AINT 152 – Week 10 in review (Final Week)

Week 10, the final week of the project, has finally come and the game is almost done. All of the main game play parts of the game are done I just needed to add the start, death and winning screens, some music for the menu and death screens and a how to play section to teach people have to play the game in the first place. Let’s start off with the other scenes.

Menu

The menu main screen is a flat image that I created myself in Photoshop of a wall high above a busy city at night. The buttons on the screen are very self-explanatory. The play button works by waiting for the player to click the button and when they do the button runs a script to start the first level of the game. Same as the exit button does the same but the code that that button uses terminates the program.

Over

The Game over screen is quite similar. Again I made it I Photoshop my self and just shows the main game characters hat on the floor with red eyes all around. The play again button re-runs the code to start the from the start menu and just restarts the game from the beginning and the exit button again just terminates the program.

win

Last is the winning screen which depicts dead rats all around the player’s character model. The only button here is the menu main button which again is very self-explanatory. It simple runs a line of code that starts the main menu scene and the game can either be played again from there or simple closed.

Next I added the how to play canvas to the game. This is a canvas on the main level scene that appears when the level 1 scene is loaded and it can be seen below. It simply outlines the rules for the game and how to play it.

pause

Last but not least I added music to the main menu and the death scene. For the main menu screen I wanted to use some sort of slow guitar song so I did it myself with my guitar. I did this by simply recording me playing the song on my Dictaphone, editing it in audacity and then adding it to the scene so that it plays continuously.

I wanted some slightly haunting music for the death screen so I went for some spooky synthesizer music that give the scene a slight haunting quality which is what I was going for so I’m happy with it.

No GIF but instead a YouTube video of a play through of the game. I am very happy with the end result of my game, it is a bit rough around the corners and could still use a lot of work but I find it enjoyable.

AINT 152 – Week 9 in review

Week 9

Week 9 was all about adding a few new things to the game to the game such as a new rat enemy, a pause menu for the game and some music to the main game scene. The new rat enemy is called King rat and has a much larger pool of health, does more damage at the price of moving slower than the regular rat, the pause menu will allow the player to quit the game when they please and the music in the scene is sewer sound effects to give an scary feeling to the game.

First off let’s talk about king rat. King rat as I said is a rat enemy with more heath and damage than a regular rat but with the down side of being slower and larger than the other rat meaning that it is harder for it to get around the level. The King rat also does give more score to the player when one is killed. Below is the sprite for the King rat:

Sprite afeaf
Health 100
Damage 5
Speed 2

As you can see compared to the other rats the king rat is quite a hardy enemy and will cause the player quite a problem if they manage to get stuck in a corner with one of these.

The pause menu is very simple and was added purely because without it you can’t exit the game if you’re playing it from an executable. All I had to do was add a panel to a black canvas and add a few buttons. The buttons either resume the game for the point the paused it at or just straight quit the game. Below is a picture of the pause menu and the code that goes with it:

Last I added some music to the background of the game to give the game some ambient background noise so that the feels a little more deep and immersive. Since the game is set in a sewer full of rat the music that is playing in the background is mostly noises of dripping or rats scurrying around.

I feel the game is really coming along now and next week is the next week so will be adding all the last finishing touches so that the game is more polished and ready for the final hand in. As you can see in the GIF the pause menu and the big rat are both in the game fine.ezgif-2462555844.gif

AINT 152 – Week 8 in review

Week 8 has mainly been used trying to get the power ups working which has been a little stressful but all but one are now working and they work well and are now well balanced.

I’ll start by talking about the power up that doesn’t work.  Sadly the triple shot power is not currently working. The power up is meant to work by activating 2 extra bullets spawners once the power up is collected to make it so that the user fires 3 bullets instead of 1. At the moment when your player’s collider comes in contacted with the power ups collider the 2 extra spawners activate but continually fire at a very high fire rate for the full length of the power up and when it runs out the spawners disable. After many hours of testing and changing code I can still not get the triple shot to work so I have made the decision to take it out the game for the time being as there are lots of other core features that need to be added or polished before the hand in.

Anyway on to the power ups that do work. First there is the rapid fire power up. This power increase the spawn rate for the bullets so that the fire rate of the player’s weapon increases dramatically when the power up is picked up. You can see the power up in action below.

ezgif-455049075

As you can see the fire rate is increased a lot and gives the player a better chance of cutting through those hordes of rats.

The other power up is the double damage and double point’s power up, this power up obviously makes the player do double damage the enemies and doubles the amount of points that the player gets for killing an enemy.

ezgif-2230060749

As you can see in the GIF above, the first few kills take two bullets to kill and give 10 points a kill but after the power up is picked up the enemies die after one bullet and give 20 points on death. Below you can see the main code for how the power ups work.

Power up code

AINT 152 – Week 7 in review

Week 7 was a very productive week for the game as I managed to fix the problem I was having with the A* pathing algorithm and the enemies will navigate around obstacles with ease now which makes the game a lot more enjoyable and actually now adds a large amount of challenge to the game as you now can’t hide as the rats will come and find you.

As I said in the last post the problem I was having with the A* pathing was that I had to transfer my 2D game into a 3D game space. This transfer was quite smooth until you tried to play the game and all the sprites were invisible. What was actually happening was that even though I had changed the rotation of the sprites so that they appeared on the level correctly, the animations on the sprites were still making the sprite display as if they were on the 2D game space so they were appearing side on to the camera.

The way that I fixed this was by adding a child object to the animation prefab and putting the animator itself and its sprite renderer on it so that it was on a gameobject that was meant for 3D game space. After this was done the sprites moved around the game fine and everything worked.

Capture

I have also created so power up place holders for the game. These place holders currently
don’t do anything but soon they will be working power ups in the game.

First Rate
This one increase the fire rate of the player weapon for a short amount of
time to make it easier to gun down the rat hoards.
Triple Shot

This one with be a triple shot power up which does what it says on the box. It will enable two other bullet spawners for a short amount of time after it is picked up so that the player’s weapon will fire 3 shots at a Double Damagettime instead on just one.

This one will be give the player double damage and double the points for
all kills they get for a short amount of time.

You can see in the GIF for this week that the rat goes around the wall to get to the player.

ezgif-2110059410

AINT 152 – Week 6 in review

Week six has been a difficult week as I went about trying to give my 2D rat shooter an A* pathing algorithm so that the enemies in the game wouldn’t get stuck on walls and be able to find their way around obstacles on the map to get to the player. However this didn’t prove as easy as I thought and have run into a bug which I’m currently stuck and working on.

Due to this there isn’t a huge amount to talk about the game in this blog post so I will be also be talking about an indie game that I have been playing recently and features that I like that I think would be good to have in my own game at some point but back to the pathing problem.

My game ultimately needs a type of pathing algorithm due to how tight and angular my map is, as you can see.

Sewer

The problem is that Unity3D’s pathing is only set up for 3D games and not for 2D. This is mainly because 2D games are a reasonably new thing to Unity so there is not a huge amount of customisation yet. This of course means that for me to add the pathing I would need to convert my current game from 2D to 3D. At first I thought this would be as easy as just turning the sprites and level so that they would be on the correct 3D axis but it turns out that a lot more work is needed. The animations on the enemy’s and the player’s character flip the sprite when it moves in game, so even though the sprite in the design view looks like its orientated in the correct way as soon as the game starts the sprites flip so that they are side on to the camera and since the sprites are 2D when they are on their side you can see them. So other than this no other progress has been made so far this week but I think I should be able to get the pathing working.

header

As I said earlier in the post, I’ll be talking about an indie game that I have been playing recently. This indie game is Risk of Rain and you can follow this link to check out its steam page (http://store.steampowered.com/app/248820/)

To quote the store page itself: Risk of Rain is an action platformer with roguelike elements. With permanent death as a primary feature, players will have to play their best to get as far as possible. Fight on a mysterious planet with randomly spawning enemies and bosses, either alone or with 3 friends in online co-op.’ the game has such a great mix between fast paced run and gun platformer and smart, tactical roguelike that is truly does deliver a very satisfying gaming experience.

One feature of the game is that as you kill enemies you collect cash which you can spend a few different ways. You can buy differently priced chests, donate money to totems and hope you get an item or buy items from one of the venders in the game. The items you pick up all have different ability’s that branch from firing rockets when you fir, causing bleeding damage when an enemy gets close to you or just passive healing. I think implementing something like this in my game would be really cool as the idea of a randomised item system sounds very interesting and it also varies the game play a lot so there is lots of replay ability. I would recommend this game to anyone who wants a really fun game to kill some hours on.

AINT 152 – Easter & Week 5 in review

This blog post will consist of the work that I have done over the Easter holidays that we have just had and the work that I have done in the first week back to University.

I started the work I did on thtilede game over Easter with redesigning and making a new arena for my game to take place in. To this I decided to use the program tiled to make my arena as I have used tiled for other projects such as the sprite platformed I made in AINT 151.
Tiled lets users import their own tile sets and then use them to make your own custom 2D maps for games. It uses different layers so that you can create depth and a 3 dimensional effect.

I have made my own tile set before and it was very time consuming as I’m not known for my artistic skill. So I decided to use a free one from a website called OpenGameArt (http://opengameart.org/). I decided over the Easter holiday that I was going to change the zombie enemy to a rat due to the theme of plague that I was going for, this is why I went for a sewer tile set made by user MrBeast. (His page is linked at the bottom) The tile set has all the basic tiles I would need to make my map and I really like the 16 bit art design as that is what I was trying to go for with the rest of the art assets that I was creating. Below you can see what I made with the sewer tile set.

As can be seen above, the map I decided to build ended up only really using a third of the overall tile set but I feel I used that third effectively and also by only using a small amount of the tile map and can use the other sections so create other levels to add some diversity to the level design.

As I said early I decided to go with a rat design for the enemy in the game due to the theme of plague I was going with so I made my own rat sprite to go as an enemy. Below is the end product that I came up with.

Rat

The sprite is longer than the player sprite and a little bit wider so that they have the effect of looking like giant rats. However making the rats like this may have caused so problems with the enemy’s pathing. Due to the fact there are a lot of walls in the game the rats tend to just get stuck as their pathing automatically makes them walk towards the player as the crow flies. I will have to think about adding some sort of advanced path such as A* pathing so that the rats can get around the walls in the game so they can get to the player without getting stuck.

There is no gif for this week as there was no huge game play differences due to the fact that I have not yet implemented a lot of this stuff yet and that will be done next

AINT 152 – Week 4 in review

The 4th week of AINT 152 was the last week that we would be tutored through the work and be given our tutorials to work though as after this last week our games would be in a state where they worked and were ready to be completed by our self’s. This week we finished off our player animations and added the player sound affects to the game. We also created a zombie spawner using the zombie prefab we made in week 2.

I should start out by saying that I have now changed the player’s character to the Plague doctor which I said I would in the last post. Below you can see the sprite I have made. You can see there is only two frames of animation at the moment as I just wanted to get the sprite into the game and working. I will be continuing to edit this sprite and then do sprites for the zombies too to go with my theme.

Hero

So the first thing we did in this session was add sounds when the player fires their gun. As I was going for a much more magic based gun system I went for the sound of a spell being fired from a staff as my main character has a staff as his primary weapon. Once I had selected the sound affect that I wanted I simply dragged the sound affect onto the hero game object. Once this is done the character then has the sound affect but it has to be triggered by something. This is why we needed the player behaviour script.

player b

Above is the script that we use to determine when to play the firing animation for the player and when to play the sound for the weapon. As you can see when the player gives the input of the mouse button being held down the isFiring bool is set to true so the firing animation is played at this time. Otherwise when the mouse button is up and there for not being pressed the bool is set back to false and the animation and sound stops. This code also lets the player take damage by using the same code as used in the zombie behaviour script.

Also in this session we made a spawner for the zombies so that they would automatically be spawned into the game at a certain location. This was done by creating a new game object called spawner and then writing this code for it.

spawner

In the public void Spawn you can see instantiate is used to clone the prefab of the zombie that is being spawned then the position and the rotation it is spawned at. We also used another script that set how fast zombies are spawned. This same script also makes the spawn start spawning the zombies when the game starts and continues to do so. We also made another script that would grant the player points every time they killed a zombie which will later display on the UI.

updated

The spawner would now spawn zombies but the zombies that would spawn in needed to have reference to the player so that they would target the player, look in their direction at all times and then also do damage to the player when they collided. The highlighted code below is what was added for this. After this we added so UI script so that the heath of the player and the current score of the player would appear on the top left hand side of the screen.

Here is what my game looks like after the 4th and final session. As you can see my custom sprites animation works fine and the zombies now spawn in and I can get score and lose health. I will now continue the game on my own until it is completed.

giphy

AINT 152 – Week 3 in review

In the 3rd week’s session we looked at animation in Unity. We worked on setting up a custom animation for when a zombie dies and then prefabbing that animation for multiple on trigger use and also started work on an animation for the player’s weapon firing.

The first thing that we did was make the animation for the zombie’s death. To do this we first has to open the sprite editor so we could slice the sprite into separate parts so they can be played in order to appear like they are moving.

This slideshow requires JavaScript.

In the pictures above you can see the process of slicing the sprite into the separate parts. As there was 8 different frames of the animation I split the sprite into 8 columns and 1 row so that each part of the animation would be its own picture then as you can see each frame of the animation has a black box around it to signify that it is a separate frame of the sprite.

Pics

As you can see after this is done you end up with 8 different sprites which correspond to the different frames of the animation we are making. After this we opened the animation view and added the 8 frames. Once these were in we changed the sample to 24 so that the animation would play out at 24 FPS (Frames Per Second).

Ani

After this we added so code so that the animation would destroy itself after the animation was complete. We had to make sure that the destroy timer was precisely the right time so that it wouldn’t cut off or play extra of the animation before destroying it. We also made a prefab of the explosion to use with the zombie behavior script so that when the zombie game object is destroyed the animation with play.

The other animation we started to set up was for the animation of the played shooting their weapon. For this we had to slice the sprite again to get a sprite of the player’s character in an idle state and a sprite of the character in a firing state. This is so that as the player fires their weapon the character will switch between an idle and firing state in an animation. So we made to different animation for each state and switched between using the animator view.

Player ni

This basically works by using a bool variable t check if an animation is playing or not. So say if the idle animation is playing and then the player starts to fire the gun then the idle animation’s bool would be set to false which would in turn set the player firing animation to true, there for playing the firing animation. This animation requires so code to work which we will be doing next week so this is all for this week.

Here is what the game looks like so fair. As can be seen the animation for the zombie when it dies now appears but the firing animation is still in the works. I have decided on a lovecraftian theme as I am a huge fan of Lovecraft’s works. My main character will be a plague doctor which I have started to create and have ideas for a level setting and new type of enemy similar to a witch.

57042e977f789404900104

AINT 152 – Week 2 in review

This week in AINT 152 carried on with the basic development of our game. This time we moved away from the basic play controls and instead made the bullet that the player would be shooting and game the player the ability to fire said bullet and also we created the enemy of the game, the zombie and made it move towards the player, always face the player and take damage when a bullet hit the zombie.

We started put by adding a bullet game object to the game and then saving that object as a prefab. If you do not know what a prefab is a prefab is basically a game object that’s isn’t placed on to the games scene itself but is spawned on to the scene by something else. This can be done simple code to tell the game when to spawn a prefab or by input from the player like my bullet is. In my game prefabs will be used for a few different things. The zombies in the game will also end up being prefabs so they can be spawned at different points throughout the game. After the prefab is made you can still spawn in the original game object to change the setting of the prefab. You must however press the apply button at the top right hand corner of the inspector when this is done or it will only save those settings to the game object you are editing and not all of the prefab objects.

bullet

Above is the code that is used to make the player shoot the bullet. As you can see when the player gives and input into the game, here it is a left mouse click, the bullet is fired and the bullet prefab is created and spawned.

The main enemy of the game, the zombie, was imported just like the players character was. The zombie sprite was made into a game object and then setting were Zombiechanged and scripts were written to make the zombie move and face in the direction that was wanted and also take damage when a bullet fired by the player makes contact with it.

Here is the zombie behavior script and the bullet hit script that gives the zombie its health, controls how it is hurt and what happens when a bullet makes contact with a zombie. As can be seen by the zombie behavior script the zombie’s initial health is set by the int health. Then the damage that the zombie takes is calculated by the public void TakeDamage. This subtracts the damage dealt to the zombie from the zombie’s health and then when the zombie’s health becomes equal to or less than 0 the zombie game object is destroyed making the zombie disappear.

Capture

The Bullet hit script shown here is what gives the bullet its damage. The damage is set by the int damage and is used with the void OnTriggerEnter2D. What happens here is that when a bullet comes into contact with a collider which the zombie has then damage will be taken and subtracted from the zombie’s health.

Bullet hit

There is also the two scripts that control the zombie moving towards the player and also to make the zombie always look towards the player and they can be seen below.

This slideshow requires JavaScript.

Here is a short GIF showing what my game currently looks like and how it works at the moment. I am really looking forward to continuing with the development of the game and am thinking about changing the theme of the game so that I can add my own art and sound assets. I will also be making the zombie a prefab so that it can be spawned into the game without having to be already on the scene.

57001cdc1cc58343376964.gif

 

 

 

AINT 152 – Week 1 in review

My first week on the AINT 152 was really exciting and really started to get down to why I wanted to come to university. This is because we started some real games development using the Unity3D engine. The game we were developing was a 2D top down zombie shooter that had been designed by our lecturer, James.

We started off by getting used to the interface of unity as not all of us, including me, had used Unity before. The software is really quite easy to get your head around and has a nice layout and style. We made our first scene and then used one of the art assets given to us to make a floor that the player would play the level on. We then added so collision to the edges of the arena so nothing could level the scene. After the scene had been constructed we then worked through setting up the player and allowing him to move around by getting input from the keyboard and mouse. Using the w,a,s,d keys the player could move forward, back, left and right and the players character would rotate to face the players mouse curser.

56fc184c78b25354507978

Here is a GIF showing how my game currently operates. As you can see the player moves around the scene and turns to face the mouse. The top down camera also follows the player around the scene but at quite a slow pace. This gives the appearance that the player it very floaty and just drifts around the scene, so that is something that i will be changing so that the camera has a much tighter grip on the player so the player feels they have better control of their character.

After this we were really done for that session but as I had got the hang of it quite fast I was done quite a bit before the session was due to end so I did some research into games similar to the one we were making.

The first game I looked at was a game called HELLDRIVERS.

This game is a twin stick shooter just like my game which is set in space. There is a hub world which you travel to the different levels in the game. I like this idea as it gives the player some down time in-between levels and also allows the player to decide which level they would like to play next. There is also a very large selection of weapons in the game giving the player lots of variety in their play styles so they can play how they want to play.  

I like the idea of a hub world as it gives the player the freedom to pick which levels they want to play. I may think about trying to implement this into my game but it may not happen due to the fact it is a reasonably large sized attachment to the game. Also I would like to have a few different weapons so the players don’t get bored and so there is some verity.

The other game I looked at Gunnheim.

Gunnheim was again another twin stick shooter in which you played as Vikings running around with large swords and guns and decimate anything in your path. The game uses very bright colour schemes and has a focus on the game being fast paced and gory. Every time and enemy is killed a large amount of blood is sprayed all over the environment and is left there while the game continues leaving you with battlefield covered in the blood of your enemy’s.

I really like the gore in Gunnheim and I would like to put that in my game as I think it adds a lot more atmosphere to the game. I think I will try to add something similar to my game once I am at that point. I’m really looking forward to continuing with the unit and the project I am making.