Gravity Entity
-
- Posts: 2237
- Joined: Sat Mar 12, 2005 10:49 pm
Gravity Entity
So, after seeing SO many questions about gravity in Q3 and how to walk on walls etc I decided that Im going to make a small mod removing the default gravity and creating gravity entities that can be placed in the map with settings much like the lights.
When you get close to one gravity entity you'll detach from the last entity and attach to the new one whose angle (set in the map editor) will determine if your standing sideways, upside down, or right side up.
I wont be able to start work on this for quite some time though due to the fact that my computer access is quite limited at the moment.
When you get close to one gravity entity you'll detach from the last entity and attach to the new one whose angle (set in the map editor) will determine if your standing sideways, upside down, or right side up.
I wont be able to start work on this for quite some time though due to the fact that my computer access is quite limited at the moment.
-
- Posts: 2237
- Joined: Sat Mar 12, 2005 10:49 pm
-
- Posts: 2237
- Joined: Sat Mar 12, 2005 10:49 pm
Are you going to add gravity vectors of surfaces that influence players/items simultaneously then? That might get quite complicated/cpu heavy. Just wondering how you would handle situations where you approach multiple surfaces with different gravity parms under an angle, like this:

It would be funny if grenades would be influenced by gravity too btw.
I played a mod that could change the nade speed, which i changed to
It would be funny if grenades would be influenced by gravity too btw.

-
- Posts: 2237
- Joined: Sat Mar 12, 2005 10:49 pm
glad you asked. Excellent drawing btw. It's almost exactly what I'm going for but there's a slight difference.

The entity is adjustable much like a light. The circumference will determine the area of pull by the entity much like it determines amount of light for the light entity.
The entities will be drawn to this gravity source.
When two gravity "nodes" have areas that overlap that's where the surface params should come in.
The surface params will determine which node the player (and all the child projectiles fired at the time) will be affected by and which nodes will be ignored.
The child projectiles will be independent of the parent when the parent switches to a new surface param so it will continue to follow the rules of the node the parent was on when it was fired.
however, now that I just thought of that the real reason Im going about this mod is to make magnetic boots for a larger project Im working on. If this is the case then the gernades should just all obey the regular gravity and drop to the ground.
Hmmm.... damn I have to think that one through hehe. Maybe Ill make two mods, one where the projectiles will pass into sepearate zones and adhere to the gravity node assigned to that zone so one minute it will go straight down then suddenly fly left lol. That would be pretty interesting.
Alright well I gotta run. Food to eat and work to do
Cya,
Silicone_Milk

The entity is adjustable much like a light. The circumference will determine the area of pull by the entity much like it determines amount of light for the light entity.
The entities will be drawn to this gravity source.
When two gravity "nodes" have areas that overlap that's where the surface params should come in.
The surface params will determine which node the player (and all the child projectiles fired at the time) will be affected by and which nodes will be ignored.
The child projectiles will be independent of the parent when the parent switches to a new surface param so it will continue to follow the rules of the node the parent was on when it was fired.
however, now that I just thought of that the real reason Im going about this mod is to make magnetic boots for a larger project Im working on. If this is the case then the gernades should just all obey the regular gravity and drop to the ground.
Hmmm.... damn I have to think that one through hehe. Maybe Ill make two mods, one where the projectiles will pass into sepearate zones and adhere to the gravity node assigned to that zone so one minute it will go straight down then suddenly fly left lol. That would be pretty interesting.
Alright well I gotta run. Food to eat and work to do

Cya,
Silicone_Milk
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Re: Gravity Entity
Nothing like bumping a topic that's been dead for over two years. Did you ever get this to work? I was tinkering with something quite similar (but volumes instead of entities). Got the physics working fine but I ran into a rather major shortcoming: I can't for the life of me get models to render but top down. It's like that movie 'It', everyone is floating down here.
-
- Posts: 2237
- Joined: Sat Mar 12, 2005 10:49 pm
Re: Gravity Entity
That's beyond weird. I just dug this thread up and was having a nostalgic moment last week.
I never even put down a single line of code on this. Still quite an interesting idea in my opinion.
Why have you decided to go with volumes (zones? more manageable than a ton of entities?) rather than entities?
I never even put down a single line of code on this. Still quite an interesting idea in my opinion.
Why have you decided to go with volumes (zones? more manageable than a ton of entities?) rather than entities?
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Re: Gravity Entity
It's easier for the mapper because he/she can clearly lay out the area of gravity. With entities, you're stuck with trial and error.
Re: Gravity Entity
Oh yeah, I remember this one.
Many years ago now a friend of mine was working on something like this. As I recall, one of the biggest problems he ran into was getting the players' axis-aligned bounding boxes to be the right shape and orientation (such as AABB have one) for any given gravity surface.
However the big difference now is that we have full source access, so it's definitely possible. Tremulous has some sort of wall-walking implementation for their little running aliens, but I'm not sure how full-fledged it is.
I considered doing something like this for my project, but figured I'd run into some beastly math at some point and get discouraged. Best of luck if you decide to try it!
Many years ago now a friend of mine was working on something like this. As I recall, one of the biggest problems he ran into was getting the players' axis-aligned bounding boxes to be the right shape and orientation (such as AABB have one) for any given gravity surface.
However the big difference now is that we have full source access, so it's definitely possible. Tremulous has some sort of wall-walking implementation for their little running aliens, but I'm not sure how full-fledged it is.
I considered doing something like this for my project, but figured I'd run into some beastly math at some point and get discouraged. Best of luck if you decide to try it!
Re: Gravity Entity
I'd be very interested to see what you come up with misanthropia.
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Re: Gravity Entity
I'm pondering this one, right now. I'll see if I can come up with something that works well enough (and doesn't force me to rewrite half the render code; I'm a lazy bum, you see).
-
- Posts: 2237
- Joined: Sat Mar 12, 2005 10:49 pm
Re: Gravity Entity
Isn't that the definition of programming though? Being lazy enough to automate actions? 

Re: Gravity Entity
Did you come up with any ideas for this misantropia?
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Re: Gravity Entity
Sort of. Let's call it a meta idea. :)
It consists of two parts: 1) manipulating the axis[3] field in the refEntity_t of the model, and 2) rendering the three parts of the model - head, torso and legs - at right angles and distances. The first part I got working, the second part needs some straightening out (but I just might get to that later today). If you like, below is a somewhat eerie example of #1. Insert just before the call to trap_R_AddRefEntityToScene() in CG_AddTestModel() (cgame/cg_view.c) and in the console type: /testmodel models/players/doom/head
It consists of two parts: 1) manipulating the axis[3] field in the refEntity_t of the model, and 2) rendering the three parts of the model - head, torso and legs - at right angles and distances. The first part I got working, the second part needs some straightening out (but I just might get to that later today). If you like, below is a somewhat eerie example of #1. Insert just before the call to trap_R_AddRefEntityToScene() in CG_AddTestModel() (cgame/cg_view.c) and in the console type: /testmodel models/players/doom/head
Code: Select all
{
static int pitch = 0, roll = 0;
vec3_t angles;
VectorMA( cg.refdef.vieworg, 20, cg.refdef.viewaxis[0], cg.testModelEntity.origin );
angles[PITCH] = pitch;
angles[YAW] = 180 + cg.refdefViewAngles[1];
angles[ROLL] = roll;
AnglesToAxis( angles, cg.testModelEntity.axis );
pitch = (pitch + 1) % 360;
roll = (roll + 1) % 360;
}
-
- Posts: 2237
- Joined: Sat Mar 12, 2005 10:49 pm
Re: Gravity Entity
Might be interested in this: http://www.xreal-project.net/wordpress/
Wall walking has been implemented and seems to work pretty damn well.
Wall walking has been implemented and seems to work pretty damn well.
Re: Gravity Entity
Anyone played Prey? Walk on walls, gravity changes, localized gravity, etc. Doom3 (id Tech 4) engine, btw... but I don't think it would be all that different from a programming point of view.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Re: Gravity Entity
maybe check out how serious sam does it. that has gravity changing in real time
Re: Gravity Entity
it is just tremulous. nothing new. real shortcoming is the lack of oriented bounding boxes.Silicone_Milk wrote:Might be interested in this: http://www.xreal-project.net/wordpress/
Wall walking has been implemented and seems to work pretty damn well.
not very useful for tall player models
