Skip to content

WIP mod support#1313

Open
Vagabond wants to merge 45 commits intomasterfrom
adt/mod-support
Open

WIP mod support#1313
Vagabond wants to merge 45 commits intomasterfrom
adt/mod-support

Conversation

@Vagabond
Copy link
Copy Markdown
Member

@Vagabond Vagabond commented Sep 22, 2025

Things to do:

  • Require a mod manifest in each zip file
  • Either do not load mods in netplay mode, or load only cosmetic changes (would require retaining original sprites for compatible collision detection)
  • Fix all the memory leaks
  • Support for replacing sound samples
  • Support for sprite information like collision coordinates, offsets and index reuse
  • Support for tournament pilot photos/logos to be higher resolution
  • Switch from file IDs to filenames (eg scene_id 8 -> "ARENA0", har_id 1 -> "FIGHTR1")
  • unify with https://www.omf2097.com/wiki/doku.php?id=openomf:openomf_mod_folder_structure

Depends on #1312 to properly display high-res assets.

unsigned long long entry_size = zip_entry_uncomp_size(zip);
void *entry_buf = omf_calloc(entry_size, 1);
if(zip_entry_noallocread(zip, entry_buf, entry_size) < 0) {
log_warn("failed to load %s into memory", zip_entry_name(zip));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

continue;

?

}

str filename;
str_from_format(&filename, "tournaments/%s/tournament.ini", tournament_name);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

str_free() seems to be missing before the next call to str_from_format

// For arenas, check for 'common' for anim_ids 6 (round), 7 (number), 8 (you lose), 9 (you win), 10 (fight),
// 11 (ready), 24 (dust 1), 25 (dust 2), 26 (dust 3), 27 (match counters)

str_from_format(&filename, "scenes/common/%d/animdata.ini", anim_id);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

matching str_free() missing


// Convert
af_create(a, &tmp);
af_create(a, &tmp, &fn);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

str_free(fn)


// Convert
bk_create(b, &tmp);
bk_create(b, &tmp, &fn);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

str_free(fn)

unsigned char *buf;
size_t len;
// check the modmanager here for a music mod
path_stem(&music, &fn);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

str_free(fn)

#include <confuse.h>

#define UPDATE_FIELD_INT(field_name, struct_field, new_value) \
if(new_value != 0 && struct_field != new_value) { \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

btw, I guess this means that mods cannot set field values intentionally to 0, ever ? Is that okay ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same for floats, I suppose

@Vagabond
Copy link
Copy Markdown
Member Author

"Prevent most mod assets loading during netplay" -- most. What is allowed ?

music and arena backgrounds right now

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants