Immortal v0.10f

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
wattle
Swami
Posts: 226
Joined: Fri Aug 15, 2014 1:06 pm
Location: Germany

Re: Immortal AI help with scripting

Post by wattle »

pietro wrote: Fri Dec 20, 2024 8:39 am Hi everyone
I am having fun adding some scenario units to some factions, example
Imperial Legionary (byzantines)
Crusader Knight (Teutons)
Norse Warrior (nordic factions)
Eastern Swordsman (eastern factions)

If i use the faction, I CAN TRAIN THEM even in a normal scrim game.

-----------How do i change Immortal AI so that, if the unit is available, then the AI trains it too?
Something easy like if Norse Warrior < 30 then train Norse Warrior

Please consider i am a complete noob and i have very little knowledge of AI scripting.
Tx, cheers :)
If you open any random AI (the .per file) and scroll through it to get an idea how they look, and than you open Immortal.per and scroll through it, you'll quickly realize, even if completely unfamiliar, that there likely is code in the "normal" AIs that is roughly comprehensible, while in Immortal the code is totally incomprehensible. That's because it almost entirely uses direct unit control commands, which are advanced scripting, its full of temporary goal/variable names which are reused over and over again, and there are a LOT of jumps/redirects (3k+) in the code, because it is actually written in c++ and than converted into the aoe2 scripting language.

So in short, it's hardly possible to change Immortal in a way that makes sense. I would certainly be not the only one to be baffled, if any person is able to do so.
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.
GamesGod
Swami
Posts: 124
Joined: Fri May 20, 2016 4:01 am
Location: Russia

Re: Immortal AI help with scripting

Post by GamesGod »

pietro wrote: Fri Dec 20, 2024 8:39 am Hi everyone
I am having fun adding some scenario units to some factions, example
Imperial Legionary (byzantines)
Crusader Knight (Teutons)
Norse Warrior (nordic factions)
Eastern Swordsman (eastern factions)

If i use the faction, I CAN TRAIN THEM even in a normal scrim game.

-----------How do i change Immortal AI so that, if the unit is available, then the AI trains it too?
Something easy like if Norse Warrior < 30 then train Norse Warrior

Please consider i am a complete noob and i have very little knowledge of AI scripting.
Tx, cheers :)
U can add standart functions with standart conditions to the start file immortal ai, after define constants, I mean example for train units, and this functions will be work.

Example...
(defrule
(game-time > 600)
(can-train norse-warrior)
=>
(train norse-warrior))
:)
Developer of GamesGod AI
ElshidoBR
Forumer
Posts: 1
Joined: Sun Nov 17, 2024 1:05 pm

Re: Immortal v0.10f

Post by ElshidoBR »

Hello!

First of all: congratulations on the excellent script and algorithms of this AI. I'm having a lot of fun playing with this AI and also using it in AI vs AI matches.

I'd like to report an apparent bug that I've noticed mainly in these AI vs AI matches - It happens mainly in the late game: The military units approach to attack, but they don't hit, even the melee units that are already stuck to the enemies.

I forgot to mention that I'm playing the Definitive version of Age, and I know it has some bugs, but I don't know exactly what they are. So I apologize if this report has already been clarified before.

Cheers!
pietro
Forumer
Posts: 3
Joined: Fri Dec 20, 2024 8:33 am

Re: Immortal v0.10f

Post by pietro »

that helped a lot: i added new units to the game, and the Ai is training them
; Rule #9744
(defrule
(unit-type-count-total Poleaxe-Heavy-Infantry < 60)
(can-train Poleaxe-Heavy-Infantry)
=>
(train Poleaxe-Heavy-Infantry))
; Rule #9745
(defrule
(unit-type-count-total Ritterbruder < 60)
(can-train Ritterbruder)
=>
(train Ritterbruder))
; Rule #9746
(defrule
(unit-type-count-total Immortals-Clibanarii < 40)
(can-train Immortals-Clibanarii)
=>
(train Immortals-Clibanarii)
pietro
Forumer
Posts: 3
Joined: Fri Dec 20, 2024 8:33 am

Immortal AI need help.

Post by pietro »

I need Immortal AI to build bombard towers (ideally it would wall too, even a small wall around the core economy like Blackforce AI does).
Something VERY SIMPLE like

if you have built a castle

then

build one bombard tower to it's right and one to it's left (i want the BTW to be close to the castle)

how do i write it?
abrakamham
Forumer
Posts: 5
Joined: Sat Feb 08, 2025 11:26 am

Re: Immortal v0.10f

Post by abrakamham »

Is it possible to make this AI build walls?
MightyRecon
Forumer
Posts: 8
Joined: Sun Apr 16, 2023 5:40 pm

Re: Immortal v0.10f

Post by MightyRecon »

Where is tmb anyways? I don't think there has been any significant updates since May of last year and we are 3 months away from it being May again.

Has anyone seen him around? Would be nice to know if he's doing well.
kunyi
Guru
Posts: 761
Joined: Tue Mar 21, 2006 7:48 am

Re: Immortal v0.10f

Post by kunyi »

If we play multiplayer with friends against an Immortal AI, after the 50th minute, there’s brutal lag—even if the best computer is hosting with just 2-3 AIs. Is there any way to fix this? :devil
Benhur
Forumer
Posts: 2
Joined: Sun Apr 06, 2025 11:46 am

Re: Immortal v0.10f

Post by Benhur »

Here somes rules you can add to build walls:

; Rule #9736
(defrule
(current-age <= feudal-age)
(unit-type-count villager > 15)
=>
(enable-wall-placement 1))

; Rule #9737
(defrule
(current-age > feudal-age)
(unit-type-count villager > 40)
(building-type-count town-center > 1)
(building-type-count castle > 1)
=>
(enable-wall-placement 2))


; Rule #9738
(defrule
(up-pending-objects c: palisade-wall > 0)
=>
(up-assign-builders c: palisade-wall c: 3))

; Rule #9739
(defrule
(up-pending-objects c: stone-wall-line > 0)
=>
(up-assign-builders c: stone-wall-line c: 5))

; Rule #9740
(defrule
(up-pending-objects c: gate-class > 0)
=>
(up-assign-builders c: gate-class c: 1))


; Rule #9741
(defrule
(up-pending-objects c: palisade-wall < 4)
(wall-completed-percentage 1 < 50)
(can-build-wall 1 palisade-wall)
=>
(build-wall 1 palisade-wall))

; Rule #9742
(defrule
(up-pending-objects c: palisade-wall < 4)
(wall-completed-percentage 1 < 100)
(wall-completed-percentage 1 >= 49)
(can-build-wall 1 palisade-wall)
=>
(build-wall 1 palisade-wall))

; Rule #9743
(defrule
(up-pending-objects c: gate-class < 1)
(wall-completed-percentage 1 < 30)
(gate-count 1 < 4)
(can-build-gate 1)
=>
(build-gate 1)
)

; Rule #9744
(defrule
(up-pending-objects c: gate-class < 1)
(wall-completed-percentage 1 > 30)
(wall-completed-percentage 1 <= 100)
(gate-count 1 < 9)
(can-build-gate 1)
=>
(build-gate 1)
)




; Rule #9745
(defrule
(up-pending-objects c: stone-wall-line < 4)
(wall-completed-percentage 2 < 50)
(can-build-wall 2 stone-wall-line)
=>
(build-wall 2 stone-wall-line)
)

; Rule #9746
(defrule
(up-pending-objects c: stone-wall-line < 4)
(wall-completed-percentage 2 < 100)
(wall-completed-percentage 2 >= 49)
(can-build-wall 2 stone-wall-line)
=>
(build-wall 2 stone-wall-line)
)

; Rule #9747
(defrule
(up-pending-objects c: gate-class < 1)
(wall-completed-percentage 2 < 30)
(gate-count 2 < 4)
(can-build-gate 2)
=>
(build-gate 2)
)

; Rule #9748
(defrule
(up-pending-objects c: gate-class < 1)
(wall-completed-percentage 2 > 30)
(wall-completed-percentage 2 <= 100)
(gate-count 2 < 10)
(can-build-gate 2)
=>
(build-gate 2)
)

; Rule #9749
(defrule
(current-age <= feudal-age)
(strategic-number sn-gate-type-for-wall != 1)
=>
(set-strategic-number sn-gate-type-for-wall 1))

; Rule #9750
(defrule
(current-age > feudal-age)
(building-type-count town-center > 1)
(building-type-count castle > 1)
(strategic-number sn-gate-type-for-wall != 0)
=>
(set-strategic-number sn-gate-type-for-wall 0))
Benhur
Forumer
Posts: 2
Joined: Sun Apr 06, 2025 11:46 am

Re: Immortal v0.10f

Post by Benhur »

For some reason, the AI is demolishing the walls directly.

Disabling Rule #5653 helps a little :

; Rule #5653
(defrule
(true)
=>
(up-full-reset-search)
(up-find-local c: palisade-wall c: 240)
(up-filter-status c: status-ready c: list-inactive)
(up-find-status-local c: palisade-wall c: 240)
(up-filter-status c: status-pending c: list-active)
(up-find-status-local c: palisade-wall c: 240)
(up-remove-objects search-local object_data-tag c:!= 6)
(up-modify-sn sn-focus-player c:= my-player-number)
(up-create-group 0 0 c: 0)
(up-get-group-size c: 0 varTmp1588))


after a while, the AI still ends up demolishing all the walls. Disabling Rule #5653 helps a bit, it doesn't fully solve the problem.
Post Reply