-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Vehicle boat/traction update #17687
Vehicle boat/traction update #17687
Conversation
Needs rebase |
f614477
to
9fd355f
Compare
Rebased |
This is a significant improvement |
@@ -3531,6 +3531,15 @@ std::set<fault_id> item::faults_potential() const | |||
return res; | |||
} | |||
|
|||
int item::wheel_area() const | |||
{ | |||
if( !is_wheel() ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overly verbose. item.cpp
is already obese.
return is_wheel() ? type->wheel->diameter * type->wheel->width : 0
Vehicle movement functions need some further documentation starting with the Can you provide a skeleton outline on the github wiki of how vehicles actually move as this would probably accelerate review of vehicle PR's and possibly encourage other developers to assist. It doesn't need to be all encompassing but having something there also encourages future contributions to the documentation. |
Cleaned up Not sure how to document the |
Can you provide an overview/introduction as to how the whole system works? |
Maximum speed is multiplied by |
@@ -1445,6 +1445,55 @@ void veh_interact::display_veh () | |||
wrefresh (w_disp); | |||
} | |||
|
|||
std::string wheel_state_description( const vehicle &veh ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static?
float fr0 = 1000.0; | ||
float kf = ( fr0 / (fr0 + wheels_area()) ); | ||
return kf; | ||
constexpr float fr0 = 9000.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was always magic, kept for compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea what it means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it's just there for the numbers to look right.
It doesn't really model any real life effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be best to document is as unknown magical value - at least that makes it clear future removal would be acceptable
|
||
// Combined coefficient of aerodynamic and wheel friction resistance of vehicle, 0-1.0. | ||
// 1.0 means it's ideal form and have no resistance at all. 0 -- it won't move |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this still hold true because it's more descriptive than the below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I copy+paste "0 means won't move, 1 means ideal" to every k_*
description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No but you could wrap the whole family of k_*
functions in a doxygen scope and explain that there
How about this? |
Better but I'd wrap the whole lot in a doxygen scope and provide a short summary. The function documentation would be better in the style of the preamble one you gave for |
How to scope multiple functions and provide one description for all of them and specific descriptions for details for each function? |
There is an example starting at |
How about this? |
Perfect. Now they have definitions the Apart from that looks good to go |
Added the same info that |
@@ -147,7 +147,10 @@ void game::dump_stats( const std::string& what, dump_mode mode ) | |||
|
|||
} else if( what == "VEHICLE" ) { | |||
header = { | |||
"Name", "Weight (empty)", "Weight (fueled)" | |||
"Name", "Weight (empty)", "Weight (fueled)", | |||
"Max velocity", "Safe velocity", "Acceleration", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the units of max velocity, safe velocity and acceleration?
|
? |
Dump the vehicle stats. All vehicles are 99% |
I forgot a to include a magic constant I removed from |
Mostly refactoring for future land vehicle/boat split.
Wheel configuration, traction etc. functions got a
bool boat
argument. If false, it checks the wheels. If true, the boat parts.Other code changes:
k_mass
so that it doesn't change from current values.grab_point == tripoint_zero
tograb_type == OBJECT_NONE
. This allows grabbing stuff below selfGameplay changes: