Since a couple of weeks I have this thing going on in my mind and I can’t decide if it is good or bad.
It’s a python plugin for blender.
The plugin takes the blender data, translates it into a stream format and sends it to a subprocess via the system pipeline. The subprocess is a game-engine dependent program that transforms the input into game-engine data and starts the game.
In pseudo-python we’re talking about this:
engine = subprocess.Popen(executable counterpart of the engine, ...). read the data from bpy and send it to the engine subprocess when done send a "start game" token...
From the game engine perspective one would have to write a program that parses the data coming from the process input and translates it into usable structures.
I tested the idea and it works.
The worst part in the actual implementation would be to translate the custom python scripts.
That requires at best to write a python counterpart for bge mapped to functions in the engine. Boring, something might not be reproducible, but it can work.
Here’s the pros I can see
- there’s no linking between the plugin and the engine starter, so there’s no licensing puzzle to solve.
- for blender, you have to maintain only this stream-translator script and not a whole compiled engine
- from the user point of view, it would work exactly as the “start” button in the Standalone Player tab: you press the button, a window pops up with the game running.
- it remains backward compatible with current games
But here’s the gigantic contrary:
Is it really any different from an exporter to a format like collada - possibly with an extension for the scripting stuff? I mean, press the start button, automatically export to collada, call the engine program that reads that file and starts the game, same result, right?
That’s what puzzles me.