TC going from Mac Classic to Windows, a couple of questions...

Discuss and unveil current Marathon projects.

Post Dec 20th '09, 17:21

Treellama wrote:Have you tried testing this sound file with a simple map containing only one of the monsters you care about? If you have many sounds going, the engine has to cut some off to make room for the new ones.


Now I have. I've made a simple 30 polygon map template with some weapons in it, and then copied it 15 times. For each copy, I placed 8 spawn points for a particular monster type in the largest room, and set the monster parameters to:

Initial count: 8
Min count: 5
Max count: 8
Total available: Infinity
Appearance: 50%

Then I tested each of these maps both in the original engine and in AO and with the sound file in question (as well as with my TC sounds file). I found that the problem is still present in both engines, but that the original engine fares somewhat better than AO.

However, during my testing I noticed something interesting. First of all, I noticed that some of the monsters performed just fine, while others performed worse. These monsters have the following aspects in common:

A) They have a very rich vocabulary (i.e. using 4 to 5 sounds in several soundbanks).
B) They have long "being hit"-sounds (i.e. equivalents to BOBs Ouch/Cut it out/Watch it).
C) They are enemies with their own kind (i.e. the "behavior settings" in the physics file).

The last one caught my eye, so I extended my testing with a new physics file where all kinds of monsters are enemies with their own kind. Using this physics file I was able to reproduce the problem with those monsters that performed just fine in the previous tests.

I also noticed a more or less foolproof method to reprocude the problem: Make the monsters fight amongst themselves, which is easily done by leading them all into a narrow entrance/corridor (sooner or later someone is going to fire off a projectile that lands on another monster, especially true with explosive damage), and then run away to somewhere safe and fire some weapons and listen if the weapon sounds cuts prematurely.

The most interesting bit is that I was able to get my 8 monsters to fight amongst themselves, thus using up a lot of channels/slots (one channel each for the attack, projectile hit, other monster being hit, and probably also some random and death sounds), and then run away to a dead quiet place on the other side of the map (about 30 world units away, and about 8 polygons between the player and the monsters), and still get the weapon sounds to cut prematurely. This was painfully aparent on the shotgun reload sound. At the moment I'm using the original sound ("clickity-clock"). Most of the time it cut prematurely, but sometimes it just wouldn't play at all.

With these test results I was able to formulate the following hypothesis: All sound effects generated by monsters use up a sound channel even though the player will never actually hear the sounds (i.e. the sounds internal playback volume is 0 due to being obscured by the map geometry).

This hypothesis can be confirmed by the method described above, and it could also explain why my real TC level exhibit the same problem. On my TC level there are at least 6 monster instances at any given time (i.e. the accumulated "Min count" value for all monster types), and at most 36 monsters. If I'm able to reproduce the problem with 5 to 8 monsters, no wonder it is apparent on a 6 to 36 monster level.

I tried to disprove the hypothesis by increasing the number of channels used by Aleph One. If sounds are using up channels even when they are not audible due to map geometry, the most convenient disproof would be if one could reproduce the problem even when the available number of sound channels are largely increased, right? There is a 32 channel cap in the AO interface, so instead I tried to increase it in the "Marathon Infinity Preferences" file in the Prefs\User\ directory. It didn't seem to have any noticeable effect though. I went as high as 512, but still no effect. Surely that must mean my hypothesis is disproven? No, I do not believe that is the case, and I draw that conclusion based upon the following definition in SoundManager.h:

Code: Select all
static const int MAXIMUM_SOUND_CHANNELS = 32;

Again, I'm not very good at C++ and the code base is pretty large, but if the maximum number of sound channels is capped hard in the code I won't be able to disprove my hypothesis in this convenient way.

Okay, so what to do next? Naturally, I could try to minimize the number of sounds played simultaneously by:

A) reducing the maximum number of monsters on the level (i.e. reducing max count and the appearance probability), which is something I will do anyway since it is a bit crowded for multiplayer action right now.
B) make sure that each kind of monster is indifferent or even friendly to their own and other kinds of monsters, even though that will take the "edge" of the whole TC since one of the aspects of the TC is that monsters fight amongst themselves here and there.
C) remove the "being hit" sound effects from some of the monsters.
D) reduce monsters attack repetition so that the attack, projectile hit, and being hit sound effects are reduced overall.
E) make sure that monsters doesn't spawn until a player comes near them (by using the Monster Trigger and Zone Border polygon types)

Unfortunately, A won't solve the problem alone, I've already tried that before. B, C, and D will reduce the level enjoyment. E will only be marginally effective in multiplayer mode. And even with A to E combined I'm not sure how much it will help. So, if my hypothesis is correct, the problem will still be present until I'm able to either increase the maximum number of sound channels beyond 32, or somehow make sure that sounds with a playback volume of 0 will never "steal" sound channels.

Come to think of it, my hypothesis could also explain the problems Fishman92 is having. If I'm correct, this has less to do with the filesize or length of the sounds, and more with how many sound channels are being used simultaneously. Of course, longer sounds will occupy their channel for a longer duration, thus long sounds ARE a problem (especially if most of them has a playback volume of 0) , but in my opinion it shouldn't be a problem if the hardware is able to play more channels. My Fireface 400 has a 648 channel mixer (which doesn't matter anyways if the number of channels is capped in AO), but I can't find any information about those Soundmax HD Audio cards that seems to be omnipresent in computers of today and yesterday.

Fishman92, are you able to reproduce this scenario as well? I.e.:

-- Make a ~30 polygon map.
-- Place 8 monster spawn points (or more, if your monsters are less verbose) in a large room, one type of monster only.
-- Make the monsters rebel against eachother (behavior settings in the physics file).
-- Make them fight amongst themselves (which is rather easy if you lead them into a narrow entrance and they have explosive attacks and also that they are rather slow moving).
-- Run far away to a dead quiet place, fire off some weapons and listen for sound effects cutting prematurely.

If you're able to reprocude the problem this way, I think we actually have a case here.


Sincerely,
Kaninus
Kaninus

Post Dec 20th '09, 23:45

Just a few observations:
  • These novel-length posts are very difficult to read in their entirety; perhaps you can try to be more concise in the future
  • Aleph One is limited to 32 channels, setting it higher in the prefs will do no good
  • Sounds that are volume 0 are still queued, since you could walk back into range and hear the end of them
  • The engine will never cut off a sound playing at a sufficiently higher volume to play one at a lower volume, unless that lower volume sound has higher priority than the higher volume sound.
  • The shotgun reloading is a poor choice for this test (or a good choice?) because it is marked "Soft" in Anvil, which gives it the lowest priority. Even a 0 volume "Medium" or "Loud" sound will cut it off.
User avatar

treellama
Pittsburgh

Post Dec 21st '09, 12:41

Treellama wrote:These novel-length posts are very difficult to read in their entirety; perhaps you can try to be more concise in the future

Sorry for my long posts, it's a work-related injury. I'll try to be more concise.

Treellama wrote:Sounds that are volume 0 are still queued, since you could walk back into range and hear the end of them

I'm guessing there is no way to change this behavior other than change the AO source code and recompile?

Treellama wrote:The engine will never cut off a sound playing at a sufficiently higher volume to play one at a lower volume, unless that lower volume sound has higher priority than the higher volume sound.
The shotgun reloading is a poor choice for this test (or a good choice?) because it is marked "Soft" in Anvil, which gives it the lowest priority. Even a 0 volume "Medium" or "Loud" sound will cut it off.

Confirmed. I raised the shotgun reload sound to "Loud" and it was seldom cut off (just once or twice, compared to 50-100% of the time). In my ignorance I thought that the description of this feature in the Wail documentation was the correct one. It only mentions that the louder the sound is, the farther it can be heard in the map in terms of number of polygons. Obviously there's more to the setting than that. I guess I could revise the volume setting in my sounds file and see if it helps.

Question: What if all sounds are Medium? Would this result in the "oldest" sounds in the cue to be cut off first?
Last edited by Kaninus on Dec 21st '09, 12:42, edited 1 time in total.
Kaninus

Post Dec 21st '09, 14:48

Kaninus wrote:I'm guessing there is no way to change this behavior other than change the AO source code and recompile?

Correct.
In my ignorance I thought that the description of this feature in the Wail documentation was the correct one. It only mentions that the louder the sound is, the farther it can be heard in the map in terms of number of polygons. Obviously there's more to the setting than that. I guess I could revise the volume setting in my sounds file and see if it helps.
As far as I can tell, that setting (called behavior_index in the Marathon 2 source) only sets the priority of the sound interrupting or being interrupted by other sounds. I don't see anything about how far away it is.

Question: What if all sounds are Medium? Would this result in the "oldest" sounds in the cue to be cut off first?

The oldest and quietest sounds, essentially. Channels are only checked when a sound starts playing, so if it's quieter than a currently playing one (but would get louder as you got close to it) it wouldn't be queued.

You can thin out sounds by decreasing the chance monsters will make noise, and don't forget all you've learned about zone borders and controlling combat that way. You don't want monsters active all over the map if you can avoid it for a number of reasons. All the scenarios up until a few years ago had to make do with 8 channels, so 32 is really a luxury.
Last edited by treellama on Dec 21st '09, 14:50, edited 1 time in total.
User avatar

treellama
Pittsburgh

Post Dec 21st '09, 19:19

Sorry to change the subject, but I'm quite interested as to what this scenario is going to "be"? Any ideas for plot etc?
Polyplicity my second (less sucky) net pack. Go on. Download it. You know you don't want to.
Marathon Aeon- My scenario in the works ~on Simplici7y

riveting six-vertice amnesty ratifications
User avatar

Dugit
Hampshire, UK

Post Dec 21st '09, 19:40

Kaninus wrote:This TC is for my immediate friends' eyes only, and it will probably be played only once at a reunion party a few weeks from now.



Dugit wrote:Sorry to change the subject, but I'm quite interested as to what this scenario is going to "be"? Any ideas for plot etc?
underworld : simple fun netmaps // prahblum peack : simple rejected netmaps
azure dreams : simple horrible netmaps // v6.0!!!: thomas mann's greatest hits : simple simple netmaps
User avatar

irons
(.Y.)

Post Dec 21st '09, 19:42

Dugit wrote:Sorry to change the subject, but I'm quite interested as to what this scenario is going to "be"? Any ideas for plot etc?

Seriously, do you do this in real life? Just insert yourself in the middle of a conversation, with no real idea what's going on, and make an ass of yourself?

The awesome part about online forums is there are tools you can use to avoid this. For example, reading the thread before posting in it.
Last edited by treellama on Dec 21st '09, 19:43, edited 1 time in total.
User avatar

treellama
Pittsburgh

Post Dec 21st '09, 19:56

Sorry. [MFrown]
Polyplicity my second (less sucky) net pack. Go on. Download it. You know you don't want to.
Marathon Aeon- My scenario in the works ~on Simplici7y

riveting six-vertice amnesty ratifications
User avatar

Dugit
Hampshire, UK

Post Dec 22nd '09, 13:45

Treellama wrote:As far as I can tell, that setting (called behavior_index in the Marathon 2 source) only sets the priority of the sound interrupting or being interrupted by other sounds. I don't see anything about how far away it is.

For the record: From what I have observed in AO when testing last night, the setting seem to be used in two ways. First, as shown with the shotgun reloading sound, "Loud" sounds are prioritized over "Medium" and "Soft". Second, when "Soft" is assigned to let's say a projectile hit effect, the player will have to be pretty close (no more than a couple of WU's) to the hit effect to hear it at all due to its significantly low volume. If "Loud" is assigned to the hit effect, there is little or no difference in volume between the effect being close to the player and it being far away (10+ WUs). Volume wise, the "Loud" setting really is loud [MTongue] and thus not very useful except for big explosions and such.

Treellama wrote:The oldest and quietest sounds, essentially. Channels are only checked when a sound starts playing, so if it's quieter than a currently playing one (but would get louder as you got close to it) it wouldn't be queued.

You can thin out sounds by decreasing the chance monsters will make noise, and don't forget all you've learned about zone borders and controlling combat that way. You don't want monsters active all over the map if you can avoid it for a number of reasons. All the scenarios up until a few years ago had to make do with 8 channels, so 32 is really a luxury.

Thanks for the suggestions. I've now revised several aspects in most of my game files, and reached an adequate compromise (at least in single player mode). For the record, this is what I've done to overcome the sound problem:
  • Reduced the minimum and maximum number of monsters at any given time, and slightly reduced their chance of appearance.
  • Re-prioritized the sounds so that only the important ones (i.e. the funniest monster one-liners, and player centric sounds such as picking up items and firing weapons) are at "Medium". Most other sounds are set to "Soft".
  • Made heavy modifications to the sound probabilities. For instance, in my scenario there is no reason for the Cyborg moving sound to play 100% of the time. I set it to 20%, and made similar adjustments on most sound classes (especially the "being hit" sounds since these are less important in my particular scenario but were set to 100%).
  • "Split up" the map with zone borders in 10 sections in order to reduce the overall activity.
  • Made most of the monsters deaf so that they don't activate needlessly and use up sound channels when players cannot hear them.
  • Revised the monsters' level of hostility against each other. They still fight amongst themselves, but less so. Tiny monsters with only melee attack capabilities are now friends with all hovering monsters so that the tiny monsters doesn't pursue these near futile battles and use up sound channels that way.
With the above modifications, AO copes adequately with my scenario. Sounds are still cut off prematurely, but it is not nearly as often as before. The original engine (with its 4 channels) copes beautifully with the same modifications, for some reason. No cut offs what so ever.

Aside from there still being some sounds cutting off, my ambient sounds keep restaring. I have placed four radios in my level, playing various kinds of music, and the music keeps restarting for some reason in AO. It doesn't do that in the original engine. I might just overlook this feature of my scenario though... the monster vocabulary is much more important than the music.

I am thus nearing completion of my TC, and I can't begin to tell how extremely grateful I am for the help I've recieved so far. I still have a couple of issues (for instance, the startup screen and the HUD doesn't find the pictures from the Images file after the convert/transfer/merge process), but I'm sure I will solve them in time for my reunion party. If not, you'll probably hear from me again within a few weeks. [MSmile]

Cheers,
Kaninus
Last edited by Kaninus on Dec 22nd '09, 13:45, edited 1 time in total.
Kaninus

Post Dec 22nd '09, 14:18

Kaninus wrote:The original engine (with its 4 channels) copes beautifully with the same modifications, for some reason. No cut offs what so ever.

Up until now it's been my impression that you were having the same problems with Marathon 2 as with Aleph One, but there is an awful lot of text to try to sort through. Is this not the case?
Last edited by treellama on Dec 22nd '09, 14:20, edited 1 time in total.
User avatar

treellama
Pittsburgh

Post Dec 22nd '09, 16:48

Treellama wrote:Up until now it's been my impression that you were having the same problems with Marathon 2 as with Aleph One, but there is an awful lot of text to try to sort through. Is this not the case?


Actually both yes and no. The problem has been present in both engines from the beginning, but have been much more apparent in AO. When I was in the early stages of creating this TC and had finished the sound effects for 3-4 monster types, the problems appeared after about 10 seconds in AO while appearing after about a minute in the original engine (and by original engine I mean the Marathon Infinity engine, not M2).

When I finished most of the monster types (10-12 or so), the problem appeared almost immediately in AO while it took like 15-20 seconds for it to appear in the original engine. And now, with the modifications mentioned above, I've been running the original engine 15 minutes straight with no issues what so ever, while in AO the problem is noticeable after 2-3 minutes (and the ambient sounds are restarting way too soon as I mentioned). Though not in any way as painfully noticeable as before. It's just a few sound effects that cut prematurely now, instead of _all_ sound effects.
Kaninus

Post Dec 22nd '09, 16:53

Have you increased Marathon Infinity's memory allocation?

Can you run the test again with it set to the default?

Edit: I am nearly certain this is the issue
Last edited by treellama on Dec 22nd '09, 17:08, edited 1 time in total.
User avatar

treellama
Pittsburgh

Post Dec 22nd '09, 17:13

Hmm... to be honest I couldn't be bothered to read trough all of these walls of text.
But I do have some experience with adding sounds to both Marathon 2/infinity whatever and Aleph One, and I must say those experiences are mostly bad ones...

I never noticed a real limit in sounds you can add or odd behavior because there's to many sounds playing. From what I've noticed; if it goes beyond 32 channels more sounds simply don't play, but I've never noticed sounds stopping while playing or anything similar.

The old os9 tools are a pain to work with, especially adding sounds with Anvil is something I wouldn't recommend at all as I've seen Anvil deleting sounds from my sound file all by itself or weird stuff like turning 'em into static noise etc. There was something about 'Wail' as well that made it a pain to work with but I can't really remember exactly what it was :).

If you got os9 I would recommend using 'Marathon Sound Editor' together with "SoundApp Fat" to edit your Marathon sound file. Also don't use anything except System 7 sound files and nothing fancy like 44khz or 32bit. 'SoundApp Fat' can convert pretty much everything to System 7 sound files, ready for Marathon to handle. Be sure make back-ups of your sound file very often, for me it was to late a couple of times when I noticed entire sound classes were empty after using Anvil.

Oh and I haven't tried it myself yet, but another option would be to use MML with Aleph One to replace your sound files with high quality 'external' ones. Correct me if I'm wrong.
Missedisland

Post Dec 22nd '09, 17:25

Treellama wrote:Have you increased Marathon Infinity's memory allocation?

Can you run the test again with it set to the default?

Edit: I am nearly certain this is the issue


Yeah, right now I have 100 MB allocated to the application. Tried to lower it to 3.6MB minimum, 7.8MB maximum. The game is then run in thousands rather than millions of colors, and the 16-bit sound option is greyed out. When running a new game I get the message that "Marathon has used up all available RAM and cannot continue. Trying [sic] giving it more memory, switching to a lower bit-depth or turning of sounds and try again." Tried switching to 8-bit graphics and deactivated active panning and stereo, same message.

Perhaps I should mention that my sounds file is 48MB and my shapes file is 49MB. I don't think Marathon will ever run my files with such a low memory setting. Oh and the Maration Infinity application was patched with the official Bungie patches up to version 1.5.
Last edited by Kaninus on Dec 22nd '09, 17:26, edited 1 time in total.
Kaninus

Post Dec 22nd '09, 17:36

Tim Vogel wrote:The old os9 tools are a pain to work with, especially adding sounds with Anvil is something I wouldn't recommend at all as I've seen Anvil deleting sounds from my sound file all by itself or weird stuff like turning 'em into static noise etc. There was something about 'Wail' as well that made it a pain to work with but I can't really remember exactly what it was :).

Wail has actually been working pretty good here so I guess I've been rather lucky so far. It is a godsend compared to Anvil though :)

Tim Vogel wrote:If you got os9 I would recommend using 'Marathon Sound Editor' together with "SoundApp Fat" to edit your Marathon sound file. Also don't use anything except System 7 sound files and nothing fancy like 44khz or 32bit. 'SoundApp Fat' can convert pretty much everything to System 7 sound files, ready for Marathon to handle. Be sure make back-ups of your sound file very often, for me it was to late a couple of times when I noticed entire sound classes were empty after using Anvil.

According to http://webwonks.org/Marathon/utilities/infinity.html, Wail is the successor to the Marathon Sound Editor. But hey, perhaps more bugs were introduced along the way, we won't know for sure :) SoundApp is the application I've been using so far to convert from AIFF/WAV to System 7 sounds with the correct bit depth and sample rate (it seems to be the only tool on Mac OS 9 that can make bulk conversions). And yeah, I always make rigorous backups nowadays. I've learned that the hard way. Actually lost half of the prequel of this TC when a Zip disk failed back in the day... it was really painful.
Kaninus

Post Dec 22nd '09, 17:55

I had a long explanation typed out, but in the interest of brevity: due to a bug, Aleph One currently only allows half as many sounds in memory at a time (3.2 MB) as Marathon 2 when the latter detects a large memory allocation. Both will stop old sounds and remove them from RAM when they hit that limit.

I will definitely fix this for the upcoming release candidate build, and will also consider increasing that limit, which is ridiculously low by modern standards.
Last edited by treellama on Dec 22nd '09, 18:00, edited 1 time in total.
User avatar

treellama
Pittsburgh

Post Dec 22nd '09, 18:33

Treellama wrote:I had a long explanation typed out, but in the interest of brevity: due to a bug, Aleph One currently only allows half as many sounds in memory at a time (3.2 MB) as Marathon 2 when the latter detects a large memory allocation. Both will stop old sounds and remove them from RAM when they hit that limit.

I will definitely fix this for the upcoming release candidate build, and will also consider increasing that limit, which is ridiculously low by modern standards.


Oh, so you mean that this bug could be the likely culprit regarding the issues I've experienced?
Kaninus

Post Dec 22nd '09, 18:41

Kaninus wrote:Oh, so you mean that this bug could be the likely culprit regarding the issues I've experienced?

The ones where Aleph One behaves differently than Marathon 2, yes. Corrupt sound files, sounds cutting off even in Marathon 2, no guarantees there.
User avatar

treellama
Pittsburgh

Post Dec 22nd '09, 18:54

Treellama wrote:The ones where Aleph One behaves differently than Marathon 2, yes. Corrupt sound files, sounds cutting off even in Marathon 2, no guarantees there.


I understand. It'll sure be interesting to test the RC with my non revised files.

I didn't find any AO roadmap or future release dates when searching. When is the next release candidate due? I was planning to give each of my reunion party participants the game on CD, but given the information above I think I'd rather wait for the RC to arrive and use that on CD instead.
Kaninus

Post Dec 23rd '09, 16:21

Kaninus wrote:I didn't find any AO roadmap or future release dates when searching. When is the next release candidate due?

There isn't a road map, it's more like "Looks like enough stuff changed, let's make a release."

I think we can have a release candidate ready by the end of this year. I committed a change to restore Marathon 2's memory limits when you have 4 channels or fewer selected. The change also scales up the limit based on the number of channels, topping out at around 50 MB for 32 channels. That should be enough to hold your entire sounds file in memory.
Last edited by treellama on Dec 23rd '09, 16:23, edited 1 time in total.
User avatar

treellama
Pittsburgh

Post Jan 5th '10, 23:41

Treellama wrote:There isn't a road map, it's more like "Looks like enough stuff changed, let's make a release."

I think we can have a release candidate ready by the end of this year. I committed a change to restore Marathon 2's memory limits when you have 4 channels or fewer selected. The change also scales up the limit based on the number of channels, topping out at around 50 MB for 32 channels. That should be enough to hold your entire sounds file in memory.


Whatever you did, it worked. I am very happy to report that 0.23 RC1 in combination with the revised aspects I mentioned in post #59, performs equally well compared to the original engine regarding the sound issues. All sounds play to the end, and the ambient sounds doesn't restart prematurely anymore. I haven't tried my earlier sound files (the ones where the volume and priority were too liberal), but as far as I'm concerned there is no need to because I'm happy with the results so far.

Thus, my TC is finally complete! Thanks again for all your help!


Oh... well... there is one more thing. When copying my TC to other computers, the preferences get reset. So far I've made a MML script taking care of most of the key bindings (although I haven't been able to set mouse1 and mouse2 as 1st and 2nd trigger with the script, and every binding after the microphone button, i.e. index > 20, doesn't seem to be "indexable"), but there are other things I would like to be default. For instance, it would be great if OpenGL was the default instead of software rendering, as well as the "use mouse" setting and also the mouse sensitivity, so that my poor friends doesn't have to configure my TC so much. Is it possible to change these default values automatically?


Cheers,
Kaninus
Last edited by Kaninus on Jan 5th '10, 23:42, edited 1 time in total.
Kaninus

Post Jan 6th '10, 02:16

If you make a default preferences file, you can call it whatever you call the prefs file in MML (for example, Marathon Infinity Preferences) and put it in the root folder of your scenario. If no prefs are found for the user, the engine will use those as defaults when creating the prefs.

I'm glad everything else is working, thanks for finding our sounds issue.
User avatar

treellama
Pittsburgh

Post Jan 6th '10, 13:41

Is there any chance you will give the Marathon Community a shot at this?
Image
User avatar

gmanyo

Post Jan 6th '10, 14:07

It's for a private reunion party.

Although I am interested, and I do wish to see the product of this effort, sometime maybe? [MFrown]
Polyplicity my second (less sucky) net pack. Go on. Download it. You know you don't want to.
Marathon Aeon- My scenario in the works ~on Simplici7y

riveting six-vertice amnesty ratifications
User avatar

Dugit
Hampshire, UK

Post Jan 6th '10, 17:00

Det vore riktigt nice att få se detta faktiskt. dels efter som det är på svenska (yay) och dels för att det verkar som om du lagt ner mycket tid på det. så det måste ju vara kvalité :P

men aja du bestämmer. annars så länka bara i ett PM :)
What are you, if not seven different shades of stupid?
User avatar

CryoS
The Dungeon

PreviousNext

Return to Projects



Who is online

Users browsing this forum: No registered users