Are there any pitfalls with this approach to isometric map generation?

by Aris   Last Updated June 22, 2017 23:13 PM

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
     //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?

Tags : c++ isometric

Answers 1

One old style navi-map combines immovability/navigability with object ID - generally was a one byte bit field per map coordinate, thus a matrix (well, an array) of bytes:

0x00 = empty space
0x80 = wall
0xff = user character
0x01 = terrain/object 1
0x81 = impassable/immovable 1

etc. even more likely for character-based "graphical" maps, the actual ASCII code of the character to be displayed in each tile would be the object ID.

Nowadays, folks don't much care about how much memory these data structures use, nor how efficient the logic is, so you end up with matrices (or arrays of arrays) of objects (or structs) that have properties (fields) for every possible attribute, and methods (function pointers) for all "standard"/common actions on or by that object.

Richard Arnold Mead
Richard Arnold Mead
December 19, 2012 23:57 PM

Related Questions

Where can I find isometric wall tile assets?

Updated April 02, 2016 08:05 AM

Isometric coordinate maths not quite right

Updated January 30, 2017 14:05 PM

Using XNA to create an isometric tileset?

Updated March 21, 2016 08:05 AM

Develop Isometric Games

Updated July 06, 2018 07:13 AM