Thursday, March 30, 2023

Foundation Year Final Project: Production Week 7/Post-Production Week 1.

I've got some updates for my project this week, mainly that I've finished the Production phase of my game and it has now moved onto the Post-Production phase.

Game world.

The first thing I did during this week was fill in the remaining sections of my game's background. 


Melee.

I then got on with implementing the melee fighting portion of my game. One of the requirements was that my game should have "Two different attacks that have different damage and attack speed values." I have already implemented one type of shooting (the bullet shooting), but I had not worked on the sword code yet, which I started to do for this week. 

I started by creating a sword game object and implementing code to spawn that sword when the player is in the sword mode (activated/deactivated by pressing the Tab key/Middle Mouse button). 


I implemented a new sword script and an animation file. The animation activates as soon as the sword is instantiated in the game and it shows a sword swing. 



At the end of the animation, I have placed an event which triggers a function within the code. The function destroys the sword game object. 



Although I was able to get the sword spawning and swinging, I was not able to get it working properly with enemies at the time, as any hit would decrease the players health, not the enemies. However, I was able to fix it later. 


Enemy spawners.


Another problem I had was with enemy spawners, as the former code would spawn lots of enemies at once, which added to the every 10 seconds regardless of existing enemy amount and which slowed down the game and made it harder for the player to progress, especially slower players. 

float eSpawnerAmount = FindObjectsOfType<enemySpawner>().Length;
float enemyAmount = FindObjectsOfType<e1Movement>().Length;
if (enemyAmount <= eSpawnerAmount)
{
_spriteRenderer.color = Color.blue;
Invoke("SpawnPatrolEnemy", 1);

}
This was the code I came up with for the solution. Once the timer runs out, the game finds the amount of enemy spawners and the amount of enemies. If there are less enemies than enemy spawners, than the game changes the spawner colour to blue, waits one second and then spawns the enemies. 
void SpawnPatrolEnemy()
{
SpawnEnemiesInSpawnPoint(SpawnPoint2);
CheckHealthLevel();
}
It then reverts the enemy spawner object back to it's previous colour by checking the object's health.

Enemy effects.

I decided to experiment with enemy death effects. I did this by creating a new game object which spawns every time the player shoots the enemy down. 

I also added a particle object on the existing particle object, so that I could try to make it resemble a fire. 


In the end, I decided to comment out the code that spawns the particles, thus rendering them unusable in game. 

Game Menus.

I decided after that to work with the game's menus. Because I had done this before, implementing the buttons was very easy. The buttons link to a function that opens levels, in this case, the first level and a "How To Play" screen. The last button quits the game, although this only happens when the game is built and not in the Unity editor. 


I've noticed from the single piece feedback I had received so far for polyDungeons and the feedback from my previous games, that implementing a "How To Play" screen would be a good idea. The screen doesn't show the controls, just how to play the game. 





Post-Production Launch.

I finished the Production phase by building the 26_03_2023 version of the game onto 4 platforms, Linux, MacOS, Microsoft Windows and WebGL. I skipped Android as I didn't want to deal with the complexity of that platform and because I had not implemented shooting controllers for gamepads yet. I also supplied a feedback form in the game's Itch.io page. 

Post-Production Feedback.

After that, I started to gather feedback for my game. I provided links to 2 Discord servers, 1 of the groups was a public server whilst the other was a server for developers in Southampton. I also gathered feedback by setting up my computer space at University (which has 2 monitors) to have the game playing on the left monitor and the feedback form on the right monitor.

2 suggestions I received from the public server concerned the UI. The person who gave feedback didn't know what the icon on the top left did, and they also couldn't figure out how to close the How To Play page at first. 

Previously, the game featured an arrow image on the top left of the game to represent bullets. 


In the How To Play scene, I had also used a button to close out of the scene.


I dealt with the first bit of criticism by adding a label next to the object on the top left of the HUD. I also changed out the arrow for a silhouette of the bullet used in the game. 


For the 2nd bit of criticism, I moved the button to close the scene to be inside the background blur. 


I noticed that some reviewers didn't catch the feedback link within the Itch page, so I added a button to my Game Over and Main Menu screens, that opens a version of the feedback form that pre-fills in the version that the player is using. 



For the last 2 major changes for this week, I changed the way the sword works to get it to work with enemies.

Previously, the sword used the Box Collider 2D for collision and with the OnCollisionEnter2D function. The problem was that the enemies and players also used the same components, and because the sword spawns as a child of the player, the game treats the sword as the player, which means that when the enemy touches the player, the player loses a life. 

I resolved this by changing the Sword type to a trigger using the "Is Trigger" function (see below).  



You may also notice another change in the video. I've changed the amount of lives that the player has from 3 to 5, in response to feedback I received from the public game dev server. 

For next week, I will make a new build based on the feedback I've received so far, and I will continue to gather feedback ahead of the launch date,  April 27th. 


















Thursday, March 23, 2023

Foundation Year Final Project: Production Week 6.

The changes from Monday to today are mostly small changes but they represent improvements to the game ahead of the deadline for finishing the first level (27/03/2023). 


Changes to enemy spawner. 

I've added code to my game's enemy spawner object that implements a timer into the spawner, and once the timer variable is greater or equal to another variable (currently 10 for all spawners), then an enemy is spawn and the timer is reset. This code works as long as the enemy spawner is not shot down. 



This did present a problem, as enemies from later parts of the game would push up against each other and eventually outside the 2D Tilemap collider that I've added to the walls. I fixed this by changing the enemy movement code to move enemies using their Rigidbody2D components, rather than by their Transform components. 

Map changes.



I've expanded my game's map by adding new alleyways. The work on expanding it is still ongoing as evident by the flooring that hasn't been expanded to the new areas yet.

New Door Image. 



A minor change I've added is the addition of a new door sprite, as seen above. I made it in GIMP and I then imported it as a PNG. I've also modified the game object to remove any unnecessary children game objects. 


New Coin. 



The final change for now relates to the coin system that I've got in my game. I created another coin in GIMP, using a Diamond blue colour. I then created a new prefab-variant in Unity and replaced the default coin image with the new blue image. 

This new coin now grants the player 10 points rather than 1 point for silver coins and 2 points for gold coins. 










Monday, March 20, 2023

Foundation Year Final Project: Production Week 5.

 Here is are the major changes from the last week.


I started the week by creating new tiles for my game. 



I then started to design the level in my game. 




I set the enemies to have the same looking direction at the player, which works for now, although it will be replaced later. 

I started creating a coin object. 


I also created a silver version. 


I made a game object that gives the player points when it overlaps with the object. Both coins feature a silhouette of my character,  Wilbo.


I created a new enemy prefab that is faster and bigger than the 1st prefab. 


Finally, I revamped the shooting script to turn the game into a twin stick shooter. I created new objects within the main p1 gameObject that rotates based on the position of the mouse. The bullets then spawn at the end of the object. 


That concludes this weeks development. 












Thursday, March 9, 2023

Foundation Year Final Project: Production Week 4.

Here are some of the changes I've made to my final project:


Pause Menu.

One of the major changes this week is the introduction of a pause menu, accessible with the Esc key. I wanted to be able to pause and reset the game whenever needed and the pause menu allows for that. 





One issue that I will address soon is that, because of the way the game pauses, the player can turn but not move. Although I have introduced a variable for pausing in the necessary script, I will need to introduce it as a condition for turning. 




EnemySpawner object.

One of the additions that was suggested to me by my teacher was a GameObject in Unity, that you could shoot down and that would spawn enemies. I thought it was a good idea and so I added it into the game. I made it so that the colour of the object reflected the health of the Spawner, and when the Spawner's health dipped to below or at 0, then it would spawn a number of enemies near the location of the spawner device. 


This was fairly easy to program, as it mainly relies on the OnCollisionEnter2D function that I have used many times before in Unity. The trickiest part was the colour mechanism, as I wasn't able to directly change the colour of the sprite by using the health integer. 

Eventually, I decided to just check for the object's health and have the function update according to the number.

void CheckHealthLevel()
{
if (eSpawnerHealth > 75)
{
_spriteRenderer.color = Color.white;
}
else if (eSpawnerHealth > 50)
{
_spriteRenderer.color = Color.black;
}
else if (eSpawnerHealth > 25)
{
_spriteRenderer.color = Color.blue;
}
}






New player sprite. 

Based on user feedback from a game development Discord server, I decided to swap out the sprites that the player previously had. What I went for instead was a series of sprites from the same sprite pack, but with a red baseball cap. I also decided to swap the enemies sprite to what the player previously had. 

This sprite was better received from the server, and I agreed that I enjoyed the sprite more, so this is a permanent change. You can see the sprite changes below. 





You may also notice that there aren't any animations for the enemy yet. This is something I will address within the upcoming week. 


Player speed reduction.

Finally, I decided to place the easiest change this week as the last on this post. After gaining some feedback about player speed on a game development Discord server, I reduced the player's speed from 1.5 to 1 in the inspector.

The result is as shown below:




I decided to stick with the changes by applying it to the player prefab. 

Conclusion.

This week, I added an object for enemy spawning, I changed the player's speed and the player's sprites. 

Next week, I will fix the player's turning when the game is paused, I will also add animations to the enemy and I will work on the game's environment. 




Sunday, March 5, 2023

Foundation Year Final Project: Production Week 3.

This week, I made a number of changes to the player and to the game environment. The first change was that I fixed the players shooting direction. 
How did I fix it? I was in JetBrains Rider, editing the script when I noticed that the direction function was greyed out, which meant it was not working. I right clicked on the function and Rider suggested that I change it to a Switch case. 

I had been given some feedback from a Game Development Discord server, suggesting that I use a Switch statement, so I tried it. Rider rewrote some of the code using the Switch case. 

I also decided to rewrite the shooting position code using similar code to what is shown above. 

Both those changes, in addition to script modifications, allowed me to get the desired result above. 

However, I also decided to change the art and background. So I downloaded an asset pack on the internet and imported it into Unity.

I then used it to decorate my landscape.

The last major change this week was to add a new isometric tile map to accompany the water tile that came with the new asset pack. I coded it so that the player dies if they touch the water. 

I broke the project in a branch on Git, so I had to revert back to the main branch, taking away the progress I had made with the water. However, I as able to quickly fix it. And I also added a gameObject with a GameManager script that resets the game when the player dies.


Next week, I will work on enemy movement and shooting, and world decoration. 




My personal fashion journey... so far.

Intro.  Hello! Today I'm going to be discussing my fashion journey so far! Recently I've been getting into fashion as a personal h...