#Verifying Engine Stuff for XML and Lua definitions

1 messages · Page 1 of 1 (latest)

ashen fossil
#

oh, wait hold on

#

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

polar trout
#

nathern

ashen fossil
#

yis

#

i heard this was real the other day, i think XML defs needs an update

rustic pilot
ashen fossil
#

the title was "is this real?" though

rustic pilot
#

i ask you to make it more searchable

ashen fossil
#

that was moreso the desc that got deleted when i tried remaking the thread

#

oh, uhhh hold on

rustic pilot
#

the problem is that the thread search bar only finds titles

ashen fossil
#

Verifying Engine Stuff for XML definitions

#

is that better?

rustic pilot
#

yeah sure

ashen fossil
#

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

polar trout
#

manually redefining is pain

ashen fossil
#

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)

polar trout
#

it was entirely ignored

#

needs separate json i think

#

same with mod.xml

#

wdym it was 7 months ago entity_hamis

ashen fossil
#

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

polar trout
#

active dev was 7 months ago

ashen fossil
#

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

polar trout
#

does it even work?

ashen fossil
#

no clue, its empty in CC so ima assume this- oooo this is from me copying XML using CE, thats interesting

polar trout
#

iirc it's used to unpoly the entity

ashen fossil
#

that also means this is seemingly canon?

polar trout
#

lol

ashen fossil
#

which like, you can just do e notation in here???

polar trout
#

try it with regular hp, idk

ashen fossil
#

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
polar trout
ashen fossil
#

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

polar trout
#

biome stuff is unimplemented too iirc

ashen fossil
#

noted

#

going through old msgs, i assume hole_image on config_explosion is fake?

polar trout
#

hole_image is fake

ashen fossil
#

amusing how much of it there is lmao

polar trout
#

config should be a real object

ashen fossil
#

stains_image is also fake

ashen fossil
polar trout
#

ah

#

i misread it as or

ashen fossil
#

lmao

#

p sure this is real

#

ah, i mayve picked up some bad habits from Arcane Alchemy

polar trout
#

it's probably just 0x088CC316

ashen fossil
#

is this not a real thing on CellData ParticleEffect?

polar trout
#

but probably should write fully

polar trout
#

it's almost entirely manual

ashen fossil
#

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.

upper siren
#

is this xml validity debunking

polar trout
#

make xsd great again

ashen fossil
#

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_type definitely exists on <MaterialInventoryComponent/>s and can take any number of <Material/> children on it with the attributes material (string id) and count (obviously number of pixels)
  • <Mod/> component only accounts for mod.xml with required name and description attributes, doesnt account for workshop.xml with tags or compatibility.xml with _format_version and version_built_with
  • color on <ParticleEffect/> under <CellData/>
  • <MagicNumbers/> is real last i checked idk
  • mSerializedData is base64 encoded entity stored for Polymorphe purposes according to @compact yew, v cool
  • on_fire_convert_to_material definitely does exist

NEED TO TEST

  • e notation on no_heal_max_hp_cap, and perhaps test that elsewhere too

NATHAN HALP

  • audio_event_name on CellData
  • color on 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?
compact yew
#

mSerializedData stores the entity that got polymorphed so that it can be unpolyd once the effect expires. It's base64 encoded binary entity data.

ashen fossil
#

gooot it, fascinating

compact yew
#

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

ashen fossil
#

thats interesting, yeah mSerializedData sounds fun, should be added

ashen fossil
#

oh, wait this is on GameEffectComponent this is totally glass cannon

compact yew
#

Seems like it was added on 2023-08-19

ashen fossil
#

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

compact yew
#

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/

ashen fossil
#

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

ashen fossil
#

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

ashen fossil
#

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"

ashen fossil
#

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?

dull saffron
#

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

ashen fossil
#

Oooo got it

#

So I put the changes in to json file, got it I’ll do that later

ashen fossil
#

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

ashen fossil
#

also is there a way to read filename? like interpret syntax differently depending on mod.xml VS compatibility.xml VS workshop.xml?

dull saffron
#

see reaction direction for example

ashen fossil
#

seem like you already do this tho judging by the fact you have the enums written down somewhere

dull saffron
#

wdym?

ashen fossil
dull saffron
#

oh yeah

ashen fossil
#

oh the type isnt properly assigned, ill just fix that then- oh does it work?

dull saffron
#

idk where i got those

ashen fossil
#

lmao? bizarre, ill replace type anyway then? i assume thats fine??

dull saffron
#

yes

#

run generate and test things out

ashen fossil
#

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?

dull saffron
#

just use ghidra

#

i will collect them

ashen fossil
#

i am, how do i go over a list?

dull saffron
#

mosttly i copi paste the decomp then hit it with a vim macro to make it usable

#

not very proper but works well enough

ashen fossil
#

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

dull saffron
ashen fossil
#

i probably verified like the first 30-40 or so before deciding shit sucked and i was just gonna deal with that another time

ashen fossil
dull saffron
#

currently making json for magic nums

#

need to clean up the broken types

ashen fossil
#

noted

#

ill pass over the few doc stuff i had written up in my magic numbers json later then

dull saffron
#

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

ashen fossil
dull saffron
#

yes

ashen fossil
#

bizarre

dull saffron
ashen fossil
#

huh

dull saffron
#

its not hardware failure because its in screenshot

ashen fossil
#

not a monitor issue ig

#

yeah

ashen fossil
ashen fossil
#

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?

dull saffron
#

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

ashen fossil
#

okay, so ParticleEffect is just CosmeticParticleConfig?

dull saffron
#

probably

ashen fossil
#

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

dull saffron
#

looks like the wiki is correct

#

none missing and no ficticious ones

ashen fossil
#

W

dull saffron
#

time to abstract the json stuff away

#

i didnt realise id have like 5 different jsons that do the same thing

ashen fossil
#

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

ashen fossil
#

since those 3 files use diff aspects of Mod component

dull saffron
#

i think you should just do it explicitly

ashen fossil
#

?

dull saffron
#

<?xml-model href="entity.xsd" type="application/xml-xsd"?>

#

noitas xml parser can handle them

ashen fossil
#

idk what you mean

dull saffron
#

add this to the top of the file

#

and itll use that xsd

ashen fossil
#

to the top of the XML file? like in each individual mod?

dull saffron
#

yes

#

alternatively in the lsp config you can specify xsd for paths with more specificity

ashen fossil
#

that feels like more effort than its worth lmao

ashen fossil
dull saffron
#

when you configure your xml language server

#

you specify what xsd to use for what

ashen fossil
#

you mean here?

#

that works

dull saffron
#

yes

#

also spaces in filepath

#

evil

ashen fossil
#

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

dull saffron
#

yes probably

ashen fossil
#

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

ashen fossil
#

wondering if the engine has any checks for properties on <Mod/> that arent documented

dull saffron
#

pretty sure i found the fields in engine before remembering examples exist

ashen fossil
#

im wondering if theres just any undocumented behaviour towards the mod.xml fiels

#

mmmm fair enough

dull saffron
ashen fossil
#

what lang is this, C++?

#

its making my vsc very sad

dull saffron
#

c++ish

ashen fossil
#

"ish"???

dull saffron
#

ghidra generated

#

its meant to be c++ mostly

#

more c with namespaces

ashen fossil
#

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/>?

dull saffron
#

you have a type which is what it parses, then a name

ashen fossil
#

yeah that makes sense, do you happen to have the other two on hand?

dull saffron
#

its just like how in components Transform is ctypes::xform or whatever and in entities its _Transform

ashen fossil
#

well ig i meant it doesnt have a rigid structure- ig i could check if this stuff is listed somewhere else

dull saffron
#

easy to find

ashen fossil
#

ui_newgame_description?

#

ooo wait im dumb

#

hold on

#

misunderstood what you meant

dull saffron
ashen fossil
#

_format_version
version_built_with
compatibility ^^^

dull saffron
#

those are the only 2

ashen fossil
#

dont_upload_folders
dont_upload_files
workshop.xml ^^

dull saffron
#

dev exe exclusive 😭

ashen fossil
#

@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

dull saffron
#

description, dont_upload_folders, dont_upload_files

#

thats all

ashen fossil
#

noted

#

and tags, no?

#

and name?

dull saffron
#

oh wait

#

i dont have small strings marked here

#

tags, name as well

ashen fossil
#

im just going through mods rq with this issue- lemme move this to mod dev rq lmao

lilac elk
#

Ooh, okay thanks

dull saffron
ashen fossil
#

CellData uses ParticleEffect

dull saffron
#

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

ashen fossil
dull saffron
#

for useful things to do id do workshop.xml, compatability.xml, font files, moving existing hand written xsd to json

ashen fossil
#

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

dull saffron
#

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

ashen fossil
#

ought?

dull saffron
#

yes

polar trout
#

materials_source?

dull saffron
#

ought to create an out dir

dull saffron
polar trout
#

that would be a pain to generate imo

ashen fossil
#

we're generating from json files, idk if theres a misunderstanding about that

dull saffron
#

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

polar trout
#

i think i did that one dirty just to shut it up

ashen fossil
#

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

gloomy veldt
#

Alright, thanks for the heads up!! I did notice some jank stuff with my tags on the workshop; maybe that's the issue

ashen fossil
#

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

gloomy veldt
#

Yaaaay it's fixed :D

#

thanks!

ashen fossil
#

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

compact yew
#

electrical_conductivity has a different default depending on other fields (including cell_type). I don't know about any others

ashen fossil
#

the defaults for diff cell types are listed on the wiki iirc

compact yew
ashen fossil
#

no, im asking if the XSD autocomplete system can handle conditional defaults

#

not a noita question, moreso an xml xsd question#

compact yew
#

I see. I was missing the XSD context

ashen fossil
#

yeah couldve been clearer, if they cant we'll have to choose which material we consider the default

#

probs whatever the default celltype is

dull saffron
ashen fossil
dull saffron
#

well i want it to work with the lsp i use entity_hamis

#

i suppose we could raise the minimum requirements

ashen fossil
#

thats fair, if we can raise it thatd be convenient

ashen fossil
#

@dull saffron what does this actually mean?

dull saffron
#

lets you specify an xsd path in a file

#

see test folder for usage

#

noita can handle it being included

ashen fossil
#

okay, that sounds really inefficient, can i remove it?

dull saffron
#

🤷‍♀️

ashen fossil
#

like, you specifically add it to the singular file you wanna use?

dull saffron
#

yes

ashen fossil
#

ill specify that then ig

dull saffron
#

itd probably be good for compat and workshop xml when they exist

#

to disambiguate what it is

#

ig you could do **/compatability.xml → ...

ashen fossil
dull saffron
#

btw json cant have trailling comma

#

unlike nvims lua config

ashen fossil
#

oh fuck did i leave one in?

dull saffron
#

2 entity_hamis

ashen fossil
#

yeah i knew that i just forgot to exclude

#

fuck lmao

ashen fossil
#

can this even be accounted for in the xsd?

dull saffron
#

Your are sort of meant to use text in xml rather than attributes for everything

#

Nolla just doesn't mostly

ashen fossil
#

ah, i did not know that lmao

#

noita xml is the only time ive ever seen xml lmao

ashen fossil
#

@polar trout you surely remembered or documented your findings while working on biome stuff, right? :D

polar trout
#

random bullshit go

ashen fossil
#

seems inaccurate, considering nolla uses material names

dull saffron
#

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

ashen fossil
dull saffron
#

open a pr if you figure out a good solution

#

also actually run your pr and test it works this time

ashen fossil
#

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

compact yew
#

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.

dull saffron
#

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

dull saffron
#

_version might be real

ashen fossil
#

i would presume so considering example mod has it

dull saffron
#

nolla frequently uses stuff that doesnt exist

ashen fossil
#

tru but for the example mod?

dull saffron
#

quite possible

ashen fossil
#

example mod is questionable but i dont think it just has fake stuff in it

#

though tbh i wouldnt bet money on it lmao

dull saffron
#

_version does exist and does get read but it gets immediately thrown out and not used

ashen fossil
#

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

dull saffron
#

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

dull saffron
#

i wonder if 3.40282e+038 is actually valid

ashen fossil
#

i believe things do interpret that format correctly so presumably

ashen fossil
#

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

pure geyserBOT
#
**FAQ: moddev (Creator: nathansnail)**

Introduction to mod development

Various tools for mod development

Mods for mod development

Various libraries which are often useful

upper siren
ashen fossil
#

noted, much appreciated 👍

ashen fossil
#
_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

dull saffron
#

special vanilla perms

ashen fossil
#

oh i think OnModSettingsChanged might be a init function?

#

never heard of it before

ashen fossil
dull saffron
ashen fossil
#

oh is it already documented in the api defs?

dull saffron
#

yes

ashen fossil
#

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

dull saffron
#

lua api has a full list

ashen fossil
#

in sequence? thatll make it convenient

dull saffron
#

?

ashen fossil
#
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()
dull saffron
#

true

#

though this is somewhat useless because its not possible to call

ashen fossil
#

this is the main thing i booted up for lmao

dull saffron
#

mod restriction

ashen fossil
#

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 :(

dull saffron
#

whats this for?

#

i did some evil things to the history

ashen fossil
#

apparently unpushed changes to autoluaapis repo but idr doing anything

dull saffron
#

you should reset to remote state

#

i changed my email address

ashen fossil
#

can you tell me how or gimme command?

dull saffron
#

so every commit got tinkered with

dull saffron
ashen fossil
#

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?

dull saffron
#

out.lua shouldnt be touched

ashen fossil
#

okay so what should i do

dull saffron
#

add it to overrides if you want it to have custom functionality

ashen fossil
#

got it

dull saffron
#

only the manually written functions are in main.py

#

technically out.lua shouldnt be in the repo and you should build it yourself

ashen fossil
#

okay but thats annoying and inconvenient

dull saffron
#

repos should not contain build artifacts

#

they should go in releases

ashen fossil
#

the repo is already like 3 files text files, including README.md

#

convenience outweighs cost here imo

ashen fossil
#

for GameGiveAchievement

dull saffron
#

union type

ashen fossil
#

how do i specify union type here in the override thingy?

dull saffron
ashen fossil
#

oh you're so true actually

dull saffron
#

alternatively

ashen fossil
#

like so?

dull saffron
#

surely string is wrong

ashen fossil
#

?

#

i just copied how the damage thingy did it

dull saffron
#

well is string a valid value to pass?

ashen fossil
#

the function does take string

dull saffron
#

can you just pass any string?

#

notably not

ashen fossil
dull saffron
#

whereas with dealing damage you can do whatever you want

#

its just it makes the most sense to use the standard damage translations

ashen fossil
#

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

dull saffron
#

its the union of the types

#

a union is like a set union of the sets corresponding to each type

ashen fossil
#

so this? or do i not want the > there?

dull saffron
#

mostly like a coproduct

dull saffron
ashen fossil
#

it was just the first listed in the engine, does > specify a default value?

#

if so i can remove it

dull saffron
#

makes that value more visible

ashen fossil
#

got it, ill remove it then

#

this is all interesting to know

dull saffron
#

also no need to newline

ashen fossil
#

it looks cleaner, should i make it all one continuous line then?

dull saffron
#

yeah probably

#

out.lua is a bit bloated

ashen fossil
#

got it

dull saffron
#

i dont use like 2000 lines on the different component fields

#

i try to avoid bloating it too much if possible

ashen fossil
#

got it

#

so this is good?

dull saffron
#

probably put the extra info afterwards

#

and not that its mod restrictions

ashen fossil
#

you mean move the comment after args, or what?

dull saffron
#

the extra comment info should be after the built in one

ashen fossil
#

how do i change that?

dull saffron
#

rewrite the comment

ashen fossil
#

wait whats the built in comment?

dull saffron
#

the main one

#

also corresponding is spelt wrong

ashen fossil
#

or are you just saying label the fact its not safe api after main point of what it does?

dull saffron
#

yes

ashen fossil
#

ah okay sure

dull saffron
#

also maybe note that its a steam achievement

ashen fossil
#

?

dull saffron
#

rather than treechievement or whatever

ashen fossil
#

oh you're saying i should specify it as steam achievement

#

yeah thats fair i forgot treechievements exist

#

is this good?

dull saffron
#

caps are ugly

#

idk nicely worded description is better

#

why doesnt it work in safe api

#

also . before \n

ashen fossil
#

steam achievement

dull saffron
#

yes

#

also use for the param name

ashen fossil
dull saffron
#

or ' actually

#

' gets replaced with markdowned version elsewhere

ashen fossil
#

NATHER

#

RAT 🫵

dull saffron
#

the classic if TESTING

ashen fossil
#

ah

#

well still running the file didnt do anything

#

hrmmm

dull saffron
#

set testing to no

ashen fossil
#

oh

#

you're still rat then

dull saffron
#

alternatively if i had set it up so that out.lua wasnt part of the repo this wouldnt be an issue

ashen fossil
#

but also it wouldnt be an issue if testing mode wasnt enabled in the main repo 👁️

dull saffron
#

its more convenient for me

ashen fossil
#

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?

dull saffron
ashen fossil
#

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

dull saffron
#

yeah but you could create a PR and just not test entity_hamis

ashen fossil
#

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

dull saffron
#

you should just be able to run it

#

idk git pull

#

and then see

ashen fossil
#

hm, ill give it a go

dull saffron
#

probably need to pip install

ashen fossil
#

got it

dull saffron
#

i dont use requirements.txt because im like that

ashen fossil
#

is this all i need to run?

#

i dont use python lmao

dull saffron
#

no idea

#

maybe beautifulsoup?

ashen fossil
#

mmmm to google!

dull saffron
#

thats python

#

not a terminal

ashen fossil
#

oh would cmd work?

#

nope

#

what terminal nather

#

oh, this?

dull saffron
#

preferablly the shell knows of pip

ashen fossil
#

hmm

#

i mean the python thing i was in just now knew pip

#

CMD does seem to work

dull saffron
#

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

ashen fossil
#

i got bs4 installed now

ashen fossil
#

how install UV?

dull saffron
#

idk google

ashen fossil
#

google told me how to install python through UV lmao

#

oh found it

#

????????????????????

#

why no stash option

dull saffron
#

use cli git

ashen fossil
#

wretched wretched program

dull saffron
#

it actually works

ashen fossil
#

cli git?

dull saffron
#

just use git normally

ashen fossil
#

nvm im just gonna save the entire file to clipboard thats simpler

dull saffron
#

wow its incredible

ashen fossil
#

nothing happens when i add folder as C:/Program Files (x86)/Steam/steamapps/common/Noita/modding stuff/AutoLuaAPI

dull saffron
#

thats not where your tools modding is

ashen fossil
#

ooooooooo got it

dull saffron
#

also spaces in file path 😱

ashen fossil
#

it reads from there, noted

dull saffron
#

ideally it would throw some errors

#

but its python so i dont think about that

ashen fossil
#

W, worked

dull saffron
#

that is broke

#

⚠️

ashen fossil
#

made pr- oh

#

you're true? hold on

#

why did that happen?

dull saffron
#

your args wrong

ashen fossil
#

is it?

dull saffron
#

yes

#

() is for overload

#

because you just write the whole thing

ashen fossil
#

?

#

ah

#

i see

#

fixed

dull saffron
#

no caps 💥

#

see main.py:580 for example way i described thing not working

#

steal that style or something

ashen fossil
#

is this satisfactory my liege?

dull saffron
#

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

ashen fossil
#

i sent screenshots and followed your intructions 😔

dull saffron
#

it looked vaguely correct

#

fun i can just push to your repo

ashen fossil
#

oh thats amusing

ashen fossil
dull saffron
#

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

ashen fossil
#

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?

dull saffron
#

i dont know

ashen fossil
#

and why does i say it can return an int but return value doesnt match that

dull saffron
#

nolla docs wrong

ashen fossil
#

they use all 3 funcs more than 50 times each, wild

dull saffron
#

one day nolla will design something well

dull saffron
#

is that even correct for RandomDistributionf?

ashen fossil
#

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

dull saffron
#

is it just slightly out of bounds?

ashen fossil
#

i got it every few million iterations setting the mean to the upperbound of 93.66

dull saffron
#

suggest using Random() * (b - a) + a instead

#

and check that that actually works good

#

does random with no args even work?

ashen fossil
#

i used this since i thought itd be sufficient, ill give it a go

dull saffron
#

or is it also [0, 1]

ashen fossil
dull saffron
#

?

ashen fossil
#

like, what is this testing for, to see if Random() goes out of bounds? surely it doesnt

dull saffron
#

[0, 1) * (b - a) = [0, b - a], [0, b - a) + a = [a, b)

ashen fossil
#

can 1 be faulted in a precision error?

dull saffron
#

probably you should just indicate that the range is [min, max] and sometimes slightly above max if its unlucky?

ashen fossil
dull saffron
#

smh no interval arithmetic?

ashen fossil
dull saffron
#

you can use the interwebs or something to find out

ashen fossil
#

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

dull saffron
#

also you can maybe deuglify the vanilla comments

ashen fossil
#

yeah i did consider doing that

#

i dont think the whole spiel on how Random() works needs to exist 4 whole times

dull saffron
#

Random() is code

ashen fossil
#

true

#

fixed

dull saffron
#

probably just do identical to ```lua
SetRandomSeed(x, y)
Random(a, b)

ashen fossil
#

got it

dull saffron
#

or does the seed get unset?

ashen fossil
#

actually i assume it doesnt

#

mmm geh ig ill test

dull saffron
#

doesnt get unset

ashen fossil
#

ah

#

makes sense

dull saffron
#

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

ashen fossil
dull saffron
#

1 ∈ [0, 1] but not [0, 1)

ashen fossil
#

oh whether 1 is included or not?

#

whether the value can be 1?

dull saffron
#

yes

#

∈ = is an element of

ashen fossil
#

cuz no worky and idr how to make worky if so

dull saffron
#

when you hover the function it should put random() in a code block

ashen fossil
#

you also do not do this very much

dull saffron
#

you can also do ```lua if you want full code examples

dull saffron
#

or is it a me issue

#

ah it is me

ashen fossil
#

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

dull saffron
#

oh wait it gets autoadded

ashen fossil
#

so how fix?

#

yeah i was wonering if smth was doing that lmao

dull saffron
#

hmm the () are out of the block

ashen fossil
#

yeah thats the part that was confusing me

dull saffron
#

i forgot it got autoadded

ashen fossil
#

doing that rn to test

dull saffron
#

it not including () is a bug im fixing

ashen fossil
#

👍

#

ping when fixed, ill build and push

dull saffron
#

it is

ashen fossil
#

done

#

PR surely good now

#

wait no

#

built

#

i forgot to do that, now it should be good

dull saffron
#

what is between 0 and 1?

#

also this is borked

ashen fossil
#

guh

#

lemme fix

dull saffron
#

---This does not interfere with the current random seed from SetRandomSeed().
this iswrong

#

at least probably

#

give it a test

ashen fossil
ashen fossil
dull saffron
#

so note its [0, 1]

ashen fossil
#

geh cant you

#

you have edit perms

dull saffron
#

so it interferes with the state

ashen fossil
#

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?

ashen fossil
dull saffron
#

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

ashen fossil
ashen fossil
dull saffron
#

or from ig

#

also i think i might have code blocked interval notation elsehere? idk

ashen fossil
dull saffron
#

probably correct enough

ashen fossil
#

would be amusing if (0, 1]

dull saffron
#

surely they would never be so evil

dull saffron
#

probably rounds up to 0

ashen fossil
#

like this?

dull saffron
#

no

#

multilines go on multiple lines

#

and should be lua

#

see GameOnCompleted

ashen fossil
#

semicolons are lua

#

technically

dull saffron
#

semicolons do (almost) nothing

ashen fossil
#

they're useful for ultimate one-liners

dull saffron
#

you can remove them

ashen fossil
#

i can here

dull saffron
#

you can almost always

ashen fossil
#

just used it to get the idea across, make more sense to some

#

ik

dull saffron
#

but the point of a multiline code block is to be multiline

ashen fossil
#

geh i thought itd be ugly to multiline block in the middle of the comment

#

fucking how lmao

#

[[]] doesnt work

dull saffron
#

i thought this looks fine

ashen fossil
#

surely not zn

#

oh yeah

dull saffron
ashen fossil
#

check there

dull saffron
#

use \n or """

ashen fossil
#

oh i thought \n wouldnt work, got it

#

vsc doesnt support newlines unfortunately

#

yours probs will work

dull saffron
#

?

#

whats the comment look like

ashen fossil
dull saffron
#

nxml uses them heavily

ashen fossil
dull saffron
#

see gameoncompleted

ashen fossil
#

okay, ProcRnd =/= ProcRndi

#

these are p much never the same value

dull saffron
#

ooh hang on they use a seperate rng?

ashen fossil
#

yes, that much at least

dull saffron
#
   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

ashen fossil
#

so is it just the same but with diff seeding or is there a genuine difference to take note of?

dull saffron
#

it uses a different seed

#

and proceduralrandomi is weird

ashen fossil
#

ProcRand funcs all use a diff seed and ProcRandi is extra weird?

dull saffron
#

yes

#

they use the same seeding method but dont modify the global seed

ashen fossil
#

or wait, do you mean ProcRandi?

#

geh whatever, ill let you figure this all out

ashen fossil
#

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?

dull saffron
#

none of the proceduralrandoms do

dull saffron
#

yes

ashen fossil
#

oooo

#

got it

dull saffron
#
   local_218 = 0.0;
   SetSeed(&local_218,WorldSeed::Seed + NG+_Level,dStack_220,dStack_210);
ashen fossil
#

so whats special about ProceduralRandomi?

#

just alternate seeding method or what?

dull saffron
#

it doesnt modify global seed

ashen fossil
#

what

#

i thought you just said none of the procrandoms do

dull saffron
#

yes

#

oh wait i

ashen fossil
#

okay

#

yes

#

lmao

dull saffron
#

uhh its case for 0 args is weird

ashen fossil
#

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

ashen fossil
dull saffron
#

proceduralrandom seems to return a float always?

#

print some values

ashen fossil
#

should this be code block?

dull saffron
#

maybe

#

it looks better in one i think

ashen fossil
dull saffron
#

oh i see, proceduralrandom makes a float then casts it to int

ashen fossil
dull saffron
#

oh no cast

#

that explains it

ashen fossil
#

oh my god

#

ProcRand == ProcRandf

dull saffron
#

indeed

ashen fossil
#

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

dull saffron
#

its not almost identical

#

because it doesnt change global seed

ashen fossil
dull saffron
#

note the differences

ashen fossil
#

i do

#

note was already there

dull saffron
#

reasonable

#

do you note the special behaviours with 0 args?

ashen fossil
#

guh

#

what special behaviours are there?

dull saffron
#

vanilla seems true enough

#

test them ig

ashen fossil
#

?

#

i mean ig sure hold on

dull saffron
#

why doesnt forum read work

#

i have to press <Esc> to mark messages as read

ashen fossil
#

never change nolla, never change.

#

they fucking cast 0-1 to int lmao

dull saffron
#
   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

ashen fossil
#

seems rounded rather than ceil/floor

dull saffron
#

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

ashen fossil
#

wha

#

can you do this stuff on your own? i can push what i have now

#

been stuck here for over 2 hours lmao

dull saffron
#

idk its probably pretty accurate now

ashen fossil
#

0-1 behaviour sounds iffy but thats smth to figure out another day

#

actually i can run a test rq for low values

dull saffron
#

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

ashen fossil
#

new security vulnerability found, ProcRandi gives us user hardware information

#

surely this can summon the devs back for epi3

dull saffron
#
   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

ashen fossil
#

idk what im looking at

dull saffron
#

exactly the issue

ashen fossil
#

lmaoo

dull saffron
#

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

ashen fossil
#

you seem to be correct that it cannot land on 0

ashen fossil
#

across 1 billion iterations, it did not land on 0 a single time

dull saffron
#

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

ashen fossil
#

ah, should i procrand with shifting seed then?

#

smth like this?

dull saffron
#

maybe

#

it might be the rng cant ever return 0 because thatd get it in a bad state

ashen fossil
#

yeah okay it still just doesnt seem real

#

nothing at 300 million

dull saffron
#

there are 4 billion states

ashen fossil
#

previously i hit 1 a few times within 100 million

ashen fossil
dull saffron
#

ideally there shouldnt be

ashen fossil
#

im gonna say it seems highly likely that 0 is not a possible return value, feel free to check the code to verify

dull saffron
#

i think it should be able to return -0?

#

try change your condition to <= 0

ashen fossil
#

i put in a check for less than 0 separately tho

ashen fossil
dull saffron
#

apparently -0 = 0

ashen fossil
#

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

dull saffron
#

ig it can never be returned

ashen fossil
#

yeah, im throwing this in now

#

i believe this is the correct representation

dull saffron
#

evil

ashen fossil
#

check PR, i pushed changes and built

dull saffron
#

did you run python formatter?

#

its just black

ashen fossil
#

?

dull saffron
#

seems to be formatted correctly

ashen fossil
#

worked fine for me idk what you're saying

dull saffron
#

formatter

ashen fossil
#

i dont think i have a formatter

dull saffron
#

it uses black

ashen fossil
#

if theres a formatting issue surely you can fix it on your end

#

wdym it uses black i dont know what you're saying

dull saffron
#

black formatter

ashen fossil
#

is that like, the name of a formatter???

dull saffron
#

yes

ashen fossil
#

got it

dull saffron
#

its not ideal

ashen fossil
#

i didnt afaik

dull saffron
#

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

ashen fossil
#

i dont have any python extensions installed

#

wait no

#

i do have some

#

these are all

#

should i replace spaces with proper tabs rq?

dull saffron
#

no

#

if black actually worked with tabs then i wouldd

ashen fossil
#

k ill just leave this to you then

dull saffron
#

but not having a formatter is too irritating

ashen fossil
#

W changes merged

ashen fossil
#

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

polar trout
ashen fossil
#

yeah i found those, someone should put that into the lua defs

#

(im in lesson rn)

dull saffron
ashen fossil
#

yes and best excuse to not do documentation, get on that nather!!

dull saffron
#

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

polar trout
#

am working two jobs and have a family at home, can someone else pls do it

ashen fossil
#

i guess nathan's the only one available enough to do it 😔

dull saffron
#

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

ashen fossil
#

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

dull saffron
#

not a string

ashen fossil
#

Isn’t everything supposed to be accepted as string in the xml file format?

dull saffron
#

?

#

the issue is that its using e notation which xs:decimal doesnt work

#

we need a new number type

polar trout
#

do we

dull saffron
#

yes

#

it can parse e stuff fine

polar trout
#

the game doesn't use it tho

#

as well as mSerializedData

dull saffron
#

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

polar trout
#

yeah, but

#

who in the right mind will use the e notation

dull saffron
#

noller entity_hamis

polar trout
#

they won't use xds def

dull saffron
#

true

#

we have to read their code though

polar trout
#

it's just CE export

dull saffron
#

yes

polar trout
#

do they really use e notation

ashen fossil
#

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

dull saffron
#

mSerializedData is base 64

#

the underlying data is not recognisable by an xsd pattern

#

but doing a b64 string could be easy enough

ashen fossil
#

Used for poly iirc?

dull saffron
#

yes

ashen fossil
#

^ 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

dull saffron
ashen fossil
#

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?

dull saffron
#

also your lua_gettop type is wrong

ashen fossil
#

p sure you were there for that

#

i dont remember setting the type for lua_gettop

dull saffron
#

it might be std::string::from_cstr

dull saffron
ashen fossil
#

oh rly?

#

lua.h?

dull saffron
#

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

ashen fossil
#

todo: document ModSettingSetNextValue calling on ModSettingsUpdate after it runs, seemingly only in-game?

#

also document is_default being annoying for no reason

ashen fossil
#

nather

#

nather please we need biome xml defs

#

im trynna make random corrupted biome stuff

#

@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