Lockgo Posted July 18, 2014 Posted July 18, 2014 Hi everyone, I was thinking trying my had at moding the force powers a bit. Specifically force push/pull, and grip. Specifically how they interacted with items and ragdolls. For example, ammo boxes and med-pacs could be moved around with push and pull, but they always did this weird rotation thing where it looks like it was having a seizure, and after it landed it would always land on its side. The same side mind you, no matter how it fell. Also, with fallen enemy bodies, if you used grip on them, there was a chance they legs would go right through the floor. Any idea where in the code I could look at to edit it? Smoo likes this
Lockgo Posted July 18, 2014 Author Posted July 18, 2014 g_misc.c maybe?w_force.c probably? Smoo likes this
Futuza Posted July 19, 2014 Posted July 19, 2014 Well preventing clipping would be pretty hard since I can't really think of a way that you could do it without writing your own physics/collision engine. w_force.c sounds like the right one for force powers, but not physics.
Xycaleth Posted July 19, 2014 Posted July 19, 2014 For falling items, look in g_exphysics.c. For ragdoll, you want to look in the cgame folder - I think it was in cg_players.c. Futuza likes this
Tempust85 Posted July 19, 2014 Posted July 19, 2014 I wonder how far one can push JKA's current physics or whatever it is that's in there. Broadsword is interesting, though the bones need limits so you don't have twisted joints.
ensiform Posted July 20, 2014 Posted July 20, 2014 I had item pushing in my mod years ago. I forget where I got it from. } else if ( em_itemPush.integer && CheckPushItem( push_list[x] ) ) { //rolling and stationary thermal detonators are dealt with below if ( push_list[x]->item->giType == IT_TEAM ) { push_list[x]->nextthink = level.time + CTF_FLAG_RETURN_TIME; push_list[x]->think = ResetItem;//incase it falls off a cliff } else { push_list[x]->nextthink = level.time + 30000; push_list[x]->think = ResetItem;//incase it falls off a cliff } if ( pull ) { //pull the item push_list[x]->s.pos.trType = TR_GRAVITY; push_list[x]->s.apos.trType = TR_GRAVITY; VectorScale(forward, -650.0f, push_list[x]->s.pos.trDelta); VectorScale(forward, -650.0f, push_list[x]->s.apos.trDelta); push_list[x]->s.pos.trTime = level.time; // move a bit on the very first frame push_list[x]->s.apos.trTime = level.time; // move a bit on the very first frame VectorCopy( push_list[x]->r.currentOrigin, push_list[x]->s.pos.trBase); VectorCopy( push_list[x]->r.currentOrigin, push_list[x]->s.apos.trBase); push_list[x]->physicsObject = qtrue; push_list[x]->flags |= FL_BOUNCE_HALF; } else { push_list[x]->s.pos.trType = TR_GRAVITY; push_list[x]->s.apos.trType = TR_GRAVITY; VectorScale(forward, 650.0f, push_list[x]->s.pos.trDelta ); VectorScale(forward, 650.0f, push_list[x]->s.apos.trDelta ); push_list[x]->s.pos.trTime = level.time; // move a bit on the very first frame push_list[x]->s.apos.trTime = level.time; // move a bit on the very first frame VectorCopy(push_list[x]->r.currentOrigin, push_list[x]->s.pos.trBase); VectorCopy(push_list[x]->r.currentOrigin, push_list[x]->s.apos.trBase); push_list[x]->physicsObject = qtrue; push_list[x]->flags |= FL_BOUNCE_HALF; } There's a bit more to it than that, and other stuff that but is general idea of how to actually move them. Smoo likes this
Xycaleth Posted July 20, 2014 Posted July 20, 2014 I'm pretty sure it was just a one or two line change when I added it for my jk2 mod o.O. Smoo likes this
Lockgo Posted July 21, 2014 Author Posted July 21, 2014 Last thing I want to do is rewrite the entire physic engine, since from what I read, would be a huge undertaking. I would be happy with say, if random rock debri worked like it did in the original Jedi Knight's Sith engine.
Xycaleth Posted July 21, 2014 Posted July 21, 2014 No. Or at least, in a very limited fashion I think. Server can tell players to go into ragdoll, but that's it?
Lockgo Posted July 21, 2014 Author Posted July 21, 2014 Where would be a good place to look for the items, when they rotate in mid flight? I just want to see if I can put a set landing position, instead of how they always land on the ground on the side. or does g_exphysics.c cover that too?
ensiform Posted July 22, 2014 Posted July 22, 2014 You shouldn't even need to deal with g_exphysics.c for moving of items with relation to force powers. That could be your issue right there if you have weird things going on if you are.
eezstreet Posted July 22, 2014 Posted July 22, 2014 Ragdolls are handled 100% in cg_players.c as I recall. EDIT: *for players Smoo likes this
Lockgo Posted July 22, 2014 Author Posted July 22, 2014 You shouldn't even need to deal with g_exphysics.c for moving of items with relation to force powers. That could be your issue right there if you have weird things going on if you are.Its actually in base JA, its a weird thing the game always did. The moment you move shield/ammo box/guns, the game has them "land on their side" and as they are flying, they basically rotate on a set path. From how I see it, it was a good enough illusion the game did as long as you didn't look to hard at it. since the items flying in the air won't even be in the air for longer then a second, and no one really will look at ammo boxes/guns on the ground since when you get close enough you automatically pick them up.
Stoiss Posted July 22, 2014 Posted July 22, 2014 @@Xycaleth would your old project like this not be a lot easyer to inplant now after the full source has come out ? Smoo and Tempust85 like this
Lockgo Posted July 22, 2014 Author Posted July 22, 2014 That looks amazing. That was pretty much what I wanted to do. @@Xycaleth would your old project like this not be a lot easyer to inplant now after the full source has come out ? Smoo likes this
Xycaleth Posted July 22, 2014 Posted July 22, 2014 Easier, yes. Easy, no there's a whole load of issues with overloading the net code when too many things are moving about which I came across, and it's a lot of work to get a really good level of integration between the physics engine and the game itself :/ Smoo and Lockgo like this
Stoiss Posted July 22, 2014 Posted July 22, 2014 you say the net code as it is a issue, can't it not be redone so it could handle it, its been seeing in some of the Q3 source codes where it has been done, Xreal engine and some other i can't remember the names of
Xycaleth Posted July 22, 2014 Posted July 22, 2014 As far as I know, none of the Q3 engine derivatives have made any extensive changes that would support massive number (e.g. 50+) objects all moving at the same time in one area. And I personally don't know what would need doing to allow this either. I'm sure there are games that have done it, but I've not really looked into it. Smoo likes this
Stoiss Posted July 22, 2014 Posted July 22, 2014 my mistake I did not mention that we talked about having to have 50 different things on a map at a time, believed just xreal could lower this sort of thing since they've thrown some sort of physics engine in the game
ensiform Posted July 22, 2014 Posted July 22, 2014 XreaL had experimental bullet support in its java version of the mod code, but it wasn't really going anywhere. Not even networked. @@Lockgo do you have a video to explain the weirdness you are seeing? I don't really see any reason to be dealing with g_exphysics at all on item pickups. As they already have a think function which also already does simple normal physics as it is. Smoo likes this
Lockgo Posted July 23, 2014 Author Posted July 23, 2014 I can make a video later on, I can't at the present moment, but its just something that always existed in Jedi Academy. Basically the object would rotate around one direction, the same direction, on its side, and then it will always land on its side, with half the object going through the floor. Probably where the model "center" was. This always looked strange to me, especially since med packs have that trapezoid shape. Just load game in single player, and force pull a medpack and watch it spin and land. Doesn't have to be a medpack, any item should do, just most noticeable with medpacks. This isn't an issue in multiplayer, since they just bounce around like balls. Which of course is because the MP engine doesn't do half the stuff the SP engine does. Xycaleth, do you need help porting your code?
Xycaleth Posted July 23, 2014 Posted July 23, 2014 I never intended to port my code if you're interested in trying or just to have a look at the code, search for "japhys source code" on google and you should find it pretty easily. It's hosted on google code. Smoo likes this
ensiform Posted July 23, 2014 Posted July 23, 2014 I can make a video later on, I can't at the present moment, but its just something that always existed in Jedi Academy. Basically the object would rotate around one direction, the same direction, on its side, and then it will always land on its side, with half the object going through the floor. Probably where the model "center" was. This always looked strange to me, especially since med packs have that trapezoid shape. Just load game in single player, and force pull a medpack and watch it spin and land. Doesn't have to be a medpack, any item should do, just most noticeable with medpacks. This isn't an issue in multiplayer, since they just bounce around like balls. Which of course is because the MP engine doesn't do half the stuff the SP engine does. Xycaleth, do you need help porting your code?Yes I know how it looks in SP. Doesn't mean you have to do it that way in MP. As previously mentioned You obviously want items to return to their place if not dropped in MP
Lockgo Posted July 24, 2014 Author Posted July 24, 2014 Yes I know how it looks in SP. Doesn't mean you have to do it that way in MP. As previously mentioned You obviously want items to return to their place if not dropped in MP In MP, I think I would just have any item that is "moved" to simply move back to its original position if left untouched, like it does normally, as well as have it respawn back if its falling for too long. "Endless pits". I never intended to port my code if you're interested in trying or just to have a look at the code, search for "japhys source code" on google and you should find it pretty easily. It's hosted on google code.Alright I will.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now