Archived

This topic is now archived and is closed to further replies.

Need Help With Scrolling And NPC Movement

This topic is 5575 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

Hello: Would like to request some help with NPCs movement and scrolling. I have a 2D tile Rpg that scrolls/moves the map based on hero position. Characters have a speed stat that is used to update their frames and to move one step(4 steps to reach next tile at 8 pixels per step). When NPCs are added to the map and have the same speed as the hero everything is fine, but when their speed stat is changed to be faster or slower than the hero their animation becomes "jumpy". i.e. -- its hard to explain clearly, but when the hero moves the camera follows hence it apears to move the NPCs and world. Then when the NPC steps he appears to be "jumpy". example(characters move 8 pixels a step not 1 tile): 000000000000 000000000N00 00000H000000 000000000000 000000000000 hero moves down: 000000000000 000000000N00 000000000000 00000H000000 000000000000 camera moves down: 000000000N00 000000000000 00000H000000 000000000000 000000000000 npc moves down: 000000000000 000000000N00 00000H000000 000000000000 000000000000 When this happens in the game loop it happens fast enough(4 times for each movement) that the NPCs animation appears to be jumpy. Would really appreciate any information anyone could give me to help out on this. Including ways to handle 2D tile RPGs with NPCs(moving at different speeds/directions) and Scrolling. I would prefer some help in theory and not code examples, I learn/understand easier from theory, but any help would be awesome. Thanks,

Share this post


Link to post
Share on other sites
How are you doing your scrolling? It sounds like you''re just shifting the background (NPC and all) before you move your NPC and redraw. Or possibly you''re not calculating your world, camera and screen coords properly.

How exactly is your update and rendering organised?

Share this post


Link to post
Share on other sites