Basic Level Generator

Author: Logan Audrain
While I was setting up the level generator this week, I ran into a problem with tile placement. The tiles would spawn overlapping each other quite a bit, both horizontally and vertically. The tiles are the core of the building and resource systems so if they're not spawning correctly then the whole game falls like dominoes.
It took me a while to figure out where this issue was coming from because it looked like everything should be working. All the math was correct, and yet when I actually ran the code, the tiles were spawning in one big glitchy cluster. This issue was particularly hard to fix because I couldn't figure out where the error was being caused. After a while of trying different things, it occurred to me that maybe my base values were wrong since part of the code was getting the sizing info from the meshes for the tiles. So I opened up the mesh info and sure enough, what I noticed is that the size of the tile in the mesh view was twice that of the size I was getting in code. After doing a little research I learned that the box extent for the static meshes in Unreal store a radius and not the full size, so I was effectively doing all the tile math as if the tiles were half the size that they were. After accounting for this issue, I pressed play and all the tiles were placed exactly how they were supposed to be.
Get Real-Time Skeletons
Real-Time Skeletons
| Status | In development | 
| Author | TailByte | 
| Genre | Strategy | 
| Tags | Hex Based, Indie, Medieval, rts, Singleplayer, Unreal Engine | 
More posts
- Level Generation is Very SlowJun 27, 2025
- Issues with AI 3: Return of the Electric SheepJun 27, 2025
- More Command thingsJun 27, 2025
- Widget Component Misalignment in RTS UIJun 26, 2025
- Issues with AI 2: Electric BoogalooJun 21, 2025
- Level Generator Ramp PlacementJun 20, 2025
- UI Timer TroubleJun 18, 2025
- Issues with AIJun 14, 2025
- Pause MenuJun 13, 2025
Leave a comment
Log in with itch.io to leave a comment.