2017-07-19 02:24:17

Hey there,

Long time lurker, don't post often.

I've recently learned the basics of python, and heard that pyglet was a good place to start for audio game development. 

After searching online I found a few tutorials for how to get pyglet working, but nothing regarding sounds.  I looked through the documentation, but that wasn't much help either. 

So, are there any tips, tricks or tutorials for working with python and pyglet, or is it best to work with another language and  library entirely?

Thanks in advance for any replies.  This seems like a great hobby to get into, but I'm pretty unclear on where to start.

Signature

2017-07-19 03:33:18

As much as I dislike BGT, if this is your first experience in programming, BGT may be more immediately rewarding.

As to Pyglet, the usual way is to pull in Libaudioverse

I would also recommend building a sound cache, kind of like a memoizer but for sound, but you may not be able to do that if you have just gotten started.

Anyway, if you would like to continue on with Pyglet, feel free to post here.

2017-07-19 04:13:26

Seconding Raven. BGT is the quick-and-dirty solution, and libaudioverse is the way to go for Python.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2017-07-19 08:49:05

Thanks for the quick replies.

I skimmed through the documentation for Live Audioverse, and it looks like something I could work with.

I'm a bit confused as to how I get it working with python/pyglet though.  I'm assuming you can't simply install it with pip like you can with pyglet?

Additionally, how do you get your game working without any graphics?  Looking through the tutorials for libraries like pyglet and pygame, it seems as though you need some kind of sprite/pixels on the screen to handle events like player movement and collisions. Is this all done through pyglet somehow, or with Live Audioverse?

Thanks again,
Appreciate the support.

Signature

2017-07-19 09:54:57

Hi,

there already was some other topic I answered similar questions about pyglet and how to do stuff with the keyboard and some other stuff without displaying anything on the screen, which is indeed not needed at all. Since I only got experience with pygame, but not with pyglet, I can't speak from my own experience, but I can link to some tutorial which should cover those basics:
Check out this link for example
Best Regards.
Hijacker

2017-07-19 16:50:18 (edited by ultradude306 2017-07-19 16:56:32)

Hijacker wrote:

Hi,

there already was some other topic I answered similar questions about pyglet and how to do stuff with the keyboard and some other stuff without displaying anything on the screen, which is indeed not needed at all. Since I only got experience with pygame, but not with pyglet, I can't speak from my own experience, but I can link to some tutorial which should cover those basics:
Check out this link for example
Best Regards.
Hijacker

Does Pygame work withLive Audioverse as well?     If it does, that might be a better place for me to get started, since Pygame seems to be more widely used.

PS:  are there certain steps I need to take in order to get Live Audioverse working with python/the other libraries I'm  using to make the game?

Signature

2017-07-19 18:01:14

Hi,
you can combine almost every library with each other as long as they are compatible, means they don't interfere with each other. Since libaudioverse is a library which doesn't influence any other library, you can combine it with every library you want, if it's pyglet, pygame or some GUI framework like wxPython or Qt doesn't play any role here.
There aren't any special steps to get both of them working, at least no more steps you'd need to get each of them working separately.
Yeah, pygame is older and you can probably find more examples on the net, and since development of pygame continued some months ago, there isn't any reason not to try it out.
Best Regards.
Hijacker

2017-07-19 18:29:44

Hijacker wrote:

Hi,
you can combine almost every library with each other as long as they are compatible, means they don't interfere with each other. Since libaudioverse is a library which doesn't influence any other library, you can combine it with every library you want, if it's pyglet, pygame or some GUI framework like wxPython or Qt doesn't play any role here.
There aren't any special steps to get both of them working, at least no more steps you'd need to get each of them working separately.
Yeah, pygame is older and you can probably find more examples on the net, and since development of pygame continued some months ago, there isn't any reason not to try it out.
Best Regards.
Hijacker

Thanks for the information.

Looking further into things, I'll probably use Pyglet,  as it seems to be able to do more.

However, no matter what library I choose, I'm still stumped on how to actually get my game up and running… Looking at all the tutorials online,  it looks like you need some sort of sprite to get the basic mechanics of the game working. I looked at the documentation regarding keyboard events for pyglet,  but it seemed to focus  only on text/menus, not gameplay.

Signature

2017-07-19 19:24:49

All of you seem to forget that you can drop most of the unneeded code and it will run without any problems anyways. Following this guide, what's so wrong about using this code?

import pyglet
window = pyglet.window.Window()
pyglet.app.run()

And why do you think this wouldn't work at all without displaying any graphics?
In advance, pyglet doesn't have any features pygame doesn't have too, maybe except the video playback capabilities, but i'm not sure about this (didn't need this in pygame until now).
And since you want to use libaudioverse for audio playback, the limited power of pyglet and pygame considering audio doesn't play any role here.
Best Regards.
Hijacker

2017-07-19 23:34:10

The tutorials spend a lot of time on graphics because they expect a sighted audience. The graphics are output, though, not part of how the game works behind the scenes. Audio is similar: the workings of the game are not the graphics or sound (or haptics if anyone ever goes there); those are just methods of communicating what happens to the user.
A lot of 3d engines blurr the line between graphics and mechanics, but those sorts of engines leave a ton to be desired in terms of accessibility ATM. Pyglet and Pygame support graphics, but you can ignore them if you wish.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2017-07-20 00:39:26 (edited by ultradude306 2017-07-20 00:46:44)

CAE_Jones wrote:

The tutorials spend a lot of time on graphics because they expect a sighted audience. The graphics are output, though, not part of how the game works behind the scenes. Audio is similar: the workings of the game are not the graphics or sound (or haptics if anyone ever goes there); those are just methods of communicating what happens to the user.
A lot of 3d engines blurr the line between graphics and mechanics, but those sorts of engines leave a ton to be desired in terms of accessibility ATM. Pyglet and Pygame support graphics, but you can ignore them if you wish.

Thanks.  This cleared a lot of stuff up. 

Still a little confused as to how you get libaudioverse to work with the mechanics that you've got coded in pygame though.

Signature

2017-07-20 22:26:53

It's good to see someone new who's interested in game development.
As far as integrating libaudioverse (and just fyi, it's spelled exactly like that), it depends on what type of game you want to make and how that uses sound.
As an example, if you are making a simple card game, you most likely don't need 3-d sound positioning, and will just want the ability to play sounds when certain things happen, optionally panning sounds and supporting varying volumes.
This is probably the simplest usage of the library, and the reference manual has an example of how to load a sound and play it (as well as how to pan one); all you need to do is code your game so it follows the steps that the 'buffers and playing files' section of the manual does.

Perhaps a more common example of a way you might want to use sound in your game is with a full 3-d environment; that is, where sounds can move in 3 dimensions around the listener. Games such as Swamp and Road to Rage are examples of this, though I'm not sure if both actually use 3 dimensions.
To accomplish this, you'll need to use an EnvironmentNode in combination with a SourceNode for every "thing" in your 3-d environment you want to play a sound.
There are many things you can tweak that change how the environment sounds, how far sounds travel, if there is any reverb or other affects that are applied to sources, etc; I highly suggest you read libaudioverse's reference manual and python-specific notes for a good look at what it can do.
Of course feel free to ask any questions here and I'll help if I can.
Good luck!

Regards,
Blademan
Twitter: @bladehunter2213