What to look at to compile in 1.7.0

Hello everyone,

It’s been a long time since I write here. For the people who don’t remember me or for the new one, I’m the programmer of the Silence X game http://darkjaff.p3dp.com

Every month or so, I’m looking at the pand3d site to see what’s new. I just saw that there were now a way to put our game on the web! YEAH! What a nice idea!

So I download the new version of panda3d 1.7.0 to check if my game still works and if it works, then I will try the new web thing. But my game is not working anymore…

Each song in the game start for 1 or 2 seconds then stops. After that, when we come to the menu, it crach… I don’t know if there is a list of function that need to be changed, deprecated things, new way to call some objets.

Here is the error that is trown at me. Please notice that this game was programmed using panda3d 1.5.3 and everything was working fine.

DirectStart: Starting the game.
Known pipe types:
  wglGraphicsPipe
(all display modules loaded.)
:display:wgldisplay(error): SetPixelFormat(57) failed; trying 5 instead
Traceback (most recent call last):
  File "C:\Panda3D-1.7.0\direct\showbase\EventManager.py", line 61, in eventLoopTask
    self.doEvents()
  File "C:\Panda3D-1.7.0\direct\showbase\EventManager.py", line 55, in doEvents
    processFunc(self.eventQueue.dequeueEvent())
  File "C:\Panda3D-1.7.0\direct\showbase\EventManager.py", line 124, in processEvent
    messenger.send(eventName)
  File "C:\Panda3D-1.7.0\direct\showbase\Messenger.py", line 325, in send
    self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
  File "C:\Panda3D-1.7.0\direct\showbase\Messenger.py", line 410, in __dispatch
    method (*(extraArgs + sentArgs))
  File "C:\Panda3D-1.7.0\samples\SilenceX\lib\Intro.py", line 65, in cleanBeforeMenu
    self.showMainMenu()
  File "C:\Panda3D-1.7.0\samples\SilenceX\lib\Intro.py", line 70, in showMainMenu
    mm = MainMenu(self.musicPlayer)
  File "C:\Panda3D-1.7.0\samples\SilenceX\lib\MainMenu.py", line 36, in __init__
    self.setLight()
  File "C:\Panda3D-1.7.0\samples\SilenceX\lib\MainMenu.py", line 549, in setLight
    directionalLightNP = self.dummyAmbiantMenu.attachNewNode(directionalLight.upcastToPandaNode())
AttributeError: 'libpanda.DirectionalLight' object has no attribute 'upcastToPandaNode'
:task(error): Exception occurred in PythonTask eventManager
Traceback (most recent call last):
  File "main.py", line 16, in <module>
    import main2
  File "C:\Panda3D-1.7.0\samples\SilenceX\main2.py", line 6, in <module>
    intro.run()
  File "C:\Panda3D-1.7.0\samples\SilenceX\lib\Intro.py", line 227, in run
    run()
  File "C:\Panda3D-1.7.0\direct\showbase\ShowBase.py", line 2531, in run
    self.taskMgr.run()
  File "C:\Panda3D-1.7.0\direct\task\Task.py", line 496, in run
    self.step()
  File "C:\Panda3D-1.7.0\direct\task\Task.py", line 454, in step
    self.mgr.poll()
  File "C:\Panda3D-1.7.0\direct\showbase\EventManager.py", line 61, in eventLoopTask
    self.doEvents()
  File "C:\Panda3D-1.7.0\direct\showbase\EventManager.py", line 55, in doEvents
    processFunc(self.eventQueue.dequeueEvent())
  File "C:\Panda3D-1.7.0\direct\showbase\EventManager.py", line 124, in processEvent
    messenger.send(eventName)
  File "C:\Panda3D-1.7.0\direct\showbase\Messenger.py", line 325, in send
    self.__dispatch(acceptorDict, event, sentArgs, foundWatch)
  File "C:\Panda3D-1.7.0\direct\showbase\Messenger.py", line 410, in __dispatch
    method (*(extraArgs + sentArgs))
  File "C:\Panda3D-1.7.0\samples\SilenceX\lib\Intro.py", line 65, in cleanBeforeMenu
    self.showMainMenu()
  File "C:\Panda3D-1.7.0\samples\SilenceX\lib\Intro.py", line 70, in showMainMenu
    mm = MainMenu(self.musicPlayer)
  File "C:\Panda3D-1.7.0\samples\SilenceX\lib\MainMenu.py", line 36, in __init__
    self.setLight()
  File "C:\Panda3D-1.7.0\samples\SilenceX\lib\MainMenu.py", line 549, in setLight
    directionalLightNP = self.dummyAmbiantMenu.attachNewNode(directionalLight.upcastToPandaNode())
AttributeError: 'libpanda.DirectionalLight' object has no attribute 'upcastToPandaNode'

**** End of process output ****

Thanks a lot for your help. If my game can work again and if I’m able to pack it for the web, I would like to give it to the community in the Online Demo (if they want it hehehe).

DarkJaff

The function upcastToPandaNode has been removed. You can simply remove all occurrences of it - you don’t need to call it.
So this:

render.addLight(something.upcastToPandaNode())

Can become:

render.addLight(something)

Hi!

Thanks it works. But I still have the problem with the sound.

Here is one of the class that manage the sound in my game. Can you see something that is not valid anymore? Like I said, the sound start but stop after like 1 or 2 seconds.

class MusicPlayer:
    
    def __init__(self):
        # load the background music        
        #self.introMusic = loader.loadSfx("music/introAmbiant.mp3")
        self.introMusic = base.sfxManagerList[0].getSound("music/introAmbiant.mp3", 0, AudioManager.SMSample)
        self.introMusic.setLoop(True) 
        self.introMusic.setVolume(0.3) 
        #self.mainMusic = loader.loadSfx("music/ambiant1.mp3")
        self.mainMusic = base.sfxManagerList[0].getSound("music/ambiant1.mp3", 0, AudioManager.SMSample)
        self.mainMusic.setLoop(True) 
        self.mainMusic.setVolume(0.5)
        
        #self.menuMusic = loader.loadSfx("music/menu.mp3")
        self.menuMusic = base.sfxManagerList[0].getSound("music/menu.mp3", 0, AudioManager.SMSample)
        self.menuMusic.setLoop(True) 
        self.menuMusic.setVolume(0.5)
        
        #self.speechIntro = loader.loadSfx("sound/speech/Intro.mp3")
        self.speechIntro = base.sfxManagerList[0].getSound("sound/speech/Intro.mp3", 0, AudioManager.SMSample)        
        self.speechIntro.setLoop(False) 
        self.speechIntro.setVolume(1)  
        
    def playIntro(self):
        self.introMusic.play()
        
    def stopIntro(self):
        self.introMusic.stop()
        
    def playMenu(self):
        self.menuMusic.play()
        
    def stopMenu(self):
        self.menuMusic.stop()
        
    def playGameMusic(self):
        self.mainMusic.play()
        
    def stopGameMusic(self):
        self.mainMusic.stop()
        
    def playSpeechIntro(self):
        self.speechIntro.play()
    
    def stopSpeechIntro(self):
        try:
            self.speechIntro.stop()
        except KeyError,e:
            pass 

Thank you very much!

DarkJaff

Does switching between OpenAL and FMOD in Config.prc change anything?

Thanks for your help.

I tried to change my config.prc from OpenAL to FMOD and the result is worst.

Now, there is no sound and there is this error in the console:

:audio(error):   load_dso(liblibp3fmod_audio.so) failed, will use NullAudioManager
:audio(error):     Path not found

Here is what I put in my config.prc file (maybe it’s not the good thing…)

# Enable audio using the FMOD audio library by default:

audio-library-name libp3fmod_audio

Any idea of what is going on? I will try to reinstall panda3d 1.7.0 because I installed it while my old version was still installed so maybe some things went wrong during the installation…

DarkJaff

It’s “p3fmod_audio”, not “libp3fmod_audio”, I think.

You are right, I realised that like 2 minutes before you post hehehe.

Also, it works perfectly with FMOD. Do you know why the OpenAL is no longer supported? I was hoping one day that we could be rid of FMOD to create games that can be sold.

Now I will go on and try to pack my game and put it on the web.

Thanks

DarkJaff

It’s not unsupported. It’s supposed to work. There must be a bug somewhere.