How would you store/model this map?
Posted: Thu Apr 06, 2023 1:11 pm
I'd like to try to recreate a classic board game - Formula D. A key game mechanic on the board game is learning how to position your token (car) so you get the fast inside lane on corners. This leads to interesting game play but complex maps. Here is an example:
You can see there are multiple lanes and you can move between lanes, the lanes are offset, and when you get to the corners there are restrictions on how and where you can change lanes.
I'd use a large image to draw the board/road/cells but how would I map all the possible moves from one 'cell' to the next? Do I simply number/label each cell behind the scenes and hand code each cell's permissible neighbor into a large table? In most cases, each cell has 2 or 3 permissible neighbors.
For drawing tokens, I guess each cell would have an x/y to mark the centre of the cell and then an orientation (radians). Any token sitting on any given cell could then be drawn on the screen in the right location with the correct facing.
Now that I've typed it out - it doesn't seem that hard. I guess large tracks = a lot of hand coding but for prototyping and play-testing I could start with small tracks.
Would you do this the same way?
For those that have played the classic board game, I hope to add a lot of meta to each car and driver. Finishing races = experience = upgrades and better performances etc. I could even go cyber-punk and put forward/rear facing weapons (more meta). Drivers retire over time meaning you need new drivers so the meta is always changing. Coding bots is always a challenge. I might make a basic machine-learning algorithm so they can teach themselves to drive. I've done that before and may do that again.
Thanks for reading!
You can see there are multiple lanes and you can move between lanes, the lanes are offset, and when you get to the corners there are restrictions on how and where you can change lanes.
I'd use a large image to draw the board/road/cells but how would I map all the possible moves from one 'cell' to the next? Do I simply number/label each cell behind the scenes and hand code each cell's permissible neighbor into a large table? In most cases, each cell has 2 or 3 permissible neighbors.
For drawing tokens, I guess each cell would have an x/y to mark the centre of the cell and then an orientation (radians). Any token sitting on any given cell could then be drawn on the screen in the right location with the correct facing.
Now that I've typed it out - it doesn't seem that hard. I guess large tracks = a lot of hand coding but for prototyping and play-testing I could start with small tracks.
Would you do this the same way?
For those that have played the classic board game, I hope to add a lot of meta to each car and driver. Finishing races = experience = upgrades and better performances etc. I could even go cyber-punk and put forward/rear facing weapons (more meta). Drivers retire over time meaning you need new drivers so the meta is always changing. Coding bots is always a challenge. I might make a basic machine-learning algorithm so they can teach themselves to drive. I've done that before and may do that again.
Thanks for reading!