Jump to content

Base generation


docnessuno

Recommended Posts

This post is meant as a base for anyone wishing to mod the functions generating the initial base layout, something i wish to do myself as soon as i'll have some more free time.

 

First of all, here's the code used to generate the base starting layout, the exavated spaces, the number and positions of steam vents and the starting facilities.

The source is the XGBase class in XComStrategyGame.UPK

 

 

function GenerateTiles()
{
local int X, Y;
local array<int> arrDeepRockTiles;
local int iNumSteamVents, iTile, I;

iNumSteamVents = 1 + Rand(class'XGTacticalGameCore'.default.NUM_STARTING_STEAM_VENTS);
m_arrTiles.Add(5 * 7);
m_arrFacilities.Add(5 * 7);
Y = 0;
J0x5a:

// End:0x333 Loop:True
if(Y < 5)
{
	X = 0;
	J0x75:

	// End:0x325 Loop:True
	if(X < 7)
	{
		// End:0xd3 Loop:False
		if(Y == 0)
		{
			m_arrTiles[TileIndex(X, Y)].iType = 3;
		}
		// End:0x291
		else
		{
			// End:0x181 Loop:False
			if(Y == 1)
			{
				m_arrTiles[TileIndex(X, Y)].iType = 3;
				// End:0x17e Loop:False
				if(X > 7 / 2 && (Roll(75)))
				{
					m_arrTiles[TileIndex(X, Y)].iType = 0;
				}
			}
			// End:0x291
			else
			{
				// End:0x1df Loop:False
				if(IsAccessLocation(X, Y))
				{
					m_arrTiles[TileIndex(X, Y)].iType = 3;
				}
				// End:0x291
				else
				{
					// End:0x22d Loop:False
					if(Roll(20))
					{
						m_arrTiles[TileIndex(X, Y)].iType = 2;
					}
					// End:0x291
					else
					{
						m_arrTiles[TileIndex(X, Y)].iType = 0;
						arrDeepRockTiles.AddItem(TileIndex(X, Y));
					}
				}
			}
		}
		m_arrTiles[TileIndex(X, Y)].X = X;
		m_arrTiles[TileIndex(X, Y)].Y = Y;
		++ X;
		// This is an implied JumpToken; Continue!
		goto J0x75;
	}
	++ Y;
	// This is an implied JumpToken; Continue!
	goto J0x5a;
}
I = 0;
J0x33e:

// End:0x3e0 Loop:True
if(I < iNumSteamVents)
{
	iTile = Rand(arrDeepRockTiles.Length);
	m_arrTiles[arrDeepRockTiles[iTile]].iType = 1;
	m_arrSteamTiles.AddItem(arrDeepRockTiles[iTile]);
	arrDeepRockTiles.Remove(iTile, 1);
	++ I;
	// This is an implied JumpToken; Continue!
	goto J0x33e;
}
SetFacility(1, 0, 0);
SetFacility(3, 2, 0);
SetFacility(2, 4, 0);
SetFacility(4, 6, 0);
SetFacility(6, 3, 1);
m_arrTiles[TileIndex(3, 1)].iTileState = 1;
SetFacility(9, 2, 1);
// End:0x4bc Loop:False
if(Game().GetDifficulty() <= 1)
{
	SetFacility(12, 0, 1);
	Game().m_arrFacilityUnlocks[12] = 1;
}
UpdateTiles();
}

 

 

Now let's go with a detailed Analysis:

The scripts pouplates two bidimensional 5*7 arrays, one storing the terrain type and one storing any facility built on the tiles.

Why 5*7 when the base has a 4*7 structure you might ask? We'll find out later!

There are also two linear arrays, one used as a list of solid rock tiles for the random placement of Steam vents and one storing the position of the steam vents.

 

First of all, the number of steam vents on the map is determined, by referencing the NUM_STARTING_STEAM_VENTS value we know from DefaultGameCore.INI. The actual number of steam vents generated is between 1 and (NUM_STARTING_STEAM_VENTS)+1

 

Before going further, we should also take a look at some excerpts from the XGGameData class in XComGame.UPK This shouls help us understend better what each tile/facility change means:

 

defaultproperties
arrTerrainMapping(0)=(MapName="Addon_SolidRock")
arrTerrainMapping(1)=(eType=ETerrainTypes.eTerrain_RockSteam,MapName="Addon_ThermalCave")
arrTerrainMapping(2)=(eType=ETerrainTypes.eTerrain_Open,MapName="Addon_Cave")
arrTerrainMapping(3)=(eType=ETerrainTypes.eTerrain_Excavated,MapName="Addon_Excavated")
arrTerrainMapping(4)=(eType=ETerrainTypes.eTerrain_ExcavatedSteam,MapName="Addon_Excavated_Thermal")
arrTerrainMapping(5)=(eType=ETerrainTypes.eTerrain_ExcavatedAccessLift,MapName="Addon_AccessLift_Excavated")
MapName="Addon_SolidRock"
}

enum EFacilityType
{
eFacility_None,
eFacility_Hangar,
eFacility_MissionControl,
eFacility_Barracks,
eFacility_Research,
eFacility_Engineering,
eFacility_AccessLift,
eFacility_ScienceLab,
eFacility_Workshop,
eFacility_SmallRadar,
eFacility_Power,
eFacility_Foundry,
eFacility_OTS,
eFacility_AlienContain,
eFacility_LargeRadar,
eFacility_ThermalPower,
eFacility_EleriumGenerator,
eFacility_PsiLabs,
eFacility_HyperwaveRadar,
eFacility_DeusEx,
eFacility_GreyMarket,
eFacility_SitRoom,
eFacility_MAX
};

 

 

After that, the m_arrTiles array is populated. This array stores the different types of terrain (see the XGGameData spoiler). This process also populates the arrDeepRockTiles array.

The following is a summary of what is accomplished during those loops and how the process unfolds:

The Y Coordinate starts at 0 for the upmost level, and increases up to 4 while going down. Since there's a level completely hidden from the player, the first visible level has Y=1

The upmost level is fully excavated (iType = 3) => "Addon_Excavated". Note that this is an "Hidden" level, wich is not displayed in the game.

The second level is fully excavated This is actually the first "real" level.

Each tile of the second level right side of the access lift (excluded) has a 75% chance to be restored to non-excavated state (iType = 0) => "Addon_SolidRock"

The access lift tiles are excavated, while each other tile has a 20% to be a cave (iType = 2) => "Addon_Cave"

Each solid rock tile from level 3 onward (Y>1, so from the visible level 2 onward) is also added to the arrDeepRockTiles array

 

Next, the Steam vents are placed:

Using the arrDeepRockTiles array, a random rock tile is selected and changed to a steam vent (iType = 1) => "Addon_ThermalCave"

The same tile is added to the m_arrSteamTiles array, and removed from the arrDeepRockTiles array

The process is looped untill the number of steam vents generated equals the valued determined earlier

 

Then the facilities are built, by calling the SetFacility function. Here we notice thet the game uses an "invisible" facility level where the 0-space stuff is built:

Facilities 2, 3 and 4 (Hangar, Mission control and Barracks) are built on level 0 (the "invisible" level)

Facility 6 (AccessLift) is built on the first real level central position (3-1)

Facility 9 (SmallRadar) is built on the first real level, next to the access lift (2-1) Obviously this is the satellite uplink

On the appropriate difficulty, Facility 12 (OTS) is unlocked and built on the first real level, in the leftmost tile (0-1)

 

Finally the UpdateTiles function is launched. This functon just double checks every tile, making sure every one is of the correct type.

Edited by docnessuno
Link to comment
Share on other sites

  • 10 months later...

Finding this thread before poking around in XGBase-functions would probably have saved me a little time :wallbash:

 

I have just completed a little modlet that emulates a completed elevator shaft with access lifts outside the base on the left hand side.

 

This allows the player to use all 28 (7*4) base tiles to build facilities instead of the normal 24 (3*4+3*4) tiles.

The requirement to excavate is still there, so the player has to excavate his way into the base from left to right.

 

Since I did the modlet by trial and error while experimenting it is most likely possible to make it cleaner but in any case this is the object code I ended up with:

 

 

function int GetAccessX()
{
  return -1;  //One column left of the leftmost visible base column
}


function bool HasAccess(int X, int Y)
{
  return true;  //Seems like a good idea when using an imaginary elevator
}


function bool HasExcavation(int X, int Y)
{
  local int iTileX, iType;

  // End:0xE2
  if(X > (GetAccessX()))
  {
    iTileX = (GetAccessX()) + 1;
    J0x2F:
    // End:0xDF [Loop If]
    if(iTileX < X)
    {
      iType = m_arrTiles[TileIndex(iTileX, Y)].iType;
      // End:0xD1
      if((((iType != 5) && iType != 3) && iType != 4) && iType != 2)
      {
        return false;
      }
      ++ iTileX;
      // [Loop Continue]
      goto J0x2F;
    }
  }
  // End:0x1C6
  else
  {
    // End:0x1C4
    if(X < (GetAccessX()))
    {
      iTileX = (GetAccessX()) - 1;
      J0x111:
      // End:0x1C1 [Loop If]
      if(iTileX > X)
      {
        iType = m_arrTiles[TileIndex(iTileX, Y)].iType;
        // End:0x1B3
        if((((iType != 5) && iType != 3) && iType != 4) && iType != 2)
        {
          return false;
        }
        -- iTileX;
        // [Loop Continue]
        goto J0x111;
      }
    }
    // End:0x1C6
    else
    {
      return true;  //Always true seemed like a good idea here, not sure if it was really needed in the end :)
    }
  }
  return true;
  //return ReturnValue;


function GenerateTiles()
{
  local int X, Y;
  local array<int> arrDeepRockTiles;
  local int iNumSteamVents, iTile, I;
//The rand() below explains why the number of steam vents is not respecting DGC-ini
  iNumSteamVents = 1 + Rand(class'XGTacticalGameCore'.default.NUM_STARTING_STEAM_VENTS);
  m_arrTiles.Add(5 * 7);
  m_arrFacilities.Add(5 * 7);
  Y = 0;
  J0x5A:
  // End:0x333 [Loop If]
  if(Y < 5)
  {
    X = 0;
    J0x75:
    // End:0x325 [Loop If]
    if(X < 7)
    {
      // End:0xD3
      if(Y == 0)
      {
        m_arrTiles[TileIndex(X, Y)].iType = 3;
      }
      // End:0x291
      else
      {
        // End:0x181
        if(Y == 1)
        {
          m_arrTiles[TileIndex(X, Y)].iType = 3;
          // End:0x17E
          if((X > (7 / 2)) && Roll(75))
          {
            m_arrTiles[TileIndex(X, Y)].iType = 0;
          }
        }
        // End:0x291
        else
        {
          // End:0x1DF
          if(IsAccessLocation(X, Y))
          {
            m_arrTiles[TileIndex(X, Y)].iType = 1;  //Was originally 3 is no longer used at all since the elevator is outside the base
          }
          // End:0x291
          else
          {
            // End:0x22D
            if(Roll(20))
            {
              m_arrTiles[TileIndex(X, Y)].iType = 2;
            }
            // End:0x291
            else
            {
              m_arrTiles[TileIndex(X, Y)].iType = 0;
              arrDeepRockTiles.AddItem(TileIndex(X, Y));
            }
          }
        }
      }
      m_arrTiles[TileIndex(X, Y)].X = X;
      m_arrTiles[TileIndex(X, Y)].Y = Y;
      ++ X;
      // [Loop Continue]
      goto J0x75;
    }
    ++ Y;
    // [Loop Continue]
    goto J0x5A;
  }
  I = 0;
  J0x33E:
  // End:0x3E0 [Loop If]
  if(I < iNumSteamVents)
  {
    iTile = Rand(arrDeepRockTiles.Length);
    m_arrTiles[arrDeepRockTiles[iTile]].iType = 1;
    m_arrSteamTiles.AddItem(arrDeepRockTiles[iTile]);
    arrDeepRockTiles.Remove(iTile, 1);
    ++ I;
    // [Loop Continue]
    goto J0x33E;
  }
  SetFacility(1, 0, 0);
  SetFacility(3, 2, 0);
  SetFacility(2, 4, 0);
  SetFacility(4, 6, 0);
  //Removed the default elevator building: SetFacility(6,3,0); 
  m_arrTiles[TileIndex(3, 1)].iTileState = 1;
  SetFacility(9, 2, 1);
  // End:0x4AD
  if(Game().GetDifficulty() <= 1)
  {
    SetFacility(12, 0, 1);
    Game().m_arrFacilityUnlocks[12] = 1;
  }
  UpdateTiles();
  //return;  
}

 

 

 

toolboks mod:

 

 

MOD_NAME=Increased Base Size
AUTHOR=Bertilsson
DESCRIPTION=Base Size increased by 4 tiles by emulating a pre-built access elevator shaft outside the visible base on the left hand side.

Version: 1.0

Compatible with XCOM Enemy Unknown versions:
 - Patch 4 ( Changelist: 356266 )

UPK_FILE=XComStrategyGame.upk
OFFSET=2669803
[MODDED_HEX]
{Replace entire XGBase.HasExcavation function}
B0 21 00 00 AB 1F 00 00 00 00 00 00 AB 21 00 00 00 00 00 00 00 00 00 00 B0 21 00 00 00 00 00 00 68 01 00 00 36 27 00 00 D3 01 00 00 7E 01 00 00 07 E2 00 97 00 B0 21 00 00 1B 71 0E 00 00 00 00 00 00 16 16 0F 00 AD 21 00 00 92 1B 71 0E 00 00 00 00 00 00 16 26 16 07 DF 00 96 00 AD 21 00 00 00 B0 21 00 00 16 0F 00 AC 21 00 00 35 28 05 00 00 2B 05 00 00 00 00 10 1B D2 28 00 00 00 00 00 00 00 AD 21 00 00 00 AF 21 00 00 16 01 69 21 00 00 07 D1 00 82 82 82 9B 00 AC 21 00 00 2C 05 16 18 0E 00 9B 00 AC 21 00 00 2C 03 16 16 18 0E 00 9B 00 AC 21 00 00 2C 04 16 16 18 0E 00 9B 00 AC 21 00 00 2C 02 16 16 04 28 A5 00 AD 21 00 00 16 06 2F 00 06 C6 01 07 C4 01 96 00 B0 21 00 00 1B 71 0E 00 00 00 00 00 00 16 16 0F 00 AD 21 00 00 93 1B 71 0E 00 00 00 00 00 00 16 26 16 07 C1 01 97 00 AD 21 00 00 00 B0 21 00 00 16 0F 00 AC 21 00 00 35 28 05 00 00 2B 05 00 00 00 00 10 1B D2 28 00 00 00 00 00 00 00 AD 21 00 00 00 AF 21 00 00 16 01 69 21 00 00 07 B3 01 82 82 82 9B 00 AC 21 00 00 2C 05 16 18 0E 00 9B 00 AC 21 00 00 2C 03 16 16 18 0E 00 9B 00 AC 21 00 00 2C 04 16 16 18 0E 00 9B 00 AC 21 00 00 2C 02 16 16 04 28 A6 00 AD 21 00 00 16 06 11 01 06 C6 01 04 27 04 27 04 3A AE 21 00 00 53 9A 00 AF 21 00 00 25 16 18 24 00 9A 1B 10 0F 00 00 00 00 00 00 00 B0 21 00 00 93 00 AF 21 00 00 26 16 16 2C 06 16 16 00 00 00 02 00 02 00 0B 11 00 00 00 00 00 00

UPK_FILE=XComStrategyGame.upk
OFFSET=2669526
[MODDED_HEX]
{Replace entire XGBase.GetAccessX function}
AA 21 00 00 AB 1F 00 00 00 00 00 00 A9 21 00 00 00 00 00 00 00 00 00 00 AA 21 00 00 00 00 00 00 5E 01 00 00 3F 26 00 00 08 00 00 00 0E 00 00 00 04 1D FF FF FF FF 53 0B 0B 0B 0B 0B 0B 0B 00 00 00 02 00 02 00 71 0E 00 00 00 00 00 00

UPK_FILE=XComStrategyGame.upk
OFFSET=2669319
[MODDED_HEX]
{Replace entire XGBase.HasAccess function}
A8 21 00 00 AB 1F 00 00 00 00 00 00 A5 21 00 00 00 00 00 00 00 00 00 00 A8 21 00 00 00 00 00 00 54 01 00 00 1E 25 00 00 03 00 00 00 68 00 00 00 04 27 53 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 00 00 00 02 00 02 00 FF 10 00 00 00 00 00 00

UPK_FILE=XComStrategyGame.upk
OFFSET=2667038
[MODDED_HEX]
{Replace entire XGBase.GenerateTiles function}
99 21 00 00 AB 1F 00 00 00 00 00 00 92 21 00 00 00 00 00 00 00 00 00 00 99 21 00 00 00 00 00 00 D7 00 00 00 FA 16 00 00 BA 04 00 00 79 03 00 00 0F 00 96 21 00 00 92 26 A7 12 20 6D FE FF FF 09 00 F2 FB FF FF 00 02 F2 FB FF FF 16 16 54 01 69 21 00 00 90 2C 05 2C 07 16 16 54 01 6A 21 00 00 90 2C 05 2C 07 16 16 0F 00 98 21 00 00 25 07 33 03 96 00 98 21 00 00 2C 05 16 0F 00 99 21 00 00 25 07 25 03 96 00 99 21 00 00 2C 07 16 07 D3 00 9A 00 98 21 00 00 25 16 0F 35 28 05 00 00 2B 05 00 00 00 01 10 1B D2 28 00 00 00 00 00 00 00 99 21 00 00 00 98 21 00 00 16 01 69 21 00 00 2C 03 06 91 02 07 81 01 9A 00 98 21 00 00 26 16 0F 35 28 05 00 00 2B 05 00 00 00 01 10 1B D2 28 00 00 00 00 00 00 00 99 21 00 00 00 98 21 00 00 16 01 69 21 00 00 2C 03 07 7E 01 82 97 00 99 21 00 00 91 2C 07 2C 02 16 16 18 0D 00 1B 37 23 00 00 00 00 00 00 2C 4B 16 16 0F 35 28 05 00 00 2B 05 00 00 00 01 10 1B D2 28 00 00 00 00 00 00 00 99 21 00 00 00 98 21 00 00 16 01 69 21 00 00 25 06 91 02 07 DF 01 1B 0C 14 00 00 00 00 00 00 00 99 21 00 00 00 98 21 00 00 16 0F 35 28 05 00 00 2B 05 00 00 00 01 10 1B D2 28 00 00 00 00 00 00 00 99 21 00 00 00 98 21 00 00 16 01 69 21 00 00 2C 01 06 91 02 07 2D 02 1B 37 23 00 00 00 00 00 00 2C 14 16 0F 35 28 05 00 00 2B 05 00 00 00 01 10 1B D2 28 00 00 00 00 00 00 00 99 21 00 00 00 98 21 00 00 16 01 69 21 00 00 2C 02 06 91 02 0F 35 28 05 00 00 2B 05 00 00 00 01 10 1B D2 28 00 00 00 00 00 00 00 99 21 00 00 00 98 21 00 00 16 01 69 21 00 00 25 55 00 97 21 00 00 1D 00 1B D2 28 00 00 00 00 00 00 00 99 21 00 00 00 98 21 00 00 16 16 0F 35 2A 05 00 00 2B 05 00 00 00 01 10 1B D2 28 00 00 00 00 00 00 00 99 21 00 00 00 98 21 00 00 16 01 69 21 00 00 00 99 21 00 00 0F 35 29 05 00 00 2B 05 00 00 00 01 10 1B D2 28 00 00 00 00 00 00 00 99 21 00 00 00 98 21 00 00 16 01 69 21 00 00 00 98 21 00 00 A5 00 99 21 00 00 16 06 75 00 A5 00 98 21 00 00 16 06 5A 00 0F 00 94 21 00 00 25 07 E0 03 96 00 94 21 00 00 00 96 21 00 00 16 0F 00 95 21 00 00 A7 36 00 97 21 00 00 16 0F 35 28 05 00 00 2B 05 00 00 00 01 10 10 00 95 21 00 00 00 97 21 00 00 01 69 21 00 00 26 55 01 68 21 00 00 14 00 10 00 95 21 00 00 00 97 21 00 00 16 40 00 97 21 00 00 00 95 21 00 00 26 16 A5 00 94 21 00 00 16 06 3E 03 1B C8 23 00 00 00 00 00 00 26 25 25 16 1B C8 23 00 00 00 00 00 00 2C 03 2C 02 25 16 1B C8 23 00 00 00 00 00 00 2C 02 2C 04 25 16 1B C8 23 00 00 00 00 00 00 2C 04 2C 06 25 16 0F 35 26 05 00 00 2B 05 00 00 00 01 10 1B D2 28 00 00 00 00 00 00 2C 03 26 16 01 69 21 00 00 26 1B C8 23 00 00 00 00 00 00 2C 09 2C 02 26 16 07 AD 04 98 19 1B 4C 0E 00 00 00 00 00 00 16 0A 00 43 41 00 00 00 1B F6 0E 00 00 00 00 00 00 16 26 16 1B C8 23 00 00 00 00 00 00 2C 0C 25 26 16 0F 10 2C 0C 19 1B 4C 0E 00 00 00 00 00 00 16 09 00 07 41 00 00 00 01 07 41 00 00 26 1B 23 2C 00 00 00 00 00 00 16 04 0B 53 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 00 00 00 02 00 02 00 66 0E 00 00 00 00 00 00
 

 

 

 

I guess a possible improvement would be to always place steam vents in the rightmost column on level 2-4 and possibly level 1 based on difficulty level. That way player always have the option to build thermo power but the player needs to prioritize excavation to reach the steam vents.

Edited by Bertilsson
Link to comment
Share on other sites

I guess updated enums wouldn't hurt in case someone wants to tinker around:

0	0	eTerrain_Rock
1	1	eTerrain_RockSteam
2	2	eTerrain_Open
3	3	eTerrain_Excavated
4	4	eTerrain_ExcavatedSteam
5	5	eTerrain_Facility
6	6	eTerrain_ExcavatedAccessLift
7	7	eTerrain_MAX

0	0	eFacility_None
1	1	eFacility_Hangar
2	2	eFacility_MissionControl
3	3	eFacility_Barracks
4	4	eFacility_Research
5	5	eFacility_Engineering
6	6	eFacility_AccessLift
7	7	eFacility_ScienceLab
8	8	eFacility_Workshop
9	9	eFacility_SmallRadar
10	a	eFacility_Power
11	b	eFacility_Foundry
12	c	eFacility_OTS
13	d	eFacility_AlienContain
14	e	eFacility_LargeRadar
15	f	eFacility_ThermalPower
16	10	eFacility_EleriumGenerator
17	11	eFacility_PsiLabs
18	12	eFacility_HyperwaveRadar
19	13	eFacility_DeusEx
20	14	eFacility_GreyMarket
21	15	eFacility_SitRoom
22	16	eFacility_MAX

And yes a bigger base would be cool.

Link to comment
Share on other sites

  • 2 weeks later...

What bytes would need to be changed in the ToolBoks CM to place the elevator one tile left (or right) of the central position it occupies now? The idea is to keep the somewhat central access (enabling excavating in two directions at once) but maximize the number of adjacency blocks with a 2-4 horizontal layout. Seems all we should need is to have the byte for the x-tile identified by a comment to enable everyone to play around with alternate layouts now that you have done the hard part.

 

-Dubious-

Link to comment
Share on other sites

To only move the access elevator one tile right like this: 0 1 2 3 E 5 6

XComStrategyGame.upk (BGBase.GetAccessX) decimal offset 2669577
04 2C 01
return 4 / 1;  // old object code: return 7 / 2;  (Rounded down to 3)

XComStrategyGame.upk (BGBase.GenerateTiles) decimal offset 2667836
04
SetFacility(6, 4, 1); //old object code: SetFacility(6, 3, 1);

Moving a single tile to the left is a bad idea as it also requires to move the free satelite uplink, moving 2 tiles left is also a bad idea as it conflicts with free OTS facility on easy/normal. Moving to any other column is safe.

 

Edit: To clarify: The above changes should be done to original upk, not to the modded one where elevator is "placed outside" the base.

Edited by Bertilsson
Link to comment
Share on other sites

I guess a possible improvement would be to always place steam vents in the rightmost column on level 2-4 and possibly level 1 based on difficulty level. That way player always have the option to build thermo power but the player needs to prioritize excavation to reach the steam vents.

I can't decide if this is a good idea or not. It would be very simple to implement that column x on level 2-4 should always have steam regardless of number of steam vents in DGC-ini.

 

However right now I'm leaning more towards just randomizing them all over the base and make excavation cost flat rate somewhere around $50 regardless of level. Allowing both number of steam vents and flat rate excavation cost to be defined in DGC.ini.

 

Turning excavation into flat rate seems simple enough by modifying this line in XGFacility_Engineering.GetConstructionProjectCost:

kCost.iCash = int(float(class'XGTacticalGameCore'.default.BASE_EXCAVATE_CASH_COST) * (float(2) ** float(Y - 1)));

 

Finally I'm also considering to make a custom base designing tool which allows the entire base to be pre-populated with freely selectable facilities in all tiles. But I'm kind of sceptical that anyone would find it usefull? (as it pretty much kills the entire base building aspect of the game...)

Link to comment
Share on other sites

Would such a tool require placing EVERYTHING before hand? I for one have some desire to be able to place the initial 'free' facilities in accordance with my overall plan in response to the random placement of the steam vents. (Why would anyone choose to place a satellite nexus on top of a steam vent?) But I am admittedly much more of a 'builder type' and control freak, and much less of a chaos fan, than the game designers were catering to. But the base building 'game' is much more about what/when, as the random vent placement is merely the obstacle course you are dealt.

 

And thanks for the elevator tweak.

 

Edit: Are you intending to write up a Wiki article on this? If not, I would like permission to use the above as the basis of one in the hopes someone else can flesh it out.

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

Free Satelite uplink decimal offset 2667881: 09 2C 02 //09 is facility type and 02 is column

Free Officer Training School decimal offset 2667930: 0C 25 //0C is facility type and 25 is column 0. The only alternative location would be 26 (column 1) as any other value would require you to insert a 2C-token.

 

Regarding the tool it would be required to place any facilities before starting new game so reacting to where steam is randomly placed would not be possible. However it might be possible to allow placement of steam vents as well as facilities. But it feels kind of like a gigantic overkill if it would only be used to place a few steam vents and one or two buildings :)

Edited by Bertilsson
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...