Empire Tut 2 - missing event when barbarians are detected

Bug #741142 reported by LAZA on 2011-03-23
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

i made a very strange experience when i played the second tutorial of the empire:
i expanded fast but my industries was running behind, still got no coal mine or iron mine and was building the infrastructure for those at the moment.
the enemy (barbarians) exanded also (new behavior?) and we meet at the south of the coal mountain. he build an outpost and attack directly (after 1:55 h)

for those event (detected enemy) i got no message nor the possibility to build enhanced military buildings so i stuck at the barracks and was lost.
i was never able to defend an building cause the barbarians attacked with 4, 5 soldiers and my maximum is 2 in an sentry.

bzr5891 on Windows 7 in Virtualbox

Related branches

Hans Joachim Desserud (hjd) wrote :

Sounds strange. I have not seen the barbarian player on that map get out from it's starting area before. Could you please attach a savegame or replay of this game?

Changed in widelands:
importance: Undecided → Medium
status: New → Incomplete
tags: added: campaign empire
SirVer (sirver) wrote :

I played this scenario less than a week ago and didn't see the error. The replay would be most valuable. Also a savegame from earlier in the game could help.

LAZA (laza74) wrote :


LAZA (laza74) wrote :

autosave (10 min after savegame)

Nicolai Hähnle (nha) wrote :

I see two approaches to fixing that:

(1) Make the scenario more deterministic by explicitly forbidding the AI to expand beyond a certain point. The stone barrier is supposed to prevent enemy expansion, but the AI might by chance build a lot of quarries and then expand.

(2) Change the logic of the scenario so that advanced military buildings become unlocked as soon as the player can see the enemy's territory.

LAZA (laza74) wrote :

replay (wrpl)

LAZA (laza74) wrote :

replay (wrpl.wgf)

LAZA (laza74) wrote :

@ Nicolai

(3) Allow to build advanced military buildings if the event mines is triggered (something like this):
To protect your infrastructur build at exposed/strategic important places advanced military buildings like ...

For this idea, the rock cluster at the middle of the map should eventually bigger to grant the player enough ressources to build these prompt.

If there are more questions about the savegames, replay, ... don't hesitate to ask.

SirVer (sirver) wrote :

As a general remark: at the moment the barbarians are revealed currently when an oremine, a marblemine and either a coal mine or a burners house are build. Then, the bigger military buildings are also enabled for the player.


1) There is no code in the AI part for making barriers explicit. I agree that this might be useful for scenarios. As a workaround, one could place objects that can not be passed through at a certain place on the map and remove them when the 'seen' action happens. One could also forbid the quarry for the AI for a similar effect.

2) This could be done but would mean to scan at least an area of the map periodically in a Lua coroutine. Alternativly, one could add a new lua hook similar to [1] that is called whenever a (miliary?)building is completed and/or a new field is conquered by a player and/or a new field is revealed to a player. This would require coding but would reverse pushing/polling situation.

[1] http://blog.makezine.com/archive/2010/10/homemade-high-resolution-dlp-3d-pri.html

Actually, 1 and 2 sound quite useful to me but, but both are some work.

SirVer (sirver) wrote :

Blaah.. wrong link in the last post. Though interesting as well :)

I meant of course:

[1] http://wl.widelands.org/docs/lua/introduction/#hooks

Hans Joachim Desserud (hjd) wrote :

Happened to me earlier today when checking bug 780409, so it is possible. Right after building a coal mine, and establishing myself on the east side of the stones nearby I was attacked by the barbarians.

I thought a bit about, and my idea would be to rework the barbarians and the stone barrier a bit. By either disallowing the barbarians to build quarries at all, or only allow them after a while, for instance when the player learns of them, it gives the human player a head start.

This would probably also make it possible to make the barrier smaller, since the AI will not be able to break through it. I would especially like this, because frankly I think it is too large and it gets a bit tedious waiting to break through it when you have completed all the other objectives.

Changed in widelands:
milestone: none → build17-rc1
status: Incomplete → Confirmed
Leif Sandstede (lcsand) on 2011-05-10
Changed in widelands:
assignee: nobody → Leif Sandstede (widelands-sandstede)
Leif Sandstede (lcsand) wrote :

I removed the ability to build the quarry from compuer player and gave it back when computer player is revealed by trigger. It propably will not be able to build any at that point, but it will not hurt to give back the ability.
So this is the most simple way to fix this I could see.

Leif Sandstede (lcsand) on 2011-05-10
Changed in widelands:
status: Confirmed → In Progress
SirVer (sirver) wrote :

I merged your fixes in 5915. A good solution to fix this bug imho. I also added you to the list of coders, please have a look at txt/developers if you are fine with the changes.

Changed in widelands:
status: In Progress → Fix Committed
assignee: Leif Sandstede (widelands-sandstede) → nobody
Leif Sandstede (lcsand) wrote :

Well I assume the text in the brackets is supposed to be my launchpad-id, it is not and never was. But I just found out how to change it and now it is "lcsand".

SirVer (sirver) wrote :


SirVer (sirver) wrote :

Released in build17-rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers