Latest Posts

Topic: Geologist Sign posts

littlekatana
Avatar
Topic Opener
Joined: 2021-10-30, 16:43
Posts: 29
Ranking
Pry about Widelands
Posted at: 2021-11-17, 00:54

While I know people are onto the idea that geologist sign posts don't last long enough to be useful, and there's consideration of extending the time, I would like to suggest that they be permanent and that, to keep visual clutter to a minimum, they have a vision toggle, just like the other flags and building size spots.


Top Quote
tothxa
Avatar
Joined: 2021-03-24, 12:44
Posts: 434
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-11-17, 01:12

littlekatana wrote:

While I know people are onto the idea that geologist sign posts don't last long enough to be useful, and there's consideration of extending the time, I would like to suggest that they be permanent and that, to keep visual clutter to a minimum, they have a vision toggle, just like the other flags and building size spots.

Don't forget that the resource amounts will decrease when a mine is working nearby. I don't think it would make sense from an in-game point of view to update the signs regularly without sending a new geologist. But then how would the geologist judge whether a given sign is old enough to reexamine? Well, maybe the signs could be removed when a mine is built that is able to mine the marked resource.

Anyhow, it has always been part of the game mechanics that the markers decay (way back from the original Settlers).


Top Quote
littlekatana
Avatar
Topic Opener
Joined: 2021-10-30, 16:43
Posts: 29
Ranking
Pry about Widelands
Posted at: 2021-11-17, 17:37

This I did not know.

So couldn't you have a mechanic where posts that change disappear and need to be researched by the geologist, but posts that have undergone no changes stay? Also including the vision toggle.


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1927
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-11-17, 18:10

Resource indicators are technically immovables just like trees, rocks etc. The geologist checks what resource is present in which quantity at a given spot and then places the appropriate immovable, but there is no logical connection between a resource and an indicator, so auto-updating is not possible.

Letting the building visibility toggle also toggle the visibility of immovables (though it would have to be all immovables) sounds good to me.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2021-11-17, 18:54

The first found ore is stored in the message box with the field. Clicking such an entry in the message box scrolls the map to the appropriate field. But sometimes (mostly) one can't imagine where the field is (ok, it's in the center of the screen, anyway difficult to find)

What about marking the spot with an x if one clicks on a message in a message box?

Maybe this isn't the best spot for a mine, but i would prefer to have an x instead of endless visible resource markers.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1927
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-11-17, 19:29

Geologist messages behave like the out-of-resource messages for buildings or the status messages of ships: They are associated with a particular map coordinate, and you can quickly centre the view on the associated node. Highlighting the node when jumping to a message's location would be useful, IMHO. Not just for resource messages but also for all other messages with an attached position; e.g. for out-of-resource notifications it's often hard to see at higher resolutions which of the numerous mines is the one the view is now centred on.

I'm not sure about the visibility of an X – this would need to be tested. Another idea could be a semi-opaque red rectangle that fades out after two seconds. What's annoying sometimes though is that when I use the message window to jumo to a location, the message window (which opens in the centre of the screen by default) obscures the very location I'm trying to view face-wink.png


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1927
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-11-17, 19:31

By the way, when looking at the code I noticed that the geologist message is bound to the geologist who sends it. This means that just as a message from a building is automatically deleted when the building is destroyed, the resource message will be deleted automatically when the geologist dies. Bug or easter egg?


Top Quote
tothxa
Avatar
Joined: 2021-03-24, 12:44
Posts: 434
OS: antix / Debian
Version: some new PR I'm testing
Ranking
Tribe Member
Posted at: 2021-11-18, 23:17

Nordfriese wrote:

Resource indicators are technically immovables just like trees, rocks etc.

Hmmm... Immovables are defined and controlled by lua scripts... buildings too... Could littlekatana's request be fulfilled by an addon?

The indicators' lifespan is defined in their init.lua-s, so I guess it would be trivial to create an addon to make them live forever. But we still need some script to remove them when the marked resource is touched by a mine.

I don't think it's possible to execute any lua script when a building is started or completed. But after all, that's not enough anyway, because a new geologist could place new indicators within the work area of an existing mine.

I'm not sure whether it's possible to find and remove the resource indicators within a mine's working range in the production program. Is it allowed to access field objects from a production program? And how can the production program get the building's own coordinates?

From the way resource consumption is defined in the buildings' init.lua, it looks like the spot where the resource is taken from is determined by the C++ code. If so, then it's not possible to remove only the affected indicator from lua. So it would be all of them on any successful production. Would it be too slow to iterate over all fields? Atlantean and Frisian mines have large work areas...


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1927
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2021-11-20, 13:52

Productionsite programs are not real Lua code, they only offer an extremely limited set of defined features which are implemented in C++. So any sort of complex logic is not possible there. An add-on script would probably be the way to go here – you could get the initial and current amount of resources at a node and replace/remove the resource indicator immovable that's present there. Detecting mine placement and completion can be done by repeatedly iterating the map and keeping track of which mines you previously found. Iterating over all buildings of a type and over all fields in a workarea should be pretty fast. Some of these features would require the possibility to be added in C++ first (e.g. changing the immovable's main program) though this should not be hard.


Top Quote