2018-09-17 00:53:58

Hi all!
I'm a college student majoring in computer science and I wish to increase my ability to program by writing something others and my self can enjoy, and at the same time becoming a better programmer. I wish to begin by asking what language is best for programming audio games. I know BGT is a language dedicated to building such games, but I know it is also quite out of date. I have, however, learned a decent amount of it to at least get started, but I cannot find any third party classes developed by others to use in my game to help the development process come along. After all, sometimes it's easier to debug than to come up with completely new solutions to a problem.
As it is, BGT has me stumped with how to spawn objects and keep track of them, so my next thought was to try Python. After all, many believe it is a language that, besides being good for developing quite complex things, it can also be used for audio games. However, I cannot find libraries that will help me with positional audio. I'm sure they're out there, for I doubt anyone would have suggested Python if I couldn't develop an audio game with it. I have started to learn Python as well, so any help on that front would be appreciated.
In short, I just wish to find a language to program a game and with support for good audio management, and if possible, someone to help me get through my first steps in this world in which I've only been a part of as the player and not the dev. Any help would be greatly appreciated.

Thumbs up

2018-09-17 02:49:04

Hi,
    Welcome to the forum, hope you find what you're looking for. I've used both the languages referenced here quite a bit for game development. First off, I have a github repository with a lot of the most popular BGT includes. You can find it
here
Hopefully it'll house enough to at least get you started.

    With that said, many (myself included) will continue to highly discourage newcomers to use the language for a multitude of reasons. As you said, it's pretty old and we've heard literally nothing from the developer since 2013 or so? In short, future updates are quite doubtful. Next, the BGT stub (binary that contains the core BGT functions and is included with each and every executable) is an almost instant flag for the most popular anti-viruses, windows defender included. We've all submitted false-positives a time or two, but the sad truth is that we're an extreme minority. In short, your games will be falsely flagged by anti-viruses in spite of any optomisations on your part. Finally, no matter how much we might make extremely loose hacks with the faulty DLL support or whatever, you'll eventually face some pretty evident limitations.
    Now, on to my favourite language by far, python. For positional audio, it all depends on whether or not your looking for 3d. If so, the most popular in the community is

libaudioverse
It's probably got everything your looking for. Reverb, wave generation, a bunch of filters, a recorder, etc. However, the project has recently been discontinued. This isn't as big of an issue as it might sound though, since the engine itself takes advantage of lower-level windows API's which haven't really changed over the years and should almost surely be in existence for the foreseeable future.
Also out their is bass, openal, and my personal (all be it a tad out-dated) choice, sound_lib which is another wrapper of bass. I'd like to get around to writing one of my own at some point but well, that's another topic for another thread.
It's always nice to see new devs in the community, so don't hesitate to reach out.

Thumbs up +1

2018-09-17 03:36:43

Hello,

Welcome to the forum. It's nice to see another college student who is on their way to getting a Computer Science degree. I can tell you, it's a rewarding field to study. Although, a degree in computer science does not teach you how to develop an AudioGame. This is why it is good to be part of a community such as this in which people are happy to help you in programming, despite some of the small issues that we tend to face as a collective group. As you have already noted, the issue of whether BGT is a good or worthy programming language for beginners is a long-lasting discussion that just circles upon itself, ultimately leading to nothing more than bickering. However, one major flaw is apparent: BGT is comprised of outdated technologies, and as such, causes off-putting security vulnerabilities. therefore, it is recommended by many to step away from the language altogether. The advantage that BGT does offer, however, is the support for development libraries and facilities relevant to AudioGame development, many of which require some assembly in other more mainstream languages. Regardless of the language you choose, you will have to consider that you may have to make compromises and/or work-arounds for things that were conveniently offered by the BGT engine.
In terms of the Python programming language, while it is true that it is a convenient language for beginners, and it offers much in the way of development libraries, its disadvantages lie in size and speed. Perhaps optimizations do exist, such as C-like compilation known as Cython, or tiny Python interpreters and packaging, but the issue of bulkiness tends to prevail. If you can deal with that, by all means, Python is an ideal language. There are many libraries for sound manipulating, most of which are categorized as multimedia libraries. Pygame and Pyglet seem to be popular choices for the game devs. Libaudioverse is also a choice, but I'll stay away from that since last I heard, it wasn't much of a lib for production use.
If you go the C or C++ route, there are also many options. The popular choice is OpenAL with SDL.
Many people have also taken a liking to JavaScript lately. The WebAudio API is quite powerful, and if you know how to use it, this can be a great option if you desire your apps to be as cross-platform as can be.
In conclusion, there are so many combinations you can choose. Ultimately, it is up to you and what programming language with which you are familiar. Also keep in mind that Audiogame development is not just programming. A lot of it has to do with good sound design and coming up with ideas that people might find entertaining. I hope you can find your way to becoming a great game developer.

Click here to friend me on Facebook.
Click here to follow me on twitter.
If you want to add me to Skype, my name is lozano.edgar.
Please let me know that your from the AudioGames community if you wish to add me on any of these sites.

2018-09-17 05:55:43

You might find some of these examples useful in your endeavors:

[OpenAL Python Example]
[OpenAL HRTF Python Example]
[OpenAL EFX Python Example]
[OpenAL Python Recording]
[I2S Filter Python Examples]
[Audiocraft v1.1]

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up +1

2018-09-17 06:54:31

Hi there. Welcome to this forum. It'll be a lot helpful. Believe me. I got many many helps in this comunity that made my development process go a lot faster. I also recommend you use openal over libaudioverse if you are going to use python. While libaudioverse is awesome and has a lot of useful features, It might be honestly hard for a beginner to work with, starting from setting up servers and sources and environments, And i even found out some odd stuff in it like some problems with sound playing and it uses a sound playing system that is honestly different than any sound library i've ever seen.
Make sure you download all of those productions that magurp244 posted here. They might be too complicated for you when you start working with python programming language, but they'll help you a lot when you get into game development more. Also make sure to check out carter temm's github, He's a great python developer and has a copy of a repossetory which is not maintained anymore and that has a lot of nice libraries in it for audio game creation. Gladly as i said carter took a copy from it and shared it with us which makes a big thanks for himself.
There are also a lot of good resources to learn python. One of them is the tutorials point website. The website address is
www.tutorialspoint.com
I'm not gonna give you a direct link to the python manual because it has a section specially for python tutorials so open the website, press h and you'll find it.
Oh and before i forget start with python3. Don't go with python2 because it might be discontinued soon, while python3 is always updated. Some might say that there are a tun of libraries out there for python2 and their reason to use python2 is this. But the thing is that libraries are getting ported to python3 quickly, and almost any in development famous library that was using python2 before, is now supporting python3. So really, no worries about this.

Add me on skype: kianoosh.shakeri2
Or follow me on twitter @kianoosh shakeri

2018-09-17 10:01:50

hi
welcome to this forum
i think pition is grate, dam i cant spell it!

website: mahdi.jc-hosting.me
email: [email protected]: skype: mahdi.abedi82
my name on playroom: mahdi-abedi
my teamtalk server information: mahdi.jc-hosting.me, ports 6661: tell me to give you account

2018-09-18 03:00:53 (edited by ricardo0922 2018-09-18 03:01:41)

Thank you to all that have replied with very helpful information. It looks like I'll see what I can do with both BGT and Python. Python, since it's a multip-purpose language, has a lot of features I probably will not need for audio games, which is why I wish to use BGT to dip my toes into the pool of audio game development, since it is pretty simple to get started with. I'm sure it helps many grasp difficult concepts when they're first getting started, since there are not a lot of needless included functions and whatnot.
That being said, one thing I still can't figure out, and I'm not sure how Python would help me, since it seems like it's a problem that must be solved independent of whatever language you use, is not only how to spawn different types of objects, but also how to keep track of them. I can't use variables for each object, since there might be any number of objects at any given time. This is why I would love it if someone, maybe over skype or another communication service, was able to give me a crash course on how to use arrays to store object data and how to retrieve it. For instance, it's easy enough to build a game board where you can get your coords and move around, but it is much more difficult to put tiles and even monsters on that board and have them play correctly. I'd like to start by using BGT and then as my  knowledge of python increases, use that. Maybe one day, C++.
Again, thank you to each and every one of you for your valuable input.

Thumbs up

2018-09-18 05:48:38

The tools required to create and manage objects are often handled with the basic functions languages provide, classes, lists, dictionaries, etc. Such topics are generally covered in tutorials and books like [Think Python], or [Dive Into Python].

Using lists is fairly straight forward, a good analogy for a list would be a shelf where you can stack objects in a row. For example:

#create a list
shelf = ['book','snow globe','necronomicon']

#print the whole list
print(shelf)

#print the second item in the list
print(shelf[1])

#change an item in the list
shelf[2] = 'bible'

#add to the list
shelf.append('magazine')

#remove an item from the list
shelf.remove('book')

#remove an item by its position in the list
del shelf[1]

The above code demonstrates creating and playing around with list indexes, adding to and removing items from the list. When it comes to maps and objects, lists are usually used as reference points for objects relative positions to each other. As another example, lets create a 2D map using 5 nested lists stored in another list:

grid = [[0,0,0,0,0],
        [0,0,0,0,0],
        [0,0,0,0,0],
        [0,0,0,0,0],
        [0,0,0,0,0]]

print(grid)

print(grid[0][0])

In order to read individual items in this new 2D list requires two sets of numbers, a vertical number for the row, and a horizontal number for the item in that row. So lets say the number 9 represents the player, you can then set grid[0][0], the lower left corner, to the number 9 which can represent the player. Using this as a reference, you can check adjacent values like [0,1] to the right of the player, [1,0] above the player, or [1,1] to the upper right of the player for different values that represent different things, such as the number 1 representing walls, number 2 as a sword, number 3 as a goblin, etc. and use various other functions, variables, and lists for handling things like inventory, hitpoints, etc. You can build more complex interactions with classes and such, but the general principle is the same.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up +1

2018-09-18 08:10:19

at ricardo0922 You can also add me on skype, I can help you in your problems if you like. We also have a group for the blind programmers, You can join there as well though i have to add you myself or one of the admins of the group should do that which i assume you don't have them on skype since you are new to this comunity.

Add me on skype: kianoosh.shakeri2
Or follow me on twitter @kianoosh shakeri

2018-09-20 07:24:11

Kianoosh, I'd appreciate if you add me to that group of blind programmers as well. And I'd still recommend tossing aside bgt and sparing yourself a lot of headache later on. Thanks for the above resources post4. They're really really helpful.

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up

2018-09-20 07:39:58

Guys, where do I get openal from? I don't seem to get it on pip. And I am now, holy confused on which sound library to use,! There are so many! OK, I will focus on only one. Tell me, logically, which one is the best in terms of functionality and easiest to learn.

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up

2018-09-20 08:02:28 (edited by magurp244 2018-09-20 08:37:56)

OpenAL itself isn't a python library so you won't find it on pip, although there are libraries on pip that can use OpenAL. In general there are only about two worth using, PyAL which is a straight wrapper for just OpenAL, and Pyglet which comes with basic OpenAL support and all sorts of features for game development, like key input, OpenGL rendering, etc. If you go with Pyglet, you'll need to modify some of its driver scripts and get OpenAL Soft in order to enable all of OpenAL's features, such as HRTF, EFX, etc. There are scripts for doing so included in the examples I posted.

You can find a binary of OpenAL Soft [here], along with instructions for installing it. In practice though, all you need to do is keep a copy of the DLL in your working directory with your scripts and you should be fine, also be sure to pack the DLL in any binaries you distribute so they work on others machines.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up

2018-09-20 11:48:47

Thanks for the above post. How is pyglet better than pygame for gaming purposes?

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up

2018-09-20 11:50:47

So I should get PiAL and I'll be good to go to work with OpenAL framework? I mean being a wrapper for OpenAL, PiAL will provide me with all the necessary evil required for a nice sound positioning system?

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up

2018-09-20 12:56:42

Pyglet comes with a base version of OpenAL that handles 3D positional Audio, but not advanced features like HRTF and EFX. PyAL doesn't come with OpenAL. For either one you'll need to get OpenAL Soft to get the most of out of them, but yes, other than the OpenAL binary PyAL has everything you'll need and the examples I provided should work fine with it.

Pyglet runs off OpenGL so can take better advantage of hardware accelleration and 3D rendering, although pygame and SFML are also popular choices, they tend to lean towards 2D applications. Their audio capabilities also aren't as good as Pyglets when modified, but that won't really matter if your using PyAL.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up

2018-09-20 13:17:06

Somebody needs to set this up for me on my pc lol or send me step by step precise instructions because it confused me teribly. Now I don't know what to do.

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up

2018-09-20 23:42:04

Getting ALL the fancy audio features does take a bit of setup, heh. I can walk you through it, starting with pyglet. So, on the command line type:

pip install pyglet

After that your good to go, most of the examples for 3D audio and such except HRTF and EFX should work fine.

Now, if you want more fancy stuff like the HRTF and EFX, you'll need to copy over a few files in to your pyglet install, which you can typically find where you installed python such as "C:/pythonXX/Lib/site-packages/pyglet". For HRTF, copy the lib_alc.py file in the HRTF example and copy over the same file in "pyglet/media/drivers/openal/", for EFX copy lib_efx.py and lib_openal.py from the EFX example to "pyglet/media/drivers/openal/".

Or if you want to use PyAL, on the command line type:

pip install pyal

After that we get to installing OpenAL Soft, which is where things might get a bit confusing. The instructions for installing OpenAL Soft are included in the download [here] as a readme file, it involves installing regular OpenAL [here] and then renaming and copying over the OpenAL Soft dll's into your system32 and syswow64 folders. Or you can just rename the 32 bit or 64 bit soft_oal.dll to OpenAL32.dll and stick it in the same folder as whatever script your writing and you should be fine.

Note that the examples I provided come with OpenAL Soft dll's, so if you just have Pyglet or PyAL installed they should work just fine on their own.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up +1

2018-09-21 08:22:28

Thanks a lot for the above instructions. I did run the HRTF example and after rectifying the print statements I was getting some module missing error. Presumably this is because I haven't copied the stuff you told me to site-packages. I'll try it once again and will post whatever the output I get here after I copy the files to the necessary directories this time.

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up

2018-09-21 08:42:17 (edited by GauravSharma 2018-09-21 08:44:59)

Hey, there isn't any directory in pyglet as you told above- pyglet/media/drivers/openal. What the hell.
Edit: I found it! By jovian magnetic fields, I found it! I was looking into piglet, the one with p-i-g-l-e-t spelling. I have two piglets installed on my system, one with y and one with i.

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up

2018-09-21 08:48:43

It is telling me to replace files here. Am I doing it right? I'm replacing the files which are already there, I mean in pyglet\media\drivers\openal directory.

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up

2018-09-21 09:02:18 (edited by magurp244 2018-09-21 09:03:44)

The one your looking for is the one with a Y, and it should be in python/lib/site-packages/, and yes, you have to copy over and replace Pyglets lib_alc.py for HRTF, and lib_openal.py for EFX. This will update pyglets openal bindings to include the HRTF and EFX functions.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up

2018-09-21 09:04:25

Read this. Even after I followed all the instructions precisely, I get this when I run OpenALHRTF.py:
Traceback (most recent call last):
  File "C:\Users\Gaurav\Documents\python\OpenAL HRTF Python Example\OpenALHRTF.py", line 6, in <module>
    from openal import al, alc
ModuleNotFoundError: No module named 'openal'

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up

2018-09-21 09:09:08

That include is if your using PyAL, since were using Pyglet what you want to do is uncomment the top two lines, and comment that line out, like so:

#using Pyglet
from pyglet.media.drivers.openal import lib_openal as al
from pyglet.media.drivers.openal import lib_alc as alc

#using PyAL
##from openal import al, alc

This will use pyglets openal bindings instead of PyAL's. If you want to use PyAL, just comment out the top two lines and uncomment the one below them.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up

2018-09-21 09:09:56

Note: I am using python 3.7, 32-bit. I think the error makes sense because I haven't installed any lib with the name of openal. Granted it is inside the pyglet but then the cyntax should be:
from pyglet import openal. Still it doesn't work.

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up

2018-09-21 09:10:24

Oh thanks a lot.

Deep in our hearts is a capacity of infinite good or infinite evil. What path we choose is up to us.
In the end, we all have to meet the same fate-the oblivion of nonexistance, an event horizon from where not even thought can emerge...

Thumbs up