Webm out of memory

Bruce

Active member
Hello all,

I am getting this error message when using a lot of webm videos:

Code:
Sprite allocated : #2001477640
Video track: resolution=1920*1080, display resolution=1920*1080, 29.95 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 29.95 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 29.95 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 60.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 30.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 30.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 60.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 29.95 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 60.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 29.95 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 27.90 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 27.90 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample


********** An Error Occurred **********
*            Shutting Down            *

Out of memory!
Allocation of size 2073600 failed in function 'yuv_frame_create' at source/webmlib/yuv.c:123.

Obviously, I must be doing something wrong.
Can someone please advise?
Thank you
 
Hello all,

I am getting this error message when using a lot of webm videos:

Code:
Sprite allocated : #2001477640
Video track: resolution=1920*1080, display resolution=1920*1080, 29.95 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 29.95 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 29.95 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 60.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 30.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 30.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 60.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 29.95 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 60.00 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 29.95 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 27.90 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample
Video track: resolution=1920*1080, display resolution=1920*1080, 27.90 frames/second
Audio track: 44100.000000 Hz, 2 channels, 8 bits/sample


********** An Error Occurred **********
*            Shutting Down            *

Out of memory!
Allocation of size 2073600 failed in function 'yuv_frame_create' at source/webmlib/yuv.c:123.

Obviously, I must be doing something wrong.
Can someone please advise?
Thank you
My first suggestion is to use 30fps webm files with mono audio (unless if you really need stereo effect).
Second, how are the webm files played in your game (script/native)?
 
Last edited:
My first suggestion is to use 30fps webm files with mono audio (unless if you really need stereo effect).
Second, how are the webm files played in your game (script/native)?
by native.
Code:
@cmd     playwebm "data/scenes/Phoenix.webm" 0
I do want them in stereo unless it was the one that caused the problem. I just converted them to all 30 FPS in stereo but it is still giving me error message.
I hope they don't have to be in mono :-(
Thank you
 
by native.
Code:
@cmd     playwebm "data/scenes/Phoenix.webm" 0
I do want them in stereo unless it was the one that caused the problem. I just converted them to all 30 FPS in stereo but it is still giving me error message.
I hope they don't have to be in mono :-(
Thank you
You can try to optimize the file's size and bitrate using a converter, I suggest the XMedia Recode.
If I readed correctly you reached around 2gb in the log file, it's really a considerable amount.
 
But unless you have some panning happening on the audio... You won't notice any difference. Mono here isn't threated like in the old days where you hear an instrument in only one side. You will be hearing the same thing on both channels
These webm videos are from the FF RPG games. they do have panning stereo. My webm videos are large file's size and higher bitrate.
I will convert them to lower bitrate tomorrow and see, thank you
 
The reason for out of memory (which I forgot to mention above replies):
If I have both of these functions like this, it overloads the memory...
Code:
    @cmd    playwebm "data/scenes/Shiva.webm" 0  # 0 = skippable
    @cmd    SpawnByScreenRes "IceSpikes" 960 0 540 2

If I disable one of the 2, then it is working fine.


Here are the tests I have tried:

1. Reduce the size of the Webm videos and to mono
2. Change all png files to gif files
3. Remove palette none

But none of these helped.....



I am so lost and confused of what's going on. Why it can only have one of the two functions, not both?
Maybe it is a bug?
 
I am so lost and confused of what's going on. Why it can only have one of the two functions, not both?
I would like to take a look at how these functions were build, please can you post them?
By looking how you are calling them, I assume you are using inside an animation, right? Please, post the animation too.
 
Char.txt:
Code:
anim    freespecial15
    hitflash    Flash2
    hitfx    data/sounds/beat1.wav
    offset    102 252
    BBox    64 8 153 265
    @cmd    FreezeEnemies 300   
    Frame    data/chars/terry/sp400.gif
#    sound    data/chars/terry/bkn.wav
    @cmd     playwebm "data/scenes/Shiva.webm" 0  # 0 = skippable
    @cmd    SpawnByScreenRes "IceSpikes" 960 0 540 2
    @cmd     musicPlay
    delay     6
    Frame    data/chars/terry/sp400.gif
    Frame    data/chars/terry/sp401.gif
    Frame    data/chars/terry/sp406.gif

I changed the Openbor Template to 1080P resolution to test out some stuff..


IceSpike entity:
Code:
name          IceSpikes
nomove        1
type        none
scroll        1  # scroll with level/panel
antigravity 100  # always in the air (never drops down)
hostile        enemy
candamage    enemy npc obstacle shot
speed        0
noquake        1
falldie        1
remove        0
flash         flash
alpha         1  # alpha transparency
dust        dust01
setlayer    1000
lifespan     4

load quake

anim    idle
     hitflash    Flash2
    hitfx        data/sounds/beat1.wav
    fastattack    1
    attackone    0
    loop        0   
    bbox    0 0 0 0
    sound    data/sounds/IceSpikes.wav
    offset    960 540 
    delay     5
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS01.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS02.gif
    attack    0 0 0 0
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS03.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS04.gif
    attack    0 0 1910 1080  3 100 0 0 5 600
    dropv    2  1
    @cmd    projectile 1 "quake" 0 0 0   
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS05.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS06.gif
    attack    0 0 0 0
    @cmd projectile 1 "ColdFX1" 0 0 0
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS07.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS08.gif
    attack    0 0 1910 1080  3 100 0 0 5 600
    dropv    2  1
    @cmd    projectile 1 "quake" 0 0 0   
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS09.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS10.gif
    attack    0 0 0 0
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS11.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS12.gif
    attack    0 0 1910 1080  3 100 0 0 5 600
    dropv    2  1
    @cmd    projectile 1 "quake" 0 0 0   
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS13.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS14.gif
    attack    0 0 0 0
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS15.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS16.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS17.gif
    attack    0 0 1910 1080  3 100 0 0 5 600
    dropv    2  1.5
    @cmd    projectile 1 "quake" 0 0 0   
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS18.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS19.gif
    attack    0 0 0 0
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS20.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS21.gif
    attack    0 0 1910 1080  3 100 0 0 5 600
    dropv    3  2
    ...
    ....
    
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    
    drawmethod alpha 6
    drawmethod channel 0.90
    delay 10
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.80
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.70
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.60
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.50
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.40
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.30
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.20
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.10
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    @cmd    killentity getlocalvar("self")       
    delay    1
    frame    data/chars/misc/empty.gif
    frame    data/chars/misc/empty.gif
    frame    data/chars/misc/empty.gif

SpawnByScreenRes script:
Code:
// By Bloodbane
//Usage: @cmd    SpawnByScreenRes "ThunderBolt1" 960 0 540 2
void SpawnByScreenRes(void EntityName, float fX, float fY, float fZ, int FacingDir)
{
    //FacingDir: 0 = opposite dir, 1 = same dir, 2 = always facing right, 3 = always facing left
    //Spawns entity based on left screen edge and z axis
    //Auto adjust with camera's position
    //EntityName: Model name of entity to be spawned in.
    //fX: X distance relative to left edge
    //fY: Y height from ground
    //fZ: Z coordinate

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
    int PlayerDir = getentityproperty(self, "direction");
    int XPos = openborvariant("xpos"); //Get screen edge's position
    int YPos = openborvariant("ypos"); // Get camera position
    int ScreenRes = openborvariant("hResolution"); // Get screen width/horizontal

    clearspawnentry(); //Clear current spawn entry.
    setspawnentry("name", EntityName); //Acquire spawn entity by name.

    vSpawn = spawn(); //Spawn in entity.

    if(PlayerDir == 0){    //if player is facing left
      fX = ScreenRes-fX; //Reverse X direction to match facing and screen length
    }
  
    if(FacingDir==1) { //if spawn entity's flag is 1 (facing same direction as player)
        changeentityproperty(vSpawn, "direction", PlayerDir); //spawn entity faces same direction as player
    } else if(FacingDir==2) {   
        changeentityproperty(vSpawn, "direction", 1);  //spawn entity faces opposite direction as player
    } else if(FacingDir==3) {
        changeentityproperty(vSpawn, "direction", 0);  //spawn entity faces opposite direction as player
    } else changeentityproperty(vSpawn, "direction", (1-PlayerDir) );  //spawn entity faces opposite direction as player
    
    changeentityproperty(vSpawn, "position", fX + XPos, fZ + YPos, fY); //Set spawn location.
    changeentityproperty(vSpawn, "parent", self);   
    return vSpawn; //Return spawn
}

After I spawn them for 8-10 times then it freezes the game because of out of memory.
If I disable IceSpikes entity or @cmd playwebm then it never causes out of memory.


Thank you so much
 
Char.txt:
Code:
anim    freespecial15
    hitflash    Flash2
    hitfx    data/sounds/beat1.wav
    offset    102 252
    BBox    64 8 153 265
    @cmd    FreezeEnemies 300  
    Frame    data/chars/terry/sp400.gif
#    sound    data/chars/terry/bkn.wav
    @cmd     playwebm "data/scenes/Shiva.webm" 0  # 0 = skippable
    @cmd    SpawnByScreenRes "IceSpikes" 960 0 540 2
    @cmd     musicPlay
    delay     6
    Frame    data/chars/terry/sp400.gif
    Frame    data/chars/terry/sp401.gif
    Frame    data/chars/terry/sp406.gif

I changed the Openbor Template to 1080P resolution to test out some stuff..


IceSpike entity:
Code:
name          IceSpikes
nomove        1
type        none
scroll        1  # scroll with level/panel
antigravity 100  # always in the air (never drops down)
hostile        enemy
candamage    enemy npc obstacle shot
speed        0
noquake        1
falldie        1
remove        0
flash         flash
alpha         1  # alpha transparency
dust        dust01
setlayer    1000
lifespan     4

load quake

anim    idle
     hitflash    Flash2
    hitfx        data/sounds/beat1.wav
    fastattack    1
    attackone    0
    loop        0  
    bbox    0 0 0 0
    sound    data/sounds/IceSpikes.wav
    offset    960 540
    delay     5
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS01.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS02.gif
    attack    0 0 0 0
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS03.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS04.gif
    attack    0 0 1910 1080  3 100 0 0 5 600
    dropv    2  1
    @cmd    projectile 1 "quake" 0 0 0  
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS05.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS06.gif
    attack    0 0 0 0
    @cmd projectile 1 "ColdFX1" 0 0 0
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS07.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS08.gif
    attack    0 0 1910 1080  3 100 0 0 5 600
    dropv    2  1
    @cmd    projectile 1 "quake" 0 0 0  
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS09.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS10.gif
    attack    0 0 0 0
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS11.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS12.gif
    attack    0 0 1910 1080  3 100 0 0 5 600
    dropv    2  1
    @cmd    projectile 1 "quake" 0 0 0  
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS13.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS14.gif
    attack    0 0 0 0
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS15.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS16.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS17.gif
    attack    0 0 1910 1080  3 100 0 0 5 600
    dropv    2  1.5
    @cmd    projectile 1 "quake" 0 0 0  
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS18.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS19.gif
    attack    0 0 0 0
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS20.gif
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS21.gif
    attack    0 0 1910 1080  3 100 0 0 5 600
    dropv    3  2
    ...
    ....
   
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
   
    drawmethod alpha 6
    drawmethod channel 0.90
    delay 10
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.80
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.70
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.60
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.50
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.40
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.30
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.20
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    drawmethod channel 0.10
    frame    data/chars/SummonSkills/Ultimate/IceBlast/IS40.gif
    @cmd    killentity getlocalvar("self")      
    delay    1
    frame    data/chars/misc/empty.gif
    frame    data/chars/misc/empty.gif
    frame    data/chars/misc/empty.gif

SpawnByScreenRes script:
Code:
// By Bloodbane
//Usage: @cmd    SpawnByScreenRes "ThunderBolt1" 960 0 540 2
void SpawnByScreenRes(void EntityName, float fX, float fY, float fZ, int FacingDir)
{
    //FacingDir: 0 = opposite dir, 1 = same dir, 2 = always facing right, 3 = always facing left
    //Spawns entity based on left screen edge and z axis
    //Auto adjust with camera's position
    //EntityName: Model name of entity to be spawned in.
    //fX: X distance relative to left edge
    //fY: Y height from ground
    //fZ: Z coordinate

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
    int PlayerDir = getentityproperty(self, "direction");
    int XPos = openborvariant("xpos"); //Get screen edge's position
    int YPos = openborvariant("ypos"); // Get camera position
    int ScreenRes = openborvariant("hResolution"); // Get screen width/horizontal

    clearspawnentry(); //Clear current spawn entry.
    setspawnentry("name", EntityName); //Acquire spawn entity by name.

    vSpawn = spawn(); //Spawn in entity.

    if(PlayerDir == 0){    //if player is facing left
      fX = ScreenRes-fX; //Reverse X direction to match facing and screen length
    }
 
    if(FacingDir==1) { //if spawn entity's flag is 1 (facing same direction as player)
        changeentityproperty(vSpawn, "direction", PlayerDir); //spawn entity faces same direction as player
    } else if(FacingDir==2) {  
        changeentityproperty(vSpawn, "direction", 1);  //spawn entity faces opposite direction as player
    } else if(FacingDir==3) {
        changeentityproperty(vSpawn, "direction", 0);  //spawn entity faces opposite direction as player
    } else changeentityproperty(vSpawn, "direction", (1-PlayerDir) );  //spawn entity faces opposite direction as player
   
    changeentityproperty(vSpawn, "position", fX + XPos, fZ + YPos, fY); //Set spawn location.
    changeentityproperty(vSpawn, "parent", self);  
    return vSpawn; //Return spawn
}

After I spawn them for 8-10 times then it freezes the game because of out of memory.
If I disable IceSpikes entity or @cmd playwebm then it never causes out of memory.


Thank you so much
At first sight there's no problem in the code, have you tried to spawn another entity like flash instead of the IceSpikes? I see that this entity calls other entities like quake and ColdFX1.

Code:
anim freespecial15
@cmd FreezeEnemies 300
@cmd playwebm "data/scenes/Shiva.webm" 0 # 0 = skippable
@cmd musicPlay
I would like to take a look at all these other functions too.
 
At first sight there's no problem in the code, have you tried to spawn another entity like flash instead of the IceSpikes? I see that this entity calls other entities like quake and ColdFX1.


I would like to take a look at all these other functions too.
Last night, I even disabled ColdFX to try too.
I just took a look at the function musicPlay on my thumb drive, and it looks totally different than what I had before.
This one requires 3 entities: void musicPlay(void music, int loop, int offset) which has nothing to do with what I intended to do.
But then why it didn't give me the error message for this?
I know I have updated this script before... huh, I will take a look at it and will try to spawn something else instead of IceSpikes to try when I get home.

Here is the Freeze enemies:
Code:
//by Bloodbane (edited by Bruce)
//1 second = 100 centiseconds
void FreezeEnemies(int TIME)
{
    void vEntity; //Target entity placeholder.
    int iEntity; //Entity enumeration holder.
    int iMax = openborvariant("count_entities"); //Entity count.
    int eTime = openborvariant("elapsed_time");
        //Enumerate and loop through entity collection.
    for(iEntity=0; iEntity<iMax; iEntity++){
        vEntity = getentity(iEntity); //Get target entity from current loop.
        //int iName = getentityproperty(vEntity, "defaultname"); //Get target name

        if(getentityproperty(vEntity, "type")==openborconstant("TYPE_enemy")){
            changeentityproperty(vEntity, "frozen", 1);
            changeentityproperty(vEntity, "freezetime", eTime + TIME);  //1 second = 100 centiseconds
        }
    }
}

Thank you

Edit:
Uhh, on my thumb drive, there is another file called Musics with this musicPlay() function in it. Basically there are 2 musicPlay() functions on two different files:
1. musicPlay()
2. musicPlay(void music, int loop, int offset)

I'll need to remove the function musicPlay(void music, int loop, int offset) off my main animation script when I get home.
 
Last edited:
Last night, I even disabled ColdFX to try too.
I just took a look at the function musicPlay on my thumb drive, and it looks totally different than what I had before.
This one requires 3 entities: void musicPlay(void music, int loop, int offset) which has nothing to do with what I intended to do.
But then why it didn't give me the error message for this?
I know I have updated this script before... huh, I will take a look at it and will try to spawn something else instead of IceSpikes to try when I get home.

Here is the Freeze enemies:
Code:
//by Bloodbane (edited by Bruce)
//1 second = 100 centiseconds
void FreezeEnemies(int TIME)
{
    void vEntity; //Target entity placeholder.
    int iEntity; //Entity enumeration holder.
    int iMax = openborvariant("count_entities"); //Entity count.
    int eTime = openborvariant("elapsed_time");
        //Enumerate and loop through entity collection.
    for(iEntity=0; iEntity<iMax; iEntity++){
        vEntity = getentity(iEntity); //Get target entity from current loop.
        //int iName = getentityproperty(vEntity, "defaultname"); //Get target name

        if(getentityproperty(vEntity, "type")==openborconstant("TYPE_enemy")){
            changeentityproperty(vEntity, "frozen", 1);
            changeentityproperty(vEntity, "freezetime", eTime + TIME);  //1 second = 100 centiseconds
        }
    }
}

Thank you

Edit:
Uhh, on my thumb drive, there is another file called Musics with this musicPlay() function in it. Basically there are 2 musicPlay() functions on two different files:
1. musicPlay()
2. musicPlay(void music, int loop, int offset)

I'll need to remove the function musicPlay(void music, int loop, int offset) off my main animation script when I get home.
I put your FreezeEnemies function in my game but the memory does not change, the only remaining functions to look at are musicPlay and playwebm. I'm curious to see both.
 
I was troubleshooting the whole afternoon and finally figured out what caused the out of memory problem.

I had some entities with png files in 8-bit index with background color be the last color because of Photoshop.
Some were also in RGB color.

Although IceSpikes entity wasn't one of them, as soon the model loads those entities, it already overloads the memory.

When the game is in low resolution, it may not be problem, but 1080p resolution game is a big deal.

Solutions:

*Edit by DC:* Removed incorrect solutions.

Thank you for everyone's input.
God bless you all!
 
Last edited by a moderator:
I had some entities with png files in 8-bit index with background color be the last color because of Photoshop.
I think you did something wrong, because the background color is the first one on the palette (not the last) and Photoshop never forces it to be the last one - it forces to be the first one.

How are you converting those files?

I saw the video and.. are you sure you want that? Because the screen is frozen for too much time just for a cinematic thing. Just think about when you are playing in co-op... The other players will have to wait for too long.

Also, your code freeze the enemies... But how about the other players?
 
Back
Top Bottom