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

map_in_city says you're not in a city when you very clearly are #74177

Closed
Standing-Storm opened this issue May 30, 2024 · 4 comments · Fixed by #74191
Closed

map_in_city says you're not in a city when you very clearly are #74177

Standing-Storm opened this issue May 30, 2024 · 4 comments · Fixed by #74191
Assignees
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility

Comments

@Standing-Storm
Copy link
Contributor

Describe the bug

When working on #74175, I noticed that map_in_city would repeatedly return false even when I was clearly inside the city limits.

Attach save file

Darfur-trimmed.tar.gz

Steps to reproduce

  1. Place the following JSON somewhere where it loads:
    { "type": "effect_on_condition", "id": "EOC_CONDITION_CHECK_HOMULLUS_IN_CIVILIZATION_ON_OMT_ENTER", "eoc_type": "EVENT", "required_event": "avatar_enters_omt", "condition": { "u_has_trait": "HOMULLUS" }, "effect": [ { "run_eocs": [ { "id": "EOC_CONDITION_CHECK_HOMULLUS_IN_CIVILIZATION_ON_OMT_ENTER_2", "condition": { "or": [ { "test_eoc": "EOC_CONDITION_HOMULLUS_NEAR_FACTION" }, { "map_in_city": { "mutator": "loc_relative_u", "target": "(0,0,0)" } } ] }, "effect": [ { "math": [ "u_homullus_is_in_civilization", "=", "1" ] }, { "u_message": "You are in a civilized OMT." } ], "false_effect": [ { "math": [ "u_homullus_is_in_civilization", "=", "0" ] }, { "u_message": "You are NOT in a civilized OMT." } ] } ] } ] }

  2. Load game.

  3. Run west. Check when you start receiving the "You are NOT in a civilized OMT" and compare it to the city area on the map.

Expected behavior

map_in_city matches the city limits that are visible on your map.

Screenshots

map_in_city returned false for this location:

image

Once I moved north to here, it returned true:

image

Similarly, over here on the edge of town returns true:

image

But this spot returns false:

image

it's not until two OMTs to the east of that picture that it begins returning true.

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.4291 (22H2)
  • Game Version: cdda-experimental-2024-05-28-2212 bf808f6 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Portal Storms Ignore NPCs [personal_portal_storms],
    Slowdown Fungal Growth [no_fungal_growth],
    Xedra Evolved [xedra_evolved]
    ]

Additional context

No response

@Standing-Storm Standing-Storm added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label May 30, 2024
@Standing-Storm Standing-Storm changed the title map_in_city is inconsistent map_in_city says you're not in a city when you very clearly are May 30, 2024
@Procyonae
Copy link
Contributor

If I get the time I'll make the new city check from #71822 it's own PR and hook up everything to that, other than maybe non 0 city distance bc idk if that would be performance efficient or not

@Procyonae Procyonae self-assigned this May 30, 2024
@Procyonae
Copy link
Contributor

If you're not on z0 how do you think it would be best to work?

@Standing-Storm
Copy link
Contributor Author

If you're not on z0 how do you think it would be best to work?

Hmm. I would count any distance up (I think skyscrapers go up to Z: 9), and down to -1 at least for basements and the sewers. A cylinder would be easier but you'd end up with circumstances where some labs were partially in a city and partially not--not sure if subterranean labs should count as in the city or not.

@Brambor
Copy link
Contributor

Brambor commented May 30, 2024

Edit: pretty much the above comment

I would argue against it, since you can run around the underground, not knowing there is a city above you.

On the other hand, if you are in a cellar in a building, you still are in a city... So leaking that information isn't that bad. But then maybe mark it as a city only from z=-1 (deepest cellar) up as a compromise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(S1 - Need confirmation) Report waiting on confirmation of reproducibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants