Hello,
with the advent of the
Web Audio API
Audio games in the web browser have become a real possibility.
I would like to know if anyone has used the audio API, or if anyone has even been able to use it? It is super complex and in depth so most of it went over my head.
I am still learning javascript, so most of the references went over my head.
But it looks like someone could make a real 3D game in javascript.
I am not 100% sure, but I believe panda3d may be able to be run through javascript and utilize this API.

Thumbs up

Hi,

I'm a seasoned javascript developer and recently I got an idea for a sound-only 3d engine for games and exploring virtual environments. Then some nice people pointed me to this forum.
Now I need to learn a few things about audio games before I decide if my idea makes sense. Anyway, it seems not so hard to:
- position sound in 3d
- define sound direction and hearing direction (rotating your head, kinda)
- add doppler effect for moving items
- handle touchscreens on any smartphone (the game would work on any modern browser)

What I don't know is what is the current state of 3d audio games in other technologies. Is stereo sound enough nowadays, or is something better being used?
If I made the engine, how many people should I expect to use it? Javascript doesn't seem popular here.
Also, if I made tools for editing the virtual space, should they be targeted at visually impaired, or are most developers sighted anyway?

Thumbs up

a few helpful hints.
1. most games now a days use stereo movement, indeed, you were pretty much right on your post in your descriptions.
  Most of the developers here are actually blind or visually impaired. There are a few who have sight, though. It would be wise to gear the editing towards blind users, however if it would be possible to make it usable for sighted people that would definitely be beneficial.
Hope this helps.

Thumbs up

Hello,
I would really like some help with understanding the Web Audio API and getting a sound source to run. I am horrible at Javascript, but am really good at using python with
brython.
I think that what needs to happen is more audio games in the browser.
For an audio game, really all you need is 3d sound. If you can get sound like Swamp, it would be perfect! For me, I would like to know how to do:
1. load a sound
2. set a sound in space
3. unset a sound in space (so it is not checked in the loop if this is a memory problem after many sounds)
4. move the listener both through the coordinates and change the facing direction.

Does the web audio API change the sound to be lower sounding when it is behind the listener? That would also need to be something I would need for an audio game.
If you do not know python and can't help directly in brython, I really just need to know how to create and use an audio source. The examples I have seen look so horrifying that I am completely lost (defining functions within the call of another function? yikes)
There are a few sighted developers on this forum but most are not.

Thumbs up

Hey, this forum is teaming with life! Good to see.

Thanks for confirming stuff.

frastlin, JavaScript has some weirdness in it for historical reasons, but when you know what to avoid, it's a great language.
One of the greatest things is that you can do with a function everything that you can do with any plain object.

Anyway, to the point.

Web Audio Api lets you define a 3D situation and it adapts sound ballance and loudness correctly for you. So if you define the listener direction (which I'd call nose placement) it will change the loudness of sound based on that fact. The strength of that effect can be configured and I have no idea how strong it should be.

My plan for the engine is to hide all low level crap, so for a static audio scene programming wouldn't be needed at all. The more declarative it is, the better. Interactions and item/character scripting would be done with some functions.

I'm still not sure if it's a project that has potential. I'd like to put some  effort in it and maintain it for a long while. But I'm afraid there's not enough people to use it. What's an engine without games built with quality sound and voice acting?

Other questions:
Is it possible to navigate a location (room, street, park) with just stereo sound in a game? I read the description of audioquake project and they claim it's working, but could you point me to more details on how to find walls without hitting them or having a lame voice saying how far is one? wink

Also, with growing popularity of audiobooks, I think playing a game like that would be considered a great and relaxing thing to do for sighted people as well. Is that happening already? I'm new to the concept wink

Thumbs up

As I use a chromebook full time, I can't wait for "any!" html5 based web audio games to come out.
Very pleased that someone is willing to take on a project like this!
smile

Thumbs up

naugtur, I would suggest trying out some games listed on this site.  It is definitely possible to make a game where you navigate an environment with sound alone.  On IOS, a company called "Something Else" has created a few audio only games that do this.  I've also played games like Audio Quake and Shades of Doom which allow the user to navigate with audio only.  I also think Sam Tupy's new game uses sound primarily for navigation.  None of these are games played in a browser, but that is largely because it wasn't really much of an option until the new Audio API was supported by browsers--and as you have noticed Javascript isn't much used in this community write now largely because most people are writing games to run natively on the OS.  However, I could see that people might become interested in this option if there was some API available that helped hide the low level stuff.  While some of the game developers have quite advanced knowledge of development, many of our game designers are hobbyists and only beginning to develop coding skills

Thumbs up

Audio games have become very advanced, check out Swamp, Paladin of the sky, tactical battle, Entombed or Shades of doom to get a taste of what people expect from an audio game.
I use panda3d and or pyglet for python audio game development, so I am used to something like OpenAl. I believe they copy the ideas behind what OpenAl does, but it is the different html requests I have a problem with.
Do you know any other languages?
Do you know any good javascript tutorials that have you building or learning why you are doing some of the horrible things they have in Javascript?
I really want to learn it so I can develop brython, but currently I am just too horrified at all the antipythonic structures javascript has. I think it is even worse than C++...
So I would really like to change my opinion!
The best way is to make something we can use in brython. There are a lot of people learning python and brython is super easy to learn. Python is also a lot better for beginners in general.

Thumbs up

9 (edited by The Dwarfer 2015-05-10 19:50:38)

Hey all...
  I'm not sure if you all have heard of this or not, but http://www.accessiblewebgames.com has games such as are being discussed in this forum topic. From the times I've played their games, I can assure you it's not just some ambitious scam or something, unless they took their games down since I played them two years ago.
  But yes, this is just proof that such games can, and have, been made.
Edit: Yes, all of the games are still there. They have racing game, three D games, and maze games. There are not many games there... but yeah.

Thumbs up

No way!
Why is this the first time I am hearing this?
Thanks for sharing that!
I bookmarked it.
They got 40 games on there it looks like...
Will be checking this out for sure!

Thumbs up

Thanks for all the replies, I'll try to check things out (if they work on linux wink ).

I wrote a long post, but something glitched and I lost it...
Anyway, I found this: http://gamedev.stackexchange.com/questi … l-3d-audio
And I wanted to know if Binaural sound and HRTFs (Head-related transfer functions, see wikipedia, the forum won't let me add more links) are really that important for the game experience. I don't think html5 audio supports them (but didn't check yet)
On the other hand I read that everybody's ears are different enough so that the brain only adjusts to Binaural sound over time. HRTFs available in software are based on measurements from one fake rubber head.

So my question is, from your experience, is Binaural sound that much better than stereo with adjustment for the sound being quieter when behind you? Does it make sense to create an engine that wouldn't support binaural sound?

Thumbs up

No, stereo is what people are used to. You should really play some of these games so you can see what they are like.
I wonder if Thomas Ward could comment, he develops on linux, so he may know what games you can play.
But honestly 90% of the game engine is dealing with basic audio, speech, saving stats both through post and in the browser and keyboard input.
Doing everything with brython is 3 lines max for each thing, except for audio. That is the only thing keeping me from puting out html5 games.

Thumbs up

Seems links on the Accessible web Games site are gone, but don't quote me on that.
Well, the games inside the games directory itself.

Thumbs up

Weee! I found the specification of web audio API and it has proper spacial sound built in. One more thing for free! http://webaudio.github.io/web-audio-api/#Spatialization

I finally went and read about what brython is. With all due respect - it doesn't look like a good idea to say the least. It's like "we'll let you write javascript without writing javascript and all that on top of an abstraction layer that you won't understand and that will slap you in the face every time you attempt something we didn't anticipate." wink
I saw a few abstractions on top of HTML and Javascript in my career and I've seen disappointed users, because it all only worked at first and sooner or later, hit the wall.

If you want to learn javascript and you already are a programmer, there's a very old book called "javascript - the good parts" that you should start with. After that, there's an article "Two pillars of JavaScript" that explains that there are better things in life than Object Oriented programming and class hierarchies.

But back to what I wanted to say - I don't see any advantages in brython as a tool for creating browser audio games other than "you already know python". I'd aim for something more focused on putting objects in 3D space and rendering them with sound only.

Thumbs up

I found accessiblewebgames.com before, when I searched for game examples, but after some clicking I concluded it's not maintained anymore and I couldn't try any games.

Thumbs up

HRTF is something many audio games developers are very much missing in their games. People may be used to playing games, even ones that are 3d in stereo, but that's only because 90% of them have been built using direct sound 8 which only really supports stereo audio, and eax effect support was dropped post XP. The way developers solve the lack of behind sound problem is by doing one of 2 things, either lowering the volume or decreasing the pitch, both of which are quite bad.
The few games that use HRTF work great for just about everyone I know. A few examples are the somethin' else games on iOS (papa sangre, nightjar, audio defence). I wouldn't be surprised if you actually make this engine, you'd get quite a few devs getting into js just for that reason alone.

Thumbs up

Hmm,, that is a pitty. Although, I feared something like that would happen since accessible web games.com is quite old and hasn't had much in the way of additions recently.

Thumbs up

Awesome!!! this book looks really awesome! smile I hope it is going to turn me back onto javascript because python is built for efficiency, so that is why javascript looks so horrible to me.
You can also build onboard apps and web servers in python, so it just baffles me why web development doesn't switch to python when everyone admits javascript came out before it was half-baked.
Brython is the best abstraction I have ever seen in my life, one can do just about everything in brython, especially because what it allows you to do is mix javascript and python so you can create objects from javascript and access them using python syntax.
Python syntax are worth it enough for many many javascript programmers to switch to brython. (argument naming, dictionary handling, decorators and non typing of variables being a few). Also, it is almost easier to write your webpage completely in brython rather than using HTML as it is almost even less typing than it is to type <h1 id="h">Hello world</h1><br/>
It is:
from browser import document, html
document <= html.H1("Hello world", Id="h")
And html is way smaller than javascript!
But I am going to take a look through javascript - the good parts and hopefully get turned back onto javascript!
I honestly have a very hard time telling the difference between front and back in papa sangre, but as someone who is looking to develop games, I really just want to be able to place sound objects and have some change happen.
I think another thing I would like is the ability to over-ride both the browser's automatic key commands like alt and applications as well as place the screen-reader into a state where they can play my game with very little modification.
I think as platforms become more and more numerous, people are going to head more to the internet because it is just so much easier to provide multiplatform support.

Thumbs up

Getting a screen reader to play with a web application is actually very easy, this is exactly what the aria application roll was designed for, to mark an area of the page that should accept direct keyboard commands. It causes screen readers like NVDA and JAWS to automatically enter forms mode when you press enter on it or when the page automatically focuses it. The other good thing is that it doesn't stop things like live regions from working, so you can speak game messages through the screen reader if you want.

Thumbs up

Hi guys,
I've found something about accessiblewebgames.com. The games are still available to play, because I just played bat and ball a minute ago. Let me tell you how to play them, and I will be recording a podcast on it as well.
You have to go to accessiblewebgames.com. Preess alt plus 2 if you have internet explorer, or alt shift 2 if you have firefox... that's all the browser I use so I don't know any other keystrokes.
  Anyways, that will either take you to the games page, or take you a link called "Play blind games." (Blind games? rofl).
Anyways, on that page you find all the games. It's kind of hard to get to them since your screen reader has to be off... if it is jaws anyway.
But yeah, I'll try to do a podcast on it so stay tuned for that. But in summary, there are broken links on the site, but on the play blind games page the links work.

Thumbs up

How do people normally get text files from bookshare so the punctuation is decent? I downloaded Javascript the good parts and here is what the hello world example looks like:
documentddwritelngg`Hello,
world!`);


I believe it is supposed to be:
document.write("Hello,
world!");
or something like that, but I'm not 100% sure.
What I do is download the brf file and open it in dbt, then press ctrl+T and translate it into text and then copy and paste that into a text file. But it comes out with errors like this.
How do you get around this?

Thumbs up

22 (edited by Trenton Goldshark 2015-05-11 17:29:46)

Lets take it a step closer to happiness as it were... Here's direct link!

http://www.accessiblewebgames.com/playblindgames.htm

, though that play games link is at the top of the page, below the "home" link.

As a side note: for Access keys if using Chrome OS at least, numbered Access keys are inercepted by Chrome OS itself, since they are used for opening programs on the doc, unless you add "shift" to them. It depends on what web site you're on.

A Quick Update

Sadly, Chrome OS only supports "Flash," not "Shockwave." So, Chrome OS users are out of the running.

On the bright side, I am hoping more HTML5 games come out...
Only one I know of involves finding cats.
I'm gonna have to look for that link again...
Its on here among the archives though...

Hmmm... An HTML5 maze game would be nifty!

Thumbs up

Yeah, Trentin, I didn't consider Crome OS since It's so rarely mentioned, at least where I am.
  But yeah, thanks for the link. I did forget to mention that at least for windows, the play blind games link is, literally, one or two presses of the down arrow from the top of the page. lol.
I also find that if you play these games in firefox, it is possible to have your screen reader active, it pretty much puts it into forms mode without saying so. So, internet explorer doesn't allow your screen reader to be on, there's not even an application region, but firefox does--and we've pretty much already established that Firefox is better in terms of accessibility anyway. Just make sure your shockwave is updated.

Thumbs up

I think I'll start working on the engine this summer.
I listened to the trailer for Papa Sangre and it's undoubtedly great quality, but I couldn't place quite a lot of sounds. I could only imagine exact location of the most obvious sounds. But it probably comes with some practice.
I'll get more into playing later.

@Entombinator
All cool things you listed about python are available to me in Javascript. I agree Python is much better for beginners if they want to learn to use it correctly. But in terms of features for experienced developers, those languages are pretty close.
Did you try mobi format? It might be more readable (if it's not a conversion from PDF)
One more thing I can recommend, but with the sidenote that I disagree with some things and think others are a little old-fashioned: http://addyosmani.com/resources/essenti … erns/book/

Thumbs up

For Papa Sangre Lets Plays, take a visit on over to:
http://pg13.tk/?s=Papa+Sangre
, both Papa I and Papa II are up there for your listening enjoyment.
I was among the listeners during Papa II's original LP broadcast.

Thumbs up