Important Dates

Currently Online

Latest Posts

Topic: How does the AI rate port spaces?

kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1807
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-02-18, 17:04

I have a map with one available port space for both the player and the ai. If the ai reaches it, i can read in console:

4: ( 72x 52) expedition spot scoring, colony_scan_area == 34
4: Sunstone at  73x 48: PORTSPACE found, we valued it: 2
4: Sunstone at  73x 48: explore uphold, visited first time
4: Sunstone: continue island circumvention, dir=1

How can i force the ai to build a port at this place (the only port space)? Is there anything i can do, e.g. edit the map to make the AI value it higher?


Top Quote
Tibor
Joined: 2009-03-23, 23:24
Posts: 1317
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2018-02-18, 20:44

The most important aspect is amount of free space (without enemies but also without own territory). AI is using some checking radius and walk from the port space and if owned territory is found - the score is lower.

Try to look here: https://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/ai/defaultai_seafaring.cc#L27


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1807
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-02-19, 07:28

Cool, thanks face-smile.png After placing some rocks and trees:

4: Caicos at  74x 49: PORTSPACE found, we valued it: 6
Forcing flag at (72, 53)

Top Quote