Latest Posts

Topic: News about AI

Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-21, 13:54

So clay pit is supporter for aqua farm. You can still (mis)use:

 "renews_map_resource=pond_growing" ( or pond_mature  depending on what is output of aqua farm)

though renaming of the hint would be convenient.

And together with suggested:

requires_helper = true

would provide what you ask... I think...

The bee-keeper is a more difficult case; his supporter building can be one of these (or any combination of): berry farm, reed farm, farm. Perhaps permit supporter to be a table (supporter={frisians_farm, frisians_berry_farm, frisians_reed_farm})?

requires_helper = true

for bee-keeper would be sufficient here as well as long as ANY of supporters is sufficient. Also all supporters would need something like:

"renews_map_resource=honey"
Edited: 2017-08-21, 14:03

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-23, 15:17

Was the explanation sufficient?

@Nordfiese, how the training is going? Are you using latest trunk, with 2 newest AI branches that were merged lately?


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 17:07
Posts: 1950
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2017-08-23, 17:09

There is one thing that still can´t be described: The berry farm already renews the map resource "fruit", so it can´t renew honey as well, can it? I tried to pass a table renews_map_resource={"fruit","honey"} but it resulted in an error message.

I´m using the frisian branch for AI training, and I´m merging in the recent changes from trunk quite often, so the source code is the same as in latest trunk, including the AI branches. I have a bit less time for training now than when I started, but I still do one round a day. I can still train the AI for about a week, I don´t know yet whether I´ll still have enough time to continue after that. Anyway, the AI is shaping up great, improvements are clearly visible in every generation, the new AI is much better than the one in b19. I can only say it again: Great work! face-smile.png

When playing as Frisians, the AI is much weaker than as any other tribe, however. That is of course due to lack of training as Frisians, but this leads me to another thought: The Frisians are intended to be a tribe for advanced players, with a more complex economy than the other tribes and a higher risk of deadlocks. Can the AI even be as good playing Frisians as the other tribes? Should the same amount of training be put into Frisian AI as into the other tribes, or should it just be accepted that it will never be quite as good with Frisians?


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-23, 19:07

Nordfriese wrote:

There is one thing that still can´t be described: The berry farm already renews the map resource "fruit", so it can´t renew honey as well, can it? I tried to pass a table renews_map_resource={"fruit","honey"} but it resulted in an error message.

Do you mean that one site would support two productionsites? Not possible right now. In ai this hint is converted to:

int16_t production_hint;

So it is only one number (id of particular ware). Though I can imagine a std::set instead. I can implement it on AI side but I dont know how to modify the LUA side.

I´m using the frisian branch for AI training, and I´m merging in the recent changes from trunk quite often, so the source code is the same as in latest trunk, including the AI branches. I have a bit less time for training now than when I started, but I still do one round a day. I can still train the AI for about a week, I don´t know yet whether I´ll still have enough time to continue after that. Anyway, the AI is shaping up great, improvements are clearly visible in every generation, the new AI is much better than the one in b19. I can only say it again: Great work! face-smile.png

I dont know when new release of Widelands is planned, this would be a milestone for AI training. One thing would be convenient to stabilize AI - to slow down mutation rate a bit.

When playing as Frisians, the AI is much weaker than as any other tribe, however. That is of course due to lack of training as Frisians, but this leads me to another thought: The Frisians are intended to be a tribe for advanced players, with a more complex economy than the other tribes and a higher risk of deadlocks. Can the AI even be as good playing Frisians as the other tribes? Should the same amount of training be put into Frisian AI as into the other tribes, or should it just be accepted that it will never be quite as good with Frisians?

I dont know. AI should be quite generic and training with focus specifically frisians should improve AI for them and not hurt other tribes performance. But indeed there can be specific issues that AI can not overcome. First of all resolve all that missing helper building stuff. Without sufficient information for the AI you cannot expect it would figure things out.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-08-24, 06:59

Tibor wrote:

Do you mean that one site would support two productionsites? Not possible right now. In ai this hint is converted to:

int16_t production_hint;

So it is only one number (id of particular ware). Though I can imagine a std::set instead. I can implement it on AI side but I dont know how to modify the LUA side.

I have created a branch for you that takes care of the Lua stuff. Too lazy to wait for the compiler, but it should work.

I dont know when new release of Widelands is planned, this would be a milestone for AI training.

I have given up on planning those, since it always takes a lot longer than expected anyway.


Busy indexing nil values

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-24, 07:44

GunChleoc wrote:

Tibor wrote:

Do you mean that one site would support two productionsites? Not possible right now. In ai this hint is converted to:

int16_t production_hint;

So it is only one number (id of particular ware). Though I can imagine a std::set instead. I can implement it on AI side but I dont know how to modify the LUA side.

I have created a branch for you that takes care of the Lua stuff. Too lazy to wait for the compiler, but it should work.

looks sweet, I will go on with the branch..

I dont know when new release of Widelands is planned, this would be a milestone for AI training.

I have given up on planning those, since it always takes a lot longer than expected anyway.

Any significant changes to AI would cause de-training, so having AI trained now plus this tiny change in production hint would be good opportunity for release. Or we will just wait for release and slowly continually train the AI (Nordfriese mainly)


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-24, 11:30

Also, we can rename "renews_map_resources" to something more appropriate, like "supports_production_of" or so. Let you decide..


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-08-24, 13:52

"supports_production_of" sounds good.


Busy indexing nil values

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-08-24, 19:19

It cannot compile, I am getting this error:

  /var/widelands2/BZR/ai_production_hints/src/ai/ai_hints.cc: In constructor ‘BuildingHints::BuildingHints(std::unique_ptr<LuaTable>)’:
  /var/widelands2/BZR/ai_production_hints/src/ai/ai_hints.cc:52:45: error: ‘class std::unique_ptr<LuaTable>’ has no member named ‘get_table’
  for (const std::string& ware_name : table.get_table("supports_production_of")->array_entries<std::string>()) {

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2017-08-24, 20:25

It needs an include: scripting/lua_table.h


Busy indexing nil values

Top Quote