home commit
This commit is contained in:
parent
8b6ad1af86
commit
7212008673
@ -504,7 +504,7 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
|
||||
|
||||
|
||||
sleepTime = 0;
|
||||
while(System.currentTimeMillis()-lastDraw<frameInterval){
|
||||
/*while(System.currentTimeMillis()-lastDraw<frameInterval){
|
||||
|
||||
try {
|
||||
Thread.sleep(1);
|
||||
@ -513,7 +513,7 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
lastDraw=System.currentTimeMillis();
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ public class baseExpensionAI {
|
||||
}
|
||||
|
||||
|
||||
boolean playerHasLessUnits = mainThread.ec.theCombatManagerAI.checkIfAIHasBiggerForce(0.85f);
|
||||
boolean playerHasLessUnits = mainThread.ec.theCombatManagerAI.checkIfAIHasBiggerForce(1f);
|
||||
|
||||
int lowGoldmineThreshold = 17500;
|
||||
|
||||
@ -157,9 +157,6 @@ public class baseExpensionAI {
|
||||
lowGoldmineThreshold = 20000;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(myMCV == null && expensionGoldMine.goldDeposite >= 17500 && (mainThread.ec.theEconomyManagerAI.preferedGoldMine.goldDeposite < lowGoldmineThreshold ||
|
||||
(mainThread.ec.theEconomyManagerAI.preferedGoldMine == expensionGoldMine && !hasConstructionYardNearGoldMine(expensionGoldMine) && !hasRefineryNearTheGoldmine(expensionGoldMine)))){
|
||||
|
||||
|
@ -93,8 +93,8 @@ public class combatManagerAI {
|
||||
//assume player force gets stronger as time goes by
|
||||
if(unrevealedPlayerForceStrength < 0)
|
||||
unrevealedPlayerForceStrength = 0;
|
||||
if(noPlayerActivityCountdown > 0)
|
||||
unrevealedPlayerForceStrength+=0.1f;
|
||||
if(noPlayerActivityCountdown > 0 && mainThread.ec.theMapAwarenessAI.totalNumberOfPlayerUnits > 0)
|
||||
unrevealedPlayerForceStrength+=0.075f;
|
||||
|
||||
if(withdrawUnitOutsideCombatRadiusCooldown > 0){
|
||||
withdrawUnitOutsideCombatRadiusCooldown --;
|
||||
|
@ -21,6 +21,7 @@ public class mapAwarenessAI {
|
||||
public int numberOfRocketTanks_player, numberOfRocketTanks_AI, numberOfRocketTanksOnMinimap_player;
|
||||
public int numberOfHeavyTanks_player, numberOfHeavyTanks_AI, numberOfHeavyTanksOnMinimap_player;
|
||||
public int numberOfPlayerUnitsOnMinimap;
|
||||
public int totalNumberOfPlayerUnits;
|
||||
public int numberOfGunTurret_player;
|
||||
public int numberOfMissileTurret_player;
|
||||
public int numberOfFactory_player;
|
||||
@ -436,11 +437,12 @@ public class mapAwarenessAI {
|
||||
numberOfPlayerBuildingDestroyedPreviousFrame = numberOfPlayerBuildingDestroyed;
|
||||
|
||||
//analyze the enemy units composition
|
||||
totalNumberOfPlayerUnits = numberOfLightTanks_player + numberOfRocketTanks_player + numberOfStealthTanks_player + numberOfHeavyTanks_player;
|
||||
|
||||
float lightTankRatio = (float)(numberOfLightTanks_player)/(numberOfLightTanks_player + numberOfRocketTanks_player + numberOfStealthTanks_player + numberOfHeavyTanks_player + 1);
|
||||
float lightTankRatio = (float)(numberOfLightTanks_player)/(totalNumberOfPlayerUnits + 1);
|
||||
|
||||
playerHasMostlyLightTanks = numberOfLightTanks_player > 5 && lightTankRatio > 0.8f;
|
||||
playerHasMostlyHeavyTanks = numberOfHeavyTanks_player > 3 && (float)(numberOfHeavyTanks_player)/(numberOfLightTanks_player + numberOfRocketTanks_player + numberOfStealthTanks_player + numberOfHeavyTanks_player) > 0.6f;
|
||||
playerHasMostlyHeavyTanks = numberOfHeavyTanks_player > 3 && (float)(numberOfHeavyTanks_player)/(totalNumberOfPlayerUnits) > 0.6f;
|
||||
playerHasManyLightTanksButNoHeavyTank = lightTankRatio > 0.5 && lightTankRatio <=0.8 && numberOfHeavyTanks_player < 3;
|
||||
|
||||
playIsRushingHighTierUnits = mainThread.gameFrame/30 > 250 && mainThread.gameFrame/30 < 400
|
||||
@ -454,7 +456,7 @@ public class mapAwarenessAI {
|
||||
|
||||
playerIsRushingLightTank = mainThread.gameFrame/30 > 300 && mainThread.gameFrame/30 < 600 && ((playerLikelyCanNotProduceHighTierUnits && numberOfStealthTanks_player < 3) || playerHasMostlyLightTanks);
|
||||
|
||||
playerHasMostlyHeavyAndStealthTanks = (maxNumberOfStealthTanks_playerInLastFiveMinutes >=2 ) && (float)(numberOfHeavyTanks_player + numberOfStealthTanks_player)/(numberOfLightTanks_player + numberOfRocketTanks_player + numberOfStealthTanks_player + numberOfHeavyTanks_player) > 0.8f;
|
||||
playerHasMostlyHeavyAndStealthTanks = (maxNumberOfStealthTanks_playerInLastFiveMinutes >=2 ) && (float)(numberOfHeavyTanks_player + numberOfStealthTanks_player)/totalNumberOfPlayerUnits > 0.8f;
|
||||
|
||||
|
||||
//advanced counting of player units
|
||||
|
@ -115,6 +115,9 @@ public class unitProductionAI {
|
||||
rallyPoint.set(mainThread.theAssetManager.constructionYards[index].centre.x - 2.5f, 0, mainThread.theAssetManager.constructionYards[index].centre.z -2.5f);
|
||||
}
|
||||
|
||||
//If the difficulty is set to normal or hard, set the rally point just outside of player's natural expansion.
|
||||
//So if the player is going for a fast expansion and don't have much units, the AI can perform a rush attack.
|
||||
|
||||
|
||||
|
||||
//make sure not to over produce when the resource is running low
|
||||
|
@ -99,7 +99,7 @@ public class gameMenu {
|
||||
+ " Light Tank -- Cheap but lightly armored. Has moderate movement speed \n and firepower. It can be considered as the jack of all trades. It can be \n upgraded to have increased range.\n\n"
|
||||
+ " Rocket Tank -- A slow moving and lightly armored unit. It has long reload \n time but can out range static defenses. It does extra damage to buildings \n and can be upgraded to deal even more damage to buildings.\n\n"
|
||||
+ " Stealth Tank -- Fast but lightly armoured. It has a passive cloak ablility that \n turns the tank invisible when not attacking. It does more damage to light \n armoured unit but significantly less damage to heavy armoured unit. It can \n be upgraded to damage multiple units in one shot.\n\n"
|
||||
+ " Heavy Tank -- Slowest and the most expensive tank in the game. Equiped \n with twin cannons, it is a moving fortress. It can be upgraded with self \n repair capability so it can last even longer in battle field.\n\n\n\n"
|
||||
+ " Heavy Tank -- The Slowest and most expensive tank in the game. Equiped \n with twin cannons, it is a moving fortress. It can be upgraded with self \n repair capability so it can last even longer in battle field.\n\n\n\n"
|
||||
+ " 2/3 ").toCharArray();
|
||||
|
||||
helpPage3 = (" About Me \n\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user