Commit Graph

8 Commits

Author SHA1 Message Date
Simon J d3d5cfbdc4
Add test for #12728: map edge footpath connections in scenario editor (#12736)
Co-authored-by: Simon Jarrett <simonjjarrett@gmail.com>
2020-08-20 20:32:23 +02:00
Ted John 06f1b58004 Add test case for DecryptSea 2020-07-11 11:40:34 +01:00
Breno Rodrigues Guimarães ab53ddf59f Avoid fast-forwarding peep into the ride
The code being removed in the patch tries to fast forward a peep into the ride when it is the second peep for a vehicle that is used in pairs. Problem is that funds checking does not happen, so it happens that a peep may pay against its will.
Lets say a rich peep enters in line and a poor peep enters in line right after.
If the price of the ride is such that the rich peep can pay and the poor peep can't, it will be dragged into the ride because funds checking only happened for the first.
The second part of the patch just adjusts we consider the vehicle a full car if the second position is filled.

Add test to verify that a peep is not dragged into a ride it can't pay

This test puts two peeps in a Ferris Wheel. The first peep is rich and the second peep is poor. When they are both in line, the ride price is raised so that the poor peep can't pay.
Make sure the poor peep turns back and leaves the ride.

During development, a mistake in the logic would have broken all rides other than ferris wheels in a way that multiple guests could enter the same car.
Also add a test to make sure that is never broken.
2020-04-25 18:27:33 -03:00
Matt 6177255991
Add S6 Import/Export test and remove old NetworkLoadSave test 2019-10-20 13:49:35 +02:00
Richard Fine bb4e79ddda Rework tests to use ride entrances as path targets
It turns out that trying to just give a peep a pathfinding goal and then let them loose doesn't work, because every time they reach a junction, the pathfinder has them walk 'aimlessly' instead of pursuing their target. That's why we were seeing some very large step counts in previous tests - they were (eventually) walking onto the target square, but only after lots of wandering around in circles.

This commit reworks the test data to contain an actual ride for each test scenario, where the peep will path to the tile in front of the ride entrance. A nice side benefit of this is that the ride names must match the test names, so you can now tell from looking at the rides in the test data which one is used for which test instance.

The 'yellow marker' tiles for goal positions are also removed here, as we're deriving goal positions from the ride entrances instead.
2019-01-02 14:12:51 +00:00
Richard Fine 8fb81a2d89 Initial data-driven tests for pathfinder behaviour
Introduce some basic scenario-style tests for the pathfinding AI. There
are two tests:

* Test that a peep can get from a given start position to a given end
  position, and that it takes them an expected number of ticks to do so.
  Also test that they did not walk on any 'forbidden' tiles in the process,
  e.g. tiles that are completely the wrong direction from the goal etc.

* Test that a peep can *not* get from a given start position to a given
  end position after a given number of ticks.

Each test is parametric, and instantiated for multiple different
start/end positions within the provided test park. If we find a new
situation that needs a test, it should just be a matter of building
that situation in the saved game and then adding a line to the code to
set it up.

Indicating 'forbidden' tiles is done using terrain surface type IDs:
tiles that the pathfinder should never send the peep into should be
painted with the red neon surface type (index 8). This means we have
no way to forbid some path elements on a tile while allowing others,
but we don't need that right now.

Similarly, to help ensure that the test data and code are kept in
sync, the tests also require that peep start tiles are painted with
the green neon surface type (index 11) and that goal tiles are
painted with the yellow neon surface type (index 9).
2019-01-02 14:12:08 +00:00
Hielke Morsink f661d48d90 Add tests for tile_element_wants_path_connection_towards 2018-04-17 20:43:49 +02:00
Ted John f2524c07b3 Add rating test data 2017-06-04 00:47:34 +01:00