My new char crashes my game.

Chris Monvel

Active member
While working on a new character for my roster something unexpected just happened, game crashes when choosing a game mode before the select screen. This didn't happen before adding this new char. I've searched for some explanation into the log and nothing, just everything seems normal:

Total Ram: 25643151360 Bytes
Free Ram: 18066698240 Bytes
Used Ram: 7159808 Bytes

debug:nativeWidth, nativeHeight, bpp, Hz 1280, 1024, 24, 60
OpenBoR v3.0 Build , Compile Date: Aug 29 2018

Game Selected: ./Paks/AVP Battlegrounds.pak

FileCaching System Init...... Disabled
Initializing video............
Reading video settings from 'data/video.txt'.

Colordepth is depreciated. All modules are displayed with a 32bit color screen.

Initialized video............. 480x272 (Mode: 1)

Loading menu.txt............. Done!
Loading fonts................ 1 2 3 4 5 6 7 8 Done!
Timer init................... Done!
Initialize Sound.............. Done!
Loading sprites.............. Done!
Loading level order.......... Done!
Loading model constants...... Done!
Loading script settings...... Done!
Loading scripts.............. Done!
Loading models...............

Cacheing 'alien_blood' from data/chars/AlienA/Blood/alien_blood.txt
Cacheing 'predator_blood' from data/chars/PredatorA/Blood/predator_blood.txt
Cacheing 'plasma' from data/chars/PredatorA/Plasma/plasma.txt
Cacheing 'Bullet' from data/chars/misc/bullet.txt
Cacheing 'Bullet2' from data/chars/misc/bullet2.txt
Cacheing 'Bullet3' from data/chars/misc/bullet3.txt
Cacheing 'explosion' from data/chars/misc/explosion/explosion.txt
Cacheing 'flamethrower' from data/chars/misc/flamethrower/flamethrower.txt
Cacheing 'flamethrower2' from data/chars/misc/flamethrower/flamethrower2.txt
Cacheing 'splatter' from data/chars/misc/splatter.txt
Cacheing 'Merchant_Bike' from data/chars/Merchant/Merchant_Bike.txt
Cacheing 'Al_A' from data/chars/AlienA/AlienA.txt
Cacheing 'Pr_A' from data/chars/PredatorA/PredatorA.txt
Cacheing 'Jill' from data/chars/Jill/Jill.txt
Cacheing 'Cursor' from data/chars/Database/Cursor.txt
Cacheing 'Apple' from data/chars/misc/apple.txt
Cacheing 'Meat' from data/chars/misc/meat.txt
Cacheing '1up' from data/chars/misc/1up.txt
Cacheing 'Money' from data/chars/misc/money.txt
Cacheing 'Gold' from data/chars/misc/gold.txt
Cacheing 'Time' from data/chars/misc/time.txt
Cacheing 'Ammo' from data/chars/misc/ammo.txt
Cacheing 'Door' from data/chars/misc/Door.txt
Cacheing 'Box' from data/chars/misc/box.txt
Cacheing 'Crate' from data/chars/misc/crate.txt
Cacheing 'Trash' from data/chars/misc/trash.txt
Cacheing 'Table' from data/chars/misc/table.txt
Cacheing 'Chair' from data/chars/misc/chair.txt
Cacheing 'Fence' from data/chars/misc/fence.txt
Cacheing 'Trolly' from data/chars/misc/trolly.tx
Cacheing 'Merchant_Dealer' from data/chars/Merchant/Merchant_Dealer.txt
Cacheing 'Dummy' from data/chars/Dummy/Dummy.txt
Cacheing 'zombie' from data/chars/zombie/zombie.txt
Cacheing 'Ramon' from data/chars/ramon/ramon.txt
Cacheing 'Rain' from data/chars/misc/rain2/Rain.txt
Cacheing 'drops' from data/chars/misc/rain/drops/drops.txt
Cacheing 'Knife' from data/chars/misc/knife.txt
Cacheing 'Shot' from data/chars/misc/shot.txt
Cacheing 'Star' from data/chars/misc/star.txt
Cacheing 'Steam' from data/chars/misc/steam.txt
Cacheing 'burn' from data/chars/misc/burn.txt
Cacheing 'Steamer' from data/chars/misc/steamer.txt
Cacheing 'Furnace' from data/chars/misc/furnace.txt
Cacheing 'Crab' from data/chars/crab/crab.txt
Cacheing 'Lobster' from data/chars/Lobster/Lobster.txt
Cacheing 'Swat' from data/chars/Swat/Swat.txt
Cacheing 'Smoke' from data/levels/crash/smoke/smoke.txt
Cacheing 'RPD_Dialogues' from data/chars/Dialogues/rpddialogue.txt

Loaded 'alien_blood' from data/chars/AlienA/Blood/alien_blood.txt
Loaded 'predator_blood' from data/chars/PredatorA/Blood/predator_blood.txt
Loaded 'plasma' from data/chars/PredatorA/Plasma/plasma.txt
Loaded 'Bullet' from data/chars/misc/bullet.txt
Loaded 'Bullet2' from data/chars/misc/bullet2.txt
Loaded 'Bullet3' from data/chars/misc/bullet3.txt
Loaded 'explosion' from data/chars/misc/explosion/explosion.txt
Loaded 'flamethrower' from data/chars/misc/flamethrower/flamethrower.txt
Loaded 'flamethrower2' from data/chars/misc/flamethrower/flamethrower2.txt
Loaded 'splatter' from data/chars/misc/splatter.txt
Loaded 'Merchant_Bike' from data/chars/Merchant/Merchant_Bike.txt
Loaded 'Al_A' from data/chars/AlienA/AlienA.txt
Loaded 'Pr_A' from data/chars/PredatorA/PredatorA.txt
Loaded 'Jill' from data/chars/Jill/Jill.txt
Loaded 'Cursor' from data/chars/Database/Cursor.txt
Loaded 'Merchant_Dealer' from data/chars/Merchant/Merchant_Dealer.txt

Loading models............... Done!
Object engine init........... Done!
Input init................... No Joystick(s) Found!
Done!
Create blending tables....... Done!
Save settings so far........ Done!

This already happened to me while updating a character with new commands and animations, the problem was found due to a misspelling in the pallete declaration, where
it was noted as "palette" instead.

MODELS.TXT
# Required objects. These must always be loaded.
load alien_blood data/chars/AlienA/Blood/alien_blood.txt
load predator_blood data/chars/PredatorA/Blood/predator_blood.txt<<<<<<<<<<< CHARACTER'S OWN BLOOD
load plasma data/chars/PredatorA/Plasma/plasma.txt<<<<<<<<<<<<<<<<<<< CHARACTER'S PROJECTILE
load Bullet data/chars/misc/bullet.txt
load Bullet2 data/chars/misc/bullet2.txt
load Bullet3 data/chars/misc/bullet3.txt
load explosion data/chars/misc/explosion/explosion.txt
load flamethrower data/chars/misc/flamethrower/flamethrower.txt
load flamethrower2 data/chars/misc/flamethrower/flamethrower2.txt
load splatter data/chars/misc/splatter.txt
load Merchant_Bike data/chars/Merchant/Merchant_Bike.txt

# Players must also be loaded.
load Al_A data/chars/AlienA/AlienA.txt
load Pr_A data/chars/PredatorA/PredatorA.txt<<<<<<<<<<<<<< CHARACTER CONFLICTING
load Jill data/chars/Jill/Jill.txt

This is my character's .txt header.

name Pr_A
health 140
speed 14
running 18 4 2 1 1
mp 50
atchain 1 2 3 4
type player
shadow 3
gfxshadow 1 1
load plasma<<<<<<<<<<<<<<<CHARACTER'S PROJECTILE DECLARED
flash predator_blood<<<<<<<<<CHARACTER'S OWN BLOOD DECLARED TOO
noatflash 1
diesound data/chars/PredatorA/predator_death.wav
weapons Cursor PredatorA

icon data/chars/PredatorA/icon.gif 1
iconpain data/chars/PredatorA/iconpain.gif
icondie data/chars/PredatorA/icondie.gif

palette data/chars/PredatorA/palette_00.gif
alternatepal data/chars/PredatorA/palette_01.gif
alternatepal data/chars/PredatorA/palette_02.gif
alternatepal data/chars/PredatorA/palette_03.gif
alternatepal data/chars/PredatorA/palette_04.gif

com a2 freespecial6
com a3 freespecial7
com a4 freespecial8

And the command for the projectile.

anim freespecial7
energycost 5 1 0
loop 0
delay 6
offset 48 125
frame data/chars/PredatorA/A3_01.gif
offset 48 128
frame data/chars/PredatorA/A3_02.gif
sound data/chars/PredatorA/predator_cannon.wav
@cmd projectile 1 "plasma" 5 1 90 1 0<<<<<<<<<<<<<<<<<<THIS IS THE COMMAND
offset 66 124
frame data/chars/PredatorA/A3_03.gif
offset 69 134
frame data/chars/PredatorA/A3_04.gif
delay 15
offset 66 124
frame data/chars/PredatorA/A3_03.gif

I tried to remove any aditional elements to make the character work on its own and same happens. Sprites are indexed for sure as well.

Declaring elements like these have never been a problem for me since I've done this thousands of times and I've experienced this before only once due the reasons previously mentioned above. It's so confusing and hard to tell what's actually happening.

I've been trying to find the problem but I just can't and it frustrates me when Openbor does this kind of stuff. A little help might be appreciated please! I can provide a link to the character in private for further examinations.
 
Last edited:
It's not that either. I even got surprised for not getting to the select screen.
Hello @Chris Monvel

It seems that there's a unsuccessful process in the select screen. Once the problem started after a specific character addition, I suggest to reduce gradually the code of this character until the crash not happens. This way you can gradually isolate where the problem is and check it line by line.

Sometimes I have this same problem when I forget to load a specific additional entity related to another entity, or when I use the "unload model" function (it's the "load" function with the flag "3") in a wrong place.
 
Hello @Chris Monvel

It seems that there's a unsuccessful process in the select screen. Once the problem started after a specific character addition, I suggest to reduce gradually the code of this character until the crash not happens. This way you can gradually isolate where the problem is and check it line by line.

Sometimes I have this same problem when I forget to load a specific additional entity related to another entity, or when I use the "unload model" function (it's the "load" function with the flag "3") in a wrong place.
I removed any aditional element to keep the character on its own, deleted any previous saves/cfg, checked every single animation (they're all properly displayed in Openbor stats). I even had to remove the character from the MODELS.txt and test the game, and still happens!
 
Rarely, some files can corrupt, like image files or txt, and it can cause these "silent crashes" with no log.
I can take a look at your game if you want.
 
Rarely, some files can corrupt, like image files or txt, and it can cause these "silent crashes" with no log.
I can take a look at your game if you want.
Something weird just happened. I added the character to a blank Openbor mod and loaded perfectly. 😳 I don't know what just happened. I guess I'm moving my project to this blank template to avoid any other stuff in the future.
 
Something weird just happened. I added the character to a blank Openbor mod and loaded perfectly. 😳 I don't know what just happened. I guess I'm moving my project to this blank template to avoid any other stuff in the future.
Hmm I'm suspecting that there's one or more corrupted files on your previous template, it happened to me a few times.
It's good to know that the problem is solved.
 
No error shutdowns at the select screen are almost always due to a corrupted or erroneously referenced palette file. That's where you need to begin your search.

DC
 
No error shutdowns at the select screen are almost always due to a corrupted or erroneously referenced palette file. That's where you need to begin your search.

DC
I rebuilt both the character and mod from scratch to avoid any issues just to make sure, rearranged sprites and everything. Everything seems normal now and I don't understand what just happened.
 
Last edited:
@Chris Monvel : can you attach your new char's text in your next reply?

I'd like to see if he/she has FREESPECIAL, ATTACK or FOLLOW animation which is not supported (yet) in your module BUT supported by blank mod.
Excepting for FOLLOW, the rest of animations are there and didn't cause any conflict. I rebuilt both the character and mod from scratch because my previous version got damaged somehow after that (luckily my mod was a very early prototype and didn't have too much progress).

I removed the projectile to avoid conflicts and it's strange because now everything is loading perfectly and both mods (as all my Openbor projects) use the same template and never had this issue until now. I don't know what just happened but i managed to solve it for now. I'm afraid it will happen again.
 
Excepting for FOLLOW, the rest of animations are there and didn't cause any conflict. I rebuilt both the character and mod from scratch because my previous version got damaged somehow after that (luckily my mod was a very early prototype and didn't have too much progress).

I removed the projectile to avoid conflicts and it's strange because now everything is loading perfectly and both mods (as all my Openbor projects) use the same template and never had this issue until now. I don't know what just happened but i managed to solve it for now. I'm afraid it will happen again.
What text editor are you using? I'm asking that because when it happened to me, I was using windows notepad and notepad++, but I discovered that if you open the same text file on two or more editors (like notepad and obeditor or CMT) it can corrupt txt files too.

I remember that all I did to fix my game it was to create a fresh txt file and paste exactly the same content from the corrupted file (yes, sometimes the corrupted file can be readable).

Same as I said in my previous post, it's rare (happened around 3 times in more than 5 years), but a thing that can really happen.
As a suggestion, I recommend using Visual Studio Code. I have had no more problems since I changed to this app. And try to not open the same file on two or more editors.
 

What text editor are you using? I'm asking that because when it happened to me, I was using windows notepad and notepad++, but I discovered that if you open the same text file on two or more editors (like notepad and obeditor or CMT) it can corrupt txt files too.

I remember that all I did to fix my game it was to create a fresh txt file and paste exactly the same content from the corrupted file (yes, sometimes the corrupted file can be readable).

Same as I said in my previous post, it's rare (happened around 3 times in more than 5 years), but a thing that can really happen.
As a suggestion, I recommend using Visual Studio Code. I have had no more problems since I changed to this app. And try to not open the same file on two or more editors.
I use OpenborStats but i never save my text files using it, i save it manually through the txt file because I'm aware of OpenborStats "problem" when saving.

What i had to do was remove the projectiles or any present scripts, rebuilt the mod from scratch and add the character only keeping the basics. It worked now and I decided to update it quickly with its original features and scripts as it was originally conceived. Now the characters plays perfectly as it was meant to be and I'm relieved now but still don't know what happened.

How does Visual Studio work? Can you provide a link to take a look please?
 
@Chris Monvel

Visual Studio is a full featured IDE designed for building code projects. It's really more meant for doing heavy duty work like building the OpenBOR engine itself, but is also great for module making. I use it for all my coding and OpenBOR module making projects. It integrates with Git out of the box, and that's another tool you should really learn. If you put your module into GitHub, you always have backup copies of your work and can instantly roll back to a working iteration if something goes wrong - no need for a total rebuild.

The only issue with VS is that it is expensive, but they offer a complete academic version that isn't hard to get.

DC

1644081044535.png1644081079675.png
 
@Chris Monvel

Can you provide a link to take a look please?
In the link below you can download both Visual Studio or VSCode. I like both due to all the benefits DC said, but currently I prefer VSCode because it's faster, free, multiplatform and has some features from Visual Studio IDE.


Here you can see a more detailed description and comparison to see which will fit better for you.



@DCurrent
If you put your module into GitHub, you always have backup copies of your work and can instantly roll back to a working iteration if something goes wrong - no need for a total rebuild.
The backup is really a interesting feature, I'm wonder if the GitHub allow multiple backups or only the latest.
 
The backup is really a interesting feature, I'm wonder if the GitHub allow multiple backups or only the latest.

It's not really a "backup" in the the traditional sense. It's the same principal we use for building the engine, only applied to your module instead. As you make changes, you commit them, and then push to the online repository.

In other words, the git repository has all of your progressive changes as you commit them, so at any point you can go back and look at older versions, or revert to them if you want. It's the best of all worlds. If you lose your local copy of the repository, no problem. You just pull down the git copy and keep right on going like nothing ever happened. If you make changes you want to undo (like a script that's crashing and you just can't figure out why), you can revert an individual commit. This creates a new commit without the changes from the reverted one, and you're good to go.

DC
 
Back
Top Bottom