I was wondering how you handle monster spawning? I have an idea where the server sends the client the monster type and position and the client spawns the monster. But how do I make the monsters move? Also, I want certain monsters to only spawn in certain areas. Is this possible?

If you want to simulate the whole thing on the server side you should have the map data in your Extension, so that the server can calculate where to move the monster and know which areas of the map are walkable and which aren't.

Then you can have a timer/scheduler that every X milliseconds (e.g. 100-500) updates the monsters' position. Depending on the type of game you're working on, you don't necessarily need to create the whole animation on the server side. For example if the game is tile based you can send the client the destination tile for the monster and it will make a smooth animation from on tile to the other.

If the game is physics based then you will likely need to continuously update the movement vector and let the client smooth the animation out. An example of this is our Space War game, which you find in our Example packages.http://docs2x.smartfoxserver.com/ExamplesUnity/spacewar

Good question. There's no straight answer, it depends on the type of game, the type of game maps etc...In some cases you can use a mix of client and server logic to avoid too many complications, such as having a copy of the game map on the server side. Other times you may indeed need that.

For example you may just need several "spawn point" coordinates so that the server can generate the enemies, then the client will implement the movement and collision detection logic.

The next step could be to have some sort of data file (JSON, XML or similar) that provides the server with data about the map, such as a walkable areas, trigger areas etc... This way the server logic can handle paths, collisions etc...