hackclub / bag

A Slack based RPG system!
https://bag.hackclub.com
8 stars 2 forks source link

Rework economy from the ground up #14

Closed rivques closed 5 months ago

rivques commented 6 months ago

TODO: write down more about how anchor values work, etc.

The end result of this will be a big list of:

AverseABFun commented 6 months ago

A lot of this stuff should be in the bag-manifest repo, correct? Or at least all of the items and the time for crafting them?

rivques commented 6 months ago

Update: Spent some time dumping everything in a Google Sheet with the help of a script in rivques/bag-tools. However, I don't like this approach at all, as spreadsheets don't fit these data types well. I think tomorrow I'll take another attempt at analyzing the items with several scripts that can better adapt to the data structures and also aren't declarative.

I'm not sure yet if the economy is mathematically solvable. My hope is that if it's underdefined, and adding anchor values can make it solvable. If it's overdefined, however, (which it almost certainly is), that would mean that there are multiple ways to make the same item, which could prove tricky to balance well, as well as tricky to do math on.

The more I think about how I want to approach this, the harder the problem seems to get.

rivques commented 6 months ago

i've spend some more time thinking about it, here are some notes from the brainstorm: TLDR1: this problem, at least part of it, may be easier than i initially thought, but I won't know until I try, hopefully tomorrow TLDR2: intended value will probably be regulated via crafting and production times TLDR3: these tools will be called BEST, for Bag Economy Solver Tools

Bag economy solver tool (BEST) brainstorming

End goal: Figure out the best values of things in the bag economy.
What values?
- item intended values
- shop buy/sell prices
- item crafting/production times (maybe start with this one?)
what does "best" mean?
- promotes ~3% inflation (not sure if this is solvable with this system alone)
- promotes progression in gameplay (i.e., better in the long run to smelt ore into iron than to sell raw iron ore)
  - rigorously, items that are a further distance from raw materials are "more progressed"
- doesn't have one obvious meta

how to do this:
0. calculate the progression scores of each item. (each item can have multiple progresison scores because there can be more than one way to get that item)
0.1. go through all the actions and figure out what materials you can get from them.
0.2. manually filter out items whose main method of attaining is not thru raw materials (looking at specifically tanzanite dust here, maybe others)
0.3. make a breadth-first search from the raw materials through the recipe graph. store for each item that item's distance and the route to get there. maybe store the shortest 4ish distances?
0.4. take a look at this data and make sure it makes sense. assuming there's nothing that this alg ranks low-progression that should be much higher-progression:

a pause for a definition: an Abstract Time Unit (ATU) represents some later-defined amount of time and is something like a scaling factor. Setting one ATU to 2 minutes would make the game twice as slow as setting one ATU to 1 minute.

actually, this is much simpler than i thought. the easiest approach is this:
1. Have a human fully define the intended values (in ATUs) of each item.
2. Make a program that goes through all the recipes and figures out how long each recipe needs to take (in ATUS), based on the difference between the resulting item's value and the recipes' items' value, and a tool break % chance if it exists.
3. Decide on a gp/hour value and a value for ATUs, and from there, fill out each recipe's time in seconds.
it should be that simple.
ways this approach could fail:
- a negative crafting time is needed to make a value work. this means the product is less valuable than its ingredients, and should be solvable by adjusting one or more ingredient intended values or tweaking the recipe (perhaps to produce more product, or to require fewer ingredients).
- an unintended meta could emerge. not sure how to handle this.
- this approach doesn't make any attempt to control inflation with intended values (not sure if that's even possible) and leaves that up to other mechanisms, like genstore prices and prestige items
- excessively long crafting times could be required for some items. to alleviate this, tool break %s can be increased (because w/o tool break % tools would be considered worthless, as their cost would be spread out over infinitely many crafts)
rivques commented 6 months ago

Did a bunch of work in rivques/bag-tools for this method. It looks like it'll work, and I'm getting fairly reasonable values. Right now the workflow is very undocumented, and it'll stay that way until I nail down what it actually is.

rivques commented 6 months ago

finished working on Bag Economy Solver Tool (BEST) over at rivques/bag-tools. Now I just need to upload my new files to bag-manifest and complete #24 so the values are actually respected.

rivques commented 6 months ago

Blocked on #24