Feature - Implemented Slimeling tracking improvements

Edir

Member
As the title says. it shouldn't, since basic meat items will only give slime stacks, no MP.
perhaps a separate 'slime stack'counter could be implemented(though that is a feature request).
 

Lennalf

New member
This is primarily a Feature Request, but I will also mention an extremely relevant bug.

Bug Report:

Currently, basic meat items increment the slimeling's charge counter, but they don't actually provide MP charges. This has been posted once before, but I'm restating it here because it is closely related to the requested features.

Feature Requests:

Slime stack counter
Add a second counter that tracks the number of basic meat items fed to the slimeling. Whenever a slime stack is dropped at the end of combat, decrement this counter by one. This counter could be displayed next to the current one.

Example relay browser text:
Familiar: (~40.0 full, 5 stacks)

If there are currently 0 stacks, it would be reasonable to omit stating "0 stacks", as some HC players simply do not bother with stacks during the course of a run (especially if not under a Muscle sign).

Fullness counter reset trigger
When the slimeling does not display messages during combat, it means he is out of MP charges. When this occurs, reset the slimeling fullness counter to 0. Currently, it is possible to get fewer than the estimated number of charges, which causes a misleading positive balance.


As we all know, the slimeling is extremely popular, so I hope these suggestions will be considered. Thanks!
 
Shouldn't that be "set slimelingFullness = 0", RT?

Shows how much I use the CLI :p

But yeah. I'm actually surprised that basic meat items were included in the fullness counter originally. I also think that the fullness is an integer only (there is a +/- 1 variance in the number of charges, and that's probably what darth saw when he saw the 25 power stuff giving 2 or 3 charges). Just needs more spading, I suppose.
 

heeheehee

Developer
Staff member
Would changing some lines in UseItemRequest.java (3664-3671)
PHP:
		// Estimate Slimeling charges
		if ( id == FamiliarPool.SLIMELING )
		{
			// round down for now, since we don't know how this
			// really works
			if( !item.getItemName().startsWith("basic meat ") && !item.getItemName().startsWith("dense meat ") )
            {
                float charges = item.getCount() * EquipmentDatabase.getPower( item.getItemId() ) / 10.0F;
                Preferences.setFloat( "slimelingFullness", Preferences.getFloat( "slimelingFullness" ) + charges );
                useString += " (estimated " + charges + " charges)";
            }
            else
            Preferences.setInt("slimeStacks", Preferences.getFloat( "slimeStacks" ) + item.getCount() )
		}
and in FightRequest.java (2298-2303)
PHP:
        // "[slimeling] leaps on your opponent, sliming it for XX damage.  It's inspiring!"
        if ( responseText.indexOf( "leaps on your opponent" ) != -1 )
        {
            float fullness = Math.max( Preferences.getFloat( "slimelingFullness" ) - 1.0F, 0.0F );
            Preferences.setFloat("slimelingFullness", fullness );
        }
        // "[slimeling] shudders, makes some gurgling noises, and expels a big glob of... something."
        if ( responseText.indexOf( "makes some gurgling noises" ) != -1 )
        {
            float stacks = Preferences.getInt( "slimeStacks" ) - 1;
            Preferences.setInt("slimeStacks", stacks );
        }
be enough to close this feature request? (Yeah, I'm not really familiar with Mafia's source code, sorry.)
 
Last edited:

slyz

Developer
From the limited testing I have done, any item (not just the "basic meat [...]" items) that has a meat stack as one of the ingredients adds to the slime stack counter, and won't give MP charges.

Correct me if I'm wrong though.
 

heeheehee

Developer
Staff member
Would this be tracing back several steps, or just as a direct component? (Looking at the wiki page, the only equips that have $item[meat stack] as a component are the basic meat items.)
 

lostcalpolydude

Developer
Staff member
I think it just also needs to check for "dense meat " (the bottom of that table of items, using dense meat stacks). Assuming the logic is correct, which I'm not going to try to follow.
 

heeheehee

Developer
Staff member
Fair enough, edited in. (I'm not entirely sure the logic is correct either. I'm just mostly piggybacking off of the existing code.)
 

slyz

Developer
I think it just also needs to check for "dense meat ".
What I observed when working on my Familiar Feeder was that items made from dense meat stacks gave MP, not slime stacks.

Would this be tracing back several steps, or just as a direct component?
Tracing back several steps, so it would include all the items made from "basic meat [...]" items.

I'll try to "spade" this a little more seriously after I break the prism, although it shouldn't take long:
1) make sure your slimeling is empty
2) feed it a barskin hat or something, or a "dense meat" item
3) fight (stasising) until you get MP or a stack
 

Aankhen

Member
I went ahead and put together a patch that tracks slime stacks separately from MP by going back to each item’s base components. I’m not entirely sure that the presentation is ideal:
slimeling.png

…but the functionality is there. :) Note that if no stacks are expected, that part of the annotation will be left out entirely. I’d like to include information about when the next stack will drop; however, I don’t see how to do that without adding a lot of noise and possibly confusing people.

I added a couple of commands (‘recipe’ and ‘ingredients’) that make use of the same ingredients-munging framework:
ingredients.png


Hope this comes in useful.
 

Attachments

  • add-recipes-and-slime-tracking.patch
    20.9 KB · Views: 24

Winterbay

Active member
I love the recipe and ingredients commands. I have no slimeling so not very interested in that part but the commands are lovely :)
 

slyz

Developer
I love the recipe and ingredients commands!

About meat stacks: after a little bit of testing, apparently only "basic meat X" items give stacks, the only exception I found was the Gnollish autoplunger that has a meat stack somewhere among its ingredients.
 
Last edited:

Aankhen

Member
I’m happy to hear that they seem useful. :) I was unsure about the appearance myself: I wanted to create a table (like on the wiki), but (a) the HTML renderer is very rudimentary and (b) for more complicated recipes that becomes very wide very fast anyway. I tried lists of lists too, with the same results. In any case, if it looks usable to you guys, I won’t mess with it any more.

I updated the patch so it matches slyz’s results. I also squashed a couple of small bugs, simplified the code (mostly by weeding out my code’s unintentional NIH-ness) and added more documentation.

EDIT:
I forgot to add that I also put in a ‘slime-stack’/‘slime-stacks’ command to see the numbers in a more easily-understood fashion.
 

Attachments

  • add-recipes-and-slime-stack-tracking.patch
    24.4 KB · Views: 22
Last edited:

Aankhen

Member
Sorry for the double post. I realized I forgot to reset the counters on ascension. Here’s the updated patch.

EDIT:
The patch wasn’t working properly for feeding more than one item at a time. Fixed.
 

Attachments

  • add-recipes-and-slime-stack-tracking.patch
    25.1 KB · Views: 31
Last edited:

HippoKing

Member
Slimeling creep

The slimeling tracking adds the average value of items with a power that is not a multiple of 10. A charge is removed when the slimeling attacks. This can lead to a build-up of 'ghost' charges that cannot be removed because they are not inside the slimeling. This is only a problem when the slimeling is empty yet Mafia is showing it has charges.

My proposed solution would be resetting the counter to zero when the slimeling does not act in combat (indicating it is zero).
 
Another slimeling bug: basic meat stack equipment registers as charges when fed to the slimeling. In fact, it gets turned into slime stacks, not MP.
 
Top