Monday, November 11, 2013

Gridiron Solitaire #80

I'm out of post titles. Maybe "The Death March Continues", although it's really not as dramatic as all that.

Three things to discuss this week: the trailer, dialog window centering, and sound effects.

Trailers are a huge pain in the ass to create. Fredrik will read this and start laughing, since he's the one actually doing all the work. All I do is look at the new footage, send him comments, and he makes the changes.

The trailer is basically the last thing I need to get the Greenlight page up and running, so we're trying. It's just very labor intensive to create new versions, and we're going through a bunch of versions. It's moving forward, though, and I know the end is out there.

It's almost as difficult as making the cut scene, because just like the cut scene, it has to be right.

After weeks of trying to find out why dialog windows weren't always centering properly, I happily stumbled onto the cause today. During another fruitless attempt to make the bug happen, I minimized the game window to check a website, and when I maximized the window and brought up the exit confirmation window, boom--it wasn't centered. So I restarted the game, minimized the window, and the dialog windows didn't center, even though they center perfectly if I never minimize the window.

That's a fairly rare bug, but I was determined to find it, so finally. Of course, I have to fix it now, but I swear, many times it's more difficult to find a bug than it is to fix the bug.

Which brings me to the sound bug.

This has been driving me crazy for months, maybe even years. Very rarely, a sound effect just won't play, and once it doesn't, it's lost for the rest of the game.

That sounds easy to handle, right? Just detect the event that fires when the sound effect doesn't play. Except--and this is a big except--as far as I can tell, no event is firing. So there's no media_failed event or something like that to hook on to.

Like I said, this is rare--probably only occurring in 1 in 20 games, and then only involving one sound effect, usually--but man, it's a bug. I don't want it to happen 1 in 1000 games. I'm very proud of the soundstage for the game, and I want it to always be right.

I may try a possible approach that's kind of a shot in the dark. I can set up Try/Catch statements for the sound effects, then reset the source if the Catch code is triggered. What bothers me about doing that is I don't know exactly what circumstances would trigger the Catch code to begin with. When a sound effect fails (and by "fails" I mean that I can't hear it), is some kind of error generated that would cause the Catch code to execute, or is there just going to be no error at all?

Using the Try/Catch approach, without knowing what's going wrong to start with, seems very sloppy to me. The bug is rare enough, though, that I can't make it happen, so I'm in limbo.

Site Meter