Comments (12)
https://forums.wesnoth.org/viewtopic.php?t=57920
from wesnoth.
Summary of the above forum thread: there's no way to determine "the unit that did the healing". We could probably add a heals event, but it wouldn't have a second_unit.
There are of course other ways to change unit HP such as [modify_unit] but it might be too complex to also trigger on such occasions.
This doesn't really qualify as a "heal", so naturally it wouldn't trigger the event.
from wesnoth.
Ok, this makes sense.
It could have the second_unit in the case of [heal_unit] though, as it is a key of this tag.
from wesnoth.
[heal_unit]
shouldn't really trigger an event, at least by default (it could have a fire_event=yes
option like some other tags if that's wanted). But even then, it shouldn't have the second_unit, because that makes it inconsistent.
from wesnoth.
Yes, heal_unit would then need a fire_event key.
Why does it makes it inconsistent? [heal_unit] already accept filter_second (the second unit is used for the animation).
Unless you mean that on_heal should not have a second_unit. Then I can get behind that if it also triggers on village and rest heal.
from wesnoth.
It's inconsistent if the heal event sometimes has a second_unit and sometimes doesn't.
I think it would make sense for it to trigger on terrain and rest heal, yes. Those combine with healers in any case.
from wesnoth.
I see what you mean.
But this behavior already exists. In the case of a [kill] with no filter_second and fire_event=yes, the last breath event is fired with second_unit being the same as unit (the dying unit)
Line 26 in 28a8959
from wesnoth.
A heal event, if it existed, should have a healer/second_unit sometimes, which would sometimes be self (regeneration), and no healer sometimes (village, potion, etc). So, IMO, second_unit should not be set to unit simply because there's no second_unit.
IMO, [heal_unit] should not trigger an built-in heal event. If the UMC author wants some action taken they can take that action along with calling [heal_unit].
from wesnoth.
But this behavior already exists. In the case of a [kill] with no filter_second and fire_event=yes, the last breath event is fired with second_unit being the same as unit (the dying unit)
That's not the same behaviour you described earlier. It's the exact opposite – there might not be a second unit when you use [kill]
. That's much less confusing than a situation where there usually isn't a second unit, but [heal_unit]
alone passes a second unit in.
IMO, [heal_unit] should not trigger an built-in heal event.
Agreed, that should not be the default behaviour. I think it would be fine to support an optional fire_event=yes
though.
A heal event, if it existed, should have a healer/second_unit sometimes, which would sometimes be self (regeneration), and no healer sometimes (village, potion, etc).
But you're the one who realized that there's no way to choose the second unit from a healing ability. That includes regeneration, as that's essentially just another healing ability. (It uses a different tag for legacy reasons, but as far as I know, the implementation is pretty much the same.) Even rest healing doesn't offer a clear way to choose the healer – you might argue that it should be the unit itself, but what do you do when a unit rest heals and is also healed by a healer, for a total of +6 or +10?
By the way, "potion" is [heal_unit]
. There's no such concept as a potion in the game unless you code it yourself.
So, IMO, second_unit should not be set to unit simply because there's no second_unit.
Yes, there should be no second unit, not the same unit as the primary unit.
from wesnoth.
I understand the argument.
I think it is therefore fine if on_heal has not second_unit as it is not the core of the FR.
Should I edit the first message?
from wesnoth.
Even rest healing doesn't offer a clear way to choose the healer – you might argue that it should be the unit itself, but what do you do when a unit rest heals and is also healed by a healer, for a total of +6 or +10?
Well, first off I would not have rest healing as the only type of healing that is additive, especially since it's really just a minor form of regeneration.
But with the current behaviour, I'd have two events called. The one for rest healing would probably have second_unit=self, though I'd prefer additionally returning a healing type in which case second_unit would not be necessary in this case.
If I was designing healing from scratch, a single healer would not be able to heal from one to six units on a single turn. Most likely, one healer could treat one patient per turn. This would probably have the side effect of making it necessary, or at least very likely, that there would be one healer per patient (if that remained the limit -- outside rest healing -- which seems reasonable). You could have a single healer able to spread those "healing points" over multiple units, and perhaps a single patient be healed a little bit by each of multiple healers, but that's unnecessary complexity for little gain IMO, and it's easy to avoid by simply assuming that there is a short amount of time between turns. But even though this would probably make it easy to give me the heal event that I would really like to have (for me a heal event is all about the second_unit), I have to suspect it's not worth messing with something that is rather fundamental to the way players now expect this aspect of the game to work.
from wesnoth.
I started thinking about possibly making healing deterministic, aka a patient really does have a specific healer (or curer). Pretty easy, you're already searching for and saving the max healing, just grab the healer with it.
Then I figured, keep a count for each healer. Use that as a simple tie-breaker to try to spread the healing around. If patient had already found a healer that can do +8 for them, and you encounter another healer which can also do +8, the healer with the lower count is selected to be the "new" healer for this patient. The idea here is that in UMC some may want to do interesting things with healing (like give XP to a healer for each patient), and the things I can think of would benefit from having the healing spread around between healers. It's also logical, IRL you're not going to have one medic treating all the patients while the other ones sit around and play cribbage.
Then I started thinking about trying to optimize the way the healing is spread around. I quickly decided that this sort of decision sounds a lot like what I would expect the AI to do. The AI should be involved, positioning healers appropriately, and my gut says there would be some overlap between the healing code and the AI's movement code, which is a great excuse to blow it off.
Finally, I got the idea that healing should be (or, have been, given that any such change would probably be huge) an action. Like attacking is an action. Most healers can then heal exactly one patient per turn, it happens on side.turn, and the player/AI gets to choose which patient. I like this a lot more than the current healing behaviour, and I suspect that it would a lot easier on the AI. I can't imagine it would be worth the amount of effort that would be involved as it would throw the balance of the game way off (at least for players like me who rely heavily on healers), but if there ever is a major change to healing I think this is an idea worth considering.
Discussion on healing: https://forums.wesnoth.org/viewtopic.php?t=58380
from wesnoth.
Related Issues (20)
- [replace_map]map_file= might try to send the file from a client which does not have it HOT 3
- gui.show_dialog error quits to main menu
- MP Report dialog improvements
- World Conquest fails to start HOT 17
- Inconsistent volume handling after #9151 HOT 10
- Crash on Lua error HOT 6
- dynamic add-on [options] HOT 3
- special_type_active weapon filter not working HOT 13
- MP lobby chat log opens at first instead of last message HOT 11
- wesnoth.interface.select_unit(nil) unexpected behavior HOT 2
- [drawing] with empty [draw] causes assertion failure HOT 1
- window layout error reports incorrect available size when requested size is negative HOT 2
- Animated terrain graphics play at accelerated speed when coming on screen
- Walking Corpses have -40% arcane resist
- events with negative priority don't survive save / reload cycle HOT 11
- Scenario editor, unit facing, game crash HOT 8
- Pick advance: do not use [set_menu_item] in preload
- Units/Monsters: Promote Fire Dragon to Level 5 Status or Demote to Lesser Level 4
- wesnoth.simulate_combat virtual unit unexpected outcome HOT 1
- UtBS S1: bad_function_call exception thrown in turn_end event HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wesnoth.