Home » PLAYER'S HQ 1.13 » v1.13 Solutions,Tips & Spoilers » Strategic AI march routes
Strategic AI march routes[message #343725] Sun, 10 January 2016 17:41 Go to next message
CVB

 
Messages:130
Registered:September 2014
Location: Berlin
I distinctly remember to have seen around a year ago a map picture displaying the routes the army takes from the spawning point at Meduna to different cities around Arulco. But search as I might, I'm unable to find it again. Does anybody remember this map and where I might find it?

For a small mod I'm fiddling around with changing the travel times between certain sectors and want to avoid nerfing the army by breaking their routes

Thanks in advance!



Peace is a purely theoretical state of affairs whose existence we deduce because there have been intervals between wars.
J. Pournelle
Re: Strategic AI march routes[message #343728 is a reply to message #343725] Sun, 10 January 2016 19:21 Go to previous messageGo to next message
Flugente

 
Messages:3343
Registered:April 2009
Location: Germany
I don't remember any such map, but as the enemy pathing is the same one mercs use, you could just activate cheats, teleport to Meduna palace and plot a path from there to see what path/time it would take the AI. Note, however, that during the night, there is a chance that AI travel time will be several hours longer, to account for sleeping.

Edit: Found the 'longer travela at night'-code bit:
void InitiateGroupMovementToNextSector( GROUP *pGroup )
{
...
        if ( pGroup->usGroupTeam == ENEMY_TEAM )
	{
		//Determine if the enemy group is "sleeping". If so, then simply delay their arrival time by the amount of time
		//they are going to be sleeping for.
		if ( GetWorldHour( ) >= 21 || GetWorldHour( ) <= 4 )
		{
			//It is definitely night time.
			if ( Chance( 67 ) )
			{
				//2 in 3 chance of going to sleep.
				uiSleepMinutes = 360 + Random( 121 ); //6-8 hours sleep
			}
		}
	}
	else if ( pGroup->usGroupTeam == MILITIA_TEAM )
	{
		// As the player orders militia to move, a chance-based system is ill-advised - the player would simply cancel and reassign the order, leading to bypassing the mechanic in a tedious way
		// so instead, we always add a penalty, but it will be lower
		// however, do not give such a penalty for movement inside a town - the player might just want to redistribute his troops, and this would be tedious
		if ( GetWorldHour( ) >= 21 || GetWorldHour( ) <= 4 )
		{
			if ( GetTownIdForSector( pGroup->ubSectorX, pGroup->ubSectorY ) != GetTownIdForSector( pGroup->ubNextX, pGroup->ubNextY ) )
			{
				uiSleepMinutes = 280;
			}
		}
	}

        pGroup->uiTraverseTime = GetSectorMvtTimeForGroup( ubSector, ubDirection, pGroup );
...
        // add sleep, if any
        pGroup->uiTraverseTime += uiSleepMinutes;
...

[Updated on: Sun, 10 January 2016 19:37]




“What are you doing?” Joffrey interrupted him.

“… can’t a man give a few last words for his son to carry?”

“…Who told you your son was making it out of this field alive?”

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.


Re: Strategic AI march routes[message #343730 is a reply to message #343728] Sun, 10 January 2016 19:31 Go to previous message
CVB

 
Messages:130
Registered:September 2014
Location: Berlin
Great! Knowing that the travel routes are determined dynamically solves my problem. Thank you!



Peace is a purely theoretical state of affairs whose existence we deduce because there have been intervals between wars.
J. Pournelle
Previous Topic: Problem Instaling 1.13
Next Topic: HELP PLEASE ....... . iTEM MERGING
Goto Forum:
  


Current Time: Thu Jun 21 18:44:22 EEST 2018

Total time taken to generate the page: 0.00845 seconds