[Homebrew] My first game... yet another Snake!

Discussion of programming and development for the original Game Boy and Game Boy Color.
User avatar
DevEd
Posts: 51
Joined: Thu Dec 12, 2013 4:00 pm
Contact:

Re: [Homebrew] My first game... yet another Snake!

Post by DevEd » Fri Jan 05, 2018 4:16 pm

Sorry for the late reply, I don't check this place often.

Right now, DevSound doesn't support SFX on its own. However, it is designed to integrate with FX Hammer, a sound effect system that was originally created as a companion to Carillon Editor. When using raw register writes for SFX (which IIRC is what you are doing) it's very difficult to tell exactly when a sound effect stops playing so the relevant music channel(s) can kick back in. Disabling CH4 in DevSound is kinda not an option for me because I like to be able to use all 4 sound channels :P
Can you invoque for example [$89 - SetSpeed] from within the game code?
Right now no (unless you like writing directly to DevSound's RAM), but that's an excellent idea! I'll get to work on a sort of "external command" system for that purpose. Not sure what else the external command system would be used for, but I'm sure I'll think of something.

Also, an idea for your SFX trigger system: Each SFX should have its own "length" value, that way a music engine (such as DevSound) will know exactly when the SFX stops so the music channels can kick back in.

As for removing the halt in waitKey, I was trying to get it so that music could play during a waitKey, but I couldn't get it to work. I probably forgot to put the halt back in.
By the way, is it an idea to make 8 different tunes for the 8 maps :D ?
For the sake of variety, I'd say yes. I'd also recommend having different background graphics for each level if possible to add to the variety.

EDIT: I have the external command system working now.
You know, the DevSound guy.

There are two kinds of people in this world: those who are convinced there are two kinds of people in this world, and those who aren't. - Unknown

calima
Posts: 1016
Joined: Tue Oct 06, 2015 10:16 am

Re: [Homebrew] My first game... yet another Snake!

Post by calima » Sat Jan 06, 2018 3:34 am

I have some questions on DevSound.

- how do you compose? Is there a converter for Deflemask, for example?
- what is the license for FX hammer? The demo says "free for non-commercial use", and there is no other info in the files

User avatar
DevEd
Posts: 51
Joined: Thu Dec 12, 2013 4:00 pm
Contact:

Re: [Homebrew] My first game... yet another Snake!

Post by DevEd » Sat Jan 06, 2018 8:25 am

To be honest, I should probably create a proper thread for DevSound here. Don't want to derail this one...

1. There is a WIP Deflemask converter, however the output will require some manual tweaking. I have attached the converter (which isn't mine BTW) if you're interested. (Requires Python 3 BTW)
2. Aleksi Eeben (the creator of FX Hammer) has gone on record to say that anyone is free to use FX Hammer as they see fit. You'd have to ask him if you plan on selling a game using it, though. The best way to contact him seems to be through Twitter (@aleksieeben).

EDIT: ...forgot to actually attach it -___-

EDIT 2: Any further DevSound discussion should go in this thread.
Attachments

[The extension py has been deactivated and can no longer be displayed.]

You know, the DevSound guy.

There are two kinds of people in this world: those who are convinced there are two kinds of people in this world, and those who aren't. - Unknown

User avatar
Yvar de Goffau
Posts: 11
Joined: Mon Dec 04, 2017 3:57 am
Location: Saint-Beat, Haute Garonne, France

Re: [Homebrew] My first game... yet another Snake!

Post by Yvar de Goffau » Sat Jan 13, 2018 7:14 am

Indeed, I need to work on a simple centralized [s_playFX] function, which will trigger the playback of any sound effect in the game (not too difficult, since all that changes is the "frequency" of the noise register). I could store the lengths quite easily for DevSound, but I don't know where.

My knowledge of sound engines goes no futher than Something that Triggers the Right Note at the Right Time... :lol: why it would need to be update each frame goes beyond me but that doesn't matter :D

But it would be easier to use an existing SFX engine together with DevSound or another sound engine. I couldn't find anything about how to make FXHammer work or how to create new SFX for it. The disassembly I found somewhere is no help either for me noob in sound code :?

Can someone help me with it? I don't have much time for it now that real life has caught me up :roll:

User avatar
DevEd
Posts: 51
Joined: Thu Dec 12, 2013 4:00 pm
Contact:

Re: [Homebrew] My first game... yet another Snake!

Post by DevEd » Sun Jan 14, 2018 9:13 am

FX Hammer has an official editor. I attached it for convenience.

That disassembly of FX Hammer you found is mine btw :mrgreen:
Attachments
fxhammer.zip
FX Hammer editor + documentation & examples
(56.92 KiB) Downloaded 157 times
You know, the DevSound guy.

There are two kinds of people in this world: those who are convinced there are two kinds of people in this world, and those who aren't. - Unknown

User avatar
Yvar de Goffau
Posts: 11
Joined: Mon Dec 04, 2017 3:57 am
Location: Saint-Beat, Haute Garonne, France

Re: [Homebrew] My first game... yet another Snake!

Post by Yvar de Goffau » Mon Jan 15, 2018 2:10 pm

By hijacking DevSounds timer that normally makes the notes trigger, :twisted: I was able to accelerate the notes in line with the game (as well as keeping it in sync with the animations; something impossible with the classic song speeds). Until there would be a seperate TriggerSongNotes routine, this does the job.

I tried to make FXHammer work, but I discovered it was so much easier to just disable in DevSound the writing of the CH4's registers during that short period in which the SFX plays. This way, I could just keep the old sounds. 8-)

Now it is just waiting for some mad geniuses of an chip artists to compose the best snake theme-song in the world, and to make 8 variations of it for the 8 maps, and a 9th one for the title screen :wink: . Unfortunatly, my talent lies not as an composer....
Attachments
snake.gb
Snake+Devsound: the game
(64 KiB) Downloaded 196 times
snake devsound.zip
Snake+Devsound: the source
(105.86 KiB) Downloaded 169 times

Post Reply