Page 7 of 38

Re: A new artificial intelligent opponent - E323AI

Posted: 07 Sep 2009, 13:50
by Smiff
Error323, if you could post on each release which maps its been tested with, that would help us to know what we should be seeing/testing.
i've had a few short games now, it definitely starts well, not sure that its really teching up though? does it play well later? haven't really had time to find out.. seems to be crashing less though, good work!

Re: A new artificial intelligent opponent - E323AI

Posted: 07 Sep 2009, 14:12
by Error323
Hey Guys,

The problem is the pathfinder, what appears to happen is that most of the times a path cannot be found (this is definitly a bug). On a failed pathfinding attempt, the task and path itself is removed:

Code: Select all

Task task = requestTask(ATTACK);
task.add(group);
pathfinder.add(task);

if (pathfinding failed)
  task.remove();
However the next iteration it adds the same task again and the path fails again, this is looped forever. Now it attempts to find a path every iteration which is quite expensive, thats why it lags.

I'll figure it out this evening (working now), its just that it seemed fixed while it isn't >_<. When I tackled the problem, lags will be gone and it should be one smooth machine again ;)

Re: A new artificial intelligent opponent - E323AI

Posted: 07 Sep 2009, 14:16
by Error323
hughperkins wrote:Hi Error323,

Your AI sounds very cool. I like the sound of the raiding and the threatmap. I was thinking of building a threatmap in my own at some point, I'll have to up the priority a little I guess ;-)
Thanks, yeah you probably should. I hope you can create your A.I. such that it beats mine :D Then the battle is on :twisted:
hughperkins wrote:For the cheating thing, it seems like having the AI cheat a little makes the AI more fun to play against, and I guess it's not that hard to take a non-cheating AI and make it suddenly cheat - have perfect knowledge of the enemy units even without scouting - so it's still possible to play against other AIs I guess, as long as the AIs have a configurable option to cheat.
I'm thinking about a hybrid model that can easily switch between cheating and non cheating.
hughperkins wrote:Question: to what extent is there a version of E323 available for a release version of Spring? I do have a git version of Spring built, but it runs really slowly on my machine for some reason, and also I'd rather have a stable target to play against.
See the readme in the git repo (there isn't really a stable version atm, its all still alpha, but soon it will be fixed).

Re: A new artificial intelligent opponent - E323AI

Posted: 07 Sep 2009, 14:23
by AF
hugh, threatmaps are great, though I found that when meddling with mine, optimizing values and how long they linger etc was a big deal and how often it would be increased and the algorithm to combine them. Exporting as TGA helped a lot

Re: A new artificial intelligent opponent - E323AI

Posted: 07 Sep 2009, 20:54
by TheMightyOne
make the AI cheat once it realizes that its losing :twisted:

Re: A new artificial intelligent opponent - E323AI

Posted: 08 Sep 2009, 06:43
by hughperkins
Hi E323,

Well, the good news is I managed to get your AI to run on my PC, and in the same game as HughAI.

The bad news is that E323 absolutely slaughtered HughAI. There was my commander standing amidst the wreckage of charred, smoking used-to-be solar collectors and metal collectors, with a bunch of fleas whizzing around him, waiting for the kill.

So, great, when I wanted plausible competition, I really meant I wanted someone I could pretend to struggle to beat, not someone who would absolutely annihilate me :twisted:

So, thanks, when I next want plausible competition to make me look good by not being better than me, I know who NOT to call :lol:

Nice work, E323, but ... don't get too complacent ;-) ... I've implemented maphack, though I don't dare try a rematch just yet ;-)

Hugh

Re: A new artificial intelligent opponent - E323AI

Posted: 08 Sep 2009, 20:39
by Error323
UPDATE v2.11.3 Tue Sep 8 20:09:02 CEST 2009
Version 2.11.3 (Ultralisk) is out, changelog:
  • Massive Pathfinding refactor, resulting in much better pathfinding
  • Optimizations
  • Higher preference for solars
E323AI SO/DLL: E323AI-v2.11.3-Ultralisk
E323AI SRC: E323AI@github

The downside is that it pre-calculates pathing maps. On large maps, this can take quite a while (please be patient), but results in faster ingame performance. I will cache this asap.

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 00:20
by xyz
Error323 wrote:The downside is that it pre-calculates pathing maps. On large maps, this can take quite a while (please be patient), but results in faster ingame performance. I will cache this asap.
This does not sound like a good idea. The calculation takes really long, and I doubt users will wait for it to finish; caching it will not really solve the problem (I usually do a clean install every time there is a new spring version).

Ohh the AI still crashes (I had to truncate the log file, it was too big):
http://pastebin.com/m332707b8

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 03:52
by Smiff
disagree with above.. i want it to pathfind as well as possible and don't mind a wait.. when you can cache, even better.
although, stability and performance are really important, i'd rather see it play a few maps really well than all of them roughly.

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 05:41
by ato
xyz wrote:
Error323 wrote:The downside is that it pre-calculates pathing maps.
This does not sound like a good idea. The calculation takes really long, and I doubt users will wait for it to finish; caching it will not really solve the problem
My AI is still mostly on the drawing board but I was planning to handle this by doing the pre-calculation in a background thread at the start of the game (when there's no on-disk cache). Until it's done you can just do uncached pathfinding (usually you'll only have a couple of units at the start of the game so this shouldn't be too costly).

Something else that occurred to me is to see if it's possible to make use of the pathfinding info that Spring itself creates (see ~/.spring/maps/paths). I haven't looked into what exactly this is yet though -- it may not be useful.

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 09:30
by imbaczek
spring's pathfinder is already exposed via the AI interface; it works, but doesn't cut it for anything advanced.

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 09:35
by Google_Frog
Have you tried against CRAIG? It's a non-cheating Lua based AI.

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 09:43
by Error323
imbaczek wrote:spring's pathfinder is already exposed via the AI interface; it works, but doesn't cut it for anything advanced.
Indeed, it cannot take a weight overlay which I use for pathfinding to avoid enemy contact.

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 09:44
by Error323
Google_Frog wrote:Have you tried against CRAIG? It's a non-cheating Lua based AI.
Hmmm no, I was under the impression that CRAIG was targetted specifically at 1944. Which radically differs afaik.

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 09:48
by Error323
xyz wrote:
Error323 wrote:The downside is that it pre-calculates pathing maps. On large maps, this can take quite a while (please be patient), but results in faster ingame performance. I will cache this asap.
This does not sound like a good idea. The calculation takes really long, and I doubt users will wait for it to finish; caching it will not really solve the problem (I usually do a clean install every time there is a new spring version).

Ohh the AI still crashes (I had to truncate the log file, it was too big):
http://pastebin.com/m332707b8
I can't figure out why it crashes there though, hasn't happened to me at all yet :/ And for some reason I cannot use the pastebin information for debugging, it gives me jabberish.

I think I have found a way to reduce prepathing times and improve pathfinding overall. The problem is the discretization of the slopemap, I have to downscale it for the current cpu's to perform realtime pathfinding using A* as search algorithm.

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 11:22
by yuritch
Google_Frog wrote:Have you tried against CRAIG? It's a non-cheating Lua based AI.
It's resource cheating on all settings except easy. And most probably it still has maphack on easy as well.

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 12:15
by hughperkins
Error323 wrote:Thanks, yeah you probably should. I hope you can create your A.I. such that it beats mine :D Then the battle is on :twisted:
Here you go:

http://manageddreams.com/hughaireplays/ ... 23.tar.bz2

Somewhat cryptically named replay I know ;-)

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 13:32
by Error323
Noooooo my precious :P good work. Though the version is a bit crappy :/ KAIK beat it too today bleh. I'll check the replay when I get home!

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 14:16
by hughperkins
To be fair, it's yesterday's E323, because I didn't feel like sitting in McD's for 60 minutes watching the whole world build...

Hugh

Re: A new artificial intelligent opponent - E323AI

Posted: 09 Sep 2009, 14:40
by Error323
Yeah, I know... working on it tonight :D