Side issue, I'm hoping (perhaps in vain) that I can use some of this sound programming expertise in android. But I haven't really looked closely enough at Android yet. Most of the books and tutorials I've come across just cover some simple ways to do sound, nothing low level.

If you ever want quick android assistance, like copy and paste code snippets and such. Feel free to add me to MSN (msn contact link is under my image on the forum post).

Anyway, I've got the "windchime" chime patch pretty well nailed this week, and aspects of the drone working as well. The bigger gongs are yet to do. The drone will need a flanger, but I think that will be doable. I'm told flangers are not much more complicated than an echo with a very short delay time (that varies), and I managed an echo on the Theremin project.

If you can use GPL with CPE code, there's a chorus in Gervill you could extract (it has a flanger mode - a flanger basically being a chorus with attitude and tattoos ). I'm just in the process of forking this out myself for JAudioLibs - basically need to change the parameter calculations to be something sensible as opposed to MIDI values.

If that license is no good for you (or you just want the fun of coding it yourself), then it's basically a delay where the delay time is controlled by an LFO. You'll need a delay where the delay time changes on a per sample basis - once per processing block would probably sound odd. They're also usually done with a delay on either stereo channel with the LFO's out of phase with each other to give that "thicker" sound.

Request: Move to "in progress" area. [NOTE: link to project is on the start of the thread.]

I've restarted work on this project after a long break. Unfortunately, I think I'm overtaxing the cpu with the result being that the sound occasionally breaks up, sometimes stuttering rather badly for an extended period. I have a pentium 4, 3.2 GHz, 3GB of RAM. This was purchased almost 10 years ago, so maybe most other folks won't have the problems I'm having? The game usually is consuming from 60%-80% of my home computer cpu.

I have questions about possible strategies for optimization:

How much of a pickup might there be, going from passive (currently) to active rendering, using Java2D? Should I instead go straight to Libgdx or Lwjgl?

I'm wondering if maybe the Java2D can still be made to work and leave enough cpu for smooth audio. There are a few things that I'm doing that may be needlessly adding stress:

Progress report: The applet loads quickly. (To load, see first post on this thread.) ALL the sounds are now procedurally generated instead of being loaded from .wav files. The file size went from about 18MB to under 400KB. But it takes about 5-10 seconds to get going while the audio clips are built. It's close to time to figure out how to code a proper splash screen.

I am having a problem with some occasional garbage appearing on the "scroll panels". They are animated via a Perlin algorithm, but for some reason the smooth "energy patterns" get messed up. Maybe it has to do with the refresh rate? My game loop is set to run relatively slowly, as the animation needs are low.

I have some code in place monitoring the game loop time, how much is consumed, how much is slept. As far as I can tell, I never overrun the amount of available time for a game loop--there is always some sleep occurring every iteration.

My next task is to switch over to active rendering. Maybe that will eliminate this graphics problem.

"We all secretly believe we are right about everything and, by extension, we are all wrong." W. Storr, The Unpersuadables

[A long time ago, I started making a puzzle game called Hexara. That thread is now locked and I don't have the admin rights to unlock it. Would it be possible to have it unlocked? This post could be moved to that thread.]

There's going to be a seminar on composing music for games at the SF Conservatory of Music and I'm hoping to have a working jar with the game and score for their Nov. 16th deadline (seminar is a week after that). The sound here is all procedural, no wav or ogg files involved.

This "tester" was made for profiling a newly upgraded procedural sound engine. My goal is to keep the cpu usage under 5% even when the sound is most active.

OPERATION:The "in/out" tells the audio mixer whether or not to even bother reading the track. The subtracks of the chimes synth (its polyphony--the number of chimes that can play at the same time), can also be tweaked. Changing that number (have to hit enter to complete) requires the mixer be programmatically stopped and restarted which results in an audible pause.

The "Tension Level" is going to be linked to the number of "scrolls" that are completed in the puzzle. Completion of a scroll triggers a gong. When all the scrolls are solved the "gong completion" cue plays.

An increase in "tension" (as more scrolls complete) has the following effects: (1) increases the density of the chimes, (2) makes their volume/timbre a little brighter, (3) makes the flanger modulation on the drone tone sweep more quickly.

Am considering other things to change (e.g., add new or slightly more discordant pitches to be played by the windchime).

This stuff hasn't been fully implemented in Hexara itself yet. First tests show that it can still stutter, but only very occasionally. The Java2D graphics badly need a rewrite and I suspect doing so will reduce cpu enough to clear that up.

I think it might be worthwhile putting a bunch of volume/pan/timbre controls in this "tester" to help with the design and with making sure the volumes don't overload (currently possible). But my first priority was to just make sure I had a way of testing the cpu usage.

RESULTS OF PROFILING / QUESTIONS:Profiling, using JVisualVM, or even just using Windows Task Manager, gives somewhat inconsistent cpu % readings. This morning, I ran it full out (at Tension 5, all tracks on, completion cue playing) and it stayed below 5% the entire time. But while running the same file at other times, the cpu sometimes spikes at 15-20%, . These spikes are weird though in that they don't consistently follow the duration of the 'completion cue'. For example, it can hit a high and drop back down below 5% for a majority of the time the cue is playing, and the spike can come in the middle or the end of the cue (as the notes are fading away).

Is the cpu usage a reasonable gauge? I finally figured out that some usage is caused by my cursor interacting with the Swing controls (about 5-6%). Also, it seems if FASTFIND or some other program starts running in the background, that increases the likelihood of the program's tendency to spike. What is that about? Can it be dealt with?

My computer is circa 2004, so maybe this is all moot for new computers. However, I do want this engine to be able to run on Android, so keeping the cpu usage low is important.

"We all secretly believe we are right about everything and, by extension, we are all wrong." W. Storr, The Unpersuadables

I got a nice little opening animation working. Goal--have something minimal going on while resources are being manufactured in the background. Am pleased: the graphics are being cued off of the sound starts (using a Listener), and an envelope I wrote for the synths also works for the alpha control of the glow.

I think it is okay that the same Perlin graphic animation is being reused. It might be nicer if each was unique, but it would be significantly costlier. The graphic is a 64 x 128 image and stretched to 96 x 288 (another dodge to reduce cpu).

Could be improved, but I'm trying to get a simple version of the game done for a "Demo Derby" on game audio, deadline Sunday midnight. Next step, (cross-fade?) to the main screen which should have had time to finish building all its resources.

"We all secretly believe we are right about everything and, by extension, we are all wrong." W. Storr, The Unpersuadables

Some new sounds (shimmer for new puzzle, dinks for mouse-overs, stereo chorus added to this and that) and graphic effects added, as well as some cleanup of transitions.

Two concerns:

(1) I've loaded up too much sound processing and the audio will start experiencing dropouts. If you try the game and this does or doesn't occur, I'd appreciate finding out! My PC is so old that I don't know if the dropouts that I hear are going to occur for others. I'm puzzled by a lack of consistency in the profiling.

(2) It started crash on Macs for reasons that I have been unable to figure out. Last night a friend reported a screen freeze just as a puzzle is completed, but the audio continued. Weird! I generally don't have access to Macs. I did add a few more console lines to help with diagnostics. If you have a crash, a screen shot of the console out would be helpful and appreciated.

BASIC RULES: Light up a panel by placing icons in the center so that the neighbor relations are maintained. Light up all the panels at the same time to solve the puzzle.

I'm trying to come up with ways to have a 'tension level' that changes while working on the puzzle. Tension level is defined as the number of panels that are solved (0 to 5, 6 is a win).

What happens/changes with the tension level? - the panels light up - smoke now gets more active - chimes get more insistent - sweep on flanger of the drone speeds up and becomes more prominent.

Other ideas? Thx.

"We all secretly believe we are right about everything and, by extension, we are all wrong." W. Storr, The Unpersuadables

Hey, just d/l and played your game, still going actually, my crit is that at first I had no idea what I was doing. It wasn't until I did a medium level puzzle that I started to understand how to play the game, the first three puzzles I did didn't teach me how to play, I just put random things in and it worked. I didn't feel it was complex enough to register what was going on.

Just my two cents....

anyway now that I get it I'm really digging the game. Also, the music is awesome, nice ambiance.

edit: just played the 5th bronze puzzle, from the left, and that was a good easy one. I think I would've understood what was going on there, but idk

Hey, just d/l and played your game, still going actually, my crit is that at first I had no idea what I was doing. It wasn't until I did a medium level puzzle that I started to understand how to play the game, the first three puzzles I did didn't teach me how to play, I just put random things in and it worked. I didn't feel it was complex enough to register what was going on.

Just my two cents....

anyway now that I get it I'm really digging the game. Also, the music is awesome, nice ambiance.

edit: just played the 5th bronze puzzle, from the left, and that was a good easy one. I think I would've understood what was going on there, but idk

Really valuable observation! I've been struggling with how to present the puzzles. Earlier, I was told they were too hard, but I have now seen a couple people do the random thing and not learn anything from the ones that are too easy. (Originally the first silver one was my "easiest".)

Making the puzzles is tricky. I do have a utility that allows me to test to verify the solution, and shows if there are multiple solutions--a couple of the easy ones are that way.

This is the biggest challenge of this puzzle game: communicating how the puzzle works.

I take it the sound is not breaking up. That would be good. It might also be possible if things got too busy for the volume to get too loud, which makes a nasty noise, rather than a hiccup.

"We all secretly believe we are right about everything and, by extension, we are all wrong." W. Storr, The Unpersuadables

Yeah the first silver was was pretty difficult, cause I didn't understand how to play the game, but there was a distinct change from random to meaningful so it's a good puzzle. I actually continued playing and solved all the silver and bronze ones before I fell asleep so I think you're on the right track.

I have to arrange for Mac access for testing. I'm totally mystified what is going on, and am wondering what I'm doing in Java 7 that is making Macs bug out. I don't think I'm pushing things that hard, but who knows.

"We all secretly believe we are right about everything and, by extension, we are all wrong." W. Storr, The Unpersuadables

This is the biggest challenge of this puzzle game: communicating how the puzzle works.

Instructions are a good first step until you have time to work on a detailed walk-the-player-through-the-level tutorial. I would say something like:

Each vertical banner contains a sequence of tiles which must be present somewhere on the board. The sequence may be present in a straight line, or bend all over the place. Arrange the tiles so that all six sequences are present.

I haven't had problems with sound dropping out. One feature that I would prioritise is a way to give up on a level and go back to the list of levels. I'd also add the text "Choose a level" to the level selection screen, because it's not immediately obvious that it's a level selection screen. I thought at first that it was just a splashscreen. And I would find it helpful to be able to hover over a tile on a banner and see the other instances of that tile, rather than just getting that highlight when I hover over a tile on the board.

Windows 7 64-bitThere aren't any messages in the console. I think that I should again point out that the animation still plays, so it doesn't crash.

Interesting. That's the first Windows complaint. Are you by chance using Java 8? The Mac computers that were having troubles are all Java 8.

I wonder what it means when a program has a single thread freeze like that. Maybe there is something going in the multithreading or concurrent processing where the spec has changed slightly. Classically, there is either an infinite loop occurring or a deadlock. I wrote this to make no use of Synchronization, though. I guess there could be a Swing conflict?

Something similar happened once before during version upgrades, in the audio: it used to be you could create an AudioInputLine from an InputLine in Java 6. Then, there was a slight change in how underlying lines where ordered or something obscure like that and the code "broke" in Java 7. Actually, it didn't exactly break, the test for "Markability" just started to fail where it hadn't in practice before, and a lot of us didn't know audio line input often isn't 'markable".

I did a search earlier on java 8 mac bugs. I'll try searching on Java 7 to 8 transition bugs.

[EDIT: not finding anything suggestive. But maybe it is time to download Java 8. I guess I could run it separately, rather than out-and-out replace Java 7 just yet.]

@pjt33 Good suggestions! I like the text you wrote. May I use it or a slightly edited version? I used to have a menu bar with the ability to "RESET" a puzzle or give up. It may be time to bring the bar back, and include an instruction screen as well as choices for abandoning. I was thinking a Menu bar could also allow a way to load additional puzzles (sell a set of 24 or 48 at your choice of difficulty level for $1 or 0.50 cents or something). or maybe just have a row of buttons along the bottom. You are the second person to request the additional highlighting--I probably should go ahead and do it.

Happy Thanksgiving! (to those who celebrate it)

"We all secretly believe we are right about everything and, by extension, we are all wrong." W. Storr, The Unpersuadables

@Longarmx -- Are you using Eclipse, too? I always hesitate to jump forward to a new release. I'm still using Juno. Seems like it is time for Kepler + Java 8.

New theory on the crashes: I may be exposing myself to Swing multithreading problems, and these are more likely to go off on Java 8 than 7 for some reason. I am rereading about scheduling things on the EDT. (Book is open right next to me.) Have generally been kind of relaxed about this, as cluttering the EDT hurts performance, and haven't ever gotten in trouble prior to this.

"We all secretly believe we are right about everything and, by extension, we are all wrong." W. Storr, The Unpersuadables

Java 8 installed, along with Eclipse LUNA. I copied Hexara and PFAudio in, and yes, they are crashing (the audio is working fine, its the Swing stuff that seems to be crashing in test programs written for PFAudio).

There is a collection that I was relying on: ConcurrentSkipListSet, for scheduling audio events. I used a ">=" where there should have been a ">" in a compareTo method, and while it worked in Java 7, a new implementation of the collection exposed the sloppy compareTo and would start to spin in place. Had I been more rigorous in the compareTo, following the requirements in the JavaDoc, this would never have happened.

Anyway...it will be nice getting back to making progress instead of fixing broken things.

It will be a little difficult taking the time to "finish" the game. Am going to try and stick with it, especially after having been given some good suggestions. But a lot of my brain is occupied with wanting to test out the implementation of more game scoring techniques with the audio library. And there is a little matter of pending contract work that needs to be done to pay the rent.

"We all secretly believe we are right about everything and, by extension, we are all wrong." W. Storr, The Unpersuadables

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org