Friday, 23 January 2015

Final Project Update - First Draft Complete!

Good afternoon, readers!

I'd like to take this opportunity to again apologise for the delays of the Final Project, but I'm happy to say that it is now about ready to be called done, at least for prototype purposes.



Allow me to offer a quick breakdown of how the game currently functions:

As you should be aware, the Final Project of this first semester was a top-down shooter incorporating elements of the previous projects including shooting, precise movement, random generation, and enemies with a simple pathfinding AI.

When the game starts, the first thing that must be done is the generation of the level, currently a maze similar to the one developed during the Second Tutorial Project.

An instance of the maze level, almost fully generated.


Once the level has been fully created, the game chooses a number of random coordinates in the maze, first spawning the Player, and then the Goal location which the player must reach. Code is in place which attempts to prevent the Goal from appearing too close to the Player's spawn point, though it isn't currently foolproof. Due to the nature of the maze, however, even when spawning within the limit set around the player's spawn point (currently a radius 1/3 of the full size of the level), walls often block it from being immediately accessible.

Once the Player and the Goal have both been spawned, the game will generate Enemy instances to populate the maze with hazards for the player. Once they're spawned, the Enemies choose a random set of coordinates and move towards them; once these coordinates are reached, they choose another set and do the same, simulating a "roaming" behaviour.

The Enemies also have a rotating Raycast attached to them which, if it comes into contact with the Player, will cause the Enemy to give chase at a higher speed, attempting to get close enough to attack the Player.


From left to right: an Enemy, the Player, and the Goal


The Player, meanwhile, can move around the maze, attempting to either evade enemies or destroy them using a simple gun mechanic which knocks them back before destroying them with the second shot. This knockback allows the Player to push back Enemies, potentially creating a window to escape through if they get cornered. If the Enemies hit the Player enough times, however, the Player dies and the game restarts, generating a new level. The Player's current health is represented by the five white boxes around them. A box will disappear every time the Player gets hit, and once they are all gone, the Player is out of health.

That's a basic rundown of the essential mechanics currently present in the game. At this time, there are a few things I would like to add if I have the time, including a victory screen displaying the Player stats from that game (such as Enemies killed, damage taken, etc.), and alternative Goals than simple locations to reach, such as killing a set number of Enemies.

There are also a few bugs which I haven't succeeded in completely removing, including one involving the Enemy pathfinding code which sometimes returns one or more Alerts when the Enemy attempts to calculate a new path before the previous one is finished, resulting in a serious performance impact. Most of the other bugs are simpler, such as the random coordinates trying to access out-of-bounds values, or some combination of the Player's Bullet's speed and hitbox size which lets it go through walls from time to time.

While I've attempted to address all of these issues, I simply either can't find an effective solution, or didn't have time to completely erase the cause. I have attempted to reduce the frequency and/or severity of each of these, to greater or lesser degrees of success.



Well, I believe that's that, readers. I will try to complete some more improvements on this project if I get the time, but I need to put some serious effort towards preparing the projects for the coming semester, as well as setting up a website where all of these games can be accessed and played. We will have to see how well that goes before I can consider returning to continue work with this project.

This weekend I'll be participating in the Global Games Jam, but after that I will be turning all of my attention to my uni projects, including this dissertation.

Until then, I hope you have a wonderful day, readers.

No comments:

Post a Comment