Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4 5

Author Topic: SCIENCE: Quantifying minecart physics  (Read 36906 times)

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #30 on: July 12, 2012, 08:30:27 pm »

... if a dwarf swings his melee weapon at an enemy while riding past it in a minecart, will the momentum of the minecart add to the force of the swing? ...

Nope, it doesn't. We'll have to wait for Toady to add mounted combat before that'll work.

Other interesting points: a dwarf who jumps out of a moving minecart will keep moving in the direction of travel, but if he then drops an item from his inventory, it falls straight down. Shooting a crossbow from a moving minecart likewise assumes a stationary launching position.

lcy03406

  • Bay Watcher
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #31 on: July 12, 2012, 11:29:48 pm »

... if a dwarf swings his melee weapon at an enemy while riding past it in a minecart, will the momentum of the minecart add to the force of the swing? ...

Nope, it doesn't. We'll have to wait for Toady to add mounted combat before that'll work.

Other interesting points: a dwarf who jumps out of a moving minecart will keep moving in the direction of travel, but if he then drops an item from his inventory, it falls straight down. Shooting a crossbow from a moving minecart likewise assumes a stationary launching position.

But HOW to give the mount and shoot order?
Logged

xmoffitt

  • Bay Watcher
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #32 on: July 15, 2012, 09:35:15 pm »

I'll send you a pm with my email address, but would you mind explaining the basics about the python program (seeing as you already posted the code anyway), or rather, describe the calculation steps (done per tick?), and their order, so others could understand it better too?

Sure, here is the simple overview.
  • First, you create a Course, which is just a list tiles in a line with various attributes.  For example, course = [track.T] * 500 is just a long track with regular tiles.
  • Usually, you will add one or more unknown elements that you are trying to derive values.  For example, course[10] = track.SM is a Trackstop-Medium
  • Next, you create a Race object and call run() to start the simulation.
  • The impulse is applied which gives the cart position 1.5 and speed 200.
  • Then, each tick
    • Looks up the tile type and stats from the current location[/i]
    • Adds speed from rollers, up to a max speed (this might not be right)
    • Decreases speed based on friction
    • Updates position based on speed.
    • Changes direction of the cart if entering/exiting a ramp. (this might not be right)

Everything is is just fancy stuff to look for different values that "fit" the observation.   I used it to get the friction values for Lowest, Low, and Medium track stops.
Logged

Snaake

  • Bay Watcher
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #33 on: July 25, 2012, 08:47:45 am »

Hey, just though I'd pop in to explain why I haven't been posting, and do a little "what now?" post in general.

So, I sort of drifted away from DF. The blame is largely on Steam summer sales; I've been playing Terraria (inspired by minecraft, which was inspired by DF), especially the multiplayer with my girlfriend. Also gotten into the Day Z mod in the past couple of days. At the moment, I don't think I'll be playing DF very actively for a few weeks at least, but might be longer than that, to be honest (months, a year...). DF is one of those games I drift in and out of.

I will try and push myself to finish testing #14-15, since I've done part of that already; no promises though. The same applies to editing some of this info to the wiki (I did write a mention of the thread on the discussion page for the minecart article, requesting a rewrite of the physics section, citing at least this thread, can't remember if I cited others too). Other than that, feel free to finish testing this stuff, using either this thread or some other, more active one, to post the results in.
Logged

eRaz0r

  • Bay Watcher
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #34 on: August 01, 2012, 03:20:15 am »

While my "experiments" are not to the rigorous level of scientific inquiry as my predecessors here, I'd like to add some minor observations of my own.

1. Rollers built on an upward track (track and roller a single tiles length) can and will launch a cart off the rails on the level above.
2. Carts do have some kind of angular momentum.  A descending ramp track with a turn in it (.e.g a corner ramp) can derail a minecart if there are no walls. The derailment is at an angle less than the 90 degree angle that the ramp should have imparted.
3. Track Stops set to "dump"  will not dump riding dwarves.
4. When using a T-junction with rollers (as presented in the wiki) to control automated movement, riding dwarves are forcibly dismounted at the T, when the cart continues in the direction of the roller. I have not finished testing this last one.  I want to see if I can slow the cart down enough that the direction change is gentle enough that the dwarf remains in the cart.


My fort has a large "roller coaster" that I intended to use to put my marksdwarves on - to ride around the map shooting at whatever they see. The coaster works reasonably well - I have a mount point on top of an archer tower in the west above the "yard" (my old fort entrance). The track ramps down a few Z's as it progresses east over the yard, and turns south until it hits the top of another tower where it joins the "gatehouse" track that zooms in front of the gate (2 z's above the entrance)  and eventually enters the northernmost archer tower where it spirals down into the earth. At bottom the track heads due south.  About the middle of the map there's a T junction. If the rollers are off, the hapless marksdwarf will continue back to the southern archer tower and spiral up the ramps automatically (thanks to the windmill farm on the tower top) where he continues to zip in front of the gatehouse. That's entirely automated.  If the rollers are on, he was supposed to go back to the base of his original archer tower, where he'd have to climb the stairs to top.

So far, the problems are
a) dismounting on the rollers
b) can't get the marksdwarves to ride the thing properly.  Even locking doors and hatches and things, and they still just stand there.  I may have to experiment with burrows next.

Well, that's my contribution (such as it is) to the science of minecarts
Logged

Gerottomo

  • Bay Watcher
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #35 on: August 01, 2012, 09:05:53 am »

One thing to test would be if a minecart with a large weight in it will derail easier than one without as it would in actuality due to inertia and center of gravity.
Logged

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #36 on: August 01, 2012, 11:01:09 am »

My fort has a large "roller coaster" that I intended to use to put my marksdwarves on - to ride around the map shooting at whatever they see.
I think this would work as a track switcher, but I haven't done anything with bridges yet:

Code: [Select]
.1....
.1....
.11111
......
.22222
.2....
.2....
Track 1 is, at least at that corner, slow enough to not derail the track as it turns the unwalled corner. To make the switch to Track 2, you unretract the three-tile bridge that covers the gap plus the two corner track tiles, and have the cart come from the north.

Code: [Select]
.1....
.1....
.|1111
.|....
.|2222
.2....
.2....
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

eRaz0r

  • Bay Watcher
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #37 on: August 01, 2012, 01:16:04 pm »

My fort has a large "roller coaster" that I intended to use to put my marksdwarves on - to ride around the map shooting at whatever they see.
I think this would work as a track switcher, but I haven't done anything with bridges yet:
That looks workable. 
My current set up is more like this :

Code: [Select]
1 . . .
1 . . .
1 . . .
2 2 2 2
1 O O O
1 O . .
1 O . .
Where track 2 has a roller on it to pull the cart on to it.   Your idea sounds better. I've had a lot of luck with controlled derailment feeding from one track to another. 
(I have a double-helix spiral that goes down many z's to various levels - marble mine, spider silk farms, gold mine.  At each major level, using doors and derailment instead of T junction tracks, I can control whether the cart stops there and short-circuits the rest of the descent depending on what my dwarves need..
Logged

eRaz0r

  • Bay Watcher
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #38 on: August 01, 2012, 05:00:39 pm »

I've gotten the T junction working perfectly as you described. This is much more elegant than the Rollers, and the riders stay in the cart.
Logged

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #39 on: August 01, 2012, 05:17:27 pm »

Much easier to power as well, on account of not needing any power.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

eRaz0r

  • Bay Watcher
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #40 on: August 02, 2012, 01:19:45 am »

Much easier to power as well, on account of not needing any power.

Indeed - one problem though - it's too vulnerable to changes in cart speed. With the bridge retracted, the cart may or may not derail depending on the speed it's gotten at that point.

I went with a different option - a door instead.  The door acts as a wall to "encourage" the cart to stay on the corner, and when closed, the carts jump the corner on to the continuing track.
Logged

Tryble

  • Bay Watcher
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #41 on: August 05, 2012, 02:58:28 pm »

So, if I'm reading all of this right, a short list of facts we now know based on your testing:

One tile of distance traveled is labeled one Urist.

Propulsion:
Minecart travel distance is unaffected by weight or load.
Dwarves push at 200 Urists regardless of Strength, but ignore all or some of the friction of the initial tile some.
Roller speeds are measured at 51/201/451/801/1250, medium/high speeds being estimates.
Downward ramps grant an additional 470-560 Urists of movement.

Friction Costs:
Minecart tracks of any sort cost 1 Urist per tile.
Bridge tiles also cost 1 Urist.
Non-track floor costs 14 Urists.
Track stops add an additional 0/4/40-52/800-850/∞ friction to a tile, medium and higher being variable or estimated.
Turns on a track have an estimated friction cost of 9-14, variable for unknown reasons.

Other:
Bridge tiles operate identically to tracks except for pathing purposes when the cart is guided.
Upward ramps are wonky; they can decrease or increase the distance traveled by a cart.
A 200 Urist push is enough to cause a cart to jump over a 1 tile gap, as long as the gap is not adjacent to the dwarf push (pushd by roller is fine).  The gap doesn't cause any loss in travel distance.


Is this right?  I may have misread or misinterpreted some things.
« Last Edit: August 05, 2012, 03:01:25 pm by Tryble »
Logged

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #42 on: August 05, 2012, 03:47:54 pm »

Indeed - one problem though - it's too vulnerable to changes in cart speed. With the bridge retracted, the cart may or may not derail depending on the speed it's gotten at that point.
You can use track stops to slow a cart down, and they can be made one-way if you use a pressure plate with the track stop.

Quote
I went with a different option - a door instead.  The door acts as a wall to "encourage" the cart to stay on the corner, and when closed, the carts jump the corner on to the continuing track.
Closed?
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #43 on: August 05, 2012, 03:59:47 pm »

...
Dwarves push at 200 Urists regardless of Strength, but ignore all or some of the friction of the initial tile some.
Roller speeds are measured at 51/201/451/801/1250, medium/high speeds being estimates.
Downward ramps grant an additional 470-560 Urists of movement.
...

Another implication: we think rollers have a "do not exceed" speed, and rollers alone aren't sufficient to "shotgun" cart contents. We also know that 3 z-levels (perhaps plus a dwarf push) are required at minimum to "shotgun". This puts the shotgun requirement somewhere between 1250 - 1680. Careful use of track stops could make this number range smaller.

zuglar

  • Bay Watcher
    • View Profile
Re: SCIENCE: Quantifying minecart physics
« Reply #44 on: August 05, 2012, 04:50:19 pm »

Very glad to see the science!
Would you do some experiments on ramps or water/magma?

I can throw in what I've observed building a magma dipper route:

The dip needs to be at least 2 tiles wide (cart skips over 1-tile holes, I've never tried 3). An iron minecart needs a 2z drop into still 7/7 magma to pick anything up and still escape. A 1z drop will leave it stuck (and Newton's cradle won't get it out). 6/7 magma won't give any to the cart (contrary to the wiki). Sending a cart in while a magma pump is active will get the cart stuck. I have no idea why the latter, unless 7/7 magma is too much friction for a full cart to escape.

Logged
Pages: 1 2 [3] 4 5