simple yet difficult "sync" problem.... dynamic "death anim" frames? NO - its just Stroboscopic entities

oldyz

Well-known member
This week i was looking into restoring the Frankenstein battle monitors & noticed a weird and unusual thing they do:

For best results , watch them at 60FPS


after player kills Franken, the Victory animation follows, when the victory animation happens the monitors Freeze on the last 2 frames of animation they where currently using (or maybe the next 2)


As you can see - the monitors "get stuck" on a 2 frame cycle that seems to support 9 different variations or states all dependent on the Victory trigger.

either way, i have an overly complicated system of inline scripts that seem to do the job
(basically every frame has a script that goes to an "anim special" that matches the current frame - example :

Animation has 9 frames - there are 9 "anim specials" to match each situation --
What i have not figured out is how to make the "triggers scripts" themselves work as a victory animation, since players are the only entities that seem to get them

I bring this up because for a later stage i need a similar type of syncronization to happen, but this time the frame count would be in the 600+ range -
that would mean creating 600+ anim death or anim specials..
 
I don't recommend creating big in-line codes (or in-line scripts overall, except for level files), it's hard to manage and it's subject to many inconsistencies if you need to maintain a default behaviour between multiple copies of this same code. In this case I suggest using events like onmove/ondraw/update/think scripts to do this job.

Even the "animation" event is better than in-line, in case you really need to use script inside animations.
 
after player kills Franken, the Victory animation follows, when the victory animation happens the monitors Freeze on the last 2 frames of animation they where currently using (or maybe the next 2)

To me, it looks like after boss is killed, player's control is disabled before victory scene scripts are run (delays while waiting for boss' DEATH animation is finished completely and script to force victory animation on active players, just to name a few).

What i have not figured out is how to make the "triggers scripts" themselves work as a victory animation, since players are the only entities that seem to get them

If you're not using VICTORY animation, you can use other animation for that and use script to enforce the animation.
 
@Bloodbane
To me, it looks like after boss is killed, player's control is disabled before victory scene scripts are run (delays while waiting for boss' DEATH animation is finished completely and script to force victory animation on active players, just to name a few).
do you have any examples on how to disable player controls? for some of the restorations i am doing i would like to feature this on some places -
i am thinking most likely the bonus stages might need to disable all controls minus a single button?
If you're not using VICTORY animation, you can use other animation for that and use script to enforce the animation.
But what do you think of the way those monitors animate at the end? - it seems that the NS engine manages to "recycle" the last 2 frames in use as a "death" blink or death animation of sorts, and the way they "stop" adapts to the very moment the victory jingle happens...
figuring out the best way to do this key to fixing the elevator level sync problem without resorting to Pre-calculated lines of code... and probable performance issues
 
do you have any examples on how to disable player controls?

This one is for non-player type entity which you can use it to control player's ability to walk or not. The player will not be able to move around unless the script deactivates its control.

C:
void DeControl(int P, int Flag)

{
// Activates or deactivates control for defined player
// P : Player index starting from 0
// Flag : Control flag

    int Player = getplayerproperty(P, "entity");

    if (Player != NULL()){
      changeentityproperty(Player,"noaicontrol",Flag);
    }

}

Example:
Code:
anim idle
@cmd DeControl 0 1 #enable no control for player 1
@cmd DeControl 1 1 #enable no control for player 2
frame ....
frame ....
frame ....
@cmd DeControl 0 0 #player 1 free to control
@cmd DeControl 1 0 #player 2 free to control
frame ....

But what do you think of the way those monitors animate at the end?
I don't know. They look like they are paused during a victory animation. @DCurrent made a pause script which freezes all entities to a pause but the player itself.
 
I don't know. They look like they are paused during a victory animation. @DCurrent made a pause script which freezes all entities to a pause but the player itself.

If you did not see the videos at 60fps, you might have missed the weird thing about them
At first i thought it was a pause ,
i actualy ripped the monitor's frames with mame.ts at 60fps, and the monitors seem to be animated as follows:
frame 1 monitor green - low line
frame 2 blank or transparent frame
frame 3 monitor green - low line 2
frame 4 blank or transparent frame . . and so on for 18 instances (9 green frames total)

when the victory jingle happens, everything pauses, except the monitors do this weird "pause" that makes them do a 2-frame blink, agreen frame & a blank frame.

i do recall some games doing this type of weird 2 frame flicker when thigs are paused,
most of the time i have noticed it is present in games that simulate transparency by using a solid frame and a transparent frame to create mysts or fog -
somehow programmers for these games allow for these 2 frame animations to be excluded from the pause so the effect is not noticed or unbroken - and i think that this is what is going on on the monitors

but the question is, how do we duplicate this effect in Openbor, (it does not need 60fps illutions to be maintained thanks to alpha effects & drawmethod) but if you want to keep some modules faithful to the original games , those 60fps effects are must.

in order to try and imitate this , one of my first ideas was to create an entity that would be "inmune" to pause, so i could actually spawn and overlay an entity that simulates the blank/transparent state over the last "adaptively" paused green screen that the victory banner freezes.

but after some tests i was not able to find such an entity that was inmune to pausing, so it was "easier" to do 9 animspecials for every possible frame position...

Will look for DC's script, that should be the answer to create such an exclusion....
 
Last edited:
when the victory jingle happens, everything pauses, except the monitors do this weird "pause" that makes them do a 2-frame blink, agreen frame & a blank frame.

Chris and Hong Hua's video don't show active monitors but Jake's video does so I watched that instead. But still, I don't see anything special when victory jingle or stage clear text appears. IOW the monitors are paused as expected.
 
Chris and Hong Hua's video don't show active monitors but Jake's video does so I watched that instead.
You have to watch at 60 fps - only way to do so its by choosing 720p or higher resolution -
In Other Words the monitors are paused as expected.

yes , i told @maxman , that in this case it seems that the "green monitor" entities have an special kind of pause "reaction" that allows them to have a blank and non-blank frame "blink" or strobe effect to preserve the 60fps special effect.

If i am not mistaken, some games allow for such effect to take place so when players press pause on the SNEs or genesis the fake/strobe 60fps transparency is still active on certain entities/sprites - otherwise things like strobe fog, strobe clouds, strobe water, etc would appear as solid or missing if players press pause at a precise moment.... spoiling the effect.
 
I did watch it, but I did miss it until I came back to check them yesterday. You are right about the monitor blinking. It looks random whether it blinks or not. I have no idea how they made that.

Anyway, I made this one based on DC's original pause script. This new one includes calling a certain default model name for being part of the pause state along with the main user. Read the comments below in this script.

C:
void paus0004(int iToggle, int iTime){

    /*
    paus0004
    Based on pause script by original author
    Original author: Damon Vaughn Caskey
    Script modifier: Max Man
    Original date: 11022009
    Modified date: 10112022
    Pause or unpause action for all entities except self and other specific default model.
    */

    void vSelf      = getlocalvar("self");                  //Caller   
    int  iETime     = openborvariant("elapsed_time");       //Current time.
    int  iMax       = openborvariant("ent_max");            //Entity count.
    int  iEntity;                                           //Loop counter.
    void vEntity;                                           //Target entity.
    void vName;                                        //Named entity.

    for(iEntity=0; iEntity<iMax; iEntity++)
    {   
        vEntity = getentity(iEntity);                                       //Get target entity from current loop.       
        vName   = getentityproperty(vEntity, "defaultname"); //Get target name
       
        if (vEntity != vSelf && vName != "Monitor")                                               //Not Self and the model?
        {
            changeentityproperty(vEntity, "frozen", iToggle);               //Toggle frozen.
            changeentityproperty(vEntity, "freezetime", iETime + iTime);    //Toggle frozen time.
        }
    }   
}

Example:
Code:
anim freespecial10
@cmd paus0004 1 2458
offset ....
delay ....
frame ......
frame .....
frame .....

It works the same as the original, but for a specified model/entity (along with self or main user). I just named it as "Monitor", but I don't know what your model's name is for your NS project. It's just an example to show you. This means the one using it (mainly the player) and the other model are the only ones that don't freeze like ice at all.

EDIT: After I watched them in 60 FPS, there's still a pause when there's victory, but when you pause the videos during that moment, you see those monitors whether they are black or green. It just depends on the FPS of the video. (I have no idea where that comes from.) Bloodbane and I were right. It's all paused, but you can see the blinking of the monitor screens. The lines don't move since it's paused.
 
Last edited:
Thanks @maxman

It is a simple pause, but the monitors are "strobe entities"
if i have the chance i will upload more samples of games that feature what i like to call "stroboscopic sprites/entities"

Contra 3 has lots of 60fps strobe effects,
Super Castlevania 4 features some - even tho the game supports transparency
Sonic 1's water features it too, but i think it gets affected by pause
Jim Power the lost dimention 3D had sprites with effects that where unaffected by pause - if i recall correctly

EDIT: After I watched them in 60 FPS, there's still a pause when there's victory, but when you pause the videos during that moment, you see those monitors whether they are black or green. It just depends on the FPS of the video. (I have no idea where that comes from.) Bloodbane and I were right. It's all paused, but you can see the blinking of the monitor screens. The lines don't move since it's paused.
In the NS engine, other examples of stroboscopic entities are these:
Chris's holy water
the blue aura that appears when you hold the attack button
chri's uppercut knee flames


stroboscopic entities on these engines might be made using a "flag" or "type" swicth that enables the engine to give such entities an automatic 60fps strobe effect, these entites's animation frames are probably programmed with a normal frame sequence (no blank frame is necessary)

and so , when pause state happens , these entities have the ability to keep on Flickering using the very last frame they where displaying.

More unfortunate news for me , because i now realize that i have to fix a bunch of the special effects in NS wide -
some have the wrong animation rate and others where corrected using drawmethod - it will be a case by case basis - but i do believe that the OG 60fps stroboscopic effects have their charm.
 
If you want to specify the name of the summoned model without having it being paused, in case you want to make a pause for freezing everything, you can declare any partner model you want.

C:
void paus0005(int iToggle, int iTime, void mName){

    void vSelf      = getlocalvar("self");                  //Caller   
    int  iETime     = openborvariant("elapsed_time");       //Current time.
    int  iMax       = openborvariant("ent_max");            //Entity count.
    int  iEntity;                                           //Loop counter.
    void vEntity;                                           //Target entity.
    void vName;                                        //Named entity.

    for(iEntity=0; iEntity<iMax; iEntity++)
    {   
        vEntity = getentity(iEntity);                                       //Get target entity from current loop.       
        vName   = getentityproperty(vEntity, "defaultname"); //Get target name
       
        if (vEntity != vSelf && vName != mName)                                               //Not Self and the model?
        {
            changeentityproperty(vEntity, "frozen", iToggle);               //Toggle frozen.
            changeentityproperty(vEntity, "freezetime", iETime + iTime);    //Toggle frozen time.
        }
    }   
}

Example:
Code:
anim freespecial10
@cmd paus0005 1 1120 "SSBomb"
offset ....
delay ....
frame ......
frame .....
frame .....

Code:
anim freespecial24
@cmd paus0005 1 741 "BigAura"
offset ....
delay ....
frame ......
frame .....
frame .....

First time I heard of strobes. Set your delay time shorter (faster) like delay 1-3 for the flashing monitor, but I don't know about other effects for that.
 
First time I heard of strobes. Set your delay time shorter (faster) like delay 1-3 for the flashing monitor, but I don't know about other effects for that.
he he i could not find any other proper name for it -

i hope i did not give myself fake memories, but i swear i have seen clouds, ghosts & lantern lights in Old games that flicker & even when they freeze/pause still flicker anyway -
these are usually 2 frame animations tho, so that is why NightSlashers's monitors where hard to imitate, due to their 9 possible states (& the fact that i did not take into account the pause).

The closest Hardcode things the engine has to this type of feature are:
alpha {int}
  • If set to 1, this entity will be displayed with alpha transparency.
  • If set to 2, this entity will use negative alpha transparency (the darker colors are stronger, like shadows).
  • If set to 3, this entity will overlay transparency. It's described in the engine as being a combination of alpha and negative alpha, and the formula is "bg<128 ? multiply(bg*2,fg) : screen((bg-128)*2,fg)".
  • If set to 4, this entity will use hardlight transparency. Seems to be the opposite of overlay. The formula is "fg<128 ? multiply(fg*2,bg) : screen((fg-128)*2,bg)".
  • If set to 5, this entity uses dodge transparency. Described in the code as being "Very nice for a colourful boost of light."
  • If set to 6, this entity will use 50% transparency. The entire entity will be 50% transparent: every pixel will be averaged with the pixel right behind it.
  • If set to 7, this entity will use Strobe effect transparency. The entire entity will automatically flicker at 60fps to simulate transparency - useful for recreating accurate effects for fan mods of Old games (This is my suggestion if you want to add this to the next engine @DCurrent ) NOTE: entities will continue to Flicker in a paused state
  • In 8bit colormode, this setting DOES NOT work with remaps. You need 16bit or 32bit color mode to use this together with remaps
nodieblink {int}
  • Sets how entity's death animation is played.
    • 0 = entity starts blinking as soon as entity die in respective FALL animation.
    • 1 = entity won't blink until after the last frame of entity's FALL or DEATH animation when killed.
anywho - @maxman , @Bloodbane , @Kratus and anyone who took interest in this silly little obsession of a thread, thank you - i will try and close it with some examples of the hypothesys - and maybe - hopefully an script/template to create automatic - pause proof strobe entities?
 
Last edited:
Back
Top Bottom