Skip to content
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

Make ship pathfinding faster #3825

Closed
DorpsGek opened this issue May 9, 2010 · 6 comments
Closed

Make ship pathfinding faster #3825

DorpsGek opened this issue May 9, 2010 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented May 9, 2010

smurfix opened the ticket and wrote:

Why is ship routing called in network mode? (On the client!) I thought that's the server's responsibility.
Anyway, ship routing should be called a little bit less often. Like, once per ship's route segment -- but not on every tick!

The result of this problem is that TFPModeShip(), due to calling itself recursively, eats 10% of CPU time on my fast system, and is responsible for making some large games unwatchable on "normal" desktop computers.

# 0 TPFModeShip (tpf=0x7fffffffe1a0, tile=670259, direction=DIAGDIR_SE) at /daten/src/git/openttd/src/pathfinder/opf/opf_ship.cpp:53
# 1 0x0000000000636c1f in OPFShipFollowTrack (v=, tile=670259, dir=, bits=TRACK_BIT_NONE, skiptile=5,
track=0x7fffffffe21c) at /daten/src/git/openttd/src/pathfinder/opf/opf_ship.cpp:118
# 2 FindShipTrack (v=, tile=670259, dir=, bits=TRACK_BIT_NONE, skiptile=5, track=0x7fffffffe21c)
at /daten/src/git/openttd/src/pathfinder/opf/opf_ship.cpp:150
# 3 0x0000000000636d74 in OPFShipChooseTrack (v=0xff4a00, tile=668211, enterdir=DIAGDIR_NW, tracks=)
at /daten/src/git/openttd/src/pathfinder/opf/opf_ship.cpp:196
# 4 0x00000000006a9e0b in ChooseShipTrack (this=0xff4a00) at /daten/src/git/openttd/src/ship_cmd.cpp:386
# 5 ShipController (this=0xff4a00) at /daten/src/git/openttd/src/ship_cmd.cpp:550
# 6 Ship::Tick (this=0xff4a00) at /daten/src/git/openttd/src/ship_cmd.cpp:599
# 7 0x0000000000710c5d in CallVehicleTicks () at /daten/src/git/openttd/src/vehicle.cpp:690
# 8 0x0000000000622d55 in StateGameLoop () at /daten/src/git/openttd/src/openttd.cpp:1228
# 9 0x00000000005df50a in NetworkDoClientLoop () at /daten/src/git/openttd/src/network/network.cpp:1019
# 10 0x00000000005e08c7 in NetworkGameLoop () at /daten/src/git/openttd/src/network/network.cpp:1212
# 11 0x00000000006245a8 in GameLoop () at /daten/src/git/openttd/src/openttd.cpp:1300

Reported version: 1.0.1
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/3825
@DorpsGek
Copy link
Member Author

DorpsGek commented May 9, 2010

Rubidium wrote:

Because the client runs the WHOLE game. We only send commands between clients/servers and not all game state updates. This as sending all game state updates would take way too much bandwidth.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3825#comment8011

@DorpsGek
Copy link
Member Author

DorpsGek commented May 9, 2010

smurfix wrote:

OK, so how about converting this to a feature request "cache ship routes". Calculating all of them on every tick (at least that's how I read the source) is wasteful (and prevents me from watching my own game).


This comment was imported from FlySpray: https://bugs.openttd.org/task/3825#comment8013

@DorpsGek
Copy link
Member Author

DorpsGek commented May 9, 2010

Rubidium wrote:

http://www.tt-forums.net/viewtopic.php?p=608637# p608637


This comment was imported from FlySpray: https://bugs.openttd.org/task/3825#comment8014

@DorpsGek
Copy link
Member Author

SmatZ wrote:

YAPF of course already uses cache.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3825#comment8049

@DorpsGek
Copy link
Member Author

DorpsGek commented Jun 5, 2010

Lone_Wolf wrote:

Yes, YAPF uses much less resources than NPF. But for some reason it's marked as "not recommended" in Advanced Options dialog.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3825#comment8116

@DorpsGek
Copy link
Member Author

peter1138 closed the ticket.

Reason for closing: Won't fix

YAPF is default and recommended these days


This comment was imported from FlySpray: https://bugs.openttd.org/task/3825

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant