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 → Netcode
Netcode
2001-07-13, 3:38 PM #1
Is it possible to add some kind of netcode into JK? Like, if you hit someone in MP you really hit him? I'm not asking if it's a good idea, only if it can be done. I didn't find any cogs involving projectiles so i figure that it would require writing a few, so if anyone would have ideas/pointers i'd be happy to listen. Any other help would be great too [http://forums.massassi.net/html/smile.gif]
2001-07-13, 5:18 PM #2
What do you mean? When you punch someone else in MP, you DO actually punch him. For a minute it sounded like if you punch a guy, the physical guy in real life gets hit...then I'd have to call you crazy...
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-07-13, 7:16 PM #3
lmao Emon !
2001-07-14, 1:26 AM #4
I meant that if you see the thing you fired hit the other guy, that the code makes sure the other guy gets hit. Because of the lag in JK that is never the case. Since synching the two players would not be feasible, i was thinking about adding a cog that gets the targetid of the thing that was hit, then applies damage to the target. So, even if the other guy never got hit on his screen he still gets damage cause he got hit on my screen. And please only serious replies, not just weird jokes cause you dont understand anything about lag and netcodes and such.
2001-07-14, 4:53 AM #5
I think some of the replied knows about lags, just not a bit clear in the first post, either for me.

My theory ( or guess or thinking) is that cogs also gets transfered in the network to get the effect done, so if the broadcast for the punch damage (which is some template stuff) doesn't arrive, neither cog has 100% guarantee to reach the clients.

Plus, if you enter a bit laggy game with such net debugger cogs, you may get hit all the time when you think you dodged every projectiles, because all the clients think they hit you, and that may become kind of annoying. You dodged but you never did.

------------------
http://millennium.massassi.net/ - Millennium
2001-07-14, 6:50 AM #6
Forget about punches. I am talking about projectiles (bullets and such) and i think there should be a way to enforce the rule "If you see yourself hit him, you really hit him (with the bullet!!)". I am not asking if it is wise to do so, only how and if it is possible. Sure, it would be harder to dodge bullets but the mod i am making features really fast undodgeable bullets and it really sucks if you have to keep aiming in front of a person.
2001-07-14, 7:19 AM #7
Yes, I think it is possible.
But "lag in game is usual on online games".

Let's talk on how to do.
You have to assign a cog to the certain projectile, and to do so you must edit the template of the projectile which will also lead you to do the enabling custom projectiles in multiplayer method, which can be found on a site in my sig.

In the touched message of the new cog that goes with the projectile, you might want to do the following method.

Code:
touched:

//if touched not on player, go away
if(!(GetSourceType() & 0x400)) return;

//if the shooter of the projectile is on the comp...
if(GetLocalPlayerThing() == GetThingParent(GetSenderRef()))
{
   SendTrigger(GetSourceRef(), uniqueID, damageAmount, damageType, GetThingParent(GetSenderRef()), 0);
}

return;


And in the trigger message of the client's kyle.cog or any cog.

Code:
trigger:

if(GetSourceRef() == uniqueID)
{
   //print("I got you damaged on my comp!");
   DamageThing(GetLocalPlayerThing(), GetParam(0), GetParam(1), GetParam(2));
}
return;


(Change the uniqueID as some whole number)

This is just a method from top of my head at 2AM, so better methods may exist.

The thing is that since the damaged message will not be able to be retrieved since it happens on the client side, you cannot get the exact damage the client inflicts, so you must send a raw damage data to the client ignoring the damage decaying by distance etc.

And I may be wrong on the getsendertype flag.

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited July 14, 2001).]
2001-07-14, 5:18 PM #8
Thank you very much. This might be a good step into making jk more fun to play online [http://forums.massassi.net/html/smile.gif] Games like quake3, Counter-Strike etc. all have some kind of netcode wich enables them to hit the ppl much more easily. I think this might really help in increasing jk playability [http://forums.massassi.net/html/smile.gif]
2001-07-14, 5:22 PM #9
Hey dude, chill! Just joking around a bit. I know what you mean now. I suppose it would be possible, as Hideki descriped, but would probably have side effects that are not worth it. That's kind of what happened in MechWarrior 4. They tried something like that, and warping was terrible (not saying there would be that same side effect). I think they fixed it in a patch..but I bet no one here cares [http://forums.massassi.net/html/smile.gif]

And yes, I DO know about lag and stuff. Just because I can make a joke (whether it's funny or not) and you can't take one doesn't make me stupid.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-07-14, 5:28 PM #10
I just thought of something...if like Hideki said..if that worked, you'd be dodging but you wouldn't. That would be like reverse lag! Inside of you lead-shooting or lead-swining, you'd have to lead-dodge! Woulndt that be interesting...
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-07-14, 5:52 PM #11
Lead dodge!
That's a new tactic!

Lead shoot or dodge, which is harder!?
Sounds equal if both are enabled, but impossible [http://forums.massassi.net/html/smile.gif]

------------------
http://millennium.massassi.net/ - Millennium
2001-07-14, 6:00 PM #12
Acculy i'm in teh beta stages of doingh something like that

Insted what happens is , that on a comp it will get everyone in views ping ( using a dodgy code that may not work ) , then it will set the perosn that your looking at in the real position he is , using the ping ... and a couple of amazing vectors .... It should work , i will get back to you
2001-07-15, 1:50 AM #13
Make sure you do and show us your amazing work.

------------------
http://millennium.massassi.net/ - Millennium
2001-07-15, 2:08 AM #14
sounds interesting, if you have a few example pieces of code or a website or whatever, please post them [http://forums.massassi.net/html/smile.gif]

↑ Up to the top!