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

Rework adjacency connectors and make them work #1274

Merged
merged 56 commits into from
Nov 10, 2023

Conversation

stilnat
Copy link
Contributor

@stilnat stilnat commented Oct 7, 2023

Summary

The will to have a single script to handle all connectors led to hard to understand, unmaintainable and partly broken code.
This PR tries to simplify the mess by having multiple small scripts for different kind of connectors.
It's also making some old connectors work back, those who were working on the old branch.

Pictures/Videos (optional)

2023-11-02.12-32-53.mp4

Changes to Files

Technical Notes (optional)

Currently, adjacency connecting is mostly handled by MultiAdjacencyConnector, and it's a big mess. The approach "One script to rule them all" doesn't work well here, we have too many connectors with their own unique behavior. The idea is to to create a new connector each time we have a singular behavior, instead of adding cases to the multiAdjacencyConnector.
The IAdjacencyConnector interface has been expanded to cover for the needs of most connectors.

In particular, connectors are now responsible for getting their own neighbours. This is because the definition of neighbours can highly vary from one connector to another. e.g : disposal pipe connectors consider that disposal furnitures are a neighbour if it is directly above them.

Known issues

  • missing mesh for steel reinforced windows and walls, the X6 mesh. replaced for now with the X5.

Fixes (optional)

  • closes Proper Airlock Tilemap Integration #1106

  • fixes advanced adjacency (some X position were broken)

  • fixes edge case with walls all around a door, displaying some visible transparent side next to the door.

  • fixes offset pipe connections

  • add working disposal pipe vertical connections. Vertical pipe connect only to disposal pipe in front of them.

  • fixes plenum covers

TODO

cosmiccoincidence

This comment was marked as resolved.

@stilnat

This comment was marked as resolved.

@cosmiccoincidence

This comment was marked as resolved.

@stilnat

This comment was marked as resolved.

@cosmiccoincidence cosmiccoincidence added the Tilemaps Tasks related to the tilemap system or its connectors. label Nov 5, 2023
@stilnat stilnat changed the title [WIP] Rework adjacency connectors and make them work Rework adjacency connectors and make them work Nov 6, 2023
@cosmiccoincidence
Copy link
Member

cosmiccoincidence commented Nov 9, 2023

added x6 from steelwall for steelwall reinforced

Don't forget to update x6 from SteelWindow for SteelWindowReinforced

Copy link
Member

@cosmiccoincidence cosmiccoincidence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to link a material to the .fbx you added.

Go to DisposalPipes.fbx in Unity and look at the inspector window:
image
Set the correct materials, in this instance you just need to set Palette05 to use the Palette material. MAKE SURE TO HIT APPLY.
If you do not set these, it imports the material from the model file which we end up with copies of material files in the project for no reason.

@@ -13,11 +13,14 @@ public enum TileLayer
Turf,
Wire,
Disposal,
Pipes,
PipeSurface,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably group all 4 pipe lines, instead of having 1 separated. Prevents confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue with unity and enums is that when you modify the order in the enum, Unity gets confused with the enums you registerer in editor. I did not put them together because I was afraid to break something. It's probably not much change but that means retesting a lot of stuff, can we do a separate PR for that ? If you insist I will change it though.

@@ -445,7 +445,10 @@ public void OnDropDownChange()
{
TileLayer.Wire,
TileLayer.Disposal,
TileLayer.Pipes
TileLayer.PipeLeft,
TileLayer.PipeRight,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@cosmiccoincidence cosmiccoincidence merged commit 378f2e4 into RE-SS3D:develop Nov 10, 2023
2 checks passed
@stilnat stilnat deleted the integrate-doors-properly branch November 16, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tilemaps Tasks related to the tilemap system or its connectors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proper Airlock Tilemap Integration
2 participants