Feverishly working on a Plane combat game in Unity, for no reason apart from one evening thinking "I wonder how hard it is to make a plane control system that feels nice?"
The answer - fairly hard, fairly hard.
So please, by all means, take a look at the video. It's a small snapshot of the progress thus far (one week of evening programming).
Here's a short rundown of things to observe, and their respective explanations:
- Custom Spring camera - I found this gave a more tactile flight feeling, and a more explicit feeling of movement in the plane. The camera will constantly attempt to align itself with an "ideal" position (a gameobject bound to the back of the plane), at a defined easing rate, to loosen or tighten the spring.
- Controls - no real originality here. I originally attempted to use physics (gravity, drag etc) but opted for a more action-y feel (think Crimson Skies). Controls are as follows:
- Roll
- Roll will gradually correct to horizontal if it is between both sides of 70 degrees. (70 and 290 degrees)
- Pitch up/down
- If the plane is angled downward at less than 35 degrees, it will gain momentum, leading to a decaying speedboost after correction of the game.
- Turn left/right
- Thrust
- The plane will continually move at a defined minimum speed, but may be accelerated (at an acceleration rate) to a maximum thrust.
- Fire
- See below.
- Firing System - this will trigger, at a specified rate (defined by rest intervals between viable shots) - a raycast from a defined 'gun' location. This gun will be arbitrarily rotated within small defined bounds (currently 2 degrees) to give a nice scattered pattern of shots.
- Hit response system - when an object is struck by a Fire ray, it will:
- Take the type of the shot (e.g: Machine gun shot)
- Look through its defined responses to this type of shot
- Respond.
- E.g: Spawn fire particle.
- Procedural Scenery - tricky tricky tricky. The entire scene is encapsulated in a large array, with integers defining the contents of that location on the map. E.g: 1 = house, 0 = nothing
- The game will take the planes coordinates, convert them to 'map coordinates', search around those coordinates for scenery that should be drawn, instantiate them, and destroy all objects that should not be displayed. Tricky!
- Seamless world - You can fly around the world seamlessly. This is really all I wanted. Here's how it's achieved:
- There are 9 terrains in the game, each representing one node in a 3x3 grid.
- The plane is kept always in the centre of this grid, and terrains are shuffled accordingly, to assure that they roll smoothly.
Currently working on Networking this badboy up for some multiplayer air combat. Get excited. More to come.
2 comments:
fyi, your videos are marked private.
Hey, I'm new in Unity, and got a pretty ambitious goal - Making a flying bird game.
I found this blog through your living skybox vid on you-tube. i looked through this blog, And I was fascinated by the seamless world
I have been looking for this for a while.
It says how to do It, but I was wondering if you could possibly spare some time and reply to me on how exactly to do it?
I hope you can find some time, and thanks in advance!
Post a Comment