logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Issue #48. UnrealI.CloudZone kills/destroys non-colliding actors (Read 184 times)
Masterkent
Developer Team
Offline



Posts: 864
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Issue #48. UnrealI.CloudZone kills/destroys non-colliding actors
Aug 12th, 2017 at 1:28pm
Print Post  
Code
Select All
class CloudZone extends ZoneInfo;

event ActorEntered( actor Other )
{
	if ( Other.IsA('Pawn') )
		Pawn(Other).Died(Pawn(Other).Enemy, 'Fell', Location);
	else
		Other.LifeSpan = 0.01;
} 


This code doesn't check if the entered actor may collide with something. It allows the following things:

- spectators may die in CloudZones;
- players may die in CloudZones when using the ghost mode;
- the selected weapon of a player may be destroyed in a CloudZone.

See http://www.youtube.com/watch?v=_oa9VkG-UIs

Usually actors for which bCollideActors is false or bCollideWorld is false are supposed to be environment-insensitive. Additionally, an actor whose bNoDelete is true probably won't have a sensible behavior after its LifeSpan automatically reaches zero.

If the entered actor is a Pawn which is already dead (Health <= 0), there should be no attempt to kill it again.

Whether the Enemy of the Pawn is responsible for pushing the Pawn into the CloudZone, cannot be determined based on the currently available properties; hence it would be weird to unconditionally count such kills as Enemy's frags. I think, the killer pawn passed to Died should be none.

Suggested resolution: change the function definition to

Code
Select All
event ActorEntered( actor Other )
{
	if (!Other.bCollideActors || !Other.bCollideWorld)
		return;
	if (Other.bIsPawn)
	{
		if (Pawn(Other).Health > 0)
			Pawn(Other).Died(none, 'Fell', Location);
	}
	else if (!Other.bNoDelete)
		Other.LifeSpan = 0.01;
} 

« Last Edit: Aug 12th, 2017 at 3:03pm by Masterkent »  
Back to top
 
IP Logged
 
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 517
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
Re: Issue #48. UnrealI.CloudZone kills/destroys non-colliding actors
Reply #1 - Aug 12th, 2017 at 3:47pm
Print Post  
Shouldn't it have been Instigator rather than Enemy in the first place?
  

HX on Mod DB. Revision on Steam.
Back to top
 
IP Logged
 
Masterkent
Developer Team
Offline



Posts: 864
Location: Russia
Joined: Apr 5th, 2013
Gender: Male
Re: Issue #48. UnrealI.CloudZone kills/destroys non-colliding actors
Reply #2 - Aug 20th, 2017 at 6:15pm
Print Post  
han wrote on Aug 12th, 2017 at 3:47pm:
Shouldn't it have been Instigator rather than Enemy in the first place?

Who is the instigator?

After more tests and thinking about other aspects of the given implementation, I decided to change the suggested code to

Code
Select All
simulated event ActorEntered(Actor Other)
{
	if (!Other.bCollideActors || !Other.bCollideWorld)
		return;
	if (!Other.bIsPawn)
		Other.Destroy();
	else if (Role == ROLE_Authority && Pawn(Other).Health > 0)
		Pawn(Other).Died(none, 'Fell', Other.Location);
} 


Making this function simulated should improve client-side prediction for bNetTemporary projectiles. Currently such projectiles as Grenades and RazorBlades may persist client-side after their server-side counterparts have been destroyed due to entering to a CloudZone.

Setting LifeSpan to a very small value instead of calling Destroy doesn't look as serving any valuable purpose. In fact, the small delay before destruction causes some weirdness in case of RazorBlades: sometimes they hit the ceiling and disappear while moving backward (currently this can be observed in a standalone game).
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo