Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Wheels and rails for train?

Author
Message
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 24th Feb 2008 01:25
If I were going to simulate a train with rails and wheels - how would you suggest that I setup the physics parts? Would I model them like real world rails and train wheels then expect that the phsysics system would make it work normally or would I use a simpler approach? Does anyone know of examples of a rail system? I see the cave pack for FPSC and I don't even understand how it would work for FPSC.

Thank you TGC for creating such amazing products!

Success does not come with meeting the minimum requirements.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 25th Feb 2008 17:26
It depends on your goal of the game/simulation. If you're not going to have a situation where the train would ever derail, then I would go with the simpler approach. If you're looking for realism and the possibility of derailments for specific reasons, (ie, excessive speed around a corner, hit a 20 ton dump truck at a crossing, etc..) then modeling the parts and understanding how DarkPhysics will treat them in the simulation might be the way to go.

DarkPhysics could actually make the entire process easier in the long run, but considering it's a train, I don't know that it's really necessary to go that far unless you have some wildly interesting scenarios in mind for your trains..


Don't think, just code.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Feb 2008 18:06
I would use waypoints. Each track section start and end point is recorded as a position and you head for each position in turn. Carriages need a little attention, otherwise they will cut the corners if they simply follow the main car instead of the track.
Dewi Morgan
16
Years of Service
User Offline
Joined: 16th Jan 2008
Location: London, UK
Posted: 1st Mar 2008 23:29
Two thoughts occur to me. First is that to get a smooth ride, you will need smooth rails, not angular, faceted ones, which suggests making the track from splines rather than mere waypoints. Unfortunately, while spline commands exist, I don't know how to use them.

The other thought is that you could constrain the left/right movement of the train with invisible walls either side of the track in a collision group shared with the train, so that the player etc didn't collide with them. Low walls would mean higher chance of tipping: walls higher than the centre of mass of the train would mean no chance.

Yet another game programmer
Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 2nd Mar 2008 02:09
Once you get the concept, making spline calculation is relatively easily. Here is a good thread that explains the concept and theory.

http://forum.thegamecreators.com/?m=forum_view&t=30039&b=6

The part I am struggling with is how to make an object out of them

Codger

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
Dewi Morgan
16
Years of Service
User Offline
Joined: 16th Jan 2008
Location: London, UK
Posted: 2nd Mar 2008 17:13
Codger: to make a track from a spline, perhaps you could create a chain of track sleepers (textured boxes) connected by revolute joints, place the first node of the chain at the start of the "track" and loop along the chain, moving each one to line up with the track. Then at either end of each sleeper you move, put a "rail section" box to reach to the same end of the previous sleeper.

Then delete all the joints, and you've got a track.

Or (since sleepers and track sections are relatively simple thingies) make them as a mesh in a memblock?

Sindore: spamming multiple threads is less likely to get you help, than asking in just one place, and showing that you're willing to have a bash at the problem yourself.

Yet another game programmer
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Mar 2008 11:26 Edited at: 3rd Mar 2008 11:26
I think all of the ideas above are putting the picture together. As nice as splines are, you ultimately have to make them up from lots of little straight pieces if you want them to be visible.

In the image below, I make my tracks using splines. The major waypoints are used to define the splines (using the red and blue handles). But in between, there are 100 minor waypoints which define the track curve and the polys that make up the road. The image is taken in draft mode, so the ground pokes through in several places. But I hope you can see that if you have enough waypoints, you can get a nice curve.

Attachments

Login to view attachments
Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 3rd Mar 2008 18:42
batvink

Would you share your method to make the road from poly's?

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Mar 2008 21:11
I can give you a quick overview...

1. define a spline (look up c-splines on Wikipedia or elsewhere, you'll soon find hundreds of links to all sorts of spline goodies.

2. Define points along the spline (my example uses 100 points)

3. Create a mesh memblock by "joining the dots" with polys.

To get into the finer detail takes a lot of brain-ache. I learnt the basics at the TGC convention, but it took me a lot of pain and hard work to get to this stage. It is definitely worthwhile finding out about splines in your own way, there are many different ways to explain and understand them, I read many articles before I truly understood them.

Likewise, look at all the information already on the forums about mesh memblocks if you haven't made them before. Once you've made your first plain from 2 polys, you'll be hooked
Roxas
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 4th Mar 2008 17:02
Jess T has nice spline example i think.


Click For Details!
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 5th Mar 2008 03:28
Thanks folks for the help with this. I've been wrestling with it for a couple of years now. I went the waypoint approach but found it difficult to speed the trains up and down especially as they passed the waypoints. I also found it hard to keep the trains moving smoothly together as I found them jumping around moving forward or backward into each other. Anyhow - so far I like everything I see here. I already understand splines and I think you have some good clues Batvink Thank you.

I am considering derailing as an possibility. I guess what I would like to do most is create a way of making a track from meshes then uses the physics system make it "work." Thanks again all for the help.

Thank you TGC for creating such amazing products!

Success does not come with meeting the minimum requirements.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 9th Mar 2008 03:40
Please report back on this time permitting. I would like to see if you can really get fancy with a digital LEGO system using DarkPhysics. That would be neat. I'm trying something easier than you but tricky still... the TANKS in DarkPhysics. Have a few ideas but the most promissing for halfway decent gfx is making a "machine" for the treads etc... like what you're thinking about doing building rails etc.

I'm worried that the MASSIVE weights you and I would need - and the elasticisty as well as the skin depth stuff and the MASS values would work right... meaning I think even after we had something moving albeit the tank or a train... I think it would tak alot of fine tuning to get the engine to "Play it right" for the objects in question.

I'm having fun playing TANK Soccer now... but eventually, I want the tanks to act like the 20ton beasts they are.

Login to post a reply

Server time is: 2024-05-19 23:14:08
Your offset time is: 2024-05-19 23:14:08