#Verifying Engine Stuff for XML and Lua definitions
1 messages · Page 1 of 1 (latest)
oh i cant delete thread nvm
thread where ima dump stuff i find in CC's code and ask engine people (probably nathern) whether its real
nathern
your title is too long give me something better
the title was "is this real?" though
i ask you to make it more searchable
that was moreso the desc that got deleted when i tried remaking the thread
oh, uhhh hold on
the problem is that the thread search bar only finds titles
yeah sure
this seems p real, XML defs seems p wrong
on CellData, found this, it appears to be referenced in the engine and used by one material in base game
lua comments in XML code my beloved
it parses the official doc, so a lot of stuff is missing
manually redefining is pain
goot it, makes sense
unfortunately relying on Nolla is bound to have consequences
was staring at this for a few minutes trynna figure out what was wrong, and then realised squirrelly forgot to establish this as an entity lmao
uh- hm. okay so maybe CC does have some questionable code lurking in every corner, perhaps.
some of these i could maybe make a PR to fix since even i know some of these are real
(this is in workshop.xml)
it was entirely ignored
needs separate json i think
same with mod.xml
wdym it was 7 months ago 
what was 7 months ago?
mod.xml is correct, it already accounts for that, but workshop has the same fields + tags, and then compatibility.xml is just _format_version and version_built_with i think
active dev was 7 months ago
guh? ig it was january i saw you guys doing that
but wow it really took me 7 months to get around to adding this to my workspace 😭
love playing "spot the problem", its the second underscore lmao
this doesnt show up in-game but somehow CC knew it existed? idfk lmao, on GameEffectComponent
does it even work?
no clue, its empty in CC so ima assume this- oooo this is from me copying XML using CE, thats interesting
iirc it's used to unpoly the entity
that also means this is seemingly canon?
lol
which like, you can just do e notation in here???
try it with regular hp, idk
i think the issue is that theres more than one entity in the file, but like i think thats valid? added to the list of stuff i wanna test
at the end of all this im gonna list everything into categories like
- stuff i can probably correct
- stuff i can probably test
- and stuff i need nathan to verify
it might be ordering issue
xsd is not ideal
cant tell if this is us messing up formatting or what but ill make a note to return to this later
cuz ik this works, but we might implement it weirdly
biome stuff is unimplemented too iirc
hole_image is fake
amusing how much of it there is lmao
config should be a real object
stains_image is also fake
you mean config_explosion itself? yeah
lmao
p sure this is real
ah, i mayve picked up some bad habits from Arcane Alchemy
it's probably just 0x088CC316
is this not a real thing on CellData ParticleEffect?
but probably should write fully
i don't think we parsed materials fully
it's almost entirely manual
that makes sense, if there was good documentation for materials, the file would be sane
hmm. perhaps i was too harsh on nolla.
magic numbers arent real 🗣️ 🔥
that... okay fair.
is this xml validity debunking
make xsd great again
basically yeah, i was going through CC with the new fangled (7-month-old) XML definitions and noticed some stuff was amiss
so im documenting my journey through here and then im gonna fix the XML definition stuff i can fix, test the stuff im unsure about and cry to nathan about the esoteric engine things that need verifying
also a thousand years, one thousand years of jail for eba
yeah, uh, i guess you could say that
btw the file name is explosion_tiny.xml, that is indeed a very tiny explosion lmao
you cant just... type a big number and expect it to... okay.
wretched lua commenting
okay i think thats everything in CC
REAL
count_per_material_typedefinitely exists on<MaterialInventoryComponent/>s and can take any number of<Material/>children on it with the attributesmaterial(string id) andcount(obviously number of pixels)<Mod/>component only accounts formod.xmlwith requirednameanddescriptionattributes, doesnt account forworkshop.xmlwithtagsorcompatibility.xmlwith_format_versionandversion_built_withcoloron<ParticleEffect/>under<CellData/><MagicNumbers/>is real last i checked idkmSerializedDatais base64 encoded entity stored for Polymorphe purposes according to @compact yew, v coolon_fire_convert_to_materialdefinitely does exist
NEED TO TEST
- e notation on
no_heal_max_hp_cap, and perhaps test that elsewhere too
NATHAN HALP
audio_event_nameon CellDatacoloron CellData- Nolla seems very sure that it does exist, could you double check if its not too annoying?- nolla seems p sure that
fire_hp="-1"is valid, is that the case?
mSerializedData stores the entity that got polymorphed so that it can be unpolyd once the effect expires. It's base64 encoded binary entity data.
gooot it, fascinating
People have used it for fun things like cloning entities. It does bring at least a single frame of delay to create a new entity with GameEffectComponent, set mSerializedData and other fields, and then have the effect expire
thats interesting, yeah mSerializedData sounds fun, should be added
do you know what no_heal_max_hp_cap is? is it max hp cap for GC or is it no heal for meat biome?
oh, wait this is on GameEffectComponent this is totally glass cannon
Seems like it was added on 2023-08-19
oh, is it meat realm then?
lemme check game references
huh.
not referenced anywhere in /data/
i wanted to be able to visually test the effects of the component in-game and use that to experiment with e notation and then try it on other stuff, if we can figure out a way to visually see the effects of that in-game thatd be nice
Yeah, it's probably used by the meat biome NO_HEAL game effect to store your max hp in the biome. There's no reason to read/write to it from Lua hence why it isn't referenced in data/
oooo no_heal is a game effect, did not know lmao
yeah i can test for that
anyway, multi-<entity/> entity files are indeed FAKE
so i verified on_fire_convert_to_material does indeed exist, and i am also very glad i did not push CC update to workshop with the test stuff i forgot to remove
was testing other stuff lmao
i barely know anything about ghidra, but its super handy when it comes to quickly verifying if something is real, i can just easily do a search for solid_break_on_explosion_rate, see no references and conclude "oh, so that ones not real"
maan why are pin and delete messages the same perm
itd be great if we could pin whatever we wanted inside of the mod forum posts, but wed also have delete message perms if that were the case, which obviously i dont think can just be handed out
@polar trout did you start the xsd stuff? im lost lmao
wtf is this long-ass line for? im scared to touch it since it seems to contain like, everything
too massive to send in one go, im scared to add stuff cuz it might break this, how would i go about modifying the XSD to correct data and add missing things?
this file is autogenerated
you edit the json source for it
i need to move over all of them to json
and make generating from json simpler
because it turns out to be a useful way of doing things
nathan can we tell the file that the materialaudio options are exclusively "NONE", "MAGICAL" and "LAVA"? also could you look into available options for the breakaudio enums? its probs just the ones used by materials already but itd be nice to verify o/
huh, there actually seem to be a few audio things, physics event, wall and solid, interesting
oh also wanted to know about the 3 things in the last section: audio_event_name, color and fire_hp="-1", all on CD
also is there a way to read filename? like interpret syntax differently depending on mod.xml VS compatibility.xml VS workshop.xml?
nvm
change the types and write them
see reaction direction for example
seem like you already do this tho judging by the fact you have the enums written down somewhere
wdym?
.
oh yeah
oh the type isnt properly assigned, ill just fix that then- oh does it work?
idk where i got those
lmao? bizarre, ill replace type anyway then? i assume thats fine??
sure, i also made a magic numbers list- i havent verified if all of the magic numbers listed on the wiki exist cuz holy fuck theres so many, is there a way to automate searching a list of stuff in ghidra to find out which ones return 0 results?
i am, how do i go over a list?
mosttly i copi paste the decomp then hit it with a vim macro to make it usable
not very proper but works well enough
ive been using ghidra thus far to search for if stuff is referenced, but theres just too many to go over individually
apparently there are 404 individual magic numbers
i probably verified like the first 30-40 or so before deciding shit sucked and i was just gonna deal with that another time
can you check at some point if audio_event_name and color are real things on CellData at some point?
noted
ill pass over the few doc stuff i had written up in my magic numbers json later then
ive been hit by the mysterious yellow square
i probably need to figure out what part of my setup is broken and causes it
dpesnt help that my monitor is at least partially broken so i can't rule out hardware failure
i assumed yellow square was metaphor for weird unexplainable issue, but, do you mean, like, a literally yellow square on your monitor?
yes
bizarre
aha
huh
its not hardware failure because its in screenshot
my favourite mob
PR has my magic numbers thingy, and a couple minor fixes/additions to stuff
default value for convert_to_material type attributes is "", not "air", added on_fire_convert_to_material, added color to <CosmeticParticleConfig/>- wait thats not right materials use <ParticleEffect/>
wait theres no ParticleEffect mentioned in any of the jsons but its recognised as CellData Legal and even has stuff it does and doesnt accept, it is just identical to <CosmeticParticleConfig/>? what??
nather why is your xsd thingy so weird?
product types with custom names are <Name> in the xml
struct Thing {
struct Inner someName;
};
will look like <Thing <someName someField = 12/> <Thing/> in the xml
so you end up with different looking elements that are the same
okay, so ParticleEffect is just CosmeticParticleConfig?
probably
its the only thing in the xsd thing that takes airflow_scale which is something that also exists on ParticleEffect so ima assume so
got it so i didnt mess anything up, color is correct, PR should be good then
W
time to abstract the json stuff away
i didnt realise id have like 5 different jsons that do the same thing
honestly kinda hope we can get modders in general to contribute to the xsd and turn it into a documentation thingy that people will actually update with info cuz its smth people actively use, and then data from the xsd can be passed down to the wiki later down the line
first step is of course to make sure we get all the components, attributes and types correctly set up
oh, is it possible to do this btw? @dull saffron
since those 3 files use diff aspects of Mod component
i think you should just do it explicitly
?
<?xml-model href="entity.xsd" type="application/xml-xsd"?>
noitas xml parser can handle them
idk what you mean
to the top of the XML file? like in each individual mod?
yes
alternatively in the lsp config you can specify xsd for paths with more specificity
that feels like more effort than its worth lmao
this sounds like smth, what do you mean?
true but i didnt consider it when i made the folder lmao, perhaps ill fix
so something like this is what we'd expect?
that can work
yes probably
do you know if <Mod/> has any funny secret properties or checks in-engine that we dont know about?
or if you dont know, would that be smth you could check at some point? seems unlikely, but potentially interesting
wdym?
wondering if the engine has any checks for properties on <Mod/> that arent documented
pretty sure i found the fields in engine before remembering examples exist
im wondering if theres just any undocumented behaviour towards the mod.xml fiels
mmmm fair enough
c++ish
"ish"???
ah, i thought you were about to tell me nolla did some horrid language amalgamation to make their engine
huh, this isnt everything, ig workshop.xml stuff isnt included, nor compatibility.xml
purely mod.xml attr, thats interesting, ig this is just the interpreter for mod.xml and there isnt really a defined struct/type for <Mod/>?
they are seperate parsers
you have a type which is what it parses, then a name
yeah that makes sense, do you happen to have the other two on hand?
its just like how in components Transform is ctypes::xform or whatever and in entities its _Transform
well ig i meant it doesnt have a rigid structure- ig i could check if this stuff is listed somewhere else
give me some strings they use
easy to find
yes but for others
_format_version
version_built_with
compatibility ^^^
dont_upload_folders
dont_upload_files
workshop.xml ^^
dev exe exclusive 😭
@gloomy veldt fix this btw, spaces break the tags, spells and alchemy are actually spells and alchemy and wont be found under those tags on the workshop
@lilac elk you too
im just going through mods rq with this issue- lemme move this to mod dev rq lmao
Ooh, okay thanks
whats meant to use this?
CellData uses ParticleEffect
also in future run generate in your pr
so that way the changes to the xsd actually appear in it
rather than whatever commit comes next
ive made the json system easy to use, moving over sprite, biomes_alll to it at some point is needed
sure, got it 👍
for useful things to do id do workshop.xml, compatability.xml, font files, moving existing hand written xsd to json
wheres the hadwritten xsd stuff?
and yeah ill get back to this stuff proper in some hours, i didnt get much sleep last night so ill be taking a nap soon
sprite.xsd and biomes_all.xsd
also transform should probably use the generation system
it was somewhat handwritten because i didn't support vector2s (or any a.b style xml types)
and really i out to create a directory for the generated content, the testing content, and the source content
ought?
yes
materials_source?
ought to create an out dir
?
that would be a pain to generate imo
we're generating from json files, idk if theres a misunderstanding about that
oh ill keep the source xsds
for the base
but rather than having a handwritten sprite xsd i want it to be jsonified
some of the subelements in materials should also be jsoned
currently they dont have lsp hover
i think i did that one dirty just to shut it up
where is this at? GE?
Yeah Glimmer’s Expanded, and I might’ve seen it on one of your other mods? Just double check for spaces following commas on all your mods
Alright, thanks for the heads up!! I did notice some jank stuff with my tags on the workshop; maybe that's the issue
CC had the same for a few years, just thought to check up on some mods I use and found Gram and GE had the same issues, along with a few others
Surprisingly less common mistake than I would’ve thought tbh lmao
At least considering the fact I don’t think I’ve ever seen anyone else bring it up before in my presence at the very least
is it possible to have default values change depending on cell type btw? since liquids solids and whatnot have diff default values for some attributes
electrical_conductivity has a different default depending on other fields (including cell_type). I don't know about any others
the defaults for diff cell types are listed on the wiki iirc
ig I don't understand what you're asking. Aren't you answering your own question here
no, im asking if the XSD autocomplete system can handle conditional defaults
not a noita question, moreso an xml xsd question#
I see. I was missing the XSD context
yeah couldve been clearer, if they cant we'll have to choose which material we consider the default
probs whatever the default celltype is
xsd 1.1 can, but lemminx is only xsd 1.0
mmmm and i assume we need lemminx?
well i want it to work with the lsp i use 
i suppose we could raise the minimum requirements
thats fair, if we can raise it thatd be convenient
@dull saffron what does this actually mean?
lets you specify an xsd path in a file
see test folder for usage
noita can handle it being included
okay, that sounds really inefficient, can i remove it?
🤷♀️
like, you specifically add it to the singular file you wanna use?
yes
ill specify that then ig
itd probably be good for compat and workshop xml when they exist
to disambiguate what it is
ig you could do **/compatability.xml → ...
yeah thats the plan, for now ive excluded it but this is what i have my file looking like
anyway, here PR https://github.com/NathanSnail/noita_xml_dtd/pull/8
oh fuck did i leave one in?
2 
can this even be accounted for in the xsd?
Sure
Your are sort of meant to use text in xml rather than attributes for everything
Nolla just doesn't mostly
@polar trout you surely remembered or documented your findings while working on biome stuff, right? :D
random bullshit go
seems inaccurate, considering nolla uses material names
yes
material types are kinda weird
they are converted to int by the xml parser so the type is int
maybe modify generator to make the type some material type if its a material type and not an int
not sure how to easily detect
configs are all from dexter
he did some engine patch to generate them
yeah i remember the same thing for other material stuff before
open a pr if you figure out a good solution
also actually run your pr and test it works this time
i mean my suggestion would be string makes more sense than int imo
why would you set a mat id for it thats just prone to break, ideally taking both would be nice but string is def more important imo, perhaps add a note saying it can take int mat id or smth
int field in the "custom data types" section is good enough to differentiate between integers and material name fields, I'm pretty sure. Even if it's not, that would be a good starting point for creating a hard coded list.
seems likely
theres only a single one there
so idk
theres a uint32 colour
sprite doesnt seem to be in merged
current bugs are:
jump_trajectories
count_per_material_type
cloth_color accepts hex (maybe all ints do?)
only_position is legal in inherit transform
_version might be real
i would presume so considering example mod has it
nolla frequently uses stuff that doesnt exist
tru but for the example mod?
quite possible
example mod is questionable but i dont think it just has fake stuff in it
though tbh i wouldnt bet money on it lmao
_version does exist and does get read but it gets immediately thrown out and not used
thats amusing
worth putting in a note "hey this property exists but doesnt do anything"
can we mark it with yellow with a custom warning? i imagine so
maybe
also we need to move entity away from handwritten to json generated
doesnt seem like xsd or lemminx has a way to do deprecated
i wonder if 3.40282e+038 is actually valid
i believe things do interpret that format correctly so presumably
do we not have default values for min/max count on LoadEntitiesComponent?
also nathan you should make an NXML post in #1391736603348697220 since its a p handy tool/lib thats used by many mods
would make it easier to find
.moddev
Introduction to mod development
- Wiki page: Modding
Various tools for mod development
- Text editor: VSCode | Nvim | kickstart.nvim
- Git: Website
- LuaLS: VSCode Extension | Github - LSP
- Lemminx: VSCode Extension | Github - LSP | Github - VSCode
- Lua definitions: Github
- XML definitions: Github
- Type definitions: Github
Mods for mod development
- Component explorer: Releases | Install Guide
- Limited functionality: Workshop
- Spell Lab Shugged: Workshop | Github
- Conjurer Reborn: Workshop | Github
Various libraries which are often useful
0,0 according to component docs
noted, much appreciated 👍
_format_version
version_built_with
workshop_item_id
settings_fold_open
request_no_api_restrictions
ui_newgame_name
ui_newgame_description
ui_newgame_gfx_banner_bg
ui_newgame_gfx_banner_fg
is_game_mode
game_mode_supports_save_slots
is_translation
translation_xml_path
translation_csv_path```
bunch of strings i found, seem to all be tied to <Mod/> space
also found this lmao
special vanilla perms
which?
its in lua api
oh is it already documented in the api defs?
yes
got it, there are a lot of init funcs that arent lablled in the example mod, i would be worth compiling into a proper list if i get around to improving modding documentation on the noita wiki
lua api has a full list
in sequence? thatll make it convenient
?
BEAT_THE_GAME
BIOME_EXCAVATION_SITE
BIOME_SNOWCAVE
BIOME_SNOWCASTLE
BIOME_RAINFOREST
BIOME_VAULT
BIOME_CRYPT
GODS_AFRAID
GODS_IMPRESSED
GODS_ENRAGED
PROGRESS_PERKS
PROGRESS_SPELLS
PROGRESS_ENEMIES
ALL_ORBS```
list of achievement ids you can input into GameGiveAchievement()
this is the main thing i booted up for lmao
mod restriction
disable mod restriction mods
i agree its not very useful but i disagree that its entirely useless
wish we had a function to revoke achievements
it wouldve been so funny for fairmod lmao
you can pay in achievements to do stuff- oh we should implement that with the existing achievement system
natherrr
what do :(
apparently unpushed changes to autoluaapis repo but idr doing anything
can you tell me how or gimme command?
so every commit got tinkered with
delete the entire repo and clone it again is easiest
got it
Verifying Engine Stuff for XML and Lua definitions
okay, now thats out the way
@dull saffron :D
in the repo, GameGiveAchievement isnt in main.py, so should i just directly put info into out.lua? how should i add documentation to things?
out.lua shouldnt be touched
okay so what should i do
add it to overrides if you want it to have custom functionality
got it
only the manually written functions are in main.py
technically out.lua shouldnt be in the repo and you should build it yourself
okay but thats annoying and inconvenient
the repo is already like 3 files text files, including README.md
convenience outweighs cost here imo
nather is there a convenient way i could go "the list of possible string inputs are these"?
for GameGiveAchievement
union type
how do i specify union type here in the override thingy?

oh you're so true actually
alternatively
like so?
surely string is wrong
well is string a valid value to pass?
the function does take string
whereas with dealing damage you can do whatever you want
its just it makes the most sense to use the standard damage translations
oh i thought that first thing was just specifying the type it is and then the inputs
i didnt realise it was like "this type OR any of these inputs"
got it
its the union of the types
a union is like a set union of the sets corresponding to each type
so this? or do i not want the > there?
mostly like a coproduct
why is beat_the_game the default / special value?
it was just the first listed in the engine, does > specify a default value?
if so i can remove it
makes that value more visible
also no need to newline
it looks cleaner, should i make it all one continuous line then?
got it
i dont use like 2000 lines on the different component fields
i try to avoid bloating it too much if possible
you mean move the comment after args, or what?
the extra comment info should be after the built in one
how do i change that?
rewrite the comment
wait whats the built in comment?
or are you just saying label the fact its not safe api after main point of what it does?
yes
ah okay sure
also maybe note that its a steam achievement
?
rather than treechievement or whatever
oh you're saying i should specify it as steam achievement
yeah thats fair i forgot treechievements exist
is this good?
caps are ugly
idk nicely worded description is better
why doesnt it work in safe api
also . before \n
works here imo
set testing to no
alternatively if i had set it up so that out.lua wasnt part of the repo this wouldnt be an issue
but also it wouldnt be an issue if testing mode wasnt enabled in the main repo 👁️
its more convenient for me
also p sure it would be? i dont see how that resolves it
hmm still no worky
nathan am i crazy or is it still using your base_path as its default?
where does it grab my path?
you wouldnt need to build out.lua locally
????
im building it cuz i just made changes and would like to apply them
and releases are more inconvenient for users to download than just, git pulling
yeah but you could create a PR and just not test 
tru testing for the weak fr
id rather have my documentation work when i make it
if you're asleep or smth i might have to wait like 6-8 hours before it worky, is annoying
anyway why this no worky
hm, ill give it a go
probably need to pip install
i dont use requirements.txt because im like that
mmmm to google!
one which is running a shell that can run commands
preferablly the shell knows of pip
ok i set up uv
using proper tooling wow
just do uv run main.py
and it should all work
installing uv is left as an exercise to the reader
i got bs4 installed now
idk google
google told me how to install python through UV lmao
oh found it
????????????????????
why no stash option
use cli git
wretched wretched program
it actually works
cli git?
just use git normally
nvm im just gonna save the entire file to clipboard thats simpler
wow its incredible
nothing happens when i add folder as C:/Program Files (x86)/Steam/steamapps/common/Noita/modding stuff/AutoLuaAPI
thats not where your tools modding is
ooooooooo got it
also spaces in file path 😱
it reads from there, noted
W, worked
your args wrong
is it?
?
ah
i see
fixed
no caps 💥
see main.py:580 for example way i described thing not working
steal that style or something
is this satisfactory my liege?
i did thing
🤔
is my lsp just melting or is this a real issue
it really hates this file
indeed your code is wrong
smh test your types work
i sent screenshots and followed your intructions 😔
oh thats amusing
added pr for note about potential Randomf() inaccuracy, feel free to correct
https://github.com/NathanSnail/AutoLuaAPI/pull/3
run the generator
also does this apply to the other random fns?
add comments them to if so
otherwise suggest Random() * (b - a) + a
also almost certainly applies to ProceduralRandomf
perchance? i didnt test
i didnt run the generator cuz i figured youd want to improve the phrasing in some manner so i left as is
i imagine it doesnt happen with the reg random funcs im testing the float ones rn
confirmed on ProceduralRandomf()
confirmed on RandomDistributionf()
why are there 3 funcs?
i dont know
and why does i say it can return an int but return value doesnt match that
nolla docs wrong
they use all 3 funcs more than 50 times each, wild
one day nolla will design something well
is that even correct for RandomDistributionf?
i mean i tested it
but it is very hard assuming you have sane values
it happens frequently if the mean is one of the bounds
is it just slightly out of bounds?
i got it every few million iterations setting the mean to the upperbound of 93.66
suggest using Random() * (b - a) + a instead
and check that that actually works good
does random with no args even work?
i used this since i thought itd be sufficient, ill give it a go
or is it also [0, 1]
what does this mean out of curiosity?
?
like, what is this testing for, to see if Random() goes out of bounds? surely it doesnt
[0, 1) * (b - a) = [0, b - a], [0, b - a) + a = [a, b)
can 1 be faulted in a precision error?
probably you should just indicate that the range is [min, max] and sometimes slightly above max if its unlucky?
this is nonsense to me idk this
smh no interval arithmetic?
i mean id assume it can be below too if min wasnt 0, idk how float to double conversion works though it might only be up
you can use the interwebs or something to find out
ik i just assumed it made sense for float imprecision to happen up and low
yeah idk im not getting anything
nothing that i get at least
also you can maybe deuglify the vanilla comments
yeah i did consider doing that
i dont think the whole spiel on how Random() works needs to exist 4 whole times
Random() is code
probably just do identical to ```lua
SetRandomSeed(x, y)
Random(a, b)
got it
or does the seed get unset?
doesnt get unset
also between 0.0 and 1.0 is ambiguous
is it [0, 1] or [0, 1)?
else if (max == 0) {
max = (int)RNGState * 0x41a7 + ((int)RNGState / 0x1f31d) * -0x7fffffff;
if (max < 1) {
max = max + 0x7fffffff;
}
RNGState = (double)max;
local_208 = (float)(RNGState * 4.656612875e-10) + (float)NULL;
lua_checkstack(param_1,1);
lua_pushnumber(param_1,(double)CONCAT44(uVar1,(int)((ulonglong)(double)local_208 >> 0x20)));
}
what the code does
whats the difference?
1 ∈ [0, 1] but not [0, 1)
were you telling me to do this?
cuz no worky and idr how to make worky if so
yes
when you hover the function it should put random() in a code block
you also do not do this very much
you can also do ```lua if you want full code examples
thats from nolla i thought?
or is it a me issue
ah it is me
i tried finding an example on how to make it work properly (cuz its doing this for me), but all your function mentions are not in code blocks in main.py
oh wait it gets autoadded
hmm the () are out of the block
yeah thats the part that was confusing me
it not including () is a bug im fixing
it is
done
PR surely good now
wait no
built
i forgot to do that, now it should be good
---This does not interfere with the current random seed from SetRandomSeed().
this iswrong
at least probably
give it a test
includes 1
???? didnt you say it didnt reset it?
so note its [0, 1]
not getting unset ⇒ does get set and not unset
so it interferes with the state
ah it interferes with the state cuz its counted as running a random func, i assume it was outside of that, got it
are you ammending this or shall i?
happened twice across 100,000,000 iterations btw lmao
you can
also i think itd be cool to do the show equivalent code thing
because it is literally just
SetRandomSeed...
Random
and so hovering it and seeing what its implementation is would be nice
oh so it is literally this got it
in not between
or from ig
also i think i might have code blocked interval notation elsehere? idk
probably correct enough
would be amusing if (0, 1]
surely they would never be so evil
actually if max = -2³¹ does this get a slightly negative value?
probably rounds up to 0
like this?
semicolons do (almost) nothing
they're useful for ultimate one-liners
you can remove them
i can here
you can almost always
but the point of a multiline code block is to be multiline
geh i thought itd be ugly to multiline block in the middle of the comment
fucking how lmao
[[]] doesnt work
i thought this looks fine
wrong language
check there
use \n or """
oh i thought \n wouldnt work, got it
vsc doesnt support newlines unfortunately
yours probs will work
nxml uses them heavily
]
see gameoncompleted
ooh hang on they use a seperate rng?
yes, that much at least
SetSeed(&local_220,WorldSeed::Seed + NG+_Level,dStack_210,dStack_218);
if (iVar1 == 2) {
RandomStep(&local_220);
if (0.0 <= dVar5) {
local_220 = dVar5 + 0.5;
}
else {
local_220 = dVar5 - 0.5;
}
lua_checkstack(param_1,1);
floor(local_220);
iVar1 = FUN_00dfbb10();
}
local_220 is the rng
same with the other one
ok
so is it just the same but with diff seeding or is there a genuine difference to take note of?
ProcRand funcs all use a diff seed and ProcRandi is extra weird?
but dont modify the global seed- so, do they interfere with the SRS or not?
or wait, do you mean ProcRandi?
geh whatever, ill let you figure this all out
no interference
is it just ProcRandi that doesnt interfere or is it all of them ProcRands?
and if the former, is that all thats really different about it?
?
none of the proceduralrandoms do
yes
local_218 = 0.0;
SetSeed(&local_218,WorldSeed::Seed + NG+_Level,dStack_220,dStack_210);
it doesnt modify global seed
uhh its case for 0 args is weird
is that it?
this resulted in constant diff values
so it clearly at least seeds differently too
im just gonna push what ive done and leave you to figure out how ProcRandi works
i think this is why we were going around in circles for a minute lmao
should this be code block?
gahhhh i just wanted to quickly document some small things and get back to CC developing 😭
oh i see, proceduralrandom makes a float then casts it to int
huh, so it is
indeed
im going to fucking kill nolla games what the fuck why
Random() is int and Randomf() is float, why the fuck are both ProceduralRandom() and ProceduralRandomf() float and ProceduralRandomi() is int
😭
note the differences
if (max == 2) {
dVar3 = RandomDouble0To1(&rng);
if (0.0 <= dVar3) {
rng = dVar3 + 0.5;
}
else {
rng = dVar3 - 0.5;
}
lua_checkstack(param_1,1);
floor(rng);
max = FUN_00dfbb10();
}
mystery fn
seems rounded rather than ceil/floor
im pretty sure it is literally always >= 0
so its just floor(Random() + 0.5)
actually is 0 <= -0 true 🤔
and can Random() return -0
wha
can you do this stuff on your own? i can push what i have now
been stuck here for over 2 hours lmao
idk its probably pretty accurate now
0-1 behaviour sounds iffy but thats smth to figure out another day
actually i can run a test rq for low values
i think the behaviour of ProcRandomi with no args might slightly depend on hardware features?
it checks a hardware feature and uses a different approach depending on it
im not sure if they are equivalent
new security vulnerability found, ProcRandi gives us user hardware information
surely this can summon the devs back for epi3
if (RoundModeThing == 0) {
uVar1 = (ulonglong)ROUND(param_3);
uStack_20 = (uint)uVar1;
fStack_1c = (float)(uVar1 >> 0x20);
fVar3 = (float)param_3;
if ((uStack_20 != 0) || (fVar3 = fStack_1c, (uVar1 & 0x7fffffff00000000) != 0)) {
if ((int)fVar3 < 0) {
uVar1 = uVar1 + (0x80000000 < (uint)-(float)(param_3 - (float10)(longlong)uVar1));
}
else {
uVar2 = (uint)(0x80000000 < (uint)(float)(param_3 - (float10)(longlong)uVar1));
uVar1 = CONCAT44((int)fStack_1c - (uint)(uStack_20 < uVar2),uStack_20 - uVar2);
}
}
return uVar1;
}
return CONCAT44(param_2,(int)param_3);
wtf is this garbage
idk what im looking at
exactly the issue
lmaoo
awesome, if i commit the params they all get deleted
ghidra bug ig
wha the hardware feature check dissapeared
wait i commited the params and ghidra took me to a different fn
you seem to be correct that it cannot land on 0
does that mean it literally is this?
across 1 billion iterations, it did not land on 0 a single time
print the smallest values?
your starting seed might just never hit 0
the rng is periodic
print whenever you get a repeat of the smallest value
i suspect youll find that your rng is looping
there are 4 billion states
previously i hit 1 a few times within 100 million
but surely theres more than one 0 within that
ideally there shouldnt be
im gonna say it seems highly likely that 0 is not a possible return value, feel free to check the code to verify
i put in a check for less than 0 separately tho
surely this would also trigger if it hit -0, right?
apparently -0 = 0
there was nothing except the percentage markers
well then i still didnt hit anything for ==0
so neither 0 nor -0 were returned within a billion iterations
i can set my computer up to do 100 billion iterations overnight, but i think at this point its fairly certain
ig it can never be returned
evil
check PR, i pushed changes and built
?
seems to be formatted correctly
worked fine for me idk what you're saying
formatter
i dont think i have a formatter
it uses black
if theres a formatting issue surely you can fix it on your end
wdym it uses black i dont know what you're saying
black formatter
is that like, the name of a formatter???
yes
got it
its not ideal
i didnt afaik
written in python so almost unusably slow
and uses spaces (why does pep say to do this??)
other than that its good
writing tools in python is a terrible idea but always tempting to do
i dont have any python extensions installed
wait no
i do have some
these are all
should i replace spaces with proper tabs rq?
k ill just leave this to you then
but not having a formatter is too irritating
W changes merged
do we have a list of Session numbers we could dump into the relevant functions? iirc its a static list that cant be added to
Used to store map and New Game Plus information for the current run.
best time to do development
yes and best excuse to not do documentation, get on that nather!!
also someone whos less lazy than me should split up the generator script to be readable and reusable
what if i want to autogenerate new versions of the api functions where multiple returns are replaced by table returns?
rn i can't and would need to reimplement a parser for nollas broken doc format
am working two jobs and have a family at home, can someone else pls do it
i guess nathan's the only one available enough to do it 😔
worst hover ever
idk why it looks so bad
i think its lua not markdown and thats causing everything to go wrong
why the -- doesn't hide it but the " doesn't work i cant say
i think treesitter just hates this not even vaguely valid lua
intereseting, if i manually remove the | the highlight gets fixed
too bad i cant do that
gameeffect comp, doesnt recognise mSerializedData and no_heal_max_hp_cap has its type as decimal which makes it angy when you put in string
not a string
Isn’t everything supposed to be accepted as string in the xml file format?
?
the issue is that its using e notation which xs:decimal doesnt work
we need a new number type
do we
yeah they are only meant to be used by engine
mSerializedData is almost impossible to use correctly, so idc about it that much
no_heal_max_hp_cap is actually useful
noller 
they won't use xds def
it's just CE export
yes
do they really use e notation
Idk it’s just what I got i think when I used CE to copy XML data, and I’m p sure it does work
mSerializedData is base 64
the underlying data is not recognisable by an xsd pattern
but doing a b64 string could be easy enough
Used for poly iirc?
yes
^ LoadPixelScene
i think this is the colour table, so thats smth
since the colour table is here, the actual setting of pixels should take place after this
optimisestring?
i thought it was a translation, but then after investigating the function with other people, it was concluded its doing something to strings- seemingly optimising them?
also your lua_gettop type is wrong
it might be std::string::from_cstr
you can just import lua.h into ghidra and get them all set
yeah
or copy them manually from lua.h but thats a bit silly
somewhat worth messing with the types to make the index an enum which has a special value for the _G table so the decomp is nicer
note that this is just the lua function for loading a pixel scene
itll call the actual impl elsewhere
todo: document ModSettingSetNextValue calling on ModSettingsUpdate after it runs, seemingly only in-game?
also document is_default being annoying for no reason
nather
nather please we need biome xml defs
im trynna make random corrupted biome stuff
but idk what most of this is Devastated
@jolly crypt i presume you handle most of the biome stuff in apoth? do you have any notes jotted down anywhere in terms of comments or anything detailing any of the parameters for biomes? or is it all stored safely away in your mind palace?
i can gather the general stuff, name is name, type is whether its noise or wang generated, background image stuff
but theres weird stuff i dont understand here- limit background image? noise_biome_edges i can guess what its related to but idk what it does, i can make vague guesses about wang_map_width/height and audio_music_2 and audio_ambience