For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com
Requesting custom WaterZoneInfo
- Krull0r
- Global Moderator
- Posts: 543
- Joined: Sun Jul 01, 2007 4:07 pm
Requesting custom WaterZoneInfo
Hello.
I'm thinking about a custom Waterzone for Unreal Redux which plays a player attached looping underwater sound effect while the player is under water.
It is also important that only the player can hear the sound effect.
So he shouldn't become a sound source for other players.
Might this be possible?
Greetings Krull0r
I'm thinking about a custom Waterzone for Unreal Redux which plays a player attached looping underwater sound effect while the player is under water.
It is also important that only the player can hear the sound effect.
So he shouldn't become a sound source for other players.
Might this be possible?
Greetings Krull0r
- Masterkent
- OldUnreal Member
- Posts: 1469
- Joined: Fri Apr 05, 2013 12:41 pm
Re: Requesting custom WaterZoneInfo
Do you need that working for all water zones or only for particular ones?I'm thinking about a custom Waterzone for Unreal Redux which plays a player attached looping underwater sound effect while the player is under water.
What region of a player (foot/middle/head) should reside in a water zone to make the sound played?
- Krull0r
- Global Moderator
- Posts: 543
- Joined: Sun Jul 01, 2007 4:07 pm
Re: Requesting custom WaterZoneInfo
It should work for all WaterZone Info
Maybe with the possibility to place different sounds for each ZoneInfo
Using the Head region would be nice.
Maybe with the possibility to place different sounds for each ZoneInfo
Using the Head region would be nice.
- Bleeder91[NL]
- OldUnreal Member
- Posts: 1062
- Joined: Sun Oct 04, 2009 7:22 pm
Re: Requesting custom WaterZoneInfo
I used this ZoneAmbientSound before, which client-side relocates to the player once he's in the zone. I used this for rain sounds but your idea should work too. Some tinkering may be required like the offset from the player, but I'm sure you can figure it out (I'm unsure whether CalcCameraLocation is 227j+ only).
Code: Select all
//=============================================================================
// ZoneAmbientSound.
//=============================================================================
class ZoneAmbientSound expands AmbientSound;
var byte BaseVolume;
var ZoneInfo BaseZone;
Replication
{
Reliable if(Role==ROLE_Authority)
BaseZone, BaseVolume;
}
simulated function BeginPlay()
{
BaseVolume=SoundVolume;
BaseZone=Region.Zone;
SoundVolume=0;
ScaleGlow=0;
DrawType=DT_None;
}
simulated function Tick(float DT)
{
var PlayerPawn LocalPlayer;
LocalPlayer=Level.GetLocalPlayerPawn();
if(!bool(LocalPlayer)) { Disable('Tick'); return; }
SetLocation(LocalPlayer.CalcCameraLocation+(vect(100,0,0)>>LocalPlayer.CalcCameraRotation));
if(LocalPlayer.HeadRegion.Zone==BaseZone) ScaleGlow=FClamp(ScaleGlow+2*DT,0,1);
else ScaleGlow=FClamp(ScaleGlow-2*DT,0,1);
SoundVolume=BaseVolume*ScaleGlow;
}
defaultproperties
{
bStatic=False
bHidden=False
bAlwaysRelevant=True
RemoteRole=ROLE_SimulatedProxy
}
Last edited by Bleeder91[NL] on Mon Jun 11, 2018 5:34 pm, edited 1 time in total.
- Masterkent
- OldUnreal Member
- Posts: 1469
- Joined: Fri Apr 05, 2013 12:41 pm
Re: Requesting custom WaterZoneInfo
Is that sound supposed to be coming from the water or from the player's equipment?
Sometimes the location of the player's camera may be far from the head location (e.g. when using the 3rd person view or watching other player). So it's unclear what should happen, for example, when your head in under water, but your camera is not, or vice versa. Additionally, it's not clear whether spectators should hear such underwater sounds (when they observe the world from their own position or use a view from other actor).
Sometimes the location of the player's camera may be far from the head location (e.g. when using the 3rd person view or watching other player). So it's unclear what should happen, for example, when your head in under water, but your camera is not, or vice versa. Additionally, it's not clear whether spectators should hear such underwater sounds (when they observe the world from their own position or use a view from other actor).
- Krull0r
- Global Moderator
- Posts: 543
- Joined: Sun Jul 01, 2007 4:07 pm
Re: Requesting custom WaterZoneInfo
Bleeder your sound actor works fine so far
The problem is now I'm also using DynamicWaterZoneInfo for water ( because of BSP holes ) and the sound do not check the Zone change.
I really like the fading after the player leaves or enters the ZoneInfo
I like to use such an actor for underwater background noises.
The problem is now I'm also using DynamicWaterZoneInfo for water ( because of BSP holes ) and the sound do not check the Zone change.
I really like the fading after the player leaves or enters the ZoneInfo
I like to use such an actor for underwater background noises.
- Masterkent
- OldUnreal Member
- Posts: 1469
- Joined: Fri Apr 05, 2013 12:41 pm
Re: Requesting custom WaterZoneInfo
I never used dynamic zones and dunno how they work. Regarding ZoneAmbientSound, I'd probably implement it a bit differently.
For particular zones:
For all other water zones:
The class of sound source (spawned by the implementation client-side, should not be placed in maps via UnrealEd):
The main differences are:
1. It's possible to assign a common ambient sound for all water zones in the map.
2. No network replication is used, so a greater number of other actors can be replicated without issues (max number of simultaneously net-relevant actors is about 1024).
3. Time-dependent fading doesn't make sense to me, so I wouldn't use it.
4. Whether and what sound is played depends on the location of the player's camera (which may be far from the head region).
For particular zones:
Code: Select all
class ZoneAmbientSound expands AmbientSound;
var(Sound) Sound ZoneSound;
var ZoneAmbientSound Next;
simulated event Tick(float DeltaTime)
{
local PlayerPawn Player;
local ZoneAmbientSoundSource SoundSource;
if (Level.NetMode == NM_DedicatedServer)
{
Disable('Tick');
return;
}
Player = Level.GetLocalPlayerPawn();
if (Player == none)
return;
foreach Player.ChildActors(class'ZoneAmbientSoundSource', SoundSource)
{
SoundSource.AddZoneAmbientSound(self);
Disable('Tick');
return;
}
SoundSource = Player.Spawn(class'ZoneAmbientSoundSource', Player);
if (SoundSource != none)
SoundSource.AddZoneAmbientSound(self);
Disable('Tick');
}
simulated function bool HandleZone(ZoneInfo Zone, Actor SoundSource)
{
if (Level.GetLocZone(Location).Zone != Zone)
return false;
SetAmbientSoundOf(SoundSource);
return true;
}
final simulated function SetAmbientSoundOf(Actor SoundSource)
{
SoundSource.AmbientSound = ZoneSound;
SoundSource.SoundPitch = SoundPitch;
SoundSource.SoundVolume = SoundVolume;
}
defaultproperties
{
bNoDelete=True
bStatic=False
RemoteRole=ROLE_SimulatedProxy
}
Code: Select all
class WaterZonesAmbientSound expands ZoneAmbientSound;
simulated function bool HandleZone(ZoneInfo Zone, Actor SoundSource)
{
if (WaterZone(Zone) != none)
SetAmbientSoundOf(SoundSource);
return false;
}
Code: Select all
class ZoneAmbientSoundSource expands AmbientSound
nousercreate;
var private ZoneAmbientSound First;
var private ZoneInfo LastOwnerCamZone;
event Tick(float DeltaTime)
{
Update(PlayerPawn(Owner));
}
final function AddZoneAmbientSound(ZoneAmbientSound ZoneAmbientSound)
{
ZoneAmbientSound.Next = First;
First = ZoneAmbientSound;
LastOwnerCamZone = none;
}
final function Update(PlayerPawn Player)
{
if (Player == none || Player.bDeleteMe)
{
Destroy();
return;
}
SetLocation(Player.CalcCameraLocation);
Velocity = Player.Velocity;
UpdateZoneAmbientSound(Player);
}
final function UpdateZoneAmbientSound(PlayerPawn Player)
{
local ZoneAmbientSound ZoneAmbientSound;
if (LastOwnerCamZone == Player.CameraRegion.Zone)
return;
LastOwnerCamZone = Player.CameraRegion.Zone;
AmbientSound = none;
for (ZoneAmbientSound = First; ZoneAmbientSound != none; ZoneAmbientSound = ZoneAmbientSound.Next)
if (ZoneAmbientSound.HandleZone(LastOwnerCamZone, self))
return;
}
defaultproperties
{
bStatic=False
RemoteRole=ROLE_None
}
1. It's possible to assign a common ambient sound for all water zones in the map.
2. No network replication is used, so a greater number of other actors can be replicated without issues (max number of simultaneously net-relevant actors is about 1024).
3. Time-dependent fading doesn't make sense to me, so I wouldn't use it.
4. Whether and what sound is played depends on the location of the player's camera (which may be far from the head region).
Last edited by Masterkent on Fri Jun 29, 2018 10:11 am, edited 1 time in total.
- Bleeder91[NL]
- OldUnreal Member
- Posts: 1062
- Joined: Sun Oct 04, 2009 7:22 pm
Re: Requesting custom WaterZoneInfo
Thanks for the free optimization, Masterkent, it'll come in handy in the very near future. Much appreciated
- Masterkent
- OldUnreal Member
- Posts: 1469
- Joined: Fri Apr 05, 2013 12:41 pm
Re: Requesting custom WaterZoneInfo
Whether these optimizations are applicable depends on how you use such actors and what effects you want to achieve. bNoDelete is useful when the actor need not be spawned or destroyed dynamically and network clients can read its properties directly from the containing map. Dynamically spawnable actors cannot have default.bNoDelete == true. And if you want those fading effects, then two or more sounds can potentially be played simultaneously, so a single sound source won't suffice.
- Krull0r
- Global Moderator
- Posts: 543
- Joined: Sun Jul 01, 2007 4:07 pm
Re: Requesting custom WaterZoneInfo
Works fine so far but entering a DynamicWaterZones has no effect
- Masterkent
- OldUnreal Member
- Posts: 1469
- Joined: Fri Apr 05, 2013 12:41 pm
Re: Requesting custom WaterZoneInfo
DynamicZoneInfo does not update Region of actors which are already present in its volume, and I'd consider this as a bug in DynamicZoneInfo itself.
My code may handle dynamic zones well after replacing
with
Bleeder's code can be changed similarly, but you'd need to either get rid of variable BaseZone or postpone its initialization somehow, because your DynamicZoneInfo actor may be initialized after the call to ZoneAmbientSound.BeginPlay, so during the execution of ZoneAmbientSound.BeginPlay expressions like
or
may behave as if the DynamicZoneInfo actor didn't exist.
The initialization order of DynamicZoneInfo and ZoneAmbientSound will probably depend on the order in which these actors are placed in the list of actors (or objects). Since you cannot reliably specify this order by means of UnrealEd, relying on the automatically chosen order, which luckily may produce the desirable behavior, wouldn't be a good idea.
My code may handle dynamic zones well after replacing
Code: Select all
simulated function bool HandleZone(ZoneInfo Zone, Actor SoundSource)
{
if (Region.Zone != Zone)
return false;
SetAmbientSoundOf(SoundSource);
return true;
}
Code: Select all
simulated function bool HandleZone(ZoneInfo Zone, Actor SoundSource)
{
if (Level.GetLocZone(Location).Zone != Zone)
return false;
SetAmbientSoundOf(SoundSource);
return true;
}
Code: Select all
BaseZone = Region.Zone
Code: Select all
BaseZone = Level.GetLocZone(Location).Zone
The initialization order of DynamicZoneInfo and ZoneAmbientSound will probably depend on the order in which these actors are placed in the list of actors (or objects). Since you cannot reliably specify this order by means of UnrealEd, relying on the automatically chosen order, which luckily may produce the desirable behavior, wouldn't be a good idea.
- Krull0r
- Global Moderator
- Posts: 543
- Joined: Sun Jul 01, 2007 4:07 pm
Re: Requesting custom WaterZoneInfo
Yes! This worked fine so far.
Only one more problem.
The game crashes and freezes with out any error message if I add more then one of that ambientsound.
Only one more problem.
The game crashes and freezes with out any error message if I add more then one of that ambientsound.
- Masterkent
- OldUnreal Member
- Posts: 1469
- Joined: Fri Apr 05, 2013 12:41 pm