Lua: reveal_fields after hide_fields(fields, hide_completely) does not respect seen fields

Bug #1687100 reported by kaputtnik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Undecided
Unassigned

Bug Description

Since there is a possibility to hide a area of map completely, revealing after a complete hiding causes unwanted behavior. Some parts of a map get darken and workers disappear. Difficult to explain so please try yourself: The attached save game is from tutorial03_seafaring with the following lines added in mission_thread.introduction()

plr:hide_fields(wl.Game().map:get_field(43,52):region(20),true)
plr:reveal_fields(wl.Game().map:get_field(43,52):region(20))
sleep(600000)

Watch the region at the Quarry at 45,54 (increase game time to 3 or so). Each time the Stonemason leaves his house some area around the quarry get darken. This happens also to other parts of the map. Some carriers do also disappear. I guess its because the player looses sight to the area where the carrier stands (the area get a bit darken).

Maybe an opposite option in regard to hide_fields(fields, hide_completly) would be needed to reveal_fields()? Something like reveal_fields(fields, see_all)?

Tags: lua

Related branches

Revision history for this message
kaputtnik (franku) wrote :
GunChleoc (gunchleoc)
Changed in widelands:
milestone: none → build20-rc1
GunChleoc (gunchleoc)
Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
status: New → In Progress
tags: added: lua
Revision history for this message
GunChleoc (gunchleoc) wrote :

Attached screenshot shows behaviour of attached branch for the following code in the seafaring tutorial.

plr:reveal_fields(wl.Game().map:get_field(70,46):region(20))
plr:hide_fields(wl.Game().map:get_field(70,46):region(10))
plr:hide_fields(wl.Game().map:get_field(70,46):region(5),true)

Revision history for this message
kaputtnik (franku) wrote :

Here the videos which shows what we currently have. With the attached branch this wouldn't be possible anymore:

https://launchpadlibrarian.net/313650121/random.webm
https://launchpadlibrarian.net/314105026/concentric.webm

Also the related code in the empire scenario 3 by hessenfarmer will not work.

What we need is a function that hide fields completely, regardless of a worker or a building has sight to it. And maybe a function which reveal fields without knowledge of a worker or a carrier has sight to it.

Revision history for this message
kaputtnik (franku) wrote :

Attached the branch which contains the animations so this branch could be found easier and could be used for testing. We can remove the link if there is a solution :-)

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

Fixed in build20-rc1

Changed in widelands:
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.