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 #300381] Mon, 27 February 2012 00:35 Go to previous messageGo to next message
tazpn

 
Messages:99
Registered:December 2007
Location: CA, USA
Here is the source patch for the mod for including the final fixes which resolved Istrebitel's issues. I've removed the additional changes I had involving interrupt resolution as its really a different mod.

ja2_ff_patch_4957.rar
Re: AI Turn Speed Up Mod [1.13 MP][message #300420] Mon, 27 February 2012 16:58 Go to previous messageGo to next message
RoWa21

 
Messages:2046
Registered:October 2005
Location: Austria
I have included the FF patch in the latest development source trunk. Works perfect. It really speeds up the enemy turn. Perfect work on this, tazpn Smile


Re: AI Turn Speed Up Mod [1.13 MP][message #301363] Thu, 08 March 2012 23:46 Go to previous messageGo to next message
Flugente

 
Messages:3051
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?



Re: AI Turn Speed Up Mod [1.13 MP][message #301364] Fri, 09 March 2012 00:02 Go to previous messageGo to next message
RoWa21

 
Messages:2046
Registered:October 2005
Location: Austria
I don't have the error. do you get the error in a debug and release build? whats the error message when you run in debug? in which method does it crash?


Re: AI Turn Speed Up Mod [1.13 MP][message #301366] Fri, 09 March 2012 01:05 Go to previous messageGo to next message
Flugente

 
Messages:3051
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



Re: AI Turn Speed Up Mod [1.13 MP][message #301367] Fri, 09 March 2012 01:15 Go to previous messageGo to next message
Flugente

 
Messages:3051
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



Re: AI Turn Speed Up Mod [1.13 MP][message #301376] Fri, 09 March 2012 05:30 Go to previous messageGo to next message
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

Re: AI Turn Speed Up Mod [1.13 MP][message #301440] Sat, 10 March 2012 00:37 Go to previous messageGo to next message
Flugente

 
Messages:3051
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.


Re: AI Turn Speed Up Mod [1.13 MP][message #301457] Sat, 10 March 2012 05:31 Go to previous messageGo to next message
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


How the code would be uninitialized is still a mystery to me.

[Updated on: Sat, 10 March 2012 05:53] by Moderator

Re: AI Turn Speed Up Mod [1.13 MP][message #301478] Sat, 10 March 2012 15:51 Go to previous messageGo to next message
Flugente

 
Messages:3051
Registered:April 2009
Location: Germany
I'm using windowed mode and always start via the INi editor. I've got an AMD Radeon HD 6950, drivers are updated.

With your fix, the problem still occurs, but the game doesn't hang, it immediately crashes. As now I don't have to manually end the task, it is a slight improvement Smile

I'd like to give in any additional info, but I don't know what, as I'm not familiar with the video routines. Any guesses where I should take a closer look via debugging?


Re: AI Turn Speed Up Mod [1.13 MP][message #301482] Sat, 10 March 2012 18:10 Go to previous messageGo to next message
tazpn

 
Messages:99
Registered:December 2007
Location: CA, USA
Well the main routine is

Build\Options Screen.cpp(298):UINT32 OptionsScreenHandle()

This calls EnterOptionsScreen, RenderOptionsScreen, and ExitOptionsScreen. EnterOptionsScreen is responsible for initializing the assets which is search for the STI files that will be used by Render and cleaned up by Exit. It looks like your machine is somehow calling Render without Enter or Enter is not properly initializing the assets because they are not there.

I'd set breakpoints on line 700, 877, 933 to look at the state of guiOptionBackGroundImage.

All of these routines should be called from same thread in succession via the OptionsScreenHandle method. The one of most importance is line 700 which should initialize the global to some value other than 0 or uninitialized.

It may be possible that CreateVideoObject or something is failing in AddStandardVideoObject which then cascades to the other issues. Some of this could in theory be video card related though unlikely.

More advanced debugging would require defining SGP_DEBUG in Build\builddefines.h which will spam debug messages to log files and the debug output window.
Re: AI Turn Speed Up Mod [1.13 MP][message #308783] Tue, 07 August 2012 21:44 Go to previous messageGo to next message
Istrebitel

 
Messages:222
Registered:December 2009
Location: Russia, Saint-Petersburg
--

[Updated on: Wed, 08 August 2012 09:59] by Moderator

Re: AI Turn Speed Up Mod [1.13 MP][message #309237] Sat, 18 August 2012 00:57 Go to previous messageGo to next message
dzolnjan
Messages:3
Registered:August 2012
Is there any progress on this fast forward AI turn stuff ??

Re: AI Turn Speed Up Mod [1.13 MP][message #335098] Wed, 20 August 2014 21:51 Go to previous messageGo to next message
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
Re: AI Turn Speed Up Mod [1.13 MP][message #335099] Wed, 20 August 2014 22:11 Go to previous message
Gambigobilla

 
Messages:719
Registered:July 2008
r3882 is just ancient considering this feature is built-in for many versions. Get the latest from here, http://www.ja-galaxy-forum.com/ubbthreads.php/topics/311288/Depri_s_Builds_and_Packages_Ge.html#Post311288
Previous Topic: Snitches + Externalised morale & reputation
Next Topic: Individual Mercs' Food Preferences.
Goto Forum:
  


Current Time: Sun Jun 25 06:35:50 EEST 2017

Total time taken to generate the page: 0.00968 seconds