2D/Isometric map algorithm
Posted
by
Icarus Cocksson
on Game Development
See other posts from Game Development
or by Icarus Cocksson
Published on 2012-12-19T22:27:25Z
Indexed on
2012/12/19
23:15 UTC
Read the original article
Hit count: 344
First of all, I don't have much experience on game development but I do have experience on development. I do know how to make a map, but I don't know if my solution is a normal or a hacky solution. I don't want to waste my time coding things, and realise they're utterly crap and lose my motivation.
Let's imagine the following map. (2D - top view - A square)
X: 0 to 500 Y: 0 to 500
My character currently stands at X:250,Y:400, somewhere near center of 100px above bottom and I can control him with my keyboard buttons. LEFT button does X--, UP button does Y-- etc.
This one is kid's play.
I'm asking this because I know there are some engines that automate this task. For example, games like Diablo 3 uses an engine. You can pretty much drag drop a rock to map, and it is automatically being placed here - making player unable to pass through/detect the collision. But what the engine exactly does in the background? Generates a map like mine, places a rock at the center, and checks it like:
unmovableObjects = array('50,50'); //we placed a rock at 50,50 location
if(Map.hasUnmovableObject(CurrentPlayerX, CurrentPlayerY))
{
//unable to move
}
else
{
//able to move
}
My question is: Is this how 2D/Isometric maps are being generated or there is a different and more complex logic behind them?
© Game Development or respective owner