Filed Under: Journal - Development - Game Development
Well, we're now into 2003 and it would seem by all external accounts that I've once again stopped working. Alas my pets... I have not.
I've been busy, busy. There have been so many additions and changes to the library I don't even know where to start describing them. First I'll say that I've left OpenGL for a little while to attend to some other engine matters that need attention. The largest target of that attention has been the networking code.
After a few days of work I think I have it nailed down pretty good. It should be interesting to see how things hold out under any pressure, but for the time being everything seems nice and stable.
I've been putting lots of time into design for the actual GAME project and I'm getting pretty excited about it. I won't go too far into things for now. Soon enough there'll be a whole section of this site devoted to it, so no point in duplicating work. For the moment I'll first be focusing on smaller benchmarks. The first will be a simple multi-client chat server. It's going to be boring as hell to make, but it's a good way to test the networking code as well as create an arena for the construction of some character capturing routines.
After the chat server and client are done, a pong game is in the works. It's dumb and I hate to waste the time doing it, but I think it will be critical in shaking out any bugs in the networking layer, the graphics code, interface... everything. Most importantly I need to shake out some of the bugs floating around in me. I have many (at this point, while untested) brilliant ideas about how to arrange game structures and client interfaces so that networking, AI and local interfaces will be 100% abstracted. It should make for nice clean development.
To be honest though, I'm beginning to worry a little bit about the expense of some of these ideas. Data spends a lot of time just moving around and changing types. I'm wondering how that's going to play out when it comes down to a real game environment. Especially in a large scale RPG where lots of things are happening all the time. I know I constantly underestimate the processors abilities, but it still feels like a lot of work is going on that shouldn't be.
Well, regardless of all these wonderful issues - the largest issue at hand for me right now is to get to bed. This journal was started around 3:30 or so, but it's now 6:30 - and I have a very long day with a lot of work to be done tomorrow. I'm hopeful that I can have SOME kind of functional chat code working by the end of the weekend.
We shall see.
As a last note, I'm going to leave behind two examples of the new networking code. The first requests google's homepage! Of course, it gets a redirect to the www.google.ca site, but it still completes the request perfectly. That's right. Five lines of code is all it takes.
This example shows all that needs to be done to create a TCP server and client, connect them together and send "Hello?", then respond with "Hi!".
The HTTP line endings should be \r\n, not \n\r. For some reason I needed a good 15 seconds staring at that line to find out what was wrong about it :).
Some random comments:
Are these blocking sockets? They are not usually very good for games, unless you like threads (but then you would be crazy :)).
Did you consider making cNetworkMessage allocate buffers as needed instead of requiring the user to specify a size at construction?
About networking, AI and local interfaces being 100% abstracted, I'd recommend not going overboard. Some AIs need to cheat to be fun, and some networked games need to do client-side prediction/interpolation to feel responsive. This might not apply to a turn-based RPG though, I don't know.
Well that's it. Good luck with all that!