Commit Graph

41 Commits

Author SHA1 Message Date
Jonathan G Rennison
f1a6f1161d Link graph schedule: Adjust debug logging 2019-02-25 21:08:00 +00:00
Jonathan G Rennison
b3a7a04cf2 Linkgraph: Pause game on load if a link graph join is immediately due 2019-02-25 18:43:38 +00:00
Jonathan G Rennison
26858cdf3d Link graph: Clamp job duration multipliers to 1 for small jobs
Cost estimate < 4000
2019-02-22 00:56:04 +00:00
Jonathan G Rennison
e3bb96e484 Link graph: Check for unfinished jobs 2 ticks before join instead of 1
This is to fix pausing multiplayer servers at daylength = 1
2019-02-22 00:55:28 +00:00
Jonathan G Rennison
e0e490112c Link graph: Don't place jobs with different join dates in the same job set 2019-02-22 00:53:59 +00:00
Jonathan G Rennison
035f5622b9 Merge branch 'master' into jgrpp
# Conflicts:
#	src/console_cmds.cpp
#	src/landscape.cpp
#	src/linkgraph/linkgraphschedule.cpp
#	src/openttd.cpp
#	src/roadveh_cmd.cpp
#	src/toolbar_gui.cpp
#	src/train_cmd.cpp
#	src/vehicle.cpp
#	src/viewport.cpp
#	src/window_type.h
2018-07-24 18:30:42 +01:00
Niels Martin Hansen
2a868b9f3b Feature: Framerate display window (#6822)
Frame rate and various game loop/graphics timing measurements and graphs. Accessible via the Help menu, and can print some stats in the console via the fps command.
2018-07-19 21:17:07 +02:00
Jonathan G Rennison
a732dc440a Fix use of %zu in debug format strings, which isn't supported on Windows 2018-06-07 06:54:43 +01:00
Jonathan G Rennison
3f83546dfc Linkgraph: Fix numeric overflow in cost estimate/duration multiplier.
Bump cost estimate type to 64 bits
2017-10-05 18:27:22 +01:00
Jonathan G Rennison
7e89b9789f Linkgraph: Fix divide by 0 error when total linkgraph cost estimate <= 1. 2017-02-13 21:29:58 +00:00
Jonathan G Rennison
2080daab8d Linkgraph: Refactoring to avoid manual deletes. 2017-02-08 21:59:41 +00:00
Jonathan G Rennison
375dbdbfe1 Linkgraph: Allow job threads to be aborted early when clearing schedule. 2016-11-26 00:33:50 +00:00
Jonathan G Rennison
d08d1cbd67 Linkgraph: Avoid attempting to merge/apply job when cleaning schedule.
This can cause crashes when switching savegame.
Move job merge/apply out of destructor into separate function.
2016-11-26 00:15:01 +00:00
Jonathan G Rennison
1cede8431f Linkgraph: Support running multiple jobs per spawned thread. 2016-11-01 23:02:15 +00:00
Jonathan G Rennison
84e61b690a Linkgraph: Changes to job scheduling algorithm.
This is to improve responsiveness of link graph updates, whilst
avoiding being blocked waiting for updates to complete.
Previously, large numbers of cheap jobs resulted in poor responsiveness
as it took a long time for jobs to cycle round.

Add 'linkgraph' debug category.
2016-11-01 23:02:15 +00:00
Jonathan G Rennison
b8a89437a1 Enable use of atomic store/load on clang. 2016-09-08 18:40:08 +01:00
Jonathan G Rennison
61ff4f5d97 Limit linkgraph recalc interval to minimum of 2 ticks.
The interval could otherwise fall to 1 tick at very high day lengths,
and low number of days interval, with recalc not scaled by day length
enabled.
2016-01-31 12:22:03 +00:00
Jonathan G Rennison
78cf5ca682 Add setting for linkgraph times to be in non daylength scaled days.
Savegame format change for link graph jobs.
Change link graph scheduler to support more than one operation
per day, on _date_fract ticks other than SPAWN_JOIN_TICK.
2016-01-29 00:26:47 +00:00
Jonathan G Rennison
3896952136 Join more than one link graph job at once where possible.
This can occur when the link graph recalculation times are changed.
In particular, if the duration or interval are reduced, the new jobs
will be delayed until the completion of the previous long job,
and then remain backlogged thereafter as jobs are dequeued at the same
rate as they are queued.
2016-01-28 19:32:21 +00:00
Jonathan G Rennison
548ea31e83 Fix compilation on gcc before 4.7 due to use of atomic builtins. 2016-01-07 22:45:11 +00:00
Jonathan G Rennison
c6854afcef Pause the game instead of blocking when link graph jobs lag.
Check if the job is still running one date fract tick before it
is due to join and if so pause the game until its done.
This avoids the main thread being blocked on a thread join.
Show if pause is due to link graph job in status bar, update network
messages.
This does not apply for network clients.
2015-09-03 18:36:30 +01:00
frosch
a14b836bf2 (svn r27178) -Fix [FS#5969]: Data race due to lazy initialisation of objects. 2015-03-07 18:27:01 +00:00
frosch
780e595933 (svn r27178) -Fix [FS#5969]: Data race due to lazy initialisation of objects. 2015-03-07 18:27:01 +00:00
rubidium
2be4215f43 (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
rubidium
0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
fonsinchen
ebcba0c0e3 (svn r26347) -Fix [FS#5898]: Make sure link graph jobs can delete themselves after SLA_NULL. 2014-02-16 18:42:59 +00:00
fonsinchen
cc77d40336 (svn r26347) -Fix [FS#5898]: Make sure link graph jobs can delete themselves after SLA_NULL. 2014-02-16 18:42:59 +00:00
fonsinchen
cd68a2d8a5 (svn r26276) -Fix [FS#5874]: Don't spawn link graph jobs for link graphs with only one node 2014-01-24 21:39:07 +00:00
fonsinchen
95354136be (svn r26276) -Fix [FS#5874]: Don't spawn link graph jobs for link graphs with only one node 2014-01-24 21:39:07 +00:00
fonsinchen
fea3a433b2 (svn r26166) -Fix: Scale flows only after mapping to avoid rounding errors. 2013-12-20 14:57:44 +00:00
fonsinchen
ec492bfb77 (svn r26166) -Fix: Scale flows only after mapping to avoid rounding errors. 2013-12-20 14:57:44 +00:00
fonsinchen
75cff48a5d (svn r25867) -Fix [FS#5764]: Shift dates on link graphs when using scenario editor date tool. 2013-10-15 17:32:31 +00:00
fonsinchen
5ab204c8a1 (svn r25867) -Fix [FS#5764]: Shift dates on link graphs when using scenario editor date tool. 2013-10-15 17:32:31 +00:00
fonsinchen
94baba190e (svn r25357) -Add: flow mapper for link graph 2013-06-09 13:01:23 +00:00
fonsinchen
575cabe90a (svn r25357) -Add: flow mapper for link graph 2013-06-09 13:01:23 +00:00
fonsinchen
1cc410f7bb (svn r25356) -Add: Multi-Commodity-Flow solver for link graph 2013-06-09 13:00:41 +00:00
fonsinchen
9824d53d6a (svn r25356) -Add: Multi-Commodity-Flow solver for link graph 2013-06-09 13:00:41 +00:00
fonsinchen
aa393a8ee9 (svn r25355) -Add: demand handler for link graph 2013-06-09 12:59:51 +00:00
fonsinchen
6a46b5262f (svn r25355) -Add: demand handler for link graph 2013-06-09 12:59:51 +00:00
fonsinchen
97a9908b0e (svn r25354) -Add: link graph schedule and typedefs for LinkGraph and related classes 2013-06-09 12:58:37 +00:00
fonsinchen
c32eea02dd (svn r25354) -Add: link graph schedule and typedefs for LinkGraph and related classes 2013-06-09 12:58:37 +00:00