You are on page 1of 16

Journal

25/04/17:

Today I have made some good progress. Yesterday, development on


the game started and the work I did yesterday was just finding
textures and character sprites.
Todays challenge was to figure out the movement and animation of
the character. Animating the character was fairly easy since I had
every single frame I needed and with the help of the Animated Sprite
node I was able to animate the character no
problem.
The harder thing to do was creating the script so the sprite could
move. I wrote that with the help of a tutorial I watched in the past
but there was one thing that I had to find out how to do on my own.
I want my sprite to follow the mouse cursor so the player can shoot
the enemies coming towards them. It was pretty hard to find the
correct script but in the end I found it and it works pretty well. There
are some things that I will have to tweak later but for now I have
made great progress. I will try to focus on animating the character
properly and to tweak the movement some more until I am happy
with what I have. After that is done I can start making levels and
programing enemies and that shouldnt be too hard since there are
many tutorials on the internet that can help me out.

Proposal discussion entry:

There is not much I can talk about really. I have to agree that the
production schedule I provided was pretty lacking and I should
improve it but I dont really know how, since all the things that
where pointed out in the video are kind of all being done in the
development of the game.
I dont know how to go about making sketches of my ideas. Im not
really good at drawing and I sure cant make a sketch in Godot.
Maybe I can take some screenshots of the progress or make a short
video showing the stage the game is in. I will have to think about
that.

02/05/17:

Well, today was eventful. Over the weekend I decided to switch


the game engine from Godot to Unity, but we cant have Unity on
the Macs at college so I had to bring my own laptop. All good right?
Wrong. My laptop has a broken battery and I have to use the charger
for it to work but I couldnt because my laptop has a European plug
and I need an adaptor for it to work. So I brought a useless piece of
junk to school for no reason. It wasnt all bad, I got to search the web
for some textures for when I start building levels for the game and I
updated my website with an explanation of why I switched to Unity.
The day wasnt completely lost. I guess thats good.

03/05/17:

Today we looked at and graded some level 2 media work from last
year. We were put in groups of two and graded a project. We graded
the project as a merit. That is honestly all I have to say. I didnt have
much time to work on the game at school or at home because some
stuff happened that prevented me from doing so.

12/05/17:

What a fun time Ive had since I havent update this journal. Ok, Im
going to go through some of the problems Ive had with the game
and how I fixed them.
First problem: the player wasnt able to pick up any guns. For this
game to work properly, the player needs to have the ability to pick
up and throw weapons. This problem had been bugging me for I
think a week if not more. I posted three threads on two different
websites and I even asked the creator of the tutorials I follow for
help. The first thread gave me little to no help on my issue (Thread in
question: https://forum.unity3d.com/threads/object-reference-not-
set-to-an-instance-of-an-object-error-can-anyone-help.469467/)
People genuinely tried to help me but being a beginner when it
comes to coding I understood almost nothing of what they said to
me. They gave me some code to put in my script and that didnt
work and eventual the thread went silent. The second thread was on
the Unity forums as well but for some reason I cant find that one. It
was basically the same as the other one, it didnt really help. The
third post was on Reddit where I got a ton of good advice that I
followed and that helped me solve my issue. (Post:
https://www.reddit.com/r/Unity2D/comments/6a71dz/beginner_ga
me_developer_in_need_of_help/). The problem was that a string of
code was incorrectly written. This line of code public string name;
was giving me a warning saying 'WeaponPickup.name' hides
inherited member 'UnityEngine.Object.name'. Use the new keyword
if hiding was intended. Apparently the program I use to write my
scripts (Mono Behavior) already has a string variable called name
which my public string name; was hiding. The problem was if I
tried to change it to something else the weapon pickup script
stopped working, so I renamed it back to name and just ignored
the warning and it works. I dont know how that warning doesnt
prevent the script from working but, who cares, it works. I should
rename it though, it is getting quite annoying. The small conversation
I had with the guy who made the tutorials didnt help either. I asked
him about an error I had already solved but I forgot to tell him that.
Now I moved on to creating enemies that the player can knock down
and kill and I finished creating the enemy AI script. The only
problems I still have is that whenever the player attacks, the sprite
kind of moves away from the legs and I dont know how to solve
that. The other problem is that the Raycast I am using to make the
player hit enemies is reaching out to a much bigger distance than
needed . This is how long the Raycast is. What
that does is if the line collides with the collider of an enemy it will
make the enemy change sprites to one of them being on the ground
or dead (if you hit them with a bat or a knife). Now I can hit them
form a distance and it look like the sprite is some sort of Jedi, which
is not good. I fill fix that once I figure out how.

14/05/17:

Yesterday and today I worked on two separate things for the game. I
fixed the Raycast issue I had yesterday, the problem was the distance
of the Raycast was set to 1.2 units and I changed it to 0.2 units. Now
it the enemies get hit only when the player is close to them, which is
what should happen. Also yesterday I created an Enemy AI script.
Now the enemies can move around and on their own and chase the
player when they see him. It didnt come without problems though.
There was this bug happening when the enemy detected the player,
when he would just run back to a certain point on the map and just
stand there and spin around like crazy. It turns out, on the line of
code responsible for the detection of the player I assigned a different
Raycast that had nothing to do with detecting the player. The
Raycast in question was there to make the enemy turn 90 degrees
whenever he hit a wall. I guess that confused the enemy every time
it detected the player and in all of its confusion, decided to become a
windmill. I fixed that and now it works just fine, the enemies chase
the player and when they get knocked down or killed, little changed
in the Enemy Attacked script disable the AI along with the collision
on the enemy sprites. I decided I build a small map as a way to
contain all the enemies from running off into the sun set, because
God knows how many sprites just ran off and I wasnt able to find
them. Good thing there is a reset button. Anyway, this map is
nothing special; its just a bunch of walls. The problem I had with it is
that the bullets and the player could pass through them. The walls
had to be set to kinematic, so they wouldnt get affected by physics.
My player was also kinematic and for some reason it was able to
pass through the walls, same with the bullets. If I were to set the
bullets and player to not be kinematic, then whenever I would shoot,
the bullets would hit players collider and make him move without
me pressing any buttons. The problem was this: I have two empty
objects that are children of the player object, an oneHandSpawn and
twoHandSpawn. They are used as references for where the bullets
should fire from if the weapon was a one handed weapon (pistol, uzi)
or a two handed weapon (shotgun, rifle). These objects were placed
inside the players collider and thus the bullets would hit the collider
and move the player along and the bullets werent able to escape. I
fixed this by moving the objects out of the players collider. Now the
bullets spawn just fine.

17/05/17:

Right now I fill like the game is getting somewhere. I managed to find
a Tile map painter add-on for Unity which allowed me to make this
test map. Its not the best, and the floor is a bit of an eye sore when
walking around the map but its a start.

I also had to resize the player because he was too small. I added
collisions to the walls after I was done making the map because
otherwise the player and the enemy would have been able to walk
straight through the walls.

When I was resizing the sprites I stumbled upon another problem.


The Raycast that is used for hit detection and the one used to make
the enemy turn when it hits a wall were too small. I had to change
the distance the raycast travels when it is used. It took some
tweaking but eventually I got it right.
The movement speed of the player and the enemy had to be
changed as well because once they were scaled up, they were
moving very slowly.
I have implemented player health, so now whenever the player is hit
by an enemy he dies and you have to press R to restart.
I havent done much else to be honest. I feel like the hardest part has
passed and now I just have to make more level design stuff.

22/05/17:

It has been a while since I updated this journal. This is what I added
to the game in that time.
I made a very simple main menu for the game, I created elevators
which transport the player to the next part of the level and I tried to
make a level exit elevator.
What the level exit elevator does is when all the enemies are dead
and the player enters its box collider that is set as a trigger, it will
load the main menu scene and thus complete the level.
The reason I said I tried is because I am getting an error that reads
as follows NullReferenceException: Object reference not set to an
instance of an object
LevelEscapeController.OnTriggerEnter2D (UnityEngine.Collider2D
other) (at Assets/Scripts/LevelEscapeController.cs:41). I dont really
know what it means but it has something to do with line 41 in the
script which is this one
MenuScreen menu = GameObject.FindGameObjectWithTag ("Menu").GetComp
onent<MenuScreen> ();
This line is supposed to help load the menu scene but for some
reason the error says that Object reference not set to an instance of
an object which leads me to believe that the MenuScreen
component was not referenced in the script, which it is not, but even
if I did reference it, it still didnt work. Right now I am waiting for a
response from the guy who made the tutorials I follow; I hope he has
a solution for this problem.
Also, this is what the main menu looks like:

Very simple, I will update it when I am finished with the rest of the
things I have to do. The text at the top is the name of the game; its
called Dr.Rocksos Cocaine Heist. Dr.Rockso is a character from an
animated TV Show called Metalocalypse.
This is pretty much it, I am having problems again (they should be
fixed soon), the main menu looks kind of rubbish and time is running
out. I hope I can finish this game in time and dont run into any more
problems along the way.

24/05/17:
Today I created a map in the Hotline Miami 2 level editor just to test
it before I replicate it in the Unity engine.

It looks pretty empty but this was made just for testing porpoises.
This is the first floor of the level, it is made up of many small rooms
and it doesnt have an absurd amount of enemies. I am not very
happy with the enemy placement. I feel like the enemies should be
more spread out and there should be multiple groups of enemies
walking around a large room. I dont really know how I could change
the placement but for now the level plays well, a bit easy I think but
what can you ask from a beginner.
The second floor is where a problem started showing up.

In the first level, that blue arrow is the floor transition. It is supposed
to transport the player to a new floor but for some reason whenever
I went through the floor transition, the player would spawn either
out of the map or too far into the room and would get shot by the
enemies immediately. I dont know what is wrong but I guess I will
find out after a quick Google search.
Now, this floor has fewer rooms than the last one and they are all
bigger. Again, I am not satisfied with the enemy placement so I will
probably fix it but for now I have to fix the transition glitch.
28/05/17:

Today I managed to finish the mechanics of the game. I went


through most of the tutorials (some of them had stuff that I wasnt
really interested in adding to my game) and I can say that the game
is pretty much bug free and it will take some tweaking to get the
enemies to stay in the room they are put in. The like to wonder
around and go to parts of the map they shouldnt be in.
The screenshot from above is the first floor of the map I made in the
level editor of Hotline Miami 2, recreated in Unity. There might be
some slight changes like the elevator from the right. It wasnt there
in the Hotline Miami map but I had to add it in order to transition the
player from one area to another. Later I will have to add the second
floor of the map and that will be level 1 done. I have 4 more levels to
go and some sprite customization to do. I would love to have that all
done this week and have until the 16th of June to write whatever else
I have to write.

29/05/17:

Today I finished customizing the player character. I have all


the main animations and I will probably add more animations for
different weapons. He is supposed to look like Dr. Rockso from
Metalocalypse and I think I made a decent job of it. I still need to add
some shading but that shouldnt take long. Once I am done with the
enemy sprites and the floor and wall textures I will start
implementing them into the game.

30/05/17:

Today I customized the floor texture and made it look like concrete.

It doesnt look exactly like concrete but I did my best with


my limited knowledge of pixel art. It looks better than the black and
white bathroom floor tiles I was using before for testing porpoises.
Today I also created all the levels that I plan on having in my game.
They were made using the Hotline Miami 2 level editor and they will
be rebuilt in the Unity Engine tomorrow because it is kind of late
right now. I would love to get some pictures of the levels in here but
they will take up like 6 pages, so instead I will leave a link to an imgur
album. Here it is: http://imgur.com/a/8AXzJ

01/06/17:

Today I remade the maps from yesterday in the Unity Engine. It was
not the easiest thing to do because the asset I used to make the map
doesnt really like to cooperate sometimes. The asset is called
TileMaster and it is good for making maps that use 2D tiles but if you
have two or more spritesheets in the tileset folder sometimes it
wont change between tilesets. For example, I had the edited tileset
(the one with the concrete floor) and the original one. When I
changed to the edited one and I wanted to paint with the new floor
tiles it decided to paint with the old one, even though I changed
tileset. All I had to do was delete the original one and my problem
was fixed. Now the next step in my journey is to add collision to the
walls. We cant have the enemy and player walk through walls.
02/06/17:

Like with every new addition to this game, a problem has appeared. I
was well into putting in the wall collisions when I got the idea to get
some enemies in the level to see how it works. Guess what, the
enemies couldnt detect the player. Like with every problem so far, I
have gone through the steps I always go through:
1) Look through the script to try to figure out what is wrong.
2) Fail to find the problem and get sidetracked by something else
that is not related to the game.
3) Go to Reddit for help.
Eventually someone responded to my post but as always, it did little
to help with my problem. They were suggesting stuff that I never
even heard of and a quick Google search left me even more baffled
as to what those people were saying since I couldnt understand a
thing. I quickly figured out that I can import a scene in the scene I
was in and steal one of the working enemies from there. The easiest
solution ever. So now I am going to start placing enemies into the
level and I will probably finish it tomorrow because it is quite late.

03/06/17:

Ok, today I solved my issue. I thought it might be a raycast problem


but that wasnt it. Someone on Reddit suggested changing the
raycast to a linecast, but I dont really know how to do that and I
think that would mean going back on a lot of work, I really dont
want to do that. So what I did was I got the first level, imported it
into the second and all I did was take one of the working enemies,
throw it in the second level and now it works. It was such a simple
solution its stupid. Now I managed to place enemies all over the
level (not random obviously) and it is looking good. It should be done
tomorrow.
04/06/17:

Today I am done with the game. It is finished, almost. I still have to


add some things, like a background for the main menu, music for all
the levels and some cutscenes to give a little context to the
character. But today I decorated the levels as best as I could. Since
the game takes place in a bunker I saw it fit to place a lot of boxes
and barrels around the place. Some boxes act as cover from enemies
and the player can hide behind them if they want. Right now I am
talking with my sister about what type of music to have in the game.
I feel like having electronic music but since the character is called Dr.
Rockso the rock and roll clown, it would seem fit to have rock and
metal as background music. I will decide eventually but right now I
am considering both.

05/06/17:

Today I decided on what music I want to have in my game. Yesterday


I was torn between electronic and rock and I have to say that I chose
to have rock music in my game. With that out of the way, I started
looking for music that would fit with the levels I have created and the
main menu. After a while, I found 6 songs that I think would fit:
Menu Music: KISS-Rock and Roll all Night
Level 1: Marilyn Manson-Killing Strangers
Level 2: Motorhead-Jack the Ripper
Level 3: ACDC-Shoot to Thrill
Level 4: Brendon Small-Dangertits (funny name I know)
Level 5: Dethklok-Thunderhorse
In the end I think all of these songs fit with their respective levels and
I am happy with my choises.
Also, today I created a Hotline Miami style cutscene at the start of
level 1. The player walks in a box collider that is set as a trigger and
that triggers the cutscene and an overlay and a picture of Dr.Rockso
pop up along with some text. I will add these at certain points in the
game but I havent figured out where I should put them yet.
06/06/17:

Another day another problem. This one is not as serious as the other
ones I had. Its about the music. You see, when the player dies you
get to restart the level but the music gets reset as well. I want the
music to keep playing even after restarting. I kind of fixed it with a
script I found which takes the game object that houses the music and
keeps it there after restarting. Basically how restarting works is
everything gets destroyed and the same scene gets loaded again.
This script I found doesnt allow the music game object to destroy
and it keeps it in the scene. The problem with that is that even after
loading the main menu or the second level the music will continue
playing. If the next scene that is loaded also has music the script will
destroy that object and keep the one from the first level. I already
posted a thread on Reddit asking for help and so far nobody has
answered my question. I will have to wait.
On another note, today I made a survey and posted it on Reddit as
well. I got 23 responses and now I just have to write about them.
Shouldnt take long.

07/06/17:

Today I got around to putting the music I chose into their respective
levels. I had to figure out a way of making the music play
continuously because every time you restart the level the music gets
reset as well. I might have talked about this at an earlier date but I
dont remember. Anyway, with the help of Reddit I wrote a script
that keeps the music going and turns it off when the player reaches
the end of the level and then it plays the menu music because every
time you finish a level you go back to the main menu. I tried to make
a transition screen but it proved to be a lot harder than I thought so I
just left it as is. I did post on the Unity forums but nobody replied.
I also added those cutscene I talked about yesterday. They are placed
at the beginning of the first level and at the beginning of the final
level. I tried to place the final cutscene at the end of level 5 but for
some reason it would get deleted automatically while I was going
through the level. It is pretty strange, I dont know what is causing it,
but I suspect it might be the fact that so much stuff spawns when
you kill an enemy. It might be causing an overload and the program
might be deleting stuff to keep the game from lagging. I dont really
know how to fix it so I will leave it like this in the final game as well. I
also added a credits scene at the end of level 5; giving credit to
everyone I used assets from. Just thought it might be a nice little
touch.

08/06/17:

Ok, today I exported the final game like 5 times. There were some
problems where some enemies would get stuck on walls and other
stuff around the levels. I fixed those problems in the editor but as
soon as I made another build, the fixes were not applied for some
reason. That leaves me with enemies that get stuck on walls. I will
have to find a solution to that. I also gave the game to one of my
friends to play and give me feedback. In his feedback message I think
he covered all of the things that are good and bad with the game,
and I believe getting more feedback would give me the same result. I
am really debating if I should post the game on Reddit to get the
game to a larger audience but I am sure I will get the same feedback I
got from my friend. I will have to think about it.

09/06/17:

Today I fixed some of the enemies that got stuck on walls. For some
reason, the raycast that fires from the enemy wasnt detecting the
wall if it hit a corner and thus the enemy would get stuck. I fixed that
by adding a square collider to certain corners and now the enemies
dont get stuck anymore. Some enemies however do collide with
each other and get stuck but it rarely happens. And even if it was a
frequent thing I have no idea how I would solve that problem
because if I were to add a small wall collider to the enemies the
raycast would hit it and the enemy would probably start spinning like
crazy, breaking them completely.
On a different note, I managed to add a Back to Menu button to
the pause menu. So in case you want to change the level you can go
back to the main menu and choose another one.

You might also like