Custom audio scripting is crashing our server. **sigh**
Moderator: Moderators
Custom audio scripting is crashing our server. **sigh**
Hey guys. I've been trying to work this out for a couple of months now. I'm at my wits end and just about to remove all my fun and goofy sounds from my map just to keep it working.
I have a lot of music in this one that players can activate. So, I've been trying to limit how many can be played at once. But no matter what I do, the stupid thing keeps crashing. Most of the sounds are started by a trigger-use. But a couple are trigger-multiple's that you just run through. I think those are the main ones causing my problems. But the alarm stuff in there is kind of touchy too since it doesn't want to work all the time.
If anyone can help me resolve this I'd be gratefull. Here is the whole nasty noob written script:
That last audio script is a temporary addon to allow me to check to see if the alarm kills the music when it sounds. But the actual alarm only runs once, it doesn't loop.
My finger is on the delete button. Help!
It doesn't seem to want to post my script... I'll see If I can get it somewhere else.
I put it here... BK_town.scr
http://webpages.charter.net/dt3d/
I have a lot of music in this one that players can activate. So, I've been trying to limit how many can be played at once. But no matter what I do, the stupid thing keeps crashing. Most of the sounds are started by a trigger-use. But a couple are trigger-multiple's that you just run through. I think those are the main ones causing my problems. But the alarm stuff in there is kind of touchy too since it doesn't want to work all the time.
If anyone can help me resolve this I'd be gratefull. Here is the whole nasty noob written script:
That last audio script is a temporary addon to allow me to check to see if the alarm kills the music when it sounds. But the actual alarm only runs once, it doesn't loop.
My finger is on the delete button. Help!
It doesn't seem to want to post my script... I'll see If I can get it somewhere else.
I put it here... BK_town.scr
http://webpages.charter.net/dt3d/
Diego
Yeah, I was originally using auto on everything. But it was always crashing then as well. Or some of my sounds would just not play.
That's why I started throwing them on different channels. I was using the "quotes" because tltrude mentioned my use of "local" earlier needed them. But the reality is the sounds will usually work if I use them or not.
$speaker_XXX is a dummy .tik file. I have the same channel specified in it's properties as listed in the script.
What drives me crazy is I can run this map on my own computer all day long. But once it is on the server with other players, it won't last 5 minutes. Last night we tried activating all the triggered sounds at once. hehe, it didn't like that at all.
But most of the time the map will just crash when nobody is even activating the sound triggers.
I am pre-cacheing the sounds. There is about 12 mb of custom sounds in here.
The main sound that has to work everytime is the alarm. That's why I have it overriding most of the other's when it fires. I'll try diabling the trigger-multiple ones again to see if that helps the stability. Until I added them back in, we were able to play the map for about 2 hours without any crashes. But I don't know if I am hitting some kind of limit, or if it's just the way I am implementing them that is the problem.
Anyway, I'll put all my other sounds back to auto except for the alarm.
That's why I started throwing them on different channels. I was using the "quotes" because tltrude mentioned my use of "local" earlier needed them. But the reality is the sounds will usually work if I use them or not.
$speaker_XXX is a dummy .tik file. I have the same channel specified in it's properties as listed in the script.
What drives me crazy is I can run this map on my own computer all day long. But once it is on the server with other players, it won't last 5 minutes. Last night we tried activating all the triggered sounds at once. hehe, it didn't like that at all.
But most of the time the map will just crash when nobody is even activating the sound triggers.
I am pre-cacheing the sounds. There is about 12 mb of custom sounds in here.
The main sound that has to work everytime is the alarm. That's why I have it overriding most of the other's when it fires. I'll try diabling the trigger-multiple ones again to see if that helps the stability. Until I added them back in, we were able to play the map for about 2 hours without any crashes. But I don't know if I am hitting some kind of limit, or if it's just the way I am implementing them that is the problem.
Anyway, I'll put all my other sounds back to auto except for the alarm.
Diego
I tried using auto for all my sound channels this time. But when I do that, the command "stopsound 0" that I use to stop sound on the auto channel, doesn't work. According to the Entity viewer, the default is voice anyway. So I've put those speakers back to channel 4. So my trigger that turns off the music works again.
I've temporarily cut back on the number of custom sounds I'm using. And I've moved my mp3's out of my pk3 file. I tried to use .wav files. But I guess they were so big that they couldn't cache. Most of them just wouldn't play. So I'll stick with mp3.
I'll be able to try this version out on the server tomorrow. I'll let you know if it works or not.
I've temporarily cut back on the number of custom sounds I'm using. And I've moved my mp3's out of my pk3 file. I tried to use .wav files. But I guess they were so big that they couldn't cache. Most of them just wouldn't play. So I'll stick with mp3.
I'll be able to try this version out on the server tomorrow. I'll let you know if it works or not.
Diego
Well, we tested the map last night. It seemed fairly stable. I had only about one-third of the total custom sounds in the game. It crashed once, but I'm not sure if that was script related or not.
The biggest problem is that I was still having trouble getting the sounds to work everytime. It seemed to get more bugs when more players were in the game. So I guess at this point, I'm just going to remove everything that is not absolutely necessary.
The biggest problem is that I was still having trouble getting the sounds to work everytime. It seemed to get more bugs when more players were in the game. So I guess at this point, I'm just going to remove everything that is not absolutely necessary.
Diego
-
Krane
- Lieutenant General
- Posts: 782
- Joined: Sat May 31, 2003 4:18 pm
- Location: California, USA
- Contact:
Before loading your map, type logfile 2 in the console. A file called qconsole.log will appear in your main folder w/ all the information we need to figure out where your errors are.
Or, as soon as it crashes, open your console and scroll up to see what kind of error you're getting.
Hope that helps.
Or, as soon as it crashes, open your console and scroll up to see what kind of error you're getting.
Hope that helps.
I'll try this as soon as I can. I just reinstalled Windows. I don't have my SDK for MOHAA setup yet.
I wasn't seeing any errors in the console window when the sounds didn't play. But there might be something else that would show up in the log file if it crashed. Does that work if I'm playing on the server? Because when I run the map on my computer by myself, I never have any of these problems.
One thing that might help: sometimes when I trigger my looping alarm sound, it won't play, but I will hear a clicking noise coming from the .tik speaker. It's almost like it is trying to play but is getting interupted and restarted over and over again.
I wasn't seeing any errors in the console window when the sounds didn't play. But there might be something else that would show up in the log file if it crashed. Does that work if I'm playing on the server? Because when I run the map on my computer by myself, I never have any of these problems.
One thing that might help: sometimes when I trigger my looping alarm sound, it won't play, but I will hear a clicking noise coming from the .tik speaker. It's almost like it is trying to play but is getting interupted and restarted over and over again.
Diego
-
Krane
- Lieutenant General
- Posts: 782
- Joined: Sat May 31, 2003 4:18 pm
- Location: California, USA
- Contact:
Got the virus? welcome to the club...Diego wrote:I'll try this as soon as I can. I just reinstalled Windows.
1) Are your map/server for AA or SH?
2) I think is possible, when you join a server, to see where the prob is in the qconsole.log. Ask the server to do the same.
3) the "loop-alike" sound, trying to play, can be a script error. I will check your script again...
No virus. I was giving it a semi-annual cleaning. I'm compiling a new version tonight that is much simpler. But the looping code for the alarm test is still in here.
I've edited out my animated switches and my volume damage scripts to shorten down.
I've edited out my animated switches and my volume damage scripts to shorten down.
Code: Select all
//BK Town v. 2.30
// ARCHITECTURE: =[BK]=theOmega, =[BK]=Don Diego
// Some prefabs from Wacko (metal stairs, air ducts, modified printing press)
// SCRIPTING: =[BK]=theOmega, =[BK]=Don Diego
// Trap door scripting taken from TlTrude's door tutorial.
// CUSTOM TEXTURES: =[BK]=Don Diego, Transparent and reflect shader help by Wacko.
// LIGHTING: =[BK]=Don Diego
//
/////////////////////////////////////////////////
//MAIN SETUP AND SCORE///////////////////////////
/////////////////////////////////////////////////
main:
local.master = spawn ScriptMaster
/////////////////////////////////////////////////
//Looping level sounds///////////////////////////
/////////////////////////////////////////////////
local.master aliascache snore sound/bktown/snore.mp3 soundparms 2.0 1.0 1.0 0.0 200 500 auto loaded maps "obj dm"
local.master aliascache Fire sound/bktown/fireplace.mp3 soundparms 1.0 1.0 1.0 0.0 100 300 auto loaded maps "obj dm"
local.master aliascache Fire2 sound/bktown/fireplace.mp3 soundparms 1.0 1.0 1.0 0.0 100 300 auto loaded maps "obj dm"
local.master aliascache Fire3 sound/bktown/fireplace.mp3 soundparms 1.0.0 1.0 1.0 0.0 200 400 auto loaded maps "obj dm"
local.master aliascache Press sound/bktown/Press.mp3 soundparms 0.5 1.0 1.0 0.0 100 400 auto loaded maps "obj dm"
local.master aliascache Boiler sound/bktown/BoilerRoom.mp3 soundparms 1.2 1.0 1.0 0.0 500 1000 auto loaded maps "obj dm"
/////////////////////////////////////////////////
//Triggerable Music//////////////////////////////
/////////////////////////////////////////////////
local.master aliascache piano sound/bktown/Music/pianoman.mp3 soundparms 1.0 1.0 1.0 0.0 300 1000 voice loaded maps "obj dm"
local.master aliascache Slix_3 sound/bktown/Music/Slix_3.mp3 soundparms 1.0 1.0 1.0 0.0 200 500 voice loaded maps "obj dm"
/////////////////////////////////////////////////
//Triggerable Sound Effects//////////////////////
/////////////////////////////////////////////////
local.master aliascache stonedoor sound/bktown/stonedoor.mp3 soundparms 3.0 1.0 1.0 0.0 200 400 auto loaded maps "obj dm"
local.master aliascache Flush sound/bktown/flush.mp3 soundparms 4.0 1.0 1.0 0.0 300 500 auto loaded maps "obj dm"
local.master aliascache Alarm sound/bktown/Alarm.mp3 soundparms 1.0 1.0 1.0 0.0 3000 8000 dialogue loaded maps "obj dm"
/////////////////////////////////////////////////
level waittill prespawn
exec global/DMprecache.scr
exec scripts/bktown_precache.scr
exec global/door_locked.scr::lock
exec global/ambient.scr mohdm3
//$trap_door movedown 64 // door moved up for lighting edges
$trap_door move
$CoffinB move
thread trap_door_mover
thread CoffinB_mover
level.script=maps/dm/BK_town.scr
setcvar "g_scoreboardpic" "score"
level waittill spawn
level.musicplaying = 0
// set scoreboard messages
setcvar "g_obj_alliedtext1" "BK Town"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" "created by:"
setcvar "g_obj_axistext1" " ""
setcvar "g_obj_axistext2" "=[BK]=theOmega"
setcvar "g_obj_axistext3" "=[BK]=DonDiego"
wait 2
$speaker_ELfire loopsound Fire
$speaker_NGfire loopsound Fire2
$speaker_Durafire loopsound Fire3
$speaker_Snore loopsound snore
$speaker_Press loopsound Press
$speaker_Blaster3 loopsound Boiler
end
//////////////////////////////////////////////////
//SOUND SCRIPTS///////////////////////////////////
//////////////////////////////////////////////////
//////////////////////////////////////////////////
//Sound script for Kenny's Room///////////////////
//////////////////////////////////////////////////
alarmthread:
iprintlnbold "WARNING! SECURITY SYSTEM ACTIVATED!"
level.musicplaying = 1
//Kill sound in Maddog's room while alarm is playing//
$MaddogPiano nottriggerable
$speaker_Maddog stopsound 4
//Kill sound in Disco while alarm is playing//
$DiscoTrigger nottriggerable
$speaker_Slix1 stopsound 4
$speaker_Slix2 stopsound 4
$speaker_Slix3 stopsound 4
$speaker_Slix4 stopsound 4
//Play Alarm Sound
$speaker_Alarm playsound Alarm
wait 16
//Resume normal sound operations
level.musicplaying = 0
$MaddogPiano triggerable
$DiscoTrigger triggerable
end
//////////////////////////////////////////////////
//Sound script for Maddog's Room//////////////////
//////////////////////////////////////////////////
thread.Maddog:
if (level.musicplaying == 0)
{
level.musicplaying = 1
$MaddogPiano nottriggerable
$speaker_Maddog playsound piano
iprintlnbold "Report to your room Maddog!"
wait 43
level.musicplaying = 0
$MaddogPiano triggerable
}
end
/////////////////////////////////////////////////
//Sound script for NightGirl's Room//////////////
/////////////////////////////////////////////////
thread.Toilet:
$speaker_Toilet playsound Flush
wait 10
end
/////////////////////////////////////////////////
//Sound script for Slix's Room//////////////////
/////////////////////////////////////////////////
slixthread:
if (level.musicplaying == 0)
{
level.musicplaying = 1
$speaker_Omega stoploopsound
$DiscoTrigger nottriggerable
thread Slix_3
//thread ("Slix_" + (randomint(7) + 1))
$speaker_Omega loopsound Omega1
}
end
////////////////////////////////////////////////
Slix_3:
iprintlnbold "Disco Fever!"
$speaker_Slix1 playsound Slix_3
$speaker_Slix2 playsound Slix_3
$speaker_Slix3 playsound Slix_3
$speaker_Slix4 playsound Slix_3
wait 62
level.musicplaying = 0
$DiscoTrigger triggerable
end
//////////////////////////////////////////////////
//Alarm Sound Tester//////////////////////////////
//////////////////////////////////////////////////
//Turn Alarm On
thread.AlarmTestOn:
$AlarmTestOn nottriggerable
iprintlnbold "TESTING SECURITY SYSTEM!"
level.musicplaying = 1
//Kill sound in Maddog's room while alarm is playing//
$speaker_Maddog stopsound 4
$MaddogPiano nottriggerable
//Kill sound in Disco while alarm is playing//
$speaker_Slix1 stopsound 4
$speaker_Slix2 stopsound 4
$speaker_Slix3 stopsound 4
$speaker_Slix4 stopsound 4
$DiscoTrigger nottriggerable
$speaker_Alarm loopsound Alarm
end
//Turn Alarm Off
thread.AlarmTestOff:
iprintlnbold "SECURITY SYSTEM TEST COMPLETE!"
$speaker_Alarm stoploopsound
level.musicplaying = 0
$AlarmTestOn triggerable
$MaddogPiano triggerable
$DiscoTrigger triggerable
end
//////////////////////////////////////////////////
Diego
I finally got a chance to test my new scripts. We had 12 players on last night and ran the map 4 times without any crashes.
The only glitch was the alarm stopped working but that might have been caused by all the map restarts. In a regular rotation, I don't think that will happen.
I drastically cut back the number of sounds and removed the scripts that I thought were the most fragile. I wish I could have isolated what was actually causing the problem so I don't do it again. But I guess I'll have to be satisfied with a map that works.
By the way, Krane:
You never explained to me why including my MP3 files in my .PK3 file is a bad idea. Why do they have to be extracted in the "main" folder? My file seemed to crash no matter where I put the sounds. It just became more unstable when I used more of them.
The only glitch was the alarm stopped working but that might have been caused by all the map restarts. In a regular rotation, I don't think that will happen.
I drastically cut back the number of sounds and removed the scripts that I thought were the most fragile. I wish I could have isolated what was actually causing the problem so I don't do it again. But I guess I'll have to be satisfied with a map that works.
By the way, Krane:
You never explained to me why including my MP3 files in my .PK3 file is a bad idea. Why do they have to be extracted in the "main" folder? My file seemed to crash no matter where I put the sounds. It just became more unstable when I used more of them.
Diego
-
Krane
- Lieutenant General
- Posts: 782
- Joined: Sat May 31, 2003 4:18 pm
- Location: California, USA
- Contact:
I know that as a "rule of thumb": mp3 dont play inside the pk3. I tested ages ago and it didnt play indeed, will test it again (when time permits).
But, w/ my experience as a sound designer, I must ask: what kind of compression are you using for the mp3? Are you using 160kbps/44.100khz?
But, w/ my experience as a sound designer, I must ask: what kind of compression are you using for the mp3? Are you using 160kbps/44.100khz?
Last edited by Krane on Fri Jun 11, 2004 5:39 am, edited 1 time in total.
I'm using 128kbps. Isn't that supposed to be 44.100 khz? I think that is what I am using also. I'll have to doublecheck.
I was using a variety of kbps depending on the quality of the sound. Some were as low as 64kbps. But I change them all to 128 about a month ago to eliminate that as a possiblity for crashing.
When I had my mp3s in my pk3 file, all of them would play. They just would not play everytime they were supposed too. Aside from the crashing, that has been my biggest problem with this map. Separating them from the pk3 didn't really help either issue. The only thing that seems to have fixed my problems was reducing the amount of sound files I was using and removing some of the more complicated sound threads from my script altogether.
I was using a variety of kbps depending on the quality of the sound. Some were as low as 64kbps. But I change them all to 128 about a month ago to eliminate that as a possiblity for crashing.
When I had my mp3s in my pk3 file, all of them would play. They just would not play everytime they were supposed too. Aside from the crashing, that has been my biggest problem with this map. Separating them from the pk3 didn't really help either issue. The only thing that seems to have fixed my problems was reducing the amount of sound files I was using and removing some of the more complicated sound threads from my script altogether.
Diego
