Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/OpenSHC/AI/AICState.func.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "OpenSHC/AI/AIUnitBehaviourType.hpp"
#include "OpenSHC/AI/AIVUnitType.hpp"
#include "OpenSHC/Commands/MappersEnum.hpp"
#include "OpenSHC/Game/Player/PlayerID.hpp"
#include "OpenSHC/Game/Resources/ResourceType.hpp"
#include "OpenSHC/Map/Units/UnitType.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"
Expand All @@ -19,7 +18,6 @@ namespace AI {
using OpenSHC::AI::AIUnitBehaviourType;
using OpenSHC::AI::AIVUnitType;
using OpenSHC::Commands::MappersEnum;
using OpenSHC::Game::Player::PlayerID;
using OpenSHC::Game::Resources::ResourceType;
using OpenSHC::Map::Units::UnitType;
using OpenSHC::WindowsHelper::Enums::BOOLEnum;
Expand Down Expand Up @@ -122,11 +120,11 @@ namespace AI {
getResourceRebuildDelay;

MACRO_FUNCTION_RESOLVER(
int (AICState::*)(PlayerID), false, Address::SHC_3BB0A8C1_0x004CB180, &AICState::aiFarmChoice)
int (AICState::*)(int), false, Address::SHC_3BB0A8C1_0x004CB180, &AICState::aiFarmChoice)
aiFarmChoice;

MACRO_FUNCTION_RESOLVER(
int (AICState::*)(PlayerID), false, Address::SHC_3BB0A8C1_0x004CB1B0, &AICState::setNextFarmTypeToBuild)
int (AICState::*)(int), false, Address::SHC_3BB0A8C1_0x004CB1B0, &AICState::setNextFarmTypeToBuild)
setNextFarmTypeToBuild;

MACRO_FUNCTION_RESOLVER(
Expand All @@ -138,22 +136,22 @@ namespace AI {
aiShouldBuildWoodcutter;

MACRO_FUNCTION_RESOLVER(
uint (AICState::*)(PlayerID), false, Address::SHC_3BB0A8C1_0x004CB330, &AICState::aiShouldBuildQuarry)
uint (AICState::*)(int), false, Address::SHC_3BB0A8C1_0x004CB330, &AICState::aiShouldBuildQuarry)
aiShouldBuildQuarry;

MACRO_FUNCTION_RESOLVER(
undefined4 (AICState::*)(int), false, Address::SHC_3BB0A8C1_0x004CB3A0, &AICState::aiRequiresExtraOxtethers)
aiRequiresExtraOxtethers;

MACRO_FUNCTION_RESOLVER(
uint (AICState::*)(PlayerID), false, Address::SHC_3BB0A8C1_0x004CB4D0, &AICState::aiShouldBuildIronMine)
uint (AICState::*)(int), false, Address::SHC_3BB0A8C1_0x004CB4D0, &AICState::aiShouldBuildIronMine)
aiShouldBuildIronMine;

MACRO_FUNCTION_RESOLVER(
uint (AICState::*)(PlayerID), false, Address::SHC_3BB0A8C1_0x004CB540, &AICState::aiShouldBuildPitchrig)
uint (AICState::*)(int), false, Address::SHC_3BB0A8C1_0x004CB540, &AICState::aiShouldBuildPitchrig)
aiShouldBuildPitchrig;

MACRO_FUNCTION_RESOLVER(BOOLEnum (AICState::*)(PlayerID, MappersEnum), false, Address::SHC_3BB0A8C1_0x004CB5B0,
MACRO_FUNCTION_RESOLVER(BOOLEnum (AICState::*)(int, MappersEnum), false, Address::SHC_3BB0A8C1_0x004CB5B0,
&AICState::shouldNotBeBuildingHovel)
shouldNotBeBuildingHovel;

Expand Down Expand Up @@ -784,7 +782,7 @@ namespace AI {
&AICState::shouldNotBeBuildingGranary)
shouldNotBeBuildingGranary;

MACRO_FUNCTION_RESOLVER(BOOLEnum (AICState::*)(PlayerID, MappersEnum), false, Address::SHC_3BB0A8C1_0x004ECA60,
MACRO_FUNCTION_RESOLVER(BOOLEnum (AICState::*)(int, MappersEnum), false, Address::SHC_3BB0A8C1_0x004ECA60,
&AICState::shouldNotBeBuildingArmoury)
shouldNotBeBuildingArmoury;

Expand Down
16 changes: 7 additions & 9 deletions src/OpenSHC/AI/AICState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "OpenSHC/AI/AIVUnitType.hpp"
#include "OpenSHC/AI/TileDistancePair.hpp"
#include "OpenSHC/Commands/MappersEnum.hpp"
#include "OpenSHC/Game/Player/PlayerID.hpp"
#include "OpenSHC/Game/Resources/ResourceType.hpp"
#include "OpenSHC/Map/Units/UnitType.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"
Expand All @@ -28,7 +27,6 @@ namespace AI {
using OpenSHC::AI::TileDistancePair;
using OpenSHC::AI::AIC::AICSpecification;
using OpenSHC::Commands::MappersEnum;
using OpenSHC::Game::Player::PlayerID;
using OpenSHC::Game::Resources::ResourceType;
using OpenSHC::Map::Units::UnitType;
using OpenSHC::WindowsHelper::Enums::BOOLEnum;
Expand Down Expand Up @@ -104,23 +102,23 @@ namespace AI {

int getResourceRebuildDelay(int param_1);

int aiFarmChoice(PlayerID playerID);
int aiFarmChoice(int playerID);

int setNextFarmTypeToBuild(PlayerID playerID);
int setNextFarmTypeToBuild(int playerID);

BOOLEnum aiShouldBuildFarm(int playerID);

BOOLEnum aiShouldBuildWoodcutter(int playerID);

uint aiShouldBuildQuarry(PlayerID playerID);
uint aiShouldBuildQuarry(int playerID);

undefined4 aiRequiresExtraOxtethers(int playerID);

uint aiShouldBuildIronMine(PlayerID playerID);
uint aiShouldBuildIronMine(int playerID);

uint aiShouldBuildPitchrig(PlayerID param_1);
uint aiShouldBuildPitchrig(int playerID);

BOOLEnum shouldNotBeBuildingHovel(PlayerID playerID, MappersEnum param_2);
BOOLEnum shouldNotBeBuildingHovel(int playerID, MappersEnum param_2);

BOOLEnum shouldWaitWithBuildingNegativeFearFactor(int param_1, MappersEnum param_2);

Expand Down Expand Up @@ -438,7 +436,7 @@ namespace AI {

BOOLEnum shouldNotBeBuildingGranary(int playerID, MappersEnum param_2);

BOOLEnum shouldNotBeBuildingArmoury(PlayerID playerID, MappersEnum param_2);
BOOLEnum shouldNotBeBuildingArmoury(int playerID, MappersEnum param_2);

BOOLEnum shouldNotBuildKillingPits(int playerID, MappersEnum commandBuildingType);

Expand Down
16 changes: 7 additions & 9 deletions src/OpenSHC/AI/AIVState.func.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "OpenSHC/AI/AIV/AIVBuildingType2.hpp"
#include "OpenSHC/AI/AIVState.hpp"
#include "OpenSHC/Commands/MappersEnum.hpp"
#include "OpenSHC/Game/Player/PlayerID.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"
namespace OpenSHC {
namespace AI {
Expand All @@ -15,7 +14,6 @@ namespace AI {
using OpenSHC::AI::AIGridComputationResourceType;
using OpenSHC::AI::AIV::AIVBuildingType2;
using OpenSHC::Commands::MappersEnum;
using OpenSHC::Game::Player::PlayerID;
using OpenSHC::WindowsHelper::Enums::BOOLEnum;

// Constructor
Expand Down Expand Up @@ -56,18 +54,18 @@ namespace AI {
rotateAIV;

MACRO_FUNCTION_RESOLVER(
void (AIVState::*)(PlayerID), false, Address::SHC_3BB0A8C1_0x004ED240, &AIVState::aiPlaceFlag)
void (AIVState::*)(int), false, Address::SHC_3BB0A8C1_0x004ED240, &AIVState::aiPlaceFlag)
aiPlaceFlag;

MACRO_FUNCTION_RESOLVER(
void (AIVState::*)(PlayerID), false, Address::SHC_3BB0A8C1_0x004ED300, &AIVState::aiPlaceBrazier)
void (AIVState::*)(int), false, Address::SHC_3BB0A8C1_0x004ED300, &AIVState::aiPlaceBrazier)
aiPlaceBrazier;

MACRO_FUNCTION_RESOLVER(void (AIVState::*)(int, int), false, Address::SHC_3BB0A8C1_0x004ED3B0,
&AIVState::incrementStructureHeatMapTile)
incrementStructureHeatMapTile;

MACRO_FUNCTION_RESOLVER(BOOLEnum (AIVState::*)(PlayerID, int, int), false, Address::SHC_3BB0A8C1_0x004ED410,
MACRO_FUNCTION_RESOLVER(BOOLEnum (AIVState::*)(int, int, int), false, Address::SHC_3BB0A8C1_0x004ED410,
&AIVState::aiPlaceAIVBuilding)
aiPlaceAIVBuilding;

Expand All @@ -83,7 +81,7 @@ namespace AI {
int (AIVState::*)(), false, Address::SHC_3BB0A8C1_0x004EDD00, &AIVState::computeLargestSeparateArea)
computeLargestSeparateArea;

MACRO_FUNCTION_RESOLVER(int (AIVState::*)(PlayerID, MappersEnum), false, Address::SHC_3BB0A8C1_0x004EDDF0,
MACRO_FUNCTION_RESOLVER(int (AIVState::*)(int, MappersEnum), false, Address::SHC_3BB0A8C1_0x004EDDF0,
&AIVState::findSuitableFarmLocationAndPlaceFarm)
findSuitableFarmLocationAndPlaceFarm;

Expand Down Expand Up @@ -132,7 +130,7 @@ namespace AI {
findSpotNearEngineersGuild;

MACRO_FUNCTION_RESOLVER(
void (AIVState::*)(PlayerID), false, Address::SHC_3BB0A8C1_0x004EFC30, &AIVState::aiPlaceAdditionalOxtether)
void (AIVState::*)(int), false, Address::SHC_3BB0A8C1_0x004EFC30, &AIVState::aiPlaceAdditionalOxtether)
aiPlaceAdditionalOxtether;

MACRO_FUNCTION_RESOLVER(
Expand All @@ -147,7 +145,7 @@ namespace AI {
void (AIVState::*)(int), false, Address::SHC_3BB0A8C1_0x004EFED0, &AIVState::aiPlaceQuarryAndOxtether)
aiPlaceQuarryAndOxtether;

MACRO_FUNCTION_RESOLVER(BOOLEnum (AIVState::*)(PlayerID, int), false, Address::SHC_3BB0A8C1_0x004F0060,
MACRO_FUNCTION_RESOLVER(BOOLEnum (AIVState::*)(int, int), false, Address::SHC_3BB0A8C1_0x004F0060,
&AIVState::executeDefaultCastleAIV)
executeDefaultCastleAIV;

Expand All @@ -164,7 +162,7 @@ namespace AI {
tryPlaceAIVAndReturnFitPercentage;

MACRO_FUNCTION_RESOLVER(
void (AIVState::*)(PlayerID), false, Address::SHC_3BB0A8C1_0x004F15C0, &AIVState::aiDecideOnNewBuildings)
void (AIVState::*)(int), false, Address::SHC_3BB0A8C1_0x004F15C0, &AIVState::aiDecideOnNewBuildings)
aiDecideOnNewBuildings;

MACRO_FUNCTION_RESOLVER(void (AIVState::*)(), false, Address::SHC_3BB0A8C1_0x004F1860,
Expand Down
16 changes: 7 additions & 9 deletions src/OpenSHC/AI/AIVState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "OpenSHC/AI/AIV/AIVBuildingType2Short.hpp"
#include "OpenSHC/AI/AIV/AIVSpec.hpp"
#include "OpenSHC/Commands/MappersEnum.hpp"
#include "OpenSHC/Game/Player/PlayerID.hpp"
#include "OpenSHC/Map/HeatMap.hpp"
#include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp"

Expand All @@ -27,7 +26,6 @@ namespace AI {
using OpenSHC::AI::AIV::AIVBuildingType2Short;
using OpenSHC::AI::AIV::AIVSpec;
using OpenSHC::Commands::MappersEnum;
using OpenSHC::Game::Player::PlayerID;
using OpenSHC::Map::HeatMap;
using OpenSHC::WindowsHelper::Enums::BOOLEnum;

Expand Down Expand Up @@ -100,21 +98,21 @@ namespace AI {

void rotateAIV(int orientation);

void aiPlaceFlag(PlayerID playerID);
void aiPlaceFlag(int playerID);

void aiPlaceBrazier(PlayerID playerID);
void aiPlaceBrazier(int playerID);

void incrementStructureHeatMapTile(int x, int y);

BOOLEnum aiPlaceAIVBuilding(PlayerID playerID, int step, int isPausing);
BOOLEnum aiPlaceAIVBuilding(int playerID, int step, int isPausing);

void clearTheHeatmaps();

void resetCountdownInHeatMap(int x, int y);

int computeLargestSeparateArea();

int findSuitableFarmLocationAndPlaceFarm(PlayerID playerID, MappersEnum commandBuildingType);
int findSuitableFarmLocationAndPlaceFarm(int playerID, MappersEnum commandBuildingType);

void findAppropriateWoodCutterGridLocation(int playerID);

Expand All @@ -139,23 +137,23 @@ namespace AI {

BOOLEnum findSpotNearEngineersGuild(int param_1);

void aiPlaceAdditionalOxtether(PlayerID playerID);
void aiPlaceAdditionalOxtether(int playerID);

void aiPlacePitchrig(int playerID);

void aiPlaceIronMine(int playerID);

void aiPlaceQuarryAndOxtether(int playerID);

BOOLEnum executeDefaultCastleAIV(PlayerID playerID, int param_2);
BOOLEnum executeDefaultCastleAIV(int playerID, int param_2);

void recomputeHeatmaps(int initialize);

void selectBestAIVwithRandomStart(int playerID);

int tryPlaceAIVAndReturnFitPercentage(int playerID, int castleID);

void aiDecideOnNewBuildings(PlayerID playerID);
void aiDecideOnNewBuildings(int playerID);

void updateBuildingsStateAndUpdateAIBuildingDecisions();
};
Expand Down
57 changes: 35 additions & 22 deletions src/OpenSHC/AI/AttackInfo/AttackInfoDefinedData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,61 @@
#pragma once

#include "OpenSHC/AI/Tribes/AITribeTypeInt.hpp"
#include "OpenSHC/AI/Tribes/AITribeTypeShort.hpp"
#include "OpenSHC/Commands/MappersEnum.hpp"

namespace OpenSHC {
namespace AI {
namespace AttackInfo {

using OpenSHC::AI::Tribes::AITribeTypeInt;
using OpenSHC::AI::Tribes::AITribeTypeShort;
using OpenSHC::Commands::MappersEnum;

#pragma pack(push, 1)
// SIZE: 0x00000A34
typedef struct AttackInfoDefinedData {

int field0_0x0[10]; // 0x00000000 length: 40
int field1_0x28[10]; // 0x00000028 length: 40
int AICasDisThreshold[10]; // 0x00000000 length: 40
int AIAttackWaveAdvanceDelay[10]; // 0x00000028 length: 40
int AttackWaveDurationPerAttacker[10]; // 0x00000050 length: 40
int field3_0x78[10]; // 0x00000078 length: 40
int field4_0xa0[10]; // 0x000000A0 length: 40
int AIAttackWaveTargetDelay[10]; // 0x00000078 length: 40
int AIReservedTroopBudget[10]; // 0x000000A0 length: 40
MappersEnum field5_0xc8[5]; // 0x000000C8 length: 20
int field6_0xdc; // 0x000000DC length: 4
int field7_0xe0; // 0x000000E0 length: 4
int field8_0xe4; // 0x000000E4 length: 4
int field9_0xe8; // 0x000000E8 length: 4
short field10_0xec[16][2]; // 0x000000EC length: 64
undefined1 padding_0x12c[240]; // 0x0000012C length: 240
AITribeTypeInt field251_0x21c[20]; // 0x0000021C length: 80
AITribeTypeInt field252_0x26c[20]; // 0x0000026C length: 80
AITribeTypeInt field253_0x2bc[20]; // 0x000002BC length: 80
AITribeTypeInt field254_0x30c[20]; // 0x0000030C length: 80
AITribeTypeInt field255_0x35c[20]; // 0x0000035C length: 80
AITribeTypeInt field256_0x3ac[20]; // 0x000003AC length: 80
AITribeTypeInt field257_0x3fc[20]; // 0x000003FC length: 80
undefined1 padding_0x44c[800]; // 0x0000044C length: 800
AITribeTypeInt field1058_0x76c[20]; // 0x0000076C length: 80
AITribeTypeInt field1059_0x7bc[20]; // 0x000007BC length: 80
AITribeTypeShort field1060_0x80c[40]; // 0x0000080C length: 80
undefined1 padding_0x85c[400]; // 0x0000085C length: 400
int field1461_0x9ec[5]; // 0x000009EC length: 20
short SiegeCrewPositionOffsets[16][2]; // 0x000000EC length: 64
AITribeTypeInt field_0x12c[20]; // 0x0000012C length: 80
AITribeTypeInt field_0x17c[20]; // 0x0000017C length: 80
AITribeTypeInt field_0x1cc[20]; // 0x000001CC length: 80
AITribeTypeInt field14_0x21c[20]; // 0x0000021C length: 80
AITribeTypeInt field15_0x26c[20]; // 0x0000026C length: 80
AITribeTypeInt field16_0x2bc[20]; // 0x000002BC length: 80
AITribeTypeInt field17_0x30c[20]; // 0x0000030C length: 80
AITribeTypeInt field18_0x35c[20]; // 0x0000035C length: 80
AITribeTypeInt field19_0x3ac[20]; // 0x000003AC length: 80
AITribeTypeInt field20_0x3fc[20]; // 0x000003FC length: 80
AITribeTypeInt field_0x44c[20]; // 0x0000044C length: 80
AITribeTypeInt field_0x49c[20]; // 0x0000049C length: 80
AITribeTypeInt field_0x4ec[20]; // 0x000004EC length: 80
AITribeTypeInt field_0x53c[20]; // 0x0000053C length: 80
AITribeTypeInt field_0x58c[20]; // 0x0000058C length: 80
AITribeTypeInt field_0x5dc[20]; // 0x000005DC length: 80
AITribeTypeInt field_0x62c[20]; // 0x0000062C length: 80
AITribeTypeInt field_0x67c[20]; // 0x0000067C length: 80
AITribeTypeInt field_0x6cc[20]; // 0x000006CC length: 80
AITribeTypeInt field_0x71c[20]; // 0x0000071C length: 80
AITribeTypeInt field31_0x76c[20]; // 0x0000076C length: 80
AITribeTypeInt field32_0x7bc[20]; // 0x000007BC length: 80
AITribeTypeInt field33_0x80c[20]; // 0x0000080C length: 80
AITribeTypeInt field_0x85c[20]; // 0x0000085C length: 80
AITribeTypeInt field_0x8ac[20]; // 0x000008AC length: 80
AITribeTypeInt field_0x8fc[20]; // 0x000008FC length: 80
AITribeTypeInt field_0x94c[20]; // 0x0000094C length: 80
AITribeTypeInt field_0x99c[20]; // 0x0000099C length: 80
int field39_0x9ec[5]; // 0x000009EC length: 20
undefined1 padding_0xa00[12]; // 0x00000A00 length: 12
int field1474_0xa0c; // 0x00000A0C length: 4
int field52_0xa0c; // 0x00000A0C length: 4
undefined1 padding_0xa10[36]; // 0x00000A10 length: 36

} AttackInfoDefinedData;
Expand Down
34 changes: 17 additions & 17 deletions src/OpenSHC/AI/Siege/SiegeUnitCounts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ namespace AI {
typedef struct SiegeUnitCounts {

int archers; // 0x00000000 length: 4
int field1_0x4; // 0x00000004 length: 4
int field2_0x8; // 0x00000008 length: 4
int field3_0xc; // 0x0000000C length: 4
int field4_0x10; // 0x00000010 length: 4
int field5_0x14; // 0x00000014 length: 4
int field6_0x18; // 0x00000018 length: 4
int field7_0x1c; // 0x0000001C length: 4
int field8_0x20; // 0x00000020 length: 4
int field9_0x24; // 0x00000024 length: 4
int field10_0x28; // 0x00000028 length: 4
int field11_0x2c; // 0x0000002C length: 4
int field12_0x30; // 0x00000030 length: 4
int field13_0x34; // 0x00000034 length: 4
int field14_0x38; // 0x00000038 length: 4
int field15_0x3c; // 0x0000003C length: 4
int field16_0x40; // 0x00000040 length: 4
int field17_0x44; // 0x00000044 length: 4
int crossbowmen; // 0x00000004 length: 4
int spearmen; // 0x00000008 length: 4
int pikemen; // 0x0000000C length: 4
int macemen; // 0x00000010 length: 4
int swordsmen; // 0x00000014 length: 4
int knights; // 0x00000018 length: 4
int laddermen; // 0x0000001C length: 4
int engineers; // 0x00000020 length: 4
int monks; // 0x00000024 length: 4
int arabianArchers; // 0x00000028 length: 4
int slaves; // 0x0000002C length: 4
int slingers; // 0x00000030 length: 4
int assassins; // 0x00000034 length: 4
int horseArchers; // 0x00000038 length: 4
int arabianSwordsmen; // 0x0000003C length: 4
int fireThrowers; // 0x00000040 length: 4
int fireBallistas; // 0x00000044 length: 4
int field18_0x48; // 0x00000048 length: 4
int field19_0x4c; // 0x0000004C length: 4

Expand Down
Loading
Loading