Scouts are a sore point of this game.

Bug #1656664 reported by Teppo Mäenpää
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Undecided
Unassigned

Bug Description

Currently, occasionally one needs a scout to attack the enemy: Enemy has a large military building, and player only small ones at the front. Building more military buildings might be impossible because of geography or other reasons.

Scout visits the enemy military sites very infrequently. When the scout is in the vicinity of an enemy building, the building is often attackable only for few seconds. This forces the player to vigorously monitor his scout, and be prepared to attack in the small window of opportunity. This is bad.

More verbose descriptions at

https://wl.widelands.org/forum/topic/2792/

Tags: military

Related branches

Revision history for this message
Teppo Mäenpää (kxq) wrote :

Currently, the scout is just a worker. Should it be a class of its own?

In my mind, this could open some new opportunities: The scout could have a memory, to sensibly share his efforts between exploring unseen areas and stalking the enemy.

Of course, this is not necessary and one could just add more variables to the plain worker class (like "this is the military site I am currently observing"). Would just make the code a bit prettier imo.

===

The scout could also play a new sound when he is starting a picnic near points of enemy military presence. This way, the player would know when he should shift focus to attacking. Opinions?

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

There is some overlap and previous discussion in bug 1427531 and bug 794483.

Revision history for this message
GunChleoc (gunchleoc) wrote :

We discussed in the forum that increasing the scouts' vision range would be a good stop-gap measure until we can implement something better.

https://wl.widelands.org/forum/topic/2792/

tags: added: military
Revision history for this message
TiborB (tiborb95) wrote :

It is very unclear what changes should be done.
Scout can be programmed to visit only vicinity of militarysites - but this will not satisfy all.
Scout can be programmed to "re-visit", but probably only vicinity of militarysites not all fields.
Or do we want three categories of target fields:
- vicitnity of enemysites
- other enemy territory
- all other not-mine territories.

Probability of visit would be higher up to the list, and fields in close vicinity of militarysites would allow revisit....

Your opinions?

Revision history for this message
GunChleoc (gunchleoc) wrote :

I think we should start with the smallest change, then work ourselves up the list until we're happy. e.g. increased vision range first, then stopping for a bit at militarysites. Leave the rest for later after some testing has been done by players who use scouts often.

Revision history for this message
TiborB (tiborb95) wrote :

The scout works the way it picks a field then goes to there. So I can add logic that if the field is in vicinity to enemy military site (radius 3 e.g.) it will wait there for some time. However please understand that it is not when it "passes by", only when target field is close to military site.
FTW can I save some values to act parameters? Scout is using only two of them.

Revision history for this message
Teppo Mäenpää (kxq) wrote :

I thought that if one makes the scout to be a child class of worker, then it would be possible to add some memory to the scout, like "am I scouting random unrecently-seen spots, or going for enemy military sites", and which military site he is circling around etc.

This way, the scout could also emit a new sound when he decides to *start* a trip towards an enemy site. If such sound comes early, the player knows that it is time to stop minding the economic hotspots and focus on frontline, and be prepared when the window of opportunity arrives.

Technically, it would be possible to add variables like that to the worker class too, but that would be unaesthetic to my eyes.

Revision history for this message
TiborB (tiborb95) wrote :

It looks like big change - for my skills :(

Revision history for this message
Teppo Mäenpää (kxq) wrote :

Adding the class is just some dull work: Need to mind loading and saving, too.

Figuring out a way to get a list of
- other tribes' military buildings
- in working range of this scouting hut
- known to this tribe
- unattackable (vision range)
- in range of at least one own military building
- allies excluded

might take a while. I do not even know which terms the code uses for these things. The rest is straightforward.

Revision history for this message
TiborB (tiborb95) wrote :

But creating that new class is just what I am afraid of.

Revision history for this message
GunChleoc (gunchleoc) wrote :

You will need to have 2 objects - Scout and ScoutDescr. Let their constructors call Worker and WorkerDescr.

Then make a copy of int new_worker_type(lua_State* L); in scripting lua_root and of void add_worker_type(const LuaTable& table, const EditorGameBase& egbase); in tribes.h and the new class should be ready to use.

Finally, add a new type to enum class MapObjectType that you assign to the scout and search the codebase for "WORKER" to check where you need to adapt things. There will be some converter function sin LuaMap that will need a scout added to their switch statement, and we'll need a LuaScoutDescription class as well.

Revision history for this message
TiborB (tiborb95) wrote :

Looks like a fun for many hours, I am not sure I want to work on it. Especially when I am still struggling with the new AI.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I hear you. So many projects, so little time...

Revision history for this message
Teppo Mäenpää (kxq) wrote :

I had neglected the lua part -- thanks for pointing out.

Teppo Mäenpää (kxq)
Changed in widelands:
assignee: nobody → Teppo Mäenpää (kxq)
Revision history for this message
Teppo Mäenpää (kxq) wrote :

Since quite a lot of time has passed, I somewhat took advantage of #5: The solution is relatively simle compared to the suggestion, and IMO still solves the original problem without harming other uses of worker class too much (branch linked to ticket).

Revision history for this message
GunChleoc (gunchleoc) wrote :

Thanks! Can you please make a merge request, so that we can review it?

Revision history for this message
Teppo Mäenpää (kxq) wrote :

For reminder: Original feature request in https://wl.widelands.org/forum/topic/2792

Since I have not contributed any code for ~3 years, the linked branch probably breaks many style and other rules that I have long ago forgotten.

Revision history for this message
GunChleoc (gunchleoc) wrote :

That doesn't matter, we can always fix any style guide issues during the code review. Reviewing will be even easier if you change the branch owner to widelands-dev - you're still a member :)

Revision history for this message
Teppo Mäenpää (kxq) wrote :

Changed.

For some reason, I no longer see the merge proposal. However, LP refuses me to make a new one, so supposedly at least some parts of the merge proposal survived the ownership change.

Just in case that the comments don't reappear: How do I talk to bunnybot? What does it nowadays do? Is there a documentation that I could read

Thanks for the comments.

Revision history for this message
Teppo Mäenpää (kxq) wrote :

#19: Now I see those again.

Teppo Mäenpää (kxq)
Changed in widelands:
status: New → In Progress
Revision history for this message
GunChleoc (gunchleoc) wrote :

Ran into a failed assert while testing the branch

Revision history for this message
kaputtnik (franku) wrote :
Revision history for this message
kaputtnik (franku) wrote :
Revision history for this message
kaputtnik (franku) wrote :
Revision history for this message
Teppo Mäenpää (kxq) wrote :

BACKGROUND:
The radius of a scout is "only" 15. Radius is interpreted in a creative way in the old (=random walk) scout code: the maximum distance to visit is always calculated from the current position of the worker instead of his base. Therefore, the scout does visit places beyond radius in random walk mode.

Is this intentional? Should the scout walk past his working radius?

In the attached branch, the scout now visits military sites withing the working area (calulated from building, not from arbitrary position). The maximum conquer radius of a military site is 12. This is less than 15, but, bearing in mind that the scout now only minds military sites within its working radius, is the difference always large enough? Should the scout have a somewhat larger radius, at least when scouting military buildings?

If not, then the scout is demoted, and the price of scouting mission makes even less sense.

WARNING: MORE OPINIONS: Currently, the price of a scouting missions differ: For barbarians, that is raw fish or raw meat or bread (through tavern). For atlanteans, the scout _must_ have smoked fish. If he gets some, then he will also consume some bread (or work slower). At minimum, the atlantean scout should be able to work with bread only if smoked fish is absent. Should we remove the foodstuff from scouts altogether?

Revision history for this message
kaputtnik (franku) wrote :

I think having the scout a deeper look into the unknown area is good, regardless if there are military sites or not. E.g. to find some mountains or other resources. This may help to which direction the own territory has to be expanded.

I have no opinion regarding the food stuff. May ask in the forum, but i think we should not change too many things in one branch. Your branch is a good change at all :-)

Revision history for this message
Teppo Mäenpää (kxq) wrote :

I agree: not in the same branch.

Revision history for this message
Teppo Mäenpää (kxq) wrote :

What about the radius? 15 vs 12 could be a problem in some rough terrains. I did not playtest such maps, would not know even if this was a real-world issue.

GunChleoc (gunchleoc)
Changed in widelands:
milestone: none → build20-rc1
GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Fix Committed
assignee: Teppo Mäenpää (kxq) → 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.