Topic: Training sites

fk
Avatar
Joined: 2013-07-30, 22:58 UTC+2.0
Posts: 150
Ranking
At home in WL-forums
Posted at: 2015-03-17, 16:36 UTC+1.0

On huge map I can easily have 4 trainingscamps working for 100%

Perhaps it is more difficult to reach 100% at central spots.

Edited: 2015-03-17, 16:36 UTC+1.0

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01 UTC+2.0
Posts: 1116
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-03-17, 19:25 UTC+1.0

fk wrote:

On huge map I can easily have 4 trainingscamps working for 100%

Perhaps it is more difficult to reach 100% at central spots.

I don't understand what do you mean by "central spots"? I've described how to do that here: link but for sure it will be very hard to implement in current AI-model. Calculating, assumptions, approximations and those things are very far to current AI-calculations face-smile.png

So yes: please build more trainingscamps, but try to build them as close as possible to each other. My strategy include lots of dismantling, even 100% working buildings. This is very hard to predict. face-smile.png


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24 UTC+1.0
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-03-17, 20:19 UTC+1.0

I see opinions differs quite a lot. I have something programmed yet and I think I will stay with it.

It is really hard to mimic human thinking for AI.

At least some feedback:

@einstain

please build more trainingscamps, but try to build them as close as possible to each other.

Why???

My strategy include lots of dismantling, even 100% working buildings.

Is there typo? My <-> AI ??

@fk

do not built next trainingsite if there is one unoccupied (by trainer)

That rule already exists (or existed?).

Now this rule will be applicable for all trainingsites at once, not per individual trainingsite type.

@wl-zocker

I always build new training sites when the existing once are full of soldiers, weapons, and food. Maybe you could use the statistics (the official or your own one) for that.

You mean treat them as productionsites, where % of utilization is considered when new building is to be built or some of current one destroyed? Not bad idea.... but additional work...


Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01 UTC+2.0
Posts: 1116
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-03-17, 21:58 UTC+1.0

Tibor wrote:

@einstain

please build more trainingscamps, but try to build them as close as possible to each other.

Why???

Centralized production system in Settlers II / Widelands is much more efficient than scattered production system. Why? Because if we produce f.e. a tabard in one part of world, and the same tabard in another part of world. Assume that it is on the 512x512 map. Also the distance is maximal, but optimal: if there is closer way, we will take. So the distance is on the square of 256x256 => 256sqrt(2)~=362 units. Then we want tabards from one part of our empire to the second one it will take time. It is in this case distance * time_per_unit * 1.5 (1.5 factor is because a carrier has to go for a tabard and then go whole road. The distance to go for tabard is 0.5 of standard distance). Then you have time = 3621.8*1.5 = 977.4 seconds =16 minutes 17.4 seconds. This time is lost for the economy and for upgrading soldiers.

That is beacuse I prefer centralized production system: build everything in of one type in one place:

  • warehouse with prefered crops
  • near the warehouse mills
  • in other place warehouse for flour
  • in that place bakeries
  • then warehouse for food
  • next to that warehouse colloseums & trainingscamp

You can't build all the system at once, because you don't have resources and territory for that. You have to conquer it first. So you build all the systems around the headquaters, then dismantle it part of system by part of system: dismantle mills, centralize them. Then dismantle bakeries and build in other part, centralize them, and so on.

Theory (calculations based on Widelands system) say that if everything is moved to one place (warehouse) where it is needed (f.e. all the food to one warehouse), the economy will work very good. Better if you don't have the distance, but most of the huge-map games it is impossible. Experience say that theory is true only if you have good road system (lack of traffic jams). There are some exceptions of that rule, but they are complex cases.

My strategy include lots of dismantling, even 100% working buildings.

Is there typo? My <-> AI ??

I've described it above: this is my strategy. It changes a bit than it is described in the file, mostly that dismantling. For example I need a cloth production in early game (to build ships) and it is useless till late game. In the late game I need several buildings (f.e. 4 of each) instead of 2 of them (1 of each). This is needed in completely new spot. So I dismantle working buildings when other are built or almost built.

My strategy is very complex, but I know for sure that it is very efficient. I gain several level 10 soldiers in very short time and I can win almost all the battles. Also it is very hard for AI calculations. Why? Because my strategy contains states. I didn't heard that AI can save any value for itself. So there is no state of AI- all the decisions will be the same for the whole game. Of course you can get the current state of game/ empire if you calculate lots of things, but it will be CPU-expensive for sure face-smile.png It is better to make a calculations at the beginning of the game and then use them to play.

There is a "weak point" of my strategy: if you attack me when I'm not on the "late game state", you will probably win for sure. After getting last state there is no return: you will loose face-tongue.png face-grin.png So how much time you have? On The Nile map I've tried to make it as fast as possible: 5-6 hours. Faster is impossible, because there is no possible to produce more marble/ marble columns/ build all the farms/ etc. After 10-12 hours I have 100% working economy on each state and then I can attack weaker players OR build more trainings camps if I'm not the strongest one face-smile.png


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24 UTC+1.0
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-03-17, 22:13 UTC+1.0

it is science face-smile.png

But does not input queues of material at productionsites work as buffers?

Main problem of AI is that it cannot look a map and say 'here in this corner I will build this industry and over there that industry'. It has no undestanding of space. It can measure distance, or even walking distance but does not understand shapes/layout and so.


Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35 UTC+2.0
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-03-18, 00:06 UTC+1.0

I don't think what einstein says is needed in 99% of cases. only in extremely large maps centralizing the economy increases efficiency. Which is a purely theoretical situation: AI is not strong enough to challenge a human on a large map even with a weak strategy, and humans do not play for 12 hours normally.

I have seen economy slow down for lack of centralization. normally the mmaterial stored at productionsites acts as buffer; so you have for example 3 corn on the road, and 3 corn on the mill, and the mill will still work even if the map is big. But if the map is very huge, you can have 6 corn on the road and 0 corn in the mill, and the mill won't work. So your economy slows down, and you see corn accumulating in warehouses even if your mills are empty.

I never considered actually dismantling and resettling all the buildings. seems like more trouble than it's worth, especially the loss of building material. Those few times I had the problem myself, I solved it by making more mills (and, in general, transformation buildings). II had proposed a solution to it by an algoritm that would reroute the wares to the closer buildings, so that if there is corn A going to mill A' and corn B going to mill B' and the sum of distances A-B' + B-A' is lower than A-A' + B-B' then A is sent to B' and B is sent too A' instead. I discussed it in one oof my first posts, nbut now I cannot find it anymore. Anyway, it was probably too cpu intensive, considering that long games tend to lag already by themselves.

Anyway, long story short, I don't think the top priority of an AI should be to optimize for a game on a huge map lasting longer than 10 hours. It would be more important instead to make the AI capable of making a full economy in a small map (never tried the AI of the tunk builds, but in version 18 on a small map like the green plateau or desert tournament the AI could not make new soldiers) or capable of upgrading its soldiers before, like, 6 hours.

Also, from an AI point of view, I think decentralized production is better. centralized production is very vulnerable to conquest. If an opponent conquers some of your ground, with centralized production your entire production will be stopped. And you won't have anywhere free to rebuild. Since AI is not good at holding a front, I think it is good that it can llose terrain without getting the economy broken by it.

Edited: 2015-03-18, 00:07 UTC+1.0

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01 UTC+2.0
Posts: 1116
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-03-18, 01:09 UTC+1.0

king_of_nowhere wrote:

I don't think what einstein says is needed in 99% of cases.

It depends on what you are playing face-smile.png For my single player games it is 99% of cases. So it is needed! I don't like to play small maps, because it is too easy to win. I like to build up whole economy, then attack

Only in extremely large maps centralizing the economy increases efficiency.

I told that. Maybe not exactly, so thank you.

Which is a purely theoretical situation: AI is not strong enough to challenge a human on a large map even with a weak strategy, and humans do not play for 12 hours normally.

I don't understand all the sentence. What did you want to say? Did you tell that I'm not a normal human? face-smile.png I like to play a game for more than 16 hours before win.

(...) you see corn accumulating in warehouses even if your mills are empty. Try big seafaring map and see what can happened when your "roads" aren't efficient at all.

I never considered actually dismantling and resettling all the buildings. seems like more trouble than it's worth, especially the loss of building material.

Stones? usually there is lots of stone. Wood? It has infinite number to get (build a forester).

I did that also with tournament games! Why? because of lack of terrain. Foresters and woodcutters were moved "to the corner". It was worth it!

Those few times I had the problem myself, I solved it by making more mills (and, in general, transformation buildings).

This is the easiest way, but not very efficient- you loose lots of wares and you can simply have traffic problems.

II had proposed a solution to it by an algoritm that would reroute the wares (...)

The algorithm is quite simple, but as you mentioned, cpu-intensive. There is thousands of wares on the roads. Check every ware is almost impossible. Simple swapping is not always the best way. It is better, but if you want to make it even more efficient, it is quite a complex problem. Settlers II didn't solved that at all! Widelands is much better: if the ware is going to the warehouse, it can change direction and go to another site.

I don't think the top priority of an AI should be to optimize for a game on a huge map lasting longer than 10 hours.

1 . Can you win The Nile map in shorter time than 10 hours? (7 AIs against you). Or can you win The Maze map in 7th position in shorter time? There is lots of maps designed to be long-term! There are even maps for more than 24 hours game.

I can remember that in The Maze map on build 18 and before AI got stuck because of trees. The game was boring. No good soldiers, no good AI. Now it is much better! (thank you Tibor again!)

2 . If you optimize only some aspects for AI for a long time-games, you will have lots of benefits on that state.

f.e. if you optimize wood production, you can gain few thousands wood more. For other products it will be less significant (f.e. only 1% more lvl 10 sodliers), but still it will be very powerful.

It would be more important instead to make the AI capable of making a full economy in a small map (...)

This is another significant need. But for sure basics is now done. Sometimes AI has problems with limited land, but it is much better than before.

Also, from an AI point of view, I think decentralized production is better. centralized production is very vulnerable to conquest. (...)

You're right. But I've never seen anybody who lost and had centralized production.

Ok, to be more specific: Only one player in my widelands-history played with me on long-term maps. He was a very good player, but his strategy was rather mix of centralize and decentralized production. On The Nile map he had very good soldiers about 4-6 hours before me. But he lost. Our economies were growing up. And finally his economy wasn't working well. If the map was smaller he would win for sure. (the game last for more than 20 hours of gametime!)

From that time I've never played whole game with another human on huge maps (only begin of games few times, but not more than 3-4 hours of gametime)

So that I want to play with good AI. It is very patient and with 7x more power- very powerful against me face-smile.png

Since AI is not good at holding a front, I think it is good that it can llose terrain without getting the economy broken by it.

So maybe we should think about improving moving the frontline instead of criticizing an idea of long-term games?

I know that you don't like long-term games, but there is number of players that are playing a game for a very long time! I can see that on metaserver there are some people playing Widelands few times a week. Maybe they are playing one game?

For small maps- ok, the strategy is not needed at all! But for larger maps it is needed for sure. But how to implement that? I don't know now.


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35 UTC+2.0
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-03-18, 17:41 UTC+1.0

Well, you have a point. I also would like to play long games, but I know I am quite an exception among players (I remember in civilization IV, if the game lasted longer than two hours someone would start complaining it was boring. to me, they were the only games really meaningful) and I tend to think it's not needed to cater to my very specific needs.

But especially in widelands, the AI suck hard. So I played two or three games on huge maps in the beginning, but I soon gave up because there was too little challenge involved. Then I tried to play by only making mines on the wrong resources, so they would be exhausted and only produce 5% of the times; I had huge economy, but it was quite different, because I still had little metal. I eventually gave up playing on larger maps because this AI consistently fails to provide anything resembling a decent challenge; that's where my criticism of long games come from. AI is too weak to make meaningful long games, and humans are too hasty to find 7 other people who would play a long game.

in fact, I was considering opening a thread requesting the programmers to let the AI cheat so that we could have decent opponents. There's no shame in it. I don't know of a single strategic or 4x game (widelands is more a 4x than a strategic, because it has much more focus on economy than fighting) where a mediocre human could not mop the floor with a non-cheating AI. mIn the aforementioned civ IV, at godlike level AI had almost triple production than a human, and some managed to beat it anyway.

But again, I never played with AI after base 18. everybody said it's improved a lot, maybe I should give it a try before judging. So

1 . Can you win The Nile map in shorter time than 10 hours?

I'll take your challenge. Then I will say if it is still worthless to try to play long games.

P.S.

I did that also with tournament games! Why? because of lack of terrain. Foresters and woodcutters were moved "to the corner". It was worth it!

In the torunament, since the map was so small, I planned from the beginning where I wanted to build everything.


Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 23:24 UTC+1.0
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-03-18, 21:03 UTC+1.0

Guys,

a lot of interesting stuf was said, so couple of comments

I am aware that AI does not make differencies based on map size. F.e. in estimation how many wood it needs (it has internal targets) or it could adjust a time when first trainingsite is to be build.

It is theoretically possible to cluster productionsites, in fact something like this is done with space consumers, even though it might not be that much visible. If we identified some building as belonging to industry X, AI could scan vicinity of possible building field, and increase score if buildings of the same industries are found. It would not be effective for 100% though, but would make some difference. But also warehouses would have to be included in this... It is not so easy at all....

re cheating by AI - It would be more elegant if we allowed various amount of starting wares for AI - if we had easy/medium/difficult game levels. But generally I am against cheating here....

I just pushed new branch ai-military-changes - where I reworked training sites stategy and attacking algorithm. I am trying to make AI more agile when attacking. I am still intensively working on it, but who can compile it, can try it. No, dont try it yet :) OK, fixed, you can try it :)

BTW - where is SirVer? :)

Edited: 2015-03-18, 22:04 UTC+1.0

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01 UTC+2.0
Posts: 1116
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-03-18, 22:49 UTC+1.0

But again, I never played with AI after base 18. everybody said it's improved a lot, maybe I should give it a try before judging. So

1 . Can you win The Nile map in shorter time than 10 hours?

I'll take your challenge. Then I will say if it is still worthless to try to play long games.

I will be glad to see the result of your game face-smile.png Will you fight against all the computers? face-smile.png They aren't so strong, that is for sure, but they are much stronger than before.

P.S.

I did that also with tournament games! Why? because of lack of terrain. Foresters and woodcutters were moved "to the corner". It was worth it!

In the torunament, since the map was so small, I planned from the beginning where I wanted to build everything.

I coudn't, because I used dense terrain for foresters first. Because I guessed that this spot is better to grow trees (wood was more needed at the beggining), but at the end it wasn't so I moved the foresters. Also with woodcutters- I placed lots of them to clear whole territory, then dismantle almost every of them. Another method: clear terrain, then build whole economy, then fight. Step by step to win face-smile.png Only you were stronger than our team till now.

Tibor wrote:

But also warehouses would have to be included in this... It is not so easy at all....

I know that. It is very hard to produce efficient way of programming AI here.

re cheating by AI - It would be more elegant if we allowed various amount of starting wares for AI - if we had easy/medium/difficult game levels. But generally I am against cheating here....

I am against too. But I was thinking rather to produce different strategies for AI: centralized, decentralized, seafaring prior (for some maps it is major thing). We can consider choosing the correct strategy, but now I don't know how to do that.

For example: The Nile map is best for big empires, seafaring is not the major thing there, but can be useful. Colonies map is mostly seafaring map (if the players will not reach each other). There are some maps where decentralized production is quite efficient (maybe 128x128 maps, not island, like finlakes or whatever (Can't remember the correct name for the map).

OK, fixed, you can try it face-smile.png

I remember compiling. Long and lots of troubles face-smile.png If you aren't a developer- hard to do that. But it is not mission impossible. Maybe I will ask you personally to help me, but not now face-wink.png

Edited: 2015-03-18, 23:04 UTC+1.0

einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote