Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: 1000 cloth  (Read 931 times)

Scribble

  • Bay Watcher
    • View Profile
1000 cloth
« on: April 13, 2010, 11:56:42 am »

Sorry If this has been posted before, but I cannot find the post;

Clothier's task now take up 'a thousand' units of cloth. is this right as it means than an entire dwarven caravan of overpriced pigtail cloth makes about a bag.

If it's a bug is there a work around?

many thanks!
Logged

Hamster Man

  • Bay Watcher
    • View Profile
Re: 1000 cloth
« Reply #1 on: April 13, 2010, 11:58:23 am »

It's not a bug - one "cloth" item (such as you'd produce at a weaver) is equivalent to 10000 cloth units. The reason for this is that cloth can be used in tiny pieces in certain places, such as the hospital (I haven't seen it myself but I think they only use like 10 units of cloth to bandage people, or something like that).

Thus, don't worry. Produce as normal.
Logged
So there's that, as well. It looks like the only chronic problems that water can't cure are nausea and cave spider bites.
Which, coincidentally enough, can be cured by magma.

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: 1000 cloth
« Reply #2 on: April 13, 2010, 12:01:36 pm »

So, is there some reason Toady refuses to use real numbers for material quantities?
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

Dave Mongoose

  • Bay Watcher
    • View Profile
Re: 1000 cloth
« Reply #3 on: April 13, 2010, 12:06:22 pm »

So, is there some reason Toady refuses to use real numbers for material quantities?

They are real numbers, just bigger than the old ones... if you like, think of cloth being measured in centimeters (or inches) squared.
Logged

haywire

  • Bay Watcher
    • View Profile
Re: 1000 cloth
« Reply #4 on: April 13, 2010, 12:54:41 pm »

These new numbers would be what is causing my framerate to drop through the floor when elven caravans arrive then, isn't it?  Since they like to come bearing metric shitloads of cloth and thread.  I'm currently doing a 2x2 fort, and when no caravans are there, my framerate is constantly at the cap of 100, but when the elves come onto the screen it drops to about 40.

Next world I think I'm going to take the ability to make and use any cloth/thread away from the little bastards.
Logged

Surray

  • Bay Watcher
    • View Profile
Re: 1000 cloth
« Reply #5 on: April 13, 2010, 01:18:01 pm »

Unless they're packing about a million cloth items it shouldn't have any impact on performance.
Your problem must be caused by something else.
Logged

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: 1000 cloth
« Reply #6 on: April 13, 2010, 01:23:37 pm »

They are real numbers, just bigger than the old ones... if you like, think of cloth being measured in centimeters (or inches) squared.

Real number = 1.0000 units of cloth
Integer = 10000 units of cloth

Everything in Dwarf Fortress is measured in integers for some reason.  Usually it's not a problem, but the new fractional unit system with cloth makes the choice a bit odd.  Can't be a performance issue since modern processors do real number math in hardware.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

haywire

  • Bay Watcher
    • View Profile
Re: 1000 cloth
« Reply #7 on: April 13, 2010, 01:33:32 pm »

Wonder what it is about the elves then.  I get lower rates with dwarves and humans as well, but not nearly as dramatic as with elves.  I figured it might be related to how the number of objects in a fort affects performance.  I had a fort in the old version where I was digging out all of the underground levels and the framerate started dropping the more I did it, but rose again once I started atom smashing the thousands of stone I was generating.  So if the game is counting each of these threads/pieces of cloth as a single object, elves arriving carrying just 20 threads would actually be showing up with 300k+ objects.
Logged

Sizik

  • Bay Watcher
    • View Profile
Re: 1000 cloth
« Reply #8 on: April 13, 2010, 01:41:34 pm »

They are real numbers, just bigger than the old ones... if you like, think of cloth being measured in centimeters (or inches) squared.

Real number = 1.0000 units of cloth
Integer = 10000 units of cloth

Everything in Dwarf Fortress is measured in integers for some reason.  Usually it's not a problem, but the new fractional unit system with cloth makes the choice a bit odd.  Can't be a performance issue since modern processors do real number math in hardware.

Unless it's possible to use arbitrarily small units of cloth, it's more efficient to use integers.
Logged
Skyscrapes, the Tower-Fortress, finally complete!
Skyscrapes 2, repelling the zombie horde!

Zurai

  • Bay Watcher
    • View Profile
Re: 1000 cloth
« Reply #9 on: April 13, 2010, 02:40:54 pm »

Real number = 1.0000 units of cloth
Integer = 10000 units of cloth

Everything in Dwarf Fortress is measured in integers for some reason.  Usually it's not a problem, but the new fractional unit system with cloth makes the choice a bit odd.  Can't be a performance issue since modern processors do real number math in hardware.

.........

Integers are real numbers. They're specifically and explicitly defined as real numbers. You cannot have an integer that is not a real number.

There are no fractional costs. All costs are in integers. A single cloth object contains 10,000 units of cloth, and all reactions involving cloth use integer amounts of cloth.

What you're asking for is to convert the entire mathematical foundation of the unit system in the game from integers to floating point numbers for really no good reason:
  • There's no real performance benefit
  • There could be a decided performance decrease; if doubles are used, they're twice the size of ints, and if floats are used, they suffer from imprecision errors with repeated use
  • They're no more obvious than integers are and take more screen real-estate (as you have to list all the preceding zeroes with a floating point number but not with an integer)


The main benefit to using floating point numbers is that they're the only way to handle true fractions. When you're taking 63% of a number, you're not guaranteed to get an accurate end result if you do the math using an integer. When all of your math is done using fixed, whole numbers, floating points offer no benefits.
Logged

Keolah

  • Bay Watcher
    • View Profile
Re: 1000 cloth
« Reply #10 on: April 13, 2010, 03:06:50 pm »

It's more likely that the elves are causing more lag than the dwarves or humans because they're bringing boatloads of animals as well, not because of the cloth. The dwarves and humans bring cloth too, after all, but not animals.
Logged
There's no use crying over every mistake. You just keep on trying till you run out of *cat tallow roast*.

Garthor

  • Bay Watcher
    • View Profile
Re: 1000 cloth
« Reply #11 on: April 13, 2010, 03:24:20 pm »

What you're asking for is to convert the entire mathematical foundation of the unit system in the game from integers to floating point numbers for really no good reason:
  • There's no real performance benefit
  • There could be a decided performance decrease; if doubles are used, they're twice the size of ints, and if floats are used, they suffer from imprecision errors with repeated use
  • They're no more obvious than integers are and take more screen real-estate (as you have to list all the preceding zeroes with a floating point number but not with an integer)


The main benefit to using floating point numbers is that they're the only way to handle true fractions. When you're taking 63% of a number, you're not guaranteed to get an accurate end result if you do the math using an integer. When all of your math is done using fixed, whole numbers, floating points offer no benefits.

Actually, the biggest issue with using floating point (or double) values is that, because the fraction is stored as binary, you get infinitely repeating sequences on some rather stupid values.  For example, 0.1 is an infinitely repeating sequence.  The result of this is that, regardless of your precision, you cannot accurately add these numbers up: subtracting 0.1 from 1 ten times will give you a very tiny (but not zero!) number, because you cannot have infinite precision.  Naturally, having .000000000000000138778 of a piece of cloth is not particularly useful.
Logged