Great!Twilighte wrote:ok, i think i can safely set out some rules regarding effects. You could even start inserting the code into places in the engine you think their should be a sound effect.
Sounds perfect. If I understood correctly, I could use Channel A for step sounds (for instance) and set VolumeA to whatever value and keep it this way.I think the best way to handle volume will be three locations, like VolumeA, VolumeB and VolumeC. It's up to u whether these should reside in zero page or main memory.
Basically the three locations will correspond to Effects allocated to A, B and C. The volume range will be 0 to 15.
Once the volume is written you will not have to write it again until it changes.
I will leave it to you to devise some method to work out distance, so that further events sound quieter than closer events.
mmm I declare my incompetence here... May I suppose some effects will have an "finishing" envelope (such as step sounds) so I can jsr with the appropriate value in reg A when I need the "tic" sound, while others (such as computer beeps) will have "infinite" envelope so I jsr once to start them and another jsr with a given Effect value to stop them?As for the Effects, each channel will hold up to 32 Effects, giving u a total of 96 effects. However i suspect we'll use a fraction of them.
When you need to call an effect, you can do the following
The initialise Effect routine can also be used at the start of the game to set the music irq up.Code: Select all
lda #Effect jsr InitialiseEffectVector
Does music use the three channels? To be honest even if I see the nice effect of having music playing all the time, when effects are produced in another channel, I trend to hate that in a game... So I will be happy to have nice sound effects on channels and put music only on given moments...Their will also be a total of 24 tracks like short multichannel tracks or the title tune, high score tune or game over. and these use the above format except Bits 0-1 should be set to 3 (and the Track number into Bits 2-6).
The Music will also have an associated maximum volume (which may also be used for mute) and this will be held in VolumeA, so remember to set it before calling a Track.
Anyway the best thing here could be having each of the three channels dedicated to something. Channel A can be used for step sounds, for instance, as well as pick-up or interaction sounds. Channel B can be used for Messaging, so bips and blops can be made whenever something is displayed on the text area. Channel C can be used for alarm sounds and other environmental sounds (bips in the computer room, for instance).
Have no experience here, so ideas welcome. Maybe having Channel B for both message and alarm sounds and C for environment is a better idea.
Nothing at this moment... Maybe laterNot sure yet what to do with Bit 7, it could act as a fade flag like when the hero dies the current effects could die away. Give me some ideas.
I like it a lot and do not see any inconveniencies. It would be indeed nice if you write an optimized routine... remember I left you quite a large space in page zero for this...By the way, the reason why i compact stuff into a single byte is to conserve memory on your side.
You could just store the effect number and have the Effect routine pick it up, but their may be a delay and scanning the location could use up valuable cpu time.
I can write the effect play routine for ingame sounds (and music) to optimise cpu time whilst nothing is being played.
This format is not final but can be if you are happy with it.
Best regards,