Blooddrunk game engine+editor {Looking for potential users!}
Today i've overcome a major hurdle. Python docs dont say how to allocate and returna new custom object i.e. IXMLReader.... The functions are caled but they dont quite work because of the beyond repair python unicode. However i am implementing the utf-8 reader tomorrow in whole and then getting back onto this.
Try to have a look on how pyBindGen does it. Its entirely written in python so it is very easy to install and use. It can create wrappers for functions, classes, structures, moreover the code that pyBindGen creates is clean and cleardevsh wrote:Today i've overcome a major hurdle. Python docs dont say how to allocate and returna new custom object i.e. IXMLReader.... The functions are caled but they dont quite work because of the beyond repair python unicode. However i am implementing the utf-8 reader tomorrow in whole and then getting back onto this.
http://code.google.com/p/pybindgen/
Theres also online documentation.
I had successfully wrapped a few classes using it, so I think you should give it a try.
Working on game: Marrbles (Currently stopped).
-
- Posts: 126
- Joined: Wed Sep 29, 2010 8:23 pm
-
- Posts: 126
- Joined: Wed Sep 29, 2010 8:23 pm
yeah we met our outline of 10 revisions a day from both of us joined. WE fixed all issues (except windows binary of the first demo - hehe), the lib compiles in windows, the XMLReader works in python with (now) correct enums. I implemented the rest of the functions and the XMLReader type is complete both UTF32 and UTF8 types!
This is what we can execute so far
We will be rewriting all irrlicht's examples to help us with the direction of python interpreter's development, of course all blooddrunk functions will be exposed by the end of this week
This is a draft for Irrlicht PoC 01.Hello World
This is what we can execute so far
Code: Select all
import irrlicht
import io
import irrFileSystem
import irrVideoDriver
import video
import irrSceneManager
import irrGUIEnvironment
print "This is a python script initializing the editor.\n"
Caption = u"Blooddrunk Game Editor"
irrlicht.setWindowCaption(Caption)
irrFileSystem.addFolderFileArchive("../editorData/")
irrVideoDriver.setTextureCreationFlag(video.ETCF_ALWAYS_32_BIT, 1)
irrSceneManager.setAmbientLight(0.3,0.3,0.3);
xml = irrFileSystem.createXMLReader("config.xml")
MessageText = Caption
StartUpModelFile = u""
a = 0
while xml.read():
nodeType = xml.getNodeType()
if nodeType==io.EXN_TEXT:
print xml.getNodeData()
print nodeType
MessageText = xml.getNodeData()
elif nodeType==io.EXN_ELEMENT:
nodeName = xml.getNodeName()
if "startUpModel"==nodeName:
StartUpModelFile = xml.getAttributeValue(u"file")
elif "messageText"==nodeName:
Caption = xml.getAttributeValue(u"caption")
xml.drop() # don't forget to delete the xml reader
irrGUIEnvironment.addMessageBox(Caption,MessageText)
skin = irrGUIEnvironment.getSkin();
font = irrGUIEnvironment.getFont("fonthaettenschweiler.bmp");
skin.setFont(font);
print "End of Initialization. \n"
This is a draft for Irrlicht PoC 01.Hello World
Code: Select all
import BSettingsManager
import core
import BEngine
import irrlicht
import irrGUIEnvironment
import irrSceneManager
import irrVideoDriver
import BPythonInterpreter
import bdrunk
import BRenderer
def renderFN():
BRenderer.render()
settings = BSettingsManager.getSettings()
if (settings.resolution.X!=640)||(settings.resolution.Y!=480):
print "Bad Resolution Restarting..."
settings.resolution = core.dimension2d(640,480)
BSettingsManager.setSettings(settings)
BSettingsManager.save()
BEngine.restart()
irrlicht.setWindowCaption(u"Hello World! - Irrlicht Engine Demo")
irrGUIEnvironment.addStaticText(u"Hello World! This is the Irrlicht Software renderer!",rect(10,10,260,22), 1)
mesh = irrSceneManager.getMesh("../../media/sydney.md2")
if mesh.isNull():
BEngine.Quit()
node = irrSceneManager.addAnimatedMeshSceneNode( mesh );
if !node.isNull():
node.setMaterialFlag(EMF_LIGHTING, 0)
node.setMD2Animation(EMAT_STAND)
node.setMaterialTexture( 0, irrVideoDriver.getTexture("../../media/sydney.bmp") )
irrSceneManager.addCameraSceneNode(0, core.vector3df(0,30,-40), core.vector3df(0,5,0))
BPythonInterpreter.registerFunction(bdrunk.EPIRF_START_OF_FRAME,renderFN)
#BPythonInterpreter.registerModuleFunction(bdrunk.EPIRF_START_OF_FRAME,"renderFN","./path/to/module.py")
#Got to kickstart the engine into the first frame (then it calls the "renderFN" function repeateadly)
BRenderer.render()
if i understand that snippet correctly. You are calling a registered script function from c++ to call a c++ function every frame? that sounds like a big slow down. try to avoid calling scripts over and over it is not really needed.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
@Macron: Any chance of you resurfacing?
EDIT: Implemented SettingsManager as a python object (I now need to implement dimension2du and getSettings), I implemented the entire core:: namespace except for typedefs and most classes. Implementing the 2d vectors has a knockon effect(I only need to add operator support) which enables me to easily implement 3d vectors, core::recti, and some more IAttribute functions and review IAttributeWriteFlags and the IAttributeExchangingObject inheritance. I am to finish implmenting ALL classes in the core:: namespace before the end of the month.
EDIT: Implemented SettingsManager as a python object (I now need to implement dimension2du and getSettings), I implemented the entire core:: namespace except for typedefs and most classes. Implementing the 2d vectors has a knockon effect(I only need to add operator support) which enables me to easily implement 3d vectors, core::recti, and some more IAttribute functions and review IAttributeWriteFlags and the IAttributeExchangingObject inheritance. I am to finish implmenting ALL classes in the core:: namespace before the end of the month.
nearing the release of the first demo (just more monotonous python coding)... also I am doing Irrlicht PoCs (to proove every example is doable in pure python) but...
I am doing XEffects PoCs in Blooddrunk, demonstrating that it can render the exact same scenes in deferred faster than XEffects. Obviously I will make a second set of demos that show what Blooddrunk can do with the spare fps... (instead of 1 point light, 2) or (3 spotlights with shadows + 29 no shadow lights)/(GI instead of SSAO)
I am doing XEffects PoCs in Blooddrunk, demonstrating that it can render the exact same scenes in deferred faster than XEffects. Obviously I will make a second set of demos that show what Blooddrunk can do with the spare fps... (instead of 1 point light, 2) or (3 spotlights with shadows + 29 no shadow lights)/(GI instead of SSAO)