Can I make an animation from a game?

I’m using BGE to run a physics simulation, because I need scriptable interactions. That bit’s working fine; I can set up the sensors and actuators and everything works.

However, now I want to render the result out as a video. Because a game is not an animation, I can’t simply tell Blender to render the animation. I have found a couple of references that there did actually use to be a facility for running the game and every tick keyframes in the animation timeline would be generated, meaning that after running the game you got essentially a baked animation which could be rendered or edited. This would be ideal, as it would let me do cool things like rerender parts of the simulation from a different camera position.

That seems to have gone. Was it ever replaced with anything else?

(And yes, I know I can just use a screen recorder. I just don’t want to!)

It’s still in the documentation! https://upbge.org/#/documentation/docs/latest/manual/manual/physics/introduction.html#recording-to-keyframes

But that UI doesn’t look like Blender 3…

The article in the documentation is about recording Blender physics but you want the in-game bullet physics recorded.
Look here the last post for the “record.blend” that works in UPBGE 0.3.

I’m on UPBGE 0.36.1 and that script fails, complaining that it can’t import bge. That sounds weird? Is there anything I need to do other than just running it?

You just hit p for the game and after pressing esc there is the animation filled.
(I have to press esc 2 times.)

The script is run by an always sensor of the static cube. It skips 5 frames. perhaps this way the record intervall can be controlled?
If I set it to skip 0 frames then it plays back too slow. The playback speed (fps) can be set in the “Output” Propeties. Default is 24 fps. 60 would match the game fps.
grafik

1 Like

Also, import the whole cube,

There is a keyboard sensor etc in it.