2018-12-02 20:08:44

Hi all!
As much as I like javascript for audiogames, it's gotten to the point where I'd like to try other cross platform, more advanced alternatives which support things like multithreading, etc.

I've been looking at Python but so far I've had no success, because mostly I've come across outdated libraries like audiogameKit3 and stuff like that whose latest versions are from 2017.

Does anyone have more modern stuff that we can use?
Maybe someone here has coded something and we can exchange ideas?
Let me know!

Thumbs up

2018-12-02 20:32:54

Hi.
I wouldn't use audiogameKit3, mainly because it isn't a mainstream library. That said, having libraries from 2017 doesn't mean it's outdated (that solely depend on the library on question).
I would use eather pygame or pysdl2 for ui,, some form of open al (or fmod) for audio and steel f( or accessible output2 from q) for screen reader output.
These are most of the external game related libraries you would need, anything else is in the standard library (well stuff like making data files in json and such).

Hope it helps
NicklasMCHD

I'm me. Just me. No one else. Only meeee!

Thumbs up +1

2018-12-02 21:33:27

audiokit3 uses libaudioverse and some other shit for keyboard input, menus, etc etc and it seems reasonable, *shrug*

Thumbs up

2018-12-02 23:57:13

You might want to check out paul iyobo’s python3 version of AGK, located at https://github.com/pauliyobo

2018-12-03 00:51:21

libaudioverse is discontinued and as far as I know does not support Mac.

2018-12-03 00:52:14

Not to be a jerk. But I couldn't really resist

ogomez92 wrote:

and here is how python  shows its general slowness...
the game could be great, it's not the best in its kind but that's not your fault, it's python. it's slow and clunky for audiogames.

What all on  a sudden made you change idea? Just curious.

If you want to get in touch with me you can follow me on Twitter
have a nice day.
Paul

2018-12-03 02:32:40

Some other libraries of interest would be Pyglet, which as OpenGL and OpenAL support, and Tolk for screen reader access, maybe PyAL. You could also check out my [OpenAL Example Pack].

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

Thumbs up +1

2018-12-03 05:56:16 (edited by ogomez92 2018-12-03 05:57:06)

at #6 just trying to broaden my horizons. As much as I love Javascript for simple games, stuff lke Beatstar, rhythm rage, etc which make heavy use of fs modules, quick loading of files, etc etc, need more robust options. Python slowness... that game was slow, I can say that for sure, though I still need to see if it is a general thing or undead assault was also slow because it wasn't so well done. I guess I wanna try it for myself, see what happens.

At #6 what do you use foran  audio library?

Thumbs up

2018-12-03 07:09:22

@8 I use sound_lib. There are a few options in sund which are:
sund_lib, pyopenal, and pyal, on which magurp created some examples.

If you want to get in touch with me you can follow me on Twitter
have a nice day.
Paul

2018-12-03 07:31:18

Python most definitely isn't slow, if you fully utilize multithreading and coroutines. If it were slow, it wouldn't be used for heavy machine learning algorithms, data mining, big data, cryptocurrencys, and so on -- things that require high-speed computing.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

2018-12-03 13:28:16

Oriol check this thing. It might help you. Just I have to say that I used the timer module in AGK3 along its output module. They're nothing to be updated or anything. It's bass of an fps-style game. No weapons, But it features a nearly nice movement system. Note again! This thing might be slow because I wrote it in pyglet and pyglet.schedule functions add a bit of lag to the game and i found no way to fix it. I converted this to pygame for myself. Link:
https://github.com/kianoosh-shakeri/python-fps/
Recently I use pygame for key handling and window creation, WX for sudden popping up dialogs such as input texts, Etc, Sound_lib which is a bit buggy or i still don't know how to fix my problem because i'm pretty new to this library, And pyopenAl. You can use pyAl as well.
Last but not least, Python isn't slow. Well not that much you might think. It's slow when it comes to graphical game development or better say vidio game development. It's good for audio games

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

2018-12-03 14:14:36

It depends on how you optimize it for graphical rendering. Using simple draw calls is good for the basics, but for heavy lifting like lots of objects or complexity you really want to use things like hardware acceleration. Pyglets the obvious choice for that given its OpenGL bindings, Pygame and PySFML mostly only have 2D acceleration.

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

Thumbs up

2018-12-03 19:05:46

Hi,

Ethin wrote:

Python most definitely isn't slow, if you fully utilize multithreading and coroutines. If it were slow, it wouldn't be used for heavy machine learning algorithms, data mining, big data, cryptocurrencys, and so on -- things that require high-speed computing.

Just wanted to comment on this first.
Python itself isn't exactly slow, its just slower than low-level languages like C or C++ or assembled languages like C#, due to its just-in-time processing and the interpreter. The fact that it can be used for calculation-heavy and time-critical applications is because its standard library, syntax and built-in features are just amazing and you can create a script using libraries like tensor in a few minutes. Tensor itself again is just a Python extension written in some other language like C with a Python wrapper on top of it to simplify access even further.
Same goes for all other big data analysis tools. The libraries themselves are written in highly performant languages to enpower Python scripts with the best speed possible, but the data analysis results can be easily processed using Python.

I myself used to develope audiogames in Python, and it was fun, but I ended up stopping to do so, because it wasn't what I expected. It worked, but it simply didn't feel that great doing so, it kinda felt like hacking something together instead of feeling like I was doing something really cool.
I used Pygame those days, even a really old pygame version (1.7.1 I believe), since I found out that sdl2 used in any higher pygame version simply crashes on very old laptop graphics cards produced by ATI (which is AMD nowadays). I was using accessible output 1 (not 2), which I enhanced by adding compatibility to 1 or 2 more screen readers.
For popups which needed to show real windows I accessed Tkinter, because its already within the standard library. Sound was realized using Bass4Py (https://github.com/Timtam/Bass4Py), which is currently in the refactoring process and will be releazed with full Cython bindings soon enough.

Regarding Cython: if you want to easily wrap a shared library or write time-critical algorithms in Python (or pythonish style), you can use Cython, which compiles down to a Python extension built in C and therefore drastically increases performance, even adding in typechecking and loads more. Check it out.
Best Regards.
Hijacker

Thumbs up +1

2018-12-03 19:09:56

You could also use bass for audio, even though i don't think a * really * good bass wrapper exists for python, but I could be wrong.
i heard somewhere, that @cartertemm was working on a bass wrapper, but I don't know, if he's releasing it to the public or if it's even a thing.

Sitenote: Use python 3, I will kill you if you're not smile
No but i heard use python 3. Python 2 will be discontinued on the first of january, 2020.

- NicklasMCHD

I'm me. Just me. No one else. Only meeee!

Thumbs up

2018-12-03 20:48:21

there is a bass wrapper which is called pybass. Carter's making a sound_lib like thing for making the sound manipulation easier. Sound_lib it's self has been built on top of pybass. So there is indeed a bass wrapper.

If you want to get in touch with me you can follow me on Twitter
have a nice day.
Paul

2018-12-03 21:11:33

Well, pybass is about 5 years old and doesn't know any of the new features BASS provides, so i'm sticking to Bass4Py, which offers a nice OOP-friendly interface and knows more of the new features and tries to stay up-to-date with BASS. There might actually be more BASS wrappers out there, considering its popularity.
Best Regards.
Hijacker

Thumbs up

2018-12-04 01:45:02

One thing to think about when comparing python and the way and speed in which it does data mining and machine learning as compared to game rendering, is that Any data analysts worth his or her salt should be running computations on a GPU. GPU's generally have many times more cores than a normal CPU and GPU tasks are much more parallel friendly. Your random duel-core (quad-core at best) random laptop will never keep up with a decent GPU. On the main CPU you are also fighting for execution time against all of  the other process in your computer: mail program, twitter client, and oh look helpful windows just checked for updates.
----------
This
post
will
continue
after
this
extended
reboot.
----------
Few, now that that is over... That being said, any program written poorly will run like crap no matter the language and no matter the CPU. Which is why I am so bullish on getting some sort of formal education in comp sci or a related field if you really want to program or in this case code games. You'll be able to see that the algorithm you just wrote is O(n^2) when you could have written it as O(n). And so many more things that you learn that almost can't be taught anywhere other than in a classroom setting.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub

2018-12-04 02:07:40

True. But Python isn't slow. In fact, as time goes by Python will get closer and closer to speeds matching native speeds. It will never get equal speed, but its already close enough that there isn't much of a difference.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

2018-12-04 12:47:42

In conclusion, coding audiogames in python is bloated as **** and either you have to use a really old audio library, make it yourself, and hack together a bunch of other stuff. I think I'm sticking to js. *rolls eyes*

Thumbs up

2018-12-04 13:16:41

Yeah, to be serious, i'm not a fan of audio game development in Python yet. In fact, the only good thing BGT did was the native audio gaming support, but thats it already. We'd probably need something new, without AngelScript playing a role in it, maybe on top of Lua, which is the fastest interpreted scripting language to date and would also be cross-platform compatible.
If i'd have to develope audio games without the help of BGT right now, i'd probably stick to something FMOD compatible, like C#, C++ or something.
Best Regards.
Hijacker

Thumbs up

2018-12-04 13:30:58

I still prefer python over C# unless someone corrects me if i'm wrong. C# can be decompiled super easy and in some games I don't want this happen. I know decompilation is a task that can be done no matter how hard you protect your code. But the hardness of decompilation is what matters to me. With a deobfuscator like de4dot and then a decompiler like dot net reflector people can get my sourcecode that I was working on for maybe years! And this feels a bit cruel to me. At least i can mess with opcodes and build python myself then decompiling my program will be harder but I found no way so far to protect my C# code specially against de4dot

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

2018-12-04 14:36:30

I like node.js, I mean of course code can be decompiled and my games are open source so yeah code protection is something I don't really need at this point, but still.

Thumbs up

2018-12-04 15:29:37 (edited by Hijacker 2018-12-04 15:31:42)

kianoosh wrote:

I still prefer python over C# unless someone corrects me if i'm wrong. C# can be decompiled super easy and in some games I don't want this happen. I know decompilation is a task that can be done no matter how hard you protect your code. But the hardness of decompilation is what matters to me. With a deobfuscator like de4dot and then a decompiler like dot net reflector people can get my sourcecode that I was working on for maybe years! And this feels a bit cruel to me. At least i can mess with opcodes and build python myself then decompiling my program will be harder but I found no way so far to protect my C# code specially against de4dot

Oh, you are wrong. In fact, Python is much easier to decrypt than C#. C# code is stored as assembly within your executable and yeah, the assembly can be decrypted, but Python code is stored as byte code wherever you take it, because the interpreter needs to be able to know the code whenever running it. All the Python "build" tools are in fact packaging tools instead. They take the Python interpreter, collect all dependencies your code requires, convert all the plain scripts to byte code, pack all those things together and set up a neat little run script running the interpreter with your dedicated main script to get it running, thats it. Oh and, this resulting package, although it mostly looks like an exe file, is just an enhanced zip file, since Python handles its imports via zipimporting, so all the packages are required to ly within zip files inside the executable. So if it comes to protecting your code, you are way better sticking with C#, since obfuscation can help making your assembly as hard to read as possible. Pythons byte code will probably be always better to read than assembly, even when obfuscating your code, pythons byte code probably stores more information than the C# assemblies.

If you really want to protect python code as far as possible, stick with tools like Cython which takes your Python code, transpiles it to C code and builds a native python extension compiled out of C code from it, allowing only reverse engineers to work something out of it.

Best Regards.
Hijacker

Thumbs up

2018-12-04 15:41:55

A library could be old, but it could still work well. Honestly I don't think that using old libraries for audio is bad because libraries are outdated.
But this is just me :d.

If you want to get in touch with me you can follow me on Twitter
have a nice day.
Paul

2018-12-04 16:09:18 (edited by kianoosh 2018-12-04 16:10:16)

Ok. You might be right with the fact that python codes are more easy to decompile without protection compared to C#. But well. There are things like cython that you can use on python's case. No way i found to protect my C# code and at least Me, the developer fail on decompiling my own program. What i'm trying to get out of all this is a way to protect my C# code, And then see if I can suggest it to people for audio game development. In my own opinion though. A lot of people still think that if the hacker wants to get the code they will. So why any further protections when you know this fact. My problem is with the ones who really don't know much and with a little little little effert they manage to get my sourcecode out of the executable file and then make fun of me. Uh. That hurts.

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