New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Used pressure crystals: credit value scaling with explosion power #15933
Used pressure crystals: credit value scaling with explosion power #15933
Conversation
Damn a real use for toxins, maybe we need a proper explosives testing platform now. Is there anything stopping someone stacking 10 of these on a tile for one blast? |
Yes. Stacking doesn't work (i hope). You CAN harvest the same explosion with multiple crystals by doing this: line them up one per turf, in a line leading away from the epicenter. But by nature, each further crystal receives much less explosive power. (fixing this is beyond my ability, but it's also not that bad) |
boutput( user, "The reader reads <b>[crystal.pressure]</b> kiloblast." ) | ||
else | ||
boutput( user, "The reader reads a firm 0. It guilts you into trying to read an unexploded pressure crystal, and seems to have succeeded. You feel ashamed for being so compelled by a device that has nothing more than a slot and a number display.") | ||
boutput( user, "The reader reads a firm 0. It guilts you into trying to read an unexploded pressure crystal, and seems to have \ | ||
succeeded. You feel ashamed for being so compelled by a device that has nothing more than a slot and a number display.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know these didn't have them before but they probably should have style classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
planning to atomize the bulk of the pressure sensor stuff into another pr
desc = "A pressure crystal. We're not really sure how it works, but it does. Place this near where the epicenter of a bomb would be, \ | ||
then detonate the bomb. Afterwards, place the crystal in a tester to determine the strength.<br>\ | ||
Spent pressure crystals can be sold to researchers on the shipping market, for a credit sum depending on the measured power." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems... really verbose. Should some of this be moved over to a help message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh forgot about those, good point. It is done
@@ -529,9 +551,10 @@ TYPEINFO(/obj/item/device/transfer_valve/briefcase) | |||
boutput( user, "<b>There's no crystal in this here device!</b>") | |||
else | |||
if(crystal.pressure) | |||
boutput( user, "The reader reads <b>[crystal.pressure/25]</b> kilojoules." ) | |||
boutput( user, "The reader reads <b>[crystal.pressure]</b> kiloblast." ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a kiloblast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nonexistent unit (just like joules in _units.dm) :)
Anyway I looked into explosion power unit -> Joule conversion, but it is not worth it. So kiloblast is just 1:1 with an explosion's power value instead
This seems really neat, but the problem especially with TTVs is that if you can make one then you can make 20. A good solution to this might be giving diminishing returns for values close to previously shipped crystals, ie on selling a crystal, go through each previously shipped crystal and scale down the new profit value by the inverse of the distance between them. |
Alternative idea from dev chat: make it like requisitions where you get an order for a particular value of pressure crystal and are paid based on how close you get to it (and maybe also how high the value is?) |
Only after making this PR did I learn that the valve is mechscannable. I'd been guessing the time economy on manufacturing, setting up the test area, etc. would be comparable to what Cargo can do in the same time. Then Emily's cargo update went in today, lol I agree with diminishing returns on similar values. It's just gonna take me a while to puzzle through the math. Maybe I'll try something simpler like pregenerating a list of ranges w/ scaling multipliers, and fitting sold crystals into those edit: hang on, this range list idea actually makes it super simple to make faux-requisitions, too... just increase the value of a few random ranges, and send a paper listing them to cargo, all on round start! |
Scope creep has arrived on scene. Please check out the newly updated PR description |
@@ -1,6 +1,13 @@ | |||
#define SUPPLY_OPEN_TIME 1 SECOND //Time it takes to open supply door in seconds. | |||
#define SUPPLY_CLOSE_TIME 15 SECONDS //Time it takes to close supply door in seconds. | |||
|
|||
#define PRESSURE_CRYSTAL_VALUATION_FORMULA ** 1.1 * 400 /// The full explosion-power-to-credits conversion formula | |||
#define PRESSURE_CRYSTAL_SALES_RANGE_LENGTH 5 /// The span size of each range for the pressure crystal sales list. Measured in explosion power |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 power either side is very hard to get right, it'd make more sense to scale it by proximity rather than have a sharp cutoff
proc/appraise_pressure_crystal(var/obj/item/pressure_crystal/pc, var/sell = 0) | ||
if (pc.pressure <= 0) | ||
return | ||
var/index = "[ceil(pc.pressure / PRESSURE_CRYSTAL_SALES_RANGE_LENGTH)]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure what this index system is supposed to be doing, but it's it doesn't seem like it's going to prevent slightly diluting the mix a few times to get different enough values to trick the system. I suggest making it gradually scale by proximity instead, so a lot of similar values will all dilute any more sales in the approximate area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The index takes a measured pressure and converts it into an integer, which represents a range. e.g. pressure of 27.4 gets fit into the range of 25-30. Then if it gets sold, the index of the 25-30 range gets an entry in the sales list as a key, with its value as a multiplier (rand 0.3 to 0.6)
After that, credit value for pressures in that range receives that multiplier. Which stacks multiplicatively with further sales.
It's not perfect: has a hard cutoff, like you say. But I don't have the knowledge to make the system you're describing.
edit: I should mention, this does have an upside! Concrete ranges w/ values that are visible to players is pretty user-friendly.
Rewrite pressure crystal appraisal to use scaling values
[GAME OBJECTS] [SCIENCE] [FEATURE]
About the PR
Why's this needed?
Fun and purpose for toxin lab. They can contribute to the budget, but they have to go do field work and expend lab equipment. Also pressure crystals report real explosion power now, to compare results and do Science™
Can also deliberately test detonate artifact bombs, for reliably more credit value than selling it.
Developers please tweak and change all the balance values you want.
There are some defines at the top of shippingmarket.dm for balance tweaks.
Here's some reference credit values with the formula: explosion_power ^ 1.1 * 100 = credits
Changelog