Giter VIP home page Giter VIP logo

libsm64-godot's Introduction

libsm64-godot

Addon that binds libsm64 to godot via GDExtention, allowing to integrate mario into any Godot 4 project.

SM64 Mario in GDQuest demo

Projects using libsm64-godot

Infinite Mario 64 (by TwilightPB) Infinite Mario 64 (by TwilightPB)

Current Godot compatibility

Currently compatible with Godot 4.2.x, with binaries compiled for Windows and Linux (untested) 64 bits. Check the Releases for the files.

How to compile the GDExtension

If you just clone the project throught Git and attempt to run it, you'll get errors complaining about the lack of the GDExtension library (the project zip file in the Releases page already has the necessary binaries packaged).

First, build libsm64 and then copy (don't move) the genereated dynamic library from the extension/libsm64/dist/ folder into addons/libsm64-godot/extension/bin.

Setup the requirements for building Godot with MinGW. Then, run the following command from inside of the extension folder to compile the GDExtension. It will automatically copy the generated binary into addons/libsm64-godot/extension/bin.

  • For debug build: scons target=template_debug use_mingw=yes
  • For release build: scons target=template_release use_mingw=yes

Note: if you are using MSYS2 to compile, you must run this command from the MSYS2 MINGW64 terminal window.

How to use

This add-on consists of two main components:

  • SM64Global: Singleton that exposes the init() and terminate() functions of the libsm64 library.
  • SM64Mario: Extends Node3D; can have multiple in any scene.

It also adds two helper nodes:

  • SM64StaticSurfaceHandler: Extends Node; provides helper functions to load all the meshes under the libsm64_static_surfaces group into the libsm64 world.
  • SM64SurfaceObjectsHandler: Extends Node; provides helper functions to load and update all the meshes under the libsm64_surface_objects group into the libsm64 world.

This add-on requires a Super Mario 64 (USA) ROM file (for legal reasons, steps to get a ROM will not be disclosed). Make sure the ROM file has the following SHA256 hash:

17ce077343c6133f8c9f2d6d6d9a4ab62c8cd2aa57c40aea1f490b4c8bb21d91

If the SHA256 doesn't match, it will be rejected and the addon will fail to initialize.

Simple steps for basic use

When creating the scene:

  1. Add a SM64StaticSurfaceHandler node to the scene.
  2. Add the meshes that compose the world to the libsm64_static_surfaces group (NOTICE: use simple, low-polycount meshes for best results).
  3. Add a SM64Mario node (or as many as you want) and set its camera property with an Camera3D node.
  4. Create the action names that are in the SM64Mario node's Input Actions export group in the project's Input Map and bind them to the appropriate axes/buttons/keys.

Then do the following on the scene's main script:

  1. Feed the SM64Global singleton the file path to the Super Mario 64 ROM file (SM64Global.rom_filepath = "path/to/rom/file").
  2. Configure the SM64.Global.scale_factor property if necessary (try default value first).
  3. Call the SM64Global.global_init() function.
  4. Call StaticSurfaceHandler.load_static_surfaces() on your instanced SM64StaticSurfaceHandler node.
  5. Call SM64Mario.create() on your instanced SM64Mario node(s).

For more detailed instructions refer to the manual.

libsm64-godot's People

Contributors

brawmario avatar gapva avatar jscottmiller avatar

Stargazers

林建傑 avatar  avatar  avatar bollombollom avatar  avatar  avatar skyler avatar  avatar CheySha avatar Quartzmaven avatar Kamil Krzyśków avatar  avatar Ahmed Maawy avatar AknJ avatar NintenHero avatar Shehab Ali Tweel avatar  avatar Albert Armea avatar Jonathan West avatar nightblade9 avatar Thomas Crow avatar Devan Ferguson avatar ibisrecordings avatar Harrison avatar  avatar  avatar Alessio Delmonti avatar Carlos Benito Jareño avatar kris avatar Jacob Herrera avatar lolisamurai avatar  avatar Adam avatar Luis Arturo Pacheco avatar Aleph Diallo avatar Moomit avatar Peter Goodlad avatar Emanuel Acosta Gonzalez (emanvidmaker) avatar  avatar Mischief Aaron avatar  avatar eros71 avatar Luisroobert avatar  avatar  avatar Akash Goswami avatar Sabbers avatar  avatar NarreDev avatar Nick Shockey avatar alaska avatar  avatar Jonas Reitan avatar ckoshiro avatar Benjamin Westphal avatar 6bir avatar Master Tanker avatar Lewis James avatar Sarah B. avatar  avatar  avatar  avatar  avatar  avatar Jordan Brown avatar  avatar James Czekaj avatar Ny'hrarr avatar cz avatar Hugo Locurcio avatar James McMurray avatar mastrio avatar Kevin avatar Jack Jamison avatar Eric Cameracci avatar Ryhon avatar  avatar  avatar  avatar Sean Ramey avatar Media Explorer avatar Larson T. avatar bperris avatar dd avatar dusk avatar  avatar  avatar Axel avatar Aaron Benjamin avatar ana avatar  avatar Jack Freund avatar Luca Talevi avatar Benjamin Stanley avatar Ed_ avatar  avatar Benjamin Levy avatar Halim Bimantara avatar Matias Ricarte avatar  avatar

Watchers

James Cloos avatar hashalon avatar  avatar PERLOT Maxence avatar  avatar Wall_E20 avatar

libsm64-godot's Issues

doesnt work

does not create a autoload SM64Global.
Error loading extension: res://addons/libsm64-godot/extension/libsm64.gd.gdextension.

Extensibility questions

Hi,

Is this project still under development?

I have a few ideas I an thinking of making, but I need some clarification on what is and isn't possible, given that a lot of behaviour isn't in gdscript. I looked through all the extension and addon code, but couldn't figure it out.

  1. Is there any way to override behaviours to do something else? E.g. pressing B doesn't punch, and/or executes my custom code. I see an action signal in Mario's class, but no way to interrupt existing behaviour.

  2. is it possible to change Mario's behaviour, selectively or entirely? Maybe recolour red to blue, or something simple like like adding a modulate color.

  3. Is there any way to get different instances of Mario to react to different gamepads?

[Feature Request] BehaviorScripts

Would be neat to be able to apply them to objects like you can with the surface properties, although I assume this is a limitation with libsm64 because I can't find them being implemented there, so I'm not sure if it's actually possible.

plugin not properly detecting ROM

a fresh, untouched ROM of SM64 (or any SM64 rom, untouched or not) doesn't work as of 11/3/2022 on Godot 4 - Beta 3.

in the example project, the integrated filesystem tells me i have an "invalid or corrupt" ROM.

Surface Properties are... strange?

I tried for quite a while but couldn't seem to find a stable ground on how surfaces properties were being handled. Specifically slippery and various surfaces. I got some of them to work, but it really seemed like it was a hit-or-miss situation. The one I finally got to do something was using SurfaceType:Timer Start, with TerrainType:Sand. I don't think Force did anything here, but the result was Mario sinking into quicksand.

I'm not the best at extrapolating information, so I'm sure I'm doing something incorrectly here haha

Mario clips through thin walls

In the Bob-omb Battlefield example, Mario clips one way through the fences. It seems to depend on which way the normals are facing, but if you have a thin object with collision Mario will clip through it even if you have normals facing out on both sides.

Discord?

I was wondering if there is a discord for this project since it seems very interesting and I see a lot of potential in it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.