Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » JCS & Scripting

Online Event Updating

plunK plunK's Avatar

JCF Member

Joined: Apr 2008

Posts: 514

plunK is an asset to this forum

Jan 27, 2012, 02:02 PM
plunK is offline
Reply With Quote
Online Event Updating

So I am have finished planning work to do some maps again, but I forgot how event updating works online for triggers, scenery, etc. What is Locally updated? What is updated when the Host updates? What is Universally updated. I am curious about:
-Trigger Scenery
-Trigger Crates
-Destruct Scenery
-Bomb Scenery
-Collapse Scenery
-Animations (all players in sync?)
-Exploding TNT crates, or MCE crates that fire lazers?
Sean Sean's Avatar

JCF Member

Joined: Oct 2010

Posts: 720

Sean is a forum legendSean is a forum legend

Jan 27, 2012, 05:40 PM
Sean is offline
Reply With Quote
Trigger Scenery is dependent on whether or not Trigger Crate or Trigger Zone is used. A Trigger Crate, when hit, affects the trigger scenery for all players, including the host (which of course means that all players joining the server thereafter continue to be affected by the trigger), while a Trigger Zone, when touched, only affects the player touching it. I'm guessing why this happens is because a Trigger Crate is spawned as an object, and objects in MP, when taken or destroyed, is updated for everyone in the server.

Destruct Scenery is supposed to be a server wide event, but during many games of Ground Force it's not at all uncommon to see someone standing on air. My guess is that the server sends information about what blocks have been destroyed, the client misses it due to packet loss, then the server stops sending information, leaving blocks available to the client.

My take on the other two Sceneries is that they function more or less the same way as Destruct Scenery. Bomb Scenery is rarely used for actual destruction, but as a wall of sorts to prevent ammo going through walls and taking power ups which are meant to be physically visited.

Animations start when a player loads a level, so these are not in sync.

MCE Events and other generated objects have their presence announced to the clients by the server, and are probably treated like any other object.
__________________
drop by my SoundCloud or something if you want, it's my life's pride

Last edited by Sean; Jan 28, 2012 at 02:48 AM.
Seren Seren's Avatar

JCF Member

Joined: Feb 2010

Posts: 866

Seren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to all

Jan 28, 2012, 01:14 AM
Seren is offline
Reply With Quote
Quote:
Originally Posted by Sean View Post
A Trigger Crate, when hit, affects the trigger scenery for all players, including the host (which of course means that all players joining the server thereafter continue to be affected by the trigger)
This is basically true, but it's worth noting that in JJ2+ you can prevent joiners from receiving host's trigger setting by placing a Special Trigger Zone. Read section 13. of Plus readme to learn more.
Quote:
Originally Posted by Sean
My guess is that the server sends information about what blocks have been destroyed, the client misses it due to packet loss, then the server stops sending information, leaving blocks available to the client.
Just like you, I can only guess, but I don't think the server sends any information about scenery blocks at all. I suppose it only sends information about ammo being launched at some position. However, bullet speed is different locally and globally (you can sometimes notice this in turrets - locally your ammo travels with the fastest velocity possible, but the server and therefore other clients see it travelling with default velocity), which causes different destruct scenery blocks to be hit locally and globally.
Quote:
Originally Posted by Sean
MCE Events and other generated objects have their presence announced to the clients by the server, and are probably treated like any other object.
However, you should still keep in mind that any container-type object (including power ups and shields) can be destroyed locally and clients nor the server don't send information about such objects getting destroyed. It's just what they "think" happened, because they see a bullet hitting a power up. They don't have to realize that, client-side, the power up is 500 tiles further from its original position thanks to local triggers.
__________________

I am an official JJ2+ programmer and this has been an official JJ2+ statement.
Sean Sean's Avatar

JCF Member

Joined: Oct 2010

Posts: 720

Sean is a forum legendSean is a forum legend

Jan 28, 2012, 02:54 AM
Sean is offline
Reply With Quote
Quote:
Originally Posted by Sir Ementaler View Post
This is basically true, but it's worth noting that in JJ2+ you can prevent joiners from receiving host's trigger setting by placing a Special Trigger Zone. Read section 13. of Plus readme to learn more.
This only proves that I should actually start reading readmes.

Quote:
Originally Posted by Sir Ementaler
Just like you, I can only guess, but I don't think the server sends any information about scenery blocks at all. I suppose it only sends information about ammo being launched at some position. However, bullet speed is different locally and globally (you can sometimes notice this in turrets - locally your ammo travels with the fastest velocity possible, but the server and therefore other clients see it travelling with default velocity), which causes different destruct scenery blocks to be hit locally and globally.
Haven't you noticed when joining a server hosting some of the original Battle levels, blocks that have already been destroyed are not shown as being 'there'? This most likely hints to the actual state of the block being sent, as opposed to or as well as the ammo being shot.

Quote:
Originally Posted by Sir Ementaler
They don't have to realize that, client-side, the power up is 500 tiles further from its original position thanks to local triggers.
Ahahahahahahahah.
__________________
drop by my SoundCloud or something if you want, it's my life's pride
Seren Seren's Avatar

JCF Member

Joined: Feb 2010

Posts: 866

Seren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to all

Jan 28, 2012, 08:06 AM
Seren is offline
Reply With Quote
Quote:
Originally Posted by Sean View Post
Haven't you noticed when joining a server hosting some of the original Battle levels, blocks that have already been destroyed are not shown as being 'there'? This most likely hints to the actual state of the block being sent, as opposed to or as well as the ammo being shot.
While joining, you generally receive more information than usually. But since you said it and I wasn't sure, I checked experimentally and I'm right, during the game clients don't receive any information about scenery getting destroyed. It works in the same way as with container-type objects.
__________________

I am an official JJ2+ programmer and this has been an official JJ2+ statement.
minmay

JCF Member

Joined: Aug 2002

Posts: 1,186

minmay is immeasurably awesomeminmay is immeasurably awesomeminmay is immeasurably awesomeminmay is immeasurably awesomeminmay is immeasurably awesome

Jan 28, 2012, 03:05 PM
minmay is offline
Reply With Quote
Quote:
Originally Posted by Sir Ementaler View Post
This is basically true, but it's worth noting that in JJ2+ you can prevent joiners from receiving host's trigger setting by placing a Special Trigger Zone. Read section 13. of Plus readme to learn more.
read this and was like "crap, i forgot about this, i'd better edit Solar so it uses it for that coin warp trigger falling powerup thing"

then i opened it in jcs and realized i had already done it like 5 months ago and forgotten about it

forgetting things makes me feel bad
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT -8. The time now is 08:54 PM.