Comments (11)
Why would the game suggest a longer path?
Move cost for roads is smaller than for off-road overmap terrains (fields, trails and dirt roads):
Cataclysm-DDA/src/overmapbuffer.cpp
Lines 868 to 885 in 73b6cf7
You need to use wheels with bigger offroad_rating
on your vehicle if you want to move off-road.
from cataclysm-dda.
Yes, the difference in path costs between roads and fields looks a bit high. It would be nice to change the formula a little since off-road driving isn't that punishing regardless offroad rating of your vehicle.
from cataclysm-dda.
When using vehicles, the speed is reduced to 6 km/h in some locations. On the road, in the field or elsewhere.
Autodrive has speed limits. Read here -
Cataclysm-DDA/src/vehicle_autodrive.cpp
Line 40 in 73b6cf7
from cataclysm-dda.
Thank you.
Move cost for roads is smaller than for off-road overmap terrains (fields, trails and dirt roads):
And how does this manifest for vehicles? A character that spends more moves. What does the vehicle spend? It travels 19 km/h on asphalt and travels 19 km/h in a field. What's the point? Does it affect fuel consumption?
I know that for some vehicles, there is a maximum speed limit. But that threshold is higher than this 19 kilometers per hour. So what's the point of going down the road?
from cataclysm-dda.
However, sometimes the simplified simulation used to compute the search graph fails to accurately predict where the vehicle will end up. This could be because there was too much error in an approximation (such as time to accelerate) or the driving conditions changed (ran over a mound of dirt that interfered with steering). When such a discrepancy is detected, autodrive will fall back to "safe mode", cutting the speed to the minimum (1 tile per second) and recomputing the path.
Since the navigation graph is cached and not updated in response to dynamic obstacles (such as animals) autodrive will also perform collision detection at every turn, before taking any action that may end the turn. If a possible collision is detected autodrive will enter "safe mode", reducing speed and recomputing. If the speed is already at minimum it will abort instead with a warning message.
If I understand correctly. We get an error or detect an obstacle (animal/zombie). We reset the speed and recalculate the path.
But why do we need to slow down? Maybe I'm missing something. We're not driving in real time. If an error or obstacle is detected, recalculate the path and follow it. Or give control to the player. Only slow down if a collision is guaranteed at the current speed. And there is no way to avoid the obstacle while keeping the speed.
P.S. Why am I thinking of Tesla and its autopilot?
from cataclysm-dda.
The reason auto driving speed is limited is because it's hard to make a robust feature that doesn't do the Tesla thing and crashes into something it can't recognize.
Acceleration and (to a lesser extent) deceleration are tricky to predict exactly how large they'll be. A miscalculation results in the vehicle ending up in a different location from where it was predicted to be, thus disrupting the whole path, possibly to the extent that a recalculated path no longer have enough safety margin to an obstacle.
In addition to the issues with the path itself, you also have to deal with the fact that the vehicle doesn't occupy a single tile, but rather several tiles in a configuration that morphs based on the orientation.
You need to slow down when facing obstacles in order to ensure the vehicle ends up exactly where it was intended to end up. There are already issues with partial tile displacement sideways (move one tile sideways every X tiles forward), and you'd compound that if the movement forward is also in partial tiles so you'd have to predict when those partial tiles end up in an extra tile of movement.
If I understand it correctly, the fuel consumption is indeed higher off-road. I also believe (without knowing) that the path finding's road preference is a result of a calculation based on the vehicle's performance over different kinds of terrain without accounting for the limited speed the travel can actually be performed at, so if the travel logic was able to actually travel at maximum safe speed the road would be faster.
Making a 360 degree turn for no reason would obviously be a bug. Making a 360 degree turn due to a mobile obstacle might not be, although it seems odd.
Personally I'm amazed this dog speaks, rather than complaining about the deficiencies in it's speech.
However, if someone steps up to try to improve the logic it would be great.
from cataclysm-dda.
I realize that using a dynamic velocity value, is additional complexity and calculations. That's why the calculation uses 3 tiles per move.
But we have some interesting parameters. Acceleration, braking and top speed off-road. They depend on wheels, engine and maybe something else. But clearly above 3 tiles per turn. Why aren't we targeting them?
Let's say the turns are complicated. Straight sections. Conditionally 5 tiles * 5 moves = 25 tiles or ~1 OMT. Straight sections, in the representation of the function responsible for building the route. That is, sections where there are no turns. And if we go straight, let's add speed. And this speed will be calculated so that the car could stop completely in 1 turn.
Total, turns we pass the old way with 1-3 tiles per turn. Straight sections - 5...8 tiles per turn.
Some tests from the game
Vehicle name | Acceleration (characteristic), km/h | Acceleration (characteristic), tile/turn | Acceleration (real), km/h | Braking, km/h | Speed, km/h |
---|---|---|---|---|---|
motorcycle (road) | 54 | 8 | 54 | 54..64 | - |
motorcycle (field) | 54 | 8 | 28 | 51..53 | 72 |
motorcycle (tall or long grass) | 54 | 8 | 8 | 20 / 32 | 20 / 32 |
coupe (field) | 26 | 4 | 26 | 45...54 | - |
coupe (road) | 26 | 4 | 16 | 43...48 | 118 |
coupe(tall or long grass) | 26 | 4 | 6 | 37..41 | 33..57 |
The spread is most likely due to rounding. It depends on what initial speed the braking starts at. Or it's just a bug. For areas with high and long grass. Apparently they have different effects. But since they are intermixed with each other, it's hard to say for sure.
Summary.
We have a section of straight path for which we know the road characteristics. We can calculate the braking. For a motorcycle, that's 8 tiles per stroke. So we can go up to 54 km/h. Or 20/32 if it's long grass sections. And for the coupe, 35-40 km/h.
from cataclysm-dda.
I don't know if anyone needs this. And maybe it's already implemented, but I don't know about it.
I suggest adding some tools to test path building and automatic movement.
- Highlighting the current OMT. For example, using monochrome colors. Or other marking of OMT boundaries.
- Color visualization of the constructed path. Colored tiles are overlaid on top of the tiles. For example, of blue color. They denote the path on which the player or transport will move. In general, this is the path that is built in driver.omt_path (if I understood correctly). Ideally, we will have a strip of width from 1 tile to the width of the transport.
Obstacles are highlighted in a separate color, red.
- Ariadne's thread. This is the analog of the 2nd point, but it is built only for the part of the car with coordinates (0,0). It is highlighted with a different color (gold, from the golden Ariadne's thread).
The main difference, it's always one tile wide. For easier perception of the path. Relevant if the transport begins to make loops or "twitch" left-right.
Additionally, you can specify control points: the points of the beginning and end of movement for 1 move. As well as the angle of rotation at these points.
- Adding the possibility of automatic movement with confirmation. That is, it's automatic movement, but requiring confirmation from the user every n moves (on OMT boundaries?). Would allow better response to strange car behavior. Or analyze the constructed path.
from cataclysm-dda.
Is a hayfield considered not driveable?
from cataclysm-dda.
Is a hayfield considered not driveable?
Check travel_cost_type
field in overmap terrain definition. Some terrains are impassable
.
from cataclysm-dda.
If I understand correctly
Cataclysm-DDA/data/json/overmap/overmap_terrain/overmap_terrain.json
Lines 28 to 34 in a60d305
Nowhere is the travel_cost_type
parameter specified. And that's why this OMT is considered impassable?
from cataclysm-dda.
Related Issues (20)
- Overmap coverage tests are extremely flaky currently HOT 1
- "Board up window" shows no missing requirements but I cannot build it. HOT 1
- make faction realistic scaling and/or give us the ability to be able to assign use time bubble to the npc, some stuff don't tick when the npc move far away and it somewhat frustrating
- npc crafting menu should be easier, and somewhat be like those colony management theme ?
- Benches in memory don't connect properly
- Exploit: boiled bandages produce clean water too fast HOT 2
- Enemy become passenger in vehicle when rammed or passed slowly HOT 3
- Bandaging applies better quality than said HOT 1
- Moving (not all) items with charges out of inventory doesn't update weight (AIM)
- Rubik's dialogue line "I'm here to talk about a job." is broken - typo in JSON HOT 1
- Four horse cart is slower than a two horse cart HOT 1
- Zombie clothing not filthy HOT 5
- stamina regains when dodge enemy attacks HOT 1
- linux cataclysm --version and main menu report wrong version in 0.G release HOT 3
- Shattering already shattered armor
- Tests: `guy != nullptr` randomly failing HOT 2
- The game code assumes the map goes up to Z=10, but you can't actually go higher than Z=9 HOT 2
- Bow Shooting Takes Too Long HOT 10
- Arithmetical error crash HOT 4
- Add more heating tools that use alcohol HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cataclysm-dda.