Is there a way to know if an actor can be replicated?
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Is there a way to know if an actor can be replicated?
Is there a way, in UnrealScript, to check if an actor can be replicated?
"Your stuff is known to be buggy and unfinished/not properly tested"
- EvilGrins
- Godlike
- Posts: 9751
- Joined: Thu Jun 30, 2011 8:12 pm
- Personal rank: God of Fudge
- Location: Palo Alto, CA
- Contact:
Re: Is there a way to know if an actor can be replicated?
I may be oversimplifying this (or possibly not understanding the question) but it seems the simplest way to go would be to find the actor, right click on said actor, and hit "duplicate".
If nothing happens... then it can't be replicated.
If nothing happens... then it can't be replicated.
http://unreal-games.livejournal.com/
Smilies · viewtopic.php?f=8&t=13758medor wrote:Replace Skaarj with EvilGrins
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Is there a way to know if an actor can be replicated?
EvilGrins wrote:I may be oversimplifying this (or possibly not understanding the question) but it seems the simplest way to go would be to find the actor, right click on said actor, and hit "duplicate".
If nothing happens... then it can't be replicated.
:/PrinceOfFunky wrote:in UnrealScript
"Your stuff is known to be buggy and unfinished/not properly tested"
- EvilGrins
- Godlike
- Posts: 9751
- Joined: Thu Jun 30, 2011 8:12 pm
- Personal rank: God of Fudge
- Location: Palo Alto, CA
- Contact:
Re: Is there a way to know if an actor can be replicated?
Yes, I saw the script part but I don't know script.PrinceOfFunky wrote::/
http://unreal-games.livejournal.com/
Smilies · viewtopic.php?f=8&t=13758medor wrote:Replace Skaarj with EvilGrins
Re: Is there a way to know if an actor can be replicated?
Look at my signature. There's a link to an article about replication, which mentions the conditions any actor must satisfy to be replicated. Pretty much all of them can be checked in UnrealScript. Leave out the location-based tests and you have a generic "might be replicable" check. (The bare minimum is a RemoteRole > ROLE_None, but maybe you want other verifications as well.)PrinceOfFunky wrote:Is there a way, in UnrealScript, to check if an actor can be replicated?
Replication and duplication are entirely unrelated topics.EvilGrins wrote:I may be oversimplifying this (or possibly not understanding the question)
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Is there a way to know if an actor can be replicated?
If an actor has RemoteRole > than ROLE_None, couldn't it just mean it replicates just its variables and probably not itself?Wormbo wrote:Look at my signature. There's a link to an article about replication, which mentions the conditions any actor must satisfy to be replicated. Pretty much all of them can be checked in UnrealScript. Leave out the location-based tests and you have a generic "might be replicable" check. (The bare minimum is a RemoteRole > ROLE_None, but maybe you want other verifications as well.)PrinceOfFunky wrote:Is there a way, in UnrealScript, to check if an actor can be replicated?
Replication and duplication are entirely unrelated topics.EvilGrins wrote:I may be oversimplifying this (or possibly not understanding the question)
"Your stuff is known to be buggy and unfinished/not properly tested"
- sektor2111
- Godlike
- Posts: 6413
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Is there a way to know if an actor can be replicated?
SwarmSpawn is an actor used in server spawned/attached client doesn't know to much about, it is only feeling consequences (stuff spawned), I'm guessing, else No Guess > LiftCenter has RemoteRole = ROLE_None but being part of Level Player can figure it's existence but not changes to actor occurred in game > In client doesn't move with Lift it's completely stuck.
For the rest:Pretty self explanatory... No ? Eh, it replicates itself but not all related visuals/variables, so it might be part of both client and server but some times client doesn't see all changes. Example ? Yes... Several light related craps.
So to speak I like more actors than objects subclassed in other sort of stuff...
For the rest:
Code: Select all
//=============================================================================
// Actor: The base class of all actors.
// This is a built-in Unreal class and it shouldn't be modified.
//=============================================================================
class Actor extends Object
abstract
native
nativereplication;
So to speak I like more actors than objects subclassed in other sort of stuff...
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Is there a way to know if an actor can be replicated?
Well, thanks for the answers, but I just noticed, it may be another kind of problem. There are actors who get destroyed even if I didn't programmed them to be destroyed.
If you want know why I opened this topic, it was cause I thought the problem was related to this code:
The AllActors iterator iterates throught a chain of Actors where actors are added to the back of the chain. An AMP is spawned for every Actor, this means there will always be an AMP to the back of the Actors chain.
But I now understands it cannot be related to it, since Owner variable gets updated when a replicated actors "owning an actor" turns from being None to an actual Actor reference.
Now I just need to understand why those actors get Destroyed, and only when their Owner becomes None...
EDIT: Destroyed() is not even called, Expired() neither, so no one calls Destroy() or set a lifeSpan to the "AMP" actor.
EDIT2: I tried setting bNoDelete to true, they don't get deleted but of course I cannot use it since I couldn't destroy them anymore.
EDIT3: Omg o.o I found out what's the problem... It's a None assignment!
This would even solve a problem I had with UnrealRace, and probably a problem you(sektor) had with your A.I. tweak tool, as you wrote here(viewtopic.php?f=15&t=11324):
ActorA.ActorB = None; is the same of ActorB = None; ?
If yes, at this point I couldn't change the value of ActorB with another actor to change the position of an Actor chain that starts from ActorA, like "ActorA.ActorB = ActorC". Would it change the reference of ActorB into ActorC, or just the value?
If you want know why I opened this topic, it was cause I thought the problem was related to this code:
Spoiler
Code: Select all
var Actor lastSpawn;
function Tick( float Delta ) {
local Actor a;
local bool lastSpawnReached;
foreach AllActors(class'Actor', a) {
if (bFirstIteration || lastSpawnReached) {
GiveAMP(a);
lastSpawn = a;
} else {
if (a == lastSpawn)
lastSpawnReached = true;
}
}
bFirstIteration = false;
}
Now I just need to understand why those actors get Destroyed, and only when their Owner becomes None...
EDIT: Destroyed() is not even called, Expired() neither, so no one calls Destroy() or set a lifeSpan to the "AMP" actor.
EDIT2: I tried setting bNoDelete to true, they don't get deleted but of course I cannot use it since I couldn't destroy them anymore.
EDIT3: Omg o.o I found out what's the problem... It's a None assignment!
This would even solve a problem I had with UnrealRace, and probably a problem you(sektor) had with your A.I. tweak tool, as you wrote here(viewtopic.php?f=15&t=11324):
Now, it's 7am and still have to go sleep, so maybe that's why I'm having the following question in my mind right now:sektor2111 wrote:The rest of spawning problems are similar with my little tiny A.I. tweak tool. In certain Level (Zone) actors (some types) are not spawning or are immediately in deletion process
ActorA.ActorB = None; is the same of ActorB = None; ?
If yes, at this point I couldn't change the value of ActorB with another actor to change the position of an Actor chain that starts from ActorA, like "ActorA.ActorB = ActorC". Would it change the reference of ActorB into ActorC, or just the value?
"Your stuff is known to be buggy and unfinished/not properly tested"
Re: Is there a way to know if an actor can be replicated?
You clearly didn't read the article. All replication starts with the actor being replicated. WTF are the values replicated to if there's no actor to receive them!?PrinceOfFunky wrote:If an actor has RemoteRole > than ROLE_None, couldn't it just mean it replicates just its variables and probably not itself?
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Is there a way to know if an actor can be replicated?
Wormbo wrote:You clearly didn't read the article
PrinceOfFunky wrote:I did read it all some weeks ago
Why should UT replicate the entire actor if it could replicate just the needed variables? I remember of reading about variables compression, which is used to save bandwith. An engine wouldn't rly need everything of the actor, it could easily save values and replicate them to the client actors, even if the server had no actors. But if you say even the server has the full actor and updates only the replicated variables then ok, but at first it sounds like a waste of space in the server.
"Your stuff is known to be buggy and unfinished/not properly tested"
Re: Is there a way to know if an actor can be replicated?
Replicating an actor means either "hey client, spawn an actor of this class at this location, then let's talk about it on channel number N" or, if the actor is either bStatic or bNoDelete, "hey client, you know this particular actor from the map you currently run? Let's talk about it on channel number N". The client then either spawns the actor of the specified class or just takes the actor as put into the level by the mapper and there you go, a replicated actor.
- sektor2111
- Godlike
- Posts: 6413
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: Is there a way to know if an actor can be replicated?
@Funky...
Man, trust me, I'm not an expert from any kind but trying to work much simple as possible returns peacefully and friendly some understanding around how does engine work. In my theory actor has a lot of values and variables because... Actors are many types with many purposes, one is pawn, another is decoration, another is weapon, another is on purpose for replicate data, they are different having a common root - to be honest, there are accesible some default properties which Editor can alter with insane stupid results, I wouldn't create access at them because it opens ways in screwing Level but it was Epic decision to a nice mooing show. Leaving these, I'm using logs, I read info, I made temporary mutator tools for logging and debugging. Once I found a PathNode in Level (VIA Editor) but Out of Level in Game (VIA Tester - sounds insane but it was True) so I have concluded that Level is badly messed up (DevPath did not work anyway). By creating temporary mutators for logging purpose you figure a lot of problems. Right a few minutes ago I read that vectorial math topic, I'm not sure if all that noise is not useless, my Bots were able to quit hunting items in full load and start hunting player. I'll be I can "convice" a flier Camera to track player but... each of you if wants the hard way I don't have nothing against this coding spree...
Do not forget Actor's PreBeginPlay - there might occur a faster destruction if properties and codes are not done correctly, else if a karmic thing from Level ruins party at beginning then... wait 200 ms for finishing some random "storm", sometimes waiting is more wise than a PostBeginPlay with chances to conflict with another such occurrence.
One of decisions in getting rid of things in several moments without to screw their start is to put them a LifeSpan - it's a sort of sheduled Destroy(). There are ways to try with one single problem: TIME for trying every method, to not mention those with Special constants which needs a different Attack.
Man, trust me, I'm not an expert from any kind but trying to work much simple as possible returns peacefully and friendly some understanding around how does engine work. In my theory actor has a lot of values and variables because... Actors are many types with many purposes, one is pawn, another is decoration, another is weapon, another is on purpose for replicate data, they are different having a common root - to be honest, there are accesible some default properties which Editor can alter with insane stupid results, I wouldn't create access at them because it opens ways in screwing Level but it was Epic decision to a nice mooing show. Leaving these, I'm using logs, I read info, I made temporary mutator tools for logging and debugging. Once I found a PathNode in Level (VIA Editor) but Out of Level in Game (VIA Tester - sounds insane but it was True) so I have concluded that Level is badly messed up (DevPath did not work anyway). By creating temporary mutators for logging purpose you figure a lot of problems. Right a few minutes ago I read that vectorial math topic, I'm not sure if all that noise is not useless, my Bots were able to quit hunting items in full load and start hunting player. I'll be I can "convice" a flier Camera to track player but... each of you if wants the hard way I don't have nothing against this coding spree...
Do not forget Actor's PreBeginPlay - there might occur a faster destruction if properties and codes are not done correctly, else if a karmic thing from Level ruins party at beginning then... wait 200 ms for finishing some random "storm", sometimes waiting is more wise than a PostBeginPlay with chances to conflict with another such occurrence.
One of decisions in getting rid of things in several moments without to screw their start is to put them a LifeSpan - it's a sort of sheduled Destroy(). There are ways to try with one single problem: TIME for trying every method, to not mention those with Special constants which needs a different Attack.
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: Is there a way to know if an actor can be replicated?
I guess even if replicating the entire actor in the server would be a waste of space, it needs to do it since there are variables of an actor that are used to perform some replicated functions, and others that depend on other variables.Wormbo wrote:Replicating an actor means either "hey client, spawn an actor of this class at this location, then let's talk about it on channel number N" or, if the actor is either bStatic or bNoDelete, "hey client, you know this particular actor from the map you currently run? Let's talk about it on channel number N". The client then either spawns the actor of the specified class or just takes the actor as put into the level by the mapper and there you go, a replicated actor.
Anyway, about the problem, I found out that the the AMP disappears when the player dies only if it was in its Inventory, so I guessed it was cause a None assignment to the AMP, but I run this code:
Code: Select all
i1 = Spawn(class'AM_Pickup');
i2 = Spawn(class'AM_Pickup');
i3 = Spawn(class'AM_Pickup');
i1.Inventory = i2;
i3.Inventory = i2;
i1.Inventory = None;
Log(-1@i1.Inventory@i2@i3.Inventory);
i2 = None;
Log(-2@i1.Inventory@i2@i3.Inventory);
Code: Select all
ScriptLog: -1 None DM-Prova.AM_Pickup1 DM-Prova.AM_Pickup1
ScriptLog: -2 None None DM-Prova.AM_Pickup1
I see when a pawn dies its Inventory is set to None and if the pawn gets destroyed, every item from its inventory gets destroyed. But Destroyed() is not called in the AMP and even if the Inventory would be set to None, I have the proof that even if you set an Actor variable to None, the Actor doesn't get deleted from the map.
I'm thinking that weapons get deleted in someway when the pawn dies, only code I read set weapons to None, so this means those weapons still exist in the map? I don't believe so.
EDIT: Into the simulated event Destroyed() from within Pawn.uc there's this line of code:
Code: Select all
for( Inv=Inventory; Inv!=None; Inv=Inv.Inventory )
Inv.Destroy();
EDIT 2: FOUND IT OUT!
Destroyed() wasn't called cause I put the function into a state...
Actually, I didn't know there could have been some callbacks that are not called at all if in a state.
"Your stuff is known to be buggy and unfinished/not properly tested"