The Box is a short, experimental horror game based around the themes found in the movie "Cube". You wake up to find yourself locked up in a mysterious cube structure. Things don't quite seem normal inside the box... You must investigate and find your way out.
Short into to what I've been implementing for the past week.
Posted by smashthewindow on May 8th, 2013
This article is another article about updates I've made to the game.
I've improved the procedural generation algorithm in the game. Before, I was generating rooms based on random numbers I've received from the pseudo-random number generation algorithm. This worked "ok", but the biggest problem with it was that sometimes important rooms in the gameplay (like exit rooms, checkpoints) were spawned too close to the starting room, and the triggers and events that were generated for each room made absolutely no relation to each other at all (I would generally like to give the player some kind of hint that he/she is going the right way).
I've solved this problem by implementing the perlin noise algorithm to generated the rooms. Perlin noise algorithm is a algorithm that generated a smooth-transitioning noise values based off a seed. It's generally used for height-map generation in large scale worlds (such as Minecraft). Based from the noise created, I determine which rooms should be placed where.
Before, I had kept a reference to the trigger object in my room object. This was a quick hack to get a prototype up and running, but was severely limited in it's functionality as the room object was the only object that could access that trigger.
I've updated this system to utilize an event manager that holds a reference to all the objects that must be updated, and which invokes the appropriate callback function with the even data. With this system, I can have multiple objects getting reported on a some type of event at once.
This is also a lot more entity-oriented approach that allows the code to be very extensible.
For the alpha prototype, I've made the whole room from a single-box. This prevented me from implementing various traps and triggers I've had in my mind, and is going through the process of separating the rooms, making the floor, walls, roof, doors, and the hallways between rooms all separate. This will allow various more freedom when it comes to design.
Well, that's about it.
Instead of keeping everyone in the dark, I thought I might as well share what I've been working on.
I'll try to post as much as possible when there's various updates made to the game - however, I would rather much spend my time coding and work on the game than to write these articles.
So I guess it's time for me to go dark again - but don't be worried if there are little to no updates to the page, just remember that I'm hard at work.
So until next time, peace all.
- smashthewindow, writing this straight after he finished his AP Calc exam :D