Jump to content
The Dark Mod Forums

Savegame problems


Haplo

Recommended Posts

Hi all

 

After talking about this a bit on the TTLG forum it seems here is a better place to post the issues I am experiencing.

 

I can install and start missions fine. The first few saves and loads work fine too. However it always goes wrong afterwards. Loading the game crashes while inside the game, but the same savegame loads fine on a freshly started TDM. One of these three always happens:

 

1. Quickloading makes the game crash immediately. It doesn't even get to the 'Loading' screen. Loading any other savegame also crashes. Choosing 'Quit Mission' crashes too. If I finish the mission, the 'Mission Complete' page crashes. If I open TDM again, same savegames work fine. This seems like a problem with ending the current session, and not the savegames.

 

2. Quickloading/loading causes a window to pop up that says "Application has requested to terminate at runtime unusually". Again, the same savegame works fine on a fresh restart of TDM.

 

3. Quickloading/loading results in a malloc error (happens less frequent than the other two). Again, the same savegame works fine on a fresh restart of TDM.

 

When 2 & 3 happen I also noticed that saving a game takes a quite a long time with a lot of hard disk activity.

 

 

Here's more info:

 

- PC specs: Intel Core Duo E8500, WinXP SP3 32bit, GeForce 9800 GTX+ with the latest drivers, 4GB of RAM, Doom3 1.3.1.1304

- TDM Updater says all the files are the latest.

- I do not change any of the options in the middle of the game.

- I do not run any programs in the background so there should be plenty of memory available.

- Both the Windows partition and the partition that Doom3 resides in have a lot of free space.

- The problem happens with all the FMs.

- EDIT: Doom3 works fine.

- EDIT: I don't have any other mods installed.

 

 

Any ideas? Let me know if you need more information. If there is a logging mechanism tell me and I'll send you the log file. I can also send some savegames. Thanks.

Edited by Haplo
Link to comment
Share on other sites

  • Replies 106
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Do you have any other Doom 3 mods installed? 

 

Try this: delete the DoomConfig.cfg located in your \darkmod folder and run tdm_update.exe again. This will get you a new DoomConfig.cfg, just in case something is screwed up in that file.

 

If TDM is still not working properly, play Doom 3 and do the same things you are doing in TDM: save, quicksave, quickload, load from menu, quit, reload, quickload, etc. This will at least isolate the problem to TDM if everything works properly in Doom 3.

 

 

Link to comment
Share on other sites

Your system looks fine for running Dark Mod but somehow it seems to me that the quicksave is getting bloated and more and more RAM is being used up until Windows switches to the virtual memory swap file (hence the disk thrashing) and then that fills up and it crashes. But why? Maybe it's storing multiple copies of the gamesave in RAM, ie, not clearing the previous RAM allocation. Wonder if this is a Windows setting error?

 

This is not a solution but a possible fix until the problem is solved properly. You only mention quickload/saving but instead exit back to the menus and use the save/load menu entirely. If necessary, quit mission before using the gamesave menu to reload. Not ideal but if that works it also might throw light on the problem if it is only happening in-game.

 

This problem is on bugtracker.

Link to comment
Share on other sites

Your system looks fine for running Dark Mod but somehow it seems to me that the quicksave is getting bloated and more and more RAM is being used up until Windows switches to the virtual memory swap file (hence the disk thrashing) and then that fills up and it crashes. But why? Maybe it's storing multiple copies of the gamesave in RAM, ie, not clearing the previous RAM allocation. Wonder if this is a Windows setting error?

 

This is not a solution but a possible fix until the problem is solved properly. You only mention quickload/saving but instead exit back to the menus and use the save/load menu entirely. If necessary, quit mission before using the gamesave menu to reload. Not ideal but if that works it also might throw light on the problem if it is only happening in-game.

 

This problem is on bugtracker.

 

Thanks for the reply. I did some more experiments and here is what I found:

 

I opened Windows task manager and closed everything else. The Commit Charge was around 400MB. Then I started TDM and loaded my savegame. The game loaded fine and the Commit Charge went up to 2.4GB. While inside the game I pressed the quickload button and the memory usage started going up, the game crashed when it reached 2.6GB.

 

I looked at my savegames. Original Doom3 savegames are around 10MB each. The savegames that had the problem #1 (problem with ending current session) were around 28MB. The savegames that had problem 2 and 3 were around 400MB(!!). So you are right, the savegame are getting bloated.

 

I loaded one of the 400MB quicksaves and quicksaved over it, the size didn't increase.

 

Let me know if you are interested in any of the files. The 400MB saves zip to less than 4MB!

Link to comment
Share on other sites

For what it's worth, I have experienced this bug, but only with the recently released Patently Dangerous, not the other fan missions. I can't recall off hand if I have done more quicksaving in it than other missions; it may be possible since the patrols were relatively hard to avoid. I am on a laptop with an Intel Core 2 Duo T5670, 2 x 1024MB DDR-II RAM and an Intel X3100 video card.

Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Link to comment
Share on other sites

I can try to load such a savegame in my debugger, though I can't make any promises that it's possible to spot where the error was coming from.

 

Of course, you'll need to upload that huge savegame somewhere, which is not trivial given such a size.

Link to comment
Share on other sites

I checked my savegames, and indeed, the offending one is at 270 MB. Looking at it in a text viewer, after some preliminary data in the first percent of content, approximately the first 90% of it is composed of identical strings that read

 

start_ammo_waterarrow 5 atdm:player_base atdm:player_base start_ammo_firearrow 0 atdm:player_base atdm:player_base start_ammo_noisemaker 1 atdm:player_base atdm:player_base start_ammo_mossarrow 5 atdm:player_base atdm:player_base atdm:weapon_shortsword 1 atdm:player_base atdm:player_base start_ammo_vinearrow 0 atdm:player_base atdm:player_base

 

In comparison, my savegames for Chalice have stayed under 24 MB, for Crown at 16 MB, Outpost at 14 MB and Training at 30 MB.

Edited by Melan

Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Link to comment
Share on other sites

greebo: Sure. Rapidshare (3.3 MB)

Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Link to comment
Share on other sites

Bummer. RS does this on occasions. Try this: Uploading.com Please say when you got it so I can remove the file.

Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Link to comment
Share on other sites

I wonder if there's any connection to the bug someone reported about getting duplicate arrow purchases after a saved game?

Link to comment
Share on other sites

I wonder if there's any connection to the bug someone reported about getting duplicate arrow purchases after a saved game?

No, that was caused by something different - I already fixed that one. :)

 

I inspected the savegame yesterday for some time, but so far I couldn't find anything suspicious in the corresponding code sections (I also checked the sections before and after the DifficultyManager routines, and I also inspected the savegame with a hex editor, it's all fine so far.) First I suspected there was some kind of uninitialised member variable issue but that's not the case.

 

Any hints on what you have been doing before that savegame got bloated that way? Restarts, deaths, etc?

Link to comment
Share on other sites

And here is my savegame: http://endings.lemonamiga.com/fm/savegames.zip

 

I tend to save a lot, and in this case I loaded every time I failed at blackjacking the guards (and sometimes getting hurt in the process). But never died.

 

Could it be related to problem #1? Maybe the current session doesn't end properly, and the parameters for the new session just get added to it?

 

Let me know how if can help. If you want, send me new binaries with debugging/logging turned on and I will send you back the results.

Link to comment
Share on other sites

Did some inspection, too, but didn't see anything obviously wrong.

 

Only minor thing:

 

   for (int i = 0; i < mapFile->GetNumEntities(); i++)
   {
       idMapEntity* ent = mapFile->GetEntity(i);

       if (idStr::Icmp(ent->epairs.GetString("classname"), DIFFICULTY_ENTITYDEF) == 0)
       {
           LoadMapDifficultySettings(ent);
       }
   }

 

the loop above could be aborted once the entity is found, since there should be ever only one. But I don't think that matters.

 

Maybe the DifficultyManager is not properly cleared upon reload? It also seems to have "subobjects" and calls store/restore on them, maybe these objects are the problem? Just brainstorming.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Btw, here is a general C++ question:

 

   savefile->WriteInt(_settings.Num());

   for (int i = 0; i < _settings.Num(); ++i)
   {
       _settings[i].Save(savefile);
   }

 

Wouldn't it be better to cache the value of _settings.Num() in the tight loop? Calling the method a few thousand times must be much more expensive than comparing to an integer. Noticed such constructs all over the place, and a few million calls will add up needlessly.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Saving is not exactly performance-critical (it doesn't happen every frame; far from it). Also note that the time required to write stuff to disk will certainly dominate, and probably even mask, the time required to jump around in memory to pull out that integer value. (By "mask", I mean that the CPU is probably bottlenecked by disk access anyway, so optimising its memory access at this point would simply mean that it ended up waiting longer for the disk! End result, no actual speed improvement.)

 

Plus, in theory that call could be partially/wholly optimised away by the compiler, turning it into a simple pointer lookup, which once in L1 cache is pretty fast anyway. In practice it may or may not be optimised very much (only way to be sure is to check the generated assembly code).

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...