Skip to content

Commit

Permalink
Make bicycles more likely to exist (#37457)
Browse files Browse the repository at this point in the history
* Make bicycles more likely to exist

Prior to this change, bicycles had only a 3% chance among the vehicle
pool (less than half that of armored vehicles) on city streets.
This seemed way too low, so I wanted to give bikes a fairer chance.

Fixes #37451

This commit changes three vehicle groups, including:

city_vehicles:
- Bicycle equally likely as the standard car,
  or twice as likely as a Hippie Van.
- Dirt bike as likely as a Hatchback or Hippie Van
- Electric bicycle as likely as a Beetle or RV

suburban_home:
- Bicycle as likely as standard car
- Dirt bike as likely as SUV
- Electric bicycle possible, as likely as scooter or sports car

parkinglot:
- Bicycle as likely as car or flatbed truck
- Dirt bike possible, as likely as hatchback or motorcycle

* Reduce bicycle spawn frequency somewhat

Based on PR feedback from other devs/players, I'm dialing back the
bicycle spawn frequency significantly from my previous commit.

The total adjustment now is that bicycles are roughly 1.5 - 2 times as
likely to appear in city streets, suburban homes, and parking lots, as
they are in the current experimental branch.

Adjustments made in this commit include:

In "city_vehicles" (i.e. in streets everywhere):

- "bicycle" weight is 800 (originally 400), making them
  rarer than "car", "car_hatch", "ambulance", or "hippie_van",
  but more likely than "beetle", "car_mini", "bus", "rv", or "4x4_car".
  Same chance of spawning as a "pickup" or "suv".

- "bicycle_dirt" weight is 200 (originally 0, impossible), making them
  as likely as "suv_electric", "motorcycle", "truck_swat", or "fire_engine"

- "bicycle_electric" weight is back to 100 (originally 100)

In "suburban_home":

- "bicycle" weight is now 200 (originally 150),
  same chance as "4x4_car" or "motorcycle"

- "bicycle_dirt" weight is now 150 (originally 125),
  same chance as "car_anmlcmpt"

And in "parkinglot":

- "bicycle" weight left at 1000 (originally 500)

- "bicycle_dirt" removed again (back how it was before)

Partially fixes #37451

* Add a bike shed to house08 and house_patio

To get a few more pedal-powered bicycles and parts into the world in a
less conspicuous way than simply spamming them onto the city streets

Fixes #37451

As suggested by @I-am-Erk, this adds a 6x6 nestable mapgen module
containing a simple metal bike shed. It's modeled after the 6x6_junk
shed, with flimsier metal walls, but still having locked (pickable)
metal doors, so it's not a total smash-and-grab.

Inside the shed is a 50% chance of finding a "bikeshop" vehicle, most
often a "bicycle", "bicycle_dirt", or "bicycle_electric", but with some
chance of "tandem", "scooter", "unicycle" etc.

It's furnished with a workbench and metal shelf, across which there is a
low (10%) chance of seeing 1-3 "bikeshop_tools", usually a bike part
(wheel, horn, foot crank, saddle) but sometimes such goodies as a wrench,
screwdriver set, duct tape, or even (very low chance) a toolbox!

I found two houses where this shed seems to fit well with the layout
("house08" and "house_patio"), and included the new bike shed with the
same probability as "shed_6x6_woodworker".

* Have correctly linted JSON

My JSON failed linting, now it should work

* Remove the trailing newline

To see if that is enough lint removal
  • Loading branch information
wapcaplet committed Jan 30, 2020
1 parent 3045555 commit 7a6ccdd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
1 change: 1 addition & 0 deletions data/json/mapgen/house/house08.json
Expand Up @@ -58,6 +58,7 @@
[ "greenhouse_6x6_vegetable", 25 ],
[ "pond_6x6", 25 ],
[ "shed_6x6_junk", 25 ],
[ "shed_6x6_bike", 25 ],
[ "shed_6x6_woodworker", 25 ]
],
"x": 15,
Expand Down
1 change: 1 addition & 0 deletions data/json/mapgen/house/house_patio.json
Expand Up @@ -69,6 +69,7 @@
[ "greenhouse_6x6_vegetable", 25 ],
[ "pond_6x6", 20 ],
[ "shed_6x6_junk", 25 ],
[ "shed_6x6_bike", 20 ],
[ "shed_6x6_woodworker", 20 ]
],
"x": 1,
Expand Down
28 changes: 28 additions & 0 deletions data/json/mapgen/nested/house_nested.json
Expand Up @@ -1638,6 +1638,34 @@
]
}
},
{
"type": "mapgen",
"method": "json",
"//": "a nested map for lawns",
"nested_mapgen_id": "shed_6x6_bike",
"object": {
"mapgensize": [ 6, 6 ],
"rotation": [ 0, 3 ],
"rows": [
"||||||",
"| +",
"| B|",
"| B|",
"+ S|",
"||||||"
],
"terrain": {
"|": "t_scrap_wall",
"+": "t_door_metal_pickable",
" ": "t_thconc_floor",
"S": "t_thconc_floor",
"B": "t_thconc_floor"
},
"furniture": { "T": "f_trashcan", "S": "f_utility_shelf", "B": "f_workbench" },
"place_vehicles": [ { "vehicle": "bikeshop", "x": 1, "y": 2, "rotation": 270, "chance": 50 } ],
"place_items": [ { "item": "bikeshop_tools", "x": 4, "y": [ 2, 4 ], "chance": 10, "repeat": [ 1, 3 ] } ]
}
},
{
"type": "mapgen",
"method": "json",
Expand Down
10 changes: 6 additions & 4 deletions data/json/vehicle_groups.json
Expand Up @@ -14,7 +14,8 @@
[ "suv_electric", 120 ],
[ "car_mini", 400 ],
[ "beetle", 500 ],
[ "bicycle", 400 ],
[ "bicycle", 800 ],
[ "bicycle_dirt", 200 ],
[ "bicycle_electric", 100 ],
[ "motorcycle", 200 ],
[ "motorcycle_cross", 20 ],
Expand Down Expand Up @@ -165,8 +166,9 @@
[ "suv_electric", 120 ],
[ "pickup", 300 ],
[ "portable_generator", 50 ],
[ "bicycle", 150 ],
[ "bicycle_dirt", 125 ],
[ "bicycle", 200 ],
[ "bicycle_dirt", 150 ],
[ "bicycle_electric", 100 ],
[ "tricycle", 5 ],
[ "4x4_car", 200 ]
]
Expand Down Expand Up @@ -211,7 +213,7 @@
[ "hippie_van", 750 ],
[ "golf_cart", 300 ],
[ "scooter", 300 ],
[ "bicycle", 500 ],
[ "bicycle", 1000 ],
[ "rara_x", 300 ],
[ "unicycle", 100 ],
[ "bicycle_electric", 200 ],
Expand Down

0 comments on commit 7a6ccdd

Please sign in to comment.