4 registered members (ozgur, Ayumi, VHX, monarch),
1,161
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Random Crashes under Windows 10
[Re: Superku]
#471465
03/05/18 15:04
03/05/18 15:04
|
Joined: Apr 2002
Posts: 680 Germany
Turrican
OP
User
|
OP
User
Joined: Apr 2002
Posts: 680
Germany
|
Just a status update: The increased nexus really seems to help. I still have to perform some more thorough testing on other machines, but so far Kartoffel and me had no more random crashes.
@jcl: Of course we've already checked all these functions related to the <P>/Pause feature (UI scripts, control scripts, sounds, graphics, entities, pointers, etc.) and we can rule out errors in these areas. Of course, we also investigated other loops running at the same time. The problem was that the crash occurred not only in connection with the pause function, but also when loading levels and playing larger sound files. I don't know if I'm telling the symptoms correctly, but for me personally this indicates a possible lack of memory.
I could imagine that at a certain point in time the reserved virtual memory was too full and therefore memory areas might have been overwritten, resulting in script malfunctions, error messages in "clean" code parts and, ultimately, crashes. This is also supported by the fact that the crashes have changed their behaviour or occurred later/less often after we excluded particularly large model files from the game's code. However, that's only a speculation due to the absence of an actual, reliable error source.
@jumpman: You might be right about that. I also think there may still be a problem in the source code and I'll make sure to analyze the whole code again. Last week I did what you suggested: Setting the Nexus very low and reducing the code until the engine ran stable. The whole thing was very tedious and time-consuming. Unfortunately, I could not detect any errors in the excluded code areas. I was able to fix some other bugs on the way though - some of these fixes definitely helped to make the version more stable, so all of this wasn't in vain.
Anway, at the moment I am very happy that the game is running without crashes, so now I'm going to invest my time into actual content polishing. I'll also give my partners green light so they can continue their work.
Thanks so far to all of you. In case the crash reoccurs, I'll let you know by posting here... Fingers crossed!
|
|
|
Re: Random Crashes under Windows 10
[Re: jumpman]
#471479
03/05/18 20:14
03/05/18 20:14
|
Joined: Sep 2003
Posts: 9,859
FBL
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 9,859
|
I can only give my standard hints here, which made me get projects to publish and runproperly more than one time:
- never trigger any level loading from an entity funtion. Either use some status handshake/polling for triggering the level change, or at least set my to null in order to decouple the function from an entity. - never do complex things in events. No entity movement, no entity removal or creation. and - surprise - no level loading. Again, use a polling function for these things and inside the event function only set a status/or flags which is regularly evaluated by the polling function. - take care with media instructions and videos (especially in connection with render to texture). A level change can cause real problems if media streaming is not stopped properly before level change. - wait(1). The most hated statement and the imaginary fix for everything, yes. But in fact there are instruction like ptr_remove() (anything related spawning or deleting objects) which simply require to have the entity alive for at least one frame. I think somewhere in the manual there is (was?) a list of so called "dangerous instructions". Those should also never be called in event functions, as they can get you into extremly nasty random behavior. - any looping entity function should have a well defined exit condition and not just a while(1). If the entity is deleted, the my pointer of the looping entity function is not guaranteed to be set to null, so the function may continue running - and it can even "switch" to a different entity this way". Always stop the entity loop(s), afterwards remove the entity.
Likely none of these are your problem, but it's the standards I always checked. With nearly every Ackcon there was some mysterious crash behavior which was solved by reviewing the code fo the issues mentioned above.
|
|
|
Re: Random Crashes under Windows 10
[Re: Iglarion]
#471574
03/10/18 10:59
03/10/18 10:59
|
Joined: Apr 2002
Posts: 680 Germany
Turrican
OP
User
|
OP
User
Joined: Apr 2002
Posts: 680
Germany
|
Oh no, that sounds bad. Have you tried to raise the nexus as a "hotfix"? As a next step I would recommend to check which functions are still running during level_load and to make sure to close them manually if necessary. I counted up a global variable and let the loading routine wait until all functions were terminated and the variable reached zero. Here's a code snippet, adapted from the one in this thread, which you can use to write out the currently running functions using engine_gettaskinfo:
void print_all_running_tasks(STRING* _filename)
{
proc_mode = PROC_LATE;
STRING * STR_NEW_LINE = str_create("
");
int i=0;
char* funcname;
ENTITY* ent;
var _file=file_open_write(_filename);
for(i=0;i<num_actions;i++)
{
engine_gettaskinfo(i,&funcname,&ent);
if(funcname!=NULL)
{
file_str_write(_file,"[ ");
if(i<10) { file_str_write(_file,"0"); }
if(i<100) { file_str_write(_file,"0"); }
if(i<1000) { file_str_write(_file,"0"); }
file_var_write(_file,i);
file_str_write(_file,"] - ");
file_str_write(_file,funcname);
file_str_write(_file, STR_NEW_LINE);
}
else
{
file_str_write(_file,"funcname was NULL");
}
}
file_close(_file);
str_remove(STR_NEW_LINE);
}
Maybe there are also some pointers from the previous level that you should remove before switching levels? Basically you should also go through Firoball's (very helpful!) tips, maybe your problem can be solved with it. I wonder if these Windows 10 crashes might be due to a general engine bug after all.
|
|
|
Re: Random Crashes under Windows 10
[Re: Turrican]
#471577
03/10/18 12:44
03/10/18 12:44
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
If you publish your game through SED it will always be compiled with the default nexus. You can create a custom starter window and write COMMAND "-nx 200"; in the window definition to launch it with the correct value. Wait, does your game crash in test or published mode? @Iglarion If it is the latter have you tried copying all source files (models, textures, sounds, media files, text files) over to the published folder? EDIT: Not trying to sound like a smartass here but... But in fact there are instruction like ptr_remove() (anything related spawning or deleting objects) which simply require to have the entity alive for at least one frame. This is not quite true, you can remove the entity immediately on creation (in its action or after ent_create). I do this all the time in my game based on level progress/ checkpoints. any looping entity function should have a well defined exit condition [...] Always stop the entity loop(s), afterwards remove the entity. If you don't use PROC_GLOBAL (at all in your code - which IMO you really shouldn't, it's buggy in my opinion and does nasty stuff as described indirectly by Firoball) removing an entity will stop its (while(1) loop) function.
Last edited by Superku; 03/10/18 12:53.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Random Crashes under Windows 10
[Re: Turrican]
#471579
03/10/18 12:49
03/10/18 12:49
|
Joined: Jul 2004
Posts: 785 Serbia
Iglarion
User
|
User
Joined: Jul 2004
Posts: 785
Serbia
|
Yes I try raise nexus, at first I thought this help a bit, or put off the time of crashing engine, but happens again.
Today I modified my code to be able moving fast trought all levels, and after playing game in developement mode about one hour I reach crash, but now after level load: Error E2005 Can't create DirectX texture Skin1.
In past i pass trought all my textures about 20 times to be sure all is ok. I not understand now, why i get this error message randomly beacuse, before i get this error i was in this level and everythings works fine, and after i back again i get crash? Why the first time I entered in this level I did not get a error?
@Superku Yes I copy all my files from developement mode into published folder
Last edited by Iglarion; 03/10/18 12:52.
|
|
|
|