Commit Graph

373 Commits

Author SHA1 Message Date
Jonathan G Rennison
b01fd1607a Re-order various structs to reduce holes/padding 2024-01-24 23:17:53 +00:00
Jonathan G Rennison
97e6f3062e Adding of _t to (u)int types, and WChar to char32_t
See: eaae0bb5e
2024-01-07 17:20:41 +00:00
PeterN
98788e865f Fix #10502: Refit engine before attaching free wagons. (#10926)
Caused by incorrect order of operations when buying a train engine with refit and attaching free wagons.

(cherry picked from commit ee2d0745e9)
2023-06-05 20:47:58 +01:00
Jonathan G Rennison
ae7c86c49d Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/release-linux.yml
#	.github/workflows/release-macos.yml
#	src/industry_cmd.cpp
#	src/industry_cmd.h
#	src/network/core/http_curl.cpp
#	src/network/core/tcp_http.cpp
#	src/network/core/tcp_http.h
#	src/network/network_content.h
#	src/script/api/script_goal.cpp
#	src/script/api/script_industry.cpp
#	src/script/api/script_league.cpp
#	src/script/api/script_story_page.cpp
#	src/script/api/script_town.cpp
#	src/train.h
#	src/train_cmd.cpp
2023-03-04 01:17:27 +00:00
SamuXarick
b52b29b1a4 Change: Avoid crashing to the side of a train
When a road vehicle is already running on a multi level crossing, and a train shows up ahead, don't make the road vehicle crash on the side of the train.
2023-02-22 20:09:02 +01:00
Jonathan G Rennison
0310fb0cdc Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/czech.txt
#	src/lang/galician.txt
#	src/lang/german.txt
#	src/order_cmd.cpp
#	src/saveload/afterload.cpp
#	src/ship.h
#	src/vehicle.cpp
2023-01-05 23:45:34 +00:00
Rubidium
375a5b8e3f Codechange: refactor FindClosestDepot to not use pointers, but return a struct 2023-01-04 22:30:48 +01:00
Jonathan G Rennison
58d841486e Merge branch 'master' into jgrpp
# Conflicts:
#	src/os/windows/font_win32.cpp
#	src/script/api/script_object.hpp
#	src/town_cmd.cpp
#	src/train_cmd.cpp
#	src/viewport.cpp
#	src/viewport_func.h
2022-12-27 01:00:40 +00:00
PeterN
7b5edba76c Change: Support flipping shorter engines without NewGRF support. (#10262)
* Change: Support flipping shorter engines without NewGRF support.
* Cleanup: Remove write-only prop27_set temporary flag.
2022-12-23 21:02:14 +00:00
Jonathan G Rennison
1f36c3f3e4 Merge branch 'master' into jgrpp
# Conflicts:
#	src/ai/ai_gui.cpp
#	src/build_vehicle_gui.cpp
#	src/genworld_gui.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/newgrf_sound.cpp
#	src/roadveh.h
#	src/sound.cpp
#	src/station_cmd.cpp
#	src/train.h
#	src/train_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehicle_gui.cpp
2022-11-26 23:04:14 +00:00
Artin Alavi
fd4f148c62 Feature: Hotkey to honk a vehicle's horn (#10110) 2022-11-10 21:36:18 +01:00
Henry Wilson
59dbcdb5ba Feature: Display power-to-weight ratio in ground vehicle details GUI 2022-11-08 21:02:08 +01:00
Henry Wilson
b304c06a4a Codechange: Use override specifier for Train and RoadVehicle structs 2022-11-08 21:02:08 +01:00
Henry Wilson
89cf0d5da8 Codechange: Factor cargotype weight conversion magic numbers 2022-11-08 21:02:08 +01:00
Jonathan G Rennison
fc5e20719d Fix #423: Max TE/weight should not be shown for maglevs 2022-09-16 12:32:44 +01:00
Jonathan G Rennison
e3896b69d3 Fix #416: Division by zero for trains of 0 mass
In maximum achievable speed estimator
2022-09-04 18:20:09 +01:00
Jonathan G Rennison
c6ae82b611 Fix 9ff161e4 boosting lookahead braking stats but not actual brake forces 2022-07-01 23:39:02 +01:00
Jonathan G Rennison
a6e3467d58 Fix virtual train consist change callbacks being run before cargotype set
When instantiating virtual train from non-buildable template train

See: #402

Also fixes instantiating virtual train from train not refitting leading
vehicle.
2022-06-27 01:27:35 +01:00
Jonathan G Rennison
99ee4b13ce Realistic braking: Cache train overall z position
Refresh cache at a variable rate depending on train length and
weight distribution
2022-06-03 00:41:41 +01:00
Jonathan G Rennison
6d877b5e70 Reduce redundant calls to get current max speed for trains and RVs
Between ShowVisualEffect() and UpdateSpeed()
2022-06-01 20:05:45 +01:00
Jonathan G Rennison
502980ba61 Support railtype-dependant GRF train speed limits with realistic braking
See: #389
2022-05-24 21:50:38 +01:00
Jonathan G Rennison
5b7db9d849 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/commit-checker.yml
#	src/command.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/crashlog.cpp
#	src/economy.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/misc_gui.cpp
#	src/newgrf_config.cpp
#	src/openttd.cpp
#	src/settings_gui.cpp
#	src/ship_cmd.cpp
#	src/table/settings/gui_settings.ini
2022-05-15 13:54:13 +01:00
Tyler Trahan
f4ca94d3f6 Codechange: Revenue is not the same as Income
Income is revenue minus costs. Let's name things correctly (without breaking the script API).
2022-04-25 21:51:51 +02:00
Jonathan G Rennison
92142e5684 Add routing restriction action to make exempt from speed adaptation 2022-03-06 22:39:53 +00:00
Jonathan G Rennison
904ff6757d Add slot support to road vehicles, ships and aircraft 2022-01-19 00:10:49 +00:00
Yourself
7823c81597 Add: Through load speed limit setting 2022-01-08 22:27:43 -07:00
Jonathan G Rennison
ba65a5bab5 Run most "daily" vehicle tasks at a fixed frequency at day lengths >= 8
This includes: running costs, track sharing costs, breakdown checks,
servicing checks, order checks
2021-11-27 15:51:49 +00:00
Jonathan G Rennison
5723c317f7 Fix trains with non-front parts needing repair not being serviced 2021-11-20 12:43:38 +00:00
Jonathan G Rennison
3cff5e53e4 Add train cached_curve_speed_mod to VENC, cache checks and debug window 2021-11-02 22:37:34 +00:00
Jonathan G Rennison
faf32200cf Merge tag '12.0-beta1' into jgrpp-beta
# Conflicts:
#	CMakeLists.txt
#	bin/ai/CMakeLists.txt
#	bin/game/CMakeLists.txt
#	src/build_vehicle_gui.cpp
#	src/console_cmds.cpp
#	src/core/overflowsafe_type.hpp
#	src/fios.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/lang/polish.txt
#	src/network/core/game_info.cpp
#	src/network/core/game_info.h
#	src/network/core/tcp_game.cpp
#	src/network/core/tcp_game.h
#	src/network/network.cpp
#	src/network/network_client.cpp
#	src/network/network_client.h
#	src/network/network_coordinator.cpp
#	src/network/network_gui.cpp
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/newgrf_engine.cpp
#	src/openttd.cpp
#	src/rev.cpp.in
#	src/settings_type.h
#	src/train.h
#	src/train_cmd.cpp
2021-11-02 17:51:38 +00:00
Jonathan G Rennison
2ada5767df Realistic braking: Increase value of RBC_BRAKE_FORCE_PER_LENGTH 2021-09-04 21:59:45 +01:00
Jonathan G Rennison
964ea7b910 Debug: Show realistic braking approach speeds in debug window 2021-09-04 21:40:26 +01:00
Vít Šefl
2183fd4dab Feature: [NewGRF] Maximum curve speed modifier for rail vehicles (#9346) 2021-08-15 11:17:05 +02:00
Jonathan G Rennison
6a009686c9 Fix #299: Add estimated max speed (full) to template windows 2021-07-17 23:21:12 +01:00
Jonathan G Rennison
502af119e5 Rename and move train max speed estimation functions 2021-07-17 23:06:34 +01:00
Jonathan G Rennison
158608442c Merge pull request #281 from VacuumBreather/train_speed_adaptation
# Conflicts:
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/extended_ver_sl.h
2021-07-03 23:00:25 +01:00
Jonathan G Rennison
62075c88de Apply ATC speed restriction as advisory to prevent instant braking
Remove redundant function
2021-06-27 22:26:57 +01:00
Andreas Schmitt
9a72d741ad Fix weight calculation 2021-06-20 22:29:54 +02:00
Andreas Schmitt
c1bf236a26 Rewrite the ATC logic
Now signals store speed information with a timeout for this data's validity
2021-06-20 20:40:33 +02:00
Andreas Schmitt
debc504e59 Add a setting for train speed adaptation
Prior to this change, without realistic breaking, trains would continuously run into the train in front of them. This makes them adjust their speed based on trains in front of them
2021-06-20 20:40:33 +02:00
Andreas Schmitt
d954c461b0 Add information about vehicle loads and speeds 2021-06-20 20:38:04 +02:00
Jonathan G Rennison
ba2e6087b2 Add train cache flag for whether train using realistic braking physics 2021-04-15 20:56:45 +01:00
Jonathan G Rennison
b514d29db1 Replace TrainCache::cached_tilt with a flags field 2021-04-15 20:56:45 +01:00
Jonathan G Rennison
5d5100449e Adjust realistic braking physics
Realistic acceleration uses 4 x the mass for acceleration as braking
Use 4 x mass for realistic braking as well to match
Increase per train length braking force
Add a power-based per train length braking force
2021-04-11 23:45:00 +01:00
Jonathan G Rennison
d484c32d44 Reduce sensitivity of train overheated breakdown 2021-04-11 22:53:02 +01:00
Jonathan G Rennison
95fb222852 Distribute articulated vehicle weight evenly between articulated parts
Instead of allocating it all to the first part
This improves realistic braking behaviour for long articulated consists
2021-04-03 22:04:37 +01:00
Jonathan G Rennison
26a123b708 Realistic braking: Cache offset of centre of mass of train 2021-04-03 21:25:04 +01:00
Jonathan G Rennison
c1f1b5f3b3 Give monorail/maglev larger realistic braking deceleration limits 2021-02-03 21:22:09 +00:00
Jonathan G Rennison
b7ddd486cf Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/CompileFlags.cmake
#	src/aircraft_cmd.cpp
#	src/blitter/32bpp_anim.cpp
#	src/cargopacket.cpp
#	src/cheat_gui.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/core/pool_func.hpp
#	src/date.cpp
#	src/economy.cpp
#	src/error_gui.cpp
#	src/ground_vehicle.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/industry_cmd.cpp
#	src/lang/dutch.txt
#	src/lang/french.txt
#	src/lang/german.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/mcf.cpp
#	src/network/network_content.cpp
#	src/network/network_server.cpp
#	src/network/network_udp.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_station.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/yapf/yapf_common.hpp
#	src/saveload/saveload.cpp
#	src/settings_gui.cpp
#	src/station_cmd.cpp
#	src/station_kdtree.h
#	src/string_func.h
#	src/table/settings.ini
#	src/tgp.cpp
#	src/timetable_cmd.cpp
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/train_cmd.cpp
#	src/train_gui.cpp
#	src/tree_gui.cpp
#	src/tunnelbridge_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
#	src/viewport.cpp
#	src/viewport_sprite_sorter_sse4.cpp
#	src/window.cpp
2021-02-01 17:07:34 +00:00
Jonathan G Rennison
4e0804b791 Fix const issues around GetTrainStopLocation/GetCurrentMaxSpeed 2021-01-29 02:13:08 +00:00