Commit Graph

54 Commits

Author SHA1 Message Date
Pieter-Jan Briers
0c97520276 Fix usages of TryIndex() (#39124)
* Fix usages of TryIndex()

Most usages of TryIndex() were using it incorrectly. Checking whether prototype IDs specified in prototypes actually existed before using them. This is not appropriate as it's just hiding bugs that should be getting caught by the YAML linter and other tools. (#39115)

This then resulted in TryIndex() getting modified to log errors (94f98073b0), which is incorrect as it causes false-positive errors in proper uses of the API: external data validation. (#39098)

This commit goes through and checks every call site of TryIndex() to see whether they were correct. Most call sites were replaced with the new Resolve(), which is suitable for these "defensive programming" use cases.

Fixes #39115

Breaking change: while doing this I noticed IdCardComponent and related systems were erroneously using ProtoId<AccessLevelPrototype> for job prototypes. This has been corrected.

* fix tests

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2025-09-09 18:17:56 +02:00
Pieter-Jan Briers
e99fc501a6 Revert biome rework (#38724)
* Revert "Fix world generation (#38713)"

This reverts commit 10fa6ff4af.

* Revert "Biome rework (#37735)"

This reverts commit fe7b96147c.
2025-07-03 20:48:04 +02:00
metalgearsloth
fe7b96147c Biome rework (#37735)
* DungeonData rework

Back to fields, serializes better, just make new layers dumby.

* wawawewa

* Fix this

* Fixes

* Port the work over

* wawawewa

* zoom

* Kinda workin

* Adjust wawa

* Unloading work

* Ore + entitytable fixes

Iterate every dungeon not just last.

* Big shot

* wawawewa

* Fixes

* true

* Fixes

# Conflicts:
#	Content.Server/Procedural/DungeonJob/DungeonJob.cs

* wawawewa

* Fixes

* Fix

* Lot of work

* wawawewa

* Fixing

* eh?

* a

* Fix a heap of stuff

* Better ignored check

* Reserve tile changes

* biome

* changes

* wawawewa

* Fixes & snow

* Shadow fixes

* wawawewa

* smol

* Add layer API

* More work

* wawawewa

* Preloads and running again

* wawawewa

* Modified

* Replacements and command

* Runtime support

* werk

* Fix expeds + dungeon alltiles

* reh

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2025-07-03 00:36:06 -04:00
Tayrtahn
5a93099509 Update SharedBiomeSystem methods to use Entity<T> (#37698)
* Fix warning in TryGetBiomeTile

* Overload TryGetBiomeTile

* Overload more methods, fix internal warnings

* Update TryGetEntity uses

* Update TryGetTile uses

* Cleanup TryGetDecals use

* Formatting

* Two more warnings while we're here
2025-05-21 22:10:52 -04:00
metalgearsloth
0d4f9640b5 CompFactory updates (#37559) 2025-05-20 01:08:55 -04:00
J
b1c08582d5 Various system spring cleaning (#36206)
* Various systems warnings cleanup

* Last changes before submitting PR

* Add guard for transform component, fix failing test

* Small corrections

* Audio params to specifiers datafields

* Using audio params on components and configs
2025-04-16 13:08:22 +02:00
ScarKy0
9e299a1053 Allow Aghosts to load biomes. (#36325)
* init

* review
2025-04-06 14:10:17 +02:00
Tayrtahn
7270988961 Cleanup BiomeSystem.Commands (#36084)
* _mapManager.GetMapEntityId -> _mapSystem.GetMapOrInvalid

* _mapManager.MapExists -> _mapSystem.MapExists

* Unused using
2025-03-25 23:30:06 +01:00
metalgearsloth
f51b9bc86e Add sun shadows (planet lighting stage 2) (#35145)
* Implements a Dynamic Lighting System on maps.

* Edit: the night should be a little bit brighter and blue now.

* Major edit: everything must be done on the client side now, with certain datafield replicated.
Changes were outlined in the salvage to accommodate the new lighting system.

* Edit: The offset is now serverside, this makes the time accurate in all situations.

* Removing ununsed import

* Minor tweaks

* Tweak in time precision

* Minor tweak + Unused import removed

* Edit: apparently RealTime is better for what I'm looking for

* Fix: Now the time is calculated correctly.

* Minor tweaks

* Adds condition for when the light should be updated

* Add planet lighting

* she

* close-ish

* c

* bittersweat

* Fixes

* Revert "Merge branch '22719' into 2024-09-29-planet-lighting"

This reverts commit 9f2785bb16aee47d794aa3eed8ae15004f97fc35, reversing
changes made to 19649c07a5fb625423e08fc18d91c9cb101daa86.

* Europa and day-night

* weh

* rooves working

* Clean

* Remove Europa

* Fixes

* fix

* Update

* Fix caves

* Update for engine

* Add sun shadows (planet lighting v2)

For now mostly targeting walls and having the shadows change over time. Got the basic proof-of-concept working just needs a hell of a lot of polish.

* Documentation

* a

* Fixes

* Move blur to an overlay

* Slughands

* Fixes

* Apply RoofOverlay per-grid not per-map

* Fix light render scales

* sangas

* Juice it a bit

* Better angle

* Fixes

* Add color support

* Rounding bandaid

* Wehs

* Better

* Remember I forgot to do this when writing docs

---------

Co-authored-by: DoutorWhite <thedoctorwhite@gmail.com>
2025-03-08 16:07:42 +11:00
metalgearsloth
b6ee183dc6 Add planet lighting (#32522)
* Implements a Dynamic Lighting System on maps.

* Edit: the night should be a little bit brighter and blue now.

* Major edit: everything must be done on the client side now, with certain datafield replicated.
Changes were outlined in the salvage to accommodate the new lighting system.

* Edit: The offset is now serverside, this makes the time accurate in all situations.

* Removing ununsed import

* Minor tweaks

* Tweak in time precision

* Minor tweak + Unused import removed

* Edit: apparently RealTime is better for what I'm looking for

* Fix: Now the time is calculated correctly.

* Minor tweaks

* Adds condition for when the light should be updated

* Add planet lighting

* she

* close-ish

* c

* bittersweat

* Fixes

* Revert "Merge branch '22719' into 2024-09-29-planet-lighting"

This reverts commit 9f2785bb16aee47d794aa3eed8ae15004f97fc35, reversing
changes made to 19649c07a5fb625423e08fc18d91c9cb101daa86.

* Europa and day-night

* weh

* rooves working

* Clean

* Remove Europa

* Fixes

* fix

* Update

* Fix caves

* Update for engine

* Add sun shadows (planet lighting v2)

For now mostly targeting walls and having the shadows change over time. Got the basic proof-of-concept working just needs a hell of a lot of polish.

* Documentation

* a

* Fixes

* Move blur to an overlay

* Slughands

* Fixes

* Remove v2 work

* Finalise

---------

Co-authored-by: DoutorWhite <thedoctorwhite@gmail.com>
2025-02-16 19:35:32 +11:00
metalgearsloth
d7a1753c7d Add CanLoad for biomes (#33050)
CPUJob to come later.
2024-10-31 23:18:06 -04:00
MilenVolf
1b9d77a760 Replace obsolete Tile Access methods (#32508)
* Replace obsolete SetTile

* Remove obsolete GetTileRef & GetAllTiles

* Forgor

* Apply suggested `GetMapOrInvalid`
2024-09-29 01:27:47 +02:00
Nemanja
3cdd62b0dd Mining Rebalance (#30920)
* first pass

* this shit too

* ok fix that shit

* buff

* actually fix that
2024-08-16 11:43:54 +10:00
Plykiya
160364e100 Update BiomeSystem.cs to not use Component.Owner (#29939)
Update BiomeSystem.cs

Co-authored-by: plykiya <plykiya@protonmail.com>
2024-07-12 19:22:24 +10:00
Plykiya
f6bb10503f Removes obsolete AnchorEntity() functions (#28613)
Obsolete anchor entity functions

Co-authored-by: plykiya <plykiya@protonmail.com>
2024-07-01 00:32:48 +10:00
deltanedas
e37f95c24c biome flexibility changes (#28017)
make biome apply template on mapinit, add api for setting Enabled

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-05-14 23:27:25 -04:00
Ed
cc9e40820f Night on Europa (#27731)
night
2024-05-06 20:02:22 -07:00
Leon Friedrich
18a35e7e83 Partial atmos refactor (#22521)
* Reduce atmos component queries

* Remove method events

* Cache airtight data

* Make MolesArchived nullable

* Fix airtight cache

* only get tile def once

* Immutable mixtures

* firelock queries

* misc

* misc cleanup

* Trim disconnected tiles

* Fix merge issues and bugs

* Why does the PR keep increasing in scope

* debug overlay

* Fix bugs

* Fix test, remove unused events

* Add setmapatmos command

* Fix overlays

* Add map check

* A

* Resolve conflicts with #26102

* Remove some obsolete methods
2024-03-24 03:34:56 +11:00
metalgearsloth
a9502be29e Revert "Fix chat bubbles (#25643)" (#25645)
* Revert "Fix chat bubbles (#25643)"

This reverts commit 23d2c4d924.

* Revert "Fixes obsolete Transform warnings in Content. (#25256)"

This reverts commit f284b43ff6.
2024-02-28 00:51:20 +11:00
TemporalOroboros
f284b43ff6 Fixes obsolete Transform warnings in Content. (#25256)
* Fix TransformComponent.MapPosition warnings in Content.Client

* Fix TransformComponent.MapPosition warnings in Content.IntegrationTests

* Fix TransformComponent.MapPosition warnings in Content.Shared

* Fix TransformComponent.MapPosition warnings in Content.Server

* Fix TransformComponent.WorldPosition warnings in Content.Shared

* Fix TransformComponent.WorldPosition warnings in Content.Client
Excepts ClickableComponent b/c that needs to be ECS'd entirely later

* Fix TransformComponent.WorldPosition warnings in Content.Server

* Fix TransformComponent.WorldRotation warnings in Content.*

* Fix TransformComponent.MapPosition warnings I missed

* Fix TransformComponent.WorldMatrix warnings in Content.*

* Fix TransformComponent.InvWorldMatrix warnings in Content.*

* Fix TransformComponent.GetWorldPositionRotationMatrixWithInv warnings in Content.*

* Fix TransformComponent.GetWorldPositionRotationMatrix warnings in Content.*

* Fix TransformComponent.GetWorldPositionRotation warnings in Content.*

* Fix TransformComponent.Anchored.set warnings in Content.*

* Fix TransformComponent.Coordinates.set warnings in Content.*

* Fix TransformComponent.LocalPosition.set warnings in Content.*

* Fix TransformComponent.AttachToGridOrMap warnings in Content.*

* Fix TransformComponent.AttachParent warnings in Content.*

* Preempt TransformComponent.LocalRotation.set warnings in Content.Shared

* Preempt TransformComponent.LocalRotation.set warnings in Content.Client

* Preempt TransformComponent.LocalRotation.set warnings in Content.IntegrationTests

* Preempt TransformComponent.LocalRotation.set warnings in Content.Server

* Fix/Preempt the remaining obsolete TransformComponent properties/methods in Content.*

* ECS ClickableComponent

* Fix obsolete SharedTransformSystem methods in Content.*

* Fix ExplosionOverlay `SharedTransformSystem` dependency

* Maybe fix null eye position breaking tests

* MGS requested changes
2024-02-27 12:06:20 +11:00
metalgearsloth
d8e5f5c24b Optimise DecalOverlay (#25266)
ChunkSize is still 32 so doesn't cut down on heaps of decals atm though we avoid passing many decals to drawing with the coordinates bounds check now.
2024-02-23 18:12:23 +11:00
Pieter-Jan Briers
68ce53ae17 Random spontaneous cleanup PR (#25131)
* Use new Subs.CVar helper

Removes manual config OnValueChanged calls, removes need to remember to manually unsubscribe.

This both reduces boilerplate and fixes many issues where subscriptions weren't removed on entity system shutdown.

* Fix a bunch of warnings

* More warning fixes

* Use new DateTime serializer to get rid of ISerializationHooks in changelog code.

* Get rid of some more ISerializationHooks for enums

* And a little more

* Apply suggestions from code review

Co-authored-by: 0x6273 <0x40@keemail.me>

---------

Co-authored-by: 0x6273 <0x40@keemail.me>
2024-02-13 16:48:39 -05:00
metalgearsloth
d7eb7b700c Biome marker layer tweaks (#23663)
* Biome marker layer tweaks

- Ensure veins get spawned at great perf cost (it's time-sliced anyway).
- Bump asteroids from 6 nodes to 10 nodes.

* Fixes

* magnet

* Magnet dictates wreck spawn

* Update Content.Shared/Procedural/PostGeneration/BiomeMarkerLayerPostGen.cs

* mraow
2024-01-09 22:44:38 +11:00
metalgearsloth
3ee6b8d2bc Fix biome marker dupes (#23500) 2024-01-04 15:04:43 +11:00
metalgearsloth
bf79acd127 Salvage magnet revamp (#23119)
* Generic offering window

* More work

* weh

* Parity

* Progression meter

* magnet

* rona

* PG asteroid work

* code red

* Asteroid spawnings

* clams

* a

* Marker fixes

* More fixes

* Workings of biome asteroids

* A

* Fix this loading code

* a

* Fix masking

* weh

* Fixes

* Magnet claiming

* toe

* petogue

* magnet

* Bunch of fixes

* Fix default

* Fixes

* asteroids

* Fix offerings

* Localisation and a bunch of fixes

* a

* Fixes

* Preliminary draft

* Announcement fixes

* Fixes and bump spawn rate

* Fix asteroid spawns and UI

* More fixes

* Expeditions fix

* fix

* Gravity

* Fix announcement rounding

* a

* Offset tweak

* sus

* jankass

* Fix merge
2024-01-04 14:25:32 +11:00
metalgearsloth
002d749c7e Minor biomes change (#23494)
Maybe fixes void if there's exceptions, idk
2024-01-04 13:04:14 +11:00
Leon Friedrich
b6bd82caa6 Use ECS prototype-reload events (#22613)
* Use ECS prototype-reload events

* better constructors

* Maybe this fixes tests?
2023-12-23 01:13:45 +11:00
metalgearsloth
342b08418e Fix planet command being ran on existing maps (#21775) 2023-12-11 19:51:02 +11:00
metalgearsloth
5cbf935cf0 Wrap gateway generator in cvar for dev (#21758) 2023-11-21 21:36:38 -07:00
metalgearsloth
1fa5aaf92e Fix biome marker layer command (#21278) 2023-11-18 18:08:20 +11:00
metalgearsloth
816ee2e1ab Gateway destinations (#21040)
* Gateway generation

* Gateway stuff

* gatewehs

* mercenaries

* play area

* Range fixes and tweaks

* weh

* Gateway UI polish

* Lots of fixes

* Knock some items off

* Fix dungeon spawning

Realistically we should probably be using a salvage job.

* wahwah

* wehvs

* expression

* weh

* eee

* a

* a

* WEH

* frfr

* Gatwey

* Fix gateway windows

* Fix gateway windows

* a

* a

* Better layer masking

* a

* a

* Noise fixes

* a

* Fix fractal calculations

* a

* More fixes

* Fixes

* Add layers back in

* Fixes

* namespaces and ftl

* Other TODO

* Fix distance

* Cleanup

* Fix test
2023-11-14 19:23:40 -07:00
Leon Friedrich
e685cb626b Un-revert IPlayerManager refactor (#21244) 2023-10-28 09:59:53 +11:00
metalgearsloth
a2bbda43cc Revert "Update submodule to 172.0.0 (#21222)" (#21225) 2023-10-24 21:55:20 +11:00
Leon Friedrich
7ba0ea2926 IPlayerManager refactor (#21215) 2023-10-24 20:19:08 +11:00
metalgearsloth
425e49bbc8 Fix salvage mission biome seed (#20885) 2023-10-10 14:35:50 -07:00
metalgearsloth
83062e39b0 Fix shuttle planet FTL overlapping markers (#20887) 2023-10-10 14:33:04 -07:00
metalgearsloth
e6d639b21b Fix biome recursion (#17982) 2023-07-11 22:26:19 -06:00
metalgearsloth
48276eb00a Optimise marker spawning (#17922) 2023-07-10 17:15:59 +10:00
metalgearsloth
68480af109 Update content vectors to numerics (#17759) 2023-07-08 14:08:32 +10:00
metalgearsloth
ed1ff4df06 Ore tweaks (#16930)
- Guaranteed spawns in salvage
- Triple vein count
- Made it so rocks only drop 1 as it's kinda whacky (I believe they still convert differently to bars).
2023-05-30 21:40:36 -06:00
metalgearsloth
1192a723e6 Shuttle flattening (#16416) 2023-05-19 17:26:28 +10:00
metalgearsloth
ea4440be44 Make ore loot use walls as a mask (#16377) 2023-05-14 22:01:29 -04:00
metalgearsloth
210a70fc3a Deload biome entities (#15531) 2023-05-08 01:03:04 +10:00
deltanedas
f72baa6a49 autogen parallax state (#15384)
Co-authored-by: deltanedas <@deltanedas:kde.org>
2023-04-22 22:02:23 +10:00
metalgearsloth
3d1333b9ab Don't enable ghost roles for salvage spawns (#15598) 2023-04-21 15:06:22 +10:00
metalgearsloth
0301763043 Expedition mining spawn adjustments (#15581) 2023-04-20 23:32:06 +10:00
metalgearsloth
122350f19c Salvage expeditions (#12745) 2023-04-20 10:43:13 +10:00
metalgearsloth
94ea61defa Fix biome seed gen (#15352)
Well the command itself didn't set the seed properly so.
2023-04-12 09:38:14 -05:00
metalgearsloth
6157dfa3c0 Salvage dungeons (#14520) 2023-03-10 16:41:22 +11:00
metalgearsloth
2e25128770 Update content for .Owner culling (#14185) 2023-02-22 12:45:32 +11:00