I want to create a new AI player, how to?

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: I want to create a new AI player, how to?

Post by NoQ »

Our current strategy is to build tons of archangels in base and then build sensor towers closer and closer to enemy bases.
Learn to use sensor tanks, they're much more effective ... (:
Is the turtle AI included in -ge or must I include it from extras?
From extras.
-ge is a single AI, with just some randomizations in behaviour.
Note that extras are a better way to make challenges, since you need the challenge to be the same all the time, otherwise you can't define how difficult it is.
Does it (nullbot in general) detect sensor towers near/in its base and try to destroy them?
No, it just generally attacks derricks or whatever.
DvDmanDT
Rookie
Rookie
Posts: 20
Joined: 13 Apr 2012, 16:51

Re: I want to create a new AI player, how to?

Post by DvDmanDT »

Will sensor tanks cause artillery emplacements to attack though? CB and WS tanks required us to click each target for emplacements to attack which is why we tend to use towers instead.

Can I use script markers (in FlaME) from JS AI by the way?

I'll include the turtle in next the version. Any idea when 1.17 will be released?

The map in it's current version without nullbot is available here in case you want to look at it for debugging purposes or whatever:
http://dvdmandt.net/wz2100/ (.wz, .fmap and minimap.bmp)

EDIT: In case you want to try it, make sure to have teams or 0-1, 2-4, 5-7, locked alliances, scavengers on and no bases.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: I want to create a new AI player, how to?

Post by NoQ »

Any idea when 1.17 will be released?
Already released.
Can I use script markers (in FlaME) from JS AI by the way?
Never tried so far ... no, haven't heard of any functions that use those. Need to ask someone else ...
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: I want to create a new AI player, how to?

Post by aubergine »

DvDmanDT wrote:Can I use script markers (in FlaME) from JS AI by the way?
If you're referring to labels or gateways, then the JS API supports them but only properly in the MASTER branch (what will become Warzone 3.2 at some point in the future).

Some docs on the relevant JS API functions:

* enumGateways() https://warzone.atlassian.net/wiki/page ... eId=360463
* enumLabels() https://warzone.atlassian.net/wiki/page ... eId=360473
* label() https://warzone.atlassian.net/wiki/page ... eId=360536

Also, there's no agreed specification for label naming conventions yet, however I jotted down some possible ideas in the wiki:

* https://warzone.atlassian.net/wiki/page ... Id=3309592

See the main problem from script point of view is that getting the object associated with label is one thing, knowing what it means or what to do with it is another. Currently labels are generally only used on campaign missions where there's specific scripts for specific maps - the script can be hard-coded to know what to do with an object associated with a particular label. In more general scripts, such as AIs, they'd need some way of understanding the meaning of a specific label before they could do anything useful with it.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
DvDmanDT
Rookie
Rookie
Posts: 20
Joined: 13 Apr 2012, 16:51

Re: I want to create a new AI player, how to?

Post by DvDmanDT »

1.17 seems to do a better job at capturing oils, though I was unable to complete a game because I played with linux users whose game kept crashing after an hour or so and therefore I never got that see-whole-map tech. The turtle AI did an OK job but never really got out of it's own base. Perhaps that was because I could play long enough before the crashes.. ..

aubergine: I see. I suppose I'll just hard-code or something for now then since it seems dumb to create maps that won't be playable by the majority of players for another year or so. I mostly agree with what you have on that wiki page, but I'm not sure there's enough info.. On the other hand, I like the simplicity. What I mean is that some AA locations may only make sense for a specific player.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: I want to create a new AI player, how to?

Post by NoQ »

because I played with linux users whose game kept crashing after an hour or so
Works for me there ... make them report their crash dumps (: Note: most of the devs are on linux as well.
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: I want to create a new AI player, how to?

Post by aubergine »

DvDmanDT wrote:aubergine: I see. I suppose I'll just hard-code or something for now then since it seems dumb to create maps that won't be playable by the majority of players for another year or so. I mostly agree with what you have on that wiki page, but I'm not sure there's enough info.. On the other hand, I like the simplicity. What I mean is that some AA locations may only make sense for a specific player.
I've not actually done any map making myself, so it would be very useful if anyone making maps could help provide better info (even if info is posted here or sent to me in PM I can copy to wiki, or just edit wiki directly). I currently have to do "educated guesswork" to document stuff relating to map making, so there will be some missing information but I figured that is better than no information :)

From what I understand, the labels/gateways stuff can still be put in to maps and it can be coded in to AI scripts (so long as they degrade gracefully when used on earlier versions of the JS API) and the maps/AIs will still work in current releases. At a later date when 3.2 is released, the extra JS API functions become available and scripts can then start taking advantage of the labels and so on.

What I was thinking is that it's probably worth thinking up some standard label naming conventions sooner rather than later, so that more map makers can start putting labels in to their new maps as they make them, rather than having to go back and retrofit at a later date.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
DvDmanDT
Rookie
Rookie
Posts: 20
Joined: 13 Apr 2012, 16:51

Re: I want to create a new AI player, how to?

Post by DvDmanDT »

Well, it's the first time I made a map so I perhaps someone more experienced can speak up on those points..

At the moment, the map is perfectly playable by me and my friend/beta-tester, but when I played it on IRC with some people who also played with others, alot of lag/choppyness was experienced/reported. It's hard for me to fix it since I don't experience it myself..

Here's a quote from IRC:
[05:12] <*****> no good with ai's that lag you
[05:12] <*****> i stopped playing as the timer advanced 23 minutes and that took 40 min to do
I was not in that game myself and the player is no longer online so can't ask about settings etc. Is there anything known to create lag in maps/matches? Have either of you tried MP maps with scavengers? NoQ, have you tested nullbot with scavengers?
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: I want to create a new AI player, how to?

Post by NoQ »

I did test the AI in multiplayer with scavengers, and i don't experience the lag you're talking about on my pretty low-end hardware. In fact, i'm running many AI vs. AI simulations on a speed significantly higher than 1x.

Might it be that QtScript is slow on windows?
DvDmanDT
Rookie
Rookie
Posts: 20
Joined: 13 Apr 2012, 16:51

Re: I want to create a new AI player, how to?

Post by DvDmanDT »

It's possible I suppose, but a quick google didn't reveal anything.. I'm also not really sure why it would be. Is it JIT-compiled or anything like that on Linux? Otherwise I can't really see why there would be such a difference..?

Is there a way to benchmark stuff? How do you run those simulations?

Something I did notice once was on some other map with a large group (50 perhaps) of scavenger people assigned to each player at the start of each game. Looking at those lagged like hell. I'm not entirely sure it was 3.1, but I'm positive.
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

Re: I want to create a new AI player, how to?

Post by Cyp »

Haven't tested with scavengers, but last time I tested a game with some NullBots, I couldn't get above what I think might have been about 1x speed (alternating 100x and freezing, I think averaging 1x). And not really playable at 1x speed, due to the constant freezing of the UI. Might be map dependent, was using the 5v5 NTW map. I'm on Gentoo Linux, 64 bit, on an ancient Core 2 Q6600. But maybe NullBot is faster than when I last tested.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: I want to create a new AI player, how to?

Post by NoQ »

9 nullbots on a high-oil map (400 derricks total), of some version older than 1.16, running at 1x average speed? Sounds pretty close to what i'm having, and pretty far from what DvDmanDT is having.

Now having a look what version of Qt is used by the windows package. Cause they say they improve the productivity of QtScript in new versions.
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: I want to create a new AI player, how to?

Post by cybersphinx »

NoQ wrote:what version of Qt is used by the windows package.
4.8.0.
We want information... information... information.
DvDmanDT
Rookie
Rookie
Posts: 20
Joined: 13 Apr 2012, 16:51

Re: I want to create a new AI player, how to?

Post by DvDmanDT »

Perhaps my map is exposing some near worst-case-scenario in some algorithm such as pathfinding? For example, some players are completely locked in behind other players (one AI player base is behind another). If nullbot issued more move commands (for example) than other bots then something like that could cause slowdowns.

EDIT: Updated http://dvdmandt.net/wz2100 to host the latest version in case someone wants to try it, didn't update the minimap though.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: I want to create a new AI player, how to?

Post by NoQ »

Could you check out if v1.20 v1.21 performs better?
(there were also some gameplay changes in v1.18).

Another hint: i think you should put scavenger oil derricks over oils that are protected by scavengers. This will provide scavengers with more oil and also make AIs stop bothering about capturing them with trucks, improving performance and gameplay.

Also: i think you should rename the files of nullbot when you pack it into the map. Cause if somebody has the original AI of the same version installed, it might be some serious mess when they conflict. Note: anybody who has your map is able to run your AI in any other map. It is easy to fix this in single-player challenges (move the script from /multiplay/skirmish/ into /challenges/, and point the challenge file there), but harder for multiplayer challenges (that don't really exist, so you don't have the challenge file to alter, but have to include the .ai file anyway).