The Finish Line


Updates:

Let's start where I left off in the last log.

What is Left?

  • Paint and Dress Terrain prefabs
  • Pickup Spawners
  • Checkpoints
  • Ramps?
  • More Collectables
  • End/Win condition?
  • Start/End Screen
  • Audio
  • Menu/Pause Menu

Well as you can see, everything left to do, got done. I did not end up needing pickup spawners or checkpoints. The collectables are placed in the chunk prefabs. We did not use checkpoints, it is an all or nothing race. I added a speed boost collectable, health pick up, a jump pick up, and an End Token collectable. I added a few ramps but they are risky to use, how fun. The game has a start and an end screen with button to start and replay the game. I used PhotoShop to create the End screen and the buttons

 I used an Audio manager to take care of all the music and sound effects. I like how Unity makes it easy to build managers to control different aspects of the game. I am still learning all Unity can do but I like that nearly anything you want to do, there is a tutorial out there for it, too many sometimes.

End/Win condition, this was a problem with the infinite map generation that was used. We decided to use an End Token collectable, collect X amount you win the game. This meant I had to add an End Piece to the already spawned road and stop more road pieces being spawned after that. The Level Generator use switches to choose which road section can be placed next, i,e, a road section with an entry from the south can't be placed after a section with an exit from the west. Having an end was not part of the tutorial, I had to work out how to get the end chunk placed at the end. This took a lot of trial and error. At first, the end chunk spawned on top of the last chunk, then too far away.

I had only one entry from the South on the end Chunk. At first, I tried to rotate the end chunk to line up it's entry, but I could not get it turn the terrain. To save a lot of headache, I added 3 entries to the end chunk, this way it could be spawned on to any chunk. Is it perfect, no, but it works. I wanted to have more variety in the different chunks but only end up making two variants of the SouthToNorth chunk. I hope this gives the course enough replay ability.


Enemy AI

I added an enemy AI car that chases the player, this not only adds some action to the game it also adds to the reason you are racing to the border. It's a simple AI  that follows the player and has a chance to increase it's speed and bump into the player. The final iteration of the AI is more realistic than the first. When testing the first AI, it T-bone me out of a building and sent me flying off the map. Having the AI at the start of the game was also a problem. It did not give the player a chance before it started bumping into them. To fix this I placed the AI car in one of the Chunks with a trigger box to activate it as the player passes. This work great until the player collected a boost, then the AI would just wonder around until the chunk disappeared and fall into oblivion. So now we have 2 enemy AI cars in two chunks that destroy themselves after losing the player. Every time the player triggers them, they chase the player for one or two chunks and destroy themselves. In testing, any more than this and you could have two AI chasing the player and it was chaos.

This game was enjoyable to make, the tutorial used prefabs made of cubes and walls. I realized I could use terrains as the prefabs, I was quite pleased with this revelation. This opens up the use of this level generator for an array for many type of games and it is something I will use for future projects. 

What I learned from this :

  • It takes a lot to finish a game.
  •  Adding one change to a game, isn't as simple as it seems.
  •  Always check your inspector to makes sure all the fields have the correct object or script. This can save hours of back tracking. 
  • Learn how to use Git Bash, this saved me. After sharing the project for collaboration, I was unable to push changes from GitHub Desktop and could only push from Git Bash. And I needed to use it to revert back a commit too.
  • Turn everything into a prefab, saves so much time building levels/chunks.

This devlog thing is a good way to get your thoughts about your ideas in front of your eyes, always having them in your head and not on hard copy means you are likely to forget or change something without the whole project in mind. Meaning you change one thing only to realize later on that it won't work with something else you have in-game. Get in all down in a devlog and you don't even have to publish it. Just keep the record for yourself to look back on. Or if you think what you've learned will help someone else, Publish.



I cheated in this video to activate the final chunk, the actually need 10 of the coins to win the game.

Files

RaceForTheBorder.zip Play in browser
May 10, 2024

Leave a comment

Log in with itch.io to leave a comment.