After reading some fuss about the death of bge, I wondered how hard could it be to replace it with a different engine, still embedded in that wonderful thing that is blender.
I picked up Panda3D but that didn’t go very well (some library thing in ExecutionEnvironment that I still don’t understand).
Anyways, test number 2 was on Ogre3d. The integration turned out to be far easier than expected.
Of course it’s just a proof of concept, it starts the engine, embeds the renderer and loads a predefined mesh but it works.
The point is that once the renderer is in place, the “only” thing that remains to do is to translate the blender scene into ogre things, which is tedious but not very hard.
In all that, and this comes from someone that firmly believes no human being should ever come close to use C or C++, the hardest things to code where CMake instructions (I think the C in CMake stands for “curse”).
Clearly I’m not saying that the developers of blender should stop doing what they’re doing and jump right on to integrate ogre - it’s still a lot of work to do it in a sensible way, for all the platforms where blender runs - but if I can do it then there are thousands of people way smarter than me than can do it faster and better.
And blogre would be amazing, there, I’ve said it.
Anyways, I’ll try to go a bit further and see if I can slap in some scenegraph parsing and maybe a jvm to run scripts.
If someone else wants to try, it’s really just a matter of downloading ogre (i’ve used the latest available in the repositories), adding a submodule to blender, creating a VIEW3D_OT operator in view3d_view.c (almost identical to the one for bge) and find the system handle for the blender window (I’ve used the X11 libraries but I think it should be possible to read it from the GHOST system of blender, I just gave up because I’m too lazy).
Of course I know it’s a rendering engine, but that is also the only “interesting” part of a game engine.
A) would be painful, at least from my perspective, I hate to sit down and start digging into code to find out how things are linked together, find a way to break that link if it exist and replace it. Ghastly.
B) is effortless, save for the time needed to implement the design of choice.
The troubles I see come all from the multiplatform nature of blender, I can barely compile it on my system, even setting up CMake targets and variables to allow the project to be built on different platforms would be way ahead of my skills.
Just to be clear, I’m perfectly fine with BGE as it is. The only problem I have with it is that it is not capable of take my awful models and horrible textures and automagically turn them into state of the art assets. Unfortunately there is no game engine out there that can help with that.
I do think that, in an imaginary future, “outsourcing” the rendering task - as it is already done for the audio system for example - would be an advantage, because it is one less thing to maintain.
The test I made was to check out how hard linking the two worlds could be.
The test also gave me an answer to the hypothetical question “what if they threw bge out of the window”: I would happily replace it with a new engine, also integrated in blender (that’s the beauty of bge), based on ogre.
BluePrintRandom, rude? Me? I’m a fluffy bunny wrapped in a candy swimming in a pool of honey. If I have been rude that was entirely due to my poor knowledge of the language, I sincerely apologize.
I try not to quote because I found the resulting answer less readable.
For the model-texture part, was that the rude part? I mean, it is my personal experience and a description of my artistic skills that I used to explain why bge is fine for. It wasn’t meant to be a general statement - even though I think that sometimes people tend to forget that computers are not capable of improvements, they (for now) just execute stuff.
Goran, you must look at things from the perspective of my ego, which is scientifically known to be driving force behind the expansion of the visible universe.
So my answer is yes, it would take me a few weeks. That’s because I have more or less zero practical knowledge of C++, otherwise I would say a few days.
I’m not sure if I want to try. I seriously dislike developing in C/C++. I had to force myself into this experiment.
I would suggest, if you honestly wish to pursue this, on using the GameKit engine as a foundation. It already has conversions for most game-centric Blender objects built-in, can handle some of the BGE logic stuff already, and already has some examples you can use.
It is painfully clear that your only knowledge about the bge codebase is what you have ‘picked up’ from people on the forum mentioning that it is hard to maintain/extend. Please refrain from joining conversations where you have neither questions nor answers.
I would be interested for a direct comparison of the rendering engines. Ie for a given polycount/lampcount, which is faster?
Also, which is more capable? Does ogre have any way to understand blenders material shaders? I guess not?
It may be time for me to brush up on my lower level languages and take a look at the bge from the other side.
If we’re going in the way of replacing the bge with an existing game engine, then it’s better to save the effort for Panda3D integration. It’s a full game engine, not just a render engine like ogre, and all it needs is an editor, which would be blender in this case. It’s 1 of the most (if not the most) underrated game engine, this opinion is after a few months of its usage. It’s more “compatible” with blender as it can compile existing glsl node materials and uses python which is an advantage for existing bge users.
Also it’s source code is really organised and human readable to a certain extent, unlike blender generally.
BTolputt, at the present time I have no plan to do more than little experiments around the idea (I do not consider bge dead or anything close to die).
sdfgeoff, I think I can say that ogre is completely unaware of anything related to blender’s representation of things, including material shaders. It has access to the data in the same way ketsji does so it should be a matter of translation routines. If you want to dig, the embedded engine life path is:
where a plain loop takes place until the game ends.
Jackii, I looked into Panda3d at first, I have been unable to make it cope with blender because of some dynamic library lookup. I tracked down the problem to something that the ExecutionEnvironment class of Panda is doing then I simply gave up. I think that someone more patient than me could get it done.
By the way, if anyone happens to read the thread and wishes to say something, know that I deem the knowledge of the actual blender code totally irrelevant and I would gladly accept any observation on the matter of an hypothetical external engine embedding.
And the bge code actually looks like random garbage. I’m just looking at a single function made of 1040 lines, by the time you reach line 200 you already forgot your own name. It’s also filled with unfathomable names, commented out sections, various sorts of stylistic conventions, meaningless comments.
It is not untypical for projects of appreciable size to become like that, entropy and evolution apply to software too.
Although the outer framework is not bad at all, it has a kind of aesthetic beauty.
It might be worth discussing how one would start cleaning up the code, maybe in a separate thread. I would definitely go for breaking up those humongous functions.
The only thing you can mess up is your local copy of the project, you need write access to the repository to actually do something bad for other people. I suppose git for windows is the same as git for linux, so what I’d do if I were you is to create an empty directory somewhere, open a command line console, cd to the new directory and “clone” the repository. Much like what the wiki says here: