Page 1 of 1

Are dynamic tracks possible?

PostPosted: 16 Jun 2013, 18:27
by alx-9
Hi,

I wanted to ask if it is possible to design a dynamic race track. For example, could the shape of a bridge change during the race, so that it becomes narrower? Or could there be blocked off paths in the track which become unlocked when a certain criteria is met?

Re: Are dynamic tracks possible?

PostPosted: 17 Jun 2013, 02:22
by Auria
Hi,

this is currently very difficult to do. making something that becomes narrower is possible using animations, but AIs will be unaware of it so the will not be able to correctly adapt to the changing width. Unlocking paths is not possible at all at this time; it should eventually happen with scripting but that will take a lot of work so I don't expect STK to have this feature for a little while

Re: Are dynamic tracks possible?

PostPosted: 17 Jun 2013, 15:03
by samuncle
We have already tree examples of interactivity between players and the track.

1) A cannon in fort magma
2) A Haystack in farm
3) A minecart in mine

Check these examples, they will teach you a lot and you can use them as inspiration for your track :)

Re: Are dynamic tracks possible?

PostPosted: 18 Jun 2013, 13:44
by alx-9
In those 3 cases, is the interaction based on the player's position or are they periodic animations? i.e. is for example the haystack triggered by an approaching kart or does it just roll onto the track every X seconds?

Re: Are dynamic tracks possible?

PostPosted: 19 Jun 2013, 02:46
by Auria
They are only periodic animations. There is currently no support to trigger things based on player position

Re: Are dynamic tracks possible?

PostPosted: 20 Jun 2013, 14:07
by hiker
alx-9 {l Wrote}:In those 3 cases, is the interaction based on the player's position or are they periodic animations? i.e. is for example the haystack triggered by an approaching kart or does it just roll onto the track every X seconds?

Atm they are periodic animations.

It would be quite difficult to modify the mesh at runtime (since we would need a new way to specify animations for a mesh, and exporting this into bullet). But adding or removing bullet objects wouldn't be that hard, we could add settings like: "after lap 1" or "before lap 3". For the drivelines we can either (for tracks getting smaller) just use the smaller drivelines from the very beginning, or have similar settings to indicate which drivelines to use in which lap (or which one is enabled/disabled). Getting this triggered by approaching karts would be a bit more work (in terms of how to specify this in blender and in the xml files), stk itself already has most of the infrastructure (check_lines which can detect if they are crossed, and they could be used to trigger certain actions).

But before we do anything like that we need a good track that makes use of this feature, since we don't really have the development resources to code something that's not being used. Even then, with gsoc commencing right now, I can't see us doing this in the next few months ... but having a track using this would certainly help boosting its priority (and perhaps that might even motivate new developers). We would also need to think carefully about the implementation, so that most dynamic track features we can think of can be implemented using the same framework (e.g. are checklines and lap based trigger good enough? Do we need to distinguish between player and non-player karts? If so, what in multi-player, should it be the first or last kart, ...).

Yes, ideally scripting would be nice to have, but as always we need to write the interface for those functions, and it's usually less work to use our existing xml based framework then integrating a scripting engine. Yes, maybe that's short-sighted, but with very limited developer resources that's all we can do. Perhaps next gsoc (if we participate) might be a good timing to think about scripting.

Cheers,
Joerg

Re: Are dynamic tracks possible?

PostPosted: 21 Jun 2013, 03:25
by samuncle
You can also use an approximation to start an animation when the player is at the right position.

For example in Zen Garden, flying lantern start their ascent after ~50 seconds which is the time of one lap. You can never be sure that the player is at the right position but for graphical effects it's ok

Re: Are dynamic tracks possible?

PostPosted: 24 Jun 2013, 02:52
by RaceAce
You can make a hidden shortcut with the opening covered with movable objects-say a stack of boxes. You would need to shoot/hit them to reveal the shortcut.

Re: Are dynamic tracks possible?

PostPosted: 24 Jun 2013, 12:31
by alx-9
Cheers guys, I appreciate the detailed answers.