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
-
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()
------------------------------------------------------------------
-
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()
-
Would that explain my inexplicable crashes to the desktop? I get no error messages.
-
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.
-
it happened with Medusas using OGL
-
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.
-
Did I hear someone say Eureka! :)
-
:wtf:
But why does the bug only show up in recent fs2_open builds?
-
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.
-
try this
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;
}
-
I think I fixed it
-
Yep, its fixed :) The case I mention above works now and I haven't had a trap since.
Thanks!