Game Development Community

Orrery

by Arch Stanton · in Torque Game Builder · 12/15/2005 (2:46 pm) · 3 replies

It seems to me that the crux of research for t2d is in searching, and I can't seem to find the proper phrases for the things I need.. Looking forward to the wiki's expansion.

I am trying to implement a combination game clock and physics simulation in the form of a solar system that should ultimately exist outside a scenegraph. The idea though is to be able to both affect it -- with play, pause, slow, and fast controls -- and to render it when needed by combination if its own AU scale X,Y with that of the scenegraph. I'm looking for code examples (or other advice) of anything remotely similar, untying gamelogic from physics, turn-based games, etc.

#1
12/16/2005 (12:12 pm)
Doi?

I have some input, don't worry.

Have you modelled the solar system in T2D objects yet? I saw a post around here somewhares...

Once you have that you can use schedule to do the movement... Just with .setPosition? Or even set the position and the velocity.

You could mount the objects....

HINT: Melv: Constraints?

i.e.

Pause = no command.

Play = schedule(100, 0, "updateScene");

Fast = schedule(50, 0, "updateScene");

function updateScene()
{
    // Stuff here!
    $planet1.setPosition("X Y");
    $planet1.setVelocity("Xv Yv");
}

Can't help you with the math, 'cos Im still studying for my GCSEs.
#2
12/16/2005 (4:54 pm)
I hadn't seen setVelocity yet.. can't find it in the ReferenceGuide even. Is it in the alpha?
I think I have a grasp on the math right now, but I've been having trouble designing the functions guiding the solar system. I was initially going to make it derive from sceneObject, but I don't need the gamephysics or to render anything directly. I'm looking at scriptObject now, but I'm not sure it's what I need either. It's a question of inputs and outputs, how to reference them from script, etc.
#3
12/16/2005 (11:33 pm)
Look in the docs/ directory for the API reference and some tutorials.

Just an observation, but if you're doing all this from C++ it's going to be a steeper learning curve than if you do it in script.