Big Game Project – Post 1
|
The second year project that is set to be displayed at the Gotland Game Conference (GGC) has started production, and with that progress blogs every week until the big day, this being the first. The project is done in teams and my team, called Team GG (The GG stands for Gravity Grind which was the name of the concept) consists of: Jonas Lundgren as the Producer and Lead Programmer (https://enfisk1994.wordpress.com/) The game we are making is much like Wipeout and F-Zero with high-speed competitive racing. Our game, however, differentiates from these with having two tracks running mostly parallell that the players can swap between in the race. So now to what these blogs are for: weekly updates of my progress in this project. After reading these I started working on the task. Quaternion.FromToRotation(transform.up, hit.normal) * transform.rotation; transform.up is the local up, which takes into account the transform of the object, it is always the up from the objects perspective. Of course this method returns a Quaternion that I have to handle, the resulting quaternion is the final rotation where the vehicle is rotated as it should be along the normal of the mesh below it. Ray ray = new Ray(transform.position, -transform.up); if (Physics.Raycast(ray, out hit, 100f)) { m_targetrotation = Quaternion.FromToRotation(transform.up, curr.normal) * transform.rotation; } transform.rotation = Quaternion.Slerp(transform.rotation, m_targetrotation, Time.deltaTime * m_RotationSmoothing); I later added another thing to this, making it only update the target rotation when the collider hit is a new one, done using a simple current hit != previous hit statement. Those simple lines took me several hours to get working as they should, with adjustments being made to everything, and it still does not work the way i want it to, so it is by no means a finished work but it does give a pretty good idea of what the end result is going to look like. After this I started working on a custom gravity for the same reason, the tracks shifting rotation needs an equally shifting gravitation. I made a temporary solution to this using the same way, the gravity is set to the negative normal of the mesh being hit by the downward raycast. It also checks the distance to the mesh and stops pulling down when close enough to the “ground”, which results in a somewhat functional but not even almost acceptable solution for the final game. Other than working on design documents and trying out multiple controllers functionality and insanely simple ai just moving towards waypoints that was all I did this week. Thank you for reading and I’ll see you next week! |