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 Slow1 day ago
- Issues with AI 3: Return of the Electric Sheep2 days ago
- More Command things2 days ago
- Widget Component Misalignment in RTS UI2 days ago
- Issues with AI 2: Electric Boogaloo8 days ago
- Level Generator Ramp Placement8 days ago
- UI Timer Trouble10 days ago
- Issues with AI15 days ago
- Pause Menu15 days ago
Leave a comment
Log in with itch.io to leave a comment.