

OVERWORLD

The overworld is implemented as a tile-based map. Given the project's short time frame and relatively small, inexperienced team, I needed a way to design the maps and store the data without any dedicated tools.
​
My solution was to design the maps in Tiled and store the data in bitfields. This is actually more pragmatic than it sounds - it's flexible, scales, and it doesn't take very long to convert a Tiled map into engine-readable data:
1. Draw the maps in tiled.
​
2. Export to a spreadsheet (each unique tile in the tile sheet is exported as a unique integer)
​
3. Convert the spreadsheet to a text file (easier to parse in C)
​
4. Replace the integers in the text file with game data in hexadecimal (fairly easy using combination of find+replace and hand editing)
​
5. Read the hex numbers into the engine

Example of one of the data files

Explanation of hex values (`F`s are walls, for example)

Data file for same map containing warp tiles (load another room)


Values contain three pieces of data: a room index, the player's orientation when the room spawns, and the player's position when the room spawns
The map as it appears in the game

Parsing the data files - fscanf_s doesn't work correctly with 64-bit integers, so I had to read each number as a string and parse the string