Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: A reply about stack combining  (Read 1072 times)

Quatch

  • Bay Watcher
  • [CURIOUSBEAST_ GRADSTUDENT]
    • View Profile
    • Twitch? Sometimes..
A reply about stack combining
« on: August 28, 2008, 11:50:33 am »

I'm leaning toward not suppressing the information by using some extra objects (could use the same ones as the interface would I guess, though there are all sorts of ways to think about it).

Can't you just create a new "stack" container that would be created by stacking two objects of the same types (bolts, coins, ...) and destroyed when it contains only one object?

This is roughly what I meant by "extra objects", except for the "just" part.  The main point is that it's not only an interface problem.  If items are potentially contained in fake stack items, all the job handling needs to be revised to support that.  It's a bit less of a pain if you restrict to only coins or bolts say, but there are still things to be considered.  Take bolts for example.  Your guy wants to equip some.  First it needs to recognize the container as a valid ammo object.  Depending on exactly what you choose to stack, some members might not be as eligible as others -- what if some in the stack were forbidden, or tasked for a job, prior to stack formation, for example?  Those cases would need to be disallowed or handled.  Then the equipment checker needs to realize he's got the bolts when he places the container in his quiver.  Not so bad, possibly handled by current code, but something to check.  Now he wants to fire a bolt -- shooting needs to be rewritten to support bolts in the fake objects.  Sort of a piece of the quiver code already, maybe nothing needs to be touched at all, but takes some checking and testing.  There are side issues like valuations and stocks screen stuff, which might be handled already, and other thises and thats (environmental functions would need to be taught about fake containers -- rain for example should get the bolts wet, but currently there's no mechanism for jumping through a container on the ground to get the inside stuff wet, I think, since containers are generally real -- not hard, but yet another issue), as well as any applicable storage jobs, which run into some of the first problems I mentioned.  As you get to other objects, like food, you inherit more difficulties (vermin need to see and realize that they can eat food in stacks for free, etc. etc.).  As far as I can tell, the problem is not super difficult, and a lot of the issues just need a nudge one way or the other, or no nudge at all, but there are a Lot of issues that turn this into a tedious and long haul.  There's generally more to do and check than people expect.

What about adding a task at a boyer's shop to recombine bolt stacks, not unlike melting objects at a smelter. Old stacks are destroyed, a new stack is made. It would centralize the code changes to be only in one place.
Logged
SAVE THE PHILOSOPHER!
>>KillerClowns: It's faster to write "!!science!!" than any of the synonyms: "mad science", "dwarven science", or "crimes against the laws of god and man".
>>Orius: I plan my forts with some degree of paranoia.  It's kept me somewhat safe.

Granite26

  • Bay Watcher
    • View Profile
Re: A reply about stack combining
« Reply #1 on: August 28, 2008, 12:23:36 pm »

Doesn't seem like a horrible idea, but my kneejerk reaction is that it's a little too much work for a halfway solution that wouldn't be useful code for the longterm solution.

Stroke of Genius::  Stacks are currently 2 things.  First, they serve as a optimization 'class' for the code to abstract information about a set of things that are A: all created at the same time, and B: Have the same set of information (creator, age, images, quality, etc).  The second is to serve as a physical grouping for objects in the game world.  (There's 30 coins in my pocket).  Why not separate those functions?

Technical Coding stuff
Spoiler (click to show/hide)

Anyway, this would still require the hinted at total rewrite of the way dwarves think about stacks, but it's a pretty elegant way to do it.  You wouldn't be treating a stack of similar items as any different from a pocket full of disparate coins.

Spoiler (click to show/hide)

Sharp

  • Bay Watcher
    • View Profile
Re: A reply about stack combining
« Reply #2 on: August 31, 2008, 08:32:53 am »

How about a quiver can hold 20 items (so it could hold 20 stacks of 20 bolts) but marksdwarves/hunters will only pickup a certain weight of bolts say up to 700, or until it affects thier speed to a certain level (like will stop getting more bolts if speed reduces by 10% or w/e), that way stacks don't need to be recombined as they can just be collected individually by the marksdwarf, it won't save on the clutter but it means stronger dwarves can carry more ammo which makes sense.
Logged

LegacyCWAL

  • Bay Watcher
    • View Profile
Re: A reply about stack combining
« Reply #3 on: August 31, 2008, 02:02:52 pm »

But being able to cram more ammo into a limited volume - which a quiver is - doesn't make sense.  It doesn't matter if your badass ultra-soldier can carry 700 bolts without breaking a sweat, there's no way he's fitting a tenth that many into any quiver I've ever heard of.

I think a better way is to let a quiver carry a certain number of bolts.  For instance, if it's decided that a quiver holds 25 bolts, then a stack will fill it, but if the marksdwarf only has 15 shots left, he can go pick up stray bolts and small stacks until he gets to or passes 25.  It'd be like how multiple bags can be stored in a barrel.  Only, you know, bolts.
Logged
HIDE THE WOMEN AND DROWN THE CHILDREN, THE BARON HAS ARRIVED.

Granite26

  • Bay Watcher
    • View Profile
Re: A reply about stack combining
« Reply #4 on: August 31, 2008, 02:05:24 pm »

right right right, that's all well and good, but the problem is that the developer has said that that is hard and has an insufficient return on investment to make it work. 

That means that people are looking for good simple alternatives to be used as workarounds until the stack code is reformulated.

LegacyCWAL

  • Bay Watcher
    • View Profile
Re: A reply about stack combining
« Reply #5 on: August 31, 2008, 02:14:20 pm »

*shrug* then set it to the weight of 25 (or whatever) bolts.  That winds up the same as mine and the post I replied to.  My main point was just mostly that 700 bolts simply won't fit in a quiver, regardless of how strong the guy carrying them is.
Logged
HIDE THE WOMEN AND DROWN THE CHILDREN, THE BARON HAS ARRIVED.

Draco18s

  • Bay Watcher
    • View Profile
Re: A reply about stack combining
« Reply #6 on: August 31, 2008, 02:30:26 pm »

I'd like to point out that there is ALREADY code for picking up multiple stacks of bolts and putting them in a quiver.  Marksdwarves just don't do it all the time for some unknown reason.
Logged

LegacyCWAL

  • Bay Watcher
    • View Profile
Re: A reply about stack combining
« Reply #7 on: August 31, 2008, 02:49:30 pm »

If it ain't in the game, it ain't in the game, regardless of whether it's due to not being in at all or whether it's due to being in but not working.
Logged
HIDE THE WOMEN AND DROWN THE CHILDREN, THE BARON HAS ARRIVED.

Sharp

  • Bay Watcher
    • View Profile
Re: A reply about stack combining
« Reply #8 on: September 01, 2008, 05:47:45 am »

*shrug* then set it to the weight of 25 (or whatever) bolts.  That winds up the same as mine and the post I replied to.  My main point was just mostly that 700 bolts simply won't fit in a quiver, regardless of how strong the guy carrying them is.

Yeah but the problem with that is that weights depend on the material, a 25 stack of copper bolts ways quite a fair load more then 25 adamantite bolts, also I did say that the quiver to only hold 20 items to the theoretical max would be 20*25 = 500 bolts. Also note that I said some max weight for the quiver such as 700 which would be around a stack of 25 copper bolts I believe but those are just editable numbers the main point I was getting to is so dwarves can hold multiple single stacked bolts in a quiver. I dunno how much the code could be tweaked to make it vary so you wont get a dwarf holding 500 bolts.

Also a dwarf can hold 700 bolts in a quiver if you make a stack of 700 bolts, unless its adamantite though that dwarf ain't gonna be moving very fast.
Logged

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: A reply about stack combining
« Reply #9 on: September 01, 2008, 08:51:04 am »

*shrug* then set it to the weight of 25 (or whatever) bolts.  That winds up the same as mine and the post I replied to.  My main point was just mostly that 700 bolts simply won't fit in a quiver, regardless of how strong the guy carrying them is.

Just set it so that it is a amount of weight or a maximum total, whichever is reached first.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.