Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electricity system #1371

Merged
merged 96 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
b815234
basic setup
stilnat Nov 30, 2023
a9a8073
adding quickgraph
stilnat Nov 30, 2023
6adfee5
add electric device interface
stilnat Nov 30, 2023
01f4cc9
making vertex coordinates
stilnat Nov 30, 2023
be52087
getting back tileobjects from coordinates
stilnat Dec 1, 2023
581e328
handle power in circuits
stilnat Dec 1, 2023
4118ed7
add edges when adding electric device
stilnat Dec 1, 2023
921b01a
add generator prefab
stilnat Dec 1, 2023
848aa6d
add interface implementations
stilnat Dec 1, 2023
c5ef0b5
add switch light script
stilnat Dec 1, 2023
beacd7c
add electric connectors
stilnat Dec 1, 2023
b5ff483
simple electric adjacency connector
stilnat Dec 1, 2023
7ba27cb
updating electric prefabs and adding battery script
stilnat Dec 1, 2023
a84d5ff
little fix and prefab update
stilnat Dec 1, 2023
1733b9a
update stuff
stilnat Dec 1, 2023
c9f3d42
LITTLE FIX
stilnat Dec 1, 2023
0e90820
Merge branch 'develop' into electricity
stilnat Dec 1, 2023
ed1df27
fix asset grid ref
stilnat Dec 1, 2023
53aa0d2
disable all unnecessary components
stilnat Dec 1, 2023
3597cb9
Merge branch 'make-construction-hologram-real-hologram' into electricity
stilnat Dec 1, 2023
3de2ddb
fix stuff
stilnat Dec 1, 2023
aa1fcd5
some fix
stilnat Dec 2, 2023
79db9c3
some fix
stilnat Dec 2, 2023
07066d2
allow disabling destroy logic
stilnat Dec 2, 2023
91de672
remove item code
stilnat Dec 2, 2023
3048bea
Merge branch 'actor-custom-destroy' into electricity
stilnat Dec 2, 2023
c9a5581
fix null exception
stilnat Dec 2, 2023
0273fdb
fix unwanted diagonal connections
stilnat Dec 2, 2023
8e64143
fix some null ref exceptions and refactor code
stilnat Dec 6, 2023
89a6864
mostly doc
stilnat Dec 6, 2023
d91aef5
refactor and doc
stilnat Dec 6, 2023
72ea6bd
refactor
stilnat Dec 6, 2023
9cf8ca9
remove the call destroy stuff on actors
stilnat Dec 6, 2023
9a7a4de
add sound for fuel power generator
stilnat Dec 6, 2023
29d6b99
add togglable generator
stilnat Dec 6, 2023
de742e2
fix generator asset
stilnat Dec 6, 2023
0c8ef32
add smess batteries
stilnat Dec 6, 2023
26cf6f7
add id for fuel powered generator sound
stilnat Dec 6, 2023
b664c91
Merge branch 'develop' into electricity
stilnat Dec 7, 2023
e442d5e
Remove electric stuff
stilnat Dec 7, 2023
4631f16
removed more electric stuff
stilnat Dec 7, 2023
4d2d36d
Merge branch 'develop' into electricity
stilnat Dec 7, 2023
6946ba4
smes battery power level update
stilnat Dec 7, 2023
c84f15d
make pacman vibrate
stilnat Dec 8, 2023
eabd2a3
fix power status update
stilnat Dec 8, 2023
985c2c6
fix cable connections
stilnat Dec 8, 2023
0a44eed
fix battery usage
stilnat Dec 8, 2023
e7c0e84
power rate display on SMES
stilnat Dec 8, 2023
f4fb7ed
fix left over power not helping batteries
stilnat Dec 8, 2023
38ac53f
Add battery input display
stilnat Dec 9, 2023
a753696
add toggling of batteries
stilnat Dec 9, 2023
13d935c
doc and clean up
stilnat Dec 9, 2023
c55d598
add tick based rate for electricity
stilnat Dec 9, 2023
80a1716
some doc
stilnat Dec 9, 2023
39977f6
Merge branch 'develop' into electricity
stilnat Dec 9, 2023
3f7c296
fix to make build work
stilnat Dec 9, 2023
d562005
Merge branch 'develop' into electricity
stilnat Dec 11, 2023
cddabb3
fix build
stilnat Dec 12, 2023
75a8987
fix some stuff client side
stilnat Dec 12, 2023
879af4c
fix battery client syncing
stilnat Dec 12, 2023
c025e0f
fix solar panel and add network object
stilnat Dec 12, 2023
e456f34
remove useless prefab
stilnat Dec 12, 2023
ef5c522
fix solar panel asset
stilnat Dec 13, 2023
c38bfe5
replaced fuel power generator sound and added looping option
stilnat Dec 14, 2023
cdc4b2c
isolate vibrate logic
stilnat Dec 14, 2023
f561c28
Delete Assets/Content/Data/TileMap/Resources/Furniture/Machines/Elect…
stilnat Dec 14, 2023
8434cc0
Merge branch 'develop' into electricity
stilnat Dec 14, 2023
67c7a2b
Merge branch 'develop' into electricity
stilnat Dec 15, 2023
99ff05b
fix merge issues
stilnat Dec 15, 2023
0584718
fix generator sound
stilnat Dec 15, 2023
8c45d85
Merge branch 'develop' into electricity
stilnat Dec 15, 2023
37ccc86
Merge branch 'develop' into electricity
stilnat Dec 15, 2023
d32439c
fix broken stuff
stilnat Dec 15, 2023
5f68c97
fix cable not updating when deleting them
stilnat Dec 16, 2023
e2df7cd
add doc and clean up
stilnat Dec 16, 2023
e931032
Merge branch 'develop' into electricity
stilnat Dec 16, 2023
65943d4
Cleanup
iamteapot422 Dec 21, 2023
01b72a6
Cleanup 2: electric boogaloo
iamteapot422 Dec 21, 2023
6ef404a
change on tick to fixed update
stilnat Dec 21, 2023
3f7ba18
simplify battery consuming method
stilnat Dec 23, 2023
d10709b
little comment
stilnat Dec 23, 2023
946bcc4
Cleanup 3
iamteapot422 Dec 23, 2023
2a524c6
Cleanup 3
iamteapot422 Dec 23, 2023
b638c94
Cleanup 18
iamteapot422 Dec 23, 2023
aea0124
removed unused method
stilnat Dec 24, 2023
eaeb08e
probably infinite loop
stilnat Dec 24, 2023
7f89b58
charge storages properly
stilnat Dec 27, 2023
0cde29d
moving generic toggle to interaction
stilnat Dec 27, 2023
223504b
fix prefabs
stilnat Dec 27, 2023
f4d58d3
use min max method
stilnat Dec 27, 2023
c1447ae
renaming
stilnat Dec 27, 2023
886f9d1
Remove extra strings
iamteapot422 Dec 28, 2023
2e92541
Implement charge and drain algorithms
iamteapot422 Dec 28, 2023
c3a616a
fix exception when removing smes
stilnat Dec 28, 2023
a671d1c
Revert "Implement charge and drain algorithms"
stilnat Dec 28, 2023
5b7a7da
solve merge conflict
iamteapot422 Dec 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Art/Sound/Furniture/Machines/Engineering.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Assets/Content/Addressables/AssetGroups/Sounds.asset
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ MonoBehaviour:
m_Address: Assets/Art/Sound/World/Airlocks/AirlockOpen.ogg
m_ReadOnly: 0
m_SerializedLabels: []
- m_GUID: 59b65ecaf8dffbf49876ab2768490b59
m_Address: Assets/Art/Sound/Furniture/Machines/Engineering/FuelPowerGenerator.ogg
m_ReadOnly: 0
m_SerializedLabels: []
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: ddc57d0f5f9fb874e8a26db0c5b215e0, type: 2}
m_SchemaSet:
Expand Down
2 changes: 2 additions & 0 deletions Assets/Content/Data/Databases/Sounds.asset
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ MonoBehaviour:
_value: {fileID: 8300000, guid: fc2485e75c5d3ab4e86e814043c9e9cb, type: 3}
- _key: AirlockOpen
_value: {fileID: 8300000, guid: 34297ba204a9f3944872f100baaa2369, type: 3}
- _key: FuelPowerGenerator
_value: {fileID: 8300000, guid: 59b65ecaf8dffbf49876ab2768490b59, type: 3}
_new:
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4584c35d672b8a74797cc5efa123ce16, type: 3}
m_Name: SolarPanel
m_EditorClassIdentifier:
nameString: SolarPanel
prefab: {fileID: 6286745912349171764, guid: f0eca2b8867709749bc10f61917c4bdf, type: 3}
prefab: {fileID: 941367499997148975, guid: f0eca2b8867709749bc10f61917c4bdf, type: 3}
icon: {fileID: 0}
layer: 7
genericType: 0
Expand Down
62 changes: 56 additions & 6 deletions Assets/Content/Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,54 @@ MonoBehaviour:
_scenePathHash: 2499635508
<SceneId>k__BackingField: 10735852762014670918
<AssetPathHash>k__BackingField: 0
--- !u!1 &478499394
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 478499395}
- component: {fileID: 478499396}
m_Layer: 0
m_Name: ElectricitySystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &478499395
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 478499394}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -700.46924, y: -415.26047, z: 42.020546}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1506918115}
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &478499396
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 478499394}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cec52cc8cb291414f83ee8b575949b02, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 7
_addedNetworkObject: {fileID: 1506918116}
_networkObjectCache: {fileID: 1506918116}
_tickRate: 0.2
--- !u!1 &516802433
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1155,8 +1203,8 @@ MonoBehaviour:
<ChildNetworkObjects>k__BackingField: []
SerializedTransformProperties:
Position: {x: 0, y: 0, z: 0}
Rotation: {x: 0, y: 0, z: 0, w: 0}
LocalScale: {x: 0, y: 0, z: 0}
Rotation: {x: 0, y: 0, z: 0, w: 1}
LocalScale: {x: 1, y: 1, z: 1}
_isNetworked: 1
_isGlobal: 0
_initializeOrder: 0
Expand Down Expand Up @@ -1232,9 +1280,9 @@ MonoBehaviour:
<ChildNetworkObjects>k__BackingField:
- {fileID: 913757968}
SerializedTransformProperties:
Position: {x: 0, y: 0, z: 0}
Rotation: {x: 0, y: 0, z: 0, w: 0}
LocalScale: {x: 0, y: 0, z: 0}
Position: {x: -1.510847, y: -0.9550402, z: -2.0797422}
Rotation: {x: 0, y: 0, z: 0, w: 1}
LocalScale: {x: 1, y: 1, z: 1}
_isNetworked: 1
_isGlobal: 0
_initializeOrder: 0
Expand Down Expand Up @@ -1439,7 +1487,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4468402021075485018, guid: cc5383d385556f443b2a7d3202f2b2c1, type: 3}
propertyPath: m_AnchoredPosition.y
value: -230.00006
value: -229.99997
objectReference: {fileID: 0}
- target: {fileID: 4468402021449001342, guid: cc5383d385556f443b2a7d3202f2b2c1, type: 3}
propertyPath: m_AnchoredPosition.x
Expand Down Expand Up @@ -1967,6 +2015,7 @@ Transform:
- {fileID: 1121348073}
- {fileID: 606666309}
- {fileID: 274660131}
- {fileID: 478499395}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand All @@ -1993,6 +2042,7 @@ MonoBehaviour:
- {fileID: 1121348074}
- {fileID: 606666310}
- {fileID: 274660132}
- {fileID: 478499396}
<ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField:
- {fileID: 516802435}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ GameObject:
- component: {fileID: -5414623717715724467}
- component: {fileID: 1498482382929386799}
- component: {fileID: -2628458568064459714}
- component: {fileID: 219113547575591534}
- component: {fileID: 2550114539843098724}
- component: {fileID: -2157900375506616301}
- component: {fileID: 7239473696267242548}
- component: {fileID: 4189468537532167386}
m_Layer: 0
m_Name: PacManGenerator
m_TagString: Untagged
Expand Down Expand Up @@ -51,19 +56,21 @@ MonoBehaviour:
<IsNested>k__BackingField: 0
<ComponentIndex>k__BackingField: 0
<PredictedSpawn>k__BackingField: {fileID: 0}
_networkBehaviours: []
_networkBehaviours:
- {fileID: 219113547575591534}
- {fileID: -2157900375506616301}
<ParentNetworkObject>k__BackingField: {fileID: 0}
<ChildNetworkObjects>k__BackingField: []
SerializedTransformProperties:
Position: {x: 0, y: 0, z: 0}
Rotation: {x: 0, y: 0, z: 0, w: 0}
LocalScale: {x: 0, y: 0, z: 0}
Rotation: {x: 0, y: 0, z: 0, w: 1}
LocalScale: {x: 1, y: 1, z: 1}
_isNetworked: 1
_isGlobal: 0
_initializeOrder: 0
_defaultDespawnType: 0
NetworkObserver: {fileID: 0}
<PrefabId>k__BackingField: 0
<PrefabId>k__BackingField: 157
<SpawnableCollectionId>k__BackingField: 0
_scenePathHash: 0
<SceneId>k__BackingField: 0
Expand Down Expand Up @@ -93,6 +100,82 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
key: {fileID: 11400000, guid: 59526bd88a8f878449573560e06a54f9, type: 2}
--- !u!114 &219113547575591534
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1918783493706165866}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 328b489d4f8c1f04983e195ee8635c19, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 0
_addedNetworkObject: {fileID: -5414623717715724467}
_networkObjectCache: {fileID: -5414623717715724467}
_powerProduction: 10
_skinnedMeshRenderer: {fileID: 1698900335226549537}
_enabled: 0
--- !u!114 &2550114539843098724
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1918783493706165866}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c7a41c77d19af89459c70cd823369e19, type: 3}
m_Name:
m_EditorClassIdentifier:
_amplitude: 1
_frequency: 35
--- !u!114 &-2157900375506616301
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1918783493706165866}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1bbc87ddd49b01f4098910ffdf858004, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 1
_addedNetworkObject: {fileID: -5414623717715724467}
_networkObjectCache: {fileID: -5414623717715724467}
--- !u!65 &7239473696267242548
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1918783493706165866}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.9038, y: 0.9088632, z: 0.8278526}
m_Center: {x: -0.012657881, y: 0.42530543, z: 0.015189469}
--- !u!114 &4189468537532167386
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1918783493706165866}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b621d3404247f2e4da4ab459ad43eec7, type: 3}
m_Name:
m_EditorClassIdentifier:
_componentIndexCache: 255
_addedNetworkObject: {fileID: -5414623717715724467}
_networkObjectCache: {fileID: 0}
_on: 0
--- !u!1 &4271595947011161493
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -186,7 +269,6 @@ GameObject:
m_Component:
- component: {fileID: 608453462504062702}
- component: {fileID: 1698900335226549537}
- component: {fileID: 5323246766978482323}
m_Layer: 0
m_Name: Body
m_TagString: Untagged
Expand Down Expand Up @@ -266,16 +348,3 @@ SkinnedMeshRenderer:
m_Center: {x: -0.007445082, y: 0.4215365, z: -0.0044316053}
m_Extent: {x: 0.41407037, y: 0.42270422, z: 0.41059247}
m_DirtyAABB: 0
--- !u!65 &5323246766978482323
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4379219507269237858}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.83231133, y: 0.8492101, z: 0.78938055}
m_Center: {x: -0.009774417, y: 0.42334524, z: 0.013316378}
Loading
Loading