[Logo]
 
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
TonysMonstersV5 Replication Help Needed  XML
Forum Index -> UnrealScript, Coding, Mapping, and 3rd party Mods
Author Message
tgroombr

Dominating
[Avatar]

Joined: 11/26/2006 15:05:26
Messages: 211
Location: The Invasion Vault
Offline

Hiya,

I'm not suggesting the monster pack for the server here, I'm just in need of a little help. I've got 1 last bug to squish before V5 is released, and my boot just isn't bug enough to do the job.

Replication Issue, lots of failures.

The bug is in the FireVymishMith monster. When it attacks, it spawns a flame emitter to indicate that it lights the enemy on fire. However, the emitter does not spawn at the rotation of the monster, giving it a weird looking effect.

Don't feel so confident if you do fix it at first, because I've tried lots of things and they haven't worked, but it's always worth a post.

Any help would be greatly appreciated.

Thanks.

The Monster class is attached here and the Flame Emitter class is attached in the next post.
 Filename FireVymishMith.uc [Disk] Download
 Description Fire Vymish Mith Monster.
 Filesize 2 Kbytes
 Downloaded:  581 time(s)


TonyTheSlayer - Medic
TonyTheSlayaneer - Engineer ( Of Course )
TonyTheAssassin - Weapons Master
TonyTheSlaughter - Junkie

Watch out for Rage Rocks Of Infinity +2865196826982165 (No Self-Damage) *

My Skin: http://skincity.beyondunreal.com/?section=models&action=show_infos&id=487
tgroombr

Dominating
[Avatar]

Joined: 11/26/2006 15:05:26
Messages: 211
Location: The Invasion Vault
Offline

Here is the flame class.
 Filename FireVMithFlames.uc [Disk] Download
 Description FireVymishMith flame emitter.
 Filesize 1 Kbytes
 Downloaded:  596 time(s)


TonyTheSlayer - Medic
TonyTheSlayaneer - Engineer ( Of Course )
TonyTheAssassin - Weapons Master
TonyTheSlaughter - Junkie

Watch out for Rage Rocks Of Infinity +2865196826982165 (No Self-Damage) *

My Skin: http://skincity.beyondunreal.com/?section=models&action=show_infos&id=487
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

The best way to track replication problems is by using log statements. That way you can see what is executed on the server, what on the client, and what the values are at that time. So my main recommendation is to stick log statements in, and see what is happening.

I have downloaded the code and had a quick look, but at the moment haven't got the time to download and setup the rest of TonysMonsters to test it. So I don't know what TonyEmitter etc is.

First thoughts are:

function RangedAttack will only get executed server-side (since it doesn't have simulated at the front).

function SpawnFlames will only get executed serverside. It has simulated at the front, so it can be executed clientside, but only if called clientside. Since it is called from RangedAttack it is called only serverside.

FireVMithFlames seems to want to do nothing serverside, and only wants to set the rotation client side. So the rotation probably isn't getting set.

Rotation for an Actor is replicated under certain circumstances:
Code:
 unreliable if ( (!bSkipActorPropertyReplication || bNetInitial) && bReplicateMovement
 	&& ((DrawType == DT_Mesh) || (DrawType == DT_StaticMesh))
 	&& (((RemoteRole == ROLE_AutonomousProxy) && bNetInitial)
 		|| ((RemoteRole == ROLE_SimulatedProxy) && (bNetInitial || bUpdateSimulatedPosition) && ((Base == None) || Base.bWorldGeometry))
 		|| ((RemoteRole == ROLE_DumbProxy) && ((Base == None) || Base.bWorldGeometry))) )
 		Rotation;
 
 

The role for an emitter is normally ROLE_None, which means by default none of the replication clauses will activate. So setting the rotation server side will probably not work.

One thing I normally do under these circumatances is to look for other bits of code that do similar things, and see how they do it. So see how a different directional emitter works (don't re-invent the wheel).

For example, it may be worth looking at how the direction of weapon flashes are set. Typically, something like
if (FlashEmitter != None)
FlashEmitter.SetRotation(Weapon.Rotation);

So it looks like they just call the SetRotation function of the emitter. However, I presume you have tried that and it failed.

Note your emitter either needs to be based on xEmitter, or have bDirectional=true.

Alternatively, look at the DruidsRPG.ArtifactLightningBeam code. There I include the direction in the spawn call

Actor Spawn( class<Actor> SpawnClass, optional Actor SpawnOwner, optional name SpawnTag, optional vector SpawnLocation, optional rotator SpawnRotation ) [native, final]

HitEmitter = spawn(HitEmitterClass,,, (StartTrace + Instigator.Location)/2, rotator(HitLocation - ((StartTrace + Instigator.Location)/2)));
tgroombr

Dominating
[Avatar]

Joined: 11/26/2006 15:05:26
Messages: 211
Location: The Invasion Vault
Offline

Ok Szlat, thanks for the reply.

I set bDirectional to true in the FireVMithFlame emitter properties and edited some lines of code in the Monster. I've used the GainedChild function in an attempt to set the rotation of the emitter by taking the advantage of setting the owner property to itself in the spawn line. However, the problem persists even though the code is much more thorough and cleaner. My last resort would be to try using an XEmitter. I did this before trying to fix it, but the flames would not spawn. Now that I know what I'm doing, I can probably replicate the emitter better.

Here are the revised files.
 Filename FireVymishMith.uc [Disk] Download
 Description
 Filesize 2 Kbytes
 Downloaded:  552 time(s)


TonyTheSlayer - Medic
TonyTheSlayaneer - Engineer ( Of Course )
TonyTheAssassin - Weapons Master
TonyTheSlaughter - Junkie

Watch out for Rage Rocks Of Infinity +2865196826982165 (No Self-Damage) *

My Skin: http://skincity.beyondunreal.com/?section=models&action=show_infos&id=487
tgroombr

Dominating
[Avatar]

Joined: 11/26/2006 15:05:26
Messages: 211
Location: The Invasion Vault
Offline

Emitter flames.
 Filename FireVMithFlames.uc [Disk] Download
 Description
 Filesize 994 bytes
 Downloaded:  545 time(s)


TonyTheSlayer - Medic
TonyTheSlayaneer - Engineer ( Of Course )
TonyTheAssassin - Weapons Master
TonyTheSlaughter - Junkie

Watch out for Rage Rocks Of Infinity +2865196826982165 (No Self-Damage) *

My Skin: http://skincity.beyondunreal.com/?section=models&action=show_infos&id=487
tgroombr

Dominating
[Avatar]

Joined: 11/26/2006 15:05:26
Messages: 211
Location: The Invasion Vault
Offline

Here is TonyEmitter; it seemed like you were puzzled as to what this was.

It's the base emitter I use for all particle effects in the TonysMonsters. It replicates much easier since it has Role_SimulatedProxy.
 Filename TonyEmitter.uc [Disk] Download
 Description
 Filesize 173 bytes
 Downloaded:  573 time(s)


TonyTheSlayer - Medic
TonyTheSlayaneer - Engineer ( Of Course )
TonyTheAssassin - Weapons Master
TonyTheSlaughter - Junkie

Watch out for Rage Rocks Of Infinity +2865196826982165 (No Self-Damage) *

My Skin: http://skincity.beyondunreal.com/?section=models&action=show_infos&id=487
Szlat

Wicked Sick!

Joined: 05/18/2005 18:32:41
Messages: 2124
Location: UK
Offline

If you have changed the role to SimulatedProxy then the standard replication ought to work for the rotation.
So if server side, you call Flame.SetRotation(Rotation), this should get replicated provided
  • you do not have bNetTemporary=true. But be aware setting bNetTemporary=false and SimulatedProxy does incur extra replication overhead. And it shouldn't be necessary as lots of other emitters are directional, and are still Role_none and bNetTemprary=true.
  • you need to have bReplicateMovement=true
  • Base needs to be none, which I expect it is

    I still recommend putting log statements in to find out what is happening. For example, is the GainedChild function just executed serverside? I expect so, but since I can't see where it gets called, I can't say.

    So if you log the rotation when it gets spawned serverside and clientside, are they different?
  • Szlat

    Wicked Sick!

    Joined: 05/18/2005 18:32:41
    Messages: 2124
    Location: UK
    Offline

    The more I think about it, the more I wonder why things are going wrong. Generating emitters is standard code, lots of things do it, a lot of it is directional, and clients draw it with no problem.

    So, the the emitter is generated and visible to the client, but is in the wrong direction.
  • Try running a listen server rather than dedicated+client. Is it correct on the listen server? If still wrong, then not a replication issue.
  • Put a log in to see what rotation the emitter is spawned in. Is this the correct rotation, and does it change as the monster turns. Does the emitter always go in the same absolute direction, or is it always wrong relative to the monster?
  • Try replacing your flame emitter with one we know works - like the lightning one from the lightning rod, and put in the same spawning code. Does this work? If so, change things bit by bit to get back to the current code, and see when it stops working.

    I have a feeling setting bNetTemporary=false and ROLE_SimulatedProxy are the wrong way to go, and will increase network overhead for servers. It ought to work the same way that all the other emitters work.

    Oh, and for emitters, bNotOnDedServer is normally true
  • tgroombr

    Dominating
    [Avatar]

    Joined: 11/26/2006 15:05:26
    Messages: 211
    Location: The Invasion Vault
    Offline

    Just a report on what I data I collected so far.

    The property bReplicateMovement is now true on the emitter.

    On a listen server, the rotation is the same as the monster rotation.
    On a dedicated, it isn't, rather, always facing Rotator(0,0,0).

    Log statements show on the listen server the rotation of the monster.
    On a dedicated server it's always (0,0,0).


    I only have 3 words about this.

    What the heck?!

    I'm about to try the other emitter method to get data on that.

    EDIT: I just did the above with a new XEmitter I created to substitute the current Emitter. It is attached to this post. Again, the same exact stuff happens.
     Filename FireVMithFlamesII.uc [Disk] Download
     Description
     Filesize 707 bytes
     Downloaded:  549 time(s)


    TonyTheSlayer - Medic
    TonyTheSlayaneer - Engineer ( Of Course )
    TonyTheAssassin - Weapons Master
    TonyTheSlaughter - Junkie

    Watch out for Rage Rocks Of Infinity +2865196826982165 (No Self-Damage) *

    My Skin: http://skincity.beyondunreal.com/?section=models&action=show_infos&id=487
    Szlat

    Wicked Sick!

    Joined: 05/18/2005 18:32:41
    Messages: 2124
    Location: UK
    Offline

    Replication is the big pain we have to deal with. Nothing ever works quite as you want. Just keep plugging away at it - eventually you will get there.

    In the back of my mind, I have a concern that we are overcomplicating things. It is just an emitter.

    Have you tried putting in a copy of code from elsewhere that works? For example, copy the code for the lightning rod, and spawn the lightning bolt that gives. See if that works, or still ends up with the wrong rotation.

    Since we know the emitter code works for the rod, this might point out if the problem lies in the emitter or some thing wrong with the circumstances in which it is spawned.

    Note that in the lightning rod (or bolt) there is no bespoke replication code. The emitter gets spawned server side and the clients see it correctly.

    I don't pretend to fully understand replication. But in my understanding, the only replication you can do anything significant about is between the server and the client that owns an object. So for a player, there is a certain amount of data you can replicate about his stuff between him and the server. But not to other players.
    So the emitter has to be spawned on the server, and has to be shown to all the players. There must be certain flags like game relevant or always relevant or something to set so the emitter is shown.
    However, if it requires clientside code to work, that will not run on clients who do not own the object. And the monster is not owned by any of the clients - so I am suprised you are seeing any logs in the UT2004.log? I would expect the logging just to be in the server.log file. Showing that no replication or client side calling is occuring.
    tgroombr

    Dominating
    [Avatar]

    Joined: 11/26/2006 15:05:26
    Messages: 211
    Location: The Invasion Vault
    Offline

    From what I learned from INI, a simulated function does not have to be called from a client to initiate. I think it can be called by the server and run on the client. The spawn flames function is simulated because the clients will be unable to see the flames if it isn't. So it looks like it tends to be this way.

    TonyTheSlayer - Medic
    TonyTheSlayaneer - Engineer ( Of Course )
    TonyTheAssassin - Weapons Master
    TonyTheSlaughter - Junkie

    Watch out for Rage Rocks Of Infinity +2865196826982165 (No Self-Damage) *

    My Skin: http://skincity.beyondunreal.com/?section=models&action=show_infos&id=487
    Szlat

    Wicked Sick!

    Joined: 05/18/2005 18:32:41
    Messages: 2124
    Location: UK
    Offline

    tgroombr wrote:
    From what I learned from INI, a simulated function does not have to be called from a client to initiate. I think it can be called by the server and run on the client. The spawn flames function is simulated because the clients will be unable to see the flames if it isn't. So it looks like it tends to be this way. 
    Let me try and clear up a common misconception.
    If a function does not have simulated on it, it will only run on the server.
    If a function has simulated on it, it could possibly be executed on the client if everything else is correct. Or it could run on the server. Or both. Or neither.
    Very very simply, a simulated function runs on the client if it is called from a simulated function running on the client, or if it is defined in a replication block as to run on the client, and the context of the calling function allows it to be called on the client. There is a huge list of conditions to satisfy before the function will get called on the client.

    However, remember that "the client" is the owner of the object - in this case the monster. And that is a pure server based object. You cannot call a client side function on every client.

    So, my recommendation is to forget trying to call anything clientside. Instead, try to spawn the emitter on the server pointing in the correct direction. There will be some flags to set, and the role needs to be set correctly in order for clients to see it correctly, but you have examples in the lightning bolt etc to follow. Have you tried using an existing directional emitter yet?
    tgroombr

    Dominating
    [Avatar]

    Joined: 11/26/2006 15:05:26
    Messages: 211
    Location: The Invasion Vault
    Offline

    Ok.

    I tried using a part of code from another class that works. (RedeemerProjectile spawning the trail.)
    FAILURE.

    I tried spawning another emitter class that works. (GoopSmoke and RedeemerTrail)
    FAILURE.

    I tried setting the SpawnVecA property as seen in the lightning rod.
    FAILURE.

    This is really starting to drive me up the wall now.

    EDIT: Now I've tried this method.

    I tried setting a custom vector variable in the Flame class that will change the mSpawnVecA property after replication of the data is received from the spawn class.
    FAILURE.

    NOW I'm mad.

    TonyTheSlayer - Medic
    TonyTheSlayaneer - Engineer ( Of Course )
    TonyTheAssassin - Weapons Master
    TonyTheSlaughter - Junkie

    Watch out for Rage Rocks Of Infinity +2865196826982165 (No Self-Damage) *

    My Skin: http://skincity.beyondunreal.com/?section=models&action=show_infos&id=487
    fallen7x7

    Killing Spree

    Joined: 08/20/2010 14:57:13
    Messages: 62
    Location: uk
    Offline

    im not a big scripting fan but u could look at yr v4 monster pack and see the relicatin wat evar or just change the proj class also my prob is when i make a ability i add it to the ini and that crap thing dont show up eve when druidsrpg is disabeld wth??? asking for ages

    1 word
    whattheheck
    Jefe

    Godlike
    [Avatar]

    Joined: 11/05/2008 22:52:53
    Messages: 361
    Offline

    fallen7x7 wrote:

    1 word
    whattheheck  


    Ditto when i read your posts.



    The new DC server:
     
    Forum Index -> UnrealScript, Coding, Mapping, and 3rd party Mods
    Go to: