Dec 7, 2007
Snowball Fight: Milestone I Complete
Well, I’ve completed my initial ‘base’ task for my networking project. The big concern for the project was to at least have it to where I could have two players running around simultaneously. This, alone, should easily net me an A on the project. There are still people who have yet to start on a final project. Call me an over-achiever, but I enjoy myself some game dev time. >;)
I’ll need to do some testing with somebody to make sure that what I’ve got works well from two different locations. Running it on my poor laptop isn’t netting me the results that I need, and that’s probably because when I fire up the server, I have 2 threads running. Firing up a client, nets 1 thread. Add that with two games, utilizing SDL, and you’ve got yourself a ‘lag fest’ consuming tons of system resources, even over the local host. I’m pretty confident that the code is well enough to maintain a constant stream of data back and forth, without all of this other processes going on, but we’ll see.
Essentially, my logic goes something like this.
I have a ‘PlayerPosPacket’ structure that consists of the x, y, avatarNumber, playerNumber, and the totalPlayers (maintained by the server packet) for each player connected.
With that in hand, I can easily pack up the players data points from the current player objects, send it on to the server, the server can unpack it, re-assign the new values to the objects, repack the new values (catching any updated movements), and send it back to the client with the updated structure. And the process revolves just like that.
I would post code, but the project hasn’t been turned in yet and I don’t want to violate any school rules in the rare case somebody finds this blog. I’ll save ‘code-and-show’ until the end of next week.
After I do some testing, I’ll be sitting down to write down the tasks that I want to complete by Christmas Eve, doing some housekeeping on the code base, and moving on to throwing objects.




