Can't get an AI to work for Conflict Terra

Can't get an AI to work for Conflict Terra

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Can't get an AI to work for Conflict Terra

Post by oksnoop2 »

http://codepad.org/9oc9JxmJ AAI config
http://codepad.org/813lELqW AAI error log

Shard is just crashing the game right off the bat.

Kaik does not know what to do with the flagshipbase same for Rai.

If anyone one wants to tell me what i'm doing wrong or better yet how to fix it. I would be grateful. I will share any other files you request to look at just ask.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Can't get an AI to work for Conflict Terra

Post by slogic »

All AIs do not know about mod-specific morphing command. Your last chance is Shard.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Can't get an AI to work for Conflict Terra

Post by AF »

Try the shard dll I posted in the Shard thread, although the morphing will still be a problem as those API calls caused a crash in the engine
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: Can't get an AI to work for Conflict Terra

Post by oksnoop2 »

At slogic: I added a modoption to start with the flagship in factory mode. Still does not seem to know what to do.

At AF: It still crashes, maybe my configs are wrong. I tried replacing the .dll and it still crashes.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Can't get an AI to work for Conflict Terra

Post by AF »

Is this with conflict terra, or all content regardless?
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: Can't get an AI to work for Conflict Terra

Post by oksnoop2 »

After testing Evo still works just fine.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Can't get an AI to work for Conflict Terra

Post by slogic »

oksnoop2 wrote:At slogic: I added a modoption to start with the flagship in factory mode. Still does not seem to know what to do.
Here is event queue form E323AI:

Code: Select all

[00:00] (II): CE323AI::UnitCreated Oda Class Cruiser(155, -1)
[00:00] (II): CE323AI::UnitFinished Oda Class Cruiser(155, -1)
[00:00] (II): CEconomy::addUnitOnFinished Oda Class Cruiser(155, -1)
[00:00] (II): CE323AI::UnitCreated Mobile Headquarters(11, -1)
[00:00] (II): CE323AI::UnitFinished Mobile Headquarters(11, -1)
[00:00] (II): CEconomy::addUnitOnFinished Mobile Headquarters(11, -1)
[00:00] (II): CGroup::reset Group(1): range(-4.31602e+008), buildRange(-4.31602e+008), los(-4.31602e+008), speed(-4.31602e+008), strength(-4.31602e+008), amount(0)]
[00:00] (II): CGroup::addUnit Mobile Headquarters(11, -1) to Group(1): range(1000), buildRange(128), los(31.25), speed(0), strength(1470), amount(1) [Mobile Headquarters(11, -1)]
[00:00] (II): CE323AI::UnitDestroyed Oda Class Cruiser(155, -1)
[00:00] (II): CUnit::remove Oda Class Cruiser(155, -1)
[00:00] (II): CUnitTable::remove Oda Class Cruiser(155, -1)
I think no one AI expects you created mobile commander, then static commander, then remove mobile. AIs usually bind to the first commander which you have removed. This is the problem. Try spawning static commander without intermediate one (if possible).

Another problem arises if commander is a factory at the same time. Even in NOTA commander can't build units inside itself and most AIs try to build resource makers first, then initial factory.

The last problem i can fix in E323AI, but don't know how to deal with the first one. To fix this i need to reinitialize economy when first spawned commander is dead, or just ignore first _flying_ commander, which is too hardcoded and not suitable.

PS. Looks like i fixed the first problem in E323AI by removing COMMANDER tag in config for Oda unit (also had to tweak some .cpp file which respected untidef's isCommander tag instead of custom AI tag). Still units wanna assist factory & other units, strange cause i'm checking unitdef's canBeAssisted in appropriate places.
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Can't get an AI to work for Conflict Terra

Post by slogic »

I added basic initial support of CT in E323AI 3.22.1 (it may be bundled with Spring > 0.82.4). Though one strange thing occurs for land military units: they can't reach usual metal extractors & other ground units. So land attack is stalled. But builders are everywhere :)
Last edited by slogic on 01 Sep 2010, 19:28, edited 1 time in total.
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: Can't get an AI to work for Conflict Terra

Post by oksnoop2 »

Thanks! :-) Where can i get this version?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Can't get an AI to work for Conflict Terra

Post by zwzsg »

Made you a gadget to give metal and energy truck built by AI random move order then morph order. Test with NullAI and found working.

Three issues however:
  • CT current morph gadget breaks when the morph order is given by another gadget ("recursion is not permitted").
    FIX: update CT to this lastest version of unit_morph.lua from CA.
  • The morph command ID are hardwritten at the top of the gadget, but these numbers were hard to get, and are bound to change when you add/remove new morphing units: It works now, it may stop work if you edit d\luarules\configs\morph_defs.lua
    FIX: I will have to edit both unit_morph.lua and Spread_n_Deploy.lua
    EDIT: Done. See attachement and http://springrts.com/phpbb/viewtopic.php?f=23&t=23998
  • I doubt AI will appreciate having some of their unit randomly move and deploy anywhere: A depot deploying in the wrong place might block unit exit pathes out of the base.
    FIX: There is no way I write code to analyze where is best spot to deploy, so we'll need better support from the AI devs there.
Attachments
Spread_n_Deploy.lua
Improved version, requires my new unit_morph.lua
(2.9 KiB) Downloaded 97 times
Spread_n_Deploy.lua
For (old) CA unit_morph.lua
(1.6 KiB) Downloaded 112 times
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: Can't get an AI to work for Conflict Terra

Post by oksnoop2 »

Did not mean to bump this. Sorry.
Post Reply

Return to “AI”