CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.58k stars 4.16k forks source link

Allow NPCs sent on Faction Camp Missions to use vehicles owned by the player faction #52113

Closed AmarinReyny closed 1 year ago

AmarinReyny commented 3 years ago

Is your feature request related to a problem? Please describe.

From an immersion perspective, it seems weird to me that NPCs aren't able to utilize unused vehicles owned by the player faction in order to make their jobs easier.

Describe the solution you'd like

I have an idea in which you would be able to select a vehicle for an NPC to take with them when you send them out on missions. Vehicles could probably have certain "qualities" assigned to them based on things like how fast they can go, how much cargo space they have, and even things like what their exterior parts are made of or any turrets they might have, which could modify certain aspects of the faction camp mission - like, maybe a vehicle with over a certain amount of cargo space would have a "cargo transportation" quality, which would increase the speed at which constructions are completed or the amount of items obtained in foraging/hunting/other resource-obtaining missions, or a vehicle with a certain amount of boards on exterior tiles would or a working turret would have a "combat" quality which would reduce the riskiness of risky missions. Speed would probably have a small impact on everything the vehicle does for the mission. And, the more stuff contributing to any given quality, the higher the quality would be, thus the more the vehicle's qualities would contribute to the mission. Maybe in addition to that, the driving skill of the NPC could influence how much of that contribution is applied.

When you assign the vehicle to the follower, the vehicle would disappear until the mission is complete, and would reappear when the follower returns to camp, with some fuel gone and/or some damage to random parts.

Not only would it improve immersion, it would also give more options for "mechanic" type characters, who could improve their faction with a fleet of vehicles for their followers to use.

Describe alternatives you've considered

Pretending that my survivor is the only survivor in the entire post-Cataclysm world who actually drives vehicles

Additional context

Add any other context (such as mock-ups, proof of concepts or screenshots) about the feature request here.

morthein commented 3 years ago

This could be interesting. Not only could they do long range missions in a shorter time, but it could damage (or destroy) the vehicle based on the skill of driving of the NPC.

PatrikLundell commented 3 years ago

It would probably be tricky to implement, as you can't drive on most of the map. It certainly would make logical sense to have a companion set to cut trees on a tile adjacent to the field a field base camp is placed on use a vehicle to go to the forest, cut trees and load them up onto the vehicle, and drive back to deliver the logs, but figuring out how close you can get to the designated tile and how long you'd have to drive to reach it (if there are tiles you can't drive through in the way so you'd have to go around) wouldn't be trivial. Similarly, a combat patrol in a vehicle should be restricted to routes you can actually drive along.

To make it clear: I like the idea, but I think it would be hard to implement with any amount of detail.

AmarinReyny commented 3 years ago

It would probably be tricky to implement, as you can't drive on most of the map. It certainly would make logical sense to have a companion set to cut trees on a tile adjacent to the field a field base camp is placed on use a vehicle to go to the forest, cut trees and load them up onto the vehicle, and drive back to deliver the logs, but figuring out how close you can get to the designated tile and how long you'd have to drive to reach it (if there are tiles you can't drive through in the way so you'd have to go around) wouldn't be trivial. Similarly, a combat patrol in a vehicle should be restricted to routes you can actually drive along.

To make it clear: I like the idea, but I think it would be hard to implement with any amount of detail.

I didn't think about that before, but now that you've mentioned it, I think I have a solution. Maybe one of the qualities a vehicle can have is "one tile wide," which is assigned by default but taken away if the vehicle ever becomes more than one tile wide.

Then, when an overmap tile is selected, the game automatically calculates the route the assigned NPC would have to take, and if there are no possible routes to the overmap tile that would only consist of roads, bridges, and fields, then the game removes any vehicles that are wider than one tile from the list of possible vehicles to assign. Not only that, but if what Morthein suggested is implemented, a higher driving skill would be required to avoid damaging or destroying the vehicle even with the one tile wide quality.

Furthermore, this gives me another idea - if there are routes that could lead to the tile by road/bridge/field, but those routes are very long and roundabout routes while the selected overmap tile is only a short distance away, maybe there could be a way to calculate two potential routes, one the roundabout way with the easier terrain, and the other the shorter way with the more difficult terrain, and have the player select which route they want the assigned NPC to use.

PatrikLundell commented 3 years ago

Have you tried driving single tile wide vehicles through woods? I've done it once for a fairly short distance along a trail, and that was a royal pain that still required the bashing of some blocking vegetation. The only kind of vehicle I'd consider usable in a forest is a single tile one, such as a mech, and even then you'd have issue getting past vegetation (if mechs can't go through bushes etc. like humans can, and a Segway would still need a clear path).

AmarinReyny commented 3 years ago

Have you tried driving single tile wide vehicles through woods? I've done it once for a fairly short distance along a trail, and that was a royal pain that still required the bashing of some blocking vegetation. The only kind of vehicle I'd consider usable in a forest is a single tile one, such as a mech, and even then you'd have issue getting past vegetation (if mechs can't go through bushes etc. like humans can, and a Segway would still need a clear path).

Fair... Maybe the quality that lets a vehicle pass through forest overmap tiles would be one tile, rather than one tile wide, and/or the percentage of clear overmap tiles in the selected route would be the percentage to which the vehicle's speed actually benefits the time/results of the mission, with a route that has no clear tiles causing no benefit to be received from the vehicle's speed?

PatrikLundell commented 3 years ago

I don't think you can have any storage in a single tile vehicle, and I'm not even sure you can construct one that you can ride, i.e. fit controls, wheels, saddle, engine, fuel tank,... into a single tile. If you can, however, I agree you could get some speed benefit from open tiles, and would probably get zero benefit from forest swamp tiles (although the swamp tiles seem to be rather deadly nowadays...).

AmarinReyny commented 3 years ago

I don't think you can have any storage in a single tile vehicle, and I'm not even sure you can construct one that you can ride, i.e. fit controls, wheels, saddle, engine, fuel tank,... into a single tile. If you can, however, I agree you could get some speed benefit from open tiles, and would probably get zero benefit from forest swamp tiles (although the swamp tiles seem to be rather deadly nowadays...).

I vaguely remember seeing someone's design for a one-tile vehicle that could be ridden, though that still leaves the problem of storage. Although, maybe another vehicle quality could be "push cart," where its use in the route calculations basically assumes that the NPC is pulling it along manually like a shopping cart or wheelbarrow, instead of actually driving it?

PatrikLundell commented 3 years ago

A shopping cart is probably the best "vehicle" for for hauling loot manually, but it does have the issue that you have to be strong enough to pull (or push) it, with varies with the terrain and how much weight you're moving. You can make a vehicle with a larger storage capacity, but it will be heavier, probably restricting the amount of loot you can move as you reach the weight limit faster than the storage capacity. It might be possible to use more suitable wheels than castor wheels as well, but you'd probably need something that doesn't require an axle.

AmarinReyny commented 3 years ago

A shopping cart is probably the best "vehicle" for for hauling loot manually, but it does have the issue that you have to be strong enough to pull (or push) it, with varies with the terrain and how much weight you're moving. You can make a vehicle with a larger storage capacity, but it will be heavier, probably restricting the amount of loot you can move as you reach the weight limit faster than the storage capacity. It might be possible to use more suitable wheels than castor wheels as well, but you'd probably need something that doesn't require an axle.

In any case, I was thinking that the difficulty of the terrain would be calculated based on the overmap tile, not on the individual tiles within it.

PatrikLundell commented 3 years ago

Yes, but even in such an abstract calculation you ought to factor in the terrain's restriction on the cargo moved. If I were to design it I'd probably say swamp has a difficulty of X, fields of Y, roads of Z, etc., with the companion being smarter than the PC (unusual) in that the companion would calculate in advance what the maximum cargo would be (whereas the PC only finds out when suddenly unable to move the vehicle, or get straining pain from trying). Difficult terrain would probably also have to get a route extension based on an estimate of how much you'd have to move around obstacles.

AmarinReyny commented 3 years ago

Yes, but even in such an abstract calculation you ought to factor in the terrain's restriction on the cargo moved. If I were to design it I'd probably say swamp has a difficulty of X, fields of Y, roads of Z, etc., with the companion being smarter than the PC (unusual) in that the companion would calculate in advance what the maximum cargo would be (whereas the PC only finds out when suddenly unable to move the vehicle, or get straining pain from trying). Difficult terrain would probably also have to get a route extension based on an estimate of how much you'd have to move around obstacles.

Fair... Going with what I said earlier about how the amount of a certain quality a vehicle has can vary, any vehicles with the "push cart" quality would be treated as only having a maximum Cargo Transportation quality of 1, regardless of what it would actually be otherwise? That way, even if a vehicle has over two hundred liters of cargo space available, it would be treated as less for the purposes of the NPC's mission.

As for the route extension thing... I dunno, if we're already going with the least amount of benefit Cargo Transportation could potentially provide, and with vehicle speed not being a factor anyway, maybe push carts should just give a flat percentage bonus to the amount of time it takes to complete the mission instead of having their individual stats accounted for. It wouldn't be a big bonus, but it would still be better than nothing.

PatrikLundell commented 3 years ago

You're right in that extra time to move around obstacles works against extra cargo capacity as you're basically trading a longer travel time against fewer trips. Which way to go would depend on how detailed the "simulation" implemented would be, which would be up to whoever would actually implement it.

AmarinReyny commented 3 years ago

You're right in that extra time to move around obstacles works against extra cargo capacity as you're basically trading a longer travel time against fewer trips. Which way to go would depend on how detailed the "simulation" implemented would be, which would be up to whoever would actually implement it.

True... All this extra complication just to deal with one very narrow application for something that would mostly be used for other things... I suppose this happens a lot, when writing scripts, doesn't it? If the dev team does decide to include this feature, they could probably cut out most of that extra complication just by having only push carts be able to travel through difficult terrain, and have those be defined as one-tile vehicles under a certain weight, and have the quality mean that, if they have any Cargo Transportation quality, they only give a small percentage bonus to how quickly the mission gets completed. Still, if any similar problems arise that can't be solved this way, it'll probably end up being more work in the long run...

PatrikLundell commented 3 years ago

This can't be done purely as JSON data, and I'm not even sure there's much point in having any of it as JSON, as it would require extra code to process that data. However, the complexity of any implementation depends on the person who decides to tackle the task (the core team would veto anything that would result in excessive amounts of code, or maintenance, or consume too much computer resources, of course).

AmarinReyny commented 3 years ago

This can't be done purely as JSON data, and I'm not even sure there's much point in having any of it as JSON, as it would require extra code to process that data. However, the complexity of any implementation depends on the person who decides to tackle the task (the core team would veto anything that would result in excessive amounts of code, or maintenance, or consume too much computer resources, of course).

Fair enough... Well, I guess I've said what I can on this topic, and the only thing left is for the devs to decide if they'll try to implement it.

stale[bot] commented 2 years ago

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.

Night-Pryanik commented 1 year ago

Closing as stale, since stalebot can't do this by itself.