Warzone2100 AI Tournament (WZAIT)

Other talk that doesn't fit elsewhere.
This is for General Discussion, not General chat.
User avatar
Prot
Trained
Trained
Posts: 236
Joined: 29 Nov 2010, 12:41

Re: Warzone2100 AI Tournament

Post by Prot » 17 Dec 2017, 18:10

NoQ wrote:Yep, that's right, they are the same. The pre-rewrite NullBot is here: https://downloads.sourceforge.net/proje ... ot-2-12.wz (hope it works).
Nice, it's worked. I run 2-12 in next round, there about 500 games left, about ~6 hours..
2-12 is older than 3.04 ?
2-12 looks like for 3.1.5 mainly.

Cyp
Evitcani
Evitcani
Posts: 774
Joined: 17 Jan 2010, 23:35

Re: Warzone2100 AI Tournament

Post by Cyp » 18 Dec 2017, 07:49

Prot wrote:
Cyp wrote: It might help a bit to change this line to something smaller than ⅖:

Code: Select all

src/loop.cpp:   const Rational renderFraction(2, 5);  // Minimum fraction of time spent rendering.

I placed these four bots on the map and launched autogame with const Rational renderFraction(2, 1);
Sorry, I meant the other smaller, as in changing renderFraction(2, 5) = ⅖ = 40% to renderFraction(1, 5) = ⅕ = 20% or renderFraction(2, 101) = ²⁄₁₀₁ = 1.980198%.

User avatar
Prot
Trained
Trained
Posts: 236
Joined: 29 Nov 2010, 12:41

Re: Warzone2100 AI Tournament (WZAIT)

Post by Prot » 20 Dec 2017, 08:10

Add full statistics grid BOT by BOT on all maps.
http://wz2100.euphobos.ru/wzait/?fullstat=true

Also you can download full database of all games:
http://wz2100.euphobos.ru/wzait/stats/games.sqlite3

User avatar
Prot
Trained
Trained
Posts: 236
Joined: 29 Nov 2010, 12:41

Re: Warzone2100 AI Tournament (WZAIT)

Post by Prot » 27 Dec 2017, 18:48

Added flexible search games regarding AI, maps and the result of the battle.

User avatar
Prot
Trained
Trained
Posts: 236
Joined: 29 Nov 2010, 12:41

Re: Warzone2100 AI Tournament (WZAIT)

Post by Prot » 09 Feb 2018, 06:54

How it works.
It's dirty code, but i want to explain how to automatic run many games, and this code runs now on my server:
Just add some comments:

Code: Select all

#!/bin/bash

export LANG=en_US.UTF-8
export DISPLAY=:0

# An additional loop that runs everything in infinity.
while true; do
	#to do safe exit from infinity loop, when all games is played
	if [[ "`cat command`" != "run" ]]; then echo Stop; exit; fi

	#If there was a failure, clear everything and prepare for a new start games.
	rm -rf ./games
	mkdir games

	#If at all in the first time are launching this script
	touch games.sqlite3

	#From php script get a plan of all games, who with whom on what maps and how many times to play.
	#We get a lot of json files that are ready for CLI params --autogame ----skirmish=some.json
	#Numbered them, and put in order.
	g=0
	while read line; do 
		echo $line > games/$(printf "%04d" $g)_game.json
		((g++))
	done < <(./init.php)

	#The main cycle, here is the start of the game with one of the prepared skirmish.json files, then goes parsing the game php script
	for i in `ls -1 games`; do
		mv games/${i} wzait.json
		ls -1 games/ | wc -l > stats/games
		date +%s > wzait.game
		jq '.challenge.map+"|"+(.challenge.bases|tostring)+"|"+(.challenge.powerLevel|tostring)+"|"+.challenge.scavengers+"|"+.player_1.name+"|"+.player_2.name' wzait.json >> wzait.game
		cp wzait.game stats/game
		mv stats/* www/stats/
		warzone2100 --skirmish=wzait.json --autogame 2>> wzait.game
		./parser.php
		./stats.php > stats/stats
		rm wzait.game
		rm wzait.json
	done

	#After playing all the games, prepare statistics for the site
	cp -f games.sqlite3 www/db/
	./fullstat.php > stats/fullstat
	mv stats/* www/stats/
	rm www/stats/game
	sleep 60
done
My www server run on odroid-u3 device, this is little arm-cpu based device which is difficult to handle large sql queries, so I decided to prepare statistics on the side of a powerful server that runs warzone

User avatar
Prot
Trained
Trained
Posts: 236
Joined: 29 Nov 2010, 12:41

Re: Warzone2100 AI Tournament (WZAIT)

Post by Prot » 22 Jun 2018, 10:28

Notice that a Semperfi JS from 20171216 plays better than from 20180321.
btw, who author of this AI, or who support him now ?

User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 884
Joined: 26 Sep 2016, 19:56

Re: Warzone2100 AI Tournament (WZAIT)

Post by Berserk Cyborg » 22 Jun 2018, 21:34

Prot wrote:btw, who author of this AI, or who support him now ?
Semperfi-js was authored by Per, if I am not mistaken. Then shortly after 3.2.3 was released I started messing with it. I don't really plan on working on it much longer, if at all, after my next set of changes. Still, it could be better. I want to finish my rewrite of Cobra and start on the conversion of Nexus to JavaScript someday.

It is more or less a template AI for new would-be scripters to experiment with and maybe even create their own bot from (like I did). So it is kept really simple.

This is what I have it as so far.
semperfi.wz
Spoiler:

User avatar
WZ2100ModsFAn
Trained
Trained
Posts: 371
Joined: 15 Apr 2018, 17:25
Location: United States.

Re: Warzone2100 AI Tournament (WZAIT)

Post by WZ2100ModsFAn » 22 Jun 2018, 21:47

Berserk Cyborg wrote:
Prot wrote:btw, who author of this AI, or who support him now ?
Semperfi-js was authored by Per, if I am not mistaken. Then shortly after 3.2.3 was released I started messing with it. I don't really plan on working on it much longer, if at all, after my next set of changes. Still, it could be better. I want to finish my rewrite of Cobra and start on the conversion of Nexus to JavaScript someday.

It is more or less a template AI for new would-be scripters to experiment with and maybe even create their own bot from (like I did). So it is kept really simple.

This is what I have it as so far.
download/file.php?id=17546
Spoiler:
The semperfi conversion is great! :)

i downloaded the file

Can anyone ask DylanDog if it's possible to convert DyDo AI?

can't now that dylandog has been inactive for at least 7 years

User avatar
Prot
Trained
Trained
Posts: 236
Joined: 29 Nov 2010, 12:41

Re: Warzone2100 AI Tournament (WZAIT)

Post by Prot » 23 Jun 2018, 21:37

Berserk Cyborg wrote: This is what I have it as so far.
semperfi.wz
Spoiler:
I think now is not supported in 3.2.3, because of this:

Code: Select all

info    |11:32:05: [callFunction:198] Uncaught exception calling function "buildFundamentals" at line 404: ReferenceError: Can't find variable: getMultiTechLevel
Hi is not playing

User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 884
Joined: 26 Sep 2016, 19:56

Re: Warzone2100 AI Tournament (WZAIT)

Post by Berserk Cyborg » 23 Jun 2018, 21:57

A quick hack to figure out if on we are on T2/T3, without getMultiTechLevel(), would be to check if hover propulsion is available, and that works good enough for the early build of a power generator. It builds 2 factories and then 2 power generators in the above case. Which is about the best I could figure out without sacrificing oil capturing on such settings.

Edit:
Last version had a research bug on hover maps. So this one should be assert free.
semperfi.wz

User avatar
JimmyJack
Trained
Trained
Posts: 109
Joined: 06 May 2017, 05:50

Re: Warzone2100 AI Tournament (WZAIT)

Post by JimmyJack » 26 Jun 2018, 01:01

Now this replaces semperfi of semperfi JS? :ninja: Or should it just be used as a mod?
Transmission ends ...

Jacob776
New user
Posts: 1
Joined: 30 Jul 2019, 07:52

Re: Warzone2100 AI Tournament (WZAIT)

Post by Jacob776 » 30 Jul 2019, 10:12

This tournament is so so awesome to watch.

lanaroady
New user
Posts: 1
Joined: 30 Jul 2019, 11:06

Re: Warzone2100 AI Tournament

Post by lanaroady » 31 Jul 2019, 14:57

Prot wrote:
16 Dec 2017, 15:32
Berserk Cyborg wrote:This is awesome!

Could you add the latest test versions of Cobra and SemperFi-JS? I put them in the folder below.
ai scripts.zip
Thanks! Semerfi works well, but Cobra has error on the start level:

Code: Select all

info    |05:07:02: [callFunction:198] Uncaught exception calling function "eventStartLevel" at line 181: ReferenceError: Can't find variable: completeRequiredResearch
 

I search inside new code, it's really don't have function completeRequiredResearch(), but old Cobra has.
I add semperfi for now.
Darkling wrote:
Thanks! I add this bot as another one, not replacing old one. I think that later I will disable the old one, but the statistics will leave.
NoQ wrote:I guess extracting per-map stats might be fun as well, i.e. which AI performs better on which maps.
Yes! Thats i planned todo. I this i add latest Nullbot too, as another bot, like my many bonecrushers four different versions.
I already check the errors and save into database last 10 line of logs, i think i need to add more lines, for better understanding whats going on.
Darkling wrote:Would it be feasible to add which sub-personality each AI is using to the output?
Yeah! I think about it, because NullBot has many different personalities and BoneCrusher start from 2.1 has too many personalities.
But at the moment the planning algorithm of the game in such a way that each bot fighting each other, but never met himself. I think later still I will rework a bit of the game so that I can gather statistics as well and every personality. However I will need a separate startup script for each personality, as it is made in NullBot.
Like multiplay/skirmish/db.js - main, and /db_personality_MG.js separate start script, running bot with force some personality.
I think of how it would be best to gather the statistics and schedule of games.
All of the things are normally trends with the superior shunks

User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Warzone2100 AI Tournament (WZAIT)

Post by NoQ » 02 Jan 2020, 19:49

Me on the right, Prot on the left:

photo_2019-11-11_00-40-34.jpg

Post Reply