drwhut / tabletop-club

An open-source platform for playing tabletop games in a physics-based 3D environment for Windows, macOS, and Linux! Made with the Godot Engine.
https://tabletopclub.net
MIT License
1.28k stars 55 forks source link

Request for Godot Feature: Scene Objects and Game Package Creation #317

Closed nahured closed 5 months ago

nahured commented 5 months ago

Is your feature request related to a problem? Please describe. I couldn't find this in the documentation, but can I create objects that are scenes in Godot? This way, I can create interactive and animated objects, like a dragon that breathes fire.

Describe the solution you'd like If possible, I'd like to use Godot to create packages for the game, whether they are tables, cards, tokens, dice, scenes, or templates. If I manage it well, I could create inventories that only the game master can see, keeping them hidden from others.

Describe alternatives you've considered I haven't considered any alternatives since I can't think of any.

Additional context The idea I have is to recreate what was in TTS, which is a table that allows you to have a map that can change to other maps, making it easier to have an open world. If this can be done with Godot and used as packages, it would be very easy to develop an open-world campaign.

drwhut commented 5 months ago

Currently, it is not possible to include Godot scene files (.tscn, or .scn) by themselves or via .pck files into Tabletop Club, the main reason being security. Godot's scenes can contain any number of nodes, resources or scripts, including malicious ones, whereas .gltf or .obj files imported as scenes will only ever include Spatial/Node3D and MeshInstance nodes.

To answer your question about animated pieces, I do plan to add this functionality in the future somehow (I'm pretty sure .gltf files can include animation data), but it's not high in priority.

To compensate for the fact that creators will not be able to mod the vanilla game via GDScript, I'm planning to add Lua scripting within the asset packs themselves with a safe API (see #65), which should hopefully allow creators to do some really cool stuff, like what you were mentioning with the private inventory for the host.

On your last point about having the various maps for an open-world campaign, currently the best way to achieve this is by having multiple save files for each "world", and loading between then. Although in the future maybe this could be automated with Lua scripting?

Unfortunately, I don't think importing scene files or packages will ever be included in the game, as it opens a lot of potential ways for malicious actors to be able to run raw GDScript code on the client. But hopefully, the functionality it would have brought will be in the game anyways, e.g. with the Lua scripting.