Visar inlägg med etikett Checkpoints. Visa alla inlägg
Visar inlägg med etikett Checkpoints. Visa alla inlägg

måndag 19 maj 2014

Pre-Beta Week

It's eight workdays unitl Gotland Game Conference(GGC) and the end of this schoolyear. This means that we have eight workdays to finnish our game Defunct. All the major parts of the game are in place but there is some small things that still needs to be done, and some things we will skip for GGC such as the level select screen we first planed on having.

Mockup of the level select screen.

Sounds

I implemented the sounds last week. As I said some time ago we are using the FMod studio plugin for unity so to play audio I  need two things: The Event files and the Bank Files.
Events are audio files that have special parameters that control them such as a velocity. Bank Files are files that contains links to the events, so to get an event we have to load a bank and then request an event.
When requesting an event we get a eventinstance which we then use to play sounds.

I created a class called SoundController that (guess what) controlls the sounds, when something wants to play a sound it calls the .PlayEvent() functions which takes a enum as parameter. Preferably this function would take a string since FMod Studio has string bank where you can link events with names, but we couldn't get it to work and it wasn't worth sinking any more time into.
I also created functions that stops, pitches fades and sets the volume of an event.

Feedback

Mikael created a particle effect for when you go out from a checkpoint that I then added to the checkpoints, and to emphasis the speed of it I also play a bit more with the FoV of the camera as you leave the checkpoint.

Directly after leaving a checkpoint

I also did the same thing but with a much much smaller FoV increase when you pick up a small boost, since we've feelt from the start that you don't "feel" the speed you get from the small boosts.

Camera

I spent some time on the camera this week smoothing it up. I realised that i used the physics player to calculate the position of the camera, which is quite dumb since it's moving really jerky since the physics player doesn't tween between the positions. I simply changed it to the graphical representation of the player for all the calculations of the camera positioning. And other smothing and rotation fixes.

Small Things
The small things of this week are some fixes with the ships, and multiplayer.
I chaged the ships up from patrolling to just going forward because it should look like they have a goal, not aimlessly flying about. I made it so that they have a spawnrate and a min and max height where they can spawn, max, min speed that they can have.

I changed the way the checkpoints give force, to balance the checkpoints with the level design we wanted to give less force to the player that already have alot of speed, so i changed them so that the level designers can sett a "fallOfCap" if the player has a velocity above this cap it will get less force that if it was below this cap. The force given is reduced by a variable called "fallOfRate" for each percentage above the cap the players velocity is.
Then I did some other small things such as fixing the restart in multiplayer, tweeked with post-processing effects and things like that.


That's all for today, goodnight and thanks for reading.
-David Forssell

fredag 9 maj 2014

The week of XInput, Checkpoints and "Destructible objects"

The week has come to an end, and for once I thought I whould get this blogging thing out of the way in time, so here I am.
This week I've been doing alot of different things, I re-did how the checkpoint boosts worked, I implemented XInput, a Xbox controller library. I linked our multiplayer lobby to the actual gameplay so the multiplayer works, and a lot more.

Checkpoints

So we got some feedback during the alpha, and one feedback we got was a smal amount of players didn't get the checkpoint boosts we had. In this checkpoint system you hold down a button to charge a boost, and then when you release you gain the momentum you've charged up. So to simplify this we decided to redo them so that they charged themselfs and when you pressed the button you got the momentum.
I personally didn't like this change, since I feelt that we keept the player passive and the charging lost its charm when you didn't charge it youself, but I still decided to give it a chance. So I changed the checkpoint boost to how we decided and we tried it on some people, and none of them liked the changes we did to them.
As I feared I made the player passive, and we decided to revert them to the way they were before. I think that people will understand this system when it's explained to them: "hold button-charge, release-get speed" is not that hard to get.



XInput

XInput is a library for Xbox controlls "But David, you are making your game in Unity doesn't that already have controller support!? Are you a moron!?" Glad you asked random person on the internet, yes we are making our game in the Unity engine and yes it has controller support, BUT it doesn't have full controller support since it can't make a controller vibrate. However it can make a phone vibrate, lazy lazy Unity...
Implementing XInput was easy, only download a package and import it, the only irritating thing is that visual studio doesn't realize that it's in. It gives away errors but unity can still compile and run it like a charm.

To set vibration on a controller I simply have to write: "GamePad.SetVibration(controllerIndex, leftVibration, rightVibration);"

I started with vibration for the Pumping feature, a small vibration when you pump in downhills and a large staggering vibration in uphills, sortof like a coughing engine. This is to make the player feel staggered when pumping in uphills to make them stop, since this makes them lose speed.
I then added a vibration for when the checkpoint boost is fully charged to tell the player to let go, and a small vibration for when the player picks up a small bost, to emphasize the speed increase.
The last vibration I added was for landings, When the player loses alot of speed in its laning I vibrate the controller roughly.

Small things

I created a button that you can spam when you have low speed to gain some speed, I'm not quite sure why we have this, since the problem we had that led to the creation of this button is that "people doesn't respawn at checkpoints when they lose speed". I guese it is to allow the people that don't want to get a good score and only want to cruise to do so.

Petter had made a script that gave objects with a specific tag a rigidbody when you hit them, to make things "destructible", but they didn't reset when you went back to a checkpoint and since I made the respawn system were we reset all the boosts, sparks and so on, I also made the physics objects respawn.
All I did was to make the "PhysObjects" register themselfs in the respawn controller with their position and rotation when they got activated, when you respawn at a checkpoint the respawn controller then removes the rigidbody and places them back at their original position with their original rotation.



I linked the multiplayer lobby Petter translated form my code to the actual gameplaye scene.
To load a different scene in unity you have to change the level prefix of the network, this is just a simple digit that reprisents a level. This is so that the network can filter out any information sent from another level, in adition to that you can also force the network to stop sending information while loading a scene to save bandwidth.




I also created some small scripts not really worth talking that much about, such as a patroling script for some ships that we will have flying over the world.

That's all for today, goodnight and thanks for reading.
-David Forssell