Feature - Implemented Checking for unknown monsters

Theraze

Active member
Currently, the check for unknown monsters is looking for stats that are set to 0. Which was great, until Manuel came along with his 'factoids' about the sleeping knob goblin guard apparently having stats of 0. Grr.

If unknown monsters could read as -1 instead, it would clearly differentiate which monster stats are unknown and which are just laughably weak. Until TPTB add a monster with negative stats. :)
 

lostcalpolydude

Developer
Staff member
Until TPTB add a monster with negative stats. :)

-ML things can lead to that happening. Apparently those monsters actually have negative stats in that situation, and take damage as their negative stats would indicate. A reliable check has to be something other than monster attack/defense, possibly something new. Or maybe monster HP.
 

roippi

Developer
I've been thinking (okay, eleron keeps complaining, and I'm somewhat in agreement) that we need a broader overhaul of the data files in this regard - this issue is not specific to monsters.txt. i.e. When we enter new fullness/drunk info, we initially put things in as 0; but 0 fill items do exist, so this is wrong.
 

Catch-22

Active member
I could've sworn I proposed "null" data not too long ago, somewhere, for something, but I can't find it now so maybe that was for something else (I distinctly remember linking to the Wikipedia page on null though).

From a database perspective, null makes the most sense as being the value for "unknown" data and it wouldn't require an overhaul to the actual data files themselves (just use null instead of zero). There's not supposed to be null in ASH though (even though it's still possible to generate them), so the information would need to be conveyed in some other way to ASH scripters.
 

roippi

Developer
I think we could just use -1 instead of 0 for unknown monster data with no issue. A little goofy with drops using 0 for unknown, I suppose?

My true preference would be to use some other symbol - "null" or ? or whatever - to denote unknown data, represent that as null internally, and figure out what should be passed to ash from there. -1 or -MAX_INT or...?
 

zarqon

Well-known member
Presently we can check the raw_<stat> monster proxy record fields for stat information which is unaffected by ML adjusters, meaning that this feature as requested does in fact make the information available which it intended.

Using the proxy record fields doesn't presently work for any of the monsters with formulaic stats, such as basement monsters or scaling holiday monsters, because these also have raw stats of 0. Thus, implementing this feature would have the dual benefit of allow us to easily distinguish unknown monsters (-1) from both formulaic-stat monsters (0) or known monsters with stats of 0 (also 0).

-1 would be preferable to -MAX_INT for me.
 

Bale

Minion
-MAX_INT would be better because stats actually can go negative if subjected to negative ML adjustment.
 

zarqon

Well-known member
The first sentence of the post before yours explains why -1 is also OK. It comes down to preference -- or some other functional difference I'm not aware of -- but either value would allow us to accurately detect unknown monsters.
 

Bale

Minion
oh. Sweet.

I mean, yeah. I saw that. I was just messing with you. Don't stare at me that way!
 

roippi

Developer
Alright, as a heads-up, I am making the following changes:

Unknown stat values in monsters.txt will become '?'
Unknown drop rates will remain 0
Internally, ? parses to null
When ash asks for the value, null will turn into -1.

I'll push it in a couple of days if nobody has objections.
 

Theraze

Active member
Just checking... if something isn't defined, such as the monsters that don't have initiative defined (most of them), does that resolve to ?/null or 0?
 

roippi

Developer
I have no idea how initiative works now. Is unknown 0? Is that a thing people even check since it's so badly spaded?

ASH will always receive an int, and ? and null are not ints. I can make it -1 or 0 or whatever it returns right now.
 

zarqon

Well-known member
Thanks roippi! If it were better spaded, I could imagine a use for checking the initiative value (predicting combat outside of combat), but I am not currently aware of any such script -- nor of any imminent plans to create one. "Whatever it returns right now" ought to be fine for quite a while, unless you'd rather go with -1 for consistency with the other stats.

@Bale: *attempts to avert gaze* *fails* *unequips Juju mask* *averts gaze*
 

roippi

Developer
So hilariously, halfway through implementing this I realized it's infinitely easier if I just replace it with.. nothing. Like actual nothing, as in no text. I can change 3 other lines of code elsewhere and I'm done. Ash will still get -1 for the three raw_ proxies.

I'll probably do that unless there are objections.
 

zarqon

Well-known member
Thanks! Better quick spin BatBrain and BatMan RE updates so people can stop using unknown_ml against scaling monsters. Will do that when I get home from work today.
 
Top