mbrlabs/Mundus

Script component

codenigma opened this issue · 1 comments

I dont't know the actual planned workflow to create a game with mundus, but i think we will need something for the game logic.

1 Solution (possible in near future):

  • When the libgdx runtime is ready we will load the world and program the logic in java with libgdx functionality. So the editor will be an optional tool for game creation.

2 Integrate a script component (javascript):

  • We implement a scripting language compatible with java6. Possible candidates are rhino, nashorn and j2v8:
    rhino is a standalone lib (100% java6 and highly compatible with android, no actual benchmark present (slower than j2v8 and nashorn in 2014))
    nashorn will only work with java8 (so not working with older android < 7.0, not an option at the moment)
    j2v8 is the implementation of google V8 engine. It is written in c++ and wrapped in java with native interfaces. At the moment it is the fastest implementation, but it must be compiled for every platform. This will complicate everything.
  • expose the commons library into a javascript library to manipulate game objects/world
  • the user can use every editor he likes to write his scripts, he will just need to point his project into the mundus project and bind the commons library
  • hot reloading of scripts, when user changed a loaded script

3 Integrate other compatible scripting language (but which is compatible with android?)

But why use a scripting component?

  • we can dynamically load game logic into Mundus (making Mundus to a real engine)
  • in future we can extend Mundus to a sandbox (like cryengine) and manipulate the world (set daytime, tree growth and other world/physics parameter)

What do you think? Do we need scripting add all, how far will this project go?

That's huge ;)
The initial plan was to just create the game world with Mundus and provide an api to load, render and interact with it (so that's your first solution), but of course it has the potential to become a fully fledged game engine.

At the moment this goes beyond the scope of the project i think. But definitely something to keep in mind.