Skip to content

Conversation

@someone2639
Copy link
Collaborator

@someone2639 someone2639 commented Feb 8, 2025

One of those inbetween PR's that will make object streaming:tm: less painful

Scope:

  • Make Model ID's an enum
  • Remove fully unused ID's (i.e. ones that have never had a geolayout associated with them, not ones that have geos but arent used in vanilla)
  • Eliminate model ID collisions by assigning one model to one geo (MODEL_ID_COUNT is 511 under this PR so gLoadedGraphNodes isn't even doubled in size by default)
    • MODEL_LEVEL_GEOMETRY_XX ID's are no longer shared as a result
  • Delete ModelID8 because MODEL_ID_COUNT won't fit by default anymore; rename ModelID16 to just ModelId (Should I just make it 32 bit?)
  • Merge all instances of shared models such as Warp Pipes and Doors
  • Migrate some common1 loads to level_main_scripts_entry to prevent crashes (and allow warp pipes to be used in levels by default)

@someone2639 someone2639 added monkaS monkaS subjective Multiple opinions are desirable labels Feb 8, 2025
@gheskett
Copy link
Collaborator

gheskett commented Feb 8, 2025

Note on enums in general is fast64 integration will need to be implemented before this can be merged.

@gheskett gheskett added the needs fast64 integration Dependent on changes to fast64 label Feb 8, 2025
@arthurtilly
Copy link
Collaborator

what. do you think fast64 uses hardcoded model ids.

@gheskett
Copy link
Collaborator

gheskett commented Feb 8, 2025

It uses defines. How do we know the current implementation is compatible (because it probably isn't).

@arthurtilly
Copy link
Collaborator

bro

@arthurtilly arthurtilly removed the needs fast64 integration Dependent on changes to fast64 label Feb 8, 2025
@gheskett
Copy link
Collaborator

gheskett commented Feb 8, 2025

Test it please.

@arthurtilly arthurtilly added the needs fast64 integration Dependent on changes to fast64 label Feb 8, 2025
Copy link
Collaborator

@gheskett gheskett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR won't see approval until fast64 is updated to support this for 3.0.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please neaten up the line spacing for geo comments, like how they were previously.


// actor model IDs

// first set of actor bins (0x54-0x63)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment no longer relevant.

Also regarding actor entries, the way this is being laid out now doesn't reuse entries, wasting memory. I don't have a good solution proposed for checking against the largest group entries though (and memory loss is probably not huge), so this will be a non-blocking concern.

const LevelScript script_func_global_13[] = {
LOAD_MODEL_FROM_GEO(MODEL_BOWSER, bowser_geo),
LOAD_MODEL_FROM_GEO(MODEL_BOWSER_BOMB_CHILD_OBJ, bowser_bomb_geo),
LOAD_MODEL_FROM_GEO(MODEL_BOWSER_BOMB, bowser_bomb_geo),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace moment

JUMP_LINK(script_func_global_17),
JUMP_LINK(script_func_vo_sl),
LOAD_MODEL_FROM_GEO(MODEL_SL_SNOW_TREE, snow_tree_geo),
LOAD_MODEL_FROM_GEO(MODEL_SNOW_TREE, snow_tree_geo),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this go in the actual vanilla objects file?

Copy link
Collaborator

@gheskett gheskett Feb 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait no it shouldn't, this is part of common1 (so it should be global then). Don't forget about CCM though!

Copy link
Collaborator

@gheskett gheskett Feb 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I'm looking at it...there's actually a lot of common1 geos unaccounted for here. I still think it makes the most sense to globally load all of them, but I guess technically this is a (mostly insignificant) waste of RAM for most hacks.

Also, this is slightly out of scope probably, but can you make the common1 and group0 geo loads for scripts.h into their own jump scripts? The main level entry script is getting pretty messy, plus a jump script has use cases for non-standard level scripts.

@gheskett gheskett added this to the 3.0 milestone Feb 16, 2025
@gheskett gheskett marked this pull request as draft February 20, 2025 19:11
@gheskett
Copy link
Collaborator

Converted to draft until fast64 implementation is addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

monkaS monkaS needs fast64 integration Dependent on changes to fast64 subjective Multiple opinions are desirable

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

3 participants