Latest Posts

Topic: scenario AI

hessenfarmer
Avatar
Topic Opener
Joined: 2014-12-11, 22:16
Posts: 2651
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2017-01-30, 21:33

Hi

thanks Tinker for giving some feedback. I had a look on the code and yes you are right in most cases.

Tinker wrote:

I have been trying with this again. I get the sonemason message as soon as I build his hut even if I have not built any wood production, the message says that as I have all three buildings I should adjust the marble pillars, but often I have not got the sawmill and I tried it without a woodcutter as well.

You are right that was a leftover from previous version. Just forgot to change the message. Fixed that.

If I start using gold for expeditions while the miners and smelters are working then I never get to 6 gold in warehouses and the objective stays as not done.

That's correct. Don't know how to change this without complicating the scenario. Any suggestions?

The barbarians cetainly advance faster now, by the time I got to the small island to get iron I was bloked by their border covering the only expansion spaces on the island. When I got to invade their island they were far to strong, having no space to build training all my soldiers were untrained, they swept through my forces almost unopposed.

That is correct. Normally I was always able to get around 80% of the iron although. But now I created some more Building spaces on the Island, so it should work now. The AI is pretty fast advancing now so you have to advance fast on the northern island. If you sail to the west of your HQ you'll find a port space and after 2 times building a sentry youl should find big spots to build training buildings.

I just updated to 8267 and now get a lua coreroutine error, attept to call nil value by scroll_smoothly_to(sea,5) in mission thread lua.

Have not updated yet. but fix is easy as you discovered.

Any more sugesstions to the scenario?

Hint for the maps: there is a second Spot for building a port on the northern island just sail to the east from your first port. This will ease the shortfall of marble a little. There is a little bit of gold and iron on the third island. As well as more space and stone fields.


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

We have a new function produced_wares_count(what) in wl.game.Player in current trunk that you could use to count the number of gold produced.

Returns count of wares produced by the player up to now. ‘what’ can be either an “all” or single ware name or an array of names. If single ware name is given, integer is returned, otherwise the table is returned.


Busy indexing nil values

Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-01-31, 10:19

hessenfarmer wrote:

That is correct. Normally I was always able to get around 80% of the iron although. But now I created some more Building spaces on the Island, so it should work now. The AI is pretty fast advancing now so you have to advance fast on the northern island. If you sail to the west of your HQ you'll find a port space and after 2 times building a sentry youl should find big spots to build training buildings.

I was used to them playing at the speed they did earlier so did not realise I needed to hurry my expansion, so got no iron and by the time I was constructing training sites the barbarians were already in sight. I'll try again and work faster this time.


Top Quote
hessenfarmer
Avatar
Topic Opener
Joined: 2014-12-11, 22:16
Posts: 2651
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2017-01-31, 22:01

@ GunChleoc: thanks for the hint with the new function I'll try this after an update to a newer trunk. But I think I will keep the current map uploaded as is to get as much players trying the scenario as possible. @ Tinker: As you gave a lot of feedback about the AI behaviour in previous versions it is to some extent your own "fault" that the AI is performing that good. ;-)many thanks for this. What could help is some feedback about the difficulty of the whole scenario now. In fact the only thing that is slowing down the AI now are lots of stones to cut and some lack of ressources. @ all: I really would appreciate some feedback about the scenario and or improvements to the map. I think the basic story is laid out but could be possibly enriched with suitable subtasks a little bit. e.g. (already implemented) Amalea is eventually giving you an advice that too many Military buildings would cost you to much building spaces. Is there something that could / should be added without overguiding or even worse annoying the player. Currently I'm thinking about the following messages/objectives: 1. saledus giving some warnings about your own speed of expansion when the AI reaches (a) certain point(s). just to create some tense. 2. Amalea gives you a hint to discover especially the port space in the northeast of the northern island and all other undiscovered items as well. 3. Amalea giving hints if critical wares are running out (marble, cloth, etc.) ( A nanny like this can be really annoying) 4. saledus reminding you to build training sites and weaponry (seems to be too annoying as this is far basic) 5. Hiding an artefact in the map to discover as a side objective. (could be explained by regaining the gods good will for the upcoming journey see introduction message)

What are the thoughts of the community about this. regards hessenfarmer

PS: Already have another story in mind to make an scenario from but still will focus on this one first.


Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-02-01, 09:09

I appiciate that I shot myself in the foot by saying they were too weak to begin with face-grin.png

This time through I tried to move faster and first contact was with some untrained barbarian soldiers which gave me more time to train as I had dispupted their production. I like all of your suggested enrichments, the nanny can be annoying but if you are controlling things then you do not get the messages.

I was looking at some other training scenarios and noticed that often the players choice of buildings is limited to start and new possabilities are added as targets are reached, this might be a help. I once decided to start food production in advance for miners and training and the mill used all the grain before I had built enough wool. Preventing the mill and bakery until the wool objective is reached might be better, the same principal could be used to control the barbarian expansion, they cannot make bread until you can for example.


Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-02-02, 10:45

I have just realised why life was easier after upgrading to 8267, the barbarians had expanded fast and had twice the land I had but most of their border military buildings were unmaned or only had one soldier. While building the training camps I decided to attack the east end of the north island, the lage plots there could be used for farms. With three towers I could attack his senties with a lager force and he only had 5 soldiers there spread betwen 10 sentries, there was no retaliation so I pressedd forward, cut his economy in two and destroyed his headquarters. It was then that I noticed I was not adding any soldiers to my economy.

8267 added barracks as the method of building soldiers instead of warehouses and the scenario setup does not add the barracks to either player, this needs to be corrected. As the player does not need soldiers until given the objective of defeating the enemy, after creating the port on the north island, it could be added to the list of building then. As many people may be playing the scenario as a tutorial they may take a lot longer to find their way around and achieve the scenario goals perhaps giving the barracks ability to the barbarians at the time you establish the port on the north island would also be good. They will have a lot more land and wares but their further expansion is delayed untill you are both in the end game.


Top Quote
Venatrix
Avatar
Joined: 2010-10-05, 19:31
Posts: 449
Ranking
Tribe Member
Location: Germany
Posted at: 2017-02-02, 11:25

Hmm… That means the other scenarios and campaigns will need a rework too, because they don’t use the barracks at the moment.

Edit: Bug is reported. https://bugs.launchpad.net/widelands/+bug/1661220

Edited: 2017-02-02, 11:41

Two is the oddest prime.

Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-02-04, 14:47

@Venatrix

As far as I can tell all 'official' scenarios work as expected, barracks are available and used if needed.

@GunChleoc

Just how does new function produced_wares_count(what) work? I can find no documentation and trial and error I have not found a way to avoid the scenario crashing when it tries to check gold produced.


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-02-04, 15:42

as for produced_wares_count(what) , there are some examples in our testsuite, see here:

http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/test/maps/plain.wmf/scripting/test_produced_wares_count.lua#L13 http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/test/maps/lua_testsuite.wmf/scripting/gplayer.lua#L158


Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-02-05, 12:06

Taking, from the example pointed to, but changing log for gold this should work

gold_count = p1:get_produced_wares_count('gold')

but gives a nil error from global produced_wares_count.

p1 is defined by

p1 = wl.Game().players[1]


Top Quote