3472 Commits

Author SHA1 Message Date
Pieter-Jan Briers
f548fd970e Do not catch Input exceptions in GameLoop on Debug. 2019-05-08 23:11:17 +02:00
Pieter-Jan Briers
5077b5ec4e Do not hide exceptions thrown in IoC service Dispose. 2019-05-08 22:59:45 +02:00
Pieter-Jan Briers
cd919302f8 Remove debug Console.WriteLine from SingleStreamLoader 2019-05-08 22:59:24 +02:00
Pieter-Jan Briers
7d8ba30844 Don't include deleted components in GetAllComponents 2019-05-08 15:40:29 +02:00
Pieter-Jan Briers
1b4cbf58b8 Make all exceptions crash the game on debug. 2019-05-08 15:40:09 +02:00
Pieter-Jan Briers
6da21ab6c1 Clyde correct sRGB support.
This makes light stacking look less... awful.

Also minor cleanup.
2019-05-08 14:37:48 +02:00
Pieter-Jan Briers
0340cecd6d Clean up entity events some more. 2019-05-08 09:54:04 +02:00
Pieter-Jan Briers
878fade1bd Timers get cancellation support. 2019-05-08 09:48:57 +02:00
Pieter-Jan Briers
285f68b4dd Minor clean up of entity events. 2019-05-07 23:13:35 +02:00
Pieter-Jan Briers
4979620486 Container improvements.
Make containers actually handle automatic removal of entities,
like say on unpartenting.
This was because a lot of content code was doing this manually,
and it broke, really badly.

They also emit events now that said content code can use instead.
2019-05-05 13:07:59 +02:00
Pieter-Jan Briers
3889066e9c Make parenting a transform to its current parent a no-op. 2019-05-05 13:05:31 +02:00
Pieter-Jan Briers
e2c7a0086c Integration Testing Framework. (#804)
* Server works if not connected to a tty.

* Rich presence does not run IoC resolution at runtime anymore.

* Work towards integration tests.

Mostly work related to making it so the server and client can run in
parallel, and allowing more control over main loop for testing.

* Lots of code relating to integration tests.
2019-05-04 17:51:20 +02:00
Pieter-Jan Briers
f4b0b69cbb Map Init & Map Loading improvements. (#801)
* MapInit v1, so people can criticize my code.

* Map init v1.

* Improve LocalPlayer to fix aghosting.

* Fix map saving.

* Map command improvements:

Implement loadbp
Made certain commands aware of uninitialized maps.

* Adds IMapManager.GetAllGrids()

* Add lsgrid and lsmap commands.

* MetaData component serialization fixes.

Serialize name and description default as null.
Don't serialize prototype.

* Explicit UID indices in map files.

* Update map format doc again.
2019-04-29 12:50:28 +02:00
Acruid
1b3cc8aba6 Grid Bounds (#800)
* Added centered unit box static field to Box2.

* MapGrid is more testable.

* Added some unit tests for MapGrid.
Fixed bug in MapChunk.GridTileToLocal().
MapGrid.UpdateAABB() actually expands properly now.

* Moved IMapChunk to Robust.Shared.Map.
Moved Chunk class out of MapManager class.

* Added unit tests for MapChunk.

* Bounds reduce by 1, so almost working.

* Now bound shrinking works :D

* Moved MapGrid out of MapManager.
Moved IMapGrid into the Shared/Map folder.
Replaced all calls to IMapGrid.ParentMap.Index with IMapGrid.ParentMapId.

* Added more MapGrid unit tests.
Fixed a bug in TryGetTileRef.
2019-04-29 12:43:20 +02:00
Acruid
d74151d242 Fixes ExposeData issue in MetaDataComponent. (#799) 2019-04-28 11:13:19 -07:00
Acruid
5fe0bd6e55 EntityStates (#798)
* Added a new special MetaDataComponent to store entity data that isn't specific to a component.

* Adds ExposeData to MetaDataComponent.
Name of the entity now defaults to the prototype name.

* EntityStates changed so that the list of networked components is not sent every tick for a modified entity.

* Code cleanup & doc comments.

* MetaDataComponent Name and Description are taken from the prototype before storing them in the component.

* Adds the EntityState serializer benchmark. This isn't a test, but is really useful.

* Redesigned the logic in ServerGameStateManager.

* Adds MetaDataComponent registration to the UnitTesting project.
2019-04-26 15:38:56 +02:00
Acruid
7053fb15f8 Map System Code Refactor (#796)
* Removed unused method TileRef.GetStep().
Removed unused property TileRef.TileSize.
Removed unused property TileRef.Tile, made the field public with the same name.
Made the TileRef struct readonly.
Removed property TileRef.TileDef.
Removed property TileRef.LocalPos.
Renamed GridTile to GridIndices.
Implemented IEquatable on TileRef.
Implemented Equality operators on TileRef.
Added PublicAPI attribute to TileRef.
Added doc comments to TileRef.

* Modified Tile:
Added the PublicApi annotation.
Made struct readonly.
Filled out doc comments.
Changed auto properties to readonly fields.
Renamed TileId to TypeId.
Added a static Empty tile to the struct.
Implemented IEquatable.

* Modified MapCoordinates:
Added PublicApi attribute.
Implemented IEquatable.
Filled out doc comments.
Removed Map property.

* Modified ScreenCoordinates:
Filled out doc comments.
Added the PublicApi attribute.
Implemented IEquatable.

* Modified GridCoordinates:
Removed method IsValidLocation.

* Removed property GridCoordinates.Grid.

* Removed GridCoordinates.Map.

* Removed GridCoordinates.MapId.

* Removed property GridCoordinates.IsWorld.
Removed constructors taking a MapId.

* Removed static IoCManager calls from GridCoordinates.

* Modified GridCoordinates:
Added attribute PublicApi.
Filled out doc comments.

* Filled out doc comments for MapGrid.
Filled out doc comments for MapIndices.
Misc refactors for both.

* added command to teleport grids.

* Added method Box2.Intersect.
Added method Box2.Union.
Placement manager now spawns new grids to place tiles not connected to an existing grid.
2019-04-20 20:37:37 +02:00
Acruid
a5a3a539dc Tick Logic Timing and Bandwidth Improvements (#795)
Code was changed so that time starts at tick zero, and all entities are initialized in the space between tick 0 to 1. This was a solution to the fact fromSequence was including entities with lastStateUpdate tick one less than the actual sequence number. This is purely an issue about when exactly the game does its logic relative to the tick signals, ie positive or negative edge of the tick. Right now the game is set up to run the game logic on the positive edge of a Tick (enforced by GameLoop).

The second big part is that an empty collection takes 5ish bytes more than a null collection in the NetSerializer, even though they are conceptually the same thing in a game state. This PR puts null checks around everything and allows GameStates to have whole sections of itself null. This reduced the payload size of an empty game state from 49B to 15B.

This PR also fixes the bug where the physics system marks every movable entity as dirty every tick.
2019-04-20 18:08:43 +02:00
Acruid
faf99d2231 By default events raised on the ECS event bus are now dispatched immediately. (#794)
Added a new EntityManager.QueueEvent() method that queues the event for the next tick.
2019-04-20 10:58:04 +02:00
Pieter-Jan Briers
ce052d4db3 Add method to post a delegate to the main thread.
Helps for writing threaded code.
2019-04-17 23:23:35 +02:00
Pieter-Jan Briers
28290614a1 Fix CVar command not working to set string CVars with null value. 2019-04-17 23:22:30 +02:00
Silver
25926a17b7 Renames SS14.* to Robust.* (#793)
RobustToolbox projects should be named Robust.* 

This PR changes the RobustToolbox projects from SS14.* to Robust.*

Updates SS14.* prefixes/namespaces to Robust.*
Updates SpaceStation14.sln to RobustToolbox.sln
Updates MSBUILD/SS14.* to MSBUILD/Robust.*
Updates CSProject and MSBuild references for the above
Updates git_helper.py
Removes Runserver and Runclient as they are unusable
2019-04-15 20:24:59 -06:00