Skip to content
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

Rubik has random debt depth #64226

Closed
Cenness opened this issue Mar 13, 2023 · 9 comments · Fixed by #71594
Closed

Rubik has random debt depth #64226

Cenness opened this issue Mar 13, 2023 · 9 comments · Fixed by #71594
Labels
[JSON] Changes (can be) made in JSON NPC / Factions NPCs, AI, Speech, Factions, Ownership (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Cenness
Copy link

Cenness commented Mar 13, 2023

Describe the bug

Each vendor in multiple exodii bases has a separate and random value for how much they can owe player, ranging in my testing from $100 to $700.

Having low values forces player to find another exodii base or an autodoc to install high value cbm.

Attach save file

Baseline-trimmed.tar.gz

Steps to reproduce

  1. Find/spawn exodii_base
  2. Rubik can owe you $100 max
  3. Find/spawn another exodii_base
  4. Rubik can owe you $700 max

Expected behavior

  • random values should be always higher than installation cost of the most pricy cbm
  • first exodii base should despawn right before you find another one

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.2604 (22H2)
  • Game Version: c50f83d [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda]
    ]

Additional context

No response

@Cenness Cenness added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Mar 13, 2023
@PatrikLundell
Copy link
Contributor

I don't see any reason for why there should be any relation between CBM installation costs and the maximum dept Rubik is willing to be in.

It would be horrible to go on an exploration trip and have your reasonably conveniently located Exodii base teleport away.
It is true that multiple "unique" locations is a problem, but it would be even worse to have only one spawn only to have it immediately be destroyed by threats (mycus, fire ants, etc.). Until there is a way to ensure the "unique" locations remain safe from random destruction and are accessible (not e.g. on an island with a broken bridge generated, or a mycus field covering the only path) multiple instances is less bad.

@Cenness
Copy link
Author

Cenness commented Mar 14, 2023

why there should be any relation between CBM installation costs and the maximum dept

Because exodii are supposed to be the only source for cbms. So I'm assuming autodocs will not be able to install cbms in future. And problems with globally_unique will be fixed somewhen in future, no doubt, so you won't be able to reroll max debt.
If installation cost of a cbm is greater than max debt player can't get it installed.

go on an exploration trip and have your reasonably conveniently located Exodii base teleport away

first exodii base should despawn right before you find another one

@PatrikLundell
Copy link
Contributor

Unless things have changed since I last played, you pay for CBM installation at the time of installation. If, however, the implementation has changed such that installation cost has to be drawn from an account into which you have to deposit before a CBM installation can be performed, yes, the account should be able to contain enough funds to cover every installation your current trust level allows.

I obviously don't understand what your "despawn" comment is supposed to mean, so just repeating it louder doesn't provide any additional understanding. Despawn just before detection of another one seems like teleporting it to me (although I guess despawn might mean reset of any progress as well as a move to a worse location.

@RAldrich
Copy link
Contributor

By "despawn" They're asking for the Exodii base to be made a globally unique location through the specific mechanism of removing old locations when you discover a new one.

This is not possible for a variety of reasons, and while many people are interested in globally unique NPC locations, removing already discovered locations is not a solution we're considering. If you'd like to learn more please search for the various existing issues on the subject.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@github-actions github-actions bot added the stale Closed for lack of activity, but still valid. label Apr 18, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2023
@I-am-Erk
Copy link
Member

I-am-Erk commented Dec 12, 2023

This probably should be solved, rubik shouldn't really accept any debt at all. EDIT: If this is the amount of money they're willing to owe to the player, that's another story... it's not a big problem if they owe the player money nor for that to be variable. It would be nice to have a little more consistency though.

@I-am-Erk I-am-Erk reopened this Dec 12, 2023
@I-am-Erk I-am-Erk removed the stale Closed for lack of activity, but still valid. label Dec 12, 2023
@RenechCDDA
Copy link
Member

RenechCDDA commented Dec 13, 2023

This is definitely the amount Rubik is willing to owe you. So you can trade them... IDK, 10 thingies and they'll owe you $100. But if you trade them 1000 thingies, they're still only willing to owe you $100. Rubik's is variable because it depends at least partly on their altruism! And remember: altruism is randomized!

The calculation is in npc::max_credit_extended.

Cataclysm-DDA/src/npc.cpp

Lines 2074 to 2093 in 3c95a24

int npc::max_credit_extended() const
{
if( is_player_ally() ) {
return INT_MAX;
}
const int credit_trust = 50;
const int credit_value = 50;
const int credit_fear = 50;
const int credit_altruism = 100;
const int credit_anger = -200;
return std::max( 0,
op_of_u.trust * credit_trust +
op_of_u.value * credit_value +
op_of_u.fear * credit_fear +
personality.altruism * credit_altruism +
op_of_u.anger * credit_anger
);
}

It would be pretty simple to short-circuit this logic with a flag if desired.

If we wanted to instead change the way NPCs generate so that Rubik (or other templated NPCs) have a specific personality setup (so their willingness to extend credit would always be the same), I would classify that as moderately tedious but technically easy. Can already be done, see below.

@I-am-Erk
Copy link
Member

We can just define Rubik's altruism as a flat value, there's an option for that already

@RenechCDDA
Copy link
Member

Oh, so there is. Well it's VERY easy when it already exists.

So rubik's definition, here:

{
"type": "npc",
"id": "exodii_merchant",
"name_suffix": "Cyborg",
"class": "NC_EXODII_TYPE_1_Merchant",
"name_unique": "Rubik",
"attitude": 0,
"mission": 3,
"chat": "TALK_EXODII_MERCHANT",
"faction": "exodii"
},

Needs a defined personality, like this: (Not these values exactly! Probably!)

  "personality": {
    "aggression": -1,
    "bravery":  2,
    "collector":  -3,
    "altruism":  4
  }

The NPCs.md documentation for reference: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/NPCs.md#npc-instance-definition

@RenechCDDA RenechCDDA added NPC / Factions NPCs, AI, Speech, Factions, Ownership (S2 - Confirmed) Bug that's been confirmed to exist [JSON] Changes (can be) made in JSON and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[JSON] Changes (can be) made in JSON NPC / Factions NPCs, AI, Speech, Factions, Ownership (S2 - Confirmed) Bug that's been confirmed to exist
Projects
Status: Completed
5 participants