Home » PLAYER'S HQ 1.13 » v1.13 General Gameplay Talk » FIXING the massive game slowdown
Re: FIXING the massive game slowdown[message #306825] Wed, 04 July 2012 08:26 Go to previous messageGo to next message
Crador is currently offline Crador

 
Messages:28
Registered:June 2012
@tactical slowdown: I second that theory. Was playing with disabled zombies for last two weeks, trying different of your SCI's, UC's and IoV's and seen none tactical slowdowns.
Turned zombies on and got some slowdowns in half of hour in the middle of enemy's turn.
@strategy slowdowns: Have never seen them under any curcimstances (except for sector inventory slowdowns before CAS when mouseover any gun with multiple attachments presents).

Report message to a moderator

Private 1st Class
Re: FIXING the massive game slowdown[message #306828] Wed, 04 July 2012 12:31 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
@all: I have compiled 2 new executables from the latest source code, but with the zombie feature disabled. For the 1.13 GameDir files, use the latest very unofficial SCI from Tais (located here: http://www.bears-pit.com/board/ubbthreads.php/topics/306175/Tais_very_unofficial_SCI_s.html#Post306175) or the latest SVN GameDir:
https://ja2svn.dyndns.org/source/ja2_v1.13_data/GameDir

1.) ja2_EN_5356_ZombiesOFF_HighspeedTimerON.exe: Zombies disabled and Highspeed Timer enabled
2.) ja2_EN_5356_ZombiesOFF_HighspeedTimerOFF.exe: Zombies disabled and Highspeed Timer disabled

I have packed both executables in a ZIP-Package. See first post for download link. Please try out both executables and report if the tacticl slowdown are gone.

[Updated on: Wed, 04 July 2012 12:33] by Moderator

Report message to a moderator

Sergeant Major

Re: FIXING the massive game slowdown[message #306840] Wed, 04 July 2012 20:55 Go to previous messageGo to next message
Tango is currently offline Tango

 
Messages:106
Registered:July 2006
I set up a few saves at different points using the using the Rev5355 .exe then tried them with both the .exe released above.

1) ja2_EN_5356_ZombiesOFF_HighspeedTimerOFF.exe: Anecdotally a bit faster and slightly less memory usage in tactical but still a noticeably slower enemy turn than I would expect. Although I did previously run the enemy turn animation speed at 0.8 rather than 1.

2)ja2_EN_5356_ZombiesOFF_HighspeedTimerON.exe: Much much faster no slow downs at all in tactical, pretty much what I would have expected before the slow downs started to become an issue.

As such, I would seem to think that it is a problem somewhere in the Zombie code.

Report message to a moderator

Sergeant
Re: FIXING the massive game slowdown[message #306843] Wed, 04 July 2012 23:12 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
thanks for testing. what about strategy slowdowns with version 2?

Report message to a moderator

Sergeant Major

Re: FIXING the massive game slowdown[message #306844] Wed, 04 July 2012 23:30 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
I think I might have found the reason why vs2008 and vs2010 built exe's are giving random unreproducable crashes and weird behaviour lately and vs2005 exe's seem to have no trouble with that..

vs2005 only supports ASLR compatibility in SP1 and I'm not even sure if it's enabled by default

I've disabled ASLR compatibilty in the linker and am having zero crashes after I have been experiencing armies of crashes before I turned it off...

I've tested with and without the highspeed timer enabled and zero crashes on startup and going strong.

Report message to a moderator

First Sergeant

Re: FIXING the massive game slowdown[message #306846] Thu, 05 July 2012 00:15 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
@tais: cool! Can you give me a step-by-step instructions how to disable it in visual studio. Thanks.

Report message to a moderator

Sergeant Major

Re: FIXING the massive game slowdown[message #306847] Thu, 05 July 2012 00:19 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
http://msdn.microsoft.com/en-us/library/bb384887.aspx

smeag was having the weird crashes in the map editor and he's also running win7, as win xp doesnt support ASLR natively these crashes shouldnt be happening there.
I am talking about the crashes that look like memory leaks but happen totally random during the startup of the editor (atleast with me they did).
When I disabled the highspeed timer I actually got sent into the deep threading internals of the code by the debugger..

But right now I have had zero crashes and I recompiled and started the map editor a lot of times, trust me

Report message to a moderator

First Sergeant

Re: FIXING the massive game slowdown[message #306848] Thu, 05 July 2012 00:36 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Thanks, I will try it out.

I think I am also close on fixing the Strategy slowdowns. In latest 1.13 version, when you compress time in Strategy view and you do not do any action (repair, movement, ...), the game still consumes more and more memory every second.

In official 4870 version (and right after HAM5 was integrated) the memory usage DID NOT INCREASE when doing no action in strategy view. Now it is time to find the problematic code...

[Updated on: Thu, 05 July 2012 00:36] by Moderator

Report message to a moderator

Sergeant Major

Re: FIXING the massive game slowdown[message #306849] Thu, 05 July 2012 01:04 Go to previous messageGo to next message
Tango is currently offline Tango

 
Messages:106
Registered:July 2006
@Rowa;

Not sure if you haven't found this already...

Further to my last the strategic slow down seems to happen pretty much equally with the two .exe you provided.

Bit harder to tell though, it is much more gradual with the memory use increasing.

Report message to a moderator

Sergeant
Re: FIXING the massive game slowdown[message #306850] Thu, 05 July 2012 01:11 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
@Tango: When (after how many minutes??) does the strategic slowdown happen? What actions did you perform when the slowdown happens. Can you run the game in windowed mode and then make a screenshot from task-manager meowing the "Committed memory" of the ja executable. Per default, the "Committed memory" column is not visible on the task-manager proces tab. You have to make the column visible on the Views menu.

Report message to a moderator

Sergeant Major

Re: FIXING the massive game slowdown[message #306853] Thu, 05 July 2012 09:07 Go to previous messageGo to next message
wolf00 is currently offline wolf00

 
Messages:1148
Registered:September 2006
Location: Czech Republic

i have ver 1465 instaled,ti is a posible use new exe ?

Report message to a moderator

Sergeant Major
Re: FIXING the massive game slowdown[message #306875] Thu, 05 July 2012 19:29 Go to previous messageGo to next message
Tango is currently offline Tango

 
Messages:106
Registered:July 2006
Will try and test the exact memory usage in strategic screen in the next couple of days, been quite busy.

I'm getting an error report when trying to load the Calisto airport sector in the latest UC113 having visited it once:

Release v1.13.5356 (Development Build): Build 12.07.04.	Z

File:
	E:\JA2\ja2_EN_5356_ZombiesOFF_HighspeedTimerON.exe
	2 type 586 processor.
	Total Physical Memory: 2046 Megs.
Segment( CS:EIP ):	001b:0074b4b2.

Exception occurred at address: 0x0074b4b2
	Write Access Violation at: 0x254211f0

Exact Error Message 
 "The thread tried to read from or write to a virtual address for which it does not have the appropriate access."

The game 'CAN' continue


Registers:
	EAX=0044004c CS=001b EIP=0074b4b2 EFLGS=00010216
	EBX=00000002 SS=0023 ESP=0012f668 EBP=01000000
	ECX=03fc0474 DS=0023 ESI=00000001 FS=003b
	EDX=15520020 ES=0023 EDI=13206458 GS=0000


Stack Walk:
FramePtr ReturnAd Param#1  Param#2  Param#3  Param#4  Function Name
01000000 00000000 00000000 00000000 00000000 00000000 ja2_EN_5356_ZombiesOFF_Highspee! 



Stack dump:
0012f668: 00000001 005fcde5 0044004c 00000000 00000002 0000000d 00000010 000000a4
0012f688: 00004007 004f0053 0044004c 43de8000 46800e00 00000000 00000312 0000323e
0012f6a8: 441c4000 44494000 4c420000 484b4341 00444145 00000000 00000000 00000000
0012f6c8: 00000000 00000000 43414c42 4e41504b 00005354 00000000 00000000 00000000
0012f6e8: 00000000 4c420000 534b4341 54524948 00000000 00000000 00000000 00000000
0012f708: 00000000 43414c42 494b534b 0000004e 00000000 00000000 00000000 00000000
0012f728: 00050000 00000b50 706d6554 5f725c5c 2e333142 00544144 0044866f 0ff90000
0012f748: 12e20198 00000281 0012f774 7c912416 0ff90000 12e20198 12e20198 0ff90000
0012f768: 13178e20 1316fe98 0012f78c 7c910a36 0000000a 1316fe98 0ff90000 1316fe70
0012f788: 12961dc8 0012f7a8 7c9116a6 00000008 12961dc8 0ff90000 12961e08 00000000
0012f7a8: 0012f87c 0ff90000 2e333142 00544144 0012f7d4 7c910a36 0000000a 131721e8
0012f7c8: 0012f7e4 7c910a36 00000005 131721e8 0ff90000 131721c0 00000000 0012f8b8
0012f7e8: 7c91084c 136c0248 13173b78 0012f810 7c9116a6 00000008 13173b78 0ff90000
0012f808: 13173bb8 00000000 0012f8e4 7c91084c 13556d98 7c910981 0ff90608 7c91005d
0012f828: 00000031 13173bc0 00000000 14db0000 00000000 13173b78 13557f78 00000010
0012f848: 00000028 ffffffff 13173b80 0ff90000 12962cb0 0101ffff 00000010 0ff90000
0012f868: 137f2000 0ff90000 0ff90000 0ff90178 0012f944 7c910981 0ff90608 7c91005d
0012f888: 00000031 137f2008 00000000 14db0000 0101f8d8 137f2000 0ff90178 ffffffff
0012f8a8: 137f2008 0ff90000 00000000 0101ffff 1317e8f8 00000000 12e242e0 0101f904
0012f8c8: 00000010 0012f828 ffffffff 0012f914 7c90e920 7c910060 12e242e8 000007b8
0012f8e8: 007ffd79 0ff90000 00000000 007ffd98 26077867 00000031 137f2028 00000000
0012f908: 00804860 0ff90000 fffffffe 0012f93c 00804860 00000000 00000000 0101fd98
0012f928: 000000f7 0012f888 26077877 0012f974 7c90e920 7c910060 ffffffff 7c91005d
0012f948: 007ffd79 0ff90000 00000000 007ffd98 260778c7 00000031 137f2008 00000000
0012f968: 0012f9a8 0012f958 269b972b 0012f9a8 00804860 269b94eb fffffffe 007ffd98
0012f988: 005fe233 137f2008 260778d7 00000002 0000000d 01000000 00000000 137f2008
0012f9a8: 00000002 0000000d 260777c3 005feacf 0000000d 00000002 00000000 0055d6e9
0012f9c8: 00000002 0000000d 00000000 2e333142 00544144 007ffd98 26077b4f 12d10510
0012f9e8: 1055ba48 00000001 0e45da9c 0012f9e0 01ff6034 0012fc34 00804860 269b94eb
0012fa08: 5350414d 3331425c 5441442e 12d10500 00000002 0000000d 00120002 0075f372
0012fa28: 12d10510 0053d673 00000002 00622ac1 0059df1b 26077897 0055d9e1 0000000d
0012fa48: 00000002 00000000 00120113 00000009 0012fba4 0000ff01 00000002 00000000
0012fa68: 00120113 00565542 0000000d 00000002 00000000 0000ffff 0054d5c9 00120113
0012fa88: 00000009 0012fba4 00000000 00506c55 00001002 00507a44 00000002 00000007
0012faa8: 00000000 00000004 37333717 00507ea6 00000004 2607798b 0012fb00 008008f3
0012fac8: 0012fae0 008400c8 00000000 0012fb10 13489710 00000001 01ff775d 7fffffa9
0012fae8: 01ff7708 004e8693 00000101 0012fb68 004e869e 01ff3620 008159d6 00804a78
0012fb08: 0012fb58 00804a88 26077a4b fffffffe 0012fb58 00b1c930 0012fb68 00120113
0012fb28: 00000009 00000000 004e867c 00b1c930 0012fb58 fffffffe 26077a2b 00120113
0012fb48: 00000009 00000000 00005001 00507514 0012fc34 00804860 2698b733 fffffffe
0012fb68: 0012fba4 004099b5 26077bd7 00409ad5 00120113 02cb0134 00000000 00000001
0012fb88: 00000378 000002d6 0012fc34 7e44048f 7e429e70 ffffffff 7e429e6b 0012fbdc
0012fba8: 004fb163 004faf00 0012fc18 7e418734 02cb0134 00000113 00000000 00000000
0012fbc8: 004faf00 dcbaabcd 00000000 0012fc18 004faf00 0012fc44 7e418816 004faf00
0012fbe8: 02cb0134 00000113 00000000 00000000 00000113 004faf00 0015d3d0 00000014
0012fc08: 00000001 00000000 00000000 00000010 00000000 7472467f 00000001 00000000
0012fc28: 00000000 0012fbf8 0012f28c 0012fd44 7e44048f 7e418830 00000000 0012fc74
0012fc48: 7e42a013 00000000 004faf00 02cb0134 00000113 00000000 00000000 00000000
0012fc68: 00000000 0015e9f0 00004242 0012fc94 7e42a998 004faf00 02cb0134 00000113
0012fc88: 00000000 00000000 00000001 0012fcc0 7378df6f 004faf00 02cb0134 00000113
0012fca8: 00000000 00000000 0012fd28 7378dcdc 00000000 004faf00 0012fcec 7e418734
0012fcc8: 02cb0134 00000113 00000000 00000000 7378dcdc dcbaabcd 00000000 0012fd28
0012fce8: 7378dcdc 0012fd54 7e418816 7378dcdc 02cb0134 00000113 00000000 00000000
0012fd08: 0012fe4c 0012fe44 0fb0c5b0 00000014 00000001 00000000 00000000 00000010
0012fd28: 00000000 ffffffff 00000001 00000000 00000000 0012fd08 0012f28c 0012fda4
0012fd48: 7e44048f 7e418830 00000000 0012fdb4 7e4189cd 00000000 7378dcdc 02cb0134
0012fd68: 00000113 00000000 00000000 0fb0c5c4 00000001 7e418bf6 7e42772b 7e4196b8
0012fd88: 00000378 000002d6 00000001 00000000 00000000 0012fd7c 0012f28c 0012fe70
0012fda8: 7e44048f 7e4189f0 ffffffff 0012fdc4 7e4196c7 0012fe44 00000001 0012fe7c
0012fdc8: 004fcc18 0012fe44 26077f3f 00000a28 00000002 00000001 7c910041 0ff90778
0012fde8: 7c91005d 0ff90178 0ff96cb0 1055c4f8 00000041 0ff90178 00000010 0ff90178
0012fe08: 0ff90000 1055c040 0ff90168 00000000 00000000 1055c040 00000018 1055c048
0012fe28: 0080003c 0ff90000 00000018 00000200 00000162 0112fc34 00000408 02cb0134
0012fe48: 00000113 00000000 00000000 2a707890 00000378 000002d6 ffffffff 7c918681
0012fe68: 008028f5 0012fdd0 0012ff18 00829ccb 00000014 00000000 0012fec4 008122ce
0012fe88: 0ff90000 00000000 008122d7 7c90d80a 7c9132f0 ffffffff 00000024 0012feb0
0012fea8: 10137500 00000000 429e235f 00000230 00000000 0000000f 00000400 00660076
0012fec8: 002e0073 006f006c 00000067 00000007 00000007 ffffffff ffffffff 0012ff28
0012fee8: 004fd1b6 00400000 00000000 00152345 00000001 26077e6b 00000a28 00000002
0012ff08: 00000001 ffffffff 0012fefc 0012f290 0012ffb0 00804860 2698c833 00000000
0012ff28: 0012ffc0 00801966 00400000 00000000 00152345 00000001 26077e83 80000001
0012ff48: 0196d9e4 7ffd5000 00000044 00153fb0 00154010 00154028 00000000 00000000
0012ff68: 00000000 00000000 00000000 00000000 00000000 00000401 00000001 00000000
0012ff88: 00000000 00010001 00000000 0012ffbc 00000001 00000005 00000000 80000001
0012ffa8: 0012ff40 115f951c 0012ffe0 00804860 269b97cb 00000001 0012fff0 7c817077
0012ffc8: 80000001 0196d9e4 7ffd5000 805512fa 0012ffc8 88294ba0 ffffffff 7c839ad8
0012ffe8: 7c817080 00000000 00000000 00000000 008019cf 00000000


(00400000 - 0F8BE000) E:\JA2\ja2_EN_5356_ZombiesOFF_HighspeedTimerON.exe 	 1.0.0.1 	 1.0.0.1 	  - file date is 07/04/2012 11:07:22
(7C900000 - 7C9B2000) C:\WINDOWS\system32
tdll.dll 	 5.1.2600.6055 	 5.1.2600.6055 	  - file date is 12/09/2010 16:15:10
(7C800000 - 7C8F6000) C:\WINDOWS\system32\kernel32.dll 	 5.1.2600.5781 	 5.1.2600.5781 	  - file date is 03/21/2009 15:06:58
(71AB0000 - 71AC7000) C:\WINDOWS\system32\WS2_32.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:12:10
(77DD0000 - 77E6B000) C:\WINDOWS\system32\ADVAPI32.dll 	 5.1.2600.5755 	 5.1.2600.5755 	  - file date is 02/09/2009 13:10:48
(77E70000 - 77F03000) C:\WINDOWS\system32\RPCRT4.dll 	 5.1.2600.6022 	 5.1.2600.6022 	  - file date is 08/16/2010 09:45:00
(77FE0000 - 77FF1000) C:\WINDOWS\system32\Secur32.dll 	 5.1.2600.5834 	 5.1.2600.5834 	  - file date is 06/25/2009 09:25:26
(77C10000 - 77C68000) C:\WINDOWS\system32\msvcrt.dll 	 7.0.2600.5512 	 6.1.8638.5512 	  - file date is 04/14/2008 01:12:02
(71AA0000 - 71AA8000) C:\WINDOWS\system32\WS2HELP.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:12:10
(10000000 - 10022000) E:\JA2\smackw32.dll 	 3.0.0.0 	 3.0.0.0 	  - file date is 07/01/2012 14:31:30
(7E410000 - 7E4A1000) C:\WINDOWS\system32\USER32.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:12:08
(77F10000 - 77F59000) C:\WINDOWS\system32\GDI32.dll 	 5.1.2600.5698 	 5.1.2600.5698 	  - file date is 10/23/2008 13:36:14
(76B40000 - 76B6D000) C:\WINDOWS\system32\WINMM.dll 	 5.1.2600.6160 	 5.1.2600.6160 	  - file date is 10/14/2011 15:47:30
(30000000 - 3006D000) E:\JA2\binkw32.dll 	 1.5.10.0 	 1.5.10.0 	  - file date is 07/01/2012 16:25:50
(00340000 - 003CF000) E:\JA2\fmod.dll 	 3.7.3.0 	 3.7.3.0 	  - file date is 07/01/2012 14:31:30
(774E0000 - 7761E000) C:\WINDOWS\system32\ole32.dll 	 5.1.2600.6168 	 5.1.2600.6168 	  - file date is 11/01/2011 17:07:10
(77BE0000 - 77BF5000) C:\WINDOWS\system32\MSACM32.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:11:58
(71AD0000 - 71AD9000) C:\WINDOWS\system32\WSOCK32.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:12:10
(73760000 - 737AB000) C:\WINDOWS\system32\DDRAW.dll 	 5.3.2600.5512 	 5.3.2600.5512 	  - file date is 04/14/2008 01:11:52
(73BC0000 - 73BC6000) C:\WINDOWS\system32\DCIMAN32.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:11:52
(59A60000 - 59B01000) C:\WINDOWS\system32\dbghelp.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:11:52
(77C00000 - 77C08000) C:\WINDOWS\system32\VERSION.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:12:08
(76390000 - 763AD000) C:\WINDOWS\system32\IMM32.DLL 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:11:54
(5AD70000 - 5ADA8000) C:\WINDOWS\system32\uxtheme.dll 	 6.0.2900.5512 	 6.0.2900.5512 	  - file date is 04/14/2008 01:12:08
(74720000 - 7476C000) C:\WINDOWS\system32\MSCTF.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:11:58
(755C0000 - 755EE000) C:\WINDOWS\system32\msctfime.ime 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:10:06
(10980000 - 10990000) C:\WINDOWS\system32\ctagent.dll 	 1.0.0.8 	 1.0.0.8 	  - file date is 06/20/2003 04:55:38
(73F10000 - 73F6C000) C:\WINDOWS\system32\dsound.dll 	 5.3.2600.5512 	 5.3.2600.5512 	  - file date is 04/14/2008 01:11:52
(76C30000 - 76C5E000) C:\WINDOWS\system32\WINTRUST.dll 	 5.131.2600.6198 	 5.131.2600.6198 	  - file date is 02/29/2012 15:10:16
(77A80000 - 77B15000) C:\WINDOWS\system32\CRYPT32.dll 	 5.131.2600.6237 	 5.131.2600.6237 	  - file date is 05/31/2012 14:22:10
(77B20000 - 77B32000) C:\WINDOWS\system32\MSASN1.dll 	 5.1.2600.5875 	 5.1.2600.5875 	  - file date is 09/04/2009 22:03:36
(76C90000 - 76CB8000) C:\WINDOWS\system32\IMAGEHLP.dll 	 5.1.2600.6198 	 5.1.2600.6198 	  - file date is 02/29/2012 15:10:16
(72D20000 - 72D29000) C:\WINDOWS\system32\wdmaud.drv 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:12:46
(72D10000 - 72D18000) C:\WINDOWS\system32\msacm32.drv 	 5.1.2600.0 	 5.1.2600.0 	  - file date is 08/18/2001 13:00:00
(77BD0000 - 77BD7000) C:\WINDOWS\system32\midimap.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:11:58
(73EE0000 - 73EE4000) C:\WINDOWS\system32\KsUser.dll 	 5.3.2600.5512 	 5.3.2600.5512 	  - file date is 04/14/2008 01:11:56
(77120000 - 771AB000) C:\WINDOWS\system32\OLEAUT32.DLL 	 5.1.2600.6058 	 5.1.2600.6058 	  - file date is 12/20/2010 18:32:16
(76BF0000 - 76BFB000) C:\WINDOWS\system32\psapi.dll 	 5.1.2600.5512 	 5.1.2600.5512 	  - file date is 04/14/2008 01:12:04


This is using the Zombies off, Highspeed timer on .exe with the timer set to false.

Not sure if this has any relation to the current problems or not.

Report message to a moderator

Sergeant
Re: FIXING the massive game slowdown[message #306887] Thu, 05 July 2012 23:30 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
Rowa I think you should also do a similar change to the vs2008 project files, pretty sure it's the same story there

Report message to a moderator

First Sergeant

Re: FIXING the massive game slowdown[message #306902] Fri, 06 July 2012 01:33 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:634
Registered:July 2005
Location: Canada
RoWa21
Thanks, I will try it out.

I think I am also close on fixing the Strategy slowdowns. In latest 1.13 version, when you compress time in Strategy view and you do not do any action (repair, movement, ...), the game still consumes more and more memory every second.

In official 4870 version (and right after HAM5 was integrated) the memory usage DID NOT INCREASE when doing no action in strategy view. Now it is time to find the problematic code...


It sounds like something new/changed in the main loop. Not to pick on Flugente, but I'd start with weapon cooldowns and poison, because they are both fairly new and both have effects that occur as time passes.

Report message to a moderator

First Sergeant

Re: FIXING the massive game slowdown[message #306915] Fri, 06 July 2012 14:24 Go to previous messageGo to next message
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

Captain

Re: FIXING the massive game slowdown[message #306917] Fri, 06 July 2012 15:30 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Hi Flugente,

I noticed a continues memory increase in strategy map when compressing time (without doing any actions). Each second the memory increases. I did a few tests with different revisions and after including the HAM5 code it was still running fine. No memory increase. This was in revision 5194.

After a few Revisions later (5207) I noticed the conntinues increase of the memory in strategy screen. So this memory problem must be introduced between revision 5194 and 5207...

EDIT: Get latest version from svn source code, because I externalized (defines) a few features. See builddefines.h

[Updated on: Fri, 06 July 2012 15:31] by Moderator

Report message to a moderator

Sergeant Major

Re: FIXING the massive game slowdown[message #306927] Fri, 06 July 2012 17:33 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
Hmm. Deducting from the last revisions in svn - will it be our modus operandi to use build defines for every feature in the future?

Report message to a moderator

Captain

Re: FIXING the massive game slowdown[message #306933] Fri, 06 July 2012 18:37 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Flugente
Hmm. Deducting from the last revisions in svn - will it be our modus operandi to use build defines for every feature in the future?


Maybe, I really don't know if we should do this for future features. But I found it a good way to exclude certain features from the executable when trying to find the tactical/strategy slowdowns.

Report message to a moderator

Sergeant Major

Re: FIXING the massive game slowdown[message #306935] Fri, 06 July 2012 21:50 Go to previous messageGo to next message
Tango is currently offline Tango

 
Messages:106
Registered:July 2006
Slightly weird one but with a very brief bit of further testing:

Using the No Zombie, High Speed timer ON .exe I get slow downs when I have an .ini entry with either True OR False for the high speed timer on entry.

Only just noticed it when I tried turning the timer on and then made the entry false. No entry (ie getting a no entry message on game start up) means no slow down. Very strange, not sure what to make of it.

Report message to a moderator

Sergeant
Re: FIXING the massive game slowdown[message #306961] Sat, 07 July 2012 18:12 Go to previous messageGo to next message
tazpn is currently offline tazpn

 
Messages:99
Registered:December 2007
Location: CA, USA
Warning: Going to be a little defensive being it my feature being blamed.

The timer itself is unlikely to be the exact cause but I couldn't say. Its more likely to be the input event queue system that I've complained about in previous Tais bug threads. If I were to guess what is happening here is that certain events are not being dequeued because the screens consuming the events are not doing it consistently.

Typically event queue code should be written like the following:

while ( DequeueEvent(&event) )
{
   switch( event.type )
   {
      case KEY_DOWN: /*Do Stuff*/ break;
      default:
         HandleDefaultEvent(&event);
         break;
   }
}

or
while ( DequeueEvent(&event) )
{
   if (event.type == KEY_DOWN)
   {
      /*Do Stuff*/
   }
   else
   {
      HandleDefaultEvent(&event);
   }
}


This was broken a couple of times most significantly when HAM5 was merged in. The DequeueEvent() will dequeue everything which can be a bad thing on on its own if that code does not actually handle every event. HandleDefaultEvent() routine should handle any left over events not consumed typically this means related mouse events. This typically leads to mouse events not working though rather than some sort of slowdown.

Typically, I think the #ifdef for every feature will only lead to a more unmaintainable code base. Handling everything via ini files and code is better even if it produces slightly slower code. It also makes it easier to test as code does not need to be recompiled. There are cases where its required like the encyclopedia because the problem was statically defined variables.

In general, the main loop will try to remove Mouse events from the queue as its first action. the highspeed timer is in part at fault here because it introduced multithreading and did not bottleneck everything through the windows queue for the main window. This allowed mouse events to be queued while the system was handling keyboard events.

Screens that are believed to be causing slowdowns should probably be checked for adhering to proper queue management. If you use DequeueEvent() in a while loop then there should be a matching HandleDefaultEvent() in the loop as well if the event was not actually handled by the thread. If DequeueSpecificEvent is used then it should handle everything but mouse events. I suppose I think that all of the event loops should be of the form DequeueEvent() with matching HandleDefaultEvent() rather than using DequeueSpecificEvent() because the latter might leave events on the queue stack. When the problem is happening for people the queue stack would be the first think I think that should be checked just to see how may unconsumed events there are in it. Its also possible that there are DequeueSpecificEvent loops which are not handling all keyboard types like only KEY_DOWN and not KEY_UP or KEY_REPEAT.

If I am right about this then using the mouse a lot while also using the keyboard simultaneously would be more likely to trigger the problem.

--
My next theory would be that its related to the hardcoded timers maintained in the timer code. One of the timers may not get reset and is always firing. This leads to gameloop being executed repeatedly or something which leads to slower framerates.

@Tango, turning off the timer and not setting it should be the same action as the code just defaults to false. My guess is you did not do whatever is required to trigger the problem in that test case.

Report message to a moderator

Corporal 1st Class
Re: FIXING the massive game slowdown[message #306964] Sat, 07 July 2012 19:47 Go to previous messageGo to next message
Tango is currently offline Tango

 
Messages:106
Registered:July 2006
@tazpn

Thanks for the explanation.

Fair enough I will start trying to go through all the possible actions I carried out.

Report message to a moderator

Sergeant
Re: FIXING the massive game slowdown[message #306967] Sat, 07 July 2012 20:52 Go to previous messageGo to next message
tazpn is currently offline 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 #307029] Mon, 09 July 2012 08:00 Go to previous messageGo to next message
tryingtokeepup is currently offline tryingtokeepup

 
Messages:24
Registered:July 2012
Location: Hawaii
tazpn

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.



Hi! This seems promising. Just a real fast question: does disabling scope modes cripple normal gameplay, or does disabling this option still allow the player to change out their scopes in a timely fashion? I'm all for a efficient fix (thank you everyone for your hard work!), but if it destroys your ability to react to enemies on a broad range of ranges, perhaps just restarting the client from time to time is still the better (?) option.

Report message to a moderator

Private 1st Class
Re: FIXING the massive game slowdown[message #307034] Mon, 09 July 2012 12:43 Go to previous messageGo to next message
Hazapuza

 
Messages:262
Registered:February 2009
Location: Finland
It does indeed hinder your performance somewhat since you can't switch from that 7x scope to the reflex sight you have mounted on top of it when the enemy surprises you at short range, and thus you receive the penalties from using a high-powered scope in close quarters (although you also get the reflex sight bonuses, since the game unrealistically applies bonuses from all equipped sights at the same time). But do note that this feature is still pretty new, and 1.13 with New Chance to Hit was and still is very much playable without it. (Edit: at least wil473's Urban Chaos 1.13 was/is, due to his work on NCTH balance.)

But if you can tolerate the slowdowns, nobody's forcing you to turn the scope modes off. Smile

[Updated on: Mon, 09 July 2012 12:51] by Moderator

Report message to a moderator

Master Sergeant
Re: FIXING the massive game slowdown[message #307035] Mon, 09 July 2012 12:50 Go to previous messageGo to next message
tryingtokeepup is currently offline tryingtokeepup

 
Messages:24
Registered:July 2012
Location: Hawaii
Thank you for the information. Just one other question dealing with your reply: So, NCTH is playable with Tai's SCI? I was led to believe that NCTH is not compatible with Tai's SCI, as it bundles AIMNAS. But if we can use it, I'll take the slowdown hit!

Last thing (thanks for the help again!)! So, if that feature is a little new, and not necessary, can I completely disable it in the ini without throwing the rest of the mechanics off? I mean, has the other parts of the shooting mechanics been balanced against the scopes? I have never understood or grasped how integrating the different mods or modding gurus are, and if they are in close communication with each other or not.

Thanks for the help!

Report message to a moderator

Private 1st Class
Re: FIXING the massive game slowdown[message #307037] Mon, 09 July 2012 13:18 Go to previous messageGo to next message
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 #307039] Mon, 09 July 2012 14:24 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Why, 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)

Report message to a moderator

Captain

Re: FIXING the massive game slowdown[message #307040] Mon, 09 July 2012 14:39 Go to previous messageGo to next message
cdudau
@ My man

You said that you didn't even like them. ???

Report message to a moderator

Re: FIXING the massive game slowdown[message #307044] Mon, 09 July 2012 14:56 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Still trolling? Shouldn't you be 'working on your goals' or something?

Report message to a moderator

Captain

Re: FIXING the massive game slowdown[message #307045] Mon, 09 July 2012 15:16 Go to previous messageGo to next message
cdudau
I am bub.

By The way,

I heard you said that you were straight as an arrow.


Report message to a moderator

Re: FIXING the massive game slowdown[message #307046] Mon, 09 July 2012 15:21 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
No, I didn't. Show me a quote by me to the contrary or shut up.

Report message to a moderator

Captain

Re: FIXING the massive game slowdown[message #307060] Mon, 09 July 2012 17:35 Go to previous messageGo to next message
jaredh

 
Messages:8
Registered:June 2006
Location: Dallas Tx
DepressivesBrot
Why, 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
Re: FIXING the massive game slowdown[message #307061] Mon, 09 July 2012 17:44 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3658
Registered:July 2009
Believe it or not, some people actually are interested in those settings and try to find something that suits them ... instead of running to the forum to complain. Also, see it as an abbreviated campaign that doesn't take months to complete.

EDIT:
Besides, take everything with a grain of salt and it probably helps that the noob in question spent some time on our irc as well.

[Updated on: Mon, 09 July 2012 17:53] by Moderator

Report message to a moderator

Captain

Re: FIXING the massive game slowdown[message #307064] Mon, 09 July 2012 17:53 Go to previous messageGo to next message
tazpn is currently offline tazpn

 
Messages:99
Registered:December 2007
Location: CA, USA
There are 2 flags DISPLAY_SCOPE_MODES and USE_SCOPE_MODES. USE_SCOPE_MODES controls whether the feature is enabled. DISPLAY_SCOPE_MODES controls whether it is displayed on the weapon. The display is what is causing the leak. So that little icon on guns is what is causing it.

I was just recommending turning off the little icon to fix the problem until my suggested patches can be applied and a new build created with it fixed.

Report message to a moderator

Corporal 1st Class
Re: FIXING the massive game slowdown[message #307066] Mon, 09 July 2012 18:22 Go to previous messageGo to next message
tais

 
Messages:656
Registered:February 2008
Location: NL
jaredh

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


(1)No and (2)No

(1) You are obviously referring to my SCI packages, if you can read they are pretty much unofficial.
Yes I have chosen to not include default game data in the SCI's anymore, you are choosing to play the game via my package on your own free will.
I am not keeping a gun to your head forcing you to use my SCI package, by playing the game via my SCI packages you accept that you are running a pretty much unfinished version of AIMNAS, thereby you have no right whatsoever to complain about not being able to play the game anywhere near completion.

(2) Depressivesbrot is actually referring to the BigMaps, once you have played the game with BigMaps you could potentially get hooked to them as they bring just that bit extra to each sector.
It all depends on the person wether they like this or not, that's not the discussion even though some people still think they can have some sort of influence on the AIMNAS package.

Edit: This all comes to one point, you are free to not use my SCI's!

Report message to a moderator

First Sergeant

Re: FIXING the massive game slowdown[message #307088] Mon, 09 July 2012 22:30 Go to previous messageGo to next message
Flugente

 
Messages:3509
Registered:April 2009
Location: Germany
Hmm. So its my fault after all, dammit Sad
I can't correct that stuff today (not at coding site here Wink ), I'll try to correct the error this week, unless someone beats me to it.

@tazpn: Any additional details about what the error is exactly, and why it only happens with the scope mode, would be very welcome. For starters, does that only occur because of the icons I added? Guess so, as we also display other stuff on guns, but no other icons...

I also ask because I'll add some other icons in there very soon Very Happy

Report message to a moderator

Captain

Re: FIXING the massive game slowdown[message #307115] Tue, 10 July 2012 05:38 Go to previous messageGo to next message
tazpn is currently offline tazpn

 
Messages:99
Registered:December 2007
Location: CA, USA
@Flugente, I've already submitted the fix and it has been checked in by Wanne. See commit 5369 for details.

The general idea is that graphics are usually allocated in the Init...() part of a screen and destroyed in the Kill...() part. Your bug was calling AddVideoObject() repeatedly without calling DeleteVideoObjectFromIndex() and doing so in the render script. Also its recommended that you use AddVideoObject macro rather than the AddStandardVideoObject as the former can be used with the SGP_VIDEO_DEBUGGING define to track resource leaks. I did not really want to fully debug your script so I handled this by allocating in an Init area but also only allocating if the ID was not zero but this latter behavior is not typical in the code. I was uncertain since I think this code is used on multiple screens in tactical and strategic areas.

Report message to a moderator

Corporal 1st Class
Re: FIXING the massive game slowdown[message #307239] Wed, 11 July 2012 17:54 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
@all: I will upload a new exe later this day. Lets see if those fixes increase the performance again.

EDIT: I have uploaded a new executable build (5387) to the SVN GameDir. See first post for further details.

[Updated on: Wed, 11 July 2012 19:20] by Moderator

Report message to a moderator

Sergeant Major

Re: FIXING the massive game slowdown[message #307247] Wed, 11 July 2012 19:59 Go to previous messageGo to next message
delta_six is currently offline delta_six

 
Messages:22
Registered:October 2011
It seems perfomance is much better with new build. Have no freezes at usual 10 minute timelapse so far. Both tactical and strategic screens look good and game runs smoothly.
Will proceed with test.

Report message to a moderator

Private 1st Class
Re: FIXING the massive game slowdown[message #307284] Thu, 12 July 2012 17:13 Go to previous messageGo to previous message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
@delta_six: Thanks for testing

@all: I uploaded another EXE build (5393), which fixes a CTD that could occur when the player ends a turn. For Download, see first post.

Report message to a moderator

Sergeant Major

Previous Topic: Zombie Mod
Next Topic: Autofire bullets per 5 APs
Goto Forum:
  


Current Time: Thu Apr 18 21:09:10 GMT+3 2024

Total time taken to generate the page: 0.03142 seconds