Home » MODDING HQ 1.13 » v1.13 Bug Reports » JA2 1.13 Windows 8.1 -- Consistent Freezes  () 1 Vote
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #344528 is a reply to message #344519] Mon, 14 March 2016 09:51 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Please check the following step-by-step guide from the "Docs" folder, posted here:

Quote:

***********************************************************************************************************************
Apply the fixes if you play Jagged Alliance 2 v1.13 on Windows 8/8.1 or Windows 10 does not start / runs extremely slow
***********************************************************************************************************************

INSTALLATION:
*** STEP 1: Temporary extract the patch/fix files ***
- Extract the "Windows 8 & 10 Fix.zip" file to a temporary folder (e.g: C:\Temp\JA2_Fix)

*** STEP 2: Apply the patch/fix files ***
- Copy the following files from the temporary folder (e.g: C:\Temp\JA2_Fix\GameDir) in your JA2 1.13 Installation directory and override any existing files
-> ddraw.dll
-> libwine.dll
-> wined3d.dll
-> Win8_10_FullScreen_RegistryFix.reg
-> Win8_10_WindowedMode_RegistryFix.reg

*** STEP 3: Apply the 2 registry (*.reg) files ***
- Before applying the 2 registry files, open them with a text editor (e.g: notepad) and change the default path to the 1.13 executable ("C:\\games\\ja2\\ja2.exe") to your JA2 1.13 Installation directory and executable file
- Save the 2 registry files
- Apply the 2 regitry files by executing them

*** STEP 4: Disable the JA2 intro ***
- Open the "Ja2.ini" file with a text editor (e.g: notepad) in your Jagged Alliance 2 v1.13 Installation directory
- Search for PLAY_INTRO and change it to PLAY_INTRO = 0
- Save the file and close it

*** STEP 5 (optional): Set the game to "Windowed Mode" to play JA2 1.13 in Windowed Mode ***
- Open the "Ja2.ini" file with a text editor (e.g: notepad) in your Jagged Alliance 2 v1.13 Installation directory
- Seach for SCREEN_MODE_WINDOWED and set it to SCREEN_MODE_WINDOWED = 1
- Save the file and close it
- Right click on the JA2 1.13 executable (ja2.exe), edit the properties and check the "Compatibility" mode
-> Check the "Reduced color mode" to 16-bit
- Set your Windows Desktop Color Schema to 16 Bit (instead of 32 Bit).
-> Screen Resolution -> Advanced Settings -> Monitor -> Colors -> "High Color (16 bit)

*** STEP 6: Set processor affinity for "ja2.exe" to only ONE CPU (CPU 0) ***
- Check out the step-by-step instructions on how to set the processor affinity for Windows 8 / Windows 10:
-> http://www.eightforums.com/tutorials/24086-processor-affinity-set-applications-windows-8-a.html

*** STEP 7: Run the game in Compatibility Mode ***
- Run the game (ja2.exe) as Windows 8 / Windows 10 Administrator
-> Right click on the JA2 1.13 executable (ja2.exe), edit the properties and check the "Compatibility" mode
-> Check the "XP SP3" compatibility mode



Here you can download the "Windows 8 & 10 Fix.zip"
https://ja2svn.mooo.com/source/ja2_v1.13_data/GameDir/Docs/Windows%20Compatibility%20Fixes/Windows%208%20&%2010%20Fi x.zip

[Updated on: Mon, 14 March 2016 09:53]

Report message to a moderator

Sergeant Major

Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #345184 is a reply to message #344528] Tue, 26 April 2016 07:38 Go to previous messageGo to next message
ShoGUN is currently offline ShoGUN
Messages:4
Registered:August 2015
Game still frezes on my laptop with that instruction. I don't know if it can help, but it runs perfectly all the time on all machines under Linux with Wine. I tried to use newer versions of Wine dlls under Windows(version 1.5.6 to be exact), but no luck - it crashes with error in wined3d.dll right from the start angry Good news is that you guys should try to play under Linux, it works perfectly. Unfortunately, XML Editor uses .Net 3.5(or 4.x), so no luck with trying to run it under Wine. And no, Windows 10 problem is not solved, there are only some workarounds...

Report message to a moderator

Civilian
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #347684 is a reply to message #335812] Sun, 04 December 2016 01:14 Go to previous messageGo to next message
MaiorPain

 
Messages:15
Registered:July 2015
Location: Russia
http://steamcommunity.com/games/215930/announcements/detail/583609044411508094


Today is the good day to...

So, there is announcement about patch for win 10 and 8 (include 8.1) for lauch from steam-devs.


Maybe it's can help us to fix this long-story issue.

Date of patch 22.11.2016

Let's wait for fix wich includes this patch in v1.13


P.S I tested steam version, it works fine for 8.1

[Updated on: Sun, 04 December 2016 01:16]




I'm sorry for my english. It's not my language and I never learn studied it. Games and translator were my teachers. Don't blame me hard, I'm always like to get corrected.

Report message to a moderator

Private
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #347706 is a reply to message #347684] Wed, 07 December 2016 14:23 Go to previous messageGo to next message
Decadent is currently offline Decadent

 
Messages:12
Registered:December 2016
Hello, I'm running windows 10 and tried the various fixes for JA2 1.13 but keep getting the usual freeze/game crash problem, seems from the above messages that the base game is fixed/patched to work within win 10 but not for 1.13?

I always keep coming back to JA2 because nothing has surpassed its gameplay in this genre, words fail me how out of touch, inept and greedy most game devs have become.

Thanks, look forward to a stable fix at some point happy

Report message to a moderator

Private
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #347716 is a reply to message #347706] Sat, 10 December 2016 10:57 Go to previous messageGo to next message
Decadent is currently offline Decadent

 
Messages:12
Registered:December 2016
After a fresh install and going through all the guide fixes again for win8/10, getting to Drassen was crash/freeze free whereas before it would crash every 10-15mins approx? the problem now is that I have no idea why it didn't run previously? win10 did have an update but I cannot imagine that would have changed anything?

I experimented not disabling cpu cores which only froze the game upon exit. The only thing I didn't do was to change desktop to 16bit.

Report message to a moderator

Private
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #347718 is a reply to message #347716] Sat, 10 December 2016 11:26 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
No reason to set the desktop to 16bit color depth. Windows 10 can handle applications running in 16bit mode while the desktop is still 32bit.
Important thing is to apply the registry fix correctly. Before applying the .reg files the path inside of them has to be set to your real game path and executable. Otherwise the settings will have no effect.

I don't even use the dll files anymore because they are causing distorted graphic issues in certain map views.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #347730 is a reply to message #347718] Tue, 13 December 2016 10:13 Go to previous messageGo to next message
Decadent is currently offline Decadent

 
Messages:12
Registered:December 2016
JA2 1.13 7609 still freezing on windows 10, nothing seems to solve this problem for me.

Report message to a moderator

Private
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #347804 is a reply to message #347730] Sun, 25 December 2016 10:48 Go to previous messageGo to next message
Decadent is currently offline Decadent

 
Messages:12
Registered:December 2016
I found a solution that is working on Windows 10:

Installed
Microsoft Visual C++ 2005 Redistributable Package (x86)
Microsoft Visual C++ 2008 Redistributable Package (x86)

The only confusing part was that both downloads from Microsoft have the same name 'vcredist_x86.exe'

Working in fullscreen mode, exits without freezing, no crashing.






Report message to a moderator

Private
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #348613 is a reply to message #335812] Tue, 31 January 2017 21:39 Go to previous messageGo to next message
Yubi is currently offline Yubi

 
Messages:5
Registered:January 2017
I also have a laptop with Win 8.1 64bit and suffered from freezes even though I followed all the advices from this thread, setting the compatibilities and colors to ja2.exe etc. Still the game froze in the manner that others have described. Fiddling with various options I managed to apparently get rid of the freezes by going to nvidia control panel and disabling "threaded optimization" for ja2.exe. Now I have not had a single freeze or problem since then. So those people with freezes might also give this a try, no guarantees tho. big grin

tl;dr disable "threaded optimization" for ja2.exe in nvidia control panel (or equivalent) to get rid of freezes for win 8.1.

EDIT: Seems that the problems are back, so you might want to discard this idea. Apparently I just got lucky streaks of nonfreezing gameplay.

EDIT2: Seems to be unplayable on win 8.1, cant get rid of the freezes. Only thing working seems to be is to set the game on win 98 compatibility mode but this makes the sounds of the game to stutter and the red screen that appears when entering hostile sectors or entering any sector makes the transition phase stutter like mad.

[Updated on: Wed, 01 February 2017 18:20]

Report message to a moderator

Private
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #348677 is a reply to message #347804] Fri, 03 February 2017 00:29 Go to previous messageGo to next message
grim is currently offline grim

 
Messages:344
Registered:July 2006
Location: France
Decadent wrote on Sun, 25 December 2016 09:48
I found a solution that is working on Windows 10:

Installed
Microsoft Visual C++ 2005 Redistributable Package (x86)
Microsoft Visual C++ 2008 Redistributable Package (x86)

The only confusing part was that both downloads from Microsoft have the same name 'vcredist_x86.exe'

Working in fullscreen mode, exits without freezing, no crashing.

I tried this and until now no crash/freeze unlike before, it seems to work well.

Report message to a moderator

Master Sergeant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #348733 is a reply to message #335812] Mon, 06 February 2017 19:28 Go to previous messageGo to next message
Yubi is currently offline Yubi

 
Messages:5
Registered:January 2017
I did some further testing and it seems that atleast on my computer (Win 8.1 64bit laptop) the solution is to set CPU affinity only to one core and the freezes are gone. This has been mentioned before in the thread but I had trouble making it work as my ja2.exe froze when I tabbed out of it and I dont want to play windowed. I also did not manage to make core affinity shortcuts work, so i searched for other ways to permanently set core affinities and a quite simple way to do this is to use a program called imagecfg. You can use this program to set ja2.exe to permanently use only one core so you dont have to set it each time you start the game, or if alt-tabbing out of the game freezes it, like mine did. My ja2.exe now uses only CPU4 and I have not had any freezes, played about +5h. Game has very minimal slowdown when transitioning to other sectors but otherwise everything seems stable, no sound stutter or anything.

I cant post links so I cannot post a direct link to imagecfg but you can google "imagecfg" and a site with download and instructions should pop up. (robpol86 dot com)

Report message to a moderator

Private
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #348739 is a reply to message #348733] Tue, 07 February 2017 00:48 Go to previous messageGo to next message
Someone64 is currently offline Someone64

 
Messages:47
Registered:May 2015
Location: Philippines
You can also save process affinity with a task manager replacement called Process Hacker. You'll need a nightly build to do this as the stable doesn't have the feature available yet.

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349338 is a reply to message #348739] Sat, 25 March 2017 12:26 Go to previous messageGo to next message
Tyxe is currently offline Tyxe

 
Messages:78
Registered:May 2012
Location: France
The imagecfg seems to work, i used to have a lot of freeze to the point it was barely playable before using it.
But it has drawbacks (or maybe because i have an old laptop that not powerful enough to run the game very fast with only one core) : when i "zoomed" in a sector as indicated by Yubi but much more annoying i can't speed up the game clock (very useful to speed up enemies/civilians turns or just when you want to move your mercs faster) by pressing the -+ like before as it make instead the game lag.
For info I had the maximum clock speed already in my ini for enemies/civilians and i don't want to speed up the general clock more than 10%.

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349417 is a reply to message #349338] Thu, 06 April 2017 09:54 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
Well trying this all out again after a couple years. happy

New hardware;
Windows 10 anniversary refresh on a Surface Pro 4 core i7.

I've done wine, registry fix, XP3 compatibility, and 16 bit color mode.

Playing full screen;

I get freezes (no response, music still plays) randomly but only when multiple sound effects triggered.

If I turn sound down all the way for PC/NPC and music, no random lockups / freezes.

With sound on...

It is diabolically easy to replicate. With "annoying speech" at 40%, doing a SHIFT+CTRL+R after a battle to reload weapons will freeze the game. (7 members on squad)

Doing a mass move of merc squad (7 members) occasionally freezes the game.

20 militia with the command to "inspect militia" doesn't lock up the game BUT causes a game-ending issue where the merc's mouths all continually wag nonstop, and the buttons on the strategic map no longer work. (once you exit sector back to strategic map, game over, the enter sector, options, resume time, etc all are grayed out. )

The issue is definitely related to sfx.

Is there a way to track how many simultaneous sound effects are playing and cap it?

Seems to me that if enough SFX are triggered simultaneously it is causing the issue, as the lockup problem is ONLY occurring when there are sound effects playing simultaneously to one another. Since music keeps playing and other things keep working, it almost seems like the problem stems from the code which is firing the sound effects is crapping out the in game ogg sound driver. The functions never return (stack overflow that isn't trapped?) and the game logic cannot continue.

If there were a setting externalized (e.g. "MAX_SIMULTANEOUS_SOUNDS") it would allow us to further test & diagnose.

Another useful option would be (grasping at straws here) some ability to forcefully re-initialize the sound system; perhaps returning control back to the game processing loop.

(To be clear when the game "locks up" from this; screen redraw still works, music still works, scrolling around the map still works, but cannot click on anything, UI is totally nonresponsive other than border scroll, keyboard input is ignored. Whatever is breaking is causing only a partial failure where mouse and keyboard input is no longer accepted and the sounds which were supposed to play never play; e.g. when it locks up on CTRL+SHIFT+R after a battle or when I do "militia inspect" there's no sounds that actually play - whatever dies, dies during sound processing and then stops all input from working.)

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349419 is a reply to message #349417] Thu, 06 April 2017 13:26 Go to previous messageGo to next message
Shanga is currently offline Shanga

 
Messages:3482
Registered:January 2000
Location: Danubia
http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23364&start=0&

Report message to a moderator

Captain
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349420 is a reply to message #349419] Thu, 06 April 2017 14:35 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
Tried dxwnd yesterday, same result. Also, had a real bitch of a time getting that to work on a high DPI system.. three hours of working on getting the settings right, only to have the same exact result.

I can play for hours and hours without issue with NPC/PC sound and music turned off.

Kind of sucks only to have bullets make sounds though. I miss hearing people scream.

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349422 is a reply to message #349420] Fri, 07 April 2017 09:39 Go to previous messageGo to next message
Decadent is currently offline Decadent

 
Messages:12
Registered:December 2016
@TrentL Did you try my fix for windows 10?

Install:
Microsoft Visual C++ 2005 Redistributable Package (x86)
Microsoft Visual C++ 2008 Redistributable Package (x86)

I have not set any compatibility mode nor using wine, just the registry fixes.

Report message to a moderator

Private
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349424 is a reply to message #349422] Sat, 08 April 2017 03:26 Go to previous messageGo to next message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
I've been trying to track down this issue, so far it appears to be caused by something weird going on in timer control code.

The timer is based on the QueryPerformanceCounter() system function, which supplies a timestamp that should be reasonably independent of current clock speed, number of CPUs and such things. So once the timer rolls over to the next tick, it stores two things, the current timestamp and the calculated timestamp of the next clock tick.

I've found that whenever the game seems to freeze, that second timestamp usually contains some weird values, sometimes decades into the future. Whenever that happens, the timer simply waits for the real timestamp to meet that bogus value. So far I'm trying to rule out errors in calculating that value, although I'm slightly worried that it might be a case of random memory corruption.

I'm testing an experimental fix where I try to detect an incorrect value and reset the timer in case it seems off. While not 100% effective, it managed to prevent the game from freezing a few times and got it back on track after it froze for several minutes.

Report message to a moderator

Master Sergeant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349429 is a reply to message #349424] Sat, 08 April 2017 12:16 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
Ok that's actually kind of interesting. Since this only happens on multi-core (running single core fixes the issue but "breaks" other things such as AI movement) you might definitely be on to something.

Read this Bob;

http://www.virtualdub.org/blog/pivot/entry.php?id=106

There's other articles out there on this.

The issue is as good as it gets for microsecond time differentials, the QueryPerformanceCounter() API function sometimes returns screwy data on multicore systems, including negative values (depending on what calculations you are using). Furthermore the way timing was handled in XP changed somewhat moving in to the Windows 7 era and again for the Win8/8.1/10.

How does your code accomodate moving time to the past, if you get a value preceeding the current value?

If you detect a difference that's greater than X ms can you not do some bounds checking logic to resample or just force a new time interval?

Are you reading system clock speed (cpu frequency) with QueryPerformanceFrequency() to translate the counter to the approx microsecond value? (this requires kernel mode QPC/QPF() calls).

The system I am using is a dual core i7 surface tablet w/ 2 logical processors per core. It *also* frequently varies CPU clock speed based on load as most systems do these days. If you are reading QPC() without taking in to account the frequency OR the frequency changes between the QPC/QPF calls (hey, stuff happens fast these days), it could cause you to get some really weird values back depending on how you're trying to calculate "the next tick" (if I'm inferring what you wrote properly). E.g. if the CPU suddenly went from a burst mode of 3.2GHZ to a power saving mode of 1.2GHZ and the frequency wasn't taken in to account.. you could get a negative estimate (compounded with QPC's sometimes odd "moving back in time" thing which causes it to spontaneously roll back it's time a few ms here and there...)

Does the application *need* nanosecond timing or would millisecond timing work? timeGetTime will be far more accurate (less buggy on multicore systems) but only gives ms timing.

http://stackoverflow.com/questions/1825720/c-high-precision-time-measurement-in-windows

"This is not just a theoretical problem; we ran into it with our application and had to conclude that the only reliable time source is timeGetTime which only has ms precision (which fortunately was sufficient in our case). We also tried fixating the thread affinity for our threads to guarantee that each thread always got a consistent value from QueryPerformanceCounter, this worked but it absolutely killed the performance in the application."

Sound familiar? Thread affinity ABSOLUTELY fixes the issue in JA but it screws up AI and other performance. happy

(I ran in to similar timing issues in a network monitoring system I wrote once; system.diagnostics.stopwatch uses QPC() calls and occasionally I'd get ping responses that were oddly "wrong". E.g. the response packet arrived at a time "previous" to when I actually sent the network packet out on very low latency networks. "How did I just get a -1ms ping?")

https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx

This MSDN article covers some interesting differences between the various OS's and can shed some light in to why this might be the underlying issue in JA2:

Windows 8, Windows 8.1, Windows Server 2012, and Windows Server 2012 R2
Windows 8, Windows 8.1, Windows Server 2012, and Windows Server 2012 R2 use TSCs as the basis for the performance counter. The TSC synchronization algorithm was significantly improved to better accommodate large systems with many processors. In addition, support for the new precise time-of-day API was added, which enables acquiring precise wall clock time stamps from the operating system. For more info, see GetSystemTimePreciseAsFileTime. On Windows RT PC platforms, the performance counter is based on either a proprietary platform counter or the system counter provided by the Windows RT PC Generic Timer if the platform is so equipped.


Now what they aren't telling you here is that different CPU cores are going to give different clock rates (naturally) and that all cores may not be running the same exact frequency (naturally). BUT, they need applications to give very precise timing which is consistent across all cores. So whatever mechanism they are using has to account for per core drift.

Personally I think their implementation is buggy - Microsoft says it's foolproof but I have seen it screw up firsthand (and there's a lot of other articles out there about this for people who have delved in to it). On Server 2012R2+ if you do a ping -t on a low latency, totally clean, isolated lab network, you'll see about 1 out of 3,000 packets give "request timed out" - often a single 1 second instance, other times in groups of 2 or 3 seconds. The system timers temporarily flip out, giving future times which exceed the 1000ms wait time default setting of the ping command. I have also witnessed this on multicore systems just reading the QPC/QPF counters as you mentioned. This is more deviation than you would expect.

I suspect this is due to some internal mechanism of 'normalizing' the ticks across multiple CPU's.

Now Windows XP SP2 used CPU TSC timer by default but could be forced to use PM timer.

Windows XP SP3 forced TSC timer. (We know JA2 runs good on this)

Windows 7+ uses HPET or some other CPU timer (which I'm trying to track down).

I'm trying to find a way to forcefully use TSC instead of HPET. Currently looks like you have to read the intrinsic _rdtsc() and work it directly off of that. (That will forcefully use the TSC counter, but there could be threading issues). That function returns the # of ticks since last processor reset. It should (importantly) never run negative and also (importantly) never return some bogus arbitrary value. It can (only) be used to track ticks between checks. (Has no bearing on processor frequency, etc).

Another symptom that points to this is when a machine hibernates/ sleeps (if I walk away from my Surface to grab coffee, take a leak, etc, come back and sign on) JA2 locks up hard most of the time.

From MSDN:

QueryPerformanceCounter reads the performance counter and returns the total number of ticks that have occurred since the Windows operating system was started, including the time when the machine was in a sleep state such as standby, hibernate, or connected standby.



Now if you are comparing values from last read to current and suddenly there's a reaaaaly big jump (say 20 minutes) between the last read and the read NOW.. you could very well find yourself waiting a very long time for the program to get to the next "tick" (if I am inferring from your post that the system determines or tries to determine when the next "tick" will be?)

You need to accommodate that.. "how much time do I have before I see the next tick" is going to be damn tricky using the QPC.

Meanwhile, reading the TSC counter should NOT be affected by this since the CPU stops making "ticks" while it's asleep. happy

Can you post the timing code and show how this is being done?

"So once the timer rolls over to the next tick, it stores two things, the current timestamp and the calculated timestamp of the next clock tick."

I'll check back tomorrow.. will try to help however I can.

[Updated on: Sat, 08 April 2017 12:20]

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349430 is a reply to message #349424] Sat, 08 April 2017 12:28 Go to previous messageGo to next message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
I think I got it. Here's the executable that I'm using, it's a few months behind current SVN version: https://www.dropbox.com/s/do21awp48rk34pi/JA2_EN_Release.7z?dl=1
I've been running this overnight and so far it's been working flawlessly. Well, at least as far as the timer related freeze is concerned ;)

Here's a quick patch that should work for the current SVN version: https://www.dropbox.com/s/rbxcwgllcrkf4mx/quickAndDirtyFix.patch?dl=1
I suggest merging this manually as there's quite a bit of junk in there, some Visual Leak Detector references, old debugging code, and a bit of changes that make this build on VC2015.

Also I fixed the issue with LBE gear losing their contents while on the ground or in a vehicle. Use ctrl+space to run a LBE integrity check.

Report message to a moderator

Master Sergeant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349431 is a reply to message #349422] Sat, 08 April 2017 12:28 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
Decadent wrote on Fri, 07 April 2017 06:39
@TrentL Did you try my fix for windows 10?

Install:
Microsoft Visual C++ 2005 Redistributable Package (x86)
Microsoft Visual C++ 2008 Redistributable Package (x86)

I have not set any compatibility mode nor using wine, just the registry fixes.



I have all of the VC++ runtimes installed *except* 2005. Visual Studio takes care of most of those installs... happy


Back on the timing issue is the timer code running on it's own thread in JA2?

If so you can tie that thread to a specific CPU core for processor affinity; thus you'll always get consistent results on QPC/QPF calls.

(This is ultimately how I ended up fixing my networking code up - it was multithreaded and I thread fixed the affinity on the timer code so it wouldn't get bounced around on different CPU's by the scheduler.)

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349433 is a reply to message #349431] Sat, 08 April 2017 13:34 Go to previous messageGo to next message
Decadent is currently offline Decadent

 
Messages:12
Registered:December 2016
@TrentL I was also missing Visual C++ 2005 which created all the issues that are being raised, once installed the game runs flawlessly. Windows 10 does not automatically install these files for you. I understand there is rarely a common fix for everyone but don't dismiss the obvious happy

Report message to a moderator

Private
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349434 is a reply to message #335812] Sat, 08 April 2017 14:09 Go to previous messageGo to next message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
In my latest attempt to fix the timer I did two things:

  1. Ensured all variable types were correct, so there would be no overflows or signed/unsigned conversion issues
  2. Added a sanity check in the function responsible for calculating the timestamp for the next tick

The timer code is in this file: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build/Utils/Timer%20Control.cpp

There are three essential JA2 threads - the main thread, the notify thread and the timer thread. Also there's a bunch of auxiliary threads for audio and stuff that don't seem to cause trouble.

Hopefully this will fix the issue for a while. If not, I have a few more ideas on how to fix this, or work around the problem. While the timer thread may be frozen, waiting for an hour after the clock went backwards, the main thread is still working the Windows message loop. It shouldn't be too hard to use it to wake up or restart the clock thread if it's not responding for too long, or add a key that allows the user to reset it once things start going off the rails.

Im guessing installing different runtimes and changing compatibility modes altered how the QPC() function behaved, which is why it helped in some cases. I rather doubt CPU pinning helped, at least for win8/win10, at most it delayed the freeze by slowing down the timer.

Report message to a moderator

Master Sergeant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349435 is a reply to message #349433] Sat, 08 April 2017 14:11 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
I gave it a try (VC2005) and compatibility mode stuff turned off. VERY laggy without Wine. I couldn't test much - grew frustrated with sluggish mouse!

I put wine back on, it runs (compatibility mode off) and it crashed nearly immediately. Turned win7 compatibility and was able to play for an hour before it crashed. Was running fine until I ran my mouse all the way to the left edge of the screen doing inventory adjustments on the strategic map; locked up immediately as soon as I hit the left border. (Frustrating because I'd just spent an hour reorganizing equipment for the nTh time). That was totally unlike the usual lockups - even the music quit. happy

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349464 is a reply to message #335812] Mon, 10 April 2017 01:47 Go to previous messageGo to next message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
Did anyone test my code or the build I posted?

So far it seems to have fixed the issue for me, both on the PC (used to freeze every 30min-2h) and the tablet (core-m CPU, used to freeze every 15min).

To test this, you don't actually need to play the game - just start it in windowed mode, load a save, load a sector then get back to the map screen. The pause text should be blinking, meaning the timer is working. just leave it like that, once in a while check if the map screen cursor is working and the pause text is still blinking. Try with an official build or SVN version first if not sure if the problem occurs. If it does, try my version and let me know if it works.

Report message to a moderator

Master Sergeant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349467 is a reply to message #349464] Mon, 10 April 2017 09:46 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
Can you drop a compiled ver 8396 exe out there? I'd be happy to test it. Don't have the stuff set up right now to do a git patch on this machine.

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349470 is a reply to message #349467] Mon, 10 April 2017 11:33 Go to previous messageGo to next message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
Here: https://www.dropbox.com/s/wnv3j15hq2gii8q/JA2_EN_Release_8396.7z?dl=1

Report message to a moderator

Master Sergeant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349475 is a reply to message #349470] Mon, 10 April 2017 19:49 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
Played a half hour so far, and so far so good Bob. I've got the afternoon off work so I should be able to get quite a few hours of testing in today.

Submitting a separate bug report regarding a resolution glitch (happens in both the SVN version and your version today, so not caused by you happy )

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349479 is a reply to message #349475] Mon, 10 April 2017 21:06 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
Definitely good so far.

Bob I'm going to go ahead and extensively playtest this over the next couple of weeks - I'll finish out my campaign on your 8396 version you posted above over the next couple weeks. I'm not very far in to it so it should give a pretty lengthy test. That way you've got a long term test before committing it.

Playing without crashes has me positively giddy. I was getting so frustrated and about to toss it back on the shelf for another year lol.

[Updated on: Mon, 10 April 2017 21:06]

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349481 is a reply to message #349479] Tue, 11 April 2017 02:46 Go to previous messageGo to next message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
Since you're testing things, would you mind using this updated exe instead?

I think I fixed the occasional crash when entering a sector, or at least fixed one way the game could crash there, so let me know if that still happens in this version. I also fixed something in interrupt code, but I don't think it had as much effect on gameplay as it did to make the debugger stop flipping out over an access violation there.

With the LBE corruption bug fixed, it's safe to put backpacks full of stuff in the car or in mercs' hands... So you can make Shank carry bags full of rocks between sectors without fear he will lose his precious cargo. Just don't get too crazy putting LBE containing stuff inside other LBE, that's still rather risky once it gets a few levels deep.

Report message to a moderator

Master Sergeant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349482 is a reply to message #349481] Tue, 11 April 2017 04:17 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
I just had a lockup after 7 hours - was just arranging inventory, clicked on a set of night vision goggles (on a helmet, to move it to another helmet), instafreeze. I'd done that dozens of times over the last 7 hours swapping helmets as I got better ones so it wasn't the inventory code.

I'll grab the new EXE and continue testing.

Definitely leagues better stability, I conquered all of Cambria and the SAM site without a single issue. Previously I would have to reload every 6-10 turns and /or every 15-30 mins on the strategic map.

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349492 is a reply to message #349482] Tue, 11 April 2017 23:22 Go to previous messageGo to next message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
I think I fixed a crash related to cover display (del/end keys), here's the updated exe. I've since moved onto getting my version in line with current SVN, so the executable with the remaining fixes is a newer revision. Shouldn't matter though, no save-braking changes.

Also, 7h of gameplay is pretty damn good for JA2, I'm not sure if the original game was that stable... There's quite a bit going on behind the scenes during inventory management, so there's actually a chance it wasn't timer related, just your usual random crash after an hour of rearranging merc inventory angry I'm sure everyone loves these.

Among other things fixed, attachment popups are arranged properly and prevent adding incompatible attachments. I've added a way for popup option availability checks to change option color.

Here's a cleaned up patch file with all my recent fixes (and a few old ones): https://www.dropbox.com/s/gq0sq60pqdqw8ll/properPatch.patch?dl=1

Report message to a moderator

Master Sergeant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349494 is a reply to message #349492] Tue, 11 April 2017 23:42 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
6+ hours after v2 exe, with zero crashes.

I'll test some more tonight after dinner. Now that the game is running good and stable I'm all sorts of fired up. happy

Also worth noting, Bob; while ALT+TAB doesn't let you get back to your windows apps; it does NOT lock up the game anymore on mine. If I accidentally hit the windows key it isn't a "OH ****" moment. The game keeps running without any issue at all; the taskbar appears and I can click back on the game and it's just fine.

I had my tablet set to 'always on' profile for testing. Tonight I'll change it back to balanced power mode and let it sleep a couple of times, and test hibernation.

With the windows login screen / facial recognition stuff that kicks in I'm curious to see if the game is still responsive after a sleep or hibernate.

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349495 is a reply to message #349494] Tue, 11 April 2017 23:56 Go to previous messageGo to next message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
It worked fine on my tablet, thing went to sleep several times before I forced it to stay awake.

Report message to a moderator

Master Sergeant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349497 is a reply to message #349495] Wed, 12 April 2017 00:58 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
Great! I'm just about to fire up another extended session!

Previously the HPC() calls would probably go pretty frigging wonky during sleep / hibernation. There would be a HUGE gap between the time the PC went to sleep and the time it woke up - so if the game were calculated "estimated next tick" it would have been a looooong wait. Sounds like your new code fixed all that up. happy

I didn't notice so much as a single stutter in extended play last night on Windows 10 anniversary refresh (windows 10 build 1607). Game ran fantastic.

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349499 is a reply to message #349497] Wed, 12 April 2017 05:41 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
Ok had an interesting non-crash Bob. Was assaulting the HQ sector in Alma and at one point in the fight, everything went in to hyperdrive.

I couldn't *do* anything with my guys, everything was flashing super fast. I could change mercs, aim, etc, but couldn't actually fire a weapon (although I could do everything else aiming wise.)

I went back to the strategic map OK, and it was flashing uber fast as well. I saved the game, reloaded, and things were back to normal. Never had to leave the game.

So not exactly a crash - as I could save and load and everything was OK after a reload, without leaving the game - but definitely something I'd never seen JA2 do before.

I don't know what precisely caused that, I was just aiming. It *almost* felt like the fast-forward AI turn never "finished" (or didn't slow back down to normal speed, when it was over), since everything was still going like it was on fast forward.

Better than crashing for sure!

But odd!

That was ~4 hours in to a game without any issues.

I was able to recover just fine and keep playing, only left the game to come write a report about it before I forgot. happy

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349508 is a reply to message #349499] Wed, 12 April 2017 21:23 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
No issues last night. Still have the LBE problem but it's sporadic. I've learned to recover from it without closing the game and re-opening.

I saw you posted a new exe for fixing LBE but it doesn't let you add multiple items of the same type.. I do that *all* the time to make grenade pouches or customized gun holsters so don't want to lose that functionality.

Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349510 is a reply to message #349508] Wed, 12 April 2017 21:50 Go to previous messageGo to next message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
I fixed that but somehow that build makes everything slow down to a crawl... I'll see if I can isolate that fix. Setting up LBE pouches has never been easier big grin

Report message to a moderator

Master Sergeant
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349511 is a reply to message #349510] Wed, 12 April 2017 22:24 Go to previous messageGo to next message
TrentL is currently offline TrentL

 
Messages:68
Registered:February 2015
Location: United States
Which development environment are you using for this Bob? Visual Studio? I've got VS2015 installed on my Surface Pro 4 (I mainly use this tablet for doing high DPI UI testing of business apps we build at work). I've never done SVN repository stuff before though. Is there a walkthrough on the forums somewhere for getting things set up to debug and compile?

I imagine there's a mile high learning curve with the existing codebase and supporting files, but it'd be interesting to take a look at it.


Report message to a moderator

Corporal
Re: JA2 1.13 Windows 8.1 -- Consistent Freezes[message #349512 is a reply to message #349511] Wed, 12 April 2017 22:56 Go to previous messageGo to previous message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
1.13 code base sure can be an experience big grin There's a thread or two about using SVN in the development forum.

Here's the updated exe: https://www.dropbox.com/s/jvmj5seffbowxa6/JA2_EN_Release_8399.7z?dl=1

I've reworked the attachment popups a bit, now they have all the necessary information to properly support pouches.
In a somewhat self-explanatory manner, attachment option colors mean: gray=unavailable in sector, red=available but incompatible, green=ready to attach.

Another improvement to the attachment menu is that ctrl+left-click on an attached item will remove it and drop it in sector inventory.

Ive also reworked the timer code a bit so its less confusing... Hopefully... And through being easier to understand, it will be harder to break it by accident. Like I did, many, many times since I started messing with it.

Report message to a moderator

Master Sergeant
Previous Topic: Runtime Error CTD
Next Topic: JA1 1.13 8408 2364 - YouTube Play Through
Goto Forum:
  


Current Time: Fri Apr 19 03:46:26 GMT+3 2024

Total time taken to generate the page: 0.02710 seconds