Game Development Community

Approximating gravitational interactions

by David Ravel · in Torque Game Engine · 10/11/2009 (4:37 pm) · 2 replies

Hi,

I'm hoping to make a small game featuring objects interacting along a flat plane, exerting forces on each other similar to gravitational effects. I want these objects (a couple dozen moving on and off the screen would be ideal) to exert these forces on each other, changing their relative velocities, and falling into things resembling orbits around each other. I'm not aiming for accuracy here, and I would plan on exaggerating and approximating the results of these effects quite a bit for game play's sake. To keep things from becoming static once everything settled into a stable spatial relationship I'd have an additional force manipulating these object, an additionally ability to effect changes of velocity. The player's object (he would just be one of these many) would possess this ability to change his velocity and move against the grain of the influence of mass. Other objects would make use of this ability on occasion to move themselves off in different directions.

The analogy at work here is that the objects represent humans in their movement through the social sphere. The gravity exerted by their mass would represent their natural, unconscious movements and tendencies. The ability to exert some additional force than this, to be able to move independently (the object would still be under gravities effects, offset by this movement.) would more represent conscious movement.

I'm not really sure how to proceed, as I am a game designer and scripter, and although I am familiar with TGB a bit I'm not enough of a programmer to be able to figure this out on my own. I was hoping if anybody could point me in the right direction so I could at least communicate intelligently while finding a programmer to contract this out to.

PS. Would this work best on TGB or TGE? I have an indie TGB license, and since I only require a 2d space to do this I thought it might work, but I was hoping some of you TGE programmers could enlighten me as to the benefits and problems of proceeding either way.

Thanks a lot for any help you guys can offer,

Dave

#1
10/11/2009 (6:25 pm)
I can't say much about coding in TGB, but I would be surprised if you weren't basically making the same modifications to whichever engine you chose - you'd have to add logic to an existing class, or create a new class, that has the gravitational forces you're aiming for. Your choice of TGE/TGB should be based on which engine you like better for rendering, whether you want to do any 3D in the future, etc. Though from my experience with TGE/A (not sure about T3D), it'd probably be much easier to do a 2D 'game' in TGB, since that's what it's designed for. The 2D stuff in TGE/A is all oriented towards menus and HUDs.
#2
10/11/2009 (7:09 pm)
thanks, I think I'll continue this in the TGB thread. If it's quite doable in TGB that'd be very much preferred; I wouldn't have to buy another license.