10 Jan, 2010, elanthis wrote in the 21st comment:
Votes: 0
Yeah, I'm wordy and I ramble a lot, I get it. :p

And Twisol, there are plenty of books to pick up if you're really interested in software design (especially game software design), and you should most definitely peruse sites like gamasutra and gamedev. A lot of their content is focused on the big mass-market 3D games of today, but most of the stuff not directly related to graphics and physics is equally applicable to text games. You'll get a lot more going straight to the source than you will out of my rambling, diluted, tldr-inspiring re-hashes. ;) And there's always DigiPen…
10 Jan, 2010, donky wrote in the 22nd comment:
Votes: 0
Writing the database access/tables/stored procedures for features, is in my experience, the most tedious part of game programming. If this can be made to go away, then the act of programming becomes a lot more fun for me at least. I've been considering rewriting my data layer for a while, and this thread has helped me reach an idea of what might suit my needs.

The plan

The idea is that I do not want to write SQL during the development process, while systems are still being developed and prototyped. I do not want to have to special dependencies, adding bother like installing and administrating a database. I just want to be able to sort persisted data into tables, and store key/value entry based rows in them.

Keys that are no longer used should be automatically identifiable and able to be obsoleted with nominal effort. When the systems are stable enough that they are not likely to change, and therefore the tables used are pretty much fixed, it should be no additional work to transition to a database backend and gain the power of SQL queries, and whatever else the database in question might provide.

Now I am aware that some aspects of this may resemble features of existing solutions, but the likelihood of those solutions being acceptable to me is non-existent.

Sample usage

The following code would first look up the "users" table. If it did not exist, it would create it. Then it would try and look up the "name" key, simply iterating through the rows until it found one with the given value "donky". If the field "name" did not exist on the "users" table, then the access of this non-existent field would be noted and tracked.

row = sorrows.data.GetTable("users").LookupRow("name", "donky")
The access of the "passwordHash" field in the row, returns the value if the field exists. We enter in the table metadata that this general field had a successful read access recording the timestamp. If the field does not exist, then a suitable exception occurs.

if newPasswordHash != row.passwordHash:
# Check the entered password is correct…
The login password was correct, so we want to actually log the user in. One part of this is recording when they last logged in. If the "lastLoginTime" field exists, we simply store a new value in it, again storing in the table metadata that this general field had a successful write access recording the timestamp. If it does not exist, it gets added as a new field in the table metadata, and the value stored as mentioned in the last sentence.

row.lastLoginTime = time.time()
At this point the system is usable as a simple datastore and is easily implementable. The only additional functionality it needs is introspection, so that undiscovered incorrect usage can be observed. For instance, by listing table fields in order of least recent access, obsolete fields are highlighted.

Implementation requirements

The end goal is to have a system that is simple to use, but can have its initial flat file backend switched out for a database if it ever reaches that stage. So, the implementation should factor this in.

The speed of the data layer is not really important. If it turns out that the simple iteration over rows ever becomes a problem, then automatic addition of dictionaries mapping row lookup for column values is a trivial extension.

Irrelevant (for now) future directions

Given the simple tracked metadata about the existing tables and the columns present within them, it should be possible to generate the SQL database schema. It should even be possible to automatically generate things like stored procedures, if a row lookup is followed by sequential use of a set of columns, then automatic creation and usage of stored procedures should be trivial.
10 Jan, 2010, Twisol wrote in the 23rd comment:
Votes: 0
(This was directed at elanthis, but donky cut in before I could submit. :P)

I've been perusing GameDev.net for quite a while (I'm Twisol there, too), but oddly enough I didn't think to check there. It's probably because my project is a GUI toolkit, not a game. But sure enough, with a quick search at GDnet, I found a couple decent articles to check out. Figures.

Books… well, I did get a tonna B&N giftcards for Christmas. :P Digipen I considered for a while, but a blog post by Josh Petrie (jpetrie on GDnet) made me think a bit more about what I wanted out of it, and I opted to try for a more general university (and I'm hoping to get in this fall).
10 Jan, 2010, David Haley wrote in the 24th comment:
Votes: 0
Donky, you might want to take a look at the Shelve library if you haven't seen it already. It seems that you're reinventing the wheel to some extent, although you might have subtly different requirements. Bit the Shelve library can do all kinds of nifty things like swapping out the backend for a database, Python dict, etc.
10 Jan, 2010, David Haley wrote in the 25th comment:
Votes: 0
Twisol said:
Books…

In case the recommendation got lost, I extremely strongly recommend the book 'Design Patterns' – it's a very good catalog of design patterns, and sometimes, although the concepts aren't new, having names to put on top of them makes thinking about them – and communicating them to others – an easier task.
10 Jan, 2010, Twisol wrote in the 26th comment:
Votes: 0
I got a Design Patterns book for Java (although it was written by the Head First team), and I've read the entries on Wikipedia for the classic patterns. Maybe I should read over them again… Forgive me for not knowing, but is there anything the Design Patterns book includes that I can't find elsewhere?
10 Jan, 2010, Sorressean wrote in the 27th comment:
Votes: 0
Being self-taught, I would love to find some sort of book/resource that would explain these ideas. Just the other day I found out about circular buffers and had a great use for them in another project. Is there some sort of resource that gives info about data structures, design ideas, etc? Finding books has been especially hard for me, especially on things like data structures and algorithems, because I'm blind, so I'm not going to be looking at the graphics that litter the book of graphs and equasions and such, so I'm sort of stuck to what I can find online or get in a format that's easily readable. This said, recommendations would be amazing. :)
10 Jan, 2010, David Haley wrote in the 28th comment:
Votes: 0
Twisol said:
Forgive me for not knowing, but is there anything the Design Patterns book includes that I can't find elsewhere?

Not being aware of everything that is out there, this is a difficult question to answer. :wink:
It's probably all out there somewhere, but the book presents a nice collection of things all in one place, and will (obviously) go into more depth on each pattern than the wikipedia articles.

Sorressean said:
Is there some sort of resource that gives info about data structures, design ideas, etc?

I don't really know any one particular place that imparts all knowledge; for me it was certainly a time-consuming process. School was incredibly valuable in getting a high-concentrated, high-signal, low-noise collection of useful things. I have used books as complements to other learning or as reference material; most of my learning was by doing. (In retrospect, this approach probably made me waste several years as I was making dumb mistakes that could have been avoided had I been wiser.)
10 Jan, 2010, elanthis wrote in the 29th comment:
Votes: 0
Quote
Digipen I considered for a while, but a blog post by Josh Petrie (jpetrie on GDnet) made me think a bit more about what I wanted out of it, and I opted to try for a more general university (and I'm hoping to get in this fall).


I'm not going to say you made the wrong choice; I have no idea what your criteria are, and DigiPen may be entirely wrong for you. I just want to note that jpetrie graduated from DigiPen a few years ago, and the school has evolved a lot since. In particular, the notion that the teachers are more interested in teaching existing industry techniques or do not focus heavily on the rest of the CS curriculum is not at all a solid claim today. I have seen very much the opposite. Many of jpetrie's other points are still totally accurate, however. I myself would not have considered going to DigiPen just a few years ago, but the DigiPen today I am very happy with. Still, DigiPen is not for everyone and there are certainly a number of solid advantages to going to a (good) general university and getting a CS degree there. :)

If you have the drive to work and learn on your own and get a lot of real-world practice and experience then you will do spectacularly at ANY school. :)
10 Jan, 2010, donky wrote in the 30th comment:
Votes: 0
David Haley said:
Donky, you might want to take a look at the Shelve library if you haven't seen it already. It seems that you're reinventing the wheel to some extent, although you might have subtly different requirements. Bit the Shelve library can do all kinds of nifty things like swapping out the backend for a database, Python dict, etc.


Ah.. but adopting existing wheel designs often results in the installation of a black box that slots into place, not quite fitting just right despite requiring custom mountings. By inventing my own wheel, it gets shaped to suit the existing mountings, and often the mountings and anything close to them can be redesigned with the wheel as a better composite at any time down the line.

Here's the implementation I cranked out in 20 minutes. Once I add the persistence support, it should almost drop right in and replace the older system.
10 Jan, 2010, David Haley wrote in the 31st comment:
Votes: 0
elanthis said:
If you have the drive to work and learn on your own and get a lot of real-world practice and experience then you will do spectacularly at ANY school. :)

I think that this is easily one of the most overlooked points when considering schools. The "better" schools make it easier to establish that you probably know what you're doing when you have no experience, but (especially in the USA) having real experience to point to is just as valuable if not more valuable than your pedigree. (Of course, it depends on what exactly you're trying to do; there are always exceptions.)
10 Jan, 2010, Twisol wrote in the 32nd comment:
Votes: 0
I've been working/learning on my own on programming projects since my preteen years. I'd like to think I'm doing fairly well, all things considered. ;)

Thanks for the tips. I'll let the thread get back on track now. :cool:
10 Jan, 2010, donky wrote in the 33rd comment:
Votes: 0
Sorressean said:
Being self-taught, I would love to find some sort of book/resource that would explain these ideas. Just the other day I found out about circular buffers and had a great use for them in another project. Is there some sort of resource that gives info about data structures, design ideas, etc? Finding books has been especially hard for me, especially on things like data structures and algorithems, because I'm blind, so I'm not going to be looking at the graphics that litter the book of graphs and equasions and such, so I'm sort of stuck to what I can find online or get in a format that's easily readable. This said, recommendations would be amazing. :)


In my experience and it may work differently for others, it isn't as simple as reading a book or resource and having it impart knowledge like some mystical Dungeons & Dragons tome of knowledge. What it comes down to for me, is that the need for functionality often causes the realisation how important some incidental knowledge you have is. Reading your reference to circular lists causes me to bore you with this story.. I was working with the boost C++ framework, and had an specific functionality I had to implement. Circular lists came to mind as the exact fit, and do a google for circular lists and boost and find that boost offers an implementation. However, the company codebase shared between offices provided an older version of boost without the circular list implementation, so I needed to write my own. Then a month later, we ended up throwing away that the system that circular list implementation was in and went with another approach..

A lot of the information I have read that became useful in game development, I read in passing. Perhaps I read an article in someone's blog. Perhaps it was something buried in a textbook. It might have been a post in a forum. I read a lot of different things, from a lot of different places, and considered it worth taking time out from my workday to do so. But of course, the internet is a waste of time, and it is easy to get distracted and sit there reading lots of worthless stuff.

One of the best programmers I ever worked with was self taught. Of course, he went to a high faluting university, but what made him especially appealing as a programmer was all the work he did on his own initiative in his own time. He found a range of interesting modding projects, and did work that was of value to others. When he came to apply for jobs, this work was what made him especially stand out as a possible employee.
10 Jan, 2010, David Haley wrote in the 34th comment:
Votes: 0
Twisol said:
I've been working/learning on my own on programming projects since my preteen years. I'd like to think I'm doing fairly well, all things considered. ;)

Thanks for the tips. I'll let the thread get back on track now. :cool:

Well, ok. I started when I was about 6 years old, and learned more at ages 19-23 than I did ages 6-19. Don't discount the value of getting a formal education. :wink: There's a difference between writing and doing a bunch of stuff, and having a deep understanding of what you're doing. It's not a question of pride, so you shouldn't think of it as a question of how much you already know. Everybody is always learning. Thinking that one already has the answers is just limiting one's own potential for growth.
10 Jan, 2010, Twisol wrote in the 35th comment:
Votes: 0
@David Haley: Right, I was just responding to your remark about having real experience. I'm definitely going to college - I very much want to - but I enjoy my own personal projects nonetheless, and I've learned quite a lot in doing so.

EDIT: I've learned more in the past two/three years about programming than I have in all the years preceding them, so I understand the sentiment there. ;)
10 Jan, 2010, elanthis wrote in the 36th comment:
Votes: 0
That's why I mentioned that if you work on personal projects during university, take them up to the professors and ask for review and criticism. Work with peers. If you work in isolation you won't learn much, even though you might convince yourself you're learning a lot. ;)
20.0/36