   Stitching together Python, C++, Ogre, Bullet, and a GUI
  Hey all.  Bit of background:I currently have a rather badly organised application written in C++, using wxWidgets for the GUI, a lot of OpenGL code, and some simple physics routines.  I think I've got some good algorithms amongst the mess, but the separation of model, view and controller is terrible.  I also want to start adding more advanced physics routines, but integration of a physics engine is looking like a nightmare.So my plan is to start a nice new clean project and import the useful routines whilst leaving the baggage behind.  I've become quite enamoured with Python recently, and its ability to bind with C++ for the hard parts, whilst remaining nice and simple to rapidly develop for the basic GUI, IO, etc.I would also like a much more structured rendering engine than my own hack and slash OpenGL routines, and Ogre looks awesome.  My current code does some pretty low-level stuff with dynamic triangle meshes, vertex buffers, all that stuff.At the moment my physics is restricted to the most basic sphere-sphere collision detection (albeit with some nifty spatial partitioning routines) and 'snooker ball' collision response.  I want to incorperate the bullet physics API to expand my basic ideas to the next level.Finally, I currently use wxWidgets as a nice simple GUI abstraction.  My program currently uses seperate windows for each part of the interface (currently, one window for debug output, one for main buttons/menus, and one for OpenGL rendering).  I don't mind using some other API besides wxWidgets, and I don't mind changing the GUI layout.So, after all that, to my problem...  I simply don't know where to start with stitching all this together!  I know there are a couple of options for C++/Python binding (Boost::Python looks good), then there's Python-Ogre, OgreBullet, and wxPython, plus loads more similar stuff.  But there's no wxBoostPythonOgreBullet API, that I can find anyway!Can anyone give any advice, link to any articles, or point me to some good open source example code of something similar to what I'm planning?Any help much appreciated!  Cheers,[Edited by - dangerdaveCS on January 8, 2010 9:03:42 AM]
  wxWidgets is really an application UI bundle. You probably don't really want to use it for a game UI sitting on top of Ogre stuff. I can only imagine it working in Python by having Ogre draw to an offscreen buffer, then somehow converting it to wxPython's Image or Bitmap classes and drawing it onto a background DC (e.g. the client DC of the window). I'd expect that to be intolerably slow because of the conversion process (if my experience using PIL from wxPython is any indication), and ugly besides (because standard OS widgets don't look expected in most games).   ;  Hi - I use Qt with Ogre, plus Bullet for physics and Lua for scripting.  People will say don't use Qt or WxWidgets for games, but they are perfectly suited for the task of "filling-in the gaps".  For example, Qt comes with a network library, provides good input support and you can do some trickery to render the Qt GUI to a texture for in-game use*.  As it's crossplatform, if you're doing Windows/Mac/Linux versions of your game then it's very helpful.  Qt is BIG - however you can pick which parts you want to use and only link to those DLLs.  In my case I think it adds about 5mb.Look at the Ogre wiki to see how to use Qt with Ogre.* You can skin the Qt gui to make it match the visual design of your game.   ;  @Zahlman: well my current setup is to have a seperate OpenGL window, then all the GUI widgets in another dedicated window.Having looked a little closer at Python-Ogre, I keep seeing hints that it supports more python bindings than for just Ogre.  Inparticular, CEGUI (which is a GUI engine that operates within OpenGL), could be used to replace wxWidgets.  There is also occasional, but not detailed, mention of Bullet bindings.  I also came across Py++, which is a tool to generate Boost::Python macro wrappings for given C++ header files.  So, my current plan is:GUI:  CEGUI in Python using Python-Ogre.Rendering:  Ogre in Python/C++ using Python-Ogre.Physics:  Bullet in Python/C++ using Python-Ogre.Physics/rendering interaction:  OgreBullet in C++.Extra Python bindings:  Py++ then Boost.Python.Python interpreter: Python C++ API (eventually).Sound cool?   ;Quote:Original post by Orbital FanHi - I use Qt with Ogre, plus Bullet for physics and Lua for scripting.  People will say don't use Qt or WxWidgets for games, but they are perfectly suited for the task of "filling-in the gaps".  For example, Qt comes with a network library, provides good input support and you can do some trickery to render the Qt GUI to a texture for in-game use*.  As it's crossplatform, if you're doing Windows/Mac/Linux versions of your game then it's very helpful.  Qt is BIG - however you can pick which parts you want to use and only link to those DLLs.  In my case I think it adds about 5mb.Look at the Ogre wiki to see how to use Qt with Ogre.* You can skin the Qt gui to make it match the visual design of your game.Ah yeah I recently read about Qt opening up their licensing, making it a better choice that wxWidgets.  And I know there is some good Python support for it.  But I wonder if it's worth just using straight CEGUI rather than the rigmarole of hacking Qt to work within an OpenGL context?   ;Quote:Original post by dangerdaveCSAh yeah I recently read about Qt opening up their licensing, making it a better choice that wxWidgets.  And I know there is some good Python support for it.  But I wonder if it's worth just using straight CEGUI rather than the rigmarole of hacking Qt to work within an OpenGL context?Qt comes with a very good GUI designer - and if you have a look at their main demo application, they demonstrate animations of controls (much like you can do in Flash).  It really depends on how advanced you want your in-game UI.  If you were doing an RPG for example, it would be a significant amount of work to do that in CEGui.   ;  I am using Python Ogre and CEGUI in my current game and it works pretty well. The CEGUI layout editor is a fairly nice feature and it will save you a good bit of time...The Qt library is fairly large and it takes a long time to compile (if you find yourself needing to compile it). I have a quad core computer and I left the nmake going overnight because it seemed to take an age. I think the Qt library is impressive and surely for an application it would be a nice choice, but for a game I do not think it is needed. Additionally Python Ogre has 2-3 other GUI systems (BetaGUI, MyGUI, QuickGUI, as well as Hikari) to use if you do not like CEGUI.[Edited by - shadowisadog on January 8, 2010 12:53:35 PM];Quote:Original post by shadowisadogI am using Python Ogre and CEGUI in my current game and it works pretty well. The CEGUI layout editor is a fairly nice feature and it will save you a good bit of time...The Qt library is fairly large and it takes a long time to compile (if you find yourself needing to compile it). I have a quad core computer and I left the nmake going overnight because it seemed to take an age. I think the Qt library is impressive and surely for an application it would be a nice choice, but for a game I do not think it is needed. Additionally Python Ogre has 2-3 other GUI systems (BetaGUI, MyGUI, QuickGUI, as well as Hikari) to use if you do not like CEGUI.What do you do for your physics engine?  Does Python-Ogre have good support for Bullet or some other engine?  And link to Ogre for e.g. sharing mesh data, etc?Do you guys think Py++ is the way to go to bind your own C++ classes to Python?   ;  Almost off topic, but just in case have you considered panda 3d (panda3d.org)? Its a complete game engine with everything already integrated, which saves you some work - its almost always python driven (Though can be developed for with c++.), and has every feature you listed, and a few more. Its bsd license and has been used by Disney for a couple of mmorpg's, is actively developed plus it has a pretty good manual. Now it doesn't have the demos that Ogre does graphically (Disney target low end hardware.) but everything Ogre can do it can, just not always as easily, though for typical stuff it will generate the shaders for you. Another noticeable weakness is the built in gui lacks convenience, but there is a wrapper that makes it far more usable which you can find in the forums. Its particle engine sucks, so most people write their own when they need one. No Bullet I'm afraid - it has ode instead plus its own bullet style physics engine, which is nowhere near as good. There is also PhysX support, but there are license issues with that and its Windows only.Be aware that 1.7.0 should be out soon (About a month - its just bugs now - I'ld go straight to a test build and skip 1.6.2 entirely.) and has a lot of new stuff, including a web plugin and packaging system to allow panda games to be distributed like flash games, it also adds the regularly requested automatic shadow support and a lot of other shine. But I'ld go have a look - will only take 10 minutes to have a quick flip through the manual and you might like what you see. (Disclaimer: I maintain the pipeline from Blender 3D to Panda, so my opinion here is hardly unbiased;-) )   ;  @Lethe:  actually, I looked through the Panda3D docs when I was first thinking about all this.  It sounded like a perfect engine, but then I discover reliance on ODE, which is bad, and it just seems a bit TOO high-level.  I need some pretty low level control over some graphical/physics stuff (e.g. my deformable terrain algorithm; CUDA (i.e. GPU) fluid simulation).However, I'll take a second look at Panda3D and definately keep my eye on Panda3D for the latest developments.   