Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Multi-part item description  (Read 1493 times)

Mrhappyface

  • Bay Watcher
    • View Profile
Multi-part item description
« on: May 31, 2012, 02:17:39 pm »

Dwarves can have randomly generated appereances such as braided beards, long hair, wide-spread teeth, etc. so why can't items? I mean I want more description besides +Steel short sword+ that happens to be encrusted with gems and metals. Why not stuff like the hilt is wide, the blade is notched, or the pommel is round? It doesn't have to effect the crunch, just the fluff.
Logged
This is Dwarf Fortress. Where torture, enslavement, and murder are not only tolerable hobbies, but considered dwarfdatory.

weenog

  • Bay Watcher
    • View Profile
Re: Multi-part item description
« Reply #1 on: May 31, 2012, 03:20:53 pm »

I'm sure it can, but only so much can be coded in so much time.  Presumably it's a much lower priority than the level of detail and variation on dwarves because it's just a thing.  It needs no personality nor individuality, even if it would be neat to have.  Bizarre little creatures trying to be real people, they have a much greater need for it.
Logged
Listen up: making a thing a ‼thing‼ doesn't make it more awesome or extreme.  It simply indicates the thing is on fire.  Get it right or look like a silly poser.

It's useful to keep a ‼torch‼ handy.

Maklak

  • Bay Watcher
    • View Profile
Re: Multi-part item description
« Reply #2 on: June 01, 2012, 01:05:00 pm »

For masterworks maybe, but otherwise I'm against it. There is usually (tens of) thousands of items in a fortress and they all eat up RAM and CPU. If the data structures for items get bigger, the game will get slower.
Logged
Quote from: Omnicega
Since you seem to criticize most things harsher than concentrated acid, I'll take that as a compliment.
On mining Organics
Military guide for FoE mod.
Research: Crossbow with axe and shield.
Dropbox referral

Williham

  • Bay Watcher
    • View Profile
Re: Multi-part item description
« Reply #3 on: June 02, 2012, 06:48:09 am »

For masterworks maybe, but otherwise I'm against it. There is usually (tens of) thousands of items in a fortress and they all eat up RAM and CPU. If the data structures for items get bigger, the game will get slower.

That's not how it works. The size of a data structure has approximately 0 impact on the speed of a running application, so long as it is constant.

In fact, if anything, only having it on masterworks would probably lead to more slowdown than having it on all items.

I've not personally explored the data structures used for dwarves, but I do believe appearance modifiers (as they are called) are stored as a series of uint_16t:s, yes? Assuming a crafted item, such as swords, shirts, socks on average has 2 appearance modifiers, and natural items, such as leathers, logs, rocks, blocks, etc. have none; that would work out to an increase of an average of 32 bits per crafted item; but the number of items like blocks, logs and bars far outstrip crafted items, at least in most fortress I've ever had, bringing the average increase of storage used per item down further.

Edit: someone is going to yell [citation needed] at my first statement, so here's a bit of proof:

wrt. to size v. speed:

Items in the game aren't stored sequentially in memory, but rather as a list of pointers to data structures tucked away elsewhere. If pointers to the items are stored in a linked list, access to any object is O(n + k), where n is the location of the item in the list, and k is small.

If the pointers to the items are instead stored in an array, access to any object is amortized constant, and for other data structures, other considerations apply, but the worst worst case is O(n) where n is the total number of items, and the worst average case is O(n / 2).

Because all items are indirected through a layer of pointers, however, you'll notice that the size of objects doesn't enter into the math at all.

wrt. to masterwork descriptions v. all descriptions.

Actually, when thinking about this, I realize its a bit of a tossup. The efficiency of describing all items v. only masterwork items is proportional to the ratio of low-quality items to masterworks, tho' the exact proportion is difficult to ascertain, and will certainly vary from machine to machine.

What is known, however, is that it will only affect the speed of the game when actually looking up the description of an item, as described above, meaning that the only cycles that are used needlessly to create the description are cycles that would not be used for the simulation in any case.
« Last Edit: June 02, 2012, 07:04:49 am by Williham »
Logged