Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Syncronized Pain...
Syncronized Pain...
2002-01-13, 9:47 AM #1
I've completed my pilotable rockets, only to discover that after hitting my enemy 10 times with the launcher, he only saw 2 hit.. And only took damage from 2 rockets. Obviously, the rockets are way out of sync, but i suppose that happens when you try to make pilotable rockets. How can i keep the rockets in sync as they fly, without causing a ton of lag? They keep changing direction, so i'm not sure if its plausable without flooding the connection.
2002-01-13, 9:55 AM #2
I do believe that one problem is the reason you dont see too many 'piliotable rocket' mods out there.


It can be done, but it will cause lag. LOTS of lag.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-13, 9:59 AM #3
What do you mean? I have it mostly working..
The Rocket looks up its parents headpitch and lookvector using the FireProjectile Trick, and uses that for its new direction... If the players are syncronized, should'nt the rockets all get the same vector?
2002-01-13, 11:23 AM #4
I think part of the problem is Jedi Knight trys to 'predict' where projectiles are going to strike based on intial vector and template velocity. I don't know the solution, hopefully someone here does.

I have 2 computers networked and have tested similar effects before. I often see this:

On the machine not running the controllable missle cog, the missile projectile shoots out travels its normal heading/velocity hits something and destroys itself before any of the new look vectors are used on it. Apparently things can be destroyed on one machine and not on others.

I dont think people using projectiles with 0 intial velocity have had much luck either.

Here's an off the wall maybe screwed up suggestion: Has anyone tried using a walkplayer as the projectile? Or if all walkplayers arent synched then maybe actually using the 'player' as the projectile.
- Wisdom is 99% experience, 1% knowledge. -
2002-01-13, 3:47 PM #5
Really? I say we make this into a challenge to see if anyone can create a guidable rocket weapon that really works.

Rules:
1) Rocket must have onboard camera, So you see from the cameras view.
2) Rocket must be steerable. It seems using the lookvector and headpitch of the player works best, but hey, whatever works.
3) Rocket must be syncronized in multiplay. If the rocket hits somebody, they should see it hit too.
4) Dying, Switching off the weapon, or pressing fire again should cancels the camera mode, and maybe destroy the rocket. (At least turn off its steering...)

There, That sounds good. I managed to make mine steerable, And got it tuned pretty close in multiplay, But i just cant seem to syncronize it right. My rocket will hit somebody, but on their end it shoots just over their head... Anybody who figures it out, let me know...

Good luck!
2002-01-14, 5:00 AM #6
I suppose you could always do:

pulse:
yoink = GetThingPos(weapon);
SendTrigger(-1, blah blah, yoink, blah blah);
return;

trigger:
if(GetSenderID == blah blah)
{
SetThingPos(projectile, yoink);
}

heh. hehe. got lag?
2002-01-14, 6:56 AM #7
Is there some way you can just sync the position and flight vector every second or half a second or something, without flooding the game with lag?
2002-01-14, 8:56 AM #8
Jipe, that would work, unless the new position is outside of the proj's previous sector. If it is, the world would dissolve into HOM... [http://forums.massassi.net/html/frown.gif]

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-14, 9:10 AM #9
cant you just add a bit of code that makes sure that if you hit him locally with the rocket, that he gets the pain message through the code instead of hoping he gets hit on his screen as well?
2002-01-14, 12:44 PM #10
I could.. But then you get into these long raging arguments like:
Player 1: I hit you!
Player 2: No you didnt!
Player 1: Yes i did, I saw it hit!
Player 2: No you did'nt, It missed by a mile!
Player 1: Calling me a liar?
Player 2: No, Its just that... Oh oh...
Player 1: Arrrrggg! Die! Die! *Violently Stabs Player 2*
...

Etc, Etc... Now we dont want that, do we? It would be better to syncronize the rocket, so BOTH players see it hit.
2002-01-14, 1:06 PM #11
The best way I see to do what you want is to send triggers to sync the pos and lvec of the
missile. -I'm working on some code like that for Hellcat's hostage cog.

Send this from the pilot player:
Code:
SendTrigger(-1, 800, VectorX(pos), VectorY(pos), VectorZ(pos), 0);
SendTrigger(-1, 801, VectorX(lvec), VectorY(lvec), VectorZ(lvec), GetThingSector(missile));


And then receive the trigger on the other players' comps:
Code:
trigger:
   if(GetSenderRef() == jkGetLocalPlayer()) Return;

   if(GetSourceRef() == 800)
   {
      syncpos=VectorSet(GetParam(0), GetParam(1), GetParam(2));
   }
   else if(GetSourceRef() == 801)
   {
      synclvec=VectorSet(GetParam(0), GetParam(1), GetParam(2));
      posghost=CreateThingAtPos(LoadTemplate("ghost"), GetParam(3), syncpos, '0 0 0');
      SetThingLook(posghost, synclvec);
      TeleportThing(missile, posghost);
      DestroyThing(posghost);
   }

Return;


That code should work. As of yet, I've only tested this in SP, but it should work. There
may be lag, but it's better than no MP at all. Good luck. [http://forums.massassi.net/html/wink.gif]

BTW, Seifer said you could send vectors as parameters, but it doesn't work; would have
made the code much simpler though. As it is, you have to split the vectors and send each
axis value as a seperate param.

New_Guy: You can't use a walkplayer. As soon as the bogus player is damaged, the game crashes.

[This message has been edited by SaberMaster (edited January 14, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-15, 9:22 PM #12
Yeah , sorry about that .... I guess I saw a vector being sent some where in a trigger and thought that you could.... sorry.

↑ Up to the top!