Room Generator 2.0

Finally, after a lot of work for levelub, i was able to work on Cards of Void again…
And in short: that is the result. (I know that you like moving thingies)

roomGif2

We had one major problem with the older version: the ground objects had to be solid to create walls because every ground simply checked if there is another solid next to it. If not so, it would generate a wall at that very place. But because solid ground would lead to many problems (pathfinding, collision checking) it had to be changed. Programmers and other people who are more intelligent than me (that includes people who can google correctly) will laugh at me now. I simply had to use „place_empty„, which checks for all objects not only solids, instead of „place_free“ whicht only checks for solids.

With that problem solved, i was able to fix that one door bug, some of you reported: Sometimes the door spawned right next to the player, which would be dumb for a dungeon you want to explore. That could happen because the floormaker turned around everytime after 30 steps. So it was possible that it made an u-turn exactly after half the way leading to an end near the player. The simple solution was to minor the steps it turns around every time it turned.

Another problem was that the door sometimes spawned nearer than another floormaker made a „secret“ passage. That is bad because we want the player to explore the dungeon and when the door can be seen too soon in the game the player would enter the boss room immediately without collecting all the secrets. So i declared the first floormaker as „floorMain“. „floorMain“ creates the main passage with the door at the end and has a chance to spawn „floorSmall“s. „floorSmalls“ generate not more than 20 floors and everytime a secret at the end. In front of the secret it creates an enemy, too, so you get challanged before getting a reward. That way we have a main passage leading to the door and different branches leading to secrets (but which one is the „floorMain“? MUHAHAHAH)

And another cool feature found it’s way into the game: We are now able to create different textures at every side of a wall. So we can make a shadow everytime a wall has free space beneath it or edges at every side of it. The result is a more 3D looking world and a better feel for space.

Feel free to ask everything about the code. Thx for reading. The next alpha is coming soon!

Dieser Beitrag wurde unter Coding veröffentlicht. Setze ein Lesezeichen auf den Permalink.

Ein Kommentar zu “Room Generator 2.0

Hinterlasse einen Kommentar