Cataclysm-dda: Gas station spacing. ( ones with a shop )

Created on 12 Sep 2016  ·  17Comments  ·  Source: CleverRaven/Cataclysm-DDA

The spawned gas stations the ones with a storefront ( non automated ones ) spacing is very tight for even small cars.

The spacing between the pumps is only 4 tiles and all cars are 4 tiles wide. That's a pretty tight fit

Might wanna increase the spacing to 5 to allow a vehicle and somewhere to stand to use the pumps. In the below image you can see a small truck at the top and the pump spacing at the station.

image

<Enhancement / Feature> Map / Mapgen

Most helpful comment

In all honestly one of those rows should be moved, and for about 50% of all gas stations diesel not even an option.

For the other 50%, 1-2 diesel pumps should be off to the side of the stations.

We should have truck stops in all honestly, that cater more to trucks and less to cars.

All 17 comments

In all honestly one of those rows should be moved, and for about 50% of all gas stations diesel not even an option.

For the other 50%, 1-2 diesel pumps should be off to the side of the stations.

We should have truck stops in all honestly, that cater more to trucks and less to cars.

truck stops would be interesting. Bunch of derelict trucks with rollmats and junk food scattered around. Maybe a few lot lizard zombies

Hmmmm Pisskop that's interesting, where I live almost all the gas stations have a deisel option on at least one pump. To be fair they also dispense gasoline too.

Discussion's been stalled on this for about 8 months – closing.

@Treah you've been active recently with PRs and issues. If you want this reopened for the sake of discussion/development, ping me here and I'll do so.

@Leland its cool I might consider making this a PR and changing this myself as I believe that this is a easy fix with just some text editing. Before I was pretty sure the PR would not be approved so its why I did not do it myself.

@Treah don't see any reason why it'd be denied! Go for it 👍

That pr would be very much appreciated.

Hmm does anyone know what this building is called in the json files? I cannot seam to find it anywhere.

@Treah it's hardcoded, unfortunately.

@Leland Ahh cool thats good to know, ill start tracking it down then.

Ohh lord. So yeah below is the function for pump placement from what I can tell. Can anyone more familiar with this generation code direct me where i can modify the values to change placements. There seams to be alot of randomness here...

void mapgen_gas_station(map *m, oter_id terrain_type, mapgendata dat, int, float density)
{
    int top_w = rng(5, 14);
    int bottom_w = SEEY * 2 - rng(1, 2);
    int middle_w = rng(top_w + 5, bottom_w - 3);
    if (middle_w < bottom_w - 5) {
        middle_w = bottom_w - 5;
    }
    int left_w = rng(0, 3);
    int right_w = SEEX * 2 - rng(1, 4);
    int center_w = rng(left_w + 4, right_w - 5);
    int pump_count = rng(3, 6);
    for (int i = 0; i < SEEX * 2; i++) {
        for (int j = 0; j < SEEX * 2; j++) {
            if (j < top_w && (top_w - j) % 4 == 0 && i > left_w && i < right_w &&
                 (i - (1 + left_w)) % pump_count == 0) {
                m->place_gas_pump(i, j, rng(1000, 10000));
            } else if ((j < 2 && i > 7 && i < 16) || (j < top_w && i > left_w && i < right_w)) {
                m->ter_set(i, j, t_pavement);
            } else if (j == top_w && (i == left_w + 6 || i == left_w + 7 || i == right_w - 7 ||
                      i == right_w - 6)) {
                m->ter_set(i, j, t_window);
            } else if (((j == top_w || j == bottom_w) && i >= left_w && i <= right_w) ||
                      (j == middle_w && (i >= center_w && i < right_w))) {
                m->ter_set(i, j, t_wall);
            } else if (((i == left_w || i == right_w) && j > top_w && j < bottom_w) ||
                      (j > middle_w && j < bottom_w && (i == center_w || i == right_w - 2))) {
                m->ter_set(i, j, t_wall);
            } else if (i == left_w + 1 && j > top_w && j < bottom_w) {
                m->set(i, j, t_floor, f_glass_fridge);
            } else if (i > left_w + 2 && i < left_w + 12 && i < center_w && i % 2 == 1 &&
                      j > top_w + 1 && j < middle_w - 1) {
                m->set(i, j, t_floor, f_rack);
            } else if ((i == right_w - 5 && j > top_w + 1 && j < top_w + 4) ||
                      (j == top_w + 3 && i > right_w - 5 && i < right_w)) {
                m->set(i, j, t_floor, f_counter);
            } else if (i > left_w && i < right_w && j > top_w && j < bottom_w) {
                m->ter_set(i, j, t_floor);
            } else {
                m->ter_set(i, j, dat.groundcover());
            }
        }
    }

That %4 before m->place_gas_pump looks suspicious. Try %5?

LOL yeah I guess I can revert to a trial and error methood. Sorry I know that the above post is kinda me asking for someone to do the change for me. Which i was not really intending.

@Treah you'd probably be better off asking around in IRC or the forums.

That code is _incredibly_ old, btw. Looks like it's mostly intact from pre-DDA, in this 7 year old commit https://github.com/CleverRaven/Cataclysm-DDA/commit/9cb78e8a83695955da8b63b9fedbc4070ea24f11.

@Leland
Its cool I am testing now with some changes and it looks like I might have figured it out.

Looks like it's mostly intact from pre-DDA, in this 7 year old commit 9cb78e8.

And even before that, it was just as hard to read, but also featured magic numbers! Woo. Thanks for the effort, @Treah.

Can it be jsonized? Then we can simply make several (correct) variants.

Was this page helpful?
0 / 5 - 0 ratings