Jump to content
  • Advertisement
Sign in to follow this  
Bow_vernon

representing position WITHOUT using FLOAT

This topic is 1602 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a question. Does game programming usually represent position using integer-based type instead of float? Thing is, I've been playing this multiplayer RPG, and since the physics is simple (no jump, movement is click-based, player can only move in "valid" regions of the map) they use integer to represent the player position. (I know this by "sniffing" at the packets received :p). And somewhere I ever read a blog that suggest that we better represent position using integer, since precision will be lost on big numbers.

 

This gives a big question mark upon my head:

1. How could the position be represented by using integers? what about when we render the object? shouldn't we be using float?

2. The game I played use integer for representing position, however, the object move smoothly (unless there's lag which will make it slide), as if it's using float. How would I achieve this?

3. Now, my game is similar. Object can only move on valid pathfinding nodes, so invalid movement are never allowed. Plus there's no jumping, the physics is very simple (it's click point adventure puzzle game). Now, how would I move object using integer-based coordinate?

 

Thanks for the wisdom you are willing to share with me.

 

Share this post


Link to post
Share on other sites
Advertisement

+1

 

I think this is what supposed to be done. Well, it seems for no I'll just use floats. Whatever floats my boats :p

 

I got another question, but I think I'll just make another thread about it. Thanks Mr. Hodgman

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!