Commit Graph

161 Commits

Author SHA1 Message Date
Joonas Rikkonen 98e05e8483 Prevent ruins from overlapping with each other or ending up above the upper boundary of the level. Closes #894 2018-11-12 13:48:23 +02:00
Joonas Rikkonen 912da3f4f6 Made FindHull methods inclusive by default (= a position exactly at the edge of a hull is considered to be within the hull). Fixes characters being considered outside when they're exactly at the edge of 2 adjacent hulls, which sometimes caused the camera to twitch inwards and the character to get wet when moving between docked subs. 2018-11-11 17:23:22 +02:00
Joonas Rikkonen 224e9238db EntityEvents are written and sent even if the entity has been removed at the time of writing. Otherwise the clients may not receive some important events, e.g. when an item applies a statuseffect to something or triggers an explosion and is removed immediately afterwards. I'm not 100% confident that this won't cause any additional issues, so it still needs more testing. See #839 2018-10-29 20:38:10 +02:00
Joonas Rikkonen ef9afedf42 Added a level equality check to client error handling to make it easier to diagnose bugs like #848 in the future. 2018-10-18 00:18:57 +03:00
Joonas Rikkonen bff2852cb6 Fixed submarine waypoints getting mirrored in mirrored levels (cherry-picked from c785732) 2018-09-21 14:05:22 +03:00
Joonas Rikkonen c4c18fbfd7 Fixed main path waypoints not getting mirrored in mirrored levels (cherry-picked from 295fc31). 2018-09-21 12:45:33 +03:00
juanjp600 e578cbc077 Explosions now use Character.Controlled.WorldPosition to determine camera shake 2018-09-19 14:57:22 -03:00
Joonas Rikkonen 57c9e5a731 Fixed IndexOutOfRange exceptions when cloning items with requiredItems that aren't present in the xml, + some more exception handling & error logging 2018-09-10 12:06:39 +03:00
Joonas Rikkonen 2b3c0d103b Fixed NotImplementedException when attempting to clone linked submarines 2018-09-10 11:40:06 +03:00
Joonas Rikkonen 7eed555522 Another docking port fix: EntityGrids are made slightly larger than the borders of the submarine, because docking ports may create gaps and hulls outside the borders, causing FindHull to fail and characters to get teleported outside the sub when from sub to another. Closes #551, hopefully for good now! 2018-08-29 14:50:44 +03:00
Joonas Rikkonen 8d83580b75 Docking port fixes again. Closes #551
- Non-saveable entities aren't removed from the linkedTo-list during saving, because that causes gaps to become unlinked with the hulls between docking ports when starting a campaign round.
- Hull rechecks are disabled on docking port gaps, because moving linked subs into place may cause the gaps to become unlinked if they're positioned in a certain way (for example in some subs the hulls between the docking ports end up inside the gap).
- Dockingports only connect the waypoints linked to their gap to each other, instead of every waypoint that happens to be inside the gap.
2018-08-29 13:38:56 +03:00
Joonas Rikkonen 48e14347a3 Fixed projectiles colliding with railguns due to 1e02d74 2018-08-24 14:18:51 +03:00
Joonas Rikkonen 3747852c13 Removed the Entity.MoveWithLevel property, fixed artifacts and other items from ruins not being saved. Closes #694 2018-08-20 16:23:40 +03:00
Joonas Rikkonen c2f9e1481f Recommended crew experience is saved using text tags instead of the actual text (-> experience texts can be translated without the translation showing up in sub files). 2018-08-15 12:06:22 +03:00
Joonas Rikkonen 1e02d7406d Added a collider to railgun (-> cannot go through walls or enemy subs anymore). Closes #444 2018-08-14 15:39:10 +03:00
Joonas Rikkonen 1f5239b141 Horizontally resizeable walls are considered horizontal regardless of their size (and the same for vertical ones). Fixes orientation of short but thick walls (e.g. a tiny piece of a heavy wall) being wrong. Closes #648 2018-08-13 14:55:26 +03:00
Joonas Rikkonen bcd44f79e9 Merge branch 'level-mirroring' 2018-08-08 15:30:41 +03:00
Joonas Rikkonen 5100956bae Levels are mirrored when traveling backwards through a connection in the campaign mode. Closes #519 2018-08-08 15:30:32 +03:00
Joonas Rikkonen 99c76d0099 Cleanup 2018-08-08 15:16:53 +03:00
Joonas Rikkonen 1c1a1eb80e Background sprites spawn at the correct position and rotation in mirrored levels. 2018-08-08 15:12:24 +03:00
Joonas Rikkonen 2859b5c7f7 Added physics error check & logging to gap update 2018-08-07 16:49:51 +03:00
Joonas Rikkonen 004250409a Fixed number of completed missions in a level not increasing if the connection is not selected after completing a mission. Closes #594 2018-08-07 13:22:02 +03:00
Joonas Rikkonen 4b0c54d664 Dockingport gap linking fixes. Closes #551
- Dockingports force the hatch/door gaps to be connected to the hulls between the ports, because connecting them automatically may fail if the ports are positioned in a non-standard way.
- Gaps don't recheck hulls in OnMapLoaded if rechecks have been disabled.
- Item.UpdateHulls and Gap.UpdateHulls are not called when OnMapLoaded is called during ruin generation.
2018-08-07 12:45:45 +03:00
Joonas Rikkonen e60ebc1930 Handling and logging exceptions thrown by ItemComponent constructors, added stack traces to a couple of error messages 2018-08-06 14:53:28 +03:00
Joonas Rikkonen d51d01c3e8 Fixed Submarine.HandleLimbCollision attempting to set the velocity of the sub to an invalid value when the current velocity is extremely small 2018-08-06 11:43:46 +03:00
Joonas Rikkonen 9052782a6c Fixed index out of range exception when trying to determine outside collider position for a gap that's not connected to anything 2018-08-06 11:22:50 +03:00
Joonas Rikkonen 9099b191d0 Fix (or a workaround) to characters teleporting inside/through colliders when leaving a sub (see #552). Gaps do a raycast out from the sub to see if there are obstacles outside, and if so, ragdolls place a collider at the corresponding position inside the sub. The collider is simply a straight axis-aligned line atm, so it doesn't work accurately with sloped ice/submarine walls, but does prevent the ragdoll from ending up inside the obstacles. TODO: use a few edges to approximate the shape of the obstacles more closely? 2018-08-02 16:48:51 +03:00
Joonas Rikkonen d81ee1a27e Added a bunch of checks to make sure a normalized zero vector (= NaN, NaN) is not used in any position/velocity/movement calculations. There were at least three places where it was causing problems according to error reports: when a character that can't enter a sub spawns at the center of a hull and when using an underwater scooter or throwing something while the cursor is at the position of the character, but there were tons of other places as well where it may have potentially caused physics errors. 2018-07-31 12:28:04 +03:00
Joonas Rikkonen 86df5f6b1a Physics error checks & logging 2018-07-30 14:31:30 +03:00
Joonas Rikkonen 5dcb7bba9b Mirroring background sprite positions partially working. They spawn at the correct edge, but not at the correct position or rotation. 2018-07-27 14:50:42 +03:00
Joonas Rikkonen 3b4a6c0081 Ruin and seafloor mirroring works now 2018-07-27 13:01:04 +03:00
Joonas Rikkonen 5b019621b7 Fixed sea floor having a wrong collision category, causing artifacts to spawn below it. Closes #532 2018-07-27 11:14:09 +03:00
Joonas Rikkonen aa5b2a973e Mirroring levels. Mirroring the wall geometry works, but ruins and background sprites are not placed at the correct positions yet. 2018-07-27 10:36:52 +03:00
Joonas Rikkonen 50603b72f4 Fixed another bug in DockingPort that caused entity ID mismatches. Even though the server sent the IDs of the CURRENT hulls and gap of the docking port, they are not necessarily created in the correct order during midround syncing and may end up replacing the ID of another entity or another entity spawned after them may cause their IDs to be replaced. Closes #530 2018-07-26 12:42:29 +03:00
Joonas Rikkonen b309b45246 Fixed entity ID mismatches and desync kicks caused by gap creation/removal in Structure.SetDamage. Creating the gaps on damaged walls wasn't guaranteed to happen in the same order client-side as on the server, causing the IDs to get assigned mismatching IDs and in some cases also affecting the IDs of other types of entities (see #528).
Now the structure gaps simply don't have IDs. They're never accessed by ID so I don't think there's the need to make the creation/removal go through entityspawner.
2018-07-25 17:34:10 +03:00
Joonas Rikkonen d3d842eecd Added error checking and logging to wire cloning logic in MapEntity.Clone (see #527) 2018-07-25 11:49:10 +03:00
Joonas Rikkonen 756278bb81 Increased the minimum distance between verts in level collider generation code. Should make the "invalid triangle created by CaveGenerator" errors less frequent. (See #311) 2018-07-24 15:43:26 +03:00
Joonas Rikkonen e21b756f29 Fixed invalid left/right normal errors during level generation (I think). The voronoi cell generation logic ignored zero-length edges, but it was possible for an edge to be so short that the distance from the adjacent edge to the center of the short edge rounded down to zero in GenerateWallShapes. 2018-07-24 15:00:35 +03:00
Joonas Rikkonen bf0c12ce52 The number of completed missions in a level connection is saved (-> reloading doesn't reset the mission in the connection to the initial one). Fixes #517 2018-07-24 14:34:27 +03:00
Joonas Rikkonen 4a8845c604 Fixed docking ports creating duplicate hulls and gaps during loading 2018-07-24 13:21:36 +03:00
Joonas Rikkonen be5f168b76 Sending error messages during EntityEvent writing/reading and entity removal to GameAnalytics 2018-07-23 21:16:57 +03:00
Joonas Rikkonen 4041633eec Clamping velocity when correcting submarine position 2018-07-23 18:33:32 +03:00
Joonas Rikkonen 9d1c4f3efb Moved Submarine.ClientRead to the client project 2018-07-23 17:58:28 +03:00
Joonas Rikkonen a61ac1716d Sending level seed & level gen errors to GameAnalytics 2018-07-20 14:17:59 +03:00
Joonas Rikkonen bcd9fd7e5f Cherry-picked de2136c (level physicsbody optimization) 2018-07-20 12:23:07 +03:00
Joonas Rikkonen 8e03ac9284 Fixed nullref exceptions in CharacterHUD & RuinGenerator 2018-07-20 11:36:53 +03:00
Joonas Rikkonen a712ec6756 Fixed null reference exception when trying to dispose a sub with no preview image. Closes #503 2018-07-20 09:59:13 +03:00
Joonas Rikkonen f1c4bd3c67 - Some of the non-game-crashing error messages are sent to GameAnalytics.
- Changed crash severity from Error to Critical.
- Exception handling when loading submarine preview images.
- Checking if position is valid in Ragdoll.SetPosition.
2018-07-19 22:12:50 +03:00
Joonas Rikkonen 30a453191f Added "VulnerableToEMP" property to Powered. Can be edited in sub editor. Reactors and relays are not affected by EMP by default. Closes #495 2018-07-18 15:07:21 +03:00
Joonas Rikkonen 568cf1a02f Fixed memory leak caused by submarine preview images, changed Submarine.SavedSubmarines to a property that prevents removing submarines from outside the class without disposing the preview image. Closes #498 2018-07-18 14:23:43 +03:00