Home » MODDING HQ 1.13 » v1.13 Idea Incubation Lab » AI Turn Speed Up Mod [1.13 MP]
|
|
|
|
| Re: AI Turn Speed Up Mod [1.13 MP][message #301363]
|
Thu, 08 March 2012 23:46 
|
|
| Flugente |
 |
Messages:3499
Registered:April 2009 Location: Germany |
|
|
Hi,
not sure if this is relvant to you. I've installed Tais Unstable SCI from February 28 on a clean installation of JA2.
Then I checked out the newest dev trunk and built a debug exe. It works, but whenever I klick on a button on the preferences menu, the game freezes. Completely, irrevocable, I have to kill JA2 via Task Manager.
I've gradually checked out older versions. The last one without this error is r4957.
Your modifications came in on r4959, however that one can't be compiled. The next one I've found that can be compiled is r4964, with the error occuring there. So I'm guessing this error must've been added somewhere between r4959 and r4964.
Is that error known yet, or is there even some fix? As the HEAD revision still has it, I guess not. Any guesses?
Report message to a moderator
|
|
|
|
|
|
|
| Re: AI Turn Speed Up Mod [1.13 MP][message #301366]
|
Fri, 09 March 2012 01:05 
|
|
| Flugente |
 |
Messages:3499
Registered:April 2009 Location: Germany |
|
|
I do not get an error. Its a debug exe. It just freezes, doing nothing...
Just found out I can set exceptions on a lot of stuff, so:
I get an exception on line 827 in vonject.cpp, more specific in
// High level blit function encapsolates ALL effects and BPP
BOOLEAN BltVideoObjectToBuffer( UINT16 *pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, UINT16 usIndex, INT32 iDestX, INT32 iDestY, INT32 fBltFlags, blt_fx *pBltFx )
{
// Sometimes an exception is thrown in that method.
//BF __try
{
// Assertions
//Assert( pBuffer != NULL );
SGP_THROW_IFFALSE( pBuffer != NULL, L"No Destination Buffer" );
if ( hSrcVObject == NULL )
{
//int breakpoint=0;
}
//Assert( hSrcVObject != NULL );
SGP_THROW_IFFALSE( hSrcVObject != NULL, L"No Source Object" )
SixteenBPPObjectInfo *image = NULL;
// Check For Flags and bit depths
switch( hSrcVObject->ubBitDepth )
{
case 32:
SGP_THROW_IFFALSE(u
The whole hSrcVObject doesn't seem to be initialied (all of its attributes are 'expression could not be evaluated...
[Updated on: Fri, 09 March 2012 01:06] by Moderator Report message to a moderator
|
|
|
|
|
| Re: AI Turn Speed Up Mod [1.13 MP][message #301367]
|
Fri, 09 March 2012 01:15 
|
|
| Flugente |
 |
Messages:3499
Registered:April 2009 Location: Germany |
|
|
Look at this snippet of Options Screen.cpp:933 :
void RenderOptionsScreen()
{
HVOBJECT hPixHandle;
UINT16 usPosY, usPosX;
UINT16 usWidth=0;
UINT8 count;
//Get and display the background image
GetVideoObject(&hPixHandle, guiOptionBackGroundImage);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, iScreenWidthOffset, iScreenHeightOffset, VO_BLT_SRCTRANSPARENCY,NULL);
//Get and display the titla image
GetVideoObject(&hPixHandle, guiOptionsAddOnImages);
hPixHandle should be initialised in GetVideoObject(&hPixHandle, guiOptionBackGroundImage), but it isn't...
I checked it. When clicking on a button, the above function is called. GetVideoObject is called several times.It looks like this:
BOOLEAN GetVideoObject( HVOBJECT *hVObject, UINT32 uiIndex )
{
VOBJECT_NODE *curr;
#ifdef _DEBUG
CheckValidVObjectIndex( uiIndex );
#endif
curr = gpVObjectHead;
while( curr )
{
if( curr->uiIndex == uiIndex )
{
*hVObject = curr->hVObject;
return TRUE;
}
curr = curr->next;
}
return FALSE;
}
and at one point it fails. hVObject isn't assigned properly, and I get an exception.
Its rather strange. The uiIndex always differs, even if I always press the same button. gpVObjectHead seems always to be proper intialised, no obviously bogus values there.
The error also does not always occur. Sometimes I can click 2 or three times before it crashes, but it always does.
Seems to be like unprotected writing somewhere, as curr seems to point to gibberish.
[Updated on: Fri, 09 March 2012 01:27] by Moderator Report message to a moderator
|
|
|
|
|
| Re: AI Turn Speed Up Mod [1.13 MP][message #301376]
|
Fri, 09 March 2012 05:30 
|
|
tazpn |
 |
Messages:99
Registered:December 2007 Location: CA, USA |
|
|
While I agree with your analysis about corruption, I'm not sure how the function gets called outside of the protected loop. Unless there is some other multithreaded code that I'm not aware of executing its pretty unlikely to be the new timer.
Does it happen if you have HIGHSPEED_TIMER = FALSE or only when it is TRUE?
The former is effectively the original code so it would not likely be this modification.
Edit: Added some assert code to those routine to make sure they are only called from my notification thread and they are.
It sounded like you did not pull the changes directly from the mod data folder only the source? You may have mismatched assets as there have been about 10 changes to data folder since the 28th.
[Updated on: Fri, 09 March 2012 06:00] by Moderator Report message to a moderator
|
Corporal 1st Class
|
|
|
|
| Re: AI Turn Speed Up Mod [1.13 MP][message #301440]
|
Sat, 10 March 2012 00:37 
|
|
| Flugente |
 |
Messages:3499
Registered:April 2009 Location: Germany |
|
|
Only happens if HIGHSPEED_TIMER = TRUE, it seems. But the behaviour is weirder. When I got home, 3 hours ago, I started my pc and immediately started the exe I'm having problems with (r4964 atm).
The error didn't occur then but it does now. Can be reproduced. Which is strange, I am compiling/surfing/listening to music/playing/watching videos, but my pc is able to do that easily, the workload isn't high. But it must have something to do with that. I didn't change anything in that GameDir, and the exe is still the same. 3 hours ago it worked, now it doesn't. ???????
When I first had the error, I had a fresh installation of SCI into which I copied the whole GameDir of the dev branch, and started with a debug exe I freshly built from the dev trunk. No changes from my side.
I then began checking out older revisions and always built everything from scratch until the error stopped occuring at r4957.
Report message to a moderator
|
|
|
|
|
| Re: AI Turn Speed Up Mod [1.13 MP][message #301457]
|
Sat, 10 March 2012 05:31 
|
|
tazpn |
 |
Messages:99
Registered:December 2007 Location: CA, USA |
|
|
Ok. Sounds pretty damning. Best guess is that there is some initialization timing I guess.
Because the code is in graphics, I'm going to focus on those routines as likely candidates.
Are you using Windowed Mode or Full screen? Do you have an NVidia, ATI, Intel Graphics card? Are you using recent drivers for the card?
---
After looking at the code the thing that is most suspicious is that GetVideoObject and return an uninitialized value rather than NULL when it fails to find a screen. This patch would at least help the code by not using uninitialized memory when it runs into problems.
Toggle Spoiler
Index: Build\Standard Gaming Platform\vobject.cpp
===================================================================
--- vobject.cpp (revision 5060)
+++ vobject.cpp (working copy)
@@ -272,6 +272,7 @@
}
curr = curr->next;
}
+ *hVObject = NULL;
return FALSE;
}
How the code would be uninitialized is still a mystery to me.
[Updated on: Sat, 10 March 2012 05:53] by Moderator Report message to a moderator
|
Corporal 1st Class
|
|
|
|
|
|
|
|
|
|
|
|
| Re: AI Turn Speed Up Mod [1.13 MP][message #335098]
|
Wed, 20 August 2014 21:51 
|
|
rckohler |
Messages:1
Registered:August 2014 |
|
|
First I apologize for my noobness. I just signed up to these forums. I have v 1.13 installed through steam but I am having difficulty getting this fast forward thing to work.
I downloaded your files:
JA2_EN_3882_VS2008_FF.exe
ja2data_v2.patch
ja2_fast_forward_trunk_v2.patch
ja2_fast_forward_ja2113mp_r3882.patch
Ja2_Options.ini
I pasted them into my install folder
C:\Program Files (x86)\Steam\steamapps\common\Jagged Alliance 2 Gold\
I click the executable and no effect.
Your instructions suggest "Goto Options Screen. Select Next. Select "Auto Fast Forward AI Turns" "
I don't know what you mean by this or where it is. I am running JA2 Gold v 1.13 and the only tab I have that is even close to options is preferences. The first page that opens when I start a new game does not have the Auto Fast Forward AI Turns option.
Again I am sorry for the remedial nature of this request but the turn length is too much for me to be able to wait through and this is such a good game I would really like to play it through again.
RCK
Report message to a moderator
|
Civilian
|
|
|
|
|
|
Goto Forum:
Current Time: Mon Jun 15 17:48:21 GMT+3 2026
Total time taken to generate the page: 0.07087 seconds
|