Help choosing a "game" - Page 2

Help choosing a "game"

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

Moderators: hoijui, Moderators

lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: Help choosing a "game"

Post by lamer »

Links:
Regarding Lua<->AI communication (with example in LegacyCpp API):
For JavaOO API docs. Specifically of interest.

Also game/mod dev can put things in (Game|Unit|Team)RulesParams and AI can read it.

Threads in lua AI not possible AFAIK. Of course if wanted algorithm has iterative nature then in theory it's possible to spread iterations between frames...
I know that threading in C++ AI is possible for sure (using it). But i don't know Java capabilities.

Regarding ZK package: i don't think they make separate .sdz anymore. And what for?
For casual player lobby will download it automatically.
For dev:

Code: Select all

$ cd ~/.spring/games && git clone https://github.com/ZeroK-RTS/Zero-K.git Zero-K.sdd
$ cd Zero-K.sdd && git checkout <any commit-version you like>
P.S. Imho Lua AI's could be acceptable if someone would write proper framework in C++ as part of the engine to handle threatmaps, pathfinding, chokepoints etc., because doing it in lua is awkward (just like computational-heavy parts for Java may be done in JNI).
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Help choosing a "game"

Post by Anarchid »

Does that mean that the "game" engine (not Spring but, ex, Zero-K's engine) can exchange «proper» messages with a non-Lua AI? Do you know how to best achieve that? All i'm seeing in the Java interface is:
- Send/receive text message from/to player(s)
- luaMessage() //unsure what this does / how it works
Yes! Non-gadget AI's can exchange text messages with the game (half-duplex). It is up to game developers to decide how to handle those messages and what messages to send.

Here are a couple examples: Shard can use ZK retreat-haven gadget and zkgbai and freundAI metal map parsing is handled by SkirmishAIMessage rather than GameRulesParams like in CircuitAI because when those were originally made, GameRulesParams were not supported by Java interface.

(you should use GRP parsing now instead)

The Shard case looks like this:

Code: Select all

	game:SendToContent("sethaven|"..upos.x..'|'..upos.y..'|'..upos.z);
"SendToContent" is Shard-speak for "CallRules". The message is then processed by the game code here:

Code: Select all

function gadget:RecvSkirmishAIMessage(aiTeam, dataStr)
	HandleLuaMessage(dataStr, aiTeam);
end

function HandleLuaMessage(msg, teamID)
 ...
end
Note that the function HandleLuaMessage is a shared handler for LuaUIMessage and SkirmishAImessage - basically, this shows how trivial it is to expose advanced luarules-to-external-AI integration for game developers (looking at MCL here).

The second case is about as trivial:

1) Game sends a JSON-encoded string with metal data to locally hosted AI
2) The AI parses the data.
3) AI deliberately and agressively attacks enemy expansion.
Where the heck can I download the Zero-K content pack!? I can't find it anywhere - all I seem to find is the lobby... I care not about the lobby.
You can use the lobby to auto-download fresh game version, or just checkout the git repository like in @lamer's post.
(and while at it, all I can find is one lobby - couldn't find those "SWL" and "flobby" you wrote about even though I don't want a lobby)
Obtain SWL here, and flobby is probably either here or there.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Help choosing a "game"

Post by Jools »

lamer wrote:Links:
Regarding ZK package: i don't think they make separate .sdz anymore. And what for?
For casual player lobby will download it automatically.
For dev:

Code: Select all

$ cd ~/.spring/games && git clone https://github.com/ZeroK-RTS/Zero-K.git Zero-K.sdd
$ cd Zero-K.sdd && git checkout <any commit-version you like>
If you just want the zk sdz, you can do this (assumes you have spring installed):

1. locate pr-downloader: it comes with spring and is usually in your spring folder
2. run the command: pr-downloader --filesystem-writepath <insert path> --download-game zk:stable

That will get you the game in the pool directory under the writepath you specified.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Re: Help choosing a "game"

Post by PauloMorfeo »

Thanks for all the help guys.

Anarchid, I don't know how much of zkgbai you've built yourself but I assume a lot if not the majority or all since it doesn't appear to have an endless stream of copycats. Congratulations - that AI seriously rocks and totally kicks arse. I knew almost nothing of Zero-K but I feel like, despite all my oTA+Spring experience, I stood no chance whatsoever on a classic 1v1 CC. And all the spectates I've done, I saw it behave really well (not to mention own the other AIs I could manage to experiment it against).

zkgbai is really active with the units, expands well aggressively, and appeared to control the economy at least decently.

Bonus style points for the windows showing up the graph and overall giving insight into what's going on inside the AI's mind - it's always super cool to see what's going on inside their "heads". I remember, when I was first toying around, I implemented such a window to draw LOS and I copied that code from your AI (and I adapted or wrote this section in the Wiki):
https://springrts.com/wiki/AI:Developme ... w_a_window

I've become really tempted to take on your AI as a challenge.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Re: Help choosing a "game"

Post by PauloMorfeo »

What are the best AIs for BA? Is the best for BA any of the ones that already ship with Spring (AAI / RAI)?
(I hope the best one isn't the one called NullAI :p)
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Help choosing a "game"

Post by abma »

PauloMorfeo wrote:What are the best AIs for BA? Is the best for BA any of the ones that already ship with Spring (AAI / RAI)?
imo from best to worst: E323AI, KAIK, RAI, Shard, AAI, when they don't crash :-P

idk about good ones which are not bundled with spring. also i didn't test them recently, so maybe something broke and they're stuck at the start unit, not sure.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Help choosing a "game"

Post by Jools »

Also depends on map: some ai:s cannot swim.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Re: Help choosing a "game"

Post by PauloMorfeo »

abma wrote:...
imo from best to worst: E323AI, KAIK, RAI, Shard, AAI, when they don't crash :-P
...
Are all of those supposed to be part of Spring when downloaded, compiled and installed from source? Because I've done that for the Engine, maybe 1 week ago (I am able to join multiplayer games of BA and TechA), but all the AIs I see in the lobby and in /usr/local/share/games/spring/AI/Skirmish/ are the empty ones and RAI and AAI.

Indeed I have a vague memory of, in the past, seeing KAIK and Shard but I don't see them any more.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Re: Help choosing a "game"

Post by PauloMorfeo »

PauloMorfeo wrote:... I've done that for the Engine, maybe 1 week ago (I am able to join multiplayer games of BA and TechA), but all the AIs I see in the lobby and in /usr/local/share/games/spring/AI/Skirmish/ are the empty ones and RAI and AAI.
...
Just saw:
https://github.com/spring/spring/tree/d ... I/Skirmish
I reckon I did something wrong - my clone / update pulled nothing from inside those folders (which are references to other repositories). I probably need to do something differently with the git.

I'm going to try to sort that out and update the "install from source" wiki.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Re: Help choosing a "game"

Post by PauloMorfeo »

PauloMorfeo wrote:...
I'm going to try to sort that out and update the "install from source" wiki.
No I'm not - I'm just a dumbfuck and forgot to follow this which is already in the wiki:
If you want to also compile the AI's, you have to type

Code: Select all

git submodule sync
git submodule update --init
to update the submodules, you have to execute the same commands again.
Which is why I don't have those "external repo" AIs, which is why I was only finding RAI and AAI. :|
Post Reply

Return to “AI”