|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: FIXING the massive game slowdown[message #306915]
|
Fri, 06 July 2012 14:24
|
|
Flugente |
|
Messages:3509
Registered:April 2009 Location: Germany |
|
|
Hi,
I'm back from my vacation...
I'll try to check my code this weekend and see if I can find a reason for slowdowns. I honestly don't suspect the zombie-functions, as there is only one call per turn (and it doesn't do anything if zombies aren't turned on).
I have another theory... questions to those who experience these slowdowns:
- Does the strategic slowdown occur while compressing time, or always, even if just planning/doing sector inventory stuff?
- Do the slowdowns in tactical occur in realtime, turn-based, or both? Do the slowdowns occur at the beginning or end of a turn, or always?
Do those currently testing - try playing without overheating and weapon mounting (atm I am suspecting weapon mounting).
@Madd: the poison system is rather unlikely, as the poisoning over time only occurs every full hour. However, the drug adjustment function is bigger now, that is another candidate.
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: FIXING the massive game slowdown[message #306967]
|
Sat, 07 July 2012 20:52
|
|
tazpn |
|
Messages:99
Registered:December 2007 Location: CA, USA |
|
|
So I've compiled the latest version I tried out a few cases myself. I've noticed some performance issues in the second battle I had in tactical mode that I had not seen prior to this. My last build I think was around May 7th I think and I had never seen this before.
I only use the fast forward mode as that is why I added the feature. I'm not sure but it seems like it might be related to enemy return fire. Specifically I noticed that bullets being very slow to render from some guns and that seems to coincide with this problem happening in tactical mode.
If I save, exit and reload the problem is gone and fast forward mode with AI runs as expected. Prior to restart it seemed just as slow as a normal turn or slower (except animations still seem to be somewhat accelerated).
My build does not have zombies since that is commented out by default. Also I was not able to reproduce the slow down in the game by replaying incremental saves. I will note that the battle was at B10 had enemies come from B9 and C10 after I initiated battle and second playthroughs did not do this. Finally it seemed to happen again in B12 (in same session as a second playthrough which had battle at B10) and also seemed to start after slow gun fire from enemy. It also seemed to start in the second battle that was started.
I'm going to try and reproduce again and step through with debugger to see if there is anything obvious and then review changes since May 7.
Edit: After doing more testing. The problem certainly seems to trigger when additional squads enter an existing battle. Now in my testing that was adding 20 or so extra mercs which shouldn't cause too many issues normally and I'm sure I've seen that dozens/hundreds? of times since I wrote the FF mod (I wrote it in 2011 it was checked in in 2012). There could be O(n^2) or something with number of mercs but restart tends to resolve the issue so I think that is unlikely. There are also a lot of edits with introduction of zombies making that hard to wade through and in theory should be compiled out.
Edit 2: I think I've isolated the problem. The previous analysis was just happenstance as far as I can tell. The high speed timer just triggers the problem faster due to the fact that it runs the rendering code as fast as possible to do the fast forwarding. Anyway the bug is the scopes mode that was apparently added in HAM5 or Flugente shortly after that release which was around first week of April.
Basically there is a AddStandardVideoObject in Tactical\Interface Items.cpp(3823) that does not destroy the item and in fact allocates a new one every time it renders code in inventory. The reason for the slow down is that the video objects list is a doubly linked list which ends up having thousands of video objects in it that are never released. So eventually the list manipulation get to be excessively slow. First I dont think the list is probably the best data structure and definitely not sure why its a doubly linked list as the find code only goes in one direction.
My suggestion is to change the linked list to a hashmap so that when these leaks do arise it does not impact performance. Perhaps there should be a warning when the size gets too large as feedback to developers. Obviously the scope code also needs a change but for now by setting [Tactical Gameplay Settings] DISPLAY_SCOPE_MODES=FALSE in ja2options.ini will mitigate this.
[Updated on: Sun, 08 July 2012 18:22] by Moderator Report message to a moderator
|
Corporal 1st Class
|
|
|
|
|
|
Re: FIXING the massive game slowdown[message #307037]
|
Mon, 09 July 2012 13:18
|
|
Hazapuza |
|
Messages:262
Registered:February 2009 Location: Finland |
|
|
AFAIK, Tais's SCI only contains the latest version of AIMNAS, which is not really compatible with the NCTH. It also uses Bigmaps, which are very heavily work in progress, and doesn't have the whole campaign available (I might be wrong about this one). In short, right now I'd say AIMNAS is not the best choice for a newcomer.
Unless there's some freaky bug in the code, there shouldn't be any problems turning the feature off.
If you have any more questions, you should make a new thread, or use some other, better fitting one than this. We're going off-topic here, and regarding the importance of this thread, we shouldn't be clogging it at all.
Report message to a moderator
|
Master Sergeant
|
|
|
|
|
|
|
|
Re: FIXING the massive game slowdown[message #307060]
|
Mon, 09 July 2012 17:35
|
|
jaredh |
|
Messages:8
Registered:June 2006 Location: Dallas Tx |
|
|
DepressivesBrotWhy, it's ideal. Your average newcomer will frequently restart and try different settings anyway, so a full campaign is not required. (he might be spoiled for life by the awesomeness of bigmaps though)
So...you are actually suggesting a newcomer should
1) Play a mod that doesn't let you play the game to anywhere near completion
2) That he will actually become spoiled by its incompleteness
The logic here is astounding. I suspect you will find very few newcomers who will agree with you...most of them are interested in actually progressing through the game rather than restarting over and over with new settings (which sounds SOOOOO FUN!!!!)
FYI, I haven't seen any of the slowdowns so far.
[Updated on: Mon, 09 July 2012 17:36] by Moderator Report message to a moderator
|
Private
|
|
|
|
|
|
|
|
|
|
|