Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: init option - [FLUIDDEPTH:7]  (Read 1191 times)

Sinergistic

  • Bay Watcher
    • View Profile
init option - [FLUIDDEPTH:7]
« on: February 28, 2009, 03:45:40 am »

Request: An init setting that allows the user to define the fluid depth. Default/max = seven.

Problem: It would need a lower limit, because current fluid mechanics would start to break down around 4 or less depth, from what I can reason out.

For instance, if the scale of depth was 1-4; 1 = 'puddle'/evaporation, 2 = dangerous, 3 = over dwarf head and 4 = full tile.

Why: Well, this is kinda based on the belief that reducing the fluid depth system to something lower would improve FPS by reducing system load. If reducing the number of possible fluid levels wouldn't have an impact on, or if the impact would be to small to notice, this is kind of pointless.

(P.S. : [ARTDEFACE:YES/NO]
Logged

Impaler[WrG]

  • Bay Watcher
  • Khazad Project Leader
    • View Profile
Re: init option - [FLUIDDEPTH:7]
« Reply #1 on: February 28, 2009, 04:16:12 am »

Fluid is probably measured with a single byte of memory, though it could theoretically go as high as 255 it would probably require a recompiled to take effect.  A system that could take an arbitrary max depth from the init would probably be slower regardless of what depth value was entered. 

Your assumption that a lower number would result in a faster game is fundamentally flawed, a computers Arithmetic and Logic Unit dose most operations in the same number of cycles regardless of the numbers size.  Computation is slowed down by having many many repeated steps, the complexity and number-crunching of each step is almost trivial compared to how many times it must be done.  Thus the system is designed to minimize the number of steps and 'hard-coding' the water depth to 7 allows us to skip steps that would otherwise have to be done if the depth were a variable.
Logged
Khazad the Isometric Fortress Engine
Extract forts from DF, load and save them to file and view them in full 3D

Khazad Home Thread
Khazad v0.0.5 Download

profit

  • Bay Watcher
  • Finely Crafted Engravings... Or it didn't happen.
    • View Profile
Re: init option - [FLUIDDEPTH:7]
« Reply #2 on: February 28, 2009, 07:45:37 am »

Fluid is probably measured with a single byte of memory, though it could theoretically go as high as 255 it would probably require a recompiled to take effect.  A system that could take an arbitrary max depth from the init would probably be slower regardless of what depth value was entered. 

Your assumption that a lower number would result in a faster game is fundamentally flawed, a computers Arithmetic and Logic Unit dose most operations in the same number of cycles regardless of the numbers size.  Computation is slowed down by having many many repeated steps, the complexity and number-crunching of each step is almost trivial compared to how many times it must be done.  Thus the system is designed to minimize the number of steps and 'hard-coding' the water depth to 7 allows us to skip steps that would otherwise have to be done if the depth were a variable.
Even worse...

Fluid depth is 3 bits in a 32 bit tile information variable.

Changing it in any way shape or form will require a massive code rewrite.

The only realistic possibility is offloading the fluid physics to a separate thread allowing multi-core processor usage.   I suppose you could also offload it to the PhysX physics engine or something like that but most people do not have PhysX cards or nvidia 9600+ cards yet.

« Last Edit: February 28, 2009, 07:48:36 am by profit »
Logged
Mods and the best utilities for dwarf fortress
Community Mods and utilities thread.

Shad0wyone

  • Bay Watcher
    • View Profile
Re: init option - [FLUIDDEPTH:7]
« Reply #3 on: February 28, 2009, 08:58:29 am »

I have nVidia 9650m GT :D 1 GB of win.

On my laptop!
Logged

Sinergistic

  • Bay Watcher
    • View Profile
Re: init option - [FLUIDDEPTH:7]
« Reply #4 on: February 28, 2009, 01:51:41 pm »

Ah, forget it then ^^

I'd just seen mention that it was set to 7 because of speed issues.
Logged

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: init option - [FLUIDDEPTH:7]
« Reply #5 on: February 28, 2009, 02:12:56 pm »

nvidia 9600+ cards yet.
Flaw.  All desktop Nvidia cards that are 8000-series or up are PhysX enabled.
Logged
Mishimanriz: Histories of Pegasi and Dictionaries