Code Monkey home page Code Monkey logo

metaforce's Introduction

Metaforce Build Status Discord Badge

A reverse-engineered, native reimplementation of Metroid Prime.

This project is currently in alpha state.
Builds are currently unavailable while the project undergoes large changes.

Separately, a matching decompilation of Metroid Prime is currently underway. Contributions are welcome.
Progress on the decompilation benefits Metaforce with bug fixes and new implementations.

Metaforce screenshot

Platform Support

  • Windows 10+ (64-bit, D3D12 / Vulkan / OpenGL)
  • macOS 10.15+ (Metal)
  • Linux (Vulkan / OpenGL)
    • Follow this guide to set up Vulkan & appropriate drivers for your distro.

Usage

Windows:

  • Open metaforce.exe

macOS:

  • Open Metaforce.app

Linux:

  • Ensure AppImage is marked as executable: chmod +x Metaforce-*.AppImage
  • Open Metaforce-*.AppImage

CLI options (non-exhaustive)

  • -l: Enable console logging
  • --warp [worldid] [areaid]: Warp to a specific world/area. Example: --warp 2 2
  • +developer=1: Enable developer UI

Build Prerequisites:

  • CMake 3.15+
    • Windows: Install CMake Tools in Visual Studio
    • macOS: brew install cmake
  • Python 3+
    • Windows: Microsoft Store
      • Verify it's added to %PATH% by typing python in cmd.
    • macOS: brew install python@3
  • [Windows] Visual Studio 2019 Community
    • Select C++ Development and verify the following packages are included:
      • Windows 10 SDK
      • CMake Tools
      • C++ Clang Compiler
      • C++ Clang-cl
  • [macOS] Xcode 11.5+
  • [Linux] Actively tested on Ubuntu 20.04, Arch Linux & derivatives.
    • Ubuntu 20.04+ packages
      build-essential curl git ninja-build clang lld zlib1g-dev libcurl4-openssl-dev \
      libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \
      libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 \
      libclang-dev libfreetype-dev libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev
      
    • Arch Linux packages
      base-devel cmake ninja llvm vulkan-headers python python-markupsafe clang lld alsa-lib libpulse libxrandr freetype2
      
    • Fedora packages
      cmake vulkan-headers ninja-build clang-devel llvm-devel libpng-devel
      
      • It's also important that you install the developer tools and libraries
        sudo dnf groupinstall "Development Tools" "Development Libraries"
        

Prep Directions

git clone --recursive https://github.com/AxioDL/metaforce.git
cd metaforce

Update Directions

cd metaforce
git pull
git submodule update --recursive

Build Directions

For Windows, it's recommended to use Visual Studio. See below.

ninja (Windows/macOS/Linux)

Builds using RelWithDebInfo by default.

cmake -B out -G Ninja # add extra options here
cmake --build out --target metaforce hecl visigen

CMake configure options

  • Build in debug mode (slower runtime speed, better backtraces): -DCMAKE_BUILD_TYPE=Debug
  • Use clang+lld (faster linking): -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
  • Optimize for current CPU (resulting binaries are not portable): -DMETAFORCE_VECTOR_ISA=native

CLion (Windows/macOS/Linux)

(main development / debugging IDE)

Open the repository's CMakeLists.txt.

Optionally configure CMake options via File > Settings > Build, Execution, Deployment > CMake.

Qt Creator (Windows/macOS/Linux)

Open the repository's CMakeLists.txt via File > Open File or Project.

Configure the desired CMake targets to build in the Projects area of the IDE.

Visual Studio (Windows)

Verify all required VS packages are installed from the above Build Prerequisites section.

Open the metaforce directory in Visual Studio (imports CMake configuration).

MSVC and clang-cl configurations should import automatically.

Xcode (macOS)

cmake -G Xcode ../metaforce

Then open metaforce.xcodeproj

metaforce's People

Contributors

antidote avatar boofoof32 avatar cobalt2727 avatar encounter avatar henriquegemignani avatar jackalstomper avatar jackoalan avatar jcw87 avatar linkmauve avatar lioncash avatar phazonjim avatar shiiion avatar sirmangler avatar zero-one101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

metaforce's Issues

URDE does not build on Windows since commit @43c8cdf

I've been trying to compile URDE since @43c8cdf on VS 2015 and Qt, but I think it may extend from @b9baa84.

VS 2015 Build log at latest commit, from Win7 x64. EDIT: Windows 10 AU x64 reports an almost identical log.

EDIT 3: Qt Build log at latest commit, from same machine, sharing error C2665 with the previous log.

This issue may be related to #19, since errors C2027 and C2338 which I suppose are the main errors that cause this issue, appear repeatedly in my log.

EDIT 2: @DiThi tried to build at latest commit and @a2b07ba on Kubuntu, but had this error instead.

MP1/Tweaks/PlayerRes.yaml fields shifted by two lines

I created a new Metroid Prime 1 project with "hecl extract /path/to/iso ./"
Then I tried to import it in urde, but encountered the following error:
[588.4102 ERROR urde::ProjectResourceFactoryBase (Boo Client Thread)] MP1/GGuiSys/YButtonOut.png: expected type 'ANCS', found 'TXTR'
[588.4104 ERROR urde::ProjectResourceFactoryBase (Boo Client Thread)] unable to spin-build ANCS 8419F209
We can trace the error back to "MP1/Tweaks/PlayerRes.yaml" fields, most of which are shifted by two lines. I don't know why, however :/
(Maybe the empty "case SBIG('CTWK')" at line 388 in DataSpec/DNAMP1/DNAMP1.cpp which executes the following "case SBIG('DUMB')" ?)

Cannot build project. At all.

here is my log: http://pastebin.com/qiRBnbkF
there are a LOT of errors here that shouldn't be there, can you please fix this?
Also, I wanted to build this project to get a better idea of how the thermal visor's pallet is generated, for my Minecraft Mod Metroid Cubed 3.

Program Will Not Run

image
After having to manually download 3 .dll files, I got this error, and could not make further progress.

Thermal Visor graphical issues

  • Super Missile impact doesn't render alpha correctly
  • Elite Pirate grenade impact doesn't render alpha correctly
  • Plasma beam impact doesn't render alpha

Add support for PBR lighting and textures

Adding support for physically-based rendering will result in being able to display photo-realistic textures on meshes based on how light actually works, as opposed to the assumptions made in non-PBR setups.

"unable to install blender addon using,'C'", and,"unexpected PAK magic" Help?

Just freshly downloaded everything I need to get going with extracting, and whenever I attempt to extract any .iso, I get one of the two messages above. The first message comes after hitting y to go forward with the extraction, and the other one appears as soon as I attempt to extract certain .iso's. Any idea how I can fix this? I'm probably just doing something obviously wrong, I'm just new to this is all.

Flaahgra issues

  • Missing most attacks
  • Tentacles sometimes activate while fainted
  • Damage color is incorrect
  • Faint direction is wrong
  • Gets stunned by a single shot
  • Scaling animation somewhat janky
  • Sun reflector re-activate animation doesn't work right (ThinkSpinnerController issue?)
  • Flaahgra doesn't shrink after bomb slot activated

Metroid Alpha issues

  • Incomplete implementation for attacking Space Pirates
  • Incomplete implementation for Gamma Metroids
  • Hitbox and target position are broken
  • Metroids in Research Core (and elsewhere) get stuck in ceiling of their spawn area

unable to install blender addon using 'C'

I'm having the same problem Morningshadows had with the program. I installed Blender (2.76b), already had MSVC 2015 CRT installed and a PAL iso of Metroid Prime that works fine with Dolphin (GM8P01 and 694e7ceeaaa3cd68c693f1d2e4b4f48a). I'm using Windows 10.

After using the command line hecl extract "Metroid Prime.iso" it tells me what's about to get exported and then tries to establish connection with Blender, but fails when it's about to install the blender addon.

blender_addon_issue

MP3 Materials erroneously marked as Additive

Some materials are being erroneously marked as additive, as a result materials are being improperly blended.

An example of this is the Leviathan Infant:
Metroid6/06_Phaaze_#SERIAL#/07 Genesis Chamber/00a Default/CMDL_5F49A5452B1491BC.blend

Puddle Spore issues

  • Missing KnockPlayer implementation
  • Doesn't respond to beam shots
  • Probably more, needs double-checking

Unable to extract MP2, fatal error during FrontEnd.pak

As title says, during AudioGrp.pak, the error "[Fatal Error BlenderConnection] error sending 'bpy.types.Material.retro_depth_sort = bpy.props.BoolProperty(name='Retro: Transparent Depth Sort')' to blender" causes hecl to crash. When I attempt to put python output into a log.txt, I get:

Initialized project at 'E:\MetroidExtractor\MetroidPrime2\rtc-mp2/.hecl
Constructed tool 'extract' 2

After this nothing happens until I press enter again and then I get two instances of:

AL lib: UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead

An MD5 of ce781ad1452311ca86667cf8dbd7d112 was acquired from my image.

Blender version is 2.76, running Windows 7 x64

Can I disable Vulkan?

Not bug, but more like a question.
Can you disable vulkan at boo submodule from urde cmake?

Another linking error.

/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/libLLVMSupport.a(Process.cpp.o): undefined reference to symbol 'set_curterm'
/usr/lib/libtinfo.so.6:error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [hecl/extern/athena/atdna/CMakeFiles/atdna.dir/build.make:97: hecl/extern/athena/atdna/atdna] Błąd 1
make[1]: *** [CMakeFiles/Makefile2:1342: hecl/extern/athena/atdna/CMakeFiles/atdna.dir/all] Błąd 2

Amuse priority handling

Necessary to avoid issues with loud overlapping SFX.

Known to affect:

  • Tangle weeds
  • Central Dynamo maze

Prototype 7 crashes extracting Metroid Prime 1 ISO

The first time I ran extract on my Prime 1 ISO (1.0 NTSC, CRC32:852B658C) it finished completely. The first time I extracted I was to my user folder (C:\Users\athairus) and extracted there just fine.

I had noticed the program left shortcut files instead of symlinks so I decided that moving the files to a better location was not feasable. Instead, I just ran the command in a different folder. It always crashes now with the message: [x.xxxx FATAL ERROR BlenderConnection] Invalid argument. It doesn't crash in the same place each time.

All I can say is the crash has nothing to do with spaces in the path... I wish I could provide more info but the build from the forums doesn't have any debug symbols.

Here's a raw pastebin with several attempts. The first attempt failed because I had to install Blender, the next attempt was the only successful one.

http://pastebin.com/yaBzRvP9

Blender 2.76b
Windows 10 x64

Space Pirate issues

  • Model goes crazy sometimes (potentially related to collision, happens often in Control Tower)
  • Glowing eyes missing

HECL Proto 10 - FATAL ERROR Blender Exception

I have Windows 7 Professional SP1 with Blender 2.77 EXACTLY from the blender old downloads page and the microsoft visual c++ redistributable. I have a folder set up at my drive's root (C:/) with a name of "hecl". Inside of the "hecl" folder is ISO of metroid prime v.1.0 NTSC named "mp1.iso" and hecl named "hec.exe". Then I take ownership of the "hecl" folder. After that, I run command prompt as admin and navigate to the "hecl" folder using cd command. Then I run the command "hecl extract mp1.iso". It then starts to index the PAKs and extract the root, however, after starting to extract "Metroid2.pak", hecl crashes.
The log of hecl via cmd shows as:

C:\hecl>hecl extract mp1.iso
[0.0043 INFO hecl::Driver] initialized project at 'C:\hecl\mp1/.hecl'
ABOUT TO EXTRACT:
MP1 [Metroid Prime NTSC (Build v1.088 10/29/2002 2:21:25)]
  AudioGrp.pak
  GGuiSys.pak
  Metroid1.pak [Space Pirate Frigate]
  Metroid2.pak [Chozo Ruins]
  Metroid3.pak [Phendrana Drifts]
  Metroid4.pak [Tallon Overworld]
  metroid5.pak [Phazon Mines]
  Metroid6.pak [Magmoor Caverns]
  Metroid7.pak [Impact Crater]
  Metroid8.pak
  MidiData.pak
  MiscData.pak
  NoARAM.pak
  SamGunFx.pak
  SamusGun.pak
  SlideShow.PAK
  TestAnim.Pak
  Tweaks.Pak


Continue? (Y/n)
Using DataSpec MP1:
[2.3235 INFO hecl::BlenderConnection] Establishing BlenderConnection...

  Indexing PAKs                                                                      100% [###########################################################################]
  MP1 Root                                                                           100% [###########################################################################]
[9.0006 INFO hecl::BlenderConnection (HECL Client Worker 1)] Establishing BlenderConnection...
[99.4531 FATAL ERROR hecl::BlenderConnection (HECL Client Worker 1)] Blender Exception
17:  - 0x0
16:  - 0x0
15:  - 0x0
14:  - 0x0
13:  - 0x0
12:  - 0x0
11: std::basic_streambuf<char,std::char_traits<char> >::xsputn - 0x7FEEF0EF740
10: std::basic_ostream<wchar_t,std::char_traits<wchar_t> >::write - 0x7FEEF119940
9: std::basic_ostream<wchar_t,std::char_traits<wchar_t> >::write - 0x7FEEF119940
8: std::basic_ostream<wchar_t,std::char_traits<wchar_t> >::write - 0x7FEEF119940
7: std::basic_ostream<wchar_t,std::char_traits<wchar_t> >::write - 0x7FEEF119940
6: std::basic_ostream<wchar_t,std::char_traits<wchar_t> >::write - 0x7FEEF119940
5: std::basic_ostream<wchar_t,std::char_traits<wchar_t> >::write - 0x7FEEF119940
4: std::basic_ostream<wchar_t,std::char_traits<wchar_t> >::write - 0x7FEEF119940
3: std::basic_ostream<wchar_t,std::char_traits<wchar_t> >::write - 0x7FEEF119940
2: crt_at_quick_exit - 0x7FEE5B0BDA0
1: BaseThreadInitThunk - 0x77A159C0
0: RtlUserThreadStart - 0x77B4A540

Omega Pirate issues

  • Hitbox for armor pieces is broken
  • Logic for choosing Phazon Pool to warp to may be inaccurate

Metroid Prime Trilogy is unable to be completely extracted.

Whenever I try to extract my Metroid Prime Trilogy ISO, it always just....stops extracting at 3% through the Metroid1.pak of Metroid Prime. No error message, no interaction from me, it just returns to the command line.

HECL however has worked in extracting a Prime ISO and an Echoes ISO separately, exporting all files.

Windows 10, Blender 2.79. ISO is Metroid Prime Trilogy USA.iso. Paths removed, but are consistent.

C:\...\Metroid Prime_ Trilogy (USA) WII ISO>hecl extract "Metroid Prime Trilogy USA.iso"
[0.0416 INFO hecl::Driver] initialized project at 'C:\...\Metroid Prime_ Trilogy (USA) WII ISO\Metroid Prime Trilogy USA/.hecl'
[0.0443 INFO AssetNameMap] Initializing asset name database...
ABOUT TO EXTRACT:
MP1 [Metroid Prime NTSC (2008/08/21 17:09 Build v3.593 (RS5))]
  AudioGrp.pak
  GGuiSys.pak
  Metroid1.pak [Space Pirate Frigate]
  Metroid2.pak [Chozo Ruins]
  Metroid3.pak [Phendrana Drifts]
  Metroid4.pak [Tallon Overworld]
  metroid5.pak [Phazon Mines]
  Metroid6.pak [Magmoor Caverns]
  Metroid7.pak [Impact Crater]
  Metroid8.pak
  MidiData.pak
  MiscData.pak
  NoARAM.pak
  RS5.pak
  SamGunFx.pak
  SamusGun.pak
  SlideShow.PAK
  Strings.pak
  TestAnim.Pak
  Tweaks.Pak

MP2 [Metroid Prime 2 NTSC (2008/08/21 17:09 Build v3.593 (RS5))]
  AudioGrp.pak
  FrontEnd.pak
  GGuiSys.pak
  LogBook.pak
  Metroid1.pak [Temple Grounds]
  Metroid2.pak [Great Temple]
  Metroid3.pak [Agon Wastes]
  Metroid4.pak [Torvus Bog]
  Metroid5.pak [Sanctuary Fortress]
  Metroid6.pak
  MidiData.pak
  MiscData.pak
  NoARAM.pak
  RS5.PAK
  SamGunFx.pak
  SamGunFxLow.pak
  SamGunFxMulti.PAK
  SamusGun.pak
  SamusGunLow.pak
  SlideShow.PAK
  Strings.pak
  TestAnim.pak

MP3 [Metroid Prime 3 NTSC (2008/08/21 17:09 Build v3.593 (RS5))]
  GuiDVD.PAK
  GuiNAND.PAK
  InGameAudio.PAK
  InGameDVD.PAK
  InGameNAND.PAK
  Logbook.PAK
  Metroid1.pak [G.F.S. Olympus, G.F.S. Valhalla, Norion]
  Metroid3.pak [Bryyo]
  Metroid4.pak [SkyTown, Elysia]
  Metroid5.pak [Pirate Homeworld]
  Metroid6.pak [Phaaze]
  Metroid7.pak [Bryyo Seed, Elysia Seed, Pirate Homeworld Seed]
  Metroid8.pak [Space]
  MiscData.pak
  NoARAM.pak
  RS5.PAK
  SamGunFx.pak
  SamusGun.pak
  UniverseArea.pak
  Worlds.pak

fe [Metroid Prime Trilogy Frontend NTSC (2008/08/21 17:09 Build v3.593 (RS5))]
  GuiDVD.PAK
  GuiNAND.PAK
  InGameAudio.PAK
  InGameDVD.PAK
  InGameNAND.PAK
  MiscData.pak
  NoARAM.pak
  RS5FE.PAK
  UniverseArea.pak


Continue? (Y/n)
Using DataSpec MP1:
[2.6206 INFO hecl::BlenderConnection] Establishing BlenderConnection...

  Trilogy Files                                              100% [###################################################]
  Indexing PAKs                                              100% [###################################################]
  MP1 Root                                                   100% [###################################################]
[38.4820 INFO hecl::BlenderConnection (HECL Client Worker 3)] Establishing BlenderConnection...
[43.8194 INFO hecl::BlenderConnection (HECL Client Worker 1)] Establishing BlenderConnection...
[47.1791 INFO hecl::BlenderConnection (HECL Client Worker 2)] Establishing BlenderConnection...
[59.2270 INFO hecl::BlenderConnection (HECL Client Worker 0)] Establishing BlenderConnection...
  Metroid1.pak                                 CSKR_029CB0A8   3% [#--------------------------------------------------]
C:\...\Metroid Prime_ Trilogy (USA) WII ISO>

Blender connection issue on Windows

i was going to try out your program, but it always failed at Establishing BlenderConnection, with a Fatal Error: unable to install blender addon using 'C'

OS: Win7 64bit (german)
Blender 2.76b (in C:\Programme\Blender Foundation\Blender)
VS redist x64 installed
Using the precompiled hecl.p6e.win7-bit.exe
Also i deleted the folders created by hecl after each fail.

I've had issues with some programms before that didn't install into "Programme" because they were looking for "Program Files" and then threw their stuff into:
C:\VTRoot\HardDiskVolume

Drone issues

  • Crash in Research Core Access (layer bits 101, after collecting Thermal Visor)
  • More

Flying Pirate issues

  • Broken movement animation / possibly pathfinding?
  • Flying pirates in Research Core get stuck
  • Jetpack & sparks particles missing
  • Ragdoll behavior isn't accurate

Interrupting the extraction may produce broken files.

I've encountered a problem.
If you interrupt extraction some of the files extracted or converted may not be deletable at all.
Just throw a SIGKILL (Ctrl-C in unix) and try to delete the directory, where the files are extracted.

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.