The General 1.2s

Upload your latest creations here.
Please note that by posting comments to posts in this forum you forfeit your personal copyright on whatever you post. AI Scripters reserves the right to re-use objective comments in script reviews without requiring the posting author's permission. Credit, where appropriate will be given in such cases.
Post Reply
User avatar
Leif Ericson
Waheguru
Posts: 1434
Joined: Wed Dec 09, 2009 8:15 pm
Location: United States

Re: The General 1.2

Post by Leif Ericson »

Yeah, there's no code yet to decide whether the group should fight or flee. It just searches out the best target and attacks, though some circumstances allow it to change its target before the target is killed.

Also forgot to mention that the DUC is only used when attacking at the moment.

User avatar
Aleph
Yogi
Posts: 489
Joined: Sat Jan 17, 2015 10:07 am
Location: Germany

Re: The General 1.2

Post by Aleph »

Thx for new :).

User avatar
Leif Ericson
Waheguru
Posts: 1434
Joined: Wed Dec 09, 2009 8:15 pm
Location: United States

Re: The General 1.2a

Post by Leif Ericson »

The General 1.2a:

- I noticed that I forgot to turn off my old TC retreat code and some other old DUC code from before version 1.2. :lol: This is fixed. The military behavior should be less buggy now. Still several kinks to work out though.
- Improvements to new DUC TC retreat conditions. Groups will be less likely to chase their current target under TCs.
- Cavalry will be slightly more likely to target spearmen.
- Slightly improved group re-formation behavior.
- Fixed string table full error on 8-player General games. Debug taunts 238 (enemy strategy detected) and 240 (max number of working buildings of each type allowed) are temporarily disabled.
- New replacement builders for some buildings, like towers and TCs, will no longer be sent when a builder has been recently killed (old code didn't actually work).
- Additional market for trade cart trading will now be placed in the map corner closest to the AI to provide safer trade routes. This can often result in markets in 3 corners of the map across a 4 player team which isn't necessarily desired, but it will be optimized later so that only one side of the map is used.

User avatar
Leif Ericson
Waheguru
Posts: 1434
Joined: Wed Dec 09, 2009 8:15 pm
Location: United States

Re: The General 1.2b

Post by Leif Ericson »

The General 1.2b:

This version brings some fairly substantial DUC improvements, though it's mostly bug fixes. This version is basically what 1.2 was intended to be. Several important features are still missing (and there's probably still bugs too :head )

DUC Army micro fixes:
- Fixed an issue with DUC nearby target selection where some nearby units and buildings weren't found in DUC searches because of the 40 remote list limit. The DUC now takes advantage of the extra storage space of the local list to consider as many possible nearby targets as possible.
- Fixed bugs related to retreating out of range from dangerous buildings and bugs related to targeting units within range of enemy defensive buildings. Groups are much less likely to quickly alternate between retreating and attacking. Right now the DUC groups need more conditions to go within range of enemy TCs and towers, but this will be added later.
- Fixed a bug where the AI would find no suitable destination's in the target enemy's town and then choose to select a destination in another enemy's town instead.
- Fixed a bug where groups would occasionally use the wrong formation.
- Increased the likelihood of groups choosing dropsites as attack destinations and decreased the likelihood of groups choosing houses as attack destinations.
- Melee groups are now more likely to change nearby attack targets when a higher priority unit is spotted.
- Adjusted nearby attack target priorities for various group types. Cavalry are now much more likely to prefer attacking spearmen.
- Minimized the number of rule loops the DUC micro code uses when possible. Hopefully improves game performance. Earlier code often looped through the entire 40 indexes of remote list even if it wasn't full.
- Groups now use the location of the middle unit of the group as the group's location, instead of the average location of all units in the group. This prevents issues where the group's "location" isn't near any units if the group is very spread out.
- Groups are more selective about when they regroup or when they combine together.
- Groups that are regrouping together should now respond to units attacking the group instead of standing idle until the group is gathered.
- Made small adjustments to min and max DUC group sizes that dynamically account for enemy military size.

Other Fixes:
- First attack starts sooner, usually when the AI has between 6 and 9 soldiers, instead of being too scared of being behind in pop and waiting until later.
- ID loops are now more efficient. The AI now tracks how many objects are on the map and only searches a few hundred beyond this number, instead of searching through the theoretical maximum number every time.
- Fixed issue with dynamic gathering system where the AI would not save up all the necessary resources for certain buildings, especially TCs and castles.
- Fixed issue where castle age and imperial age farms were only built when the AI had no idle farms. This hurt its boom. The boom is still relatively weak because it is often selected late, but if selected early enough it should keep up with the DE AI.
- Removed some DUC villager retasking rules which may have caused gathering percentages to not assign villagers correctly to each resource.

User avatar
wattle
Swami
Posts: 218
Joined: Fri Aug 15, 2014 1:06 pm
Location: Germany

Re: The General 1.2b

Post by wattle »

Interesting
MangudAI-all-in (wip, to be continued, when I retire from work :P )
Btw, thank you s64 for your effort. Was a pleasure to cross your way. Have a good time.

User avatar
Leif Ericson
Waheguru
Posts: 1434
Joined: Wed Dec 09, 2009 8:15 pm
Location: United States

Re: The General 1.2c

Post by Leif Ericson »

The General 1.2c:

This version doesn't play Fencrazy or maps with nomad settings yet, but it adds Britons and makes some important structural changes for future updates. Theoretically it can now play any civ but I haven't tested the other civs yet. The most noticeable difference is better booming and a much more flexible countering and strategy changing response (it's actually too responsive right now, but it'll be refined later).

Also, I added a link to the first post where you can download all previous versions, even the first 0.5 version.

- Merged each of the civ-specific army comp and strategy selection files into two master files so that I don't have to add new files for every civ.
- Much more flexible selection of support units to counter the enemy. Dynamically accounts for enemy army composition, unit strength in each age, primary unit weaknesses, current buildings constructed, techs complete, techs available to each civ, civ bonuses, enemy civ strengths and weaknesses, and encourages a mix of gold and trash units and a mix of ranged and melee units. This new army comp system works for all civs.
- Added ability to play Britons.
- Fix issue where escrow would be cleared unintentionally. Biggest impact is saving up for town centers.
- Improved code that counts enemy military units for much better countering response.
- Improved transition when switching between strategies with different primary units by training the previous primary unit until required buildings and techs for new unit are complete.
- Improved timing of the switch between normal imperial age strategies and low gold strategies.
- Added workaround for Britons because of bugged can-build-with-escrow command (it thinks Briton TCs cost 275 wood).
- Fixed bug with town under attack detection.
- Improved switches between booming and aggressive strategies.
- Slightly improved eco balance.
- Added capability to train elephant archers for Indian civs (though it probably won't train them unless it uses ele archers to counter the enemy).
- Combined and/or removed unnecessary goals.
- Increased the number of military buildings that can be built at once in imperial age.

User avatar
Promiskuitiv
Waheguru
Posts: 1372
Joined: Thu Nov 10, 2011 1:07 pm

Re: The General 1.2c

Post by Promiskuitiv »

That sounds like an amazing update, especially the new flexibility.

Thank you Leif!

User avatar
FireBall37
Swami
Posts: 191
Joined: Sat Aug 22, 2020 10:49 pm

Re: The General 1.2c

Post by FireBall37 »

Happy to see an update, especially a new civilization for General :dance

User avatar
Leif Ericson
Waheguru
Posts: 1434
Joined: Wed Dec 09, 2009 8:15 pm
Location: United States

Re: The General and The Sergeant 1.2d

Post by Leif Ericson »

The General and The Sergeant 1.2d:
- Brand new release of The Sergeant! Plays all of The General's civs, plus Mongols and Tatars. (The Sergeant loads files from the The General folder so don't be surprised that a separate The Sergeant folder doesn't exist.)
- plus other changes that I don't feel like documenting at 2am, but I'll add them here soon.

User avatar
Leif Ericson
Waheguru
Posts: 1434
Joined: Wed Dec 09, 2009 8:15 pm
Location: United States

Re: The General and The Sergeant 1.2d

Post by Leif Ericson »

Finally got around to documenting version 1.2d updates. The main feature is the addition of The Sergeant, which runs The General's code as if it is playing Hard difficulty. It also loads a greater variety of strategies of different strengths, though each civ only runs one strategy for now.

Other Features:
- added preliminary cavalry archer rush and steppe lancer rush strategies, steppe lancer rush needs several improvements before it's ready
- added unique tech research for India DLC and Dawn of the Dukes DLC civs
- removed unit count requirements for some unit upgrades and blacksmith techs
- fixed some bugs that caused idle scouts
- enabled the research queue
- fixed issue which occasionally prevented multiple farms from being constructed at once
- fixed issue that caused villagers to immediately lure second boar when first boar is killed
- added some features for Nomad (largely untested)
- disabled attacks in progress when heavily under attack
- slightly modified support unit preferences

Difficulty Adjustments (still needs some fine-tuning because Easiest is still way too difficult):
- added random villager training delays according to difficulty level to imitate idle TC time, similar delays added to military training
- decreased villagers, trade carts, town centers, and military buildings according to difficulty level
- added random possibility of getting housed according to difficulty level
- disabled army DUC on difficulties below extreme
- retreating from TC arrows occurs only every 10 seconds on Hard, every 15 seconds on Moderate, disabled on lower difficulties
- disabled code for villagers to attack rams on difficulties below extreme
- disabled DUC villager retasking on difficulties below extreme
- disabled training queue on hard difficulty and lower
- disabled some ally tribute on hard difficulty and lower
- disabled DUC scouting on hard difficulty and lower
- disabled deer pushing on hard difficulty and lower
- disabled boar hunting on moderate difficulty and lower
- reduced use of escrow on moderate difficulty and below
- disabled sheep claiming on moderate difficulty and lower
- disabled some eco tech research on easiest and standard difficulties

Post Reply