Some issues i would love help with

Return to General Discussion

Some issues i would love help with

Postby vlouco » Mon Mar 05, 2012 2:01 am

Hello, first post here.

I've been using Panda3D( 1.8 ) to build a little class project game, and got a couple of apparently unsolvable issues in the process, that i hope someone can help me with:

1)I have an actorInterval that i would like to set the playRate to more than 1, but doesnt matter if i put "playRate=x" in the interval constructor or use something like animation control and then try actor.play(), the character (the default moving panda of Panda3D) doesnt seem to move any quicker. Any clues?

2) Since installers are generated by p3d files, i would like to know how to include my music files (ogg) in the p3d file. As for now my p3d game and installers have no sound.

I've seen in another thread that i should use 'base.AppRunner.multifileRoot' as a base to search for the file, but i couldnt find how to access this variable (even tried the Reference).

Tried also -n and -e with "ogg" in the packp3d.

3)I also would like to know how to include stuff like "loadPrcFileData('', 'fullscreen #t')" in the p3d file, because my code runs fine, but when i get to the p3d it seems to lose all these extra configs.


Thanks in advance,

Victor T.
vlouco
 
Posts: 4
Joined: Mon Mar 05, 2012 1:51 am

Re: Some issues i would love help with

Postby flavio » Wed Mar 07, 2012 1:41 am

vlouco wrote:Hello, first post here.

Welcome! :)
vlouco wrote:I've seen in another thread that i should use 'base.AppRunner.multifileRoot' as a base to search for the file, but i couldnt find how to access this variable (even tried the Reference).

Tried also -n and -e with "ogg" in the packp3d.

Hmmm, there should be an error in your packing process since I can pack p3d files with working audio support. Could you write here a small example (like a small program which only plays a sound) and precisely describe the process you are following to make the p3d file?

Anyway, please verify that your p3d file correctly contains ogg files with something like
Code: Select all
multify -tvf yourFile.p3d

Moreover, be sure that you used the -r fmod/openal/audio switch in the packp3d invocation, and check your logs to see which error has occurred (file not found? Missing audio support?).
vlouco wrote:3)I also would like to know how to include stuff like "loadPrcFileData('', 'fullscreen #t')" in the p3d file, because my code runs fine, but when i get to the p3d it seems to lose all these extra configs.

Same here, the loadPrcFileData function works as expected in my game, so there should be an error somewhere in your process. Could you produce a small example which contains the minimal amount of code which reproduces your problem?
Image - Image
User avatar
flavio
 
Posts: 530
Joined: Fri Apr 16, 2010 12:45 pm
Location: Rome, Italy

Postby vlouco » Wed Mar 07, 2012 12:03 pm

Thanks for the reply flavio! ;D

2) With "multify -tvf yourFile.p3d" i've checked that the ogg files were in fact included in the file, and the "-r fmod/openal/audio" did the trick to make it work, thank you!

Since it seems to be not that obvious, and the logs didn't complain, shouldn't the manual be more clear on this? =(

3)My packp3d log shows a

There are some missing modules: ['panda3d.core']


Which made me worried, since i use

Code: Select all
from panda3d.core import loadPrcFileData


Also noted that using

Code: Select all
from pandac.PandaModules import loadPrcFileData


To do the same didnt work, and no clue in the logs.

I just tried running the tutorial program of the manual

http://www.panda3d.org/manual/index.php/Using_Intervals_to_move_the_Panda

With any of the imports above and a simple

Code: Select all
loadPrcFileData('', 'window-title Panda Adventures')


And it seems not to work, since the window title is still "panda".

Any hints are appreciated! ;D
vlouco
 
Posts: 4
Joined: Mon Mar 05, 2012 1:51 am

Postby flavio » Thu Mar 08, 2012 2:20 am

vlouco wrote:Since it seems to be not that obvious, and the logs didn't complain, shouldn't the manual be more clear on this? =(

Hmmm I have just done a try and have seen a "NullAudioManager" in the console.
vlouco wrote:3)My packp3d log shows a
There are some missing modules: ['panda3d.core']

Which made me worried

You can safely ignore this warning.
vlouco wrote:Also noted that using

Code: Select all
from pandac.PandaModules import loadPrcFileData


To do the same didnt work, and no clue in the logs.

I just tried running the tutorial program of the manual

http://www.panda3d.org/manual/index.php/Using_Intervals_to_move_the_Panda

With any of the imports above and a simple

Code: Select all
loadPrcFileData('', 'window-title Panda Adventures')


And it seems not to work, since the window title is still "panda".

Any hints are appreciated! ;D

Oh, you are right, it looks like this setting is being overwritten or ignored by the runtime (while it works otherwise). Someone more expert than me should know why this happens.

I never faced this issue since I prefer this way to set the title of the window (which also works in the Panda's runtime), since it let you change properties at runtime:
Code: Select all
wp = WindowProperties()
wp.setTitle( 'Your title' )
[...]
base.win.requestProperties( wp )
Image - Image
User avatar
flavio
 
Posts: 530
Joined: Fri Apr 16, 2010 12:45 pm
Location: Rome, Italy

Postby vlouco » Thu Mar 08, 2012 10:13 am

Flavio,

Thanks again for the reply.

I've realized too that only some of the 'loadPrcFileData' are been overwritten on runtime, such as 'Window Title' and 'Fullscreen', and some do work with 'loadPrcFileData' such as 'showFpsMeter'.

I've also been able so far to succefully set these properties with the "WindowProperties" that you have pointed in your reply.

But I have noticed another issue: when i run the p3d file (even after these window tweaks to fullscreen etc), the fps seems a lot slower than runnin the source directly (using python/ppython).

Running directly (python main.py) i get about 70-80 fps, and from the p3d file i get about 15-20 fps.

Anyone may know a cause for this?

Just remembering that i'm in Ubuntu 11.10 Oneiric Ocelot, running panda 1.8.0.


Thanks in advance.
vlouco
 
Posts: 4
Joined: Mon Mar 05, 2012 1:51 am

Postby flavio » Fri Mar 09, 2012 3:39 am

You are welcome. :) I don't know about this new issue, 1.8.0 didn't bring this problem in my project, anyway you could analyze your project in order to see how the time is differently consumed: this could give more information.
Image - Image
User avatar
flavio
 
Posts: 530
Joined: Fri Apr 16, 2010 12:45 pm
Location: Rome, Italy

Postby vlouco » Mon Mar 12, 2012 7:27 am

I don't really know if this helps or not, but i've just successfully done in windows exactly what i was trying to do in Ubuntu 11.10.

Trying the same commands in Windows I've experienced none of the issues with p3d files or installers said above.

I'd like to mention that I've tested the resulting p3d file and intallers in Ubuntu 11.04, 11.10 and Windows, and in Ubuntu 11.10 running the game through any of these resulted i very slow FPS (6-7) compared to running directly from the source or any of the other platforms mentioned (60 FPS).

Guess I'll just leave Ubuntu 11.10 be for a while...
vlouco
 
Posts: 4
Joined: Mon Mar 05, 2012 1:51 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests