1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 15:24:30 +01:00
Commit Graph

642 Commits

Author SHA1 Message Date
Ted John
abc3835d7b Rename openrct2.c h to OpenRCT2.c h 2016-12-14 00:32:06 +00:00
Duncan
35472fe6e2 Fix #4819. Prevent peep queue loops when next_in_queue broken. 2016-12-12 09:33:55 +01:00
Ted John
0019827d6c Refactor sprite tween logic out openrct2.c 2016-12-11 12:16:47 +00:00
Yaroslav Tretyakov
51fcfe3379 Fix #4852: Clicking on the hook icon for a person does not return it to the original location (#4854) 2016-12-07 22:28:55 +01:00
Michał Janiszewski
1ae2ca54f7 Sort includes 2016-12-01 16:03:16 +01:00
Michał Janiszewski
54e622659d Extract common parts from rct2.h to common.h 2016-12-01 16:03:16 +01:00
Michał Janiszewski
aef80b1a82 Validate parameters passed to game commands (#4814) 2016-11-21 10:37:10 +01:00
Ted John
4d7f52960d Merge pull request #4737 from Broxzier/copy_element
Copy/paste single elements
2016-11-14 21:24:40 +00:00
Michael Steenbeek
ba1225cf6e Merge cheats in console, pathfinding improvements 2016-11-14 08:54:51 +01:00
Michał Janiszewski
3f7fd56328 Remove trailing whitespace in sources 2016-11-13 20:32:55 +01:00
Broxzier
ebc0a81e72 Guests turn around when trying to enter a copied park entrance 2016-11-12 11:27:59 +01:00
Michał Janiszewski
65bb4977ce Fix #4769: peep renames broken 2016-11-10 22:49:18 +01:00
zaxcav
86ae14c65d Add pathfinding loop detection based on peep->pathfind_history
The heuristic search currently only inludes detection of loops in the current search path - i.e. from where the peep is now.

The peep->pathfind_history includes (limited) junctions that the peep has already passed through for the current search goal to get to their current location. Consider search paths through these junctions as loops as well.

This will prevent peeps getting stuck in some path layouts where looping back through a junction they already walked through and then proceeding via an alternative path (such that there is no loop in the current search path) hits the search limits on a continuing path that is closer to the goal than simply continuing on along the path which then turns (temporarily) away from the goal.

This prevents _some_ cases of alternate, longer routes to nearer tiles being returned as a better result than a route that goes through that same tile (with less steps) and then continues on to end overall further from the goal though closer to getting to the goal (as was previously documented in PR #4527).

The network version is incremented in this PR.
2016-10-23 18:55:47 +02:00
zsilencer
e2e4201112 Validate peep game command which caused crash from invalid sprite index 2016-10-22 01:53:33 -06:00
Duncan
81bb6cb950 Merge pull request #4649 from zsilencer/multiplayer
Guest+staff pickup and balloon pop commands
2016-10-20 12:46:27 +01:00
Duncan
a572ecf477 Merge pull request #4576 from zaxcav/fixPathFind
Pathfinding checks all map elements on each tile.
2016-10-20 12:42:48 +01:00
zaxcav
b85e53e898 Replace hex number with decimal number per PR review comments. 2016-10-20 11:08:14 +02:00
zaxcav
989a8fc4bc Update comment with new limits of ride satisfaction following commit 7f58c89. 2016-10-20 11:06:56 +02:00
zaxcav
d36c756ee7 Spelling corrections in code comments. 2016-10-20 11:06:56 +02:00
zaxcav
68f89c6b07 Comment peep update code related to updating happiness, etc. 2016-10-20 11:03:54 +02:00
zaxcav
6011429630 Fix potential under/over-flow of happiness, hunger, thirst in peep generation. 2016-10-20 10:45:15 +02:00
zaxcav
dfd27efaba Correct condition on running out of money thought. 2016-10-20 10:45:15 +02:00
zsilencer
3617c2cb93 Code review 2016-10-19 16:20:13 -06:00
zsilencer
986c2ab97e Fix bug - prevent firing of staff while being picked up 2016-10-19 16:20:05 -06:00
duncanspumpkin
8b196234e9 Flip the calcs 2016-10-19 21:30:08 +01:00
duncanspumpkin
430d1c4bcd Re-refactor peep calculate satisfaction 2016-10-18 21:53:01 +01:00
zsilencer
541ae91d67 fix pickup commands to work with hiring staff 2016-10-18 13:40:50 -06:00
zsilencer
d74efb23fe Add picking up peeps/staff as game command 2016-10-18 13:40:49 -06:00
zaxcav
8741a40674 Remove hacks for pathfinding to the ride exit.
When sending a mechanic to a ride exit/entrance, the original pathfinding was setting the goal to the path next to the exit/entrance with goal.z set to the exit/entrance height. This is wrong when the path slopes up to the exit/entrance. Consequently the original pathfinding included a hack to allow the mechanic to enter the exit/entrance from the goal tile.

The changes in PR #4527 (commit f3cf23f) will ignore the relevant tile when the height is wrong, preventing the original hack from working. To fix this the height of paths sloping up was adjusted in the heuristic search ... which inadvertently broke pathfinding for other goals on such a sloped path (such as the start of a ride queue that slopes up).

To fix, set the goal to the ride exit/entrance itself, make the heuristic search aware of ride exits (code existed but was commented out; entrances are already there for rides without queues) and remove both the original hack and the (incorrect) heigh adjustment made in PR #4527.

Fixes issues #4626, #4629.
2016-10-17 09:31:28 +02:00
Ted John
00e907d007 Merge pull request #4414 from Broxzier/extended_tile_inspector
Extended tile inspector
2016-10-16 21:12:21 +01:00
Manuel Vögele
ec8d37eead Fix #1943: Placing Handyman/Security Guard/Mechanic In Multiplayer Causes Crash
Open staff window on multiplayer clients when hiring new staff instead of a random visitor.
2016-10-13 22:02:10 +01:00
Michał Janiszewski
f1cbb7935d Fix left shifts that may overflow 2016-10-13 19:48:42 +01:00
zaxcav
7718300881 Correct mistakes in merging conflicts. 2016-10-12 16:17:36 +02:00
zaxcav
113c41b976 Moved declaration of rideIndex to before first use. 2016-10-12 15:57:55 +02:00
zaxcav
e2b830f7b9 Pathfinding checks all map elements on each tile.
Use of zero clearance will no longer block the path finding when paths and other map elements are placed in the same tile at the same height.

Pathfinding recognises map elements for shops, so peeps can find shops again.

Pathfinding recognises the park entrance, so peeps can leave the park again.
2016-10-12 15:10:34 +02:00
Michał Janiszewski
a80461da80 Fix #4553: crash due to accessing invalid sprite
Assertion gets hit when trying to get invalid sprite from
remove_peep_from_queue
2016-10-12 08:18:41 +01:00
Broxzier
a68dc7afb8 Add fence and banner info to tile inspector
This commit also renamed a flag, and corrected the use of one. The
flags in question are WALL_SCENERY_BANNER, WALL_SCENERY_2_FLAG4, and
WALL_SCENERY_2_FLAG5.
2016-10-11 23:27:04 +02:00
Michał Janiszewski
1135238c34 Remove/hide newly unused variables 2016-10-09 22:43:08 +02:00
LRFLEW
e5ff7412e4 Refactor/Improve String and Path Handling 2016-10-09 15:29:58 -05:00
Duncan
b29be9bfeb Merge pull request #4527 from zaxcav/fixPathfindHistory
Further pathfinding improvements
2016-10-07 12:08:36 +01:00
zaxcav
62ed46d29b Simplify initialisation of pathfinding telemetry.
Code revised per review comments.
2016-10-07 12:32:09 +02:00
Michał Janiszewski
c9b0d9e24d Initialise all variables flagged by -Wmaybe-uninitialized 2016-10-06 23:13:28 +02:00
Jonathan Haas
7a13fa6221 Fix #2042: Underflow in entertainer code when subtracting 200 from time_in_queue.
Adding myself to contributors + changelog.
2016-10-06 19:15:48 +02:00
zaxcav
72b4ff4ac8 Fix another typo 'uint' vs 'uint8'. 2016-10-04 12:12:21 +02:00
zaxcav
533d51489d Fix typo 'uint' vs 'uint8'. 2016-10-04 12:02:24 +02:00
zaxcav
2aaf0692f9 Remove unused text descriptions of enum. 2016-10-04 10:05:51 +02:00
zaxcav
7ff53057c8 Optimise pathfinding changes. 2016-10-04 10:05:51 +02:00
zaxcav
c1b371b510 Pathfinding now only treats wide path tiles as continuing tiles (and therefore a valid search result) when the current path tile is also wide.
Wide tiles are consequently only traversed to reach thin path tiles when in an area of wide path tiles. This fixes peeps getting stuck when the path search limits are all further away from the destination than wide tiles.
2016-10-04 10:05:51 +02:00
zaxcav
9625a42d82 Collect search path telemetry in the pathfinding:
- Telemetry information collected includes: end location, steps taken, number of junctions walked through, the list of junctions walked through and the directions taken at each of those junctions.

- Telemetry collection is not optimised and currently has a negative performance impact.

Improve pathfinding debugging framework:

- Include collected telemetry information in the debugging messages.

- Enable debugging only for specific peeps - for guests, debugging is logged for tracked guest(s) only; for staff, debugging is logged for "Mechanic Debug" only.

- Debug messages need a DEBUG build with appropriate log levels enabled: used log levels are VERBOSE and INFO.
2016-10-04 10:05:51 +02:00
zaxcav
fd66526351 Basic commenting of the staff path finding code. 2016-10-04 10:05:51 +02:00