Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Stack problem  (Read 2111 times)

Delorian

  • Escaped Lunatic
    • View Profile
Stack problem
« on: November 21, 2018, 12:38:01 am »

We all got this situations when you got your bolt, coins ot etc stack get split to hundred items in x1 stacks.

Why dont we just have a packager profession, so we can designate dwarf to stack 25 bolts to x25 stack? So on with coins and etc.

This do not sound as difficult as generating a villains and raids thing, but problem is there for years.

Right now i just dump them, actually.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Stack problem
« Reply #1 on: November 21, 2018, 09:50:12 am »

Problem is that items like coins carry information about when they were minted, the creatures they've struck down, temperature-based damage, etc. It's not so easy to retain that info if you combine them.
« Last Edit: November 21, 2018, 09:55:16 am by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Lestrage

  • Bay Watcher
  • novice creature of the night
    • View Profile
Re: Stack problem
« Reply #2 on: November 21, 2018, 01:48:35 pm »

how about a sort of carriable container.  you put items in the box and an algorithm sorts items by level of similarity. If multiple items are exactly similar they are combined into a stack (showing one item name and just the number of instances).
Logged
The platypus is making a plaintive gesture. The pangolin is striking a menacing pose. The penguin is laughing.

Delorian

  • Escaped Lunatic
    • View Profile
Re: Stack problem
« Reply #3 on: November 21, 2018, 03:11:39 pm »

Do we really need coins with name, quality and year on it, but without economy?
Do we really need bolts lying all around a fortress with this info, but unusable in combat?
Logged

GPeter

  • Bay Watcher
  • Adequate forum poster.
    • View Profile
Re: Stack problem
« Reply #4 on: November 21, 2018, 03:48:56 pm »

One could make a workshop market, or maybe a location, and have it to stockpile all the clothes in the fortress. Dwarves would, instead of simply picking anything up, buy their clothes on the market, and thus give money to the fortress. And then we would use the coins/money with on the Trade Depot (with some clever calculations on inflation).

Am I dreaming too much with this? Maybe...
Logged
Yeah, there's plenty of information out there, but you don't need that information to form an opinion and then defend it to the death.
Hey, don't be like that. Your life never had any meaning in the first place!

Delorian

  • Escaped Lunatic
    • View Profile
Re: Stack problem
« Reply #5 on: November 21, 2018, 11:15:16 pm »

Thing is that dwarfs did already get money for their labors, but i heard it was turned off because of x1 coin stacks flooding the fortress. I’m not that old player, but played very intense last year.
Logged

GoblinCookie

  • Bay Watcher
    • View Profile
Re: Stack problem
« Reply #6 on: November 27, 2018, 07:24:52 am »

Thing is that dwarfs did already get money for their labors, but i heard it was turned off because of x1 coin stacks flooding the fortress. I’m not that old player, but played very intense last year.

The Old Economy got nuked because it resulted in stupid things like everyone having to make rubbish rooms deliberately so that your dwarves could afford to rent them.  Toady One would not have thrown all that work away if it was something as simple to fix as just coin stacks.

It probably isn't very hard to get all objects with identical info and stack them together using a job.  Since all coins of the same kind are referencing the same common set of info, you can very much just have someone round them up as a job into a single stack referencing the same info. 

Problem is that items like coins carry information about when they were minted, the creatures they've struck down, temperature-based damage, etc. It's not so easy to retain that info if you combine them.

It is a fairly race instance that coins get burnt and such coins should not be stackable with others that are unburnt.  As for the creatures they struck down, that information can simply be added to the larger stack with a number attached, as in 1 coin in this stack struck down a goblin.  If we split the stack, there is a probability that each stack will inherit the information based upon the number of coins in the new stack vs the original. 
Logged

therahedwig

  • Bay Watcher
    • View Profile
    • wolthera.info
Re: Stack problem
« Reply #7 on: November 27, 2018, 11:56:08 am »

I have the feeling that a lot of the economy hold back is in the entity tracking still. This is also visible with the animal training, if you train animals that are not part of the default domesticated set, your civ can gain information about training them, but no matter what you do you can't get them to domesticated. This is because your civ is not able to add the new animals to its list of existing resources. Similarly, if you make a gazillion mugs, your civ will never be able to realize you did that. No matter how you feel about economy, economic actors like civilizations should probably understand how to track and change their resources better before economy can move forward.

That said, I do agree with you that it is quite silly. It gets even sillier in adventure mode, where you can have multiple separate stacks of water in the same waterskin! We'll just have to wait and see what Toady comes up with, I guess :)
Logged
Stonesense Grim Dark 0.2 Alternate detailed and darker tiles for stonesense. Now with all ores!

GoblinCookie

  • Bay Watcher
    • View Profile
Re: Stack problem
« Reply #8 on: November 29, 2018, 07:35:31 am »

I have the feeling that a lot of the economy hold back is in the entity tracking still. This is also visible with the animal training, if you train animals that are not part of the default domesticated set, your civ can gain information about training them, but no matter what you do you can't get them to domesticated. This is because your civ is not able to add the new animals to its list of existing resources. Similarly, if you make a gazillion mugs, your civ will never be able to realize you did that. No matter how you feel about economy, economic actors like civilizations should probably understand how to track and change their resources better before economy can move forward.

That said, I do agree with you that it is quite silly. It gets even sillier in adventure mode, where you can have multiple separate stacks of water in the same waterskin! We'll just have to wait and see what Toady comes up with, I guess :)

There are really two quite different things that we are talking about when we say the Economy.  One of these is what used to exist (let's call it the Old Economy) but was removed because it resulted in silliness and the other still exists but is switched off once World-Gen is complete, so in effect the economic data for all sites and civilisations is fixed forever and nothing that can happen can ever alter it again.

Now the problems of the Old Economy are not reducible simply to stacking as such.  But the need to freeze the Economy when World-Gen completes is I surmise basically to do with stacking.  The economy is based upon stacks of items moving around but once the player breaks up those stacks into individual items and in the process adds information to the individual objects it becomes impossible to easily put the genie back in the bottle.

What comes to the rescue here however is that basically what the player sees does not really have to be what is actually going on.  It is entirely possible to create purely abstract stacks which don't exist anywhere except in the economy and then present said objects *to* the player as individual items.  When the player offloads, all the items actually simply get bundled up with all their additional data into said abstract stacks.  If I throw a plump helmet and kill a goblin, said plump helmet is simply added into the abstract stack as "one of these plump helmets killed a goblin".  When the plump helmets get shipped somewhere else, the information is downloaded such that if I take an individual plump helmet from a physical stack there is a % chance that it will be that particular plump helmet that I pick up and the game will recreate the item information in full.

For instance, if we have a site we have two stacks of clothing.  One of these is the stacks of unused clothing the site has in stock and can trade with other sites while the second is the privately owned clothing on the bodies of it's dwarves.  The second stack is used to determine the quantity and quality of the clothing worn by the residents while the first is used to decide the site's stockpiles in the same fashion.  Because they don't actually exist when we aren't there, it is entirely possible for the game to go about clothing the entire population from the central stack and any information stored in a particular item of clothing has a % probability of ending up on anyone's back based upon the number of instances of said information there are.

If we in adventure mode turn up and sell lots of clothing to individual dwarves on-site, the clothing gets added to the private rather than the public stack.  That means it will first end up being given to any unclothed dwarves there might be and then it registers as a surplus.  If there is a surplus in the private stack, it gets moved into the public stack and if there is a surplus in both stacks, the items of that type can then potentially be bought by us in fortress mode. 

That means that in adventure mode we can kill a load of bandits, sell their clothing to the site *or* the individual dwarves and as a result of this end up with more clothing to buy from the caravan in fortress mode. 
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Stack problem
« Reply #9 on: November 29, 2018, 08:00:52 pm »

As long as the regal robes you gave to the king don't end up on some peasant the next time you visit.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

GoblinCookie

  • Bay Watcher
    • View Profile
Re: Stack problem
« Reply #10 on: December 01, 2018, 07:23:50 am »

As long as the regal robes you gave to the king don't end up on some peasant the next time you visit.

The king is a historical character, presumably the historical characters would own items separately as part of the larger stack (the stack would store the info for "one of these is item X with Y artwork belonging to character Z".  The rest is best sorted out chicken style by having a pecking order of sorts, dividing up the privately owned items into separate stacks depending upon social status and then giving those in the top stack the first pick.  This means if there if there is an overall shortage of clothes, the king will still end up with clothes that there are available and the king would end up with the higher quality clothes, this because he is in the top stack. 

The tricky thing here is to arrange things so the game mechanics do not treat the historical characters the same as the non-historical ones.  In effect by considering the historical characters items as part of the larger stack we are able to arrange things so if there are 10 regal robes on site held by characters in general and an abstracted character steals 1 of these robes, there is a 10% chance they will steal the robe belonging to the king.  If they do the new stack will carry the information that it is the robe belonging to the king, if they don't we will get something like "item belongs to unknown person of Site government X"; in both cases the site will be happy when we return the item. 
Logged