From bb22f72ad9dc4ed37c7868e512b6498ae5bdc12e Mon Sep 17 00:00:00 2001 From: matthijs Date: Fri, 15 Apr 2005 15:28:01 +0000 Subject: (svn r2204) - Add: [NPF] NPF now has a maximum number of nodes it will search. The default value is 5000 for now, which is an educated guess. Probably needs some finetuning. Hopefully this "feature" can be removed later on, when more sophisticated means of limiting the pathfinder have been implemented. This should make ships and larger networks playable for now, though. --- npf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'npf.c') diff --git a/npf.c b/npf.c index c7bfb0c68..63f43ecfd 100644 --- a/npf.c +++ b/npf.c @@ -785,7 +785,10 @@ void InitializeNPF(void) init_AyStar(&_npf_aystar, NPFHash, NPF_HASH_SIZE); _npf_aystar.loops_per_tick = 0; _npf_aystar.max_path_cost = 0; - _npf_aystar.max_search_nodes = 0; + //_npf_aystar.max_search_nodes = 0; + /* We will limit the number of nodes for now, until we have a better + * solution to really fix performance */ + _npf_aystar.max_search_nodes = _patches.npf_max_search_nodes; #if 0 init_AyStar(&_train_find_station, NTPHash, 1024); init_AyStar(&_train_find_depot, NTPHash, 1024); -- cgit v1.2.3-54-g00ecf