Code Monkey home page Code Monkey logo

magic_carpet_2's Introduction

Magic Carpet 2

Based off the Reverse engineering of game Magic Carpet 2 from assembler to c/c++ language by Tomas Versly
Forked from Tomas Vesely's repo here: https://github.com/turican0/remc2

Tomas has done amazing work, not only reverse engineering this code but updating it to use more modern memory allocation and use the SDL library for input and sound. He has even increased the sprite resolutions.

about this fork

this is a linux-targeted repository and changes include:

  • major cleanup of the repository
  • added check/install script
  • added joystick/controller support
  • added haptic support
  • rewritten OpenAL support from scratch, now with positional audio
  • add playback of audio tracks containing the narrator voice-over
  • fixes for various crashes

see the ChangeLog for a more detailed list.

building on linux

Gentoo mode

if you use Gentoo, this game is part of my overlay. so compilation is as simple as

emerge mcarpet2

manual mode

  1. Pull the development branch using GitHub. When pulling the branch either do a recursive clone of the repository or ensure that after the pull you run: git submodule init and git submodule update
  2. Make sure that you have CMake, make and a recent GCC installed
  3. Make sure that you have the following dependencies as development packages (the exact names depend on your distro)
  • SDL2
  • SDL2_mixer
  • SDL2_image
  • SDL2_ttf
  • libpng
  • boost
  • OpenAL
  • spdlog
  1. Build the code
~ export BUILDTYPE=Debug # or Release
~ mkdir -p build
~ cd build
~ cmake -DCMAKE_BUILD_TYPE=${BUILDTYPE} -DCMAKE_INSTALL_PREFIX=./inst [SOURCE_DIR]
~ make
~ make install
  1. Magic Carpet 2 is now built. you can find it in build/inst/bin
    • You can also run the code with sanitizers (leak, address, undefined behaviour, pointers) by passing -DUSE_SANITIZERS=True to CMake
    • Additionally you can compile the code with clang-tidy analyzers by passing -DUSE_CLANG_TIDY=True to CMake

installing game assets and running the game

In order to run the game you need to own a copy of Magic Carpet 2. We provide a script to extract the assets from the GOG version. The following steps extract the required files from the original.

  1. Purchase a copy of Magic Carpet 2 from GOG here: https://www.gog.com/game/magic_carpet_2_the_netherworlds
  2. Install the game
  3. In order to retrieve the original game's assets run the following script located in the root of the repository:
mcarpet2_install.sh -s [directory where GOG installed MC2] -d [destination directory]
# for example :
mcarpet2_install.sh -s "${HOME}/.wine/drive_c/games/Magic Carpet 2/" -d ${HOME}/games/mcarpet2/

In case you already have the original game on CD, please follow these steps:

  1. place CD into drive and verify that it can be read
  2. run the following script, providing the correct device as source:
mcarpet2_install.sh -s /dev/cdrom -d [destination directory]
# for example :
mcarpet2_install.sh -s /dev/sr0 -d ${HOME}/games/mcarpet2/

Please note that if you have used any other method to get the assets, at least run a check to make sure that remc2 has access to every file it needs:

mcarpet2_install.sh -d [destination directory]
# for example:
mcarpet2_install.sh -d ${HOME}/games/mcarpet2/
 [ ok ] CD_Files directory
 [ ok ] GAME directory
 [ ok ] recode engine

this script will fix the permissions, make everything uppercase, check all file hashes and complain if any file is missing. it's also recommended that before the first run you remove the file GAME/NETHERW/CONFIG.DAT if it exists.

  1. NOTE: The game will search in the following locations (and in this particular order) for the game assets. For the flatpak only the first two locations can be used.

    1. $XDG_DATA_HOME/remc2/
    2. $HOME/.local/share/remc2
    3. next to the remc2 binary
  2. try out the game engine via the provided wrapper

mcarpet2
  1. get the optional HD textures and synth-generated soundtrack with
mcarpet2_install.sh -x -d [destination directory]
  1. Tweak the options in ~/.config/mcarpet2/config.ini

runtime configuration

Some settings can be configured via the file config.ini. An example for this file can be found in the root directory of the remc2 repository. The game will search for this file in the following locations and this particular order. For the flatpak only the first two locations can be used.

  1. $XDG_CONFIG_HOME/remc2
  2. $HOME/.config/remc2
  3. next to the remc2 binary

testimonials

screenshot

you are in the presence of greatness.

License

Original Source Code is Copyright 1995 Bullfrog Productions

Additonal Code is Licensed under the following MIT Licence:

Copyright 2022 Magic Carpet 2 HD

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

magic_carpet_2's People

Contributors

rodan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jopadan

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.