Add Empire Mission 3

Bug #1687542 reported by hessenfarmer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Wishlist
Unassigned

Bug Description

This is created to show the different possibilities how to implement a graphical objective and send it to the user. The goal is that the image is permanently visible to the player until the objective is done.

1st alternative:
message_box.png is how the pic is added to a campaign message box
message.png is a message send to p1 to have the pic permanently visible in his messages

second alternative:
objective_in_message_box.png is showing the result of adding the image to the objective within the campaign message box
objective_window ist the same objective shown in objectives window.

I like second alternative best but want to hear your opinions

Tags: campaign

Related branches

Revision history for this message
hessenfarmer (stephan-lutz) wrote :
Revision history for this message
hessenfarmer (stephan-lutz) wrote :
Revision history for this message
hessenfarmer (stephan-lutz) wrote :
Revision history for this message
hessenfarmer (stephan-lutz) wrote :
GunChleoc (gunchleoc)
summary: - show pictures in missionobjectives
+ Add Empire Mission 3
Changed in widelands:
status: New → In Progress
importance: Undecided → Wishlist
assignee: nobody → hessenfarmer (stephan-lutz)
milestone: none → build20-rc1
tags: added: campaign
Revision history for this message
GunChleoc (gunchleoc) wrote :
Download full text (3.5 KiB)

I'm getting a segfault - last few saves attached.

Thread 1 "widelands" received signal SIGSEGV, Segmentation fault.
0x0000000001235852 in LuaMaps::LuaEconomy::ware_target_quantity (
    this=0x4fce770, L=0x748d078)
    at empire-mission-3/src/scripting/lua_map.cc:3400
3400 lua_pushinteger(L, quantity.permanent);
(gdb) backtrace
#0 0x0000000001235852 in LuaMaps::LuaEconomy::ware_target_quantity (
    this=0x4fce770, L=0x748d078)
    at empire-mission-3/src/scripting/lua_map.cc:3400
#1 0x000000000127046b in method_dispatch<LuaMaps::LuaEconomy, LuaMaps::LuaEconomy> (L=0x748d078)
    at empire-mission-3/src/scripting/luna_impl.h:175
#2 0x00000000012f5afc in luaD_precall (L=0x748d078, func=0x9524ef0,
    nresults=1)
    at empire-mission-3/src/third_party/eris/ldo.c:360
#3 0x0000000001312c48 in luaV_execute (L=0x748d078)
    at empire-mission-3/src/third_party/eris/lvm.c:1116
#4 0x00000000012f6311 in unroll (L=0x748d078, ud=0x0)
    at empire-mission-3/src/third_party/eris/ldo.c:550
#5 0x00000000012f6667 in resume (L=0x748d078, ud=0x7fffffff929c)
    at empire-mission-3/src/third_party/eris/ldo.c:643
#6 0x00000000012f50d0 in luaD_rawrunprotected (L=0x748d078,
    f=0x12f64be <resume>, ud=0x7fffffff929c)
    at empire-mission-3/src/third_party/eris/ldo.c:142
#7 0x00000000012f66e4 in lua_resume (L=0x748d078, from=0x0, nargs=0)
    at empire-mission-3/src/third_party/eris/ldo.c:657
#8 0x00000000011691ce in LuaCoroutine::resume (this=0x9498cc0)
    at empire-mission-3/src/scripting/lua_coroutine.cc:80
#9 0x0000000000f38432 in Widelands::CmdLuaCoroutine::execute (this=0xadaba10, game=...)
    at empire-mission-3/src/logic/cmd_luacoroutine.cc:42
#10 0x0000000000f39c03 in Widelands::CmdQueue::run_queue (this=0x7fffffffa180, interval=750,
    game_time_var=@0x7fffffff9fb8: 14710745) at empire-mission-3/src/logic/cmd_queue.cc:123
#11 0x0000000000e16cdb in Widelands::Game::think (this=0x7fffffff9fb0)
    at empire-mission-3/src/logic/game.cc:555
#12 0x000000000106b292 in InteractiveBase::think (this=0x379ea50)
    at empire-mission-3/src/wui/interactive_base.cc:334
#13 0x000000000108343d in InteractivePlayer::think (this=0x379ea50)
    at empire-mission-3/src/wui/interactive_player.cc:128
#14 0x0000000000fc20f1 in UI::Panel::do_think (this=0x379ea50)
    at empire-mission-3/src/ui_basic/panel.cc:458
#15 0x0000000000fc16e9 in UI::Panel::do_run (this=0x379ea50)
    at empire-mission-3/src/ui_basic/panel.cc:183
#16 0x0000000000cf4c5a in UI::Panel::run<UI::Panel::Returncodes> (this=0x379ea50)
    at empire-mission-3/src/ui_basic/panel.h:96
#17 0x0000000000e1699c in Widelands::Game::run (this=0x7fffffff9fb0, loader_ui=0x7fffffff9cd0,
    start_game_type=Widelands::Game::Loaded, script_to_run="", replay=false, prefix_for_replays="single_player")
    at empire-mission-3/src/logic/game.cc:525
#18 0x0000000000e15d34 in Widelands::Game::run_load_game (this=0x7fffffff9fb0, filename="save/wl_autosave_00.wgf", script_to_run="")
    at empire-mission-3/src/logic/game.cc:382
#19 0x0000000000cef165 in WLApplication::load_game (this=0x1a20cf0)
    at empire-mission-3/src/wlapplication.cc:1275
#20 0x0000000000cee1a3 in WLApplication::mainmenu_singleplayer (this=...

Read more...

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

Well,

I playtested the whole Mission again before uploading. So I can't tell what is going wrong. As the log is pointing to the new economy settings feature it might be possible that something was not working there. I will check this Evening the provided savegames in my Installation.

Anyhow I have checked the branch history and found some changes where I'd like to explain something:
In revision 8352 some minor changes to mission 1 and 2 were revised which I made with full intention:
In mission 2 the wrong background picture (displayed while loading the mission) is used (instead of using the one in the mission folder of mission 2 it uses that in the folder of mission 1)
In mission 1 I added the hide completely flag to the revealed part of the sea, because it is a similar mission start to mission 3.
As I still think these changes will be useful what will be the best way to get them in? Should I open a new bug for them?

Next thing is I realized the comment in texts.lua in revision 8354. The objective is explained in detail in the campaign message box introducing this objective (use economy Settings to lower the demand to 4) and it is checked in the function "economy_settings" in mission_thread.lua. Although I like to admit that there should be the target value given in the objective text just to not forget. Furthermore we can add some hint like "... by using the economy Settings"

Revision history for this message
GunChleoc (gunchleoc) wrote :

I thought the changes to the other missions were accidental - feel free to add them back in :)

My point with the comment is that the player will not know how to access the economy settings at all, unless they have played the economy tutorial. Maybe you can copy over some text from there.

Revision history for this message
kaputtnik (franku) wrote :

I do also test playing but for now i encountered no segfault. The messages for gold and wheat are shown without any problems. Playing this branch, not trunk (in case this branch is not equal to current trunk)

> My point with the comment is that the player will not know how to access the economy settings at all, unless they have played the economy tutorial.

This is a general question: Should we assume that playing the tutorial is a prerequisite for playing the campaigns? At least some basic understanding can be expected, imho. Otherwise this question will arise for every campaign.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I think this scenario should still have it for finding the button for the economy settings, since the economy tutorial is considered an advanced tutorial, and the economy settings button is hard to find. I think we will have introduced everything else and won't need to explain stuff again going forward.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

I have uploaded may latest changes this morning.
First I have fixed the things in mission 1 (hide_fields =true) and mission 2 (background Image).
Second I added the target quantity of "four" to the objective text.
Third I added a bracket to the objective text saying (Remember you can reach the economy settings by clicking on any flag.)
I think that gives the user the right hint and remebers him that he should have seen (in the tutorial) or read this (in the manual pages) already. I think this should be sufficient for this stage of the campaign.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

Ah I forgot to tell that I tried all of the savegames provided last evening and I was able to continue all of them without an error given.
For this test I used the build of my branch which was created by appveyor after merging in the economy features branch. Perhaps I'll try to download the latest trunk (which should contain the necesaary changes as well) this evening and try again.

Revision history for this message
kaputtnik (franku) wrote :

Just merged trunk into this branch, compiled and played the campaign from the beginning. No segfault for wheat, marble and gold :-)

Revision history for this message
GunChleoc (gunchleoc) wrote :

I got another segfault, but much later on. Might not be related to this branch.

I haven't finished playing the scenario yet, so I've pushed another interim code review - mostly making things that don't fit smaller and some tweaks to the texts.

Revision history for this message
GunChleoc (gunchleoc) wrote :

2 more things:

- On the southern island, the Barbarians' towers are blocking me from the eastern part of the island (see screenshot). There should be a bit more room in the north to get around the mountains.

- I got no warning that expeditions also need cloth (or I didn't remember by the time that my shipyard started producing). I was lucky that I still had barely enough left to start 1 expedition.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :
Download full text (3.8 KiB)

yesterday I downloaded and installed latest trunk build (bzr 8352) for windows x64 from Tinos site. My system is a somewhat old dell inspiron 1720 running win 10. I copied the relevant campaign files and folders from the latest revision of the branch to this installation and played the mission nearly to the end. So at least I like to confirm that the stuff is technically working on win 10 x64 very well.
Now to your findings:
1. the blocking of some space on the southern island is a known issue since the beginning. Toghether with especially tinker I thought of some workarounds which led me finally to create the building spot in the north (where you have placed a forrester in the PNG) and to switch over the iron and the coal on this mountains from the original design. As the only purpose of this island is to get the iron there and have some more building plots this situation as in your picture is fully sufficient to win the scenario. Although it is sometimes different and somehow unpredictable how much towers are build by the AI and on which locations. so If you really deem it necessary I will add another small building spot in the nort to make it to the east. But preferably I'd like to keep it like it is.

2. I'll think I could add a message box after the the first weaving mill is finished that we should spare some cloth for an expedition rather than using it all for ships. Although I thought that a player would rather build a port earlier in a game than you did. This is because there isn't much left to build after the discovery of the port building plot. But anyhow I will add the message box which will have Amalea telling you to check for cloth regularly and spare at least enough for 2 to 3 expeditions. I will explicitly leave this freedom to the player.

3. your comments in the code:
a) height of the message boxes -- I just didn't like scrolling in my resolution and forgot to think about lower res. fully happy with your changes. I might need to make some additional message boxes a little bit larger but will keep this topic into my mind
b) the overlayed messages -- never experienced this as the message box pauses my game normally. I thougth that this is a common feature so my only experience ever was: having a message displayed, clicking ok, getting the next message. Only thing I can imagine is if you have an open road building (which happens to me from time to time because road building mode is on and I don't realize this while scrolling around in my world watching my inhabitants and making plans) this would delay the messages as far as I know and this could probably lead to the case that two or more messages are fired together after finishing the road building. So could you please remember if this could have been the case if not would it be possible to tell which message from Amalea was colliding. It isn't easy to sleep for a message in the scenario because from some point in time there is no serial plot. instead we have parallelized objecitve chains.
c) waiting with the expedition port objectives -- I think I like it the way it is, because in this scenario it is of some importance to be quick although we need a lot of time to wait for so...

Read more...

Revision history for this message
GunChleoc (gunchleoc) wrote :

I played to the end now, and no more crashes. So, I expect that the problem is already in trunk and happens only sporadically.

1. That originally housed a military building, which I dismantled so I could use the building plot. So, placing a military building there wasn't enough for me to get around the mountain.

3a. You could also experiment with making the message boxes a bit wider.

3b. I don't remember now, sorry.

I pushed the remaining code review. In case you already made changes to your version, this is what you do:

1. If you already committed, bzr uncommit until you're back on the last common version

bzr shelve
bzr pull lp:~widelands-dev/widelands/empire-mission-3
bzr unshelve

Revision history for this message
GunChleoc (gunchleoc) wrote :

d. we have code for that in the Barbarian campaign, scenario 1:

   local prior_center = scroll_to_field(rocks)
   message_box_objective(plr, order_msg_3)
   obj = add_campaign_objective(obj_claim_northeastern_rocks)
   message_box_objective(plr, order_msg_4)

   -- Move back
   scroll_to_map_pixel(prior_center)

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

ok have done the following (rev8359)

1. inserted another building plot in the north of the southern island
2. inserted new message box after finishing weaving mill (@ Gun Chleoc: please correct as necessary)
3. changed width and height of the message boxes
4. inserted the functionality to scroll back to the original focus. (thanks for the code)

as I can't do anything about the overlaying messages, cause I never experienced this and would like to change nothing in the order of objectives I think I'm through with the tasks from the review.

Revision history for this message
hessenfarmer (stephan-lutz) wrote :

Wow,
I am deeply impressed about what has been done this morning. Again I learned a lot about the still unknown Features of the lua Interface.

Regarding the new NOCOM in the code I like to explain the following:

the final aim is to check if all artifacts are owned by p1 but

meanwhile a message should be given every time an artifact is discovered/conquered or reconquered but only once if the artifact is not lost.

And the last one is the reason for the complicated code as I think your simplified code example would trigger the artifact found message for each artiifact already found in every iteration of the loop.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Ah - good point about not triggering the messages twice. I'll take a look again tomorrow.

I am really looking forward to having this added, it is a very enjoyable scenario :)

Changed in widelands:
status: In Progress → Fix Committed
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
assignee: hessenfarmer (stephan-lutz) → nobody
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.