Simulation project, rendering to another process, multiplayer functionality, in BGE?

Hi, everybody,

i’m currently starting a little simulation project and thought about using one of the available (free for non-commercial/academic use) game engines. As all assets are already there and were done in blender, especially the bone animation is already done, the BGE seems a logical choice.

But there are some important constraints:

As comparisons between rendered and corresponding real scene have to be made it is a must, that the rendered “stuff” has to be made available to another program via shared memory or network in at least 10 fps turnaround cycle, so programmatically making a screenshot to a file is no option.

And, second, there must be some way/GUI to control the simulation from outside, probably like in a multiplayer game, having one instance render the scene and another connected instance viewing it in another fashion and accepting user input.

Is this in any way possible (even by working with the source with not too much hassle) in the BGE?

If somebody has suggestions i would be very grateful, if somebody with similar ideas and experience with other engines, this woould also be helpful.

Thanks, H.

You might be looking for shared memory and IPC (e.g. pipes, sockets).


(http://www.kohala.com/start/unpv22e/unpv22e.chap12.pdf)
http://en.wikipedia.org/wiki/Inter-process_communication

Render your scene to a texture. Load the texture in shared system ram. Give the other program the “ready”-command so that it can access the shared texture.

Input can be done the other way round.
Buffered Input: From extra input program put input data in shm (shared mem.). Set the “input ready”-command.
Unbuffered Input: Throw over the IPC the input command from the extra input program.
You need to modify BGE to catch either and react accordingly.

You could also set up a TCP/UDP connection and do input piping over that.


http://en.wikipedia.org/wiki/User_Datagram_Protocol

The input stuff should be easily doable via Python.
For the texture thing I guess you have to do some C++.

Because you have access to the complete code of BGE it is doable.