Giter Club home page Giter Club logo

openmom's Introduction

What's that?

OpenMoM is an attempt to rewrite from scratch a port of Master Of Magic game from Microprose.

The aim of the project is accuracy and extensibility: everything should be as much similar to the original game but at the same time the design should allow to easily tweak or extend the mechanics of the game itself.

How is it written?

The engine is written in C++14 and SDL2.0 is used for graphics, window management and controls.

The graphics engine is written to ease the management of the low level profile graphics of the original game. Everything is palette based and drawing is made by using an approach which probably resembles the one used originally for the game. While this implies that everything is quite low level, this really helps in mimicking the original behavior of most effects and animations. This also makes the grapichs quite abstract from the effective graphics framework as long as it is able to draw a texture.

Philosophy

While it might seems quite obsessive the first and more important thing is being similar to the original game in the first place. Every animation, font, colors, placement, should be as similar as possible to the original game. This doesn't mean that the game itself shouldn't be enhanced but that it should be possible to play it also as if it were the original game.

The implementation, though, should be extensible and well designed, especially regarding game data and behavior of things like spells, combat, AI.

Running

The code compiles on macOS with the provided XCode project, on Windows with the provided VS2017 project and on Debian Linux supposedly (through CMake). You need to copy all the original LBX files from the game into data/lbx to run the game.

The XCode and VS2017 projects also provide a LBX manager target which is used to see all the data inside LBX files and mark it as used.

On Windows you need to put your SDL2 libraries and includes inside libs/sdl2/win folder. Includes should go inside libs/sdl2/win/include while libs should go inside libs/sdl2/win/lib/x64/ (or x86) folder. Don't forget to put SDL2_Image too which is required to compile.

Current status

Master of Magic is a game of incredible complexity, each single and minor aspect is full of quirks and special considerations that have been made during the original development. Tthis probably means that a lot of spaghetti code was involved in the original game, which makes reproducing the structure while updating the design to something more manageable and extensible quite a challenging task.

Much work have been done on the overall structure of the game, management for units, armies, cities, combat, spells is already present but at a prototype stage. The graphics engine already supports almost all the feature required by the original game, LBX support is almost done and bugless and allows to use original graphics without much effort.

Many attempts of writing a remake of Master of Magic have been made and just a few reached the playable stage, since this is a hobby project done on my free time I'm more focused on the entertainment given by designing a flexible architecture.

Given that anyone willing to contribute is welcome and I can provide any insight on the structure of the engine to get up running.

Current screenshots

These screenshots are generated automatically for each view of the game, they don't respect the realtime status since, for example, intro view requires some timing to actually show something but they're here to showcase the status:

main view

main view

city view

city view

combat view

combat view

unit view

unit view

spellbook view

spellbook view

magic view

magic view

research view

research view

alchemy view

alchemy view

armies view

armies view

armies-items view

armies-items view

item-craft view

item-craft view

item-craft-charges view

item-craft-charges view

merchant view

merchant view

army view

army view

message view

message view

cities view

cities view

mirror view

mirror view

info-menu view

info-menu view

cartographer view

cartographer view

diplomacy view

diplomacy view

astrologer view

astrologer view

historian view

historian view

production view

production view

outpost view

outpost view

new-game view

new-game view

load view

load view

options view

options view

start view

start view

intro view

intro view

openmom's People

Contributors

jakz avatar rtentser 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

Watchers

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

openmom's Issues

Compilation issue

Hi,

I've tried to compile openmom on my Ubuntu:

  • with GCC 7.3, I've met few issues with invalid compilation flags, missing headers but also some method seen as constructor !
  • with clang 4.0, some errors are raised related to SkillSet::iterator with invalid operands.

Can you describe which version of clang on Mac is used to compile ?
Regarding your cmake, I suppose you are using Mac and/or Windows ?

MoM Rebuild

Hi @Jakz and @rtentser ,

Found this project you guys had contributed to a while back and am wondering if it's still alive and well as I've seen a wee bit of activity a few months back but wasn't sure?

Also wondering do you have any sort of project website or community group where fans can keep up to date with your work? If so please let me know so I can share it with the community and also tribute you guys on my Master of Magic fan games tribute website.

I run a few MoM fan communities so if you guys are interesting in talking about your work or watching other rebuild attempts then feel free to come join the Master of Magic Discord that I help run. We recently created a MoM Reverse Engineering sub chat there as another fellow is working on a similar project to rebuild MoM and Civizard (the MoM playstation remake). I'm sure he'd love to talk to you guys!

Implode who made the Master of Magic HD Multiplayer remake over the last 15 years that's getting very complete now also lurks our discord too as he's still working away on MoM-IME (recently implemented working global AI and taught it to build roads in between trying to kill you lol!).

I found another group here on github who appear to have worked on a similar project called MoM-Clone (not related to the other MoM-clone project i nthe early 2000s lol) so I might go invite them too.

And finally I'm not sure how connected you guys are to the MoM fan community these days and MoM news but I also run a Facebook MoM group and help run the Discord I mentioned above. We try to keep up to date on all official and fan projects so if you've been missing out on all the good MoM news then come drop by! :)

For example Slitherine have purchased the MoM rights from Atari and are selling MoM on GoG & steam, and best of all appear to be working on a official MoM2 sequel!! They're super keen to get their hands on MoM's long lost source code and have expressed interest in rebuild projects too.. They started working with Caster of Magic creator Seravy and are now selling his MoM mod as an official addon! He too is currently rebuilding MoM from the ground up (except he's using his 10-15 years of hacking every part on MoM to rebuild it super quick) and is making a Caster of Magic 2 which he's already posting public alphas over at the Realms Beyond MoM forum. Slitherine have also made a new official Master of Magic forum too. I actually made a thread there telling them about all the source possibilities and rebuild projects I knew and included yours.

I think that's all the good stuff haha.. Hope to see you guys in the communities some time if you're not already there as your knowledge and experience of tinkering with MoM files would be most welcome. :)

MoM-IME
MoM-IME

Crash when configuring

I've tried to configure the engine on Debian Stretch. I don't know cmake so i googled it and use this command:
cmake -DNAME_OF_SETTING=VALUE
I get this output:

Build Type is Debug
Base flags are  -Wno-reorder -Wno-inconsistent-missing-override -std=c++14 -stdlib=libstdc++ -fdiagnostics-show-option
Debug flags are -O0 -g -fstandalone-debug  -Wno-reorder -Wno-inconsistent-missing-override -std=c++14 -stdlib=libstdc++ -fdiagnostics-show-option
CMake Error at /usr/share/cmake-3.9/Modules/CMakeDetermineSystem.cmake:174 (file):
  file attempted to write a file:
  /home/rtentser/Sources/openmom/CMakeFiles/CMakeOutput.log into a source
  directory.
Call Stack (most recent call first):
  CMakeLists.txt:77 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

Runtime issues in Debian

When i try to run openmom i get "Floating point exception". So i've run it with gdb and got this:

(gdb) run

Starting program: /home/rtentser/Sources/cmake/src/openmom 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".

Program received signal SIGFPE, Arithmetic exception.
0x0830c3bd in std::__detail::_Mod_range_hashing::operator() (this=0x864142c <i18n::data[abi:cxx11]>, __num=170, __den=0)
    at /usr/bin/../lib/gcc/i686-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/hashtable_policy.h:446
446	    { return __num % __den; }

(gdb) backtrace

#0  0x0830c3bd in std::__detail::_Mod_range_hashing::operator() (this=0x864142c <i18n::data[abi:cxx11]>, __num=170, __den=0)
    at /usr/bin/../lib/gcc/i686-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/hashtable_policy.h:446
#1  0x0830c370 in std::__detail::_Hash_code_base<I18, std::pair<I18 const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Select1st, enum_hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>::_M_bucket_index (this=0x864142c <i18n::data[abi:cxx11]>, __c=170, __n=0)
    at /usr/bin/../lib/gcc/i686-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/hashtable_policy.h:1260
#2  0x0830be7b in std::_Hashtable<I18, std::pair<I18 const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<I18 const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::__detail::_Select1st, std::equal_to<I18>, enum_hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_bucket_index (
    this=0x864142c <i18n::data[abi:cxx11]>, __k=@0xbffff13c: I18::FIRST_AVAILABLE_INDEX, __c=170)
    at /usr/bin/../lib/gcc/i686-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/hashtable.h:623
#3  0x0830bd28 in std::__detail::_Map_base<I18, std::pair<I18 const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<I18 const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::__detail::_Select1st, std::equal_to<I18>, enum_hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[] (
    this=0x864142c <i18n::data[abi:cxx11]>, __k=@0xbffff13c: I18::FIRST_AVAILABLE_INDEX)
    at /usr/bin/../lib/gcc/i686-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/hashtable_policy.h:590
#4  0x0830bcd4 in std::unordered_map<I18, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, enum_hash, std::equal_to<I18>, std::allocator<std::pair<I18 const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::operator[] (this=0x864142c <i18n::data[abi:cxx11]>, __k=@0xbffff13c: I18::FIRST_AVAILABLE_INDEX)
    at /usr/bin/../lib/gcc/i686-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/unordered_map.h:904
#5  0x0844fd4e in i18n::keyForString (key="messages_place_name_ruins_first")
    at /home/rtentser/Sources/openmom/src/i18n/Localization.cpp:32
#6  0x082c5850 in __cxx_global_var_init () at /home/rtentser/Sources/openmom/src/ui/GfxData.cpp:34
#7  0x082c6afb in _GLOBAL__sub_I_GfxData.cpp ()
#8  0x08531a4b in __libc_csu_init ()
#9  0xb7ab8216 in __libc_start_main (main=0x82d7fc0 <main(int, char**)>, argc=1, argv=0xbffff364, init=0x8531a00 <__libc_csu_init>, 
    fini=0x8531a60 <__libc_csu_fini>, rtld_fini=0xb7feb070 <_dl_fini>, stack_end=0xbffff35c) at ../csu/libc-start.c:247
#10 0x082d7ee9 in _start ()

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.