Giter VIP home page Giter VIP logo

Comments (12)

ProditorMagnus avatar ProditorMagnus commented on September 27, 2024

https://forums.wesnoth.org/viewtopic.php?t=57920

from wesnoth.

CelticMinstrel avatar CelticMinstrel commented on September 27, 2024

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.

rodolphecombe avatar rodolphecombe commented on September 27, 2024

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.

CelticMinstrel avatar CelticMinstrel commented on September 27, 2024

[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.

rodolphecombe avatar rodolphecombe commented on September 27, 2024

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.

CelticMinstrel avatar CelticMinstrel commented on September 27, 2024

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.

rodolphecombe avatar rodolphecombe commented on September 27, 2024

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)

if not secondary_unit then killer_loc = death_loc end
. The same could be done for heal_unit (healer would be the healed unit).

from wesnoth.

white-haired-uncle avatar white-haired-uncle commented on September 27, 2024

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.

CelticMinstrel avatar CelticMinstrel commented on September 27, 2024

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.

rodolphecombe avatar rodolphecombe commented on September 27, 2024

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.

white-haired-uncle avatar white-haired-uncle commented on September 27, 2024

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.

white-haired-uncle avatar white-haired-uncle commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.