2014-11-22 09:04:58 (edited by Victorious 2014-11-22 12:56:58)

My vacation will be starting soon, and I was seriously considering developing a simple audiogame to put some of the concepts that I learnt in a programming module to practice, and it stops me from getting too rusty over the break. The idea that I had in mind would require full 3d sound though so I'll probably need to use HRTF.

I've been learning C for a few months and have grown pretty comfortable with it.

I'm trying to decide what language I should use to write the game in. I don't think I want to use BGT, and I see that c++ and c# are both based off C, so I hope that my prior C knowledge would allow me to pick either up. Those are probably the 2 languages that i'm inclined to try, but I'm not sure how to decide between them. From what I've heard, C++ is faster but more difficult to use than c# though i'm not sure how much that will matter for an audiogame. I think programmes in C# are also easier to reverse engineer.

If I decide not to use BGT, I'll also have to figure out which libraries to choose. What are the best libraries available for screen reader support and HRTF audio?

Finally, if I do decide to make commercial titles, how should the issue of software piracy be handled? I know i could use obfuscators to hopefully make life miserable for anyone attempt reverse engineering, but i'll also have to think of a suitable licensing system. If I make it multiplayer, then having game progress tied to user accounts would service. For single player games, how much would people mind if the game required at least periodic access to the internet?

2014-11-22 20:19:13

Victorious, I and a few others have been working on a system for handling commercial titles, and may be able to help you out once you get far enough along.  We currently have both C and BGT interfaces.  It does require network access for most of its authorization, as there's not really any other way to have solid piracy protection.

Frankly, in this day and age, there's really no excuse to not have network access.  Sure, outages happen, and we've been setting things up to allow for a temporary offline mode - but I'm convinced that the vast majority of people demanding offline versions are either confused or want a standalone version that can be cracked.

-dentin

Alter Aeon MUD
http://www.alteraeon.com

2014-11-22 20:32:24

It won't be ready for your holiday, but I have begun looking into how to get Libaudioverse out to testers and the like.  Other than my work, the only other thing I'm aware of is OpenALSoft-I will not repeat my rants about that here.  Coding your own HRTF is doable, but you'll need a dose of math and some knowledge about how to safely read/write custom binary file formats.
I'd not be worried about reverse engineering, but in truth anything that's not C/C++ can be.  C#, Python, java, Angelscript, Lua, probably javascript, all of these can be decompiled with about the same amount of effort.  On account that cracking your C/C++ version is also quite possible and using C/C++ will probably add weeks to your development time at minimum, it's not worth it in my opinion.  C# is not a bad language, but you will be missing a debugger unless you use Visual Studio's IDE; this may or may not be a killing blow to you, depending on your development style.  Regardless, a garbage collector is kind of a killer feature.
@dentin:
I kind of disagree.  First, a lot of blind people are in 3rd world countries with really slow or worse internet connections.  Second, even on a university campus with great internet, I still find myself offline quite a lot.  It's not as common as you think to always be online, especially among this community-and if you only target the first world countries, you'll be missing half of an already tiny market.
I'd be interested in how you're doing this in such a way that an equally capable programmer couldn't crack it once for all games, but then again I'm not sure you'd want to tell me that, especially in this public setting...

My Blog
Twitter: @ajhicks1992

2014-11-22 23:24:07

@Victorious, you mentioned needing full 3D sound, and that meaning you need HRTF.
Just to clarify, there are many 3D audio libraries that do provide 3D positioning of sound via panning, volume, and low pass filters for things behind you, but do not include HRTF.
And I've even seen Aprone and CAE Jones discussing the algorithms they use to set panning and volume adjustment to avoid the need for a separate 3D audio library at all.

So I'm just saying that HRTF makes it sound better, and is a nice to have, but for your first 3D game it is not a requirement.
Swamp is a good example of a successful game doing 3D audio without HRTF or environmental reverb.

My opinion on the performance of C++ versus C# is that it is negligible for audio games.
I also think C#, (and other high level languages), are considerably easier to learn and use than C++.

Programs written in C# are definitely easier to reverse engineer than those written in C or C++.
I guess you have to weigh the importance of this along with the other pros and cons of both languages.
For me, and admittedly I focus on free games, it is not very important as compared with other factors.
If you charge for an online game then the reverse engineering aspect matters less as online content and user accounts become most of your protection.
And as Camlorn said, writing it in C/C++ does not stop people from cracking it.  It just raises the difficulty level for doing so.
And only one person needs the expertise and motivation to crack it, then they can just share the crack.

I use C# in Visual Studio 2010.
The debugger is not accessible, but I can still use it because I used it when I had more vision and I am familiar with the hot keys and some extra steps I need to do to get the information I want from the watch window.
That said, I actually don't use the debugger and instead rely on logging, which can be nicer when debugging a game that is trying to run at 60 frames a second and you want to get useful information, but not stop the game from running.
And despite some of visual studio's annoyances I actually love features like go to definition, auto complete, rename symbol, find all references, extract method, go to file and line for this error, collapse/expand method bodies, etc.

I heard Microsoft recently released Visual Studio 2013 Community Edition, which is like the Professional edition, but free.
I haven't tested it's accessibility though.

All this is just my 2 cents.
Obviously you should make the decision about which language to use.
And even though I have a preference, I really believe that you can write great software in pretty much any language.

~ Ian Reed
Visit BlindGamers.com to rate blind accessible games and see how others have rated them.
Try my free JGT addon, the easy way to play Japanese games in English.
Or try the free games I've created.

2014-11-23 08:10:50

@dentin: I'd be interested to hear more about the licencing system as well.

@camlorn: I'd rather use an existing library if at all possible, because I want to focus primarily on the actual audio game rather than being caught up by these details for a first project.

@Ian: Based on my experience using the 3d audio functions in BGT, I had a fair amount of difficulty determining if an item was ahead or behind me, which was why I wanted HRTF. Also, the HRTF demos sound awesome.

From what I gather, the pros for c++ are faster code execution (which isn't really that important for my purpose) and making it harder to reverse engineer. For c#, faster development time and ease of use.

What audio/screen reader output libraries are available for the various languages? That'll probably help me decide which to choose.

2014-11-23 08:24:22

no no no. I'm not saying that you should make one, just that it can be done in about a day assuming all the other parts exist and you know what you're doing.  There's a lot more to a good audio experience that takes longer, i.e. reverb, and of course all the other parts have to be there.  The irony is that, if you know the trig to compute the parameters, the part that applies the effect itself is about 15 lines.  It's all the stupid framework and support code that gets in the way.
The problem is, at the moment, that's the easiest way to get it in my opinion.  OpenAL actually graduated to tortuous today when I found yet another shortcoming in it, and distributing OpenAL and managing to get a consistent experience is next to impossible without instructing users to edit an ini.  Long and short of it is-no, you don't want HRTF for your first game.  You can get away without even lowpass.  if you've never done a game or medium to large programming project of 2000 lines or more yet, don't bother and just use the most basic thing you can find.

My Blog
Twitter: @ajhicks1992

2014-11-23 18:34:09

Ah, now I see why you want HRTF, just wanted to make sure you aren't unnecessarily shooting too far on your first attempt.
Though I wonder if the 3D audio in BGT did not use a low pass filter for stuff behind you.
Just adding that is probably enough to easily distinguish behind from in front in lieu of using actual HRTF.

Regarding sound libraries available for C++ or C#.
In general those libraries are created in C or C++ with C FFI.
Which means that in C# you have to make a wrapper around them, or find an existing one, usually other people have already wrapped them and provide their wrappers free and open source.
And C++ needs no wrapper so has one less layer of indirection

As an example I'm currently using OpenTK to wrap OpenALSoft and NLibsndfile to wrap Libsndfile.
They were both freely available with source code so I didn't need to write them.

I noticed that sometimes OpenTK would fail to initialize the sound device, so I found the snippet of OpenTK code that could fail and changed it to retry a few times if it failed.
Not sure why it failed, but retrying a few times consistently initializes it correctly.
This problem may also have existed in C++, I'm not sure.

NLibsndfile had wrapped 95% of the libsndfile methods.
Then I realized I needed to use the C callback functions to provide my own file parsing functions, so I had to add the wrappers to NLibsndfile because it was missing those.
And there was another minor bug in NLibsndfile where it thought 0 was a bad parameter to a function, but the Libsndfile documentation said 0 was valid and had meaning.
So I commented out the 2 lines that checked for a 0 and threw an exception.

So most sound libraries are available in both C++ and C#, but sometimes you need to tweak the C# wrappers a bit.
So I'd call this a slight pro for C++, but only slight.

The only other audio libraries I've used in C# are DirectSound and DirectShow through the Managed DirectX dlls.
Tactical Battle still uses DirectShow.

I know less about the screen reader libraries.
I expect most of them have C APIs, and know that Craig Brett made a C# wrapper for one of them.

Hope that helps.

~ Ian Reed
Visit BlindGamers.com to rate blind accessible games and see how others have rated them.
Try my free JGT addon, the easy way to play Japanese games in English.
Or try the free games I've created.

2014-11-23 18:45:16

The service model is intended to be similar to that of steam.  There's a master controller which runs all the time and talks to the server as well as to any games you're playing.  Games get permissions from the master controller and can verify those permissions via the web.  Games will also be able to store unlock state on the server, so if someone unlocks a secret level it stays unlocked if the player logs in on a different machine.  We'll also handle the purchasing and financials.  Our goal is to provide a distribution service that takes care of the distribution, protection, and financial issues so game developers can actually spend their time making games.

-dentin

Alter Aeon MUD
http://www.alteraeon.com

2014-11-24 02:05:01

BGT uses pitch bending for behind. One can adjust the magnitude of the bending so it's more noticeable.
I also have a custom version of the sound_positioning and sound_pool scripts that allows a volume decrease as well.
IIRC, The default behind pitch decrease is half a percent. I'd go for something a little bigger, but not ridiculously so. I tend to go for ~4%, but that might be a bit much and 1-3% is probably plenty.

Low pass is in principal possible with BGT, but it'd be hard to implement practically.

看過來!
"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.

2014-11-24 14:45:02

@Dentin: how much will your steam platform charge for usage? I'd assume that its some percent of sales.

2014-11-24 20:12:57

Right now, I'm looking at 25-30% of gross.

2014-11-29 19:16:36

Is the AccessibleOutput2 library usable in other languages besides Python?

2014-11-30 03:11:00

Given that it is written in Python, no.  Writing one isn't the easiest thing, but it's also not super hard, and there's plenty of example code if you need to go there.

My Blog
Twitter: @ajhicks1992

2014-12-02 14:10:19

Is there a less painful way of adding a library to a project in visual studio 2013?

2014-12-02 18:20:53 (edited by camlorn 2014-12-02 18:21:30)

I know what you mean and no, not really.  Most common tasks in Visual Studio 2013 are painful if you are blind.  That said, if you're doing it by editing the library path, that's what you end up doing with the command line build systems anyway.  I left VS for command line build systems because it gets rid of all the tabbing, but nothing gets rid of the complexity.  The two steps--editing libpath and adding it to the linker--are conceptually the same.
On a sidenote, if you are going into .net C# land, look at XNA.  It is no longer actively developed, but it's there and it will probably meet most of your audio needs.  It also provides a lot of structural stuff and tutorials on using said stuff, so you may find it helpful.

My Blog
Twitter: @ajhicks1992