The update I bring tons of very important changes that I’ll be relying heavily when I start world building. The work I made for this was evenly distributed between both current platforms.

  1. Collisions
  2. Server map loading
  3. Map instances


Collision types in the Map Editor

Collisions where a bit of a tough task because they have to work well with the sprites. I used Tiled, the application I’m using for the tmx (map) files, to easily specify a collision and new collision types. It’s a bit hard to explain, but basically I define a collision type has at most the size of a tile sprite(16×16), and I define the collision area. Then when I added a new layer, only for collisions, and started placing collision tiles where they are needed. The client then loads all collision types with the areas I defined on each tile. Another thing I had to consider was managing the background and foreground layers. An sprite object, such as a statue, needs to have only partial collision so that other players can walk behind it.

Additionally, and for a feel good experience I made player characters act nicely when they collision on the edges. You can see in the video when the player collides on the corner of something he is pushed to the opposite direction.

Statue collision and the foreground rendering

Server map loading

Since I’m using Java for the client and Go for the server there is unfortunately going to be a lot of duplicate code. The server is also gonna need to know about collision to avoid people hacking the client and ignoring collisions completely. So for that I had to setup the server to load the map file and all the info about collisions. At the moment it’s really only loading the map and later I’ll have to set it up.

This is how the server sees the world (printed from the terminal)

Map instances

This is something that’s very important to the game. As I’ve mentioned before, I want the game to include some level of procedural generation. For this (and other things) I need to be able to treat maps like instances. So the server will be able to hold multiple instances of a dungeon for example. At the moment I’m only generating the town and inn instances and added a special tile (a door) which allows players to jump between those 2 instances. Each instance keeps track of the entities and this offers some advantages.