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

Brief update

Sign in to follow this  
Kylotan

323 views

I am busy with my Masters coursework this week, so have had little time for game code. However I did implement the basic pixel-based movement, which for now seems to work perfectly. The changes involved:

- Calling the movement update more often
- Calculating a direction vector from the current position to the middle of the next destination tile
- Making that vector's magnitude equal to the character's speed
- Moving the character's position according to that vector
- Checking if the character is near enough to the next node, and if so, moving the path iterator to the next node.

I can see several potential issues arising from this method. The first step will need to be tweaked to get a good update rate: I hear 30Hz mentioned quite often. I also need to look into how that interacts with the graphics, which presumably requires an interpolation/extrapolation layer for the smoothest animation. The second step is also a bit dubious since there are times when I may not be in the middle of a tile, but I hope testing will show how much of a problem that is likely to be. And the last step is a bit of a hack since I have no rigorous guarantee that the character will ever end up close enough to a given node. Currently there is nothing stopping them from arriving there but in the future I can see this breaking. Still, I will cross that bridge when I come to it.

So, I have 5 characters wandering across the map simultaneously. It's virtually an RTS already. ;) Next up is probably a better map and maybe some rudimentary editing facilities.
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.

GameDev.net 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!