remixed-dungeon
remixed-dungeon copied to clipboard
When fighting a frightened rat, some weird symbols appear
If a rat is frightened because I'm wearing a Giant Rat Skull, and I do chase it and fight it, the symbols #$%^
appear in red above the damage number each hit. Can't screenshot it because damage points don't stay there. Version - v remix.26.fix.4
It is rat reaction to moving from Fear (due to Fetid Rat Skull) to Anger(due your attack) and back again...
So this is not a bug? Certainly looks like it.
One possible solution is to add "permanent" flag for Terror caused by Ratter aura.
Do you want me to try and do it and pull request? I can definitely try, but I'd be happy if you give me some pointers - line numbers etc.
P.S. Можно по-русски.
O its will be great!
Bellow is good places to start: com\watabou\pixeldungeon\actors\mobs\Rat.java Rat.canAttack com\watabou\pixeldungeon\actors\buffs\Terror.java
P.S. Можно и по-русски
It's not a bug - it's the rat saying a curse word. It's censored to keep the game child-appropriate.
Thanks for the explanation @DatBoi287, I would suggest to change it to something like F$%K, so it can be understood by others. It seems like you're the only one to get this. Also, maybe it's not right for a rat to curse, since it's incapable of speech. Thoughts?
This is Giant Marsupial Rat from highly magical world.
I like the joke :)
I want to revisit this issue. As I see it there are two things:
- The
#$%^
is not clear - it might be just me, but I couldn't understand this means curses, or that it means the creature is angered. (This is minor) - The fact that the creature is angered on each hit when there is a terror aura.
My thoughts:
- Change the anger string to something else, like
F$%K
or😡
(Unicode smiley, although in the current font it doesn't look too angry), or maybe add a log message "The rat gets angry!". - Contrary to @Mikhael-Danilov's suggestion to make Terror from Ratter permanent, I believe that the rat should stay angry for some time (or even forever once attacked). Real-life creatures, even when scared, when provoked, will attack back. So making terror permanent will result in a creature that gets punished and doesn't do anything about it.
- These are details though, either way should be good.
- I also understand that this is a Giant Marsupial Rat from highly magical world and might not adhere to the real-world examples.
Let's discuss this further so we can find a solution.
EDIT: Nethack has an interesting approach to this - https://nethackwiki.com/wiki/Scare#Effect They have 2 different but connected statuses - scared and fleeing. Worth a read.
- I strongly against "Fuck" or similar words in Remixed. Because we must keep the game child-appropriate. And being translated to other languages this word can be... translated too creatively...
1.a Using unicode can be an option ( but this requires fixes for pixel font ) 1.b Adding log message looks like good addition ( log will be too spammy with it? or not? )
- PD creatures behavior much simpler what nethack monsters (let leave real-world creatures alone for now) They have following ai states: SLEEPING,HUNTING,WANDERING,FLEEING,PASSIVE. (Some mobs have more complex behavior but it implemented by overriding methods such as getCloser & canAttack - which is bad in comparasion to new ai state imho )
Terror buff works simple as follows: if (buff instanceof Terror) {setState(FLEEING);}
For partial solution we can do not aplly Terror buff for already fleeing Rat ( check Rat.canAttack() )
Or for more complete and complex sollution we can introduce new ai states.
- Agreed against curse words. a. How hard are the fixes? Maybe until we agree on the logic this should be postponed. b. I agree that the log might be too spammy, so first the correct logic has to be in place. If it is good, it shouldn't spam the states and we can add the log messages safely.
- Can you explain what will happen if we go forward with the partial solution of ignoring terror if fleeing?
- Introducing new AI states seems both complicated and risky, at least to me. What do you think?
Anyway when I have time I'll start experimenting with this.
a. We need add corresponding smile to pixel font, should be not too hard. b. Agreed. 2. Terror will be applied much less often, curses too. 3. In my opinion new AI states can make code clearer, and mobs smarter, so for me this is preferred way.
Agreed to go forward with a new AI state. I guess a good one is SCARED. In that state the mob will attack only if it can't run away from the hero. What do you think?
Maybe a good start will be to draw the finite state machine diagram of the current implementation (or other representation like a text description of it), and the proposed one so it's easier to follow.
Roughly it looks-like this:
ANY -terror> FLEEING ANY -attacked> HUNTING ANY -lullaby> SLEEPING HUNTING -target lost> WANDERING SLEEPING,WANDERING-target spotted>HUNTING
So this is the current one:
Generated with GraphViz using this code:
digraph finite_state_machine {
rankdir=LR;
size="10,10"
node [shape = circle];
PASSIVE, HUNTING, WANDERING, FLEEING -> SLEEPING [ label = "lullaby()" ];
PASSIVE, SLEEPING, WANDERING, FLEEING -> HUNTING [ label = "is_attacked()" ];
PASSIVE, HUNTING, WANDERING, SLEEPING -> FLEEING [ label = "terror()" ];
HUNTING -> WANDERING [ label = "target_lost()" ];
SLEEPING, WANDERING -> HUNTING [ label = "target_spotted()" ];
}
What do you think the SCARED should look like here?
Thanks for great state graph!
I believe we should look at Thief class: https://github.com/NYRDS/pixel-dungeon-remix/blob/6611f3c22a5902265fb72c60673ca3c4bf287d3d/PixelDungeon/src/main/java/com/watabou/pixeldungeon/actors/mobs/Thief.java
It is privately extends FLEEING state to something very similar to proposed SCARED state. Maybe it worth to reuse it?
I'm frankly having hard time keeping all the info in my head for this discussion, sorry if you'll have to explain some things several times for me.
The code you're talking about:
private class Fleeing extends Mob.Fleeing {
@Override
protected void nowhereToRun() {
if (buff( Terror.class ) == null) {
getSprite().showStatus( CharSprite.NEGATIVE, TXT_RAGE );
setState(HUNTING);
} else {
super.nowhereToRun();
}
}
}
Does this mean "If I have nowhere to run and am not terrified, start HUNTING" behavior? Or is there something else?
It is. it is not SCARED as is due to 'terrified' part, but close enough.
Great. I think it might be good to have something similar as well. First thing that I thought:
-
Scared
state will inherit fromMob.Fleeing
- If I am scared, I am fleeing, but if I am not scared I can still be fleeing for other reasons.- This will introduce structure to the AI States
- On the other hand, this will introduce complexity and might interfere with some other code - if there are
instanceof Fleeing
lines, they will catch Scared as well and it might introduce bugs.
- Once I am
Scared
but have nowhere to run, I will startHunting
.
I'm still not sure how this will integrate with Ratter Skull and whether it will solve the flipflops of the states we have now (Fear <--> Anger). I mean that it might introduce another flipflop - SCARED <--> HUNTING
.
Sorry for delayed reply.
Scared may or may not inherit from Fleeing (in my opinion ai states should be not related by inheritance)
Not sure if it is possible to completely avoid flipflops scenarios but it worth to try to mininize chances.
For example it may be: Scared -> nowhere to run -> Berserk(immune to terror) or(50% chance) Death from fear.