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

Day 4 - Movement

Sign in to follow this  
mousetail

638 views

I didn't have a lot of time today.

009.thumb.png.55b190939ba53f3cd2d301bd82a32d58.png

010.thumb.png.02fa2f3bc4007d529cde641c6d00e575.png

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  


0 Comments


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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!