Bay 12 Games Forum

Please login or register.

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

Author Topic: Generalized Stone  (Read 3362 times)

Morwaul

  • Bay Watcher
  • ..............boo
    • View Profile
Generalized Stone
« on: May 04, 2012, 03:05:22 pm »

Hello Toady

Would it be possible to make stone so that the boulders it drops can be standardized or changed by our modders?  Like wood is now.  So for instance, Limestone, Marble, and Calcite could drop "Flux Stone" boulders, while Lignite and Bismuth Coal drop "Fuel Stone" boulders.  Other generalized stones could be Magma Safe Stone, Low grade Stone, Precious Stone, Mystic Stone, or whatever.  Not sure if this would be the best way to implement this but it would probably be useful if all stone functioned as minerals.  That way mining Granite could have a 99% chance of dropping a Low Grade boulder and a 1% chance of dropping a Precious boulder.

The reason I would like this is that as I understand it, generalizing the stones will positively affect FPS.

I'm sure the modders could use this freedom for innovations that are beyond my creativity.
Logged

Destructicus

  • Bay Watcher
    • View Profile
Re: Generalized Stone
« Reply #1 on: May 04, 2012, 03:25:07 pm »

I don't think Toady is going to do anything that makes the game more generic.  This is a very detail-oriented game, and a lot of people really love the geological accuracy of all the different types of stone, minerals, etc.  FPS is an issue for me, but I'm playing on a laptop (albeit a high-end one).  For many people it doesn't seem to be that big of a cause for concern.  I don't even know if simplifying stone would really cause any difference in performance.  I think it's more the amount of items in your fortress that causes FPS death.  What methods have you tried in order to keep your FPS healthy?
Logged

Morwaul

  • Bay Watcher
  • ..............boo
    • View Profile
Re: Generalized Stone
« Reply #2 on: May 04, 2012, 04:18:06 pm »

You misunderstand.  This would not change anything in and of itself.  At least that the end user sees.  What it would do is allow the modders to make changes to their mods.  So, in Vanilla Granite would drop a granite boulder and obsidian an obsidian boulder.  But, in mods it would give the modders the ability to change the game so that granite drops a standard boulder, or steel, or fudge pudding or whatever. 
Logged

King Mir

  • Bay Watcher
    • View Profile
Re: Generalized Stone
« Reply #3 on: May 04, 2012, 05:15:07 pm »

This would be great because you could have the same natural wall type drop different items. It provides an easy way to mod in rubble. Or different grades of the same stone. Or coal to cause harmful dust sometimes. The drop rate of each item could be individually varied in the raws.

Babylon

  • Bay Watcher
    • View Profile
Re: Generalized Stone
« Reply #4 on: May 04, 2012, 05:20:13 pm »

I'm pretty sure that wood actually is not generic.
Logged

Morwaul

  • Bay Watcher
  • ..............boo
    • View Profile
Re: Generalized Stone
« Reply #5 on: May 04, 2012, 06:48:40 pm »

In Vanilla it is not.  But modders can change how it drops the wood.  For instance, the Masterwork Mod has made it so that most trees drop rough wood.  I am not sure how this is done but it is not possible with stone as the game currently works. 
Logged

ab9rf

  • Bay Watcher
    • View Profile
    • ab9rf@github
Re: Generalized Stone
« Reply #6 on: May 04, 2012, 06:58:44 pm »

The reason I would like this is that as I understand it, generalizing the stones will positively affect FPS.
No, it would not materially affect frame rate. 

The problem is that the "dig" reaction is not moddable: digging a stone generates a boulder of that stone material, and there's no way to change that.  The "cut wood" reaction for trees is controlled by the TREE tag in the raws and can be changed.  That said, I don't think Toady has enough good motivation to make the requested change.
Logged

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: Generalized Stone
« Reply #7 on: May 04, 2012, 07:00:24 pm »

Fewer types of minerals in the raws DOES affect FPS, and rather significantly.

Fewer types of stones dropped from the minerals would not.
Logged
I like fortresses because they are still underground.

sockless

  • Bay Watcher
    • View Profile
Re: Generalized Stone
« Reply #8 on: May 04, 2012, 11:15:27 pm »

So you want it like Masterwork DF where you have generaic stone types, but before they are mined, they are still non-generic.

So you would encounter a hematite vein, which when you mine it, it drops "iron ore" instead of "hematite ore"? And then when you mine magnetite, it would also drop "iron ore".

I like how it currently works, but that's largely because I like making stone items out of hematite, so I can have a blood red fortress.
Logged
Iv seen people who haven't had a redheaded person in their family for quite a while, and then out of nowhere two out of three of their children have red hair.
What color was the mailman's hair?

Morwaul

  • Bay Watcher
  • ..............boo
    • View Profile
Re: Generalized Stone
« Reply #9 on: May 05, 2012, 11:55:23 am »

Sockless, Yes, that is it in a nutshell.  My goal was to be able to have more varied and interesting Z levels without having lots of different types of stone to deal with.  Color would be an issue however.  The only work around would be to have generic stones of each color which makes the whole thing less effecient.

Also, as Jeoshua and ab9rf explained, I did not actually understand how it worked.  I actually had it backwards.  What my idea would allow is to have many stones types in the raws which only drop a few types of boulders.  Evidently having more stone types in the raws would cause a FPS slowdown and the less numerous types of stone would have no effect.  Thus the opposite of what I had hoped for.

With this said I still think it would be good if our modders had the freedom to modify what drops and how much of it when a stone tile is mined.  Of course I am not a modder so I could be off base there as well.
« Last Edit: May 05, 2012, 12:02:10 pm by Morwaul »
Logged

ab9rf

  • Bay Watcher
    • View Profile
    • ab9rf@github
Re: Generalized Stone
« Reply #10 on: May 05, 2012, 12:01:39 pm »

Also, as Jeoshua and ab9rf explained, I did not actually understand how it worked.  I actually had it backwards.  What my idea would allow is to have many stones types in the raws which only drop a few types of boulders.  Evidently having more stone types in the raws would cause a FPS slowdown and the less numerous types of stone would have no effect.  Thus the opposite of what I had hoped for.
As far as I can tell, the performance issue is due to having lots of types of raw stone (probably something to do with the way unmined stone is represented internally; it's really very complicated and almost certainly inefficient; Toadycode has a disconcerting tendency to be O(n) when O(ln n) or even O(1) is possible).  Reducing the number of possible types of mined stone will have at best a negligible effect on performance.
Logged

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: REQUIRED]
    • View Profile
Re: Generalized Stone
« Reply #11 on: May 05, 2012, 12:09:28 pm »

Fewer types of minerals in the raws DOES affect FPS, and rather significantly.

Fewer types of stones dropped from the minerals would not.

Do you have a link to science on that?  I haven't tested the effect of raw definitions on FPS, and would not expect it to have such a large effect on the game unless it were something unreasonably large.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
"And no Frankenstein-esque body part stitching?"
"Not yet"

Improved Farming
Class Warfare

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: Generalized Stone
« Reply #12 on: May 05, 2012, 01:48:39 pm »

Well no, I don't have and hard science on that point.  The main problem is that there isn't really a way at this point to set drop types.  However I did recieve a decent boost in on-embark performance with Masterwork's Less Soil, Less Rock, and Less Mineral types selected.  Take that as you may.  It's not hard science but I did notice I was getting about 10 fps more with these FPS boosts, vs not having them on.  That's only on-embark, and the number was in the several hundred calc-fps (uncapped).  Later on it didn't really help with the pathfinding or water flow fps.

So really it doesn't help much, and maybe I shouldn't have said "significantly".  But it does have a measurable effect when all else is equal.

This was right on embark, so the affected variable was the number of different stones, soils, and minerals the game was keeping track of.  I can only assume that since these would still be present if they had drop-types, it wouldn't have changed anything.
Logged
I like fortresses because they are still underground.

ab9rf

  • Bay Watcher
    • View Profile
    • ab9rf@github
Re: Generalized Stone
« Reply #13 on: May 05, 2012, 02:47:04 pm »

Well no, I don't have and hard science on that point.  The main problem is that there isn't really a way at this point to set drop types.  However I did recieve a decent boost in on-embark performance with Masterwork's Less Soil, Less Rock, and Less Mineral types selected.  Take that as you may.  It's not hard science but I did notice I was getting about 10 fps more with these FPS boosts, vs not having them on.  That's only on-embark, and the number was in the several hundred calc-fps (uncapped).  Later on it didn't really help with the pathfinding or water flow fps.
Masterwork disables all sorts of things, ostensibly for speed reasons.  While it's possible that reducing the number of stone types might have a minor impact on speed, I really rather doubt it as I'm not aware of any place in the code (at least that gets used frequently) that iterates through stone types. There is one that, I think, iterates through geolayers, and it's possible with fewer stone types you'll get fewer geolayers and so that might give a slight boost, but I think your experience is probably collateral to the many other things Masterwork does, and has nothing much to do all that much specifically with there being fewer types of stone available.

In any case, your "experiment" is not ceteris paribus, and so isn't good science. 
Logged

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: Generalized Stone
« Reply #14 on: May 05, 2012, 03:16:14 pm »

I think he was comparing Masterwork with and without the "Less Soils, Less Rock, and Less Minerals" option on. That would be pretty good science, if he tested in in identical conditions in identical locations on identical worlds, and perhaps repeated it a few times. Once probably isn't enough, especially if it was on different types of embark areas.
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.
Pages: [1] 2