Advertisement Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Day 4 - Movement

Sign in to follow this  


I didn't have a lot of time today.



It is actually possible move your units now, and after some unexpected difficulties, it is impossible to move your opponents units. The target commands you can see in the terminal are of the form <unit id> <target X> <target Y> <elbow point time> <end point time>. This way, both players will see the units reach both the elbow point and the end point at the same time. In between start point and the elbow, there might be a slight difference since they start at a slightly different time. However, this distance is horizontal so it should be a lot less likely that something significant like combat happens in that time. If it does, the difference in time should be so minor a different outcome in combat is unlikely, and if it happens I will send a death event which will probably mean both combatants die. A noble sacrifice for the greatest virtue of all: to keep the games in sync.

The combat will work mostly the same for melee and ranged: When some kind of timer reaches 0, they will all look for enemies within range, and deal damage to random one. The range will be a lot higher for ranged then melee, and ranged range also get boosted when standing on towers. Both melee and ranged enemies will prefer to attack enemies of there own type, though I might skip that since I see no easy way to implement that. My framerate is already quite low, and the whole n^2 operation of computing the distances between all units will probably be quite significant. A framerate spike could potentially cause fast units to teleport through walls, and since the framerate might be quite different on both computers, that could cause the games to go out of sync. The whole double serverless simulation system is bound to cause a lot of unfixable bugs when the game rules get more complicated.

Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!