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

Iron chunks now use visual identificator #5409

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

CI09
Copy link
Contributor

@CI09 CI09 commented Aug 26, 2024

Brief Description of What This PR Does

This PR does some stuff...

Related Issues

Closes #5402

Progress Checklist

Note: before starting this checklist the PR should be marked as non-draft.

  • PR author has checked that this PR works as intended and doesn't
    break existing features:
    https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist
    (this is important as to not waste the time of Thrive team
    members reviewing this PR)
  • Initial code review passed (this and further items should not be checked by the PR author)
  • Functionality is confirmed working by another person (see above checklist link)
  • Final code review is passed and code conforms to the
    styleguide.

Before merging all CI jobs should finish on this PR without errors, if
there are automatically detected style issues they should be fixed by
the PR author. Merging must follow our
styleguide.

@CI09 CI09 added the review label Aug 26, 2024
@CI09 CI09 requested review from a team August 26, 2024 12:40
@revolutionary-bot
Copy link

We are currently in feature freeze until the next release.
If your PR is not just a simple fix, then it may take until the release to get reviewed and merged.

Copy link
Member

@hhyyrylainen hhyyrylainen left a comment

Choose a reason for hiding this comment

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

Here's some comments. And also when reading this I realized that the CollisionShapeLoader component has a hardcoded path to a physics data object. Meaning that just these changes aren't sufficient to protect the chunks from save breakage when moving resource files around.

@@ -46,19 +46,19 @@
"Name": "SMALL_IRON_CHUNK",
"Meshes": [
{
"ScenePath": "res://assets/models/IronRock1.tscn",
"VisualResource": 9,
Copy link
Member

Choose a reason for hiding this comment

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

Yeah this, is not very nice because people need to manually write this file so using string keys here would be vastly superior.

When referring to the integer values I meant how this will be saved in the game saves, which are not edited by humans so the compactness of just pure numbers helps there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So what do I put here instead if visual id is BigIronChunk1?

Copy link
Member

Choose a reason for hiding this comment

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

"BigIronChunk1"
which either works immediately or a custom JSON converter is needed that supports both string and integer values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

JSON converter is needed then. Unfortunately.

Copy link
Member

Choose a reason for hiding this comment

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

I just looked and so far it seems like no enum values have been wanted to read from strings in the game. The RevolutionaryWebApp repo has that setup already, but sadly it uses a different JSON lib, so a separate approach is needed here.

@@ -146,6 +146,8 @@ public class ChunkScene
/// </summary>
public string ScenePath;
Copy link
Member

Choose a reason for hiding this comment

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

This and the loaded scene have to be removed in order to not cause confusion by having 2 separate mechanisms at once specifying how the visual is defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will cause to at least chunks on microbe death not function. Last time I tried to do it with fixing said issue, it froze my game.

Copy link
Member

Choose a reason for hiding this comment

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

Those chunks must also be updated to the new system. I won't have the confusion of having 2 systems for cell chunk visuals.

{
ScenePath = selectedMesh.ScenePath,
VisualIdentifier = meshes[random.Next(meshes.Count)].VisualResource,
Copy link
Member

Choose a reason for hiding this comment

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

This should use the selected mesh because otherwise the visual mesh may not match what was selected as the physics mesh.

Copy link

This PR has been inactive for a while and as such is being marked
stale. This PR will be automatically closed if this stays stale
for a while.

If this is still being worked on / will probably resume work at
some point please feel free to continue working on this and reopen
this in case this was already automatically closed.

@github-actions github-actions bot added the stale label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

Make chunk visuals load through the VisualResourceIdentifier instead of exact paths
3 participants