During this FMP project, myself and 3 others, Joseph Bowman, Alex Needham and Kyle Williams came up with an idea to create a realistic, low-poly racing game called Yōkai Racing. We decided to add a few features such as 3 total races, an AI system and have different difficulties cars on each race. My role in this project was to create and produce a functioning AI that will provide competition and a challenge to the player. This evaluation/reflection will cover all the topics in this FMP such as proposal and time management, planning, research, production and the final product.
Proposal:
When I first started this project, I created a proposal that presented mine and my team mates ideas, I also created a time management sheet that presents what work I will aim to achieve during the course of this project. Our idea was accepted and we didn't change any ideas. I utilised the time management sheet by constantly working to achieve my aims in each week. The opinion of our project through our tutors was positive and we were easily pushed onwards to starting our project.
Planning:
In order to organise all our planning within the team, we used Miro create a big mind map of all our planning. On this mind map I created 2 flowcharts on a waypoint system which I would then use in my code to produce the successful AI system. This did work quite well because I the flowcharts worked in my code however I didn't include the flowcharts for the Bezier curves system which I could have done to improve the quality of my work. It also may have helped me produce the code for the Bezier curves. I definitely should have put more work into my planning and produces more flowcharts to represent more planning into my code. If I could do my planning again I would add more flowcharts and show some explanations with the flowcharts. However I am slightly satisfied with my planning as it did help me produce my code for the AI system and assisted in me understanding how the AI system works.
Primary Research:
For my primary research, I produced a google forms document which contained a few questions about AI in different games and how players expected AI to act and what it should do. I produced 5 total questions and got 6 answers on each question. The answers I got were extremely helpful because they all pointed out what types of AI they like and what the AI should do, for example one question I conducted was "What do you expect AI to do in racing games" and most of the responses I got was to drive, brake and be able to be a challenge to the player as well as learning the course and find ways to get ahead of the player. I was able to take this information and apply it in my game, for example on race 3, the AI is much faster than the player so it has an advantage on straight roads which provides more of a challenge to the player. In total this research helped me greatly because every question enlightened me on exactly what players are looking for in games. One of the questions I asked also helped me choose which games to research, on the question where I asked "Which games have good AI?" The best answer I received was mario kart which is one of the games I researched into how it's AI works. If I could do my primary research again I would make my questions slightly more detailed and add a few more questions to cover all topics of AI that I would need such as how should an AI work? etc.
Secondary Research:
For my secondary research I looked at a few different racing games to determine how they use AI in their games. I looked at Mario kart and Forza horizon 4. Mario kart likely uses waypoints like I have used however it could use multiple and the AI will choose the best route to go, for example if there is a power-up. I could have attempted to use this system where the AI chooses where to go but it probably would not have been necessary because the tracks are not big and only have 1 route for the cars to go. Forza Horizon 4's AI was designed by looking at real life racing drivers and designing a learning system where the cars automatically know what to do based on real life drivers, they also have a considerable amount of rubber banding. This did not impact my decision making on any mechanics or systems much but it did help a little in terms of how I would want my AI to drive and some mechanics it should have. I also used a few different YouTube tutorials on the Bezier curves system and the waypoint system. These videos helped me create flowcharts and the code for the systems greatly and I couldn't have done it without them. I also learnt a lot using these videos too which will forever expand my coding knowledge. While the Bezier curves system failed I still learnt how I could use Bezier curves in the future. If I could do my secondary research again I might have looked at another AI system that I could possible have used and looked at a few different games in depth to truly understand AI fully.
Production:
I first got started on the Bezier curves system which I know now was a failure. I first looked at the video tutorial I found and created the code based on the understanding I got from the tutorial. The car did turn as smoothly as I wanted it to but the speed of it was quite unstable and unpredictable which wasn't very realistic. It looked floaty in a way. I made this system because I thought the smoothness of the curves and adjustable speed would make the car look realistic and it would be easy to create since it cannot drive off of the line. However this created a problem as the player wouldn't be able to ram the AI or knock it in any way. In conclusion with the Bezier curves, it would definitely work for something that isn't a racing game and I have learnt that, it just doesn't make the car look realistic at all in a racing game. I also received feedback from peers that the Bezier curves was too floaty and didn't look like a racing game, so I scrapped the system.
Next I made the waypoints system. I created the code using the video tutorial I made and the flowchart I made and it was successful, I managed to make a car follow each node and it turned when needed to. After completing that, I made the car brake at certain nodes which looked realistic and it matched what my goal is, to create a realistic racing game AI. I got feedback from peers and tutors that stated it looked good and positive for a racing AI. Throughout this process I learned that I can make different things happen when variables are at different values using if statements and my general knowledge of coding has significantly increased. I also learned to use OnTrigger functions correctly while I was using the SlowZone concepts.
When I completed the waypoint system, I then had to adjust the cars braking and acceleration on each track. This proved challenging because it was quite time consuming as I had to watch the car constantly. I did create a time scale functioned that sped up the game to allow me to not have to wait as long which was helpful. To create the appropriate braking and acceleration timings I coded many if statements at exact nodes for when the car should be breaking or accelerating. Overall this worked really well and its the core of how my AI works. The feedback I received on it too was quite positive.
I feel the entire system could have been better, if I could do this project again I'd look for another system to use that might be more accurate because a few problems I had with my system is that if the player bumps into the AI once, the AI may crash later or spin out. To combat that I could've created a respawning system for the AI or create a new system where the AI can drive on it own from what it can see.
Final Product:
Overall I am happy with the way the final product turns out, I achieved my goal of creating and producing a functioning AI that the player can race against that is realistic and challenging. I managed to create 3 different difficulty levels on each different car on the different races too which was also a goal. It reflects my initial idea on the project as I wanted to create an AI that the player could race against and have fun with. The final outcome of our project was a realistic, low-poly racing game with AI that has beautiful environment and fun gameplay. If I were to change anything in the project it would be a few fixes to the AI such as some issues where it doesn't turn well and is too slow in some sections or remake the entire AI system and find a better one to make. We got some feed back from a peer which is here:
In this review my AI is stated to be a "Good Motivator" which I agree with because it is good competition. However the AI in race 3 is a "hazard" because it rams the player on the first straight because it is faster than the player. This is something I would need to fix.
In Conclusion:
My final conclusion is that I'm happy with the project and I feel I have learnt a great amount as coder. I want to specialise in coding and projects like this help me greatly grow closer to that goal. I feel I have definitely become a better coder thanks to this project as I have learnt new methods and programming techniques such as referencing scripts, if and else statements, audio and using values to help me create different events such as braking and accelerating. In the future I intend to create projects like this one either with a team of developers or on my own as I have a great passion for coding and creating small games like this.