From OniGalore
Jump to navigation Jump to search

OniFly is an attempt to add flight to Oni, so that the player and the enemies will be able to move freely in 3D, instead of having to do gravity's bidding.

Planned features

  1. You press a key to start/stop flying. Same as Bid For Power.
  2. You can fly up with Jump. You can fly down with crouch.
  3. When you move forward, you'll move in the direction the mouse is pointing (ie the direction your head is facing).
  4. When you're knocked over, you fall for a few seconds, then you can start flying again.
  5. You can move faster than normal.
  6. Enemies can move faster than you can.

And, in best-case scenario, it would lead to this stuff:

  • Enemies can fly too, so they'll all chase you through the air.
  • You'll have to dodge Superballs being fired from above and below.
  • Mid-air pistol duels will be fairly normal.
  • Throws will be essential for getting someone to fall a few storeys below you.

Implemented features

  • Characters move in the direction their head is facing. So, the player and AI units can all basically fly.
  • Many of the running animations are frozen at one frame. So, people don't look like they're just running through the air.



AI don't fly enough

The AI don't chase the player as often as they should.

  • If they have a loaded weapon, they seem to stand still and fire it until it's empty -- so no flying.
  • Sometimes, they stand at the edge of a cliff and just glare at Konoko instead of chasing her (because the pathfinding AI is in control, not the combat AI.

Potential fix: Once an AI unit goes "ah!" and realizes an enemy is in front of them, we could probably make sure they stay in combat mode forever after that.

AI needs to stop jumping

When someone jumps, they are frozen in mid-air until they try to punch.

Potential fix: Detect their jump animation, and make them do another action (eg stand still).


Anyone who's flying will pop up and down constantly. It looks really bad.

Potential fix: If we can insert some code into Oni's run loop instead of running an external program, I think we could adjust the player's position before it's drawn to the screen.


There are currently 2 implemented ways to control the y position. Both have flaws.

Freezing Y position

The first way is to read the y position at the start of the level, then just keep writing it and never read it again. This way, the flight rules are the -only- thing in Oni that are capable of changing the player's Y position.


  • The collision detection system can't alter the player's Y position -- therefore, it can't stop the player from flying through floors and ceilings.
  • Cut-scenes can't change the player's Y position -- so any cut-scene involving an elevator will cause problems.

Modifying Y position

The second way is to read the Y position each time we're about to modify it. This way, everything in Oni can change the player's Y position (just like in the normal game).

However, this means gravity can affect the player's position. This makes it very hard to fly!

Game balancing (keeping it fun)

Possible options to limit the player's abilities:

  • Enemies move faster than you
  • Player's flight is limited (using one of the following:)
    • You only get flight for a short period after hitting/killing someone; kill several people in a row to fly faster/longer (like Max Payne's bullet time)
    • You have a limited amount of Fly Power that must recharge (like Bid For Power)
  • You can only fly to a limited height above the ground (don't know if there's any way to implement this)
  • You lose health while flying
  • All enemies know where you are when you're flying

Useful findings

Findings that may be of use to other projects:

  • Using custom code, it's very easy to detect & set a character's current animation and frame.