Thoughts on Strategy RPG - Grid Tilemap Implementation/?


(VanderJamesHum) #1

Hey Everyone, I’ve been playing a lot of a strategy rpg called Disgea, and it’s inspired to me start a simple prototype in FP . I need help to create a basic, square tile grid, common in most strategy games. Nothing fancy at all, just something workable .

I’m thinking use Ogmo 1 to create levels, make a full grid map, then place objects etc… and somehow be able to reference each individual grid tile, have a way to select that tile, and maybe flash its debug bitmap data on/off when its selected.

Any advice on how to tackle this would be awesome


(Zachary Lewis) #2

If you want to click on the grid with a mouse, you can determine the tile clicked by taking the world position and dividing it by the height and width of the tiles. That should give you the x and y position of the tile in a Tilemap.

You can handle selection with a Point variable to store the currently selected tile location and you can flash it by overlaying a flashing sprite over the tile (by global position).


(Jesus Boadas) #3

Im doing almost the same thing but using Tiled because Ogmo is too slow in my old machine.

I capture the screen click and combine with the camera position to get the absolute position in the grid just because all tiles are the same size.


(VanderJamesHum) #4

@zachwlewis @jboadas Thanks for your help guys. I got a grid setup and working, but it didnt really work with the oblique art style im using, so i came up with something by using pixelmasks for free movement in a circle like this:

Radius size is based on the Agility stat, and the approach negates the need for lots of math for the movement and any actions.