This update is still focused on NPC’s movement. I’ve been making tests on how the movement system should work around the limitations of a server to client connection. NOTE: The videos shown have some level of induced lag, to simulate a low connection session.

  1. Debugging
  2. AI movement

Debugging

Debug HUD

I made some updates to how I render debug lines and debug information. Specifically, I setup a specific HUD for debugging which I can enable and disable whenever I need. I used LibGDX’s GLProfiler to include information about the rendering performance, such as number of texture bindings per frame and other information. Additionally, for my development environment I’m sending server information every frame to be able to compare what the actual information will be.

AI Movement

I’ve been looking into pathfinding for a couple of weeks now. After some research I tested out a simple implementation of A* algorithm and then did more research into other pathfinding algorithms that might work better for this type of game like Theta*. I then did a different type of research, I went and played similar games to test out how they handled AI movement and collisions. I opted to put a pathfinding implementation on hold for the moment and go with a dumb follow movement from NPCs. The idea is to later combine this with different spontaneous movements per monster type to improve gameplay.

Using a simple follow mechanic I am able to guess at the current position of an entity in the client. This heavily saves data and performance. It allows for smooth and responsive movement on the client side but also introduces the possibility of a desyncif the client has a bad connection. So I introduced a sanity check that corrects an entity’s position. I still have to do further testing to see how it actually plays out with many users and varying latencies.

Before/After of a fix on a speed desync

References

What’s next?

I’m gonna keep working on this and on collisions. I believe collisions can be a big part of the gameplay, and having them work correctly and fun important. So I’m gonna be working heavily on that.

I also want to do monthly reports to visualize the time I’ve spent on development and other interesting bits of data I’ve gathered by using RescueTime. So keep a look out for that post.

Subscribe to my newsletter

Remember to subscribe to receive monthly updates about Clash Legacy!