Skip to content

feat: folder and asmdef refactoring MTT-2623 #656

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

Closed
wants to merge 11 commits into from

Conversation

pdeschain
Copy link
Contributor

@pdeschain pdeschain commented May 19, 2022

Description

This PR moves a bunch of files out from the Shared/Client/Server to Infrastructure, App Lifecycle and other, more appropriate (imo) locations.

I've introduced some asmdefs for things that were relatively easy to separate with messaging.

Other things like ConnectionManagement and UI still have to be part of the general "gameplay" assembly due to their tight coupling. Most of it can be resolved in separate smaller PRs targeting specific issues (we have a lot of unnecessary Bridges, that in this case turn out to be an unnecessary and needlessly complicating the code-base).

Some things have dual nature for now - Audio has a part that's completely independent of any other code, however there's a folder for audio-related scripts that are part of the clientside gameplay and ui logic. These will be separated with messaging in further PRs.

When we separate connection management from gameplay, we would coincidentally be able to cleanly take out the UI from the domain of Client.

All of our assemblies now are named BossRoom.***.asmdef for easier visual navigation. All of our assemblies now use GUID-based references to make things a bit less brittle in case we decide to refactor the names of the assemblies.

There's a tall chance that some file is forgotten and that there is something that you'd want to change in this proposed folder refactor - feedback is greatly appreciated!

This is a dependency diagram as it is right now:
Screen Shot 2022-05-31 at 3 29 26 PM

Issue Number(s)

MTT-2623

Contribution checklist

  • Tests have been added for boss room and/or utilities pack
  • Release notes have been added to the project changelog file and/or package changelog file
  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • JIRA ticket ID is in the PR title or at least one commit message
  • Include the ticket ID number within the body message of the PR to create a hyperlink

@fernando-cortez
Copy link
Collaborator

Should target develop, correct?

Copy link
Contributor

@LPLafontaineB LPLafontaineB left a comment

Choose a reason for hiding this comment

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

I see errors when trying to build from missing references in GameEventEditor. Also, I'm wondering why are some asmdefs using GUIDs for references while others are not? Should we be using them for all our references or keep them in plain text instead?

@pdeschain pdeschain changed the base branch from main to develop May 20, 2022 17:06
@pdeschain
Copy link
Contributor Author

switched base appropriately

@pdeschain pdeschain requested a review from LPLafontaineB May 23, 2022 14:04
@pdeschain pdeschain added the 1-Needs Review PR needs attention from the assignee and reviewers label May 23, 2022
LPLafontaineB
LPLafontaineB previously approved these changes May 24, 2022
@LPLafontaineB LPLafontaineB added 2-One More Review One review in, one to go and removed 1-Needs Review PR needs attention from the assignee and reviewers labels May 24, 2022
@SamuelBellomo SamuelBellomo added the 0-URGENT Blocker for a release and needs to be merged ASAP label May 26, 2022
@SamuelBellomo
Copy link
Contributor

trick for reviewers: you can use this command to get something a bit more manageable for review
git diff origin/develop...pdeschain/folder-assembly-refactor --minimal --compact-summary
(I use this with a combination of removing all entries which are just trivial folder moves to filter out the stuff I don't need to spend too much time on)
Ideally, we'd do a second PR with trivial folder moves, just make this easier to consume

@SamuelBellomo
Copy link
Contributor

actually no. @pdeschain can you redo this PR please? Chrome becomes unresponsive when I open the files tab. There's no way we can efficiently review this in this current state

@SamuelBellomo
Copy link
Contributor

Adding some quick note here while waiting for this to be redone
There's no consistency on the "com" in asmdef in MTT projects, some have it, some don't, however, they all have "Unity" in them. If we could have our assemblies at least start with "unity", that'd at least be somewhat consistent with MTT names.

@SamuelBellomo
Copy link
Contributor

SamuelBellomo commented May 27, 2022

There's a tall chance that some file is forgotten

What do you mean exactly by this? I hope this doesn't delete any functionality?

@SamuelBellomo
Copy link
Contributor

SamuelBellomo commented May 27, 2022

I still see scripts in Server, Shared and Client folders, couldn't we remove that folder hierarchy, even we don't introduce asmdefs? This way we'd setup how we think asmdefs should look like in the future, the same you did with UI that's currently under Gameplay, even with the current tight coupling there is between those. They would still all live under Gameplay, but with our target folder structure.

@SamuelBellomo
Copy link
Contributor

ScriptableObjectArchitecture
That's not very descriptive of the content. What's that folder's content really about?

@SamuelBellomo
Copy link
Contributor

SamuelBellomo commented May 27, 2022

I'm not convinced by the content of Infrastructure. It seems like a jumble of different scripts that should go in other assemblies (there's VFX stuff mixed with component enablers, UI overlays and nothing that's really "infrastructure" --> which should be more the vcontainer, messaging stuff; the things that will set your architecture for the whole game)

@SamuelBellomo
Copy link
Contributor

We need to be careful about creating a LOT of asmdefs.
Why do we need one for messages in ApplicationLifecycle?

@SamuelBellomo
Copy link
Contributor

Not sure I understand what the "entity" folder is

@SamuelBellomo
Copy link
Contributor

Client/Data 's content could be merged with other folders no?

@pdeschain
Copy link
Contributor Author

I've created new pull requests that make it simpler to review:
#668
#669

@pdeschain pdeschain closed this May 31, 2022
@pdeschain pdeschain deleted the pdeschain/folder-assembly-refactor branch October 4, 2022 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-URGENT Blocker for a release and needs to be merged ASAP 2-One More Review One review in, one to go
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants