tukkek / javelin

Party-based roguelike (open-source strategy-RPG game).
https://javelinrl.wordpress.com/
66 stars 7 forks source link

Story mode #154

Open tukkek opened 6 years ago

tukkek commented 6 years ago

At some point it'll become trivial to design a Module system, using Worlds as locations and Locations as portals to other parts or people to interact with. It will never be as fitting as the Infinite engine or something like that but they should be easy enough to code and all the features of Javelin can offer a lot of potential from anywhere like RPG module conversions to creating an actual roguelike experience.

Modules could be loaded from JARs, with the appropriate security considerations (no network, disk or system access) - meaning that they could be treated like actual mods or DLC, which against open up a realm of possibility.

This would most likely require some 2 small but decent example mods - not only to showcase the feature but also as a reference. Of course, documentation would also be nice but that is mostly covered by the generated JavaDoc plus a new modding guide.

tukkek commented 6 years ago

Ideally by then Javelin should have a launcher with 3 tabs: quests / mini-games / story mode.

tukkek commented 6 years ago

If Javelins become moddable, a license should be written to the effect of "you are responsible for any and all damage caused by anyone running your modules; all modules are shared freely and can be used, reused and modified by anyone and you acknowledge that all resources contained in the mod conform to this clause (including but not limited to code and art assets).

tukkek commented 6 years ago

Ideally, the modding support is achieved only through exposing the game's internal API - but if it evolves, a graphical editor could be worked on. Maybe some sort of integration with Tiled is possible.

tukkek commented 6 years ago

This article describes using a ClassLoader to implement a Security Manager and Policies-based sandbox https://blog.jayway.com/2014/06/13/sandboxing-plugins-in-java/

Some refactoring might be necessary but considering that the only contention points would be reflection and writing a save file to disk (which the game should be able to handle outside the plugin), thus just having the plugin mostly provide their custom model and controller objects, it doesn't sound too terrible to implement - especially when the sandbox isn't able to simply call Javelin code to circumvent restrictions.

Security should be less of a concern than to actually providing a stable, useful story API (through game's internals, most likely, not a dedicated one - since that would be very extensive to do properly without compromising on the extensive Javelin feature set).

tukkek commented 6 years ago

Good precursors for this would be #158 and #91