Latest Posts

Topic: Status of AI

toptopple
Avatar
Topic Opener
Joined: 2013-10-30, 08:11
Posts: 156
Ranking
At home in WL-forums
Posted at: 2016-11-05, 08:12

I just played a test in 8162 and found the AI indeed playing better than ever! Luckily I had fog off, so I could watch them developing, otherwise they may well have taken me by surprise. I have some questions about AI:

1. Does the AI algo currently apply cheating in any way (e.g. including reduced resource consumption)?
2. Have you been applying any results from the latest AI-research like "genetic algorithm" testing?

3. I found Seafaring AI quite weak so far, and I would like to have a look whether I can apply myself on it somehow. Can you give me hint where the code for it is located? Thanks!

EDIT:
What I meant was the AI capability to explore the sea and found new settlements!



Edited: 2016-11-05, 08:19

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-11-05, 11:20
  1. Does the AI algo currently apply cheating in any way (e.g. including reduced resource consumption)?

It doesn't need to send geologists, but I think that's it for cheating.

  1. Have you been applying any results from the latest AI-research like "genetic algorithm" testing?

https://wl.widelands.org/forum/topic/2646/

  1. I found Seafaring AI quite weak so far, and I would like to have a look whether I can apply myself on it somehow. Can you give me hint where the code for it is located? Thanks!

All AI code is in src/ai/defaultai.cc - I guess you will find the seafaring parts of the code if you search the file for "ship", "shipyard", "port" and "expedition."


Busy indexing nil values

Top Quote
toptopple
Avatar
Topic Opener
Joined: 2013-10-30, 08:11
Posts: 156
Ranking
At home in WL-forums
Posted at: 2016-11-08, 09:52

Had a look at it!

1. I see an advantage for various purposes (not only seafaring & exploring) if there were a "continent id" available for any land field/node of the map. This could be generated by the map editor and doesn't need to charge game execution. One of the advantages were e.g. for solving the "island invincibility" problem, even without HQ defence! It would also solve problems or enhance features of the expedition algos. Since it needs to be at least a byte value, it would inflate the map size.

2. Can I obtain somewhere a "walking distance to HQ" value for any land node? This would help in improving expedition. It should return the number of nodes (or other units) required to pass to reach the HQ. Zero if no walkup possible.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2016-11-08, 12:33
  1. Maybe this can be married to the following wishlist bug: https://bugs.launchpad.net/widelands/+bug/536542

  2. I'm not familiar with our pathfinder - search for FindNode and dig through the code from there I guess. Or maybe it can be found more easily in the wares routing.


Busy indexing nil values

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2016-11-08, 20:13

Hi, though some of your questions were already answered but still:

  • No cheating as you meant it, but note that AI can query ("see") entire map, though it does not use this advantage very much.
  • New AI (in separate branch) is very experimentally using genetic algorithm to tweak parameters, so far I am still tweaking it heavily and results are unsure.
  • But seafaring is not planned to use genetic algorithm - because training needs a lot of "events" and simply game does not generate many seafaring related events. But if you are interested in working in it, I could separate seafaring stuff into own file in ai dir, so you could play on own playground (and avoid merging conflicts)
  • pathfinding - yes there is algorithm - used for designing roads, for workers when going to do stuff (cut trees and alike). But there is no identification of land/islands.

Top Quote