Sunday, December 04, 2011

MultiPlayer


That's a screenshot of the multiplayer server running.  It's using C#/Lidgren for networking.  Here's the first AstroMiner multiplayer screenshot:


There's a lot of work that needs to be done, but 2 players can log into the same server and watch eachother fly around.  This is just the tip of a massive iceberg though.

I need to make it so the worlds are always synced up.  The enemies need to be synced.  The time of day needs to be synced.  Structures.  Water.  Pretty much every single thing.  What I'm thinking of doing is having the game always launch with a local server that runs everything.  Even when you're in single player, you'll just be connecting to your own server and pulling information from it.  That way when it comes time for you to connect to another server, I just have to point the client somewhere else.

Anyway, Lidgren was a breeze to work with.  I had some minor issues at first but it was due to my own coding.  I'd definitely recommend it if you're thinking of adding multiplayer support to your own game.

I'm going to focus on that all week and probably for the rest of the month.  It's a lot of work, but I want to get it done before I do terraforming since that's going to be one of the most complicated parts of the game.

No comments: