Repository navigation
feat: native mod framework + bunnyhopping and portal gun example mods - #66
Draft
kirjavascript wants to merge 6 commits into
Draft
kirjavascript wants to merge 6 commits into
kirjavascript wants to merge 6 commits into
Conversation
GE has no jump; this adds one as a Port action so it works on any device and respects the existing controls-live gate. The stan prop tests measure their height window from the floor, so it is lifted by Bond's height above the floor, and objects under him become his floor so a jump can land on crates. [input] jump_height sets the peak; 0 restores vanilla behaviour.
Stan edges carry no height, so a ledge or railing refuses a jump like a wall. While Bond is airborne and blocked by a tile edge, look for floor behind it within a step of his feet and cross if he fits and the room geometry shows no wall in the way. The bullet line test reports hits beyond the segment, so only hits between Bond and the landing spot count. GE_LEDGEDBG=1 logs why each attempt was taken or refused.
Jumping now keeps momentum: while airborne a CS-style velocity replaces the walk animation's motion, air strafing builds speed, a quick re-jump keeps it and holding jump auto-hops. Each part can be turned off (jumping, jump_height, jump_ledges, bhop, auto_bhop, speedometer), from midas.ini or the Port Options page, all on by default. Also declares fabsf for GCC: the IDO math.h hides it, and the implicit int version leaked an x87 stack slot per call until Bond's position went NaN and the level stopped drawing.
Jumping/bhop and the Portal Gun were patched straight into bondview2.c, joy_port.c and explosion.c, so every such tweak meant a rebuild and a heavier engine. They now live in mods/ as shared libraries loaded from Data/Mods at boot (port_mods.c, API in midas_mod.h), and the engine keeps only generic hook points and registries for options, binds, console commands, strings and spare item slots. A mod can be rebuilt without rebuilding the game. GE_MODS / midas.ini [mods] load= pick which mods run. Lua can later sit on top of the same host as one more mod (mods/README.md).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Primer
This PR is a forcing function for discussion of how a mod system could be implemented in Project Midas
I know it was suggested to support lua for mods; but I think we should support both native & lua mods
We can build the ability to support native mods first, then build the lua support on top of it: supporting both types of mods.
The mods are currently distributed as object files that you just need to put in
Datato have them work. They can be enabled with amidas.iniedit, or with environment variables.With this approach we get a lot of stuff for free: functions can just be external and immediately usable. We also get the full power and performance of using native languages.
Currently the examples are in C, but mods could be written in Rust or Zig, etc.
Legacy mods like goldfinger64 can be converted to this format still without too much trouble.
I expect to have feedback to action before merging this PR. It needs a cleanup, but I wanted to get others input befor committing to spending time on exactly how it should be. Certainly, more time needs to be spent on what exact hooks we should be using.
bhop.mp4
portal.mp4