.

.

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

Moderators: hoijui, Moderators

Post Reply
cranphin
Posts: 136
Joined: 13 Jun 2005, 16:37

.

Post by cranphin »

.
Last edited by cranphin on 21 Mar 2021, 14:04, edited 1 time in total.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Include 'crans-java-ai' in main build?

Post by Anarchid »

It seems to run slightly more reliably then other ai's in the current Spring build :)
I'm all for it. Also you have an unread message in your PM, dating since last year.

edit: removed FUD.
Last edited by Anarchid on 23 Mar 2015, 09:42, edited 1 time in total.
cranphin
Posts: 136
Joined: 13 Jun 2005, 16:37

.

Post by cranphin »

.
Last edited by cranphin on 21 Mar 2021, 14:04, edited 1 time in total.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Include 'crans-java-ai' in main build?

Post by Anarchid »

What is LoadMap and why does it break AI's
I am not 100% sure LoadMap is what broke it, but it coincides on date and touched files.

LoadMap is a new Spring feature which allows a gadget to instruct the engine to reset itself with a new map, basically starting a new game without restarting the engine.

It probably breaks Java interface because it included a requirement to make SkirmishAIHandler reusable, and the change which fulfilled this requirement was likely not tested with Java AIs.

(also possibly kloot hates java ai interface because of it being a kludge)
cranphin
Posts: 136
Joined: 13 Jun 2005, 16:37

.

Post by cranphin »

.
Last edited by cranphin on 21 Mar 2021, 14:04, edited 1 time in total.
cranphin
Posts: 136
Joined: 13 Jun 2005, 16:37

.

Post by cranphin »

.
Last edited by cranphin on 21 Mar 2021, 14:05, edited 1 time in total.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Include 'crans-java-ai' in main build?

Post by Anarchid »

Just hardwire something like "if zk, then cormex", or use the ismex customparam via this.

It seems i was too unfair to the state of the java ai interface. It actually works. I think there were some issues reported by others but they were not as grave as i expected.

As i also mentioned in the PM, placement of these also is required to be super precise. You can get elmo-precise positions of those either by parsing them from GameRulesParams, or parsing json-encoded message sent to the AI on first gameframe, like this, or this
Last edited by Anarchid on 21 Mar 2015, 12:59, edited 1 time in total.
cranphin
Posts: 136
Joined: 13 Jun 2005, 16:37

.

Post by cranphin »

.
Last edited by cranphin on 21 Mar 2021, 14:05, edited 1 time in total.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Include 'crans-java-ai' in main build?

Post by Anarchid »

It should work well enough. Not super great, but does all the basic things and reasonably efficient eco, so feel free to reuse the codes.

There's also CSI and ZKMBAI by DeinFreund, of which CSI holds the supreme champion AI of ZK title because of its uncanny ability to pathfind.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Include 'crans-java-ai' in main build?

Post by abma »

cranphin wrote:What would need to be done for this?
I think the only issue is to get a CMakeLists.txt set up for it, which I've got no idea how those things work o.O
At the moment building is done with a simple Ant script.
create a pull request to the spring develop branch which adds it to the repo and which compiles. for an example CMakeLists.txt file see hughai i guess...
cranphin
Posts: 136
Joined: 13 Jun 2005, 16:37

.

Post by cranphin »

.
Last edited by cranphin on 21 Mar 2021, 14:05, edited 1 time in total.
cranphin
Posts: 136
Joined: 13 Jun 2005, 16:37

.

Post by cranphin »

.
Last edited by cranphin on 21 Mar 2021, 14:06, edited 1 time in total.
cranphin
Posts: 136
Joined: 13 Jun 2005, 16:37

.

Post by cranphin »

.
Last edited by cranphin on 21 Mar 2021, 14:06, edited 1 time in total.
cranphin
Posts: 136
Joined: 13 Jun 2005, 16:37

.

Post by cranphin »

.
Last edited by cranphin on 21 Mar 2021, 14:06, edited 1 time in total.
8611
XTA Developer
Posts: 242
Joined: 29 Dec 2014, 08:22

Re: Include 'crans-java-ai' in main build?

Post by 8611 »

Hmm, what also puzzles me is 'energyMake' isn't provided either, but it's set in the unitdef lua files.
Mods can have a file unitdefs_post.lua that alters all the unitdefs during loading.

zero-K has such a file , it seems to set energyMake of units to zero, probally to use its own scripted resource system:
https://github.com/ZeroK-RTS/Zero-K/blo ... t.lua#L634

Code: Select all

if not reverseCompat then <--see top of file what that is
...
if ud.energymake and ud.energymake > 0 then
 ud.customparams.income_energy = ud.energymake
 ud.activatewhenbuilt = true
 ud.energymake = 0
end
So you can try reading the unit's custom parameter ( ud.customparams.income_energy ) that zero-K uses.
/edit basically same as with the metal extractors viewtopic.php?f=15&t=33276&p=567999#p567927
cranphin
Posts: 136
Joined: 13 Jun 2005, 16:37

.

Post by cranphin »

.
Last edited by cranphin on 21 Mar 2021, 14:06, edited 1 time in total.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Include 'crans-java-ai' in main build?

Post by Anarchid »

Actual internal storage is 100500 so that the energy that overflows over the scripted limit is shared to allies / spent on overdrive grid / etc.

There should be a TeamRulesParam for this.
Bla
Posts: 79
Joined: 25 Feb 2013, 14:44

Re: Include 'crans-java-ai' in main build?

Post by Bla »

Anarchid wrote:Except in dev build, Java ai's are all broken wholesale at interface level since LoadMap.
Broken how? My AI seems to run fine...
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Include 'crans-java-ai' in main build?

Post by Anarchid »

It seems i was too unfair to the state of the java ai interface. It actually works. I think there were some issues reported by others but they were not as grave as i expected.
I'll edit that post if i can to not spread further FUD. I apologize for doing it in the first place.
I'm starting to doubt if this is a good plan ;)
It seems Zero-K has so many overrides and special things outside of the game engine, that it's not really a good fit for any AI that also tries to play other games (which means it has to be introspective, and relies on what the engine tell it) :)
Hmm i guess i can do PR's, too, eventually.
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Include 'crans-java-ai' in main build?

Post by Anarchid »

I've been in a secretive mood and now my "ZK-compat" fork got to the point where it builds first three mexes, a solar, a factory, and then breaks and just spams solars until forever.

One of the things i had to do to get there was to completely disable the order validation check, which seems to be completely broken for bleeding edge engine (99-RC1) on BA as well.

That's a significant contra to inclusion. Is there a better way to circumvent this?

I guess i'm going to fix the "permanent estall" problem due to 100500 storage, add some hax to allow it to plop factory in ZK before mexes, and leave it there.
Post Reply

Return to “AI”