What should Motorcycle Prototype be named?

Tuesday, May 17, 2016

Physics and Audio

I've been reading up on how engines work and about physics specific to motorcycles. This has allowed me to get a better understanding of what moves a motorcycle and some formulas for converting engine torque to acceleration and maximum turn radius when going around corners.

Motorcycle Transmission

Up until now I've been struggling to get a smooth ride using the Unity 5 wheel colliders, they would bounce up and down a lot and behave erratically. I decided to try capsule colliders instead of the wheel colliders and this gave me a much more manageable solution. I decided to try out the wheel collider source project on the Unity wiki and found that it's much closer to the behaviour of the wheel colliders from Unity 4. Spent a couple of days implementing a setup using them and got something pretty realistic however this will have to go on the back burner while I finish off the main physics setup.

Wheel Collider Source

Spent a lot of time trying to get a decent engine sound for the motorcycle but realised that it's because you can't increase the speed of a sound in Unity without changing its pitch. This seems to be important for a realistic engine sound so I will need to implement it myself as I'm not sure the Android OS even supports this functionality.

Interactive Car Audio System

I now have a solution for engine torque and turning radius, next up is braking. I need to figure out how the friction from the brake calipers translates to deceleration of the motorcycle.

Bicycle and Motorcycle Dynamics

Tuesday, April 26, 2016

Have Your Say

I have extended the poll on choosing a name for the game, if you are using a mobile device you have to scroll down and click "View web version" in order to see it. In other news this blog has now had over 5000 views!

Finished working on the menus for the time being, I'm not happy with how the main menu looks but it's functional. Players can remap their controller in the settings menu. Implemented Splunk Mint in the game which is what I'm using for analytics in Stereo Image Viewer but the events aren't showing up in the dashboard. I implemented Game Analytics but it's very confusing and I can't find the events anywhere. Implemented Flurry and the events aren't showing up at all, I'm starting to see a pattern here. Decided to implement the Google Analytics Unity plugin and see how it goes.

Added a counter for earning money from riding around the circuit. Added a wage system for earning money while not playing the game. Players are told how much they earned while away up to a maximum of eight hours, this should encourage people to come back often and keep a steady stream of income going.

Wednesday, April 13, 2016

What Does The Future Hold

I went away over the weekend and didn't get a chance to do much on the game so I would like to share with you some features I plan to implement in the future:

It costs $100 to enter the circuit and ride the default bike. As I add more bikes to the game you will be able to pay more or less to ride them based on how they perform. I'm thinking of having everything rented in the game instead of buying it outright because the money system is based roughly on real world values. A brand new motorcycle would cost about $25000 but you would only pay $250 to ride it around the circuit for as long as you like. The same with leathers, helmets and other protective gear.

2013 CBR1000RR ABS Fireblade
Players earn a wage while they are not playing the game which is capped at eight hours to simulate going to work. They get a promotion for coming back every day which multiplies the amount of money they earn. Players also earn money from riding around the track which is multiplied by their speed to encourage them to ride faster and harder. I want to add sponsorship to the game so when a player does well enough a company offers to sponsor them which earns them more money.

MotoGP sponsors
Currently there is not a lot of incentive for players to buy better protective gear other than for aesthetic value. I want to add an injury system where players get injured when they crash. Depending on the part of the body that is injured it affects their performance in different ways for instance how fast they can change direction or diminished braking power. The injuries heal over time but if the player has a big crash they might not be able to ride at all until they heal. Hiring better gear helps tremendously when it comes to avoiding injury and being able to ride for longer.

Elena Myers
One of the main features I plan to implement is the ability to get off the bike and walk around the pits or the paddock. This allows players some time to relax if they have had enough riding and can take a break and talk to the other players who are also off their bikes. I used to play Half-Life 2: Deathmatch and often after a few hours of shooting each other everyone would cease firing and hang out for a while in the map then when we got sick of that we would go back to playing the game.

Multi-player is first on the list of priorities after the next version is released. I play a lot of MotoGP online and it's my favourite way to play, especially when you build a community and have regular races against friends. Single player is good but the AI is limited in that it's not a real person playing and will never react like a real person, often they are too slow on parts of the track and don't always take the fastest line through the corners. In the beginning players compete for the fastest lap time during the session. Having the fastest lap awards a combo bonus for any money you earn while riding so there is extra incentive for players to be the fastest. I want to experiment with having a qualifying session for a set amount of time maybe 10 or 20 minutes where players compete for the best lap, after this it transitions to a race including all players on the server who are placed on the grid according to their qualifying time. The server host is able to set the qualifying time and number of laps for each race. There are bonuses and prizes for placing well in the race. Tournament servers can be setup for serious players where the qualifying session lasts for a whole week and there is a race every Sunday with the results published on the leaderboard.

MotoGP 08
Replays are important to me because I like to record good sessions I've had and share them with friends on YouTube. I want to add the ability to view and save your favourite replays in the game and to take screenshots of the game from different angles. I also want to allow players to change the game settings and create their own bikes, tracks, etc.


AI will eventually be included in the game because it takes a lot of work to get it right. Ideally I want to create AI that takes the fastest route around the circuit and never hits another bike if they can help it. There will be a difficulty slider that adjusts down from 100% and the AI becomes slower by braking earlier and acclerating slower. I think I can create an AI that takes the fastest route around the circuit and a slider to change the difficulty but avoiding collisions is another challenge, I may not implement collisions to begin with so AI serves more as a practice tool.

Tuesday, April 5, 2016

3D User Interface

Bought a racing UI package off the Unity asset store for Motorcycle Prototype and decided to make a 3D UI in Blender to see how it looks. It turned out good so I'm going to keep going with it.

Racing Game GUI for Mobile

I posted on the MotoGP 15 Steam forum asking if anybody was keen to play online and got a few replies, had some quality races over the past week and have gotten better at the game. It's a good feeling racing shoulder to shoulder with someone where you're so evenly matched the first person to make a mistake loses.

MotoGP 15

Completed the first iteration of the help menu that includes a brief description of the game controls and how to play the game. Started on the settings menu where you can change the controller setup and various video, audio and game settings. I'm thinking about including options that control how the game plays such as acceleration, brake power, etc. I'm going to implement a leaderboard with the top lap times so I'm still not sure how this will work, perhaps lap times will not be recorded when using custom settings as that would not be fair.

Settings menu

Monday, March 28, 2016

Check Out These 360 Screenshots

I bought the mobile ready race track package and imported it into the game, there are some performance issues but I think I can deal with them.



I managed to stop the rigid body spazzing out when changing the lean angle by setting the angular velocity to zero, this means the bike now slides when on grass and low friction surfaces. I have removed all pitch and roll from the camera because it was making me feel dizzy, the first person ragdoll is more comfortable now.



I updated the touch input to accelerate when holding the touchpad and automatically brake when letting go, this works well and I now have a working input system that doesn't require a controller.

The track textures don't look great on the phone and I spent some time trying to fix it, anisotropic filtering didn't seem to be doing anything and I finally discovered the S6 does not support it.



I came across a Reddit post mentioning 360 degree screenshots in Unity so I found a package on the asset store and took heaps of them, I also took a lot of normal screenshots of the new assets in action.

I tried following a tutorial I found online about pairing my Wii remote with the phone but it didn't work. I'm keen to experiment with motion control on the Gear VR but the only option seems to be pairing it with the PC and sending the input over Wi-Fi like I'm doing with the Motorcycle Prototype companion app.

Screenshot Gallery


Motorcycle Prototype

360° Panoramas


Sunday, March 20, 2016

New Tracks Coming Soon

Added a finish line and lap timing to Motorcycle Prototype, your current lap time shows on the motorcycle dashboard along with the best lap of the session. Came up with some name ideas for the game because it's not going to be called Motorcycle Prototype forever. Started designing the menus and implemented a functional menu using the default Unity UI. There is going to be a help menu with instructions on how to play the game and how everything works, there is going to be a settings menu where you can remap your controller and change some settings in the game. I got the idea to add money to the game. You start off with around $10000 and have to pay $100 to ride on a circuit, you get paid according to your performance on the circuit based on how long you ride and how fast you are going. I haven't worked out the specifics yet but for example you get $1 for every second you ride at 100 km/h so if you are travelling at 50 km/h you earn 50 cents per second. In multiplayer there will be combos for achievements such as holding the best lap multiplied by the number of players in the server so if there are two players the amount is multiplied by two. You will still be able to ride if you don't have enough money at first so I can get the balancing sorted and make it fair, I might also add a daily pay of $100 or so with a combo for each day you come back in a row. The game no longer requires a controller to play, you can steer the bike by turning your head and it's much smoother than using a thumbstick. You can accelerate and brake by dragging on the touchpad, I am going to experiment with holding the touchpad to accelerate and automatically braking when letting go to see which method works best. I had a look online for some race track game assets and found a couple of good ones in the asset store, I am going to buy one of them and put it in the game. It looks much more professional than what I have now.

Mobile ready racetrack pack
I couldn't decide on a name for the game so I'm sticking with Motorcycle Prototype for now, I have added a poll to the main page so please vote for your favourite or suggest a new one in the comments.

Monday, March 14, 2016

Record Your Fastest Lap!

I experimented with ambient occlusion on the track model but ended up discarding it because it didn't look good when viewing at an angle and nothing I did would fix it. I implemented a ragdoll setup using the rider model and got it looking good. Made a proper collision mesh for the motorcycle so the ragdoll falls off the bike realistically instead of exploding because it's clipping the mesh collider.



I experimented with a couple of different motorcycle physics setups and control scripts. The old script was jittery because I was overriding the rigid body velocity, I have a better setup now and the ride around the track is much smoother. Wrote a script that did not use physics at all and moved/rotated the bike manually but there was no collision detection with the walls and it would be difficult to implement by hand so I went with a hybrid setup that uses physics but manually positions and rotates the bike. I also tried a setup using the new wheel colliders in Unity 5, you may or may not be aware but Unity drastically changed the behaviour of the wheel colliders in version 5 which I was using for the motorcycle and it caused a few problems. I have started implementing the finish line and tracking lap times along with the best lap.