Bug - Fixed Only unique items contribute to Clowny

fronobulax

Developer
Staff member
This might be something that was introduced when Clowny was introduced for TCRS

r19290

balloon helmet, bloody clown pants and 2 big red clown noses equipped. All the individual items show the expected Clowny modifiers (so I don't think this is a TCRS issue). Mafia reports "Clown: 4/4" but attempting "Adventurer, $1.99" fails and tells me I am only 75% Clowny. The wiki says

Your total Clownosity is determined by adding up the individual Clownosity of each unique item (i.e, dual-wielding clown whips grants 2 Clownosity, not 4) currently being worn:

If still true, as I expect, then mafia (and the maximizer?) should understand that the second clown nose doesn't increase Clowny.
 

Veracity

Developer
Staff member
Also surgeonosity - which is (still) a numeric modifier. Wiki:

Occurs with half-size scalpel, head mirror, surgical mask, surgical apron, or bloodied surgical dungarees equipped. Equipping multiple different items increases the chance of the adventure occurring, with an additional 10% chance for each unique item equipped (starting at 0%, capping at 50%).
"surgeonosity 6 min"

suggested I equip 2 half-size scalpels, surgical apron, bloodied surgical dungarees, and 3 surgical masks which gave me (supposedly) 7 surgeonosity.

"surgeonosity" suggested the same thing.

In run, using only things you have, presumably it would not suggest duplicates.
 

ckb

Minion
Staff member
Just tried my Nemesis script with r19294 in aftercare, with lots of clowny items in inventory.
'maximize 4 clownosity' equipped 2 clown whips, so I can confirm this is a bug.
 

Veracity

Developer
Staff member
Revision 19295 adds a "Uniques" section to modifiers.txt. It looks like this:

Code:
Unique	balloon helmet/clown wig/foolscap fool's cap/bloody clown pants/clownskin harness/balloon sword/clown whip/clownskin buckler/big red clown nose/clown shoes/clownskin belt/polka-dot bow tie	Clowniness
Unique	bloodied surgical dungarees/surgical apron/half-size scalpel/head mirror/surgical mask	Surgeonosity
I don't use this in the Maximizer, yet, but it's the data that will be needed: if you are maximizing for a Modifier which appears in the "uniques" map, the set of items should be treated as Single Equip.

I didn't code the Maximizer portion since I have no idea how it works internally. Should be a "simple matter of coding™" but I have other things I want/need to work on first.

And code that counts Clowniness/Surgeonosity from your equipment should also take this into effect...;)
 

Darzil

Developer
May be challenging, as Maximizer doesn't do it's calculations based on items, but on modifiers. I suspect I know why it used bitmaps . . .
 

ckb

Minion
Staff member
If this is challenging to code correctly, maybe it would be beneficial to treat this the same a 'Single Equip' for now, given that the Clowniness and Surgeoniness is likely way more important that maximizing the enchantments that these items have.
 

Veracity

Developer
Staff member
May be challenging, as Maximizer doesn't do it's calculations based on items, but on modifiers. I suspect I know why it used bitmaps . . .
How does it deal with Mutexes? I.e. multiple items only one of which can be worn? In some sense, each Unique item is in a Mutex with itself...

As ckb suggests, perhaps the Maximizer could assume any item that provides "Clowniness" or "Surgeonosity" (which never was a bitmap) is inherently Single Equip.
 

Darzil

Developer
Perhaps as a slight tweak to that, perhaps maximizer should assume that they are single equip, if the maximization includes that term.

We'd need to do something cute for the side pane display, probably.
 

Saklad5

Member
r19295, I assume. Clever solution, Veracity. The “Uniques” approach might also be useful for cleaning up hardcoded item synergies or something.
 

Veracity

Developer
Staff member
THanks - although it's not a "solution" yet, since the Maximizer doesn't actually use it yet. It's a tool intended to enable the solution.
 

Veracity

Developer
Staff member
I was hoping Darzil would look at this, but since not, bumping to 1st page to remind me to see if I can figure it out. :)
 

Veracity

Developer
Staff member
Perhaps as a slight tweak to that, perhaps maximizer should assume that they are single equip, if the maximization includes that term.
Revision 19433 does that for Clowniness and Surgeonosity, which are both numeric modifiers.
There is special code to support "Clownosity", which I did not touch.
Perhaps it would be as simple as looking up the "Uniques:Clowniness" set of items and adding them to the "uniques" set I added.

I did some refactoring to enable this, so am leaving this open to see how it behaves in the wild.
 

fronobulax

Developer
Staff member
I set up some cases with 19434 and the maximizer seems to understand uniqueness. I equipped two of a +2 accessory and it swapped one of them out for a +1, as expected.

When I maximize for something and then execute all of the suggestions or highlight some and execute them, I expect the maximizer display to update and things that "won't make a difference" are grey'd out and things I could do are "normal". After maximizing on "clownosity" the updated display had suggestions, all of which reduced clownosity. This was unexpected but may be operator error. In Ye Olden Days the maximizer really didn't care about clownosity greater than 4 and if you had a reason for wanting it you needed to pay attention to the maximizer string. It may be that what I am seeing is the "correct" behaviour since clownosity was 9 or 10.
 

Veracity

Developer
Staff member
Nothing has changed in how Clownosity is weighted. If you don't specify, it gives it a weight of 4 - which is the "desired" osity. But, the "weight" is treated differently than other modifiers:

Code:
			if ( keyword.equals( "clownosity" ) )
			{
				if ( m.end( 2 ) == m.start( 2 ) )
				{
					// No weight specified, so assume 4
					this.clownosity = 4;
				}
				else
				{
					this.clownosity = (int) weight;
				}
				// Clownosity is built on Clowniness and has
				// same unique items requirement.
				this.addUniqueItems( "Clowniness" );
				continue;
			}

			if ( keyword.equals( "raveosity" ) )
			{
				if ( m.end( 2 ) == m.start( 2 ) )
				{
					// No weight specified, so assume 7
					this.raveosity = 7;
				}
				else
				{
					this.raveosity = (int) weight;
				}
				continue;
			}
As descibed in the comment where it evaluates the "score":

Code:
		// special handling for -osity:
		// The "weight" specified is actually the desired -osity.
		// Allow partials to contribute to the score (1:1 ratio) up to the desired value.
		// Similar to setting a max.
		if ( this.clownosity > 0 )
		{
			int osity = ( (int) mods.get( Modifiers.CLOWNINESS ) ) / 25;
			score += Math.min( osity, this.clownosity );
			if ( osity < this.clownosity )
				this.failed = true;
		}
		if ( this.raveosity > 0 )
		{
			int osity = mods.getBitmap( Modifiers.RAVEOSITY );
			score += Math.min( osity, this.raveosity );
			if ( osity < this.raveosity )
				this.failed = true;
		}
Apparently, when you were offered more than +4 worth of clownosity items - and equipped more than +4's worth - when you maximized again and it chose to keep +4 worth of items, everything past that was valued less, or something. I do not understand the evaluator.

In any case, nothing changed to make me think that what you described is different than how it worked before.

(We might also consider updating to have "surgeonosity" work the same way, although you are much less likely to ever have more than +5 available in-run when you need it. Not that affects my play-style, since I never maximize on that; I simply equip each item as I get it (which provides an additional 10% chance to get the boss) and frequently fight the boss before I have found all 5 items. In fact, I have fought him the very next round after equipping the first item.)

Unless we want to expand the scope of this to add code to treat surgeonosity like every other -osity, I think this is done.
 

Veracity

Developer
Staff member
Yeah, I did that in revision 19435. Surgeonosity with no weight defaults to 5 - and, as before, even if you have 3 accessories (of the 2 possibilities), it will only suggest 2.
 
Top