1 min
I started on the level builder today. Its design is based of a mix of the level deisgner, mentioned in a previous dev diary, and the particle editor I made for GEA. The foundations have started being implemented: clicking to spawn in the a new block, different blocks spawning in depending on which element in the menu was chosen, highlighting the selected block and dragging the block around the place.
A problem that I encaounted when starting the level builder was to do with vectors. I used vectors for my user interface for the level designer but this time when I tried to implment my 2D vector I wanted it kept crashes due to missing sprite when clearing the temporary vector I used to push into the 2D vector. The code I used is shown below.
for (int i = 0; i < 2; ++i)
{
ObjectVector temp_vector;
for (int j = 0; j < 1; ++j)
{
temp_vector.push_back(GameObject());
}
objects_ui.push_back(temp_vector);
temp_vector.clear();
}
I couldn’t figure out why there was a an problem with the sprite becuase the game objects in the vector weren’t being given a sprite component at this point so it shouldn’t be executing the code to delete the sprite of the game object.
I couldn’t actually figure out what was this issue with the vector but in the end I used an array of game objects instead as I realised I didn’t need a 2D vector as it would be wasting memory allocation.
Subscribe to this blog via RSS.
Low level programming dev diary 28
Text based adventure dev diary 6
Level design developer diary 3
Game engine programming dev diary 14
Audio-visual production dev diary 7
Audio-Visual Production: Particle System Mesh Spawning Issues
Posted on 20 Feb 2020Low level programming dev diary (28) Text based adventure dev diary (6) Level design developer diary (3) Post mortem (4) Ex-machina dev diary (11) Game engine programming dev diary (14) Network game dev diary (11) Audio-visual production dev diary (7)