Project

General

Profile

Feature #802768

Extra remove cause "Enter"

Added by Marko Lindqvist 10 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
General
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

From Bug #780730:
"There wasa semantical messup in what a hut is. In the patch attached (designed for 3.0) the huts are more or less clearly defined as extras with not appear but remove cause, the new cause ERM_ENTER."

huts_by_rmcause-3.1.patch (29.1 KB) huts_by_rmcause-3.1.patch the patch Alexandro Ignatiev, 2019-07-02 09:43 PM
sanyabox.zip (113 KB) sanyabox.zip a sandbox-based ruleset where you must be literate to understand Hermit's papers Alexandro Ignatiev, 2019-07-02 09:46 PM
huts_by_rmcause-3.1.patch (28.6 KB) huts_by_rmcause-3.1.patch barbarians.c without garbage Alexandro Ignatiev, 2019-07-02 10:18 PM
huts_by_rmcause-3.1.patch (28.3 KB) huts_by_rmcause-3.1.patch Alexandro Ignatiev, 2019-07-03 08:05 PM
0048-Add-extra-rmcause-Enter-use-it-for-huts.patch (31.5 KB) 0048-Add-extra-rmcause-Enter-use-it-for-huts.patch Marko Lindqvist, 2019-07-03 08:12 PM
0044-Add-extra-rmcause-Enter-use-it-for-huts.patch (34.4 KB) 0044-Add-extra-rmcause-Enter-use-it-for-huts.patch Marko Lindqvist, 2019-07-04 11:23 PM

History

#1 Updated by Alexandro Ignatiev 8 months ago

I write it here because it's the next thing to consider with these extras. The actual problem with the huts is that AI and autoexplore treat them in a fixed way while the effect is written on Lua and can be anything, maybe some huts should be avoided until something. There is, in fact, just two constants in the code regulating the desire to enter. Also, maybe in 3.1 we should change the callback from hut_enter to a generic extra_remove (like cutting woods in Civ3 that bring shields).

#2 Updated by Marko Lindqvist 6 months ago

Will you prepare the patch?

#3 Updated by Alexandro Ignatiev 6 months ago

If it can wait for like two weeks.

#4 Updated by Alexandro Ignatiev 6 months ago

The patch is ready, huts (outside of map generator) are now bound to rmcause "Enter". As a side effect, now there can be player- and tile-dependent rmreqs (e.g., like in Civ3, we can make any barbarians units HUT_NOTHING); now, rmreqs are documented. If the requirements are since somewhen fulfilled while a unit in effect is on hut, it must step back and forth to make the tribe notice the difference that is maybe not good. Also, a minor fix of autoexplorer - hut-nothing units now don't hunt huts; other fixes (e.g. Civ3 barbarians that pass by huts) are only suggested in the code yet. Another concern is that I have no legacy savegeme to test if something happened around S_HUT but if something bad we can fix it later.

#5 Updated by Alexandro Ignatiev 6 months ago

oops, some garbage left in barbarian.c

#6 Updated by Marko Lindqvist 6 months ago

Why the return value change in sandbox script.lua? We don't want default.lua handling of huts for hermit's place.

#7 Updated by Alexandro Ignatiev 6 months ago

For this very reason. true means that the callback has dealed with the subject and we don't need to call further ones, no?

#8 Updated by Marko Lindqvist 6 months ago

Right. So it's a separate bugfix (not part of extra remove cause Enter), and should go to separate ticket and to be targeted to S3_0 too.

#9 Updated by Marko Lindqvist 6 months ago

  • Status changed from New to In Progress

Marko Lindqvist wrote:

should go to separate ticket

-> Bug #824818

#10 Updated by Alexandro Ignatiev 6 months ago

Here is the edited patch. It also fixes #824708 for 3.1 but I could not separate them.

#11 Updated by Marko Lindqvist 6 months ago

- Rebased to my local patch queue, notably to top of Feature #822933 and Feature #823926
- Made necessary updates to data/ruledit/comments.txt
- Bump network capstring for the new rmcause type
- Restored "generated = FALSE" for Hermit's Place. Map generator should not place them on start
- Minor whitespace fix

#12 Updated by Alexandro Ignatiev 5 months ago

Why restored generated=false? We have deleted the cause "Hut".

#13 Updated by Marko Lindqvist 5 months ago

  • Status changed from Resolved to In Progress

#14 Updated by Alexandro Ignatiev 5 months ago

Also, we probably should test for RPT_POSSIBLE instead of RPT_CERTAIN in unittools.c (note, in my latest diff I changed things). Maybe there can be other requirements in rmreqs that refer to the unit (e.g. a ruleset has HUT_NOTHING aviation that the savages just ignore until it starts to bomb them, but Fighters bomb too weak for it); however, we have possible evaluation in the testing functions and should keep to it.

#15 Updated by Marko Lindqvist 5 months ago

Help bug that even !generated extras are said to be placed by mapgenerator split to Bug #825071

#16 Updated by Marko Lindqvist 5 months ago

- Implement ruleset update part; when freeciv-3.0 ruleset is loaded, EC_HUT extras get ERM_ENTER rmcause
- Bug #825071 changes split out
- Incorporated changes from Alexandro's latest version
- 'generated = FALSE' removed once again from Hermit's Place

#17 Updated by Marko Lindqvist 5 months ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF