quantm_project3 - Unity Game

You want to try the game out yourself? You can download it here: Download

 
Our third project was an unity game. It could be a clone, a reinterpretation of an existing game or a completely new one. For this project, the main focus was the code and a functioning game. The looks had to be coherent but, other than that, didn't have a real impact on the grades. Or so we have been told^^. It also hardly could be to minimal, since we are designers, not programmers, though a pong clone would have. You would have needed a couple of power ups. I think you get the idea. Start screen and Game-Over Screen with a functioning High Score Ranking was a must. Since I wanted to do as little programming as possible, I decided to use the Unity physics and pretty soon I had a ragdoll pinball in mind. Well, that idea pretty much backfired. It worked perfectly in my imagination, since in real life you do need nothing but physics for that, but virtual physics are only simulated and often objects react in amazing ways you'd never have imagined, but not as they physically should. Or they don't react at all. I pretty soon gave up the idea of a ragdoll pinball since it was hard enough to make a classic pinball work. Ragdolls are fun and really cool, but you just can't controll their reaction to your input...
The main issue is the collision detection. The game engine has her own frames per second (don't confuse that with the fps output of the graficscard). It is a fixed rate, so the gameplay on more potent computers is not faster, for example. But that also means, that everything that happens in-between those engine frames, is ignored. If the ball moves to fast, the possibility is pretty high, that it goes through the other objects (and it still happens from time to time).
But let's go through the single features and explain how my solutions work.

Let's start with the menu:


The options in the start-screen should speak for themselves, in the game-screen you can go back to the start-screen (Game-Menu)or forth to the game-over-screen (Give Up). On the right is the description what keys to use and your current balls left, as well as your score.
Clear balls is actually there for bug fixing. If a ball get's stuck you can clear your balls and you get +1 on you ball count. Straight after I turned the game in, it came to me, that this way, you can set your ball count higher without end.
Spawn ball mainly a bug-fixing option too. If a ball shoots out of the flipper, there wont spawn another ball (and you ball count doesn't go down too). This way the bugs wont effect your score ;)
Those two options both were workarounds for bugs I couldn't fix. The last option (sv_cheats_1) spawns a ball at the top and sets your ball count up too and you can use it as often as you want. So it's just for fun.


 
Everything but the the objects with the particle effects on it, the paddles and the weird object at the right has an “ice material” on it. Formerly it was meant for the rag-doll so it could slide properly. The other objects do have the “bounce material”. Except the ball which is metal. That works pretty fine, but for the paddles. They just couldn't get enough force on the ball, it was impossible to reach the upper obstacles. I had to fix that in the script and add some force to the ball with each collision, so it would go up. In combination with the bounce material you could still control in which direction the ball would go off, but the force is also given to the ball, if you don't use the paddle. (Now that I think of it, it could have easily been done by checking if the key is down...). So you actually can watch the game play itself for a bit. Another thing with the paddles was, that you can't just turn them to the degree of your final position. It would just set it there without the in-betweens and the ball just falls through.
The trickiest part was the plunger though. If try to make it work with just physics, you are bound to fail because of the previous mentioned problem of the engine fps. The plunger would just go through the ball, when released. The work around here, was to parent the ball on collision onto the plunger, unparent it just before the start-position after the release and add some force to the ball.

Another thing to mention would be, that I had to duplicate every object that has a trigger on it. So I actually have the visible “collision”-meshes and the invisible trigger meshes. The scripts with “on collision” just didn't work. No idea why and I also didn't have the time to look into this longer than I did.
I really underestimated the work that physics cause, if physics are the main gameplay feature and used for more complex physics than just gravity. So there was no time for further experiments or improve the gameplay, but that way I really did learn a lot about how games (and especially physics) work. I clearly couldn't have done it alone, the plunger workaround was way above my skill and our teacher had to really think about a solution himself. I also got a lot of help for other stuff from other students, like the high-score or the use of force.