Commit Graph
37 Commits
Author SHA1 Message Date
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
metalgearslothandGitHub 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
DrSmugleafandGitHub b737ecf9b3 Add generic EntityUid, remove some usages of .Owner (#4498) 2023-10-19 12:23:48 -07:00
Leon FriedrichandGitHub f3af813b57 Transform interpolation fixes (#4488) 2023-10-17 23:47:45 +11:00
metalgearslothandGitHub 0624ac36cd Remove PhysicsComponent ref from fixtures (#4374) 2023-09-12 12:49:33 +10:00
metalgearslothandGitHub 7d1ad527d9 Replace Robust Vector2 with System.Numerics (#4092) 2023-07-08 14:08:26 +10:00
Leon FriedrichandGitHub 945c3dada9 Try fix collision mispredicts (#4016) 2023-05-13 00:02:42 +10:00
metalgearslothandGitHub 1c36d919e4 Physics ECS 2 (#3648) 2023-01-15 15:38:53 +11:00
metalgearslothandGitHub af7e9150bb Don't predict sleeping on disallowed bodies (#3661) 2023-01-06 20:39:08 +11:00
metalgearslothandGitHub ace8500240 Remove client/server split on sharedphysicsmap (#3618) 2022-12-27 13:17:54 +11:00
metalgearslothandGitHub 5c1d753a8d Physics solver refactor (#3479) 2022-12-26 10:51:00 +11:00
Leon FriedrichandGitHub 2b594f6356 Cache broadphases and container rejig (#3407) 2022-10-31 10:06:08 +11:00
metalgearslothandGitHub de01b9d8cb Raise collision events by-ref (#3201) 2022-09-14 17:23:35 +10:00
metalgearslothandGitHub db3f3e5b32 Allow maps to be saved (#3055)
* Allow maps to be saved

* I hate myself

* fix?

* Fix maybe?
2022-07-25 15:30:20 +10:00
metalgearslothandGitHub 09d7ad9d62 Don't run client physics in frameupdate (#2953) 2022-06-23 12:12:54 +10:00
AcruidandGitHub 31764d3c2d Mark C# events on MapManager as Obsolete (#2586)
* Obsoleted C# grid events from MapManager.GridCollection. Use the ECS EventBus events instead.

* Obsoleted C# events from MapManager.MapCollection. Use the ECS EventBus events instead.
2022-03-07 15:51:00 -08:00
de4d255841 Analyzer to enforce classes to be either [Virtual], abstract, or sealed. (#2469)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-02-05 19:31:58 +01:00
Pieter-Jan Briers 069ebbc8d0 Make disabled prediction work again.
Simulation input and Update() does not happen when prediction is disabled. Both of these can be re-opted in on a per-handler/system basis with a bool flag. Stuff like physics opts out of this now.
2021-12-30 03:03:39 +01:00
Vera Aguilera Puerto 26dcef4a11 Fix more useless resolves, makes entity system proxy "Deleted" not throw. 2021-12-08 11:10:11 +01:00
Wrexbe 5356523305 Client builds 2021-12-03 12:58:37 -08:00
Vera Aguilera Puerto c39f6d09eb Lots of manual fixing. More to come. 2021-12-03 17:01:46 +01:00
Vera Aguilera Puerto 19f50d60c9 Inline AddComponent 2021-12-03 11:33:40 +01:00
metalgearslothandGitHub 80a9a82278 Fix client-side physics bodies getting stuck awake (#1946)
* Fix client-side physics bodies getting stuck awake

Wasn't a huge perf hit but it could leak a bit. Also there's a bunch of E/C stuff in here and I'll deal with it later.

* Fix broadphase leak

* Fix robust server sim
2021-08-23 15:01:08 +10:00
metalgearslothandGitHub 04d94f87fc Fix movement lerping (#1924) 2021-08-04 00:11:04 +10:00
AcruidandGitHub 2183cd7ca1 Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
2021-02-10 23:27:19 -08:00
00fbefa4e5 Physics caching go brrt (#1307)
* Physics caching go brrt

* Minor optimisation

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
2020-10-09 11:40:02 +02:00
Acruid 6245b2223b Improve performance when initially settling the map at load time.
Clients now simulate all awake bodies when predicting, not just predicted ones.
2020-08-18 10:59:49 -07:00
Acruid c7f5521d2e Removed IsEntityPaused from the server component query, it was bugged and only about 1/5 of the entities on the map were actually processed in the collision system. This change causes a noticeable perf impact when starting the server and lasting until everything on the map goes to sleep.
BodyType is now serializable, fixes bug with VV.
Moved both velocity properties from ICollidableComponent to IPhysBody, added default methods to IPhysBody to get the word transform.
Added DebugTools.Break() method, calling it breaks execution in the attacked debugger.
Added VV attributes to various CollidableComponent properties.
2020-08-13 21:52:53 -07: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
Acruid 876d528578 Had to optimize the physics so that the client runs on my laptop. 2020-07-29 00:47:47 -07:00
Acruid 64bb519bce Adds PhysBody sleep visualization to the Collidable overlay. 2020-07-19 02:34:19 -07:00
Acruid 4ed044ddb4 Added an interface for PhysicsComponent.
Converted everything to use collision and physics component interfaces.
2020-07-19 00:32:06 -07:00
AcruidandGitHub 99933499b7 Merged Client and Server PhysicsComponent (#1163) 2020-07-02 09:34:16 +02:00
Pieter-Jan Briers 2af0d9df55 Optimizations to physics system.
Nothing major, just picking low hanging fruit and improving code quality around the place.
2020-06-30 15:13:51 +02:00
Pieter-Jan BriersandGitHub 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
ClyybberandGitHub fcdabe98f4 Tiny cleanup (#1098) 2020-06-02 14:40:08 +02:00
Jackson LewisandGitHub 274334c926 Rewrite the physics engine (#1037) 2020-05-23 01:21:02 +02:00