Submission #3127: Truncated & TheRandomPie_IV's Genesis Ranger X in 09:32.50

Sega Genesis
(Submitted: Ranger-X)
baseline
(Submitted: Ranger-X [U] [!].smd USA)
GENS
34350
60
71963
Unknown
Submitted by Truncated on 4/23/2011 10:25 PM
Submission Comments

About the movie

Categories:
  • As fast as possible
  • Takes damage to save time
  • Dies to save time
  • Best Genesis movie 2011
  • Heavy luck manipulation (boss 1, stage 3, boss 3, stage 4)
  • 108 seconds (6521 frames) faster than the fastest Dream Team contest movie
Ranger-X is a movie where you pilot a giant Mech. There are several weapons and modes of transportation. Each stage contains a number of Targets (stated in the top middle). When all targets have been killed, the level end.

Work, work, work

This movie was recorded by TheRandomPie_IV and Truncated. Earlier in the project, there was a bigger team consisting of mz, Dammit, cpadolf, and Cardboard. All input by these persons is gone due to redos, with the exception of the menus in the beginning, and the playaround on the first boss which was hexedited in, slightly modified, to save time.
All previous team members found important strategies and tricks, but mz deserves special mention for the fantastic scripts he engineered, which gives a HUD of speed, position, energy, jetpack heat, and most importantly, all onscreen enemies' health. He also disassembled the RNG function which saved huge amounts of time, especially on stage 3 (see stage notes).
Truncated: Finally done! My next project will be something simpler. Big thanks to RandomPie for sticking with the project for so long, and thanks to everybody who helped out earlier in the project.
TheRandomPie_IV: This was probably the thoughest project I've worked on to date and my next is also very likely to be something a touch easier. Truncated was great to work with as were all the others who made contributions. Enjoy.

Tricks

  • The Ranger and the bike can be moved separately, or merged. Changing weapons or jumping with the bike is only possible while merged. The bike moves at 7 pixels per input frame.
  • Left and right movement is not identical.
  • The speed when flying straight ahead switches between two values, 8 and 6. However, it is also possible to have a subpixel speed of 0.5. (If you are careless, the speed can also switch between 7 and 5.) This is only possible when going to the right.
  • When you duck on the ground and then press up-forward, you take off. This gives you max upwards speed instantaneously and slightly higher than max sideways speed. The sideways speed quickly goes down to its standard value. Because there is also 1 frame of zero movement, the gain is not very big (4.5 pixels going right, 5 pixels going left).
  • In upslopes, you can use two take off-boosts in a row because of a bug in the collision handling.
  • The game does not properly clear ducking status between levels. This can be used to use a take-off boost even if you start a level in the air.
  • The game does not properly clear subpixel position between levels.
  • Most projectiles give damage boosts. Some big projectiles give big damage boosts. Obviously big projectiles also take lots of health.
  • The ranger likes to kick enemies to temporarily disarm them. This also gives the ranger a small backwards boost.
  • Flying into some objects and enemies pushes you away from them. Examples are the targets and saucers in level 1-1.
  • Turning around is controlled by the player. The ranger will only kick enemies in front of it. Also, the game only calculates collisions which are actually onscreen. (It's a bit like a tree falling in the forest. If there is no Ranger there to witness it, did it actually happen?) By looking away, you can slip the blue explosions traveling along the ground past enemies.

Lag

The lag in this game is a bad joke. Every other frame is lag. Input-Lag-Input-Lag-Input-Lag...
Sometimes the input frames are switched: Input-Lag-Lag-Input-Input-Lag.
This makes it difficult to hexedit and to keep track of how laggy a section really is. We (mz, Truncated, Pie) wrote a script which takes care of the counting.

Weapons

There are 8 weapons you can wield. Your unicycle and airship fire separately, only the unicycle can be controlled.
Weapon Damage per shotEnergy per shotRate of fire Damage per input frame
Pulse rifle 1 N/A every 5 frames 0.2
Flame 1 16 every 2 frames 0.5
Bomb 12+1[1] 256 every 32 frames0.406
Blue laser 1+1 32 or 64 [2] every 4 frames 0.5
Falcon [3] [3] [3] erratic
Green laser 200 3968 (all of it)energy limitation2 or 0.88[4]
Plasma (spread shot) 10 256 every 24 frames0.417
Shield 4[5] [5] every 4 frames 1
Indra (unicycle) 1 N/A every 5 frames 0.2
Indra while joined 1 N/A every 3 frames 0.333
Eos (airship) 4 N/A erratic erratic

Pulse rifle

This is your standard peashooter. It is always available and can be combined with all other weapons. The shots get the same vertical speed as you had when you fired them, so you can "angle" shots.

Flame

Flame shoots a rapid stream of fireballs, which is supposed to look like a flamethrower. The flames receive both your vertical speed and horizontal speed added to them, and then a random addition in vertical speed (which is the reason that using the Flame advances the RNG).

Bomb

Fires a bomb in an arc forward. Vertical and horizontal speed is not added. The bomb bounces on walls but detonates on ground, and on enemies. A blue flame starts to travel along the ground, for 128 input frames. Max traveling bombs on screen is 4.
The blue flame can go up slopes and down walls. It turns at walls and at the end of the screen.
[1]: The bomb does 1 damage, the blue cream does 12. So only a direct hit scores 13.

Blue laser

[2]: The blue laser autoaims if you hold the button. The energy usage is then 32/4 input frames. If you tap the button it doesn't autoaim. The energy usage is then 32/8 frames.

Falcon

A homing bird. It travels slower than the ranger sideways and is therefore hard to use during horizontal stages.
[3]: The falcon is weird in many aspects. Energy usage is 64 to release the bird, 2 per input frame after that, 64 every time it does damage. Every other frame the bird creates a shadow which has the damage of the latest projectile fired (so you can fire the rifle to set this value to 1, best is if the airship fires so it turns to 4). There are max 3 shadows. The damage is 2 every other input frame, plus the value of all shadows, which are then removed.

Green laser

A huge laser.
[4]: The green laser (also called Proton Cannon) takes 64 input frames to start up, and then fires for 100 input frames, with 2 damage every frame. If the start-up is included, it is 0.88 damage per frame.

Shield

The shield makes you invincible and dishes out damage like nothing else, but it also eats energy extremely rapidly.
[5]: The shield does damage in this pattern: 2, 2, 0, 0. The pattern is on a global timer. The shield takes 144 energy to start and 16 energy every input frame after that.

Lua scripts

I have gotten requests for the Lua scripts used for this movie, here they are:
  • OneScript - Combination of the most important functions: HUD, lagcounter, enemy HP, RNG precognition, etc. Mainly written by mz, with additions by Dammit, Truncated and TheRandomPie_IV.
  • enemy HP - The targets in level 6 have a different memory structure, this script takes care of those and also shows the number of kicks/cooldown for the robot that holds the Shield weapon. Written by mz.
  • getframes - Extracts measuring points (target deaths and stage changes) formatted for pasting into spreadsheet. Works well for stage changes, less reliable for targets, since the position of the Ranger also matters a lot. Written by Dammit (I think?)

Stage notes

1-1

The targets in this level are big buildings shooting fireballs.
We tested the level both with flame thrower and bombs. In the competition the team that used flame thrower was the fastest, but optimizing both weapons it was clear that bombs was the winner. In this level it is actually advantageous to have a high difficulty level, because the targets shoot more often, making it easier to get damage boosts.

1-2

Boss time! Flame is the obvious choice because of higher damage over a long time. Doppler effect used to damage the legs faster. After mz's discovery of the RNG seed, we figured out that moving the bike makes it change, and manipulated the homing missiles to fly in advantageous directions. That is, hitting us in the back instead of getting in the way of our flamethrower.

2-1

The targets in this level return fire after a few hits, generate energy balls that fly in your direction, and lag. It's important to deliver all the damage over a short period of time to avoid the lag.
We pick up the blue twin lasers. They will come in handy later.
Target 4 (behind the huge wall of eggs that release pesky fish) goes down to the combined force of a bomb and two boulders that the bike shoves in. We are pretty happy with that trick.

2-2

The fighter planes are airborne, but can be manipulated to move down into the explosions traveling along the ground. This was suggested by Cardboard. We stack multiple explosions on top of each other to kill them in one hit.
Twin lasers works great on this boss, because of the range and damage output. They also make the tactic of moving away from the boss possible. The boss appears immediately when the last target is destroyed, so it's important to switch weapons just before that.
If you wonder why we stood here eating lasers for a while, read on...

3-1

In this level, the targets drop down from the sky. The time when the targets appear are random, but they are decided when the level starts. mz did some fantastic work by disassembling the randomness subroutine and the code which calls it before the level starts. From this he also made a nice lua script which essentially grants us precognition, showing at what heights all targets would end up with the current RNG seed.
The x-position (drop location) of the pods are always the same.
This is obviously a huge factor in completing this level quickly. mz's team gained about 1400 frames on this level in the dream team competition.
After an idea by Dammit, Truncated researched and wrote a script to estimate a level completion time for any combination of drop times. Pie then had the idea to calculate a lot of combinations (thousands), so we could pick the best.
The RNG is called for a lot of different reasons, but the ones we can influence directly are moving the bike, firing the flame thrower or flying upwards (one step each). Indirectly, we can make the boss fire its laser. This advances the RNG about 500 steps! Because of this we can reach a better RNG without losing too much time.
Eating the lasers takes about 180 frames, but the order of targets we get means we can complete the level 1700 frames faster than the best dream team competition movie, because almost all of the waiting for targets to drop is gone.
About the level: when going trough the treetops at too high speed, a bunch of small leaves come off. These create lag if there is other stuff on the screen, and also block shots and bombs, so we avoid it when possible. The targets release small fighter jets, which shoot lasers that are great for boosting your speed. The jets are also great at getting in the way when trying to destroy a target.
We also pick up the homing bird for the next level. It's crazy fast at killing targets, but has problems catching up to the ranger after that. It would also have meant an extra weapon switch at the boss, which is why it isn't used in this level.

3-2

The boss has two forms, each has 64 HP.
First form, the boss only takes damage when the eye is open. When the boss takes damage, it closes the eye. The fastest way around this is to buffer up 4 bombs (which is the max number on-screen) for 4*12=48 HP, and as soon as they hit, release another bomb and fire four rifle shots, 4+12=16 HP, for a total of 48+16=64 HP. The boss dies almost instantly.
The second form has spheres floating around it in a predefined pattern, the spheres block all shots. The pattern is decided when the boss spawns. It starts under the ground and moves up, towards your position. This gives us some time to both get a favourable pattern (one with a sphere opening in ground level just as the boss appears) and stack up a welcoming present of 4 bombs. As before, one more bomb and 4 rifle shots just after that kills it.

4-1

This is a vertical level. The targets here release tracking bombs, which really hurt. However, the explosion from the bombs also hurt enemies. If you set off the bomb while it is still inside the target, the target goes down!
Unfortunately, the targets release their bombs not when you get close, but on a timer which is initialized when the level starts. So we went through the process for stage 3 again, wrote a program so calculate a comparison value for different timer values, and found a very good one just a few RNG numbers away. So good actually, that all the targets release their bombs without any delay. This results in what you see, we fly upward at max speed the whole time, targets suiciding along the way, we never fire a shot. :)
The bird is used to kill the enemy rangers to decrease the lag we would otherwise have later. We pick up the giant green laser.

4-2

This boss works something like this: There are turrets shooting ballistic lasers at you. The part of the boss which you have to kill to end the level is housed under the middle turret. You have to destroy that turret to remove the walls and be able to shoot the boss. The boss consists of a small module and a ball rotating around each other. The module must be damaged to kill the boss. If the ball is damaged, it attacks the player and the module goes invulnerable for a while.
Since the green laser shoots through walls, we do not have to kill the middle turret at all. We must however make sure not to damage the ball. This is the reason that we starts firing in the "wrong" direction and turn around twice during firing: the module needs to be in the correct phase of the rotation, and we only want to scroll the module into view, not the ball.
The position of the ball and module is fixed (non-random) at the start of the stage.

5-1

This stage has three main features:
  1. It is in the dark, which means very slow energy refill for the ranger, and it has searchlights, which quickly refills energy but alerts enemies to your position. All nearby missile ships and one trailing robot start to attack you. The trailing robots switch sides so they are always behind you.
  2. The targets are on rails and move back and forth. It is possible to destroy the targets (32 HP), but you can also destroy the small modules on the rails (16 HP) instead. This makes the targets fall to their doom. This works on all targets except two last ones.
  3. The enemy rangers that are walking on the ground react differently to kicking than most enemies:
    • They receive 1 HP damage from kicks.
    • It doesn't matter which direction you face, you will always collide with them. It is not possible to pass them by turning around.
    • The kick recoil is huge, which is good for traveling faster.
Since the targets fall off their rails and die when they hit the ground, it's important to kill the last two targets when their falling distance is short.

5-2

The boss consists of two parts. Neither has any attacks on their own, they only attack once they are connected. The left one starts next to you and travels at medium speed to the right. We kill the left part with the bombs since that's what we come into the stage with. This makes it fly right quickly and attach to the right part.
During the long travel to the right part we switch to the green laser and start it so it will fire exactly as we reach the boss. The idea is to get off as many rifle shots as possible during the green laser, which as before means some turning around. It is only possible to fire the rifle when you are in view.
To finish off the boss, we get in the bike just as the laser stops, switch to the bombs while jumping with the bike, and deliver a final bike/rifle/bomb salvo.

6-1

The second enemy robot carries the arguably best weapon of the game, the shield. It makes you invincible and damages anything you touch at double the rate of the flame. The robot does not give you this weapon if you just shoot it though - you have to kick it to death. Both the ranger and the bike can kick it. If the robot goes too high and touches the ceiling, it stops moving, so this needs to be avoided most of the time.
Before the end, we switch to the green laser to kill the boss quicker. The green laser is a bit strange in that it requires full energy to activate, but the energy isn't depleted at once, only when it fires 2 seconds later. Meanwhile, you can pick up a health refill, which converts energy to health.
We take our only death here, to pass a health refill just before the boss, which would otherwise sap our energy for the green laser.
The boss has two weak points: a gun on the top and a gun on the bottom which retracts and goes invincible. With the damage output of the green laser, the bottom gun can be killed before it retracts the first time, even if it means a slower kill of the top gun.

Final boss:

During the long fall we get 14 frames ahead with the use of slightly faster velocity cycle. Always something!
As for the boss, we just shield him in the face while shooting the rifle. Even though he has a phase where he blocks your shots and you have to reflect his projectiles against him, it is still possible to damage him normally if you are behind his shield.

Possible improvements

Better lag management. The lag management in this game is hell. Theoretically better strategies in the last level weren't used because they caused more lag.
Not picking up the blue laser. Getting the blue laser was based on how much time it would save against the second boss. It does save time there, but since we were forced to wait in the third phase, perhaps a slower weapon would work out too.
Better randomness management. Perhaps it is possible to grind enough RNG steps during the first two levels that a laser shot from the second boss could be skipped, but it's doubtful.
See you next mission!

feos: HD encode.

Baxter: Complex game TASed very well, accepting.
sgrunt: To be published as soon as I grab a screenshot.
Last Edited by adelikat on 9/22/2023 2:47 AM
Page History Latest diff List referrers