70 Commits

Author SHA1 Message Date
PJB3005
788e9386fd Split up test project
Robust.UnitTesting was both ALL tests for RT, and also API surface for content tests.

Tests are now split into separate projects as appropriate, and the API side has also been split off.
2025-12-16 01:36:53 +01:00
Leon Friedrich
d894ef70ef Misc SpriteSystem fixes (#6001)
* Move GetPrototypeTextures to SpriteSystem

* Fix tests

* Fix #6002

* release notes

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2025-06-09 18:59:37 +10:00
metalgearsloth
ee8ea4ec3b Purge PhysicsMapComponent (#5766)
* Replace PhysicsMapComponent

- Dumb idea
- Lots of book-keeping and perf overhead.
- Much saner this way.

* stuff

* More work

* Purge

* Fixes

* Eh?

* Fixes

* Also this

* weh

* Fixes

* ice-cream

* Fix

* Fix stacking / gravity

* Gravity query

* MoveBuffer optimisations

* Fixes for test

* World gravity

* Fix build

* Avoid some transform resolves for contactless ents

* Less getcomps

* Fix contact caching

* Possibly less copies

* reh

* bulldoze

* Test "fix"

* seikrets

* a

* I saw this but now I decideded against it

* true
2025-05-28 19:18:36 +10:00
Leon Friedrich
fbc706f37b Refactor map loading & saving (#5572)
* Refactor map loading & saving

* test fixes

* ISerializationManager tweaks

* Fix component composition

* Try fix entity deserialization component composition

* comments

* CL

* error preinit

* a

* cleanup

* error if version is too new

* Add AlwaysPushSerializationTest

* Add auto-inclusion test

* Better categorization

* Combine test components

* Save -> TrySave

Also better handling for saving multiple entities individually

* Create new partial class for map loading

* Add OrphanSerializationTest

* Include MapIds in BeforeSerializationEvent

* Addd LifetimeSerializationTest

* Add TestMixedLifetimeSerialization

* Add CategorizationTest

* explicitly serialize list of nullspace entities

* Add backwards compatibility test

* Version comments

also fixes wrong v4 format

* add MapMergeTest

* Add NetEntity support

* Optimize EntityDeserializer

Avoid unnecessary component deserialization

* fix assert & other bugs

* fucking containers strike again

* Fix deletion of pre-init entities

* fix release note merge conflict

* Update Robust.Shared/Map/MapManager.GridCollection.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* VV

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2025-02-16 21:25:07 +11:00
Pieter-Jan Briers
d46885b96d Fix LocalizedEntityCommands breaking content unit tests. (#5375)
They are now not loaded inside content unit tests.

Fixes #5374
2024-08-21 02:43:46 +02:00
Pieter-Jan Briers
7fbcfeaa8f Warning fixes (#5275)
* Warning fixes in Robust.Shared

* Robust.Client warning fixes

* Fix test failure

Test failures were due to broken system registrations for the client RobustUnitTest. It was accidentally registering some server systems, which means DebugPhysicsSystem wasn't gettings its dependencies properly.

Fixing this meant pulling half a dozen extra dependencies that client ContainerSystem and TransformSystem are supposed to have, but didn't.
2024-07-10 01:38:32 +02:00
Pieter-Jan Briers
2a9de462d5 Preserve tile maps when saving maps & related changes (#5003)
* Un-hardcode behavior to make a component not saved to map file.

MapSaveId is a special component that can't be saved to map files due to a hardcoded type check. This behavior can now be applied to any component with [UnsavedComponent].

Moved "component registration" attributes into a single file because they don't deserve their own (poorly organized) .cs files.

* Add ITileDefinitionManager.TryGetDefinition

Try-pattern version of the existing indexers.

* Preserve tile maps when saving maps

This changes the map saver and loader code so that the "tilemap" can be preserved between map modifications as much as possible.

The tile map from the loaded map gets stored onto MapSaveTileMapComponent components on all loaded grids. This tile map is then used when saving, meaning that changes to the engine's internal tile IDs do not cause diffs.

Fixes #5000

* Changelog

* Fix tests
2024-03-27 14:14:19 +11:00
Leon Friedrich
2f0283edb7 Freeze event bus dictionaries (#4727)
* Make component factory use frozen collections

* Fix integration tests

* Also freeze _entTraitDict

* A

* I love integration test setup logic

* Re-add public method

* Freeze event bus

* Remove per-component dictionary lookup on EntAddComponent

* release notes + fix test jank

* Fix merge

* fix tests

* Shutdown
2024-01-06 13:50:19 +11:00
Leon Friedrich
64b5d6e323 Pvs cleanup & expose methods for benchmarking (#4779)
* Pvs cleanup & expose methods for benchmarking

* Fix tests

* Minimalist PvsData
2023-12-30 13:23:29 +11:00
Leon Friedrich
e9e0117402 Fix pvs bug (#4775)
* Fix pvs bug

* Moar asserts
2023-12-28 12:24:41 +11:00
Leon Friedrich
eba58cb893 Remove RobustTree & PVSCollection (#4759)
* Cut down RobustTree

* Better LoD

* Add PvsPriority flag

* Undo cvar name change

* reorganize grafana metrics

* Fix tests

* Fix replays

* Don't try process empty chunks

* Fix move benchmark

* Fix benchmark

* Remove obsolete audio methods

* Moar benchmarks

* Rename EntityData

* A

* B
2023-12-28 09:10:13 +11:00
Leon Friedrich
7b171b2212 Fix some physics bugs (#4746)
* Fix SetAwake()

* Remove bad debug assert

* EntityQuery & misc optimizations

* Remove bad(?) code, and add new test

* I love engine tests

* Add debug assert
2023-12-24 17:28:43 +11:00
Leon Friedrich
5af3cb969c Move ActorComponent to shared (#4527) 2023-10-29 04:21:09 +11:00
Leon Friedrich
684cabf3e6 Use metadata query in ToPrettyString() (#4478) 2023-10-09 19:07:31 +11:00
metalgearsloth
c4d6690a71 Remove SharedEyeComponent (#4309) 2023-09-11 16:15:08 +10:00
Leon Friedrich
fffe3c56e9 Fix enum serialization (#4208) 2023-07-30 20:17:22 +10:00
metalgearsloth
e4a14d1ec8 Start MapGrid ECS (#4185) 2023-07-23 20:50:23 +10:00
metalgearsloth
e763d59617 Remove some unnecessary EntityQuery<T> and warns (#4167) 2023-07-02 01:12:45 +10:00
Leon Friedrich
497674f306 Change capitalization of PVS to Pvs (#4139) 2023-06-15 12:08:34 +10:00
metalgearsloth
f2c2750f8c Gridtree ECS (#4109) 2023-06-10 18:15:04 +10:00
metalgearsloth
768377f59b Add joint relays (#4081) 2023-05-27 14:10:55 +10:00
metalgearsloth
8a6cadd38f Revert "Revert "Replace ResourcePath with ResPath (#3926)" (#3949)" (#3950) 2023-04-20 20:15:57 +10:00
metalgearsloth
d646403068 Revert "Replace ResourcePath with ResPath (#3926)" (#3949) 2023-04-20 11:43:51 +10:00
Ygg01
d6a3e1e286 Replace ResourcePath with ResPath (#3926) 2023-04-19 23:37:46 +10:00
metalgearsloth
1c36d919e4 Physics ECS 2 (#3648) 2023-01-15 15:38:53 +11:00
metalgearsloth
59d40eb56c Remove manual comp registrations from client / server (#3626) 2023-01-10 22:32:07 +11:00
Leon Friedrich
054a908efd Generalize component trees (#3598) 2022-12-27 13:33:46 +11:00
metalgearsloth
ace8500240 Remove client/server split on sharedphysicsmap (#3618) 2022-12-27 13:17:54 +11:00
metalgearsloth
5e3a5a0d0c Merge MapGrid into MapGridComponent (#3468) 2022-11-22 13:04:51 +11:00
Pieter-Jan Briers
1646297039 Remove most static IoCManager. accesses from engine. (#3466)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-11-15 22:00:28 +11:00
Pieter-Jan Briers
f1681b2128 Fix hot reload unit tests 2022-11-12 15:09:54 +01:00
metalgearsloth
4521dc37f5 Remove IMap / IMapGrid comps (#3434) 2022-11-04 10:12:36 +11:00
Leon Friedrich
1e843bf3a2 More Transform ECS (#3368) 2022-10-30 03:36:23 +11:00
metalgearsloth
ae2f3fe70c Remove EntityLookupComponent and de-dupe AABBs (#3367)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
2022-10-27 23:36:01 +11:00
metalgearsloth
964ab60020 Fix a bunch of warnings (#3289) 2022-10-21 00:17:29 +11:00
Leon Friedrich
557de01532 Dirty PVS chunk when visibility mask changes (#3045)
* Dirty PVS chunk when visibility mask changes

* fix tests?

* aaaaaa

* maybe sorta finally fix tests

* directly return vis mask,

Also defaults to 1 only if visibility component does not exist.

* make sure everything has first bit set
2022-07-17 06:23:35 +10:00
Pieter-Jan Briers
bf1cc8fd7c Minor performance improvements (#2860) 2022-05-28 15:28:08 +02:00
metalgearsloth
17dd3af3c7 ECS metadata pausing (#2800) 2022-05-14 14:55:42 +10:00
metalgearsloth
33251222cd EntityLookup as a system (#2573) 2022-03-03 21:17:01 +11:00
metalgearsloth
4b20bae597 RobustUnitTest tweaks (#2568) 2022-03-01 13:35:32 +11:00
metalgearsloth
6da9176410 Fixture 2 electric boogaloo (#2297) 2021-12-01 18:31:13 +11:00
metalgearsloth
f812eb1e27 Revert "Move physics fixtures to its own component (#2220)"
This reverts commit ebc0fc9c60.
2021-12-01 13:54:32 +11:00
metalgearsloth
ebc0fc9c60 Move physics fixtures to its own component (#2220) 2021-12-01 12:59:42 +11:00
Javier Guardia Fernández
04d029b9a2 Add test pooling (#2146)
* Add test pooling and global test setup

* WIP test pooling changes

* Make asynchronous tests the default again

* Finish fixing tests, make test threads background threads

* Un-pool tests with custom cvars

* Fix not changing FailureLogLevel cvar on instance return

* Fix error when overriding already overriden cvar

* Don't pool some physics integration tests

* Unpool engine tests, the technology just isn't there yet

* Remove explicit Pool = false from physics tests

* Change default pooling setting to false

* Didn't need this anyway

* Remove ConfigurationManager.ResetOverrides

* Bring back enum cvar override parsing

* Make integrationInstances name clearer > notPooledInstaces
Make clients ready and servers ready internal

* Add logging test instances

* Give more info on ran tests

* Show total clients and servers in test output

* Wipe LayerMap on SpriteComponent.AfterDeserialize

* Fix server not properly kicking clients

* Rider shut

* Make all test metrics report totals

* Format tests ran better

* Replace Console.WriteLine with TestContext.Out.WriteLine

* Fix two server test pooling info prints using total clients instead of total servers

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2021-11-06 11:18:18 +01:00
metalgearsloth
68576ace72 Accurate grid bounds (#2027)
* Fright night

* Shitty bounds working

* No more fixture leak

* Optimise TryFindGridAt

Should be O(1) now instead of the previous O(n) for number of fixtures

* ambush

* Merge stuffies

* Merge to master

* Fixes I guess

* Fix client sync

* Fix grid deserialization

* Jank test

* Fix deferral shitfuckery

* Optimise and remove

* Fixes

* Just werk dam u

* Optimisations

* Bunch of fixes

* FINALLY IT'S DONE

* Fixes

* Fix

* Comment
2021-09-20 21:07:31 +10:00
metalgearsloth
2fd3bbf58b Optimise TryFindGridAt (#1945) 2021-08-16 21:06:31 +02:00
metalgearsloth
ba40185179 Make entitylookup grid-relative (#1849)
* Refactor entitylookups to be 30% more based

* Refactor gucci

* Done?

* Fix most tests

* nothing suss

* Vera single-handedly saving shuttles

* fex

* Copy lookup from shuttles

* sys

* comp recursion
2021-07-12 13:39:02 +02:00
Vera Aguilera Puerto
ae9c2423ff Fixes EntityLookup not being restarted correctly on reconnect. 2021-05-18 17:55:24 +02:00
Pieter-Jan Briers
2a1eda0d38 Fix tests 2021-05-12 01:57:03 +02:00
metalgearsloth
d8aad89c2f Split entity management from entity queries (#1665)
* Split entity lookups from entitymanager

* Helps if you subscribe dingus

* Handle map changes

* Stacks instead

* Make mapchanges use a queue because it's probably better

Moves likely only care about the latest position

* IoC what you did there

* IoC refactor

* Minor optimisations

* Apply feedback

* My IQ dropped 3 sizes that day

* Rest of acruid's feedback

* final_no_actual commit

* enlightenment?

* Liftoff

* final_commit_v2_actual

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
2021-04-06 13:29:48 +10:00