Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Righteous1 on December 03, 2002, 11:46:05 pm

Title: warp in /warp out trap
Post by: Righteous1 on December 03, 2002, 11:46:05 pm
I'm a trap seemingly at random points during missions.  I believe others are seeing this too.  I've found a scenario that I can consistantly duplicate the problem.  

I'm using the FS2 mission The Romans Blunder(sm1-03.fs2).  The first time the Iceni jumps out, everything is fine.  If I restart the mission (ESC, select restart), the game will trap as soon as the Iceni begins to warp out.  I've  had this occur at other times and I believe a large ship was warping in or out at the time but can't swear to it.  But in the above case I can duplicate the problem consistantly.  Perhaps the warp.pof is getting free'd and not reloaded when you restart the mission?  (Just a Wild Arsed Guess)

I'm not that familiar this this part of the code.  Hopefully the above will give someone a Eureka moment.

Trap info:

Assert: Polygon_models[num]->id == model_num
File: D:\fs2_open\code\Model\ModelRead.cpp
Line: 2444

Call stack:
------------------------------------------------------------------
    model_render()    warpin_render()    fireball_render()    obj_render()    obj_render_all()    game_render_frame()    game_frame()    game_do_frame()    game_do_state()    gameseq_process_events()    WinMainSub()    WinMain()    WinMainCRTStartup()    KERNEL32.DLL bff8b560()
    KERNEL32.DLL bff8b412()
------------------------------------------------------------------
Title: warp in /warp out trap
Post by: Bobboau on December 04, 2002, 01:36:58 am
yup that is defanantly the warpmodel render

this only happens with big ships, or will this happen with small ones as well? it should be happening with both

the model is loaded from fireball_load_data(), wich is called from fireball_init(), wich is called from game_level_init(), it's getting called after model_free_all() so that shouldn't be effecting anything

the trap is in model_get()
Title: warp in /warp out trap
Post by: Sesquipedalian on December 04, 2002, 01:51:59 am
Would that explain my inexplicable crashes to the desktop?  I get no error messages.
Title: warp in /warp out trap
Post by: Righteous1 on December 04, 2002, 09:34:10 am
I haven't noticed if it happens with small ships or not.  I'll try with another mission tonight.  I've had it happen in other missions but don't remember for sure what ships were jumping in/out.
Title: warp in /warp out trap
Post by: phreak on December 04, 2002, 06:35:20 pm
it happened with Medusas using OGL
Title: warp in /warp out trap
Post by: phreak on December 04, 2002, 08:10:07 pm
which makes it the glow points crashing the game.

i found out what to do:

set 'wm' equal to -1 when model_free_all finishes

we need a separate function that loads the warpin stuff separate from fireballs because fireball_load_data is called once.
Title: warp in /warp out trap
Post by: Righteous1 on December 04, 2002, 10:00:51 pm
Did I hear someone say Eureka!  :)
Title: warp in /warp out trap
Post by: Goober5000 on December 04, 2002, 11:18:09 pm
:wtf:

But why does the bug only show up in recent fs2_open builds?
Title: warp in /warp out trap
Post by: EdrickV on December 05, 2002, 03:30:20 pm
Quote
Originally posted by Goober5000
:wtf:

But why does the bug only show up in recent fs2_open builds?


Bobboau made some changes to the warp model code, IIRC, to allow custom warp POFs.
Title: warp in /warp out trap
Post by: phreak on December 10, 2002, 05:34:16 pm
try this
Code: [Select]

extern int wm;
void model_free_all()
{
int i;

if ( !model_initted) {
model_init();
return;
}

mprintf(( "Freeing all existing models...\n" ));

for (i=0;i model_unload(i);
}
wm=-1;
}
Title: warp in /warp out trap
Post by: Bobboau on December 10, 2002, 07:34:35 pm
I think I fixed it
Title: warp in /warp out trap
Post by: Righteous1 on December 11, 2002, 08:48:35 am
Yep, its fixed :)   The case I mention above works now and I haven't had a trap since.

Thanks!