[QUOTE="ReverieDLM"][QUOTE="ssbfalco"]Nice try. Sure, 10 line of code to say, make the basic effect of gravity, but you say like omg Gravity code, game done. You failed to see that way the gravity in galaxy works is the object with the greatest gravitational pull, also based on distance is the object mario will fall towards. That alone is at least 2-3 seperate systems working together in order to produce the effect of gravity... Gravity depends on many other factors in even a simple game. Landing and chaning animations and current player state (assuming a finite state machine) is a part of making sure graivty works correctly. I don't consider the code that moves an object down to a platform alone the full gravity system... ssbfalco
I don't think you understand what gravity is. Gravity is a force along a vector. One of a large number of forces that are calculated when moving an object in a game (provided it has actual physics). Here's basically how it works: - For each dynamic object in the scene, calculate the force applied on the object from other objects in the scene. This includes: - Objects that have collided with it - Gravity - Other effects (static/kinetic friction from moving walkways, blasts of air, whatever) - Multiply this force by the time slice and add to the current velocity vector to determine what distance the object should move during the frame, and the amount of force on it - Attempt to move the object, if it would collide with another object, first calculate the above two for the object(s) that it would hit to determine the transfer of momentum, and thus the proper final location for the object. Now do you understand why gravity is trivial? It's just a force, and it is one of many that contributes to the movement of the object. How you animate the object once forces have been appplied to it is irrelevent, because you have to animate the object in some way regardless of what physics are involved in its movement.Teufelhuhn(I'll spell that name right eventually...) already showed a simple method for the gravity system, which since that post I came out of rambiling sw mode into "let me think about what I'm actually talking about" mode. It was just that recently I was messing with a crazy system that involved "generating" gravitational fields of varying strength around objects when I was fooling around with a galaxy like gravity system and have the object attracted to the strongest one based off of field strenght...
Basically, taking some stuff I went over in physics ****unncessarally overboard (based off of something a physics fanatic friend of mine said about the gravity system I told him that galaxy had...) Long story short, it kinda worked, but would be useless unless it was rewritten and done in such a way that the fields are essentially "meshes" that can be altered with something, and even then there's probably an easier way of doing it...
Normally, I'd apologize for being so rash (and braindead), but since this is systemwars I'm forced to pretend "ownage" never happened...
I tend to overcomplicate things anyway only to smack myself later realizing that there were much better ways... Stupid box, I can't tell if I'm too far inside, or too far outside...
yeah...
An interesting prospect, actually. Typically, gravity calculations for objects in games are always done assuming a point mass at the center of gravity for the object that has the gravity effect on an object. The problem with this system is that it isn't necessarily accurate. For example, consider this system: ._................................_ |..|............................X|...| |..|_____________|...| |________________| Now, if your character is at position X, standing on the side, then in a typical gravity system, it would actually be pulled off of the surface and onto the floor near the center. In reality, this is probably not what would happen. Actually, in reality, the system would be unlikely to have enough gravity that it would attract you to stand on it in the first place. But let's assume that the object also has extremely high mass. In that case, there's still a pretty high likelihood that you could stand on the edge there because the gravitation forces of the rest of the mass are pretty far away and would likely not be as strong as those for the bit that you're currently standing on. Of course, the typical solution of this is fairly simple. Don't have macro-scale concave geometry :)
Log in to comment