Commit Graph

166 Commits

Author SHA1 Message Date
Pieter-Jan Briers
2fc6614118 Add NUnit.Analyzers analyzer
Caught numerous cases of expected/actual being mixed and even a few broken test cases in content.
2020-07-30 18:38:17 +02:00
Pieter-Jan Briers
6a62b618dc More NetSerializer unit tests. 2020-07-30 15:06:45 +02:00
Acruid
350e05c152 Adds new functions to IComponentManager that can efficiently query for all entities with a set of components. 2020-07-29 15:48:32 -07:00
Pieter-Jan Briers
3648f43f5c Include NetSerializer as a submodule, add List<T> serializer. (#1195)
* Include NetSerializer as a submodule.

* NetSerializer list serializer.

* Update Actions workflows to handle the new submodule.

* Whoops
2020-07-28 18:56:20 -07:00
Pieter-Jan Briers
406e5277a6 Integration testing improvements.
Run Update in Integration game loop.
Ability to load extra prototypes from a string.
2020-07-26 14:07:24 +02:00
Pieter-Jan Briers
a3d250a5c4 Allow YamlObjectSerializer to read/write immutable interface collections. 2020-07-26 01:35:43 +02:00
ShadowCommander
30108cf992 Refactor DetachParent (#1188) 2020-07-25 17:04:14 +02:00
Acruid
8475c1ae4b Moves all of the PhysicsComponent data to the CollidableComponent, and marks the PhysicsComponent as obsolete. 2020-07-21 23:36:42 -07:00
Pieter-Jan Briers
0297464af5 Fix MapID assignment in transform init. 2020-07-22 01:51:17 +02:00
Pieter-Jan Briers
bbbaef5da4 Fix integration tests.
They weren't pumping networking anymore because Acruid moved it to Input.
2020-07-20 12:12:56 +02:00
Hugal31
63720cd034 Feature/the macro (#1165)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-07-11 15:03:28 +02:00
Pieter-Jan Briers
93fcb0df9b Move back to per-component-type-dictionaries for component storage.
It's much faster than the single dictionary approach.
2020-07-11 13:15:44 +02:00
Pieter-Jan Briers
a2617312d9 Use Serilog internally for logging, add Grafana Loki log handler. 2020-07-10 20:55:31 +02:00
Pieter-Jan Briers
9e5374ac86 Assert that messages have been registerd in integration tests. 2020-07-06 21:24:03 +02:00
Pieter-Jan Briers
31fb65bcb9 Movement prediction work. (#1144)
* Fix client-side input system not sending sequence numbers for input messages.

This caused message ordering issues and keys getting stuck down.

* Make sure EyeUpdateSystem runs after physics.

* IGameTiming.TickFraction helper.

* Subtick data for input commands.

* Literally a unit test to verify that I wasn't going insane while debugging input message ordering issues.

* More prediction logs behind net.predict.

* Move physics to shared and run it on the client.

* Synchronize grid gravity.

* Fix ResetPredictedEntities crash when entities get deleted server-side.

* Fix CollidableComponent setters not calling Dirty()

* Fix going into space while predicting.

* Watch window uses history line edit.

* Fix unpredicted objects stuck-jittering.

* VV tags for interp vars on transform.

* Fix 0 mass objects on client.

* Fix friction calculations being TPS dependent.

* Reset predict flag on handelComponentState
2020-06-24 20:47:20 +02:00
Pieter-Jan Briers
67efd69679 Add explicit update dependency specification between entity systems.
This allows a system to say "I want to update after this other system does".

Based on @chairbender's work with the input binding stuff.
2020-06-19 00:18:59 +02:00
Tyler Young
9cbdd1058c Use CannyFastMath & Update Some Packages (#1130)
update a bunch of packages and use JetBrains.Annotations as private asset as needed

mark some hot math methods agg inline to benefit from loop opts

use FMA for interp

use canny min/max/clamp

make Quaternion NormalizeAngle fixed time and faster

clean up YamlDotNet references
2020-06-18 02:25:36 +02:00
Pieter-Jan Briers
af249f80c8 Improved click detection supporting features: (#1133)
* Improved click detection supporting features:

Clickable removed from engine
Texture/RSI load hooks for content
New sprite layer API

* Fix tests.
2020-06-18 02:25:02 +02:00
Tyler Young
9662d52f90 Shared String Dictionary ctd. (#1126) 2020-06-13 04:09:48 +02:00
Pieter-Jan Briers
b3d4f55f28 Fix ResourcePath.ChangeSeparator for rooted paths. 2020-06-12 22:51:25 +02:00
Pieter-Jan Briers
aaa09881cb Enable NRTs for unit tests. 2020-06-12 17:11:32 +02:00
Pieter-Jan Briers
b1ab4a61f8 Make sure integration tests get shut down on test tear down. 2020-06-12 15:16:03 +02:00
Pieter-Jan Briers
ca1597d952 Add some convenience helpers for integration testing. 2020-06-12 12:42:05 +02:00
Tyler Young
0d52def877 Have RobustSerializer use a shared string dictionary (#1117)
* implements shared string dictionary and handshake from net-code-2

* fix unit test

switch to szr sawmill

* try to silence some warnings around ZipEntry

* rebase and use system zip instead of icsharplib

fix rebase artifacts

* Update Robust.Shared/Interfaces/GameObjects/IComponentFactory.cs

* Update Robust.Shared/Serialization/RobustSerializer.MappedStringSerializer.cs

* Update Robust.Shared/Serialization/RobustSerializer.MappedStringSerializer.cs

* Apply suggestions from code review

* Apply suggestions from code review

* Update Robust.Shared/Serialization/RobustSerializer.cs

* since no longer gathering from paths, make string splitting more robust

* make string gathering ignore strings under 4 chars long

make string gathering yet more robust

* add limit to size of mapped strings

* add more string data to feed into shared string dictionary from YAML files

add JSON importer but don't parse RSI metadata yet

fix typo that breaks nulls in MappedStringSerializer

minor refactoring

make string splitting more robust

add WriteUnsignedInt / ReadUnsignedInt for validating WriteCompressedUnsignedInt / ReadCompressedUnsignedInt aren't bogus

* comment out some log statements

* minor refactor, reorder logging

add null check due to smart typing NRT checks

* Add doc comments, readability improvements to MappedStringSerializer

The protocol, handshake, and internal logic are now more documented.

The main area that could still be improved is the documentation of how
the cache system works, but the code is readable enough for now that it
isn't immediately necessary.

* add documentation, organization

* update some more doc comments

* add flows to doc comment for NetworkInitialize

* more documentation and organization

* more docs

* instead of retrieving INetManager by IoC, assign when NetworkInitialize is invoked

* "document" the regex

* Update Robust.Shared/Network/NetManager.cs

* add missing check for LockMappedStrings

* Update Robust.Shared/Serialization/RobustSerializer.MappedStringSerializer.cs

Co-authored-by: ComicIronic <comicironic@gmail.com>

* change to warning instead of throw for unlocked string mapping

Co-authored-by: ComicIronic <comicironic@gmail.com>
2020-06-12 04:09:55 +02:00
Pieter-Jan Briers
8f63ee481e Make sure CurTick increases AFTER ticks in integration tests.
For consistency with the real main loop.
2020-06-10 04:59:50 +02:00
Pieter-Jan Briers
76b0779563 More convenient system for integration tests to override CVars. 2020-06-09 14:11:30 +02:00
Pieter-Jan Briers
3cbfef8b07 Yep it's definitely late *checks clock* oh god. 2020-06-09 03:49:09 +02:00
Pieter-Jan Briers
bdab4bc6c9 Why WOULD I run my own tests before pushing? 2020-06-09 03:47:04 +02:00
Pieter-Jan Briers
73618f6bb2 Fix map loading and add map loading unit test. 2020-06-09 03:43:33 +02:00
Pieter-Jan Briers
be1ceeb2db Add testing convenience helper to mount strings as files in the VFS. 2020-06-09 03:43:33 +02:00
Pieter-Jan Briers
289938dbd1 Refactor PackLoader.
Use System.IO.Compression instead of SharpZipLib.
Unit tests.
Fixes.
2020-06-08 23:58:32 +02:00
Pieter-Jan Briers
3459e5fd0b Remove explicit x64 platform target to fix ARM64 builds. 2020-06-08 23:36:08 +02:00
Pieter-Jan Briers
aec9c5e66d Clear IoC on RobustUnitTest TearDown to hopefully provide better test isolation. 2020-06-08 14:36:18 +02:00
Pieter-Jan Briers
9a637a0632 Fix ComponentManager_Tests on release mode. 2020-06-08 14:35:50 +02:00
ComicIronic
caa876dbb3 Fix TickRate causing CurTime jumps (#1106) 2020-06-06 23:50:02 +02:00
chairbender
d148bde02b Command Binding System supporting multiple bindings (#1089) 2020-05-31 20:44:16 +02:00
Pieter-Jan Briers
cb3fe9c138 Adds AttachedProperty<T>.
Generics are useful.
2020-05-31 00:34:56 +02:00
ComicIronic
c9157c8b57 Adds custom YAML serializer for ints in terms of named constants (#1088)
Works similar to the flag serializer, except it allows for magic numbers
to be given names in the YAML.
2020-05-30 12:07:19 +02:00
Leo
44fcb0232c Adds theyre text macro (#1080) 2020-05-28 17:47:55 +02:00
Pieter-Jan Briers
9eeb1d1afa Fix compiler warnings 2020-05-28 17:44:31 +02:00
Pieter-Jan Briers
5b9789870b Fix inheritance overriding behavior on PlacementMode. 2020-05-28 00:27:22 +02:00
Hugal31
b4eac8526a Implement text macros (#1058) 2020-05-25 20:47:51 +02:00
ComicIronic
5ebd8a4221 Add system for using flag names in YAML (#1047) 2020-05-24 22:43:30 +02:00
Jackson Lewis
274334c926 Rewrite the physics engine (#1037) 2020-05-23 01:21:02 +02:00
Pieter-Jan Briers
eb6463fad0 Fix failing test 2020-05-20 16:16:25 +02:00
Pieter-Jan Briers
2424adbe6e Clean up unused cruft files. 2020-05-17 02:12:00 +02:00
Pieter-Jan Briers
d6b25945e4 Adds AltOrigin functionality property to PopupContainer. 2020-05-13 17:55:33 +02:00
Pieter-Jan Briers
b7f3627ef1 Remove List<>/Dictionary<,> usage from low-level GameState serialization.
NetSerializer does not handle these well and sends the entire backing array instead of a more compact representation. This can then cause it to start sending lists of length 1 with a *capacity* of 4096 resulting in 250 KiB/s down to send updates for a single entity. As it just did on the public server...
2020-05-12 18:34:16 +02:00
Pieter-Jan Briers
1f6bd2481f Allow escaping command parsing. 2020-05-03 15:59:15 +02:00
ComicIronic
4b50b151fe Minor improvements to printing in VV (#1041) 2020-05-02 00:15:59 +02:00