Commit Graph
172 Commits
Author SHA1 Message Date
AndrewFenrizandGitHub c555dbc283 Do not serialize components pending removal (#6891) 2026-08-07 17:05:16 +10:00
metalgearslothandGitHub ac13da4328 Add chunk entities (#6705) 2026-07-24 19:02:55 +10:00
5e79016217 Illumination measuring system to determine how "lit up" entities are (#5574)
Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2026-07-23 23:09:22 +10:00
ab4db16d08 Fix calling Dirty+DiryField on same tick (#6685)
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2026-07-16 19:32:20 +10:00
DrSmugleafandGitHub c51009d4f0 Allow foreach with EntityQueryEnumerator and AllEntityQueryEnumerator (#6660) 2026-06-27 17:58:16 +10:00
83c2a1be11 [Dependency] source generator part 2 (#6550)
* [Dependency] source generator

No more reflection, no more codegen at runtime

Also various changes to Roslyn helpers to make this easier to write.

Requires all types with dependencies to be partial and not have readonly dependency fields. An analyzer enforces this at warning level, the previous injection strategies have remained in the code *for now* as a fallback.

No fallback is available for [field: Dependency] properties, due to a Roslyn bug.

Code Fixes exist. We love Roslyn

* Apply dependencies generator changes to all code

* Release notes

* Preprocessor got hands

* Handle nullable dependencies

These are bad but gotta deal with it.

* Apply suggestions from code review

Co-authored-by: Moony <moony@hellomouse.net>

* Fine, let's not use collection expressions

---------

Co-authored-by: Moony <moony@hellomouse.net>
2026-05-08 12:38:33 +02:00
e428a341e1 Debug assertions + a throw in RemoveComponentImmediate. (#6437)
* Debug assertions + a throw in RemoveComponentImmediate.

* nit

* Update Robust.Shared/GameObjects/EntityManager.Components.cs

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
2026-03-04 11:26:39 -05:00
5e160e26ee Prevent a potential EnsureComp exception. (#6405)
Fix potential EnsureComponent collision

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
2026-01-31 09:59:39 -05:00
deltanedasGitHubdeltanedas <@deltanedas:kde.org>
d548bce347 make EntityQuery.Resolve error not useless (#6320)
* make EntityQuery.Resolve error not useless

* it actually wasnt that bad

* goida

* make EntityQuery constructor internal

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2025-12-16 14:23:47 +01:00
4747e5a05a Add and update a lot of documentation (#6337)
* Serialization docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* ECS docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* scattered docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* Fixes

---------

Co-authored-by: Moony <moonheart08@users.noreply.github.com>
Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
2025-12-15 20:26:17 +01:00
PJB3005 9d45357ca9 Enable C# 14, fix a nullability error 2025-12-04 17:49:46 +01:00
b15d960c69 Try improve RaiseEvent performance (#5925)
* IEventBus -> EventBus

* Fix CompIdx.RefArray

* IEntityManager -> EntityManager

* Remove double delegate

* Add GetNetCompEventHandlers()

* release notes & cleanup

* Make PVS use GetNetCompEventHandlers

* I love event bus tests

* also fix pvs pause test

* dont trimm

---------

Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2025-11-13 21:32:40 +11:00
Pieter-Jan BriersandGitHub dcbe0505dc Revert "Add WeakEntityReference (#5577)" (#6112)
This reverts commit c3489d4ded.
2025-07-29 18:22:17 +02:00
c3489d4ded Add WeakEntityReference (#5577)
* Add WeakEntityReference

* Use NetEntity

* release notes

* A

* Fix merge conflicts

* comments

* A

* Add network serialization test

* Add ToPrettyString support for WeakEntityReference?

* inheritdoc

* Add GetWeakReference methods

* Not-nullable too

* Make EntitySystem proxy method signatures match EntityManager

* Add TryGetEntity

* interface

* fix test

* De-ref GetWeakReference methods

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
2025-07-29 11:12:49 -04:00
Leon FriedrichandGitHub 8f49785b4e Fix RemCompDeferred not always setting lifestage (#5786)
* Fix RemCompDeferred not setting lifestage

* spaelling
2025-04-12 12:57:11 +10:00
pokljandGitHub 0dec6a425f Modify TryCopyComponents metadata TryGetComponent (#5710) 2025-02-27 11:25:28 +11:00
8a04a4f3a5 Add a method for copying components (#5654)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2025-02-21 09:46:13 +11:00
metalgearslothandGitHub ae7725aafe Add compreg methods to entitymanager (#5655) 2025-02-10 21:39:41 +11:00
Leon FriedrichandGitHub 3f37846731 Avoid unnecessary DirtyField() calls (#5620) 2025-01-27 21:21:53 +11:00
Leon FriedrichandGitHub 9af119f57a Toolshed Rejig (#5455)
* Toolshed Rejig

* shorten hint string

* Try fix conflicts. Ill make with work later

* bodge

* Fix ProtoIdTypeParser assert

* comment

* AllEntities

* Remove more linq from WhereCommand

* better help strings

* Add ContainsCommand

* loc strings

* Add contains command description

* Add $self variable

* Errors for writing to readonly variables

* A
2024-12-21 17:49:11 +11:00
9837c33de7 Add sourcegenned field deltas (#5155)
* Remove full "delta" states

* Update MapGridComponentState

* abstract ComponentState

* Release notes

* Fix tests

* Fix nullable errors

* A

* Sourcegen component deltas

* Audio deltas + methids

* Also eye

* Optimise out the dictionary

* Minor fixes

* Physics deltas

* Also this

* Fix field deltas

* remove old release notes

* Make IComponentDelta implement IComponent

* add sourcegen launch settings

* make silent error loud

* Review

* UI deltas

* Slimmer

* Sourcegen bandaid

---------

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2024-12-21 15:48:33 +11:00
metalgearslothandGitHub 27f7f5ee36 Add Pure attribute to some entmanager methods (#5557) 2024-12-12 18:24:20 +01:00
KaraandGitHub 48d70a09c6 Remove most fully-obsoleted code (#5433) 2024-09-11 19:38:26 +10:00
Leon FriedrichandGitHub 73ef69aa94 Try and ensure that parents are always initialized before children (#5343)
* Try and ensure that parents are always initialized before children

* release notes
2024-08-31 11:05:56 +10:00
Pieter-Jan BriersandGitHub be36001ab8 Add thread check assert to core entity mutation commands. (#5411)
* Add thread check assert to core entity mutation commands.

Creation of entities and components is now checked to happen from the main thread.

This is already catching multiple buggy integration tests, these will be addressed in separate commits.

* Fix broken tests directly mutating entities from wrong thread.
2024-08-31 11:04:02 +10:00
metalgearslothandGitHub 8d5ebd830a Add CompRegistry methods to EntManager / CompFac (#5379)
* Add CompRegistry methods to EntManager / CompFac

CompRegistries are nice to use and this just makes it a bit easier to extend functionality.

* fix bad pull
2024-08-25 21:37:14 +10:00
Leon FriedrichandGitHub 1de8731465 Reduce uses of IComponentFactory.GetIndex(Type) (#5242)
* Update `RaiseComponentEvent` & component lifestatge methods

* Fix ComponentNetworkGenerator

* a

* A
2024-06-17 01:46:51 +10:00
metalgearslothandGitHub a044f04e3b Remove CompIdx locks (#5231)
* Remove CompIdx locks

So GetComponentState in PVS calls RaiseComponentEvent which in turn calls this. When you start getting a significant number of players it seems to run into lock contention considering every single compstate get will lock this.

Instead we'll just update the dictionary whenever RegisterClass is called instead.

* Fix thread-safety issues
2024-06-15 01:30:45 +10:00
Leon FriedrichandGitHub a4723d1f62 Avoid read lock in GetEntityQuery (#5236) 2024-06-15 01:19:29 +10:00
metalgearslothandGitHub 6b4d74f46e Maybe fix bad resolve logging (#5207)
I'm not entirely sure what happens, I couldn't repro it locally even when I tried to force it to use threadpool threads. The only info I have is it happens and no other info has been provided so.
2024-06-05 09:00:41 +10:00
Leon FriedrichandGitHub 9737a4249c Rework delta-states (#5149)
* Remove full "delta" states

* Update MapGridComponentState

* abstract ComponentState

* Release notes

* Fix tests

* Fix nullable errors

* A

* typo

* Turns out testing my own PRs is a good idea

* too many warnings
2024-05-24 14:08:41 +10:00
deltanedasGitHubdeltanedas <@deltanedas:kde.org>
6e61c35d35 add missing Comp inline to EntityQuery (#5123)
Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-05-14 08:43:03 +10:00
metalgearslothandGitHub 5a14e939bf TileChangedEvent bool (#5089)
Shows whether IsEmpty is different, useful in circumstances.

Also NotNullWhen null handling consistency.
2024-04-30 07:28:29 -07:00
Leon FriedrichandGitHub 7d1915096a Use more entity queries in physics systems & entity manager (#5082) 2024-04-29 13:46:10 +10:00
Leon FriedrichandGitHub d5c4981648 Partial MapManager refactor (#5042)
* MapManager rejig

* Update Tests

* A
2024-04-18 14:05:02 +10:00
metalgearslothandGitHub 92d7f2723a Add ComponentRegistry helpers to EntityManager (#4934)
* Add ComponentRegistry helpers to EntityManager

* Metadata here too

* Remove object cast

* knock

* Plural
2024-03-31 14:54:01 +11:00
Leon FriedrichandGitHub d933f03a54 Add TryComp and HasComp to EntityQuery<T> (#4996) 2024-03-24 21:40:28 +01:00
Leon FriedrichandGitHub f2e9ed0b73 NetSyncEnabled fixes (#4811)
* NetSyncEnabled fixes

* A
2024-01-05 15:11:09 +11:00
metalgearslothandGitHub 270326e188 Add IComponentState / struct support (#4610)
Still boxes but hey at least the struct dream is real.
2024-01-04 13:42:47 +11:00
Leon FriedrichandGitHub 7d27835543 Use frozen collections in component factory and EntityManager._entTraitDict (#4726)
* Make component factory use frozen collections

* Fix integration tests

* Also freeze _entTraitDict

* A

* I love integration test setup logic

* Re-add public method

* changes

* Better notes

* And the new method

* Fix notes
2024-01-04 12:21:24 +11:00
Leon FriedrichandGitHub cfb88b2e8e Arch related engine changes (#4806) 2024-01-04 12:18:03 +11:00
Leon FriedrichandGitHub 97d03c6954 VisMask and EntityLifeStage changes (#4794) 2024-01-02 11:43:08 +11:00
metalgearslothandGitHub 0b62cb6445 Change netsyncenabled to an assert (#4604) 2023-12-10 13:03:25 +11:00
metalgearslothandGitHub 24b0165ec9 Revert Arch (#4613) 2023-11-27 21:41:01 +11:00
metalgearslothandGitHub a92c0cbef4 Fix nullable comps being raised for client gamestates (#4596) 2023-11-23 22:07:27 +11:00
metalgearslothandGitHub 861807f8b4 Fix HasComp(uid, Type) (#4594) 2023-11-23 16:52:31 +11:00
7dce51e2cf Arch PR two electric boogaloo (#4388)
Co-authored-by: DrSmugleaf <drsmugleaf@gmail.com>
Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2023-11-23 14:29:37 +11:00
DrSmugleafandGitHub 2b85fa88c1 Print stack trace when adding a component while iterating net comps in ResetPredictedEntities (#4541) 2023-11-13 05:26:13 +11:00
Leon FriedrichandGitHub 325fe46aa3 Add More Entity<T> query methods (#4550) 2023-11-07 20:24:42 -08:00
Leon FriedrichandGitHub 5a6c4220fc IPlayerManager refactor (#4518) 2023-10-24 20:18:58 +11:00