Code blog: Taint v2

... sit down, kick back and relax, and talk about anything that doesn't belong on one of the other forums.
Aureus
Posts: 968
Joined: Mon Dec 28, 2020 11:13 pm

Re: Code blog: Taint v2

Post by Aureus » Wed May 25, 2022 10:47 pm

Now I modify the messages to also work for female characters. While female channelers don't get taint, there is some mention in the books or maybe RJ interviews (can't recall which) that the female Aes Sedai were only able to cure the effects of the taint for a few minutes at best. I mentioned earlier that maybe in the future there is a Yellow Ajah weave that can temporarily (as in, only for a few minutes) reduce taint, but shifts the taint temporarily onto them. Or maybe not. Maybe this is valuable for an RP event down the line. Or also maybe not. In any case I patch up the "saidin" messages to check for sex.
* HP:Healthy SP:Full MV:Fresh > stat
You are a 17 year old female human channeler.
Your height is 5 feet, 8 inches, and you weigh 169.0 lbs.
You are carrying 0.0 lbs and wearing 0.0 lbs, peanuts.
Your base abilities are: Str:19 Int:19 Wil:19 Dex:19 Con:19.
Offensive bonus: 71, Dodging bonus: 91, Parrying bonus: 28
Your mood is: Wimpy. You will flee below: 172 Hit Points
Your armor absorbs about 0% on average.

You are subjected to the following effects:
- NO QUIT

* HP:Healthy SP:Full MV:Fresh >
Bargle tried to steal something from you!

* HP:Healthy SP:Full MV:Fresh >
You hear faint whispers tickling at the back of your mind.

* HP:Healthy SP:Full MV:Fresh >
*Afriend* leaves west.

* HP:Healthy SP:Bursting MV:Fresh >
You feel the flows of saidar coursing through your body.

* HP:Healthy SP:Bursting MV:Fresh >
*Afriend* looks at you.

* HP:Healthy SP:Bursting MV:Fresh >
Bargle looks at you.

* HP:Healthy SP:Bursting MV:Fresh >
Bargle looks at you.

* HP:Healthy SP:Bursting MV:Fresh >
*Afriend* looks at you.

* HP:Healthy SP:Bursting MV:Fresh >
Mad laughter rings in your ears. You realize the voice is your own.

* HP:Healthy SP:Bursting MV:Fresh >
Bargle looks at you.

* HP:Healthy SP:Full MV:Fresh >
Suddenly *Afriend* places a silver sai in your back!
Ouch! That Really did HURT!

* HP:Battered SP:Full MV:Fresh >
*Afriend* has arrived from the south.

* HP:Healthy SP:Full MV:Fresh >
*Afriend* starts barreling down on you, a shocklance aimed at your chest.

* HP:Healthy SP:Full MV:Fresh >
You sense someone nearby is channeling saidar.
Absently, the thought occurs to you that the flows are your own.
Ok.
The earth trembles and shivers beneath your feet..!
*Afriend* vibrates and is knocked about.
Bargle vibrates and is knocked about.
You'll note that both the embrace and channeling messages reflect saidar accurately. And also there are no additional "taint on saidin" style flavor messages or sickness for embracing -- because even if a female channeler somehow gets tainted, saidar itself is not tainted. The rest functions in the same way.

I also add in some checks for the channeling portions (random seizing saidin, random channeling) that they are actually channelers, and in the latter case that they can touch saidin (ie, are not gentled, in a stedding, etc.). This should solve the ruby dagger concerns I had earlier about the taint not working right for non-channelers. It's still a bit weird that they are both the same, but not something I'm going to spend any real time on given that the ruby dagger hasn't been in the game for years and years, and when it is in the game it doesn't tend to stay long.

Aureus
Posts: 968
Joined: Mon Dec 28, 2020 11:13 pm

Re: Code blog: Taint v2

Post by Aureus » Wed May 25, 2022 10:59 pm

I also confirm that channeling mobs haven't been broken by adding in the taint splash damage, since mobs don't have taint.
* I1 R:1035 S:Inside HP:Healthy SP:Bursting MV:Fresh >
An enormous hunch-backed trolloc hits Cadsuane Melaidhrin's left arm extremely hard.
Cadsuane Melaidhrin's hands begin weaving crystals of water and air...
Cadsuane Melaidhrin unleashes a flurry of icy spikes at an enormous hunch-backed trolloc, who is stabbed repeatedly.

* I1 R:1035 S:Inside HP:Healthy SP:Bursting MV:Fresh >

Aureus
Posts: 968
Joined: Mon Dec 28, 2020 11:13 pm

Re: Code blog: Taint v2

Post by Aureus » Thu May 26, 2022 1:05 pm

I spent some time looking at target selection when the taint makes you channel an offensive weave you didn't intend. Indeed you can channel 'create food'" and because there is no target, most of the offensive weaves like fireball or hailstorm won't work. There is a small chance the target swapping will cause an overlap, but it is too small to really matter. This is problematic since a lot of weaves aren't targeted, or don't have player targets.

So I spend some time digging into the targeting code, and make channeling select a new target if the taint has forced use of an offensive weave, and the player hasn't specified a target, or the target is invalid for an offensive weave (e.g., "channel 'locate obj' heron").
* HP:Healthy SP:Bursting MV:Fresh > s
[seize ]
You feel the flows of saidin coursing through your body.
Sickening, rancid filth seeps into you.
Nausea engulfs you, the world spins around you.

* HP:Healthy SP:Bursting MV:Fresh > cr
[channel 'create food']
DEBUG: taint picking new weave.
DEBUG: taint picking new target.
You begin to weave the appropriate flows...

=
Ok.
You mold flows of Air into a tight stream, and smite Bargle.

<snip>

* HP:Healthy SP:Strong MV:Fresh - Bargle: Hurt > cr asdf <-- trying to use an invalid target here
[channel 'create food']
DEBUG: taint picking new weave.
DEBUG: taint picking new target.
You begin to weave the appropriate flows...

=
Ok.
Streaks of fire flow from your hands, burning Bargle.
Great. What about if I have selected a valid target?
* HP:Healthy SP:Strong MV:Fresh - Bargle: Wounded > cr bargle
You barely hit Bargle's left leg.
[channel 'create food']
DEBUG: taint picking new weave.
You begin to weave the appropriate flows...

=
Someone leaves down.

=
Ok.
Streaks of fire flow from your hands, burning Bargle.
Also very nice. It maintains the original target if there was a valid one. This benefits the male channeler in PK situations (well, usually -- they will still potentially channel the wrong weave, and there's the risk of splash damage). If they are trying to kill someone, I want them to mostly be able to be effective at that.

Hrm, what if I try to target myself? Let's say I am channeling armor and we swap to flame strike instead.
* HP:Healthy SP:Strong MV:Fresh - Bargle: Battered > cr atest
[channel 'create food']
DEBUG: taint picking new weave.
You can not channel this power upon yourself.
Less desirable. So I add a fix for when you targeting yourself, to also pick a new target.
* HP:Healthy SP:Good MV:Fresh > cr atest
[channel 'create food']
DEBUG: taint picking new weave.
DEBUG: taint picking new target.
You begin to weave the appropriate flows...

=
Ok.
You bring together flows of water and air, sending large stones of frozen ice at Bargle.
This all takes about an hour or so, but I think we're in a good spot here.

Aureus
Posts: 968
Joined: Mon Dec 28, 2020 11:13 pm

Re: Code blog: Taint v2

Post by Aureus » Thu May 26, 2022 1:21 pm

I also spent some time re-looking at the taint thresholds. One thing I notice is the chance to become sick when seizing is a bit low in the list, and since this has 3rd party messages it can reveal the male channeler. I move that one a bit further up by swapping it with the % chance of paranoia preventing them from following someone else. I also add a new threshold to the paranoia to account for it being lower, having it trigger less often and then ramp up more gradually. This is just tweaking so only takes ~15 mins.

Aureus
Posts: 968
Joined: Mon Dec 28, 2020 11:13 pm

Re: Code blog: Taint v2

Post by Aureus » Thu May 26, 2022 2:52 pm

And the taint is now complete, so I have committed the code for Itesh and Flash's review. Flash is the ultimate reviewer and decides what gets merged into the primary codebase and what doesn't, but since his time is very limited Itesh and I review each other's code ahead of then and resolve any comments or issues that we happen to catch. This helps eliminate some unneeded back and forth with Flash, and two sets of eyes are better than one.

When I create the "pull request" (think of it as a request for review of the changes, and ultimately for Flash to merge and load the code into the primary codebase), it lets me know there are 2 merge conflicts. This means that the primary codebase has been updated since I first started this project -- which was quite a while ago, I had just not had any time to make any progress other than setting up the code branch for it -- and Github has gotten a bit confused and doesn't know how to automatically merge these conflicting versions of the codebase together. Normally it will try to do this on its own, but when it isn't sure how to do this it will kick it back to the coder to manually resolve. I look at the merge conflicts and it's pretty simple: just some newly declared variables and it isn't sure in which order to put them. I manually edit the code in both files so the merge conflicts are resolved.

Now, the code is complete and ready for review. The next step is Itesh will take a look at it and give any comments. Then it will only need Flash's review. Since it's a very large set of changes, it's likely that it will go to the back of the queue for Flash: he's super busy and his time is very limited and so he tends to prioritize smaller changes, which are easier to review, over larger ones. It's possible he will have comments, questions, or ask for me to make some changes (very likely for a set of changes this large) and so that will also lengthen the time it takes to get it approved and merged.

So at this point we are in the waiting phase. My guess based on the number of other changes in the queue (27, including this one) is we're looking at ~3 to ~6 months.

It's worth noting that all-in, I've spent ~20-30 hours on this project. This has included a lot of testing to try to make sure nothing goes wrong (if the game breaks, Flash gets called in and this is a huge imposition, so we try to test thoroughly), but large and complex code changes always come with a high risk of bugs, especially as one person (me) manually testing things is very different from the entire playerbase trying novel and unexpected combinations of things. I've been fortunate this week has been slow, but you can get a sense for why code changes are infrequent and take a long time.

Anyway, that concludes the code blog. Hope you've enjoyed. I will update as the review process progresses, but I'm looking forward to seeing the new taint in action! (It's also occurred to me it's time for me to go stat a new MC...)

Cheers!

Melkor
Posts: 21
Joined: Thu Mar 17, 2022 6:46 pm

Re: Code blog: Taint v2

Post by Melkor » Sat May 28, 2022 6:16 pm

Just curious if travel or gate is included, would be funny if your trying to fstrike someone beat, and then you teleport into a city your warrented in.

Reyne
Posts: 1418
Joined: Wed Mar 08, 2017 2:46 am

Re: Code blog: Taint v2

Post by Reyne » Mon Sep 05, 2022 1:29 pm

The changes you've coded and proposed seem like they will make the high-taint MC play experience to be competitive in PK but as a trippy experience that really will keep them on their toes. I also like the possibility of doing "splash damage" so they're more likely to harm innocent mobs and can also essentially increase their damage output against multiple targets, especially when using an AoE weave like Sonic Boom or Earthquake.
I agree with Sarinda; this looks very cool. Encourages the character to not just get shelved when they get tainted.

I imagine the Red Ajah will be a bit busier.

Post Reply