Jump to content
  • Advertisement
  • entries
  • comments
  • views

Two Steps Forward, One Step Back.

Sign in to follow this  


In one day I managed to sort of meet my goal. The server/client code knows enough to serialize and deserialize Units and Tiles. The map renderer functions enough to keep track of a reference tile, and build 1 line of the fan of the map.

Unfortunately I've uncovered a bug. Not a bug really, but one of those design oversights that make you go "UGH!" knowing your inexperience/ignorance/suckiness just cost you a lot of time and effort.

The problem:

The server code sits in its own little area of the code base. It has a non-main main, which is called by helper code when in dedicated mode, and spawned as a thread in non-dedicated. I abstracted communication out, so both the client and server can effectively ignore what mode they're in.

Unfortunately, so did I. While they might be effectively seperate, they're not. This mainly comes into play for the event system described a few posts below. About half of the events are static "any unit that gets created, do this" events. Static events [static anything really] get shared by threads.


At least I caught it relatively early, and at least the way I was using them caused the problem to be a duplication error, not some threaded race condition issue... I'll have to sleep on the problem a little. There should be a not-so terrible way to create thread-specific static emulation if I'm too dumb or stubborn to find someone elses'.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!