Author Topic: Carrying players  (Read 8755 times)

rotacak

  • Posts: 761
  • Turrets: +39/-64
Carrying players
« on: June 14, 2008, 01:29:28 am »
Hi,
I trying two days figure out how to do this thing:
I have entityNum. But I need also entityNum coordinates (vectors). Can someone help me? How to obtain coordinates when I know only entityNum in bg_pmove.c?

Any help will be really appreciated.
« Last Edit: September 09, 2008, 04:49:44 pm by rotacak »

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: How to obtain entity vectors?
« Reply #1 on: June 14, 2008, 06:41:02 pm »
(gentities + entityNum)->s.pos or something, there's about 6 different positions and i can't remember how they differ atm.
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

rotacak

  • Posts: 761
  • Turrets: +39/-64
Re: How to obtain entity vectors?
« Reply #2 on: June 14, 2008, 11:59:06 pm »
Quote
(gentities + entityNum)

?
I can this: gentity_t *some = &g_entities[ entityNum ]; and then some->client->ps.blah.
But no in bg_pmove.c. There can't use gentity_t even g_entities.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: How to obtain entity vectors?
« Reply #3 on: June 15, 2008, 12:15:41 am »
you'll have to be more specific than bg_pmove.c in that case.
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

rotacak

  • Posts: 761
  • Turrets: +39/-64
Re: How to obtain entity vectors?
« Reply #4 on: June 15, 2008, 11:43:49 am »
For example in function PM_WalkMove().

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: How to obtain entity vectors?
« Reply #5 on: June 15, 2008, 08:34:34 pm »
pm->ps->...
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

rotacak

  • Posts: 761
  • Turrets: +39/-64
Re: How to obtain entity vectors?
« Reply #6 on: June 15, 2008, 11:10:57 pm »
Yes, but that is current player. I need this (current player) and one next (another player). And all what I know about another player is his entity number. Need create working another->ps->...

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: How to obtain entity vectors?
« Reply #7 on: June 16, 2008, 03:12:06 am »
why would your own movement depend on the movement of another player?
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

rotacak

  • Posts: 761
  • Turrets: +39/-64
Re: How to obtain entity vectors?
« Reply #8 on: June 16, 2008, 11:48:16 am »
I want to carry another player.

Before I tryed copy velocity from bottom player to on top player. But player on top walking very slowly (I know why, but don't know how to resolve) and when bottom player move zhen on top player slowly losing position and then fall down. And that moving was not fluent.

Now I trying use mover function not only on moving platforms, but also on players, but still it work bad. Carrying work ok, but I can't stand on top other player. I still moving and then fall from player. Don't know why (where comming from that moving speed) :-(

If you know better solution, type it here please.

BTW, it's there any reason why on default players can't carry others players?

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: How to obtain entity vectors?
« Reply #9 on: June 16, 2008, 10:38:21 pm »
because the code is complicated and there is little benefit. you won't be able to make players move smoothly unless you also package a cgame that has the matching version of pmove().
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Lakitu7

  • Tremulous Developers
  • *
  • Posts: 1002
  • Turrets: +120/-73
Re: How to obtain entity vectors?
« Reply #10 on: June 17, 2008, 05:17:33 am »
Risujin shared that dream and gave it up for what kevlarman is saying. His barely-working hacky solution involved setting the friction really high in such cases, from what I remember. Doing it properly is very hard-impossible because pmove is really isolated from all other information.

I too would like to be a dretch gloriously riding a charging tyrant into a base, though. :)

rotacak

  • Posts: 761
  • Turrets: +39/-64
Re: How to obtain entity vectors?
« Reply #11 on: June 17, 2008, 12:56:13 pm »
Hmm, too bad. But like I said, I trying use players like movers (g_mover.c). In that case it looks good. Probably can't carry players when player-mover walking on slope or stairs, also tyrant can't fly on dragoon's head or even player not copy movers jump, but carrying on flat place should work.

But look at this demo: http://www.mediafire.com/?t0okz0rdxf4 Why I still sliding on top of granger? On moving platform not sliding, but on player yes :-( There must be somewhere still difference between player and mover, but I don't know where.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: How to obtain entity vectors?
« Reply #12 on: June 17, 2008, 06:41:47 pm »
Hmm, too bad. But like I said, I trying use players like movers (g_mover.c). In that case it looks good. Probably can't carry players when player-mover walking on slope or stairs, also tyrant can't fly on dragoon's head or even player not copy movers jump, but carrying on flat place should work.

But look at this demo: http://www.mediafire.com/?t0okz0rdxf4 Why I still sliding on top of granger? On moving platform not sliding, but on player yes :-( There must be somewhere still difference between player and mover, but I don't know where.
you can predict the movement of a mover, you can't predict the movement of another player.
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

blood2.0

  • Guest
Re: How to obtain entity vectors?
« Reply #13 on: June 20, 2008, 08:10:35 am »
why can you clime on doors and elevators just make it so you can clime on a tyrants like you can on elevators

UniqPhoeniX

  • Spam Killer
  • *
  • Posts: 1376
  • Turrets: +66/-32
Re: How to obtain entity vectors?
« Reply #14 on: June 20, 2008, 09:23:08 am »
why can you clime on doors and elevators
WRONG

Quote
If blood2.0 keeps making topics in the mod section, his karma is probably going to end up rolling past negative infinity into the positives...
TRUE

Lakitu7

  • Tremulous Developers
  • *
  • Posts: 1002
  • Turrets: +120/-73
Re: How to obtain entity vectors?
« Reply #15 on: June 20, 2008, 10:04:39 am »
why can you clime on doors and elevators just make it so you can clime on a tyrants like you can on elevators

Read kevlarman's post again. The game reduces the appearance of lag by having your client "predict" (guess) where players and other moving things are between server frames ("snaps"). If you can't reliably predict where other players are, that makes them warp around. If you can't reliably predict where YOU are, then YOU warp around. If you climb on a tyrant, then you cannot predict where you are because it depends on where they are, which is something you can't predict. Doors and elevators, however, move in a particular way that's the same every time and thus can be predicted.

rotacak

  • Posts: 761
  • Turrets: +39/-64
Re: How to obtain entity vectors?
« Reply #16 on: June 20, 2008, 12:27:27 pm »
Anyway, can someone help me with that sliding? I know, prediction, but maybe it will be atleast a little usable. On server "Unlimited Funserver" was allowed build structures one on each other, it was buggy, hitbox was somewhere else that model, but even that was fun there.

My second attemp was add my velocity to player on my head. But I don't know how to compute addition for his velocity. So I completely copyed my velocity and that cause moving on someone's head very very slow (because I accelerate player = little step, then copy velocity from bottom player = accelerate is zero). But this attemp is more bad than using movers functions, player on top losing track of player bottom. And moving is not fluent like in mover solution.

This moving, one or second solution, is probably not for regular game, because even without bad prediction, you cant go on stairs, slopes and you can't jump if you have someone on own head. That cause bad moving, bad rushing and bad escaping. Also probably you can't for example kill human, who standing on tyrant or goon out of your slash range.

On the other hand, it is good for very fun games, where dretch can carry granger for faster escape etc. Btw, this carrying would be good for some mod, in mod it is possible to code it, isn't? With good prediction, moving everywhere even with walls, jumping with goon etc.

So if you can help me how to resolve that sliding problem (somewhat decrese that sliding move to zero or something) or how to add (not copy) velocity addition to player, I will not waste three days absolutely for nothing.

That sliding behaviour is easy to produce. Just open g_main.c, seek line "if( ent->s.eType == ET_MOVER )" and change it to "if( ent->s.eType == ET_MOVER || ent->s.eType == ET_PLAYER )" and it is.
« Last Edit: June 20, 2008, 12:31:17 pm by rotacak »

Lakitu7

  • Tremulous Developers
  • *
  • Posts: 1002
  • Turrets: +120/-73
Re: How to obtain entity vectors?
« Reply #17 on: June 20, 2008, 06:14:08 pm »
I don't know that Risujin had the same specific "sliding" problem, but his solution to the overall goal was jacking up the friction in such a situation, so perhps you should do that.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: How to obtain entity vectors?
« Reply #18 on: June 20, 2008, 06:17:44 pm »
why can you clime on doors and elevators just make it so you can clime on a tyrants like you can on elevators

Read kevlarman's post again. The game reduces the appearance of lag by having your client "predict" (guess) where players and other moving things are between server frames ("snaps"). If you can't reliably predict where other players are, that makes them warp around. If you can't reliably predict where YOU are, then YOU warp around. If you climb on a tyrant, then you cannot predict where you are because it depends on where they are, which is something you can't predict. Doors and elevators, however, move in a particular way that's the same every time and thus can be predicted.
the client only predicts its own movement.
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----