Commit Graph

16 Commits

Author SHA1 Message Date
Víctor Aguilera Puerto
d1f7f0b80b Tile Prying helpers 2020-09-02 18:55:51 +02:00
DrSmugleaf
de9dfefd61 Replace resolve dependency with attribute in components (#1995)
* Replace resolve dependency with attribute in components

* Add changes that went missing in translation
2020-09-02 01:30:03 +02:00
py01
9d5278ab0d Volume and pressure pump (#1955)
* PressurePump and VolumePump

* VolumePump fix

* PressurePump fix

* volume pump simplification

* Fixes GridAtmosphereComponent not updating pumps

Co-authored-by: py01 <pyronetics01@gmail.com>
2020-08-31 02:13:23 +02:00
Víctor Aguilera Puerto
fb0ac3d70e Atmos optimizations (#1944)
* Adds IFireAct, ITemperatureExpose

* Use AtmosDirection instead of Direction for Atmos

* Refactor atmos to heavily rely on arrays and bitflags.
Adds F A S T M O S and reduces atmos tech debt heavily.

* Optimize and fix more stuff

* Kinda improve superconduction

* Pipenet is a word

* T U R B O M O S

* Address reviews

* Small optimization

* Superconduct is also a word

* Remove check

* Cleanup tile atmosphere

* Correct a comment
2020-08-28 14:32:56 +02:00
py01
7b12d4e08c PipeNet (#1626)
* PipeNode

* Pipe prototypes

* Fixes Default NodeGroup not being registered by NodeGroupFactory

* GasNet

* PumpComponent

* IPipeNet

* PipeComponent

* misc naming, yaml

* PipeComponent rework

* PipeNet gas transfer from pipes

* PipeNet correctly combines gas on combining with other group

* Client ignores piping components

* AfterRemake

* PipeNet remake simplification

* IGasMixtureHolder on PipeComponent, IPipeNet

* PipeContainerComponent

* BasePump

* DebugPump

* IgnoredComponent fix

* Pipe LocalAir and Air

* comments

* Pump fix

* PipeNet fix

* name simplification

* PipeDirection name changes

* BaseVentComponent and DebugVentComponent

* Moves Pipe to own file

* DebugVentComponent moved to own file

* BaseScrubberComponent

* DebugScrubberComponent

* IgnoredComponents update

* scrubber prototype

* vent prototype fix

* comments

* Removes vent and scrubber PipeDirection check

* PipeContainer, Pipe, and PipeNode refactor

* Yaml cleanup

* pump prototype fix

* Removes AssumeAir usage from old IGasMixtureHolders

* Simplfies Vent & Scrubber to use AtmosHelper methods

* Vents and scrubbers invalidate the coordinate they changed the gas of

* UpdatedPipingComponent

* ScrubberComponent renamed to SiphonComponent

* Removes PumpSystem

* Removes framTime from UpdatedPiping

* PipeNetDevices

* PipeNetDevice updated by GridAtmosphereComponent

* PipeNets react from update in GridAtmosphereComponent

* GridAtmosphereComponent stores PipeNets/PipeNetDevices to be updated in queue

* diff fix

* Removes debug gas starting in pipes

* type safety in IPipeNet when combining groups

* null checks

* GridAtmos stores PipeNets and PipeNetDevices in List

* comments

* rogue curly bracket

* ProcessPipeNets update fix

* RemovePipeNet fix

* PipeNet update() unique index

* fix diff

* Integration test fixes

* Error Logging

* error fix

Co-authored-by: py01 <pyronetics01@gmail.com>
2020-08-27 17:45:27 +02:00
DrSmugleaf
b9196d0a10 Add a test that puts all components on an entity and checks for no exceptions (#1815)
* Add test that puts all components on an entity and checks for no exceptions

Also fix all the exceptions that happened because of this

* Add comments to the test

* Fix nullable errors

* Fix more nullable errors

* More nullable error fixes

* Unignore basic actor component

* Fix more nullable errors

* NULLABLE ERROR

* Add string interpolation

* Merge if checks

* Remove redundant pragma warning disable 649

* Address reviews

* Remove null wrappers around TryGetComponent

* Merge conflict fixes

* APC battery component error fix

* Fix power test

* Fix atmos mapgrid usages
2020-08-22 22:29:20 +02:00
Vince
b647ad0f42 Refactor UpdateKinematics() and fix a lot of Content warnings (#1709)
Most warnings were related to EntityQuery and IPhysicsComponent.
Partially fixes #1650 and fixes #1682
2020-08-15 20:38:35 -07:00
Víctor Aguilera Puerto
67fbdb96b3 Fix deconstructing walls creating an atmos void.
This caused a lot of high pressure movements.
2020-08-15 16:51:57 +02:00
Víctor Aguilera Puerto
898e278266 Fix some atmos tiles not being added correctly. 2020-08-15 16:20:31 +02:00
Víctor Aguilera Puerto
ca68fbe818 Add heat conduction (#1653) 2020-08-13 14:18:26 +02:00
Víctor Aguilera Puerto
6a06358012 Minor atmos optimization 2020-08-10 02:53:55 +02:00
Víctor Aguilera Puerto
7293d985a5 Unique gas serialization for atmos (#1629)
* Add unique gas mixture serialization for atmos

* Refactor doAfterEventArgs

* Adds atmos commands

* Roundstard now has correct ratio of gases

* Fixed hashcode for gasmixture, better grid atmos serialization

* Airlocks create gas based on adjacent tiles now.

* Enables barotrauma component damage
2020-08-09 16:52:59 +02:00
Víctor Aguilera Puerto
9681907006 Fix bug where atmos could get stuck processing certain states for a long time 2020-08-08 16:55:36 +02:00
Víctor Aguilera Puerto
079937a9fe Wall slams - Damage on high velocity impact. (#1600)
* Wallslammed!

* Removes debug logging

* Buff damage to 5 by default
2020-08-07 16:22:32 +02:00
Víctor Aguilera Puerto
c5d3bff266 Fix server crash 2020-08-04 16:11:41 +02:00
Víctor Aguilera Puerto
85df48a700 Adds atmos (#1389)
* Add initial atmospherics framework

* Make walls and airlocks airtight

* Add the basic atmosphere gas system

* Atmos: move CardinalToIntVec and Offset into extention methods in EntityNetworkUtils

* Optimize vending machine code a bit.

* Address feedback from Atmos PR, make code compile

Fix use of OnMove -> SnapGridComponent.OnPositionChanged.
Added pause checking to atmos simulations.

* Improvements to the existing ZAS prototype (#996)

* Rename Volume -> Quantity in GasProperty

This makes the name consistent with the rest of the code, given that
it's meant to be a mol value.

* Replace Gas enum with GasPrototype

Unused as of yet, but laying the groundwork for future changes.

* Update AtmosphereMap, improving maths

Adds a temporary default atmosphere, hardcoded in for testing. It will
be replaced eventually.

Fixed a maths mistake in the original code involving unit conversions.

Added the Take() method to IAtmosphere, for taking some volume of
mixture out of a gas mix. This will be pretty handy in the future, but
for now it's used by walls to delete air where they are built.

* Fix merging, splitting logic for zones

Removing a cell from a zone now correctly reduces its volume.
Adding a cell to a zone now correctly increases its volume.

* Improvements to atmos code, reorganising of types

Moved GasPrototype to shared, because it's going to be used by the
client later.

Split up the atmosphere code. Now zones are explicitly their own kind of
atmosphere, which should speed up some loops and also solve
inconsistencies in the volume calculation.
GasMixtures are another type of atmosphere, for more general use.

Try to fix the splitting/merging code, which was quite cryptic and not
clear at all. It *should* work now.

* Switch zones back to MapIndices

Turns out I'm an idiot who misunderstood the code. MapIndices can be
used as one-per-tile, which is what is needed for atmos. GridCoordinates
are many-per-tile, and were causing lots of problems.

* Add zone debugging overlay

This is the first example of zone information being sent to a client.

It adds the `togglezoneinfo` command, which overlays the tiles and gas
information for the zone currently occupied by the user on the screen.
This was helpful for debugging the GridCoordinates problem.

* Fix position of atmos zone debug text

* Make AirtightComponent only activate on MapInit

This should stop it splitting atmospheres in mapping.

* Doc comments improvements to AtmosphereMap

Fix some malformed comments, inherit some useful docs, document some
more functions.

* Add zone logic for changing tiles to/from space

Zones are now correctly created when all the tiles in a room are built,
and destroyed when one of the tiles is destroyed.

* update engine

* right

* Cleanup code

* Port GasMixture, further cleanup

* Fix windows not being airtight, some other stuff

* Work on atmos

* Difference between ZoneBlocked and AirBlocked

* Big GridAtmosphereManager cleanup, zones are broken now oops

* Remove zones, add excited group implementation

* Further cleanup

* Further work on atmos

* Work on gas overlay.

* PumpGasTo and ReleaseGasTo methods for GasMixture.

* Adds Tile Overlay System.

* More work on atmos

* Gasses spread, equalize and all that

* Fix a few crashes

* Gas can actually spread from room to room after opening airlocks

* Add explosive depressurization, tile prying on depressurization, gas spreading on wall break. Etc.

* More work

* Remove atmoschem, add "performant" gas overlays

* what the fuck git

* More work I guess?

* Fix stuff, create a few (empty) components for future work

* Fix temperature

* Fix tile air sharing

* Atmos optimizations

* Further atmos optimizations

* Even more optimizations!

* Update Content.Client/GameObjects/EntitySystems/GasTileOverlaySystem.cs

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>

* Update Content.Client/GameObjects/EntitySystems/GasTileOverlaySystem.cs

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>

* Update Content.Client/GameObjects/EntitySystems/GasTileOverlaySystem.cs

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>

* Address a few reviews

* Oops, forgot to remove this

* Update Content.Server/Atmos/AtmosphereMap.cs

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>

* Fix compile

* Improved client gas tile overlays

* Less allocations

* Even less allocations!

* some stuff dunno

* Big refactor time, oh yeah

* it truly is 1 AM

* bruh

* No idea why now it doesn't work.
Oh well! I'll fix this on thursday 😌

* Basic atmos serialization

* Fix bugs, add VV attributes

* Start adding stuff for gas reactions

* Add a few atmos commands

* Fill gas command

* Changes to gas opacity

* Fixes I guess

* Fixes, add space wind sound

* High pressure movement!

* Better high pressure movements.

* Fix direction, maybe?

* And now it works great

* Science!

* and this is why you don't trust people

* remove logging

* Turns out I'm fucking dumb

* Work on hotspots and reactions, add tritium gas

* IGridAtmosphereComponent interface! For future unsimulated grids.

* Makes atmos updates NoGC.

* C E A S E

* Add settemp atmos command

* Important reminder.

* Remove useless AtmosCooldown.

* More work on hotspots

* Overlays for hotspots. Fire works!

* Turns out I suck at coding

* Fire texture change

* Yeah let's make that an absolute value, hmm?

* Support for atmos after teleporting grid (more or less)

* fix attempt (doesn't actually fix it)

* Make static variable not static

* Remove magic numbers

* Stopwatch moment

* Slight cleanup.

* More cleanup.

* Atmos optimizations

* Fix build

* Remove useless ghost atmos shit

* Adds CanSeeGases component for gas overlay stuff

* Component and prototype ignores

* ExcitedGroups now dispose on being merged with others

* Some tweaking.

* Atmos now uses frame time for updates.

* Nullable boogaloo

* IExamine fix

* Fix build

* Fix restartround

* Atmos tweaking, use invalid direction

* Increase high pressure movement force

* Better sort

* Update submodule.

* NULLABILITY AAAAH

Special thanks to monster860 and all monstermos contributors!

Co-authored-by: Campbell Suter <znix@znix.xyz>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
Co-authored-by: ComicIronic <comicironic@gmail.com>
Co-authored-by: silicons <2003111+silicons@users.noreply.github.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2020-08-02 20:08:20 +02:00