Sim-Eth-ES as the base of a game

So, I’m going to be using sim-eth-es as the base on a game that I am making. There are some things that I will be doing that I’d like a bit of advice on how to go about implementing in a way that makes sense and stays true to the way sim-eth-es is designed.

The first feature I will be implementing is a before game starts chat lobby that will include simple features like a ‘ready’ button and a map selection dialog. I put together something like this using a older commit of sim-eth-basic. I just replaced the CommandConsoleState with a ChatWindowState, and messed around a bit to make it work. I was wondering what the proper way to implement this would be. In my previous implementation, the physics simulation was running in the background, just not being shown. It felt pretty messy.

Second thing I would like some thoughts on is the proper way to send a ‘map’ to the client, previously I just added a function to the GameSessionListener and used it to send a array of bytes for each ‘chunk’ of the map. The map is fairly small and not infinite, it changes but not very often so I was planning to just send delta’s when they occur and occasionally do a checksum on the map structure to ensure client and server maps are the same. The map is basically a tile map stored in a byte array, so its not anything complicated.

I guess part of my trouble is I’m not sure entirely why the code is structured the way it is (I certainly understand some of it, but not all of it, I have spent a considerable amount of time working with sim-eth-basic), so I don’t feel confident knowing the best way to add these features without turning it into a huge mess. Any advice would be appreciated.


This might be one place to start. There is usually a reason (though I can’t promise they were always good ones. :slight_smile: )

For the map, you could continue co-opting GameSession-related stuff if you like. It might make keeping up-to-date harder. The “proper” way is probably to create your own map service (with client and host pieces). That would also let you have pull methods that the client might use during initial startup to pull over some minimum set of the map before even letting the user start.

As to the chat, the service exists as soon as the connection starts and so you can slap any (or multiple) UIs on top of it. But if you mean that the physics was running because the server was hosting… then, yeah. That’s the way this game is structured. The world exists before anyone can login like if it were a persistent world or something.

If you need an application where the simulation doesn’t even start until everyone has logged in then it might be a bit tricky to restructure. I was making a demo that I could leave running 24/7 and let people login and leave as they felt like. So I didn’t really consider that other design. It’s probably something along the lines of not starting the GameSystemManager until you are ready to run the game for real.

Lol, I should have expected that :stuck_out_tongue: I’ll definitely be spending more time trying to it all out in the coming weeks.

Ok, that makes sense. Definitely gives me some direction for the changes I’ll be making, just gotta decide how to do it. Thank you for your help, and your awesome game libraries :smiley:

Why not implement the maps as entities or a single entity with a complex shape? That way when the clients loads up the scene, they will get the map upon connecting and only receieve updates along the way…?