Added a basic lua profiler
If the game is compiled with LUA_PROFILER=1, displays on screen the average execution time per frame of each active lua mod, in microseconds.
Added object functions
For some reasons, accessing the object fields obj.o* via lua is rather slow, and can drastically increase execution time of custom behaviors. For basic stuff like setting an object's velocity or moving it, some functions, missing from the original code, have been added:
s32 obj_is_valid_for_interaction(struct Object *o): returns 1 if an object is valid for interaction, i.e. active, tangible and not interacted.
s32 obj_check_hitbox_overlap(struct Object *o1, struct Object *o2): returns 1 if two objects hitboxes overlap. Doesn't check tangibility, only hitbox values.
void obj_set_vel(struct Object *o, f32 vx, f32 vy, f32 vz): sets an object's velocity.
void obj_move_xyz(struct Object *o, f32 dx, f32 dy, f32 dz): moves an object position by (dx, dy, dz).
Bug fixes:
Disable collisions with walls and ceilings after Mario exits a warp pipe to prevent softlocks in narrow places.
Make the koopa shell exclamation box respawn after some time.
Quicksand no longer downwarps and instant-kills Mario if he's shocked while being above it.
* Some bug fixes.
Fix Bully Star Spawning Cutscene to be player dependent.
Add missing line to Makefile.
Fix compile error with Clang in save_file.c
* Fix DDD Chests Star spawining in the wrong location.
Added mods folder for lua scripts
Created constants.lua so scripts could use constants internal to the C code
Created event hooks
Separated out lua functions into multiple files
The birth of a custom user interface system.
Has the ability to draw things to the screen at native resolution
regardless of window size.
Components can be nested within one another to an arbitrary depth.
Text rendering is completely rewritten.
Text and images can be clipped by their parent container.
* added a new audio bank 10 for luigi sounds
* made some audio memory buffers larger to fix sound cuts
* added option to enable/disable luigi sounds in the sound options menu
* added Andrat's "90's Classic Luigi Voice Pack" as default luigi sounds
Co-authored-by: anzz1 <>
Allows mods to register themselves so that mismatches don't occur. This
does not automagically detect when someone modified the game, so the
mods will have to insert a function like this into their patch:
static void __attribute__((constructor)) _register_this_mod() {
network_register_mod("mod name here");
}
Now a patch can choose to register callbacks for sending and receiving
packets. It's a bit tricky to use but at least it won't collide with
normal packets or other mod packets.
Due to my compile & launch scripts, I was silently ignoring warnings
this whole time. I've fixed my process, and gone back to fixed all of
the warnings I could (even outside of my code).
Added -DCOOP to identify that this is a coop build so that one patch can
be applied to EX and/or COOP. They can choose to ifdef entity synchronization
out.
There have been several times where the unpredictable behavior of
a remote player where execute_mario_action() would get caught in
an infinite loop. Now we attempt to detect an infinite hang and
escape from it. The sequence of actions will be recorded into an
errorlog.txt file. In debug mode this infinite hang will cause an
assertion to fail, crashing the game. In normal mode the game will
break out of it and hopefully carry on normally after new packets
come in.
I believe this addresses github issue #12 but I can't be sure.
along with options to select backends for windowing, rendering, audio and controls in the Makefile
use RENDER_API=D3D11 or D3D12 for the D3D renderers, that will also automatically enable using DXGI for windowing; SDL2 will still be used for input and audio for the time being
also adds three-point filtering to the OpenGL backend and an option for it in the menu