I have recently been working on a simple 2d demo which is basically a map with static objects, and lots creatures moving around on the map. The actual viewport can be moved around using the arrow keys as the map is much larger than the viewport. Currently the map is stored as a 2d integer array with each variable representing a tile on the map and each tile is the same size ( currently 48x48 ). Just the portion of the map which is in the viewport is rendered. Every turn each creature (which there are lots of 500+) looks around the map(2d array) and decides which is the best position for them to move.
This being said, the problem I am having is that right now my creatures move 1 map position per turn, but since the map positions are 48x48px, its not a smooth animation, but more of a jump.
1 solution I have thought of is to have all the objects (creatures) not have to live entirely in a specific tile, but be able to move in small increments. This is a problem because when it’s their turn to look around, or act on a creature around them, the computations will be much much more complicated and slow the entire thing down. I was thinking If I used this method I would need to figure out how to do some sort of ray-casting or more advanced collision detection.
2nd solution I have thought of is to only allow the creatues to be positioned on a perticular tile, but have them “transition” between tiles on each turn. My problem with this solutions is that eventually I want to give the user control of 1 of the creatures and it would be awkward and restrictive to have to move an entire tile space(like chess).
Any help with this would be greatly appretiated.