[null, null, {"document_url": "http://dune-ii.blogspot.com/2008/", "unformatted_src": "http://bp0.blogger.com/_rHpdClQ34VY/SERg1j8A9GI/AAAAAAAAAE8/z-dRpTVjrVY/s320/lobby-server.png", "src": "http://bp0.blogger.com/_rHpdClQ34VY/SERg1j8A9GI/AAAAAAAAAE8/z-dRpTVjrVY/s320/lobby-server.png", "formatted_filename": "lobby server"}, null, null, {"document_url": "http://dune-ii.blogspot.com/2008/", "unformatted_src": "http://bp1.blogger.com/_rHpdClQ34VY/SERg1z8A9HI/AAAAAAAAAFE/a92wl2lwEOE/s320/network-play.png", "src": "http://bp1.blogger.com/_rHpdClQ34VY/SERg1z8A9HI/AAAAAAAAAFE/a92wl2lwEOE/s320/network-play.png", "formatted_filename": "network play"}, null, null, null, null, null]


Synchronisation bug in the server...

Well well, what a surprise! More updates on Dune :).

I've coded a bit on Dune in the past few days. Not an awful lot, because I had other things aswell, but I managed to code up a few bits on the train while traveling to/from college.

Units are moving again

Yes, first thing I did was re-enable the controls to move units and scroll around the map. Sure, they don't actually send stuff over the network, but units are moving, and I found a few bugs in there related to the MCV(ie, MCV can attack, but isn't supposed to). I intend to fix this first, before actually buffering the calls to order units around.

I also need to build the turn-system for the packets. I guess I should buffer up the commands first, and then actually start working on the system that collects the packets from other sources and hands down the orders to the correct player.

DebugConsole is now a real UI object

I updated the DebugConsole, because it didn't quite behave like I wanted it to behave. It was the first 'UI' control I built, and wasn't based on the later written UI system. In other words, it was a dirty hack that rendered itself to a texture and constantly drew the texture when needed. Obviously, that was faster than the current approach, but made it more difficult to make the console support features like real UI objects, such as resizes and adding of sub-controls.

I think the next iteration of the console replaces the current code with a Textfield / Textbox in which I draw the text, and a 2nd textfield / textbox to type in. That would make it much easier to add in support for scrollbars, and other various snazzy features. But, that doesn't have an awful lot of priority at the moment.

Synchronisation bug!

And of course the bug I mentioned in the title. I have a really weird bug in the Server code related to loading. It's a few days old, and I've been trying several times to patch this up, but it didn't quite work.

The problem is as follows: When I enter the NetworkPlayState, this will create a new state called NetworkLoadingState which is responsible for loading all assets and synchronising all the clients with each other so that each game starts around the same time. However, when the server is behind on loading than the client(On my machine that is. The game having the focus will load slightly faster than the background window), it will be done loading by the time all the clients are done loading too. It will see that everyone is done, and trigger the OnStartGame event, which in that case, will report that the server hasn't completed loading yet. This will mean the client will push a new NetworkLoadingState onto the stack and voila, the game will start throwing exceptions.

I have no idea yet on how I'm going to solve this. I'm considering the just ditch the current asynch approach, get rid of the events of the events and start using blocking functions instead, to make sure things will run in proper order. Alternatively, I might just build in a 1 second delay on the server side to prevent this from happening, but that would be a dirty hack I rather avoid. First step is to figure out where it actually goes wrong, and then find a way to solve the issue neatly, without fudging up my code too much.
Posted by Toolmaker at 12:46 AM 3 comments: 
Unexpected progress! 
Happy new year! (And progress updates)

Happy new year! May 2008 be a good year!

As in updates: I've managed to complete the loading of all assets and the game actually ends up being started. So, the next step is to place some units on the map and start building the turn system.

I'm not entirely sure on how I'm going to implement the turn-system yet. I intended to send a StartTurn
Posted by Toolmaker at 9:08 AM 4 comments: Link(ed) List