Opened 2 years ago

Closed 2 years ago

#6381 closed enhancement (fixed)

[PetraAI] Attacks occur later

Reported by: Langbart Owned by: Freagarach
Priority: Release Blocker Milestone: Alpha 26
Component: AI Keywords:
Cc: Patch: Phab:D4391

Description (last modified by Langbart)

A user named marder reported via IRC 0ad-dev 12/Nov/21 that he observed a different behavior with the PetraAI, the attacks occur later than usual.

11:25 < marder> hey, did something change about the AI behavior in svn?
11:26 < marder> if I remember correctly very hard aggressive petra used to rush around minute 7
11:26 < marder> but when I play now in svn that doesn't happen until 15 min (or even later) in
11:27 < marder> in the last games I played regardless of the map petra never tried to rush
11:28 < marder> and this makes it much easier to beat the ai


Testing the AI on a map called the_limes_2p from the community-maps-2 mod.

the_limes_2p

Autostart command

~/0ad/binaries/system/pyrogenesis -quickstart -conf=mod.enabledmods:"mod public community-maps-2" -autostart="scenarios/the_limes_2p" -autostart-ai=3:petra -autostart-aidiff=3:5

Up to [25875], the attack from the AI (green player) always occurred around the 10-minute mark; with [25876], the AI is more hesitant and puts its resources into building towers rather than attacking.

third_macedonian_war

Autostart command

~/0ad/binaries/system/pyrogenesis -quickstart -conf=mod.enabledmods:"mod public" -autostart="scenarios/third_macedonian_war" -autostart-ai=2:petra -autostart-aidiff=2:5 -autostart-ai=3:petra -autostart-aidiff=3:5

Attachments (4)

25875.jpg (502.3 KB ) - added by Langbart 2 years ago.
25876.jpg (487.0 KB ) - added by Langbart 2 years ago.
25875_third_macedonian_war.jpg (592.5 KB ) - added by Langbart 2 years ago.
25876_third_macedonian_war.jpg (590.6 KB ) - added by Langbart 2 years ago.

Change History (9)

by Langbart, 2 years ago

Attachment: 25875.jpg added

by Langbart, 2 years ago

Attachment: 25876.jpg added

comment:1 by Langbart, 2 years ago

Description: modified (diff)

Adding an additional example: third_macedonian_war

by Langbart, 2 years ago

by Langbart, 2 years ago

comment:2 by Freagarach, 2 years ago

Could you please check the values of the personality, e.g. remove

	if (this.debug < 2)
		return;

from PetraAIs config.js.setConfig()?

in reply to:  2 comment:3 by Langbart, 2 years ago

Replying to Freagarach:

Could you please check the values of the personality, e.g. remove

	if (this.debug < 2)
		return;

from PetraAIs config.js.setConfig()?

I changed the line, like you can see below: ai/petra/config.js L278

Line 
277 if (this.difficulty < 2)
278 this.Economy.workPhase3 = Infinity; // prevent the phasing to city phase
279
280 API3.warn(" >>> Petra bot: personality = " + uneval(this.personality));
281};

The values did not change

the_limes_2p

[25875]

WARNING: PlayerID 2 | >>> Petra bot: personality = ({aggressive:0.4217514051795857, defensive:0.5929208264426249, cooperative:0.24637165535241365})

[25876]

WARNING: PlayerID 2 | >>> Petra bot: personality = ({aggressive:0.4217514051795857, defensive:0.5929208264426249, cooperative:0.24637165535241365})

third_macedonian_war

[25875]

WARNING: PlayerID 2 | >>> Petra bot: personality = ({aggressive:0.4217514051795857, defensive:0.5929208264426249, cooperative:0.39637165535241364})
WARNING: PlayerID 3 | >>> Petra bot: personality = ({aggressive:0.5311110617248178, defensive:0.4909132383791567, cooperative:0.9921941530890763})

[25876]

WARNING: PlayerID 2 | >>> Petra bot: personality = ({aggressive:0.4217514051795857, defensive:0.5929208264426249, cooperative:0.39637165535241364})
WARNING: PlayerID 3 | >>> Petra bot: personality = ({aggressive:0.5311110617248178, defensive:0.4909132383791567, cooperative:0.9921941530890763})

comment:4 by Freagarach, 2 years ago

Owner: set to Freagarach
Patch: Phab:D4391
Priority: Should HaveRelease Blocker

comment:5 by Freagarach, 2 years ago

Resolution: fixed
Status: newclosed

In 26132:

Fix PetraAI not rushing.

A typo in the starting strategy.
Reported by: @marder on http://irclogs.wildfiregames.com/%230ad-dev/2021-11-12-QuakeNet-%230ad-dev.log
Introduced in r25876 / rP25876.

Differential revision: https://code.wildfiregames.com/D4391
Fixes: #6381

Note: See TracTickets for help on using tickets.