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

[Port] Footsteps / Следы #110

Merged
merged 3 commits into from
Oct 31, 2024
Merged

[Port] Footsteps / Следы #110

merged 3 commits into from
Oct 31, 2024

Conversation

Spatison
Copy link
Member

Описание PR

Порт следов с БекменАтраксии


Медиа

image


Изменения

🆑 Spatison

  • add: Added footsteps / Добавлены следы

@Spatison Spatison requested a review from Remuchi October 29, 2024 12:33
@Spatison Spatison self-assigned this Oct 29, 2024
Copy link
Contributor

coderabbitai bot commented Oct 29, 2024

Walkthrough

This pull request introduces several new classes and components related to the management and visualization of footprints in the game. Key additions include the FootPrintsVisualizerSystem, FootPrintsSystem, and PuddleFootPrintsSystem, which handle the creation, appearance, and interaction of footprints with the environment. New components such as FootPrintComponent, FootPrintsComponent, and PuddleFootPrintsComponent are also defined, facilitating the tracking and visual representation of footprints. Additionally, various entities related to puddles and their interactions with footprints are introduced, enhancing the gameplay experience.

Changes

File Path Change Summary
Content.Client/_White/FootPrint/FootPrintsVisualizerSystem.cs Added FootPrintsVisualizerSystem class for visualizing foot print components.
Content.Server/_White/FootPrint/FootPrintsSystem.cs Added FootPrintsSystem class for managing footstep prints creation and behavior.
Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs Added PuddleFootPrintsSystem class for managing interactions between puddles and footprints.
Content.Shared/_White/Footprint/FootPrintComponent.cs Added FootPrintComponent class for marking footsteps with networking capabilities.
Content.Shared/_White/Footprint/FootPrintVisuals.cs Added enumerations for footprint visuals: FootPrintVisuals, FootPrintVisualState, and FootPrintVisualLayers.
Content.Shared/_White/Footprint/FootPrintsComponent.cs Added FootPrintsComponent class with properties defining footprint characteristics.
Content.Shared/_White/Footprint/PuddleFootPrintsComponent.cs Added PuddleFootPrintsComponent class for managing puddle footprint characteristics.
Resources/Prototypes/Entities/Effects/puddle.yml Added new puddle entities and modified Puddle to include PuddleFootPrints component.
Resources/Prototypes/Entities/Mobs/Player/arachnid.yml Added FootPrints component to Urist McArachne entity.
Resources/Prototypes/Entities/Mobs/Player/human.yml Added FootPrints component to BaseMobHuman entity.
Resources/Prototypes/Entities/Mobs/Species/*.yml Added FootPrints component to multiple species entities (e.g., diona, dwarf, harpy, etc.) with respective properties.
Resources/Prototypes/_White/Entities/Effects/puddle.yml Introduced new Footstep entity with various components defining its behavior and properties.
Resources/Textures/_White/Effects/footprints.rsi/meta.json Added metadata file for footprint texture effects, defining various footprint states.

Possibly related PRs

Suggested labels

Status: Needs Review

Suggested reviewers

  • Remuchi

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

github-actions bot commented Oct 29, 2024

RSI Diff Bot; head commit 90ebf3c merging into 6093d72
This PR makes changes to 1 or more RSIs. Here is a summary of all changes:

Resources/Textures/_White/Effects/footprints.rsi

State Old New Status
dragging-1 Added
dragging-2 Added
dragging-3 Added
dragging-4 Added
dragging-5 Added
dragging-test Added
footprint-left-bare-diona Added
footprint-left-bare-dwarf Added
footprint-left-bare-human Added
footprint-left-bare-lizard Added
footprint-left-bare-slime Added
footprint-left-bare-spider Added
footprint-right-bare-diona Added
footprint-right-bare-dwarf Added
footprint-right-bare-human Added
footprint-right-bare-lizard Added
footprint-right-bare-slime Added
footprint-right-bare-spider Added
footprint-shoes Added
footprint-suit Added

Edit: diff updated after 90ebf3c

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 15

🧹 Outside diff range and nitpick comments (18)
Content.Shared/_White/Footprint/PuddleFootPrintsComponent.cs (1)

4-11: Add XML documentation comments to explain the component's purpose and property meanings.

The component and its properties would benefit from XML documentation to explain:

  • The component's overall purpose in the footprint system
  • What SizeRatio represents and its valid range
  • What OffPercent represents and why it defaults to 80

Add documentation like this:

+/// <summary>
+/// Component that handles the visual properties of footprints when interacting with puddles.
+/// </summary>
 [RegisterComponent]
 public sealed partial class PuddleFootPrintsComponent : Component
 {
+    /// <summary>
+    /// The size ratio of puddle footprints relative to normal footprints.
+    /// </summary>
     [ViewVariables(VVAccess.ReadWrite)]
     public float SizeRatio = 0.2f;

+    /// <summary>
+    /// The percentage threshold at which footprints stop being visible.
+    /// </summary>
     [ViewVariables(VVAccess.ReadWrite)]
     public float OffPercent = 80f;
 }
Content.Shared/_White/Footprint/FootPrintVisuals.cs (2)

5-12: Add XML documentation for the enum and its values.

While the enum values are descriptive, adding XML documentation would help clarify:

  1. The purpose of each footprint type
  2. How the Dragging value differs from the other print types (it seems to represent a different concept)

Add documentation like this:

 [Serializable, NetSerializable]
+/// <summary>
+/// Defines the different types of footprints that can be rendered.
+/// </summary>
 public enum FootPrintVisuals : byte
 {
+    /// <summary>
+    /// Footprints made by entities without shoes.
+    /// </summary>
     BareFootPrint,
+    /// <summary>
+    /// Footprints made by entities wearing shoes.
+    /// </summary>
     ShoesPrint,
+    /// <summary>
+    /// Footprints made by entities in suits.
+    /// </summary>
     SuitPrint,
+    /// <summary>
+    /// Marks made by dragging something.
+    /// </summary>
     Dragging
 }

21-25: LGTM! Consider adding documentation for future expansion.

The enum is correctly structured for visualization layers. Consider adding XML documentation to explain its role in the rendering system, especially since it might be expanded with more layers in the future.

Add documentation like this:

 [Serializable, NetSerializable]
+/// <summary>
+/// Defines the visual layers used for rendering footprints.
+/// </summary>
 public enum FootPrintVisualLayers : byte
 {
+    /// <summary>
+    /// The base print layer.
+    /// </summary>
     Print
 }
Content.Shared/_White/Footprint/FootPrintComponent.cs (1)

12-16: Consider enhancing the documentation for PrintOwner.

While the documentation references FootPrintsComponent, it would be helpful to clarify:

  1. The relationship between this component and FootPrintsComponent
  2. The lifecycle of this relationship (when is it set, can it change, etc.)

Consider updating the documentation:

 /// <summary>
-/// Owner (with <see cref="FootPrintsComponent"/>) of a print (this component).
+/// References the entity that created this footprint. The referenced entity must have a <see cref="FootPrintsComponent"/>.
+/// This is set when the footprint is created and remains constant throughout the footprint's lifetime.
 /// </summary>
Resources/Prototypes/_White/Entities/Effects/puddle.yml (1)

1-5: Consider enhancing the entity description.

The current description "Trace of liquid" could be more specific about the entity's purpose and behavior in the game context.

Consider updating to something more descriptive like:

-  description: Trace of liquid
+  description: Visual effect representing footprints left in liquid surfaces, with associated sound and physics properties
Content.Shared/_White/Footprint/FootPrintsComponent.cs (3)

7-9: Add XML documentation for the component.

Consider adding XML documentation to describe the component's purpose, responsibilities, and usage. This will help other developers understand how to properly use this component.

 [RegisterComponent]
+/// <summary>
+/// Manages footprint appearance and behavior for entities.
+/// This component handles different types of footprints (bare feet, shoes, etc.)
+/// and their visual representation in the game world.
+/// </summary>
 public sealed partial class FootPrintsComponent : Component

26-36: Remove or improve the comment and consider using collection initialization.

The comment "yea, those" doesn't provide any value. Also, consider using a more concise array initialization syntax.

 [ViewVariables(VVAccess.ReadOnly), DataField]
-public string[] DraggingPrint =
-[
-    "dragging-1",
-    "dragging-2",
-    "dragging-3",
-    "dragging-4",
-    "dragging-5",
-];
-// yea, those
+public string[] DraggingPrint = ["dragging-1", "dragging-2", "dragging-3", "dragging-4", "dragging-5"];

43-54: Document the size and color properties.

The purpose and expected values of these properties should be documented:

  • What units are StepSize and DragSize measured in?
  • What is ColorQuantity used for and why doesn't it have a default value?
  • What does ColorReduceAlpha represent?
 [DataField]
+/// <summary>
+/// The size of a normal footstep in world units.
+/// </summary>
 public float StepSize = 0.7f;

 [DataField]
+/// <summary>
+/// The size of drag marks in world units.
+/// </summary>
 public float DragSize = 0.5f;

 [DataField]
+/// <summary>
+/// The amount of color transferred to footprints.
+/// </summary>
 public float ColorQuantity;
Resources/Prototypes/Entities/Mobs/Species/reptilian.yml (1)

71-72: Consider documenting the footprint identifier format.

The footprint identifiers follow a clear {direction}-{type}-{species} format. Consider adding a comment explaining this convention for maintainability.

  - type: FootPrints
+   # Format: {direction}-{type}-{species}
+   # direction: left/right
+   # type: bare
+   # species: specific to each species (e.g., lizard)
    leftBarePrint: "footprint-left-bare-lizard"
    rightBarePrint: "footprint-right-bare-lizard"
Resources/Prototypes/Entities/Mobs/Player/human.yml (1)

6-6: Remove trailing whitespace.

The line contains trailing spaces which should be removed to maintain consistent formatting.

-  
+
🧰 Tools
🪛 yamllint

[error] 6-6: trailing spaces

(trailing-spaces)

Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs (2)

11-20: Add XML documentation for better code maintainability.

Consider adding XML documentation to describe the system's purpose and responsibilities.

+/// <summary>
+/// Handles the interaction between entities and puddles to create footprints,
+/// including color transfer and solution management.
+/// </summary>
 public sealed class PuddleFootPrintsSystem : EntitySystem

22-46: Consider splitting solution management into a separate method.

The OnStepTrigger method handles multiple responsibilities: checking conditions, managing solutions, and updating colors. Consider extracting the solution management logic into a separate method for better maintainability and testability.

+    private bool TryGetPuddleSolution(EntityUid uid, PuddleComponent puddle, 
+        SolutionContainerManagerComponent solutionManager, out Solution solution)
+    {
+        solution = default!;
+        return _solutionContainer.ResolveSolution((uid, solutionManager), 
+            puddle.SolutionName, ref puddle.Solution, out solution);
+    }
Content.Client/_White/FootPrint/FootPrintsVisualizerSystem.cs (1)

21-29: Consider adding error handling for layer reservation.

While the initialization logic is sound, the layer reservation could fail silently. Consider adding error handling or logging to track potential issues.

-        sprite.LayerMapReserveBlank(FootPrintVisualLayers.Print);
+        if (!sprite.LayerMapReserveBlank(FootPrintVisualLayers.Print))
+        {
+            Logger.Warning($"Failed to reserve print layer for entity {uid}");
+            return;
+        }
Resources/Prototypes/Entities/Mobs/Species/arachnid.yml (1)

133-135: Consider leg count in footprint visualization.

The entity has a requiredLegs property set to 2 in the Body component. Since arachnids can lose legs (as noted in the comment about wound system), consider if the footprint visualization should adapt based on the current leg count.

This could enhance realism by:

  1. Showing different footprint patterns when legs are lost
  2. Potentially disabling footprints entirely when mobility is severely impaired
Resources/Prototypes/Entities/Mobs/Species/arachne.yml (1)

138-142: Consider revising footprint representation for spider-like creature.

The current implementation defines only two footprints (left and right) for an entity that:

  • Has 8 legs (as defined by requiredLegs: 8)
  • Uses spider-specific movement (has MovementAlwaysTouching component)
  • Is immune to step triggers (StepTriggerImmune)

This might create a visual disconnect for players expecting to see multiple footprints matching the creature's anatomy.

Consider these improvements:

  1. Implement a spider-specific pattern of footprints that better represents the 8-legged movement
  2. Add documentation explaining the design decision if bipedal prints are intentional
  3. Ensure the StepTriggerImmune component doesn't interfere with footprint generation

Would you like me to propose a more detailed design for spider-specific footprint patterns?

Content.Server/_White/FootPrint/FootPrintsSystem.cs (3)

59-60: Simplify Condition for Readability

The condition if (!(distance > stepSize)) can be simplified to if (distance <= stepSize) for better readability and understanding.

Suggested change:

-if (!(distance > stepSize))
+if (distance <= stepSize)
    return;

122-129: Simplify ReduceAlpha Method Using Math.Max

The ReduceAlpha method can be simplified by using Math.Max, which enhances code clarity and conciseness.

Suggested change:

-private float ReduceAlpha(float alpha, float reductionAmount)
-{
-    if (alpha - reductionAmount > 0f)
-        alpha -= reductionAmount;
-    else
-        alpha = 0f;
-    return alpha;
-}
+private float ReduceAlpha(float alpha, float reductionAmount)
+{
+    return Math.Max(0f, alpha - reductionAmount);
+}

106-120: Clarify State Assignment Logic in PickState Method

The state variable in the PickState method is sequentially overwritten based on multiple conditions. This might lead to unintended behavior if more than one condition is true. Consider using if-else statements to define clear priority and prevent unexpected overrides.

Suggested change:

private FootPrintVisuals PickState(EntityUid uid, bool dragging)
{
    var state = FootPrintVisuals.BareFootPrint;

-    if (_inventory.TryGetSlotEntity(uid, "shoes", out _))
-        state = FootPrintVisuals.ShoesPrint;
-
-    if (_inventory.TryGetSlotEntity(uid, "outerClothing", out var suit) && TryComp<PressureProtectionComponent>(suit, out _))
-        state = FootPrintVisuals.SuitPrint;
-
-    if (dragging)
-        state = FootPrintVisuals.Dragging;
+    if (dragging)
+    {
+        state = FootPrintVisuals.Dragging;
+    }
+    else if (_inventory.TryGetSlotEntity(uid, "outerClothing", out var suit) && TryComp<PressureProtectionComponent>(suit, out _))
+    {
+        state = FootPrintVisuals.SuitPrint;
+    }
+    else if (_inventory.TryGetSlotEntity(uid, "shoes", out _))
+    {
+        state = FootPrintVisuals.ShoesPrint;
+    }

    return state;
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6093d72 and 391b155.

⛔ Files ignored due to path filters (20)
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-1.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-2.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-3.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-4.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-5.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-test.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-diona.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-dwarf.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-human.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-lizard.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-slime.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-spider.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-diona.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-dwarf.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-human.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-lizard.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-slime.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-spider.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-shoes.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-suit.png is excluded by !**/*.png
📒 Files selected for processing (23)
  • Content.Client/_White/FootPrint/FootPrintsVisualizerSystem.cs (1 hunks)
  • Content.Server/_White/FootPrint/FootPrintsSystem.cs (1 hunks)
  • Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs (1 hunks)
  • Content.Shared/_White/Footprint/FootPrintComponent.cs (1 hunks)
  • Content.Shared/_White/Footprint/FootPrintVisuals.cs (1 hunks)
  • Content.Shared/_White/Footprint/FootPrintsComponent.cs (1 hunks)
  • Content.Shared/_White/Footprint/PuddleFootPrintsComponent.cs (1 hunks)
  • Resources/Prototypes/Entities/Effects/puddle.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Player/arachnid.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Player/human.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/arachne.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/arachnid.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/diona.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/dwarf.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/harpy.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/human.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/moth.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/reptilian.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/skeleton.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/slime.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/vox.yml (1 hunks)
  • Resources/Prototypes/_White/Entities/Effects/puddle.yml (1 hunks)
  • Resources/Textures/_White/Effects/footprints.rsi/meta.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Resources/Textures/_White/Effects/footprints.rsi/meta.json
🧰 Additional context used
🪛 yamllint
Resources/Prototypes/Entities/Mobs/Player/arachnid.yml

[error] 13-13: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/Entities/Mobs/Player/human.yml

[error] 6-6: trailing spaces

(trailing-spaces)

Resources/Prototypes/Entities/Mobs/Species/skeleton.yml

[warning] 105-105: wrong indentation: expected 4 but found 2

(indentation)

Resources/Prototypes/_White/Entities/Effects/puddle.yml

[error] 37-37: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (31)
Content.Shared/_White/Footprint/PuddleFootPrintsComponent.cs (1)

9-10: Verify the high OffPercent threshold and add validation.

The default value of 80% seems high for a visibility threshold. This means footprints will only be visible when the puddle is quite full.

Let's check how this threshold is used in the system:

Also, consider adding validation:

     [ViewVariables(VVAccess.ReadWrite)]
-    public float OffPercent = 80f;
+    public float OffPercent
+    {
+        get => _offPercent;
+        set => _offPercent = Math.Clamp(value, 0f, 100f);
+    }
+    private float _offPercent = 80f;
Content.Shared/_White/Footprint/FootPrintVisuals.cs (2)

1-4: LGTM! Clean namespace and imports.

The namespace structure and imports are well-organized and contain only the necessary dependencies.


14-19: Clarify the purpose of FootPrintVisualState enum.

The enum values State and Color are quite generic. Consider:

  1. Adding XML documentation to explain their purpose
  2. Using more specific names (e.g., if State represents visibility, consider Visibility instead)

Let's check how these values are used in the codebase:

Content.Shared/_White/Footprint/FootPrintComponent.cs (2)

9-10: LGTM! Component registration looks correct.

The component is properly registered with necessary attributes for networking and state generation.


18-22: Verify solution integration and add documentation.

The solution-related fields lack documentation explaining their purpose and usage. Additionally, we should verify the integration with the solution system.

Let's verify the solution system integration:

Consider adding documentation:

+/// <summary>
+/// The name of the solution used for footprint effects.
+/// </summary>
 [DataField]
 public string SolutionName = "step";

+/// <summary>
+/// Reference to the solution component that affects this footprint's behavior.
+/// This might be null if the footprint doesn't involve any solution mechanics.
+/// </summary>
 [DataField]
 public Entity<SolutionComponent>? Solution;
✅ Verification successful

Based on the search results, I can now generate a final response:

Documentation added and solution integration verified

The solution integration is properly implemented in the FootPrintsSystem, which has the required dependency on SharedSolutionContainerSystem (_solution). The system handles footprint mechanics using the "step" solution, which is a standard pattern seen in other solution-based components.

Here's the suggested documentation:

+/// <summary>
+/// The name of the solution used for footprint effects. This solution contains
+/// the substances that can be tracked when walking.
+/// </summary>
[DataField]
public string SolutionName = "step";

+/// <summary>
+/// Reference to the solution component that contains the trackable substances.
+/// When an entity steps on a surface, these substances can leave visible footprints.
+/// </summary>
[DataField]
public Entity<SolutionComponent>? Solution;
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check how solutions are used with footprints in the codebase

# Look for solution-related patterns in footprint systems
rg -l "Solution.*step" --type cs

# Check for other footprint components that might interact with solutions
ast-grep --pattern 'class $_ : Component { $$$ Solution $$$ FootPrint $$$ }'

Length of output: 167


Script:

#!/bin/bash
# Let's try a more comprehensive analysis

# Check for footprint-related systems and components
rg -l "FootPrint" --type cs

# Look for solution usage patterns in the codebase
rg -A 5 "SolutionComponent" --type cs

# Check for any systems that might process footprints
ast-grep --pattern 'class $_ : ISystem { $$$ FootPrint $$$ }'

# Look for documentation patterns in similar components
ast-grep --pattern 'class $_ : Component {
  /// <summary>
  $$$
  /// </summary>
  [DataField]
  $$$
}'

Length of output: 120069


Script:

#!/bin/bash
# Let's check for footprint-related systems and their solution usage

# Look for footprint systems implementation
rg -A 10 "class.*FootPrint.*System" --type cs

# Check for solution-related documentation in similar components
rg -B 2 -A 2 "SolutionName.*=.*\"step\"" --type cs

# Look for footprint-solution interactions
rg -A 5 "Solution.*FootPrint" --type cs

Length of output: 3817

Resources/Prototypes/Entities/Mobs/Species/human.yml (1)

31-31: LGTM! Verify movement system integration.

The addition of the FootPrints component to BaseMobHuman is well-placed and follows the established entity-component pattern. Since this is part of porting the footsteps feature, let's verify its integration with the movement system.

✅ Verification successful

FootPrints component is properly integrated with movement system

The verification shows that the FootPrints system is well-integrated with movement:

  • Subscribes to MoveEvent for tracking entity movement
  • Handles different movement states (walking, crawling, dragging)
  • Integrates with physics through collision detection for puddle interactions
  • Properly considers movement-related components like LayingDownComponent
  • Creates footprints based on movement distance and state

The implementation is robust and follows the codebase patterns for movement handling.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that FootPrints component is properly integrated with movement systems

# Test 1: Check if FootPrintsSystem handles movement-related components
ast-grep --pattern 'class FootPrintsSystem {
  $$$
  Move$_($$$) {
    $$$
  }
  $$$
}'

# Test 2: Check for movement-related components in FootPrintsSystem
rg -A 5 "MovementSpeed|Mover|Physics" --type cs | grep -C 5 "FootPrints"

Length of output: 1299


Script:

#!/bin/bash
# Let's check the FootPrints system implementation and its event subscriptions

# Check FootPrints system implementation
fd "FootPrint" --type f --exec cat {}

# Check for movement-related event subscriptions in FootPrints systems
rg -B 3 -A 3 "Subscribe.*Event.*Move|Subscribe.*Event.*Step|Subscribe.*Event.*Walk" --type cs | grep -C 3 "FootPrint"

Length of output: 16475

Resources/Prototypes/_White/Entities/Effects/puddle.yml (2)

8-12: Verify the footstep sound volume level.

The footstep sound volume is set to 3, which might be too loud relative to other game sounds.

Let's check other footstep sound volumes in the codebase:

✅ Verification successful

Volume level of 3 for puddle footsteps is consistent with similar effects

The volume setting of 3 for puddle footsteps is appropriate when compared to other similar sound effects in the codebase:

  • Slime footsteps also use volume: 3
  • Water tiles use volume: 8 (which makes sense as they are larger surfaces)
  • Most other footstep sounds don't specify volume, using default levels
  • When volume is specified for mechanical/large entities, it tends to be higher (e.g., catwalk volume: 8)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other FootstepModifier configurations to compare volume settings
rg -A 5 "type: FootstepModifier" --type yaml

Length of output: 1045


Script:

#!/bin/bash
# Let's try a different approach to search for FootstepModifier and volume settings
rg -g "*.yml" -A 5 "footstepSoundCollection:" 

Length of output: 19508


21-30: Verify the slip fixture bounds.

The slip fixture uses a bounding box of 0.8x0.8 units (-0.4 to 0.4 in both dimensions). Please verify if this size appropriately matches the visual footprint size and doesn't create unexpectedly large slippery areas.

Let's check other slip fixture configurations:

✅ Verification successful

The previous search showed identical slip fixture bounds in both puddle configurations. Let's verify the sprite size to ensure it matches the physics bounds.


The previous search showed the sprite files being used, but we need to verify their actual dimensions to compare with the physics bounds. Let's check the sprite resources and their metadata.


Slip fixture bounds appear consistent with standard implementation

Based on the search results, we found that:

  1. The slip fixture bounds (-0.4 to 0.4) are consistently used across both puddle implementations in the codebase
  2. The puddles use standard sprite resources (puddle.rsi and wet_floor_sparkles.rsi) with semi-transparent rendering (#FFFFFF80)
  3. The puddles are configured to snap to grid center during placement

Since this appears to be the standard implementation across the codebase and no contradicting configurations were found, the slip fixture bounds are likely appropriate for the intended gameplay mechanics.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other slip fixture configurations to compare bounds
rg -A 5 "slipFixture:" --type yaml

Length of output: 1045


Script:

#!/bin/bash
# Let's search for sprite configurations in puddle entities to compare with physics bounds
rg -A 10 "sprite:" --type yaml Resources/Prototypes/Entities/Effects/puddle.yml Resources/Prototypes/_White/Entities/Effects/puddle.yml

# Also search for any documentation about puddle sizes
rg -i "puddle.*size|size.*puddle" --type yaml Resources/Prototypes/Entities/Effects/

Length of output: 1788


Script:

#!/bin/bash
# Let's check the actual sprite files to understand their dimensions
fd "puddle.rsi|wet_floor_sparkles.rsi" -t f -x ls -l {}

# Also check for any metadata files within these RSI directories that might contain sprite dimensions
fd "puddle.rsi|wet_floor_sparkles.rsi" -t d -x find {} -name "meta.json" -exec cat {} \;

Length of output: 221

Resources/Prototypes/Entities/Mobs/Species/dwarf.yml (1)

69-73: LGTM! The FootPrints component is properly configured.

The implementation follows the established pattern seen in other species implementations, with clear naming conventions for the footprint identifiers.

Let's verify the footprint texture resources exist:

Content.Shared/_White/Footprint/FootPrintsComponent.cs (1)

10-25: 🛠️ Refactor suggestion

Consider extracting string constants and validating RSI path.

The hardcoded string values for print types could be moved to constants for better maintainability. Additionally, consider adding runtime validation for the RSI path.

Let's verify if the RSI file exists:

Resources/Prototypes/Entities/Mobs/Species/reptilian.yml (1)

69-73: LGTM! Verify footprint assets exist.

The FootPrints component is correctly added to the abstract BaseMobReptilian entity, ensuring all reptilian mobs will inherit this feature.

Let's verify the referenced footprint assets exist:

✅ Verification successful

✓ Footprint assets verified and correctly defined

The footprint sprites for both left and right bare lizard prints are properly defined in the RSI metadata file at Resources/Textures/_White/Effects/footprints.rsi/meta.json. The implementation is consistent and complete.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the footprint textures/sprites exist for the reptilian species
# Expected: Find files containing the footprint identifiers

rg -l "footprint-(left|right)-bare-lizard"

Length of output: 264


Script:

#!/bin/bash
# Let's check the content of meta.json to verify if the footprint sprites are defined
cat "Resources/Textures/_White/Effects/footprints.rsi/meta.json" | jq '.states[] | select(.name | contains("footprint-") and contains("lizard"))'

Length of output: 232

Resources/Prototypes/Entities/Mobs/Player/human.yml (3)

Line range hint 73-95: Space Ninja configuration looks good!

The entity is well-structured with appropriate components for the role, including security measures (DeathAcidifierImplant) and proper faction membership.

🧰 Tools
🪛 yamllint

[error] 6-6: trailing spaces

(trailing-spaces)


Line range hint 23-29: Verify AutoTraitor configuration.

The AutoTraitor component is configured to not give uplink or objectives. Please confirm if this is intentional, as it might affect gameplay mechanics for syndicate agents.

✅ Verification successful

AutoTraitor configuration is consistent with other syndicate entities

The configuration of AutoTraitor with giveUplink: false and giveObjectives: false is intentional and consistent across all syndicate-related entities in the codebase, including:

  • Other player characters (DeltaV variant)
  • NPC entities like syndicate monkeys, kobolds, and mice
  • All these entities follow the same pattern of disabling uplink and objectives
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other AutoTraitor component usages to compare configuration
ast-grep --pattern 'type: AutoTraitor
    $$$'

Length of output: 44


Script:

#!/bin/bash
# Let's try with ripgrep to find AutoTraitor configurations
rg -A 5 "type: AutoTraitor" --type yaml

Length of output: 2499

🧰 Tools
🪛 yamllint

[error] 6-6: trailing spaces

(trailing-spaces)


Line range hint 31-71: Review psionic power multiplier for balance.

Both nuclear operative variants have a high psionic power multiplier (7x). Please verify if this multiplier is balanced for gameplay, as it could make these operatives significantly more powerful than regular characters.

✅ Verification successful

High psionic multiplier for nuclear operatives is consistent with game balance

The 7x psionic power multiplier for nuclear operatives appears to be intentionally balanced, as it matches other high-threat entities in the game. Specifically:

  • Chaplains have a 3x multiplier (lower tier)
  • Research Director has defined power slots but no multiplier
  • Other combat-oriented humanoid entities also use 7x multiplier, suggesting this is the standard multiplier for high-threat entities
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other Psionic component configurations to compare multipliers
ast-grep --pattern 'type: Psionic
    $$$'

Length of output: 44


Script:

#!/bin/bash
# Search for Psionic configurations using ripgrep for YAML files
rg "type: Psionic" -A 3 --type yaml

Length of output: 14092

🧰 Tools
🪛 yamllint

[error] 6-6: trailing spaces

(trailing-spaces)

Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs (1)

35-36: Review the water percentage condition logic.

The current condition returns when water percentage is high, which seems counterintuitive. Should this be checking if water percentage is below the threshold instead?

Resources/Prototypes/Entities/Mobs/Species/diona.yml (1)

123-127: LGTM! The FootPrints component is properly configured.

The component is well-integrated with the existing movement-related components and follows the established pattern for species-specific footprints. The bare print identifiers are appropriately named following the convention "footprint-[direction]-bare-[species]".

Let's verify the footprint sprite states exist:

✅ Verification successful

Footprint sprites for Diona are properly configured and available

The required sprite states footprint-left-bare-diona and footprint-right-bare-diona are correctly defined in the RSI metadata, matching the configuration in the YAML file.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the footprint sprites for Diona exist
# Expected: Find RSI files containing the specified footprint states

# Search for footprint sprite files
rg -l "footprint-(left|right)-bare-diona"

Length of output: 155


Script:

#!/bin/bash
# Let's check the actual content of the meta.json to verify the sprite states exist
cat Resources/Textures/_White/Effects/footprints.rsi/meta.json | jq '.states[] | select(.name | contains("footprint-") and contains("diona"))'

Length of output: 229

Resources/Prototypes/Entities/Mobs/Species/slime.yml (1)

122-126: Verify footprint sprite resources exist.

The FootPrints component addition looks good and follows the correct YAML structure. However, let's verify that the referenced footprint sprites exist in the resources.

Resources/Prototypes/Entities/Effects/puddle.yml (3)

Line range hint 2-89: LGTM! Well-structured puddle definitions.

The temporary puddle entities are well-organized with clear inheritance and consistent reagent definitions.


Line range hint 1-1: Please clarify the TODO comment's implications for footprints.

The existing TODO suggests uncertainty about non-tile-bound puddles. This could affect how footprints interact with moving or spreading puddles. Consider documenting how the footprints system handles these edge cases.

Let's check if there are any related design discussions:


169-169: Consider documenting component interactions and placement.

A few suggestions regarding the new PuddleFootPrints component:

  1. Consider documenting how it interacts with the existing StepTrigger component
  2. The comment style "# WD EDIT" might not follow project conventions
  3. The component's placement at the end might affect execution order - verify if this is intentional

Let's check the component ordering conventions and documentation:

Content.Client/_White/FootPrint/FootPrintsVisualizerSystem.cs (5)

1-12: LGTM! Dependencies and class structure are well-organized.

The system follows proper dependency injection patterns and class organization practices.


13-20: LGTM! System initialization is properly implemented.

The initialization follows correct event subscription patterns and system lifecycle management.


30-38: LGTM! Shutdown handling is properly implemented.

The cleanup logic is thorough and handles all edge cases safely.


77-84: LGTM! Appearance change handler is well implemented.

The event handler is concise and correctly handles all cases.


1-84: Verify the existence of required components and visual states.

Since this is a ported feature, we should verify that all required components and visual states are properly ported as well.

✅ Verification successful

Let me gather more information about the visual states and enums since they weren't clearly visible in the first results.


All required components and visual states are properly implemented

The verification shows that all necessary components and visual states are correctly implemented and aligned:

  • FootPrintComponent and FootPrintsComponent exist in the shared codebase
  • FootPrintVisuals enum includes all states used in the visualizer (BareFootPrint, ShoesPrint, SuitPrint, Dragging)
  • FootPrintVisualState enum is properly defined with State and Color fields
  • RSI path and sprite states are properly defined in FootPrintsComponent
  • The visualizer system correctly uses these components and states in both server and client implementations
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the existence of required components and visual states

echo "Checking for required components and enums..."

# Check for FootPrintComponent
rg -l "class FootPrintComponent"

# Check for FootPrintsComponent
rg -l "class FootPrintsComponent"

# Check for FootPrintVisuals enum
rg -l "enum FootPrintVisuals"

# Check for FootPrintVisualState
rg -l "class FootPrintVisualState"

# Check for visual state usage
rg "FootPrintVisualState\." -A 2

Length of output: 1534


Script:

#!/bin/bash
# Check the implementation details of visual states and enums

# Look for FootPrintVisuals enum definition
echo "=== FootPrintVisuals enum definition ==="
rg "enum FootPrintVisuals" -A 10

# Look for FootPrintVisualState definition
echo -e "\n=== FootPrintVisualState definition ==="
rg "FootPrintVisualState" -B 2 -A 2

# Check for any RSI path references in FootPrintsComponent
echo -e "\n=== RSI path in FootPrintsComponent ==="
rg "RsiPath" Content.Shared/_White/Footprint/FootPrintsComponent.cs -A 2

# Verify the sprite states referenced in the visualizer
echo -e "\n=== Sprite states referenced in components ==="
rg "Print\s*=\s*" Content.Shared/_White/Footprint/FootPrintsComponent.cs

Length of output: 3692

Resources/Prototypes/Entities/Mobs/Species/moth.yml (1)

Line range hint 1-125: LGTM: Component placement and inheritance structure.

The FootPrints component is correctly added to the abstract BaseMobMoth entity, which ensures all moth entities will inherit this functionality. The placement at the end of the components list is appropriate.

Resources/Prototypes/Entities/Mobs/Species/arachnid.yml (1)

133-135: Verify footprint sprite resources exist.

The FootPrints component references specific sprite identifiers. Let's verify these resources are properly included in the port.

Resources/Prototypes/Entities/Mobs/Species/harpy.yml (2)

130-134: Consider using harpy-specific footprint sprites instead of lizard ones.

The FootPrints component is using lizard footprint sprites (footprint-left-bare-lizard and footprint-right-bare-lizard) for a harpy entity. Given that harpies likely have different foot anatomy compared to lizards, consider creating and using harpy-specific footprint sprites for better visual accuracy.

Let's verify if the referenced sprite assets exist and if there are any harpy-specific alternatives:

#!/bin/bash
# Check for footprint-related textures
rg -g "*.rsi" -l "footprint"

# Check for any harpy-related textures that might contain footprint sprites
rg -g "*.rsi" -l "harpy"

130-134: Verify integration with existing movement components.

The FootPrints component has been added to an entity that already has movement-related features (MovementSpeedModifier, FootstepSound tag, StepTriggerImmune). Ensure that the footprints system correctly integrates with:

  1. Flight state (entity has Flight component)
  2. Different movement speeds (walk/sprint)
  3. Step trigger immunity system

Let's check the footprints system implementation for these integrations:

✅ Verification successful

Let me search for the footprints system implementation and its interactions with movement components to verify the integration concerns.


Let me check the actual implementation of the footprints systems to verify their integration with movement components.


I need to check how flight states and movement speeds are handled in the codebase to complete the verification of the integration concerns.


Based on the code analysis, I can now provide a final response regarding the integration of the FootPrints component with existing movement features:

FootPrints component integration is properly handled by the movement systems

The codebase shows that:

  1. Flight state is properly handled - the FootPrintsSystem only generates footprints during OnMove events, and the FlightSystem manages movement state separately without conflicts
  2. Movement speeds are handled correctly - footprints are generated based on actual movement position changes rather than speed modifiers
  3. StepTriggerImmune is a separate system that handles immunity to step triggers, which doesn't interfere with footprint generation as they operate independently

The FootPrints component works as an independent visual effect system that observes movement but doesn't interfere with the core movement mechanics.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for footprints-related systems and their interaction with flight
ast-grep --pattern 'class $_ {
  $$$
  Flight $$$
  $$$
  FootPrint $$$
  $$$
}'

# Look for movement speed handling in footprints system
rg -A 5 "MovementSpeedModifier.*FootPrint" 

Length of output: 513


Script:

#!/bin/bash
# Search for footprints system implementation
rg -l "FootPrint" --type cs

# Check footprints system code
ast-grep --pattern 'class $_ : ISystem {
  $$$
  FootPrint $$$
  $$$
}'

# Look for movement and flight related code with footprints
rg -A 10 "FootPrint.*" --type cs

# Check for step trigger immunity handling
rg -A 5 "StepTrigger.*FootPrint" --type cs

Length of output: 495


Script:

#!/bin/bash
# Let's examine the FootPrintsSystem implementation
cat Content.Server/_White/FootPrint/FootPrintsSystem.cs

# Check PuddleFootPrintsSystem as well
cat Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs

# Look at the component definitions
cat Content.Shared/_White/Footprint/FootPrintsComponent.cs

Length of output: 9687


Script:

#!/bin/bash
# Let's check for Flight component interactions
rg -A 5 "Flight.*Component" --type cs

# Check for movement speed modifiers
rg -A 5 "MovementSpeedModifier" --type cs

# Look for step trigger immunity
rg -A 5 "StepTriggerImmune" --type cs

Length of output: 111948

Resources/Prototypes/Entities/Mobs/Species/arachne.yml (1)

138-142: Verify footprint sprite assets exist.

The component references specific sprite states. Let's verify these assets are included in the port.

Content.Server/_White/FootPrint/FootPrintsSystem.cs (1)

83-83: Verify Alpha Value Remains Within Valid Range

When reducing the alpha value of comp.PrintsColor, ensure that it remains within the valid range (0 to 1) to prevent unexpected visual effects.

Consider confirming that ReduceAlpha correctly handles boundary conditions.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 21

🧹 Outside diff range and nitpick comments (20)
Content.Shared/_White/Footprint/PuddleFootPrintsComponent.cs (1)

4-5: Add XML documentation to describe the component's purpose.

Since this is a shared component that's part of a larger footprint system, adding XML documentation would help other developers understand its role in the puddle-footprint interaction system.

+/// <summary>
+/// Component that controls how puddles affect footprint appearance and behavior.
+/// </summary>
 public sealed partial class PuddleFootPrintsComponent : Component
Content.Shared/_White/Footprint/FootPrintVisuals.cs (1)

5-12: Consider adding XML documentation to clarify enum values.

While most values are self-explanatory, the Dragging value seems different from the other print types. Adding XML documentation would help clarify the intended usage of each value, especially for Dragging.

Example documentation:

 [Serializable, NetSerializable]
+/// <summary>
+/// Defines the various types of footprints that can be rendered in the game.
+/// </summary>
 public enum FootPrintVisuals : byte
 {
+    /// <summary>Footprints left by entities without shoes</summary>
     BareFootPrint,
+    /// <summary>Footprints left by entities wearing regular shoes</summary>
     ShoesPrint,
+    /// <summary>Footprints left by entities in space suits</summary>
     SuitPrint,
+    /// <summary>Marks left when an entity is being dragged</summary>
     Dragging
 }
Content.Shared/_White/Footprint/FootPrintComponent.cs (1)

6-10: Consider enhancing the component documentation.

While the basic documentation is present, it would be helpful to include:

  • Interaction details with FootPrintsComponent
  • Purpose of the SolutionComponent integration
  • Lifecycle information (when it's created/destroyed)

Example enhancement:

 /// <summary>
-/// This is used for marking footsteps, handling footprint drawing.
+/// Represents a single footprint instance in the game world. This component is created
+/// when an entity with FootPrintsComponent leaves a footprint, and handles the visual
+/// representation and chemical properties of the print. It maintains a reference to its
+/// creator and can optionally contain a chemical solution that affects its appearance
+/// or behavior.
 /// </summary>
Resources/Prototypes/_White/Entities/Effects/puddle.yml (1)

37-37: Add newline at end of file.

Add a newline character at the end of the file to comply with YAML standards.

    - type: Appearance
+
🧰 Tools
🪛 yamllint

[error] 37-37: no new line character at the end of file

(new-line-at-end-of-file)

Content.Shared/_White/Footprint/FootPrintsComponent.cs (5)

7-9: Add XML documentation for the component.

As this is a shared component that will be used across client and server, please add XML documentation to describe its purpose, usage, and any important considerations.

+/// <summary>
+/// Component that manages footprint appearance and behavior.
+/// Used to configure how footprints are rendered and what properties they have.
+/// </summary>
 [RegisterComponent]
 public sealed partial class FootPrintsComponent : Component

26-36: Improve dragging print configuration.

The array of dragging prints could be better defined using constants and more descriptive documentation.

+    /// <summary>
+    /// Defines the sequence of sprites used for dragging animations.
+    /// Each string represents a different frame in the dragging animation.
+    /// </summary>
     [ViewVariables(VVAccess.ReadOnly), DataField]
-    public string[] DraggingPrint =
+    public static readonly string[] DraggingPrint =
     [
         "dragging-1",
         "dragging-2",
         "dragging-3",
         "dragging-4",
         "dragging-5",
     ];
-    // yea, those

43-54: Add validation and documentation for size and color parameters.

The float parameters lack documentation about their valid ranges and purposes. Additionally, consider adding validation to ensure values are within acceptable ranges.

+    /// <summary>
+    /// Size multiplier for regular footsteps. Must be positive.
+    /// </summary>
     [DataField]
-    public float StepSize = 0.7f;
+    public float StepSize = 0.7f;
+
+    /// <summary>
+    /// Size multiplier for drag marks. Must be positive.
+    /// </summary>
     [DataField]
-    public float DragSize = 0.5f;
+    public float DragSize = 0.5f;
+
+    /// <summary>
+    /// Determines the intensity of the footprint color.
+    /// </summary>
     [DataField]
-    public float ColorQuantity;
+    public float ColorQuantity;
+
+    /// <summary>
+    /// Rate at which the alpha channel of the footprint color decreases.
+    /// Must be between 0 and 1.
+    /// </summary>
     [DataField]
-    public float ColorReduceAlpha = 0.1f;
+    public float ColorReduceAlpha = 0.1f;

55-57: Document ReagentToTransfer null behavior.

Please document when ReagentToTransfer can be null and how the system should handle null values.

+    /// <summary>
+    /// Optional reagent that can be transferred through footprints.
+    /// If null, no reagent transfer will occur.
+    /// </summary>
     [DataField]
     public string? ReagentToTransfer;

1-64: Consider implementing ISerializationHooks for validation.

The component handles various configuration values that could benefit from validation on deserialization. Consider implementing ISerializationHooks to validate values when the component is created from prototype data.

Example implementation:

public sealed partial class FootPrintsComponent : Component, ISerializationHooks
{
    void ISerializationHooks.AfterDeserialization()
    {
        Debug.Assert(StepSize > 0, "StepSize must be positive");
        Debug.Assert(DragSize > 0, "DragSize must be positive");
        Debug.Assert(ColorReduceAlpha >= 0 && ColorReduceAlpha <= 1, 
            "ColorReduceAlpha must be between 0 and 1");
    }
}
Resources/Prototypes/Entities/Mobs/Species/reptilian.yml (1)

69-73: LGTM! Consider adding a brief comment about the footprint identifiers.

The FootPrints component is properly configured for the reptilian entity. The footprint identifiers follow a consistent naming pattern and align well with the entity's physical characteristics.

Consider adding a brief comment explaining the footprint identifier format for better maintainability:

  # WD EDIT START
  - type: FootPrints
+   # Format: footprint-{left|right}-bare-{species}
    leftBarePrint: "footprint-left-bare-lizard"
    rightBarePrint: "footprint-right-bare-lizard"
  # WD EDIT END
Resources/Prototypes/Entities/Mobs/Player/human.yml (1)

6-6: Remove trailing whitespace.

There is a trailing space on this line that should be removed.

-  
+
🧰 Tools
🪛 yamllint

[error] 6-6: trailing spaces

(trailing-spaces)

Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs (2)

11-20: Add XML documentation for the system class and initialization method.

Adding documentation will help other developers understand the system's purpose and responsibilities.

+/// <summary>
+/// Handles the interaction between puddles and entities with footprint components,
+/// managing the transfer of solution colors and reagents to footprints.
+/// </summary>
 public sealed class PuddleFootPrintsSystem : EntitySystem
 {
     [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
     [Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;

+    /// <summary>
+    /// Initializes the puddle footprints system by subscribing to collision events.
+    /// </summary>
     public override void Initialize()

31-31: Remove or translate the German comment.

The comment "alles gut!" should be in English for consistency and clarity.

-        // alles gut!
+        // All components are present, proceed with processing
Resources/Prototypes/Entities/Mobs/Species/slime.yml (1)

122-126: Consider slime movement mechanics.

Given that slimes typically move by sliding or oozing, consider if the standard bipedal footprint system is the most appropriate representation. You might want to explore alternative visual effects that better represent slime movement, such as a continuous trail or specialized print patterns.

Resources/Prototypes/Entities/Mobs/Species/vox.yml (1)

105-107: Consider grouping the FootPrints component with related components.

The FootPrints component is currently added at the end of the components list. For better organization and maintainability, consider grouping it with other movement or visual-related components.

Consider moving it near other movement or visual components like the Sprite component.

Resources/Prototypes/Entities/Effects/puddle.yml (1)

Line range hint 1-169: Consider restructuring puddle inheritance hierarchy.

The current structure has a good separation between temporary and permanent puddles. However, consider these architectural improvements:

  1. Group puddles by their primary effects (slippery vs non-slippery)
  2. Create separate base entities for consumable and non-consumable puddles
  3. Consider making the reagent quantities configurable through variables rather than hard-coded values

Example restructuring:

- type: entity
  id: PuddleBase
  abstract: true
  components:
    - type: Transform
    # ... common components

- type: entity
  id: PuddleSlippery
  parent: PuddleBase
  abstract: true
  components:
    - type: Slippery

- type: entity
  id: PuddleConsumable
  parent: PuddleBase
  abstract: true
  components:
    - type: Drink
    - type: BadDrink
Content.Client/_White/FootPrint/FootPrintsVisualizerSystem.cs (1)

21-37: Consider adding logging for component initialization failures.

While the null check for SpriteComponent is good, it silently fails. Consider logging a warning when the required component is missing, as this could indicate a configuration issue.

 private void OnInitialized(EntityUid uid, FootPrintComponent comp, ComponentInit args)
 {
     if (!TryComp<SpriteComponent>(uid, out var sprite))
+    {
+        Logger.Warning($"Failed to initialize FootPrintComponent on {uid}: Missing SpriteComponent");
         return;
+    }
Resources/Prototypes/Entities/Mobs/Species/arachnid.yml (1)

133-135: Consider architectural implications of spider footprint representation.

While the FootPrints component is correctly configured, it currently only represents left and right prints despite arachnids having 8 legs. This might be a deliberate simplification, but consider:

  1. Whether this accurately represents spider movement
  2. If additional footprint patterns would enhance realism

Would you like to explore alternative footprint patterns that better represent arachnid movement?

Content.Server/_White/FootPrint/FootPrintsSystem.cs (2)

59-60: Simplify condition for readability

The negated condition if (!(distance > stepSize)) can be simplified to if (distance <= stepSize), enhancing readability and understanding.

Apply this diff:

- if (!(distance > stepSize))
+ if (distance <= stepSize)
     return;

47-92: Ensure proper error handling and logging

In the OnMove method, consider adding logging for cases where important components are not found or when early returns occur due to failed conditions. This can aid in debugging and monitoring the system's behavior.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6093d72 and 391b155.

⛔ Files ignored due to path filters (20)
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-1.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-2.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-3.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-4.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-5.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/dragging-test.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-diona.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-dwarf.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-human.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-lizard.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-slime.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-left-bare-spider.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-diona.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-dwarf.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-human.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-lizard.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-slime.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-right-bare-spider.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-shoes.png is excluded by !**/*.png
  • Resources/Textures/_White/Effects/footprints.rsi/footprint-suit.png is excluded by !**/*.png
📒 Files selected for processing (23)
  • Content.Client/_White/FootPrint/FootPrintsVisualizerSystem.cs (1 hunks)
  • Content.Server/_White/FootPrint/FootPrintsSystem.cs (1 hunks)
  • Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs (1 hunks)
  • Content.Shared/_White/Footprint/FootPrintComponent.cs (1 hunks)
  • Content.Shared/_White/Footprint/FootPrintVisuals.cs (1 hunks)
  • Content.Shared/_White/Footprint/FootPrintsComponent.cs (1 hunks)
  • Content.Shared/_White/Footprint/PuddleFootPrintsComponent.cs (1 hunks)
  • Resources/Prototypes/Entities/Effects/puddle.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Player/arachnid.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Player/human.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/arachne.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/arachnid.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/diona.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/dwarf.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/harpy.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/human.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/moth.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/reptilian.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/skeleton.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/slime.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/vox.yml (1 hunks)
  • Resources/Prototypes/_White/Entities/Effects/puddle.yml (1 hunks)
  • Resources/Textures/_White/Effects/footprints.rsi/meta.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Resources/Textures/_White/Effects/footprints.rsi/meta.json
🧰 Additional context used
🪛 yamllint
Resources/Prototypes/Entities/Mobs/Player/arachnid.yml

[error] 13-13: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/Entities/Mobs/Player/human.yml

[error] 6-6: trailing spaces

(trailing-spaces)

Resources/Prototypes/Entities/Mobs/Species/skeleton.yml

[warning] 105-105: wrong indentation: expected 4 but found 2

(indentation)

Resources/Prototypes/_White/Entities/Effects/puddle.yml

[error] 37-37: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (26)
Content.Shared/_White/Footprint/PuddleFootPrintsComponent.cs (1)

1-11: Verify integration with the puddle system.

The component seems to be part of a larger puddle-footprint interaction system. Please ensure it's properly integrated with the puddle system.

✅ Verification successful

Let me check the content of these files to verify the integration.


Let me check one more thing to verify the complete integration.


Let me check for the FootPrintsComponent one more time with a different approach.


Let me check the core FootPrints components and systems to complete the verification.


Based on the comprehensive review of the code, I can now generate the final response.

The puddle-footprint integration is properly implemented and working as intended.

The verification shows that:

  • PuddleFootPrintsComponent is correctly integrated with the puddle system through PuddleFootPrintsSystem
  • The system properly handles collision events between puddles and entities with FootPrintsComponent
  • It correctly transfers reagents from puddles to footprints and manages color interpolation
  • The component is properly registered in the puddle entity prototype
  • The implementation includes proper checks for solution containers, appearance components, and other required systems

The integration is complete and follows the established patterns in the codebase for fluid-entity interactions.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration between puddles and footprints

# Check for puddle-related systems that might use this component
echo "Checking for puddle systems that interact with PuddleFootPrintsComponent..."
rg -l "PuddleFootPrintsComponent" --type cs

# Check for puddle entity definitions that use this component
echo "Checking for puddle entity definitions..."
rg -l "PuddleFootPrints" --type yaml

Length of output: 502


Script:

#!/bin/bash
# Check the puddle system implementation
echo "=== PuddleFootPrintsSystem.cs ==="
cat Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs

echo -e "\n=== Puddle prototype definitions ==="
cat Resources/Prototypes/Entities/Effects/puddle.yml

# Check for any other puddle systems that might be related
echo -e "\n=== Looking for other puddle systems ==="
rg -l "PuddleSystem" --type cs

Length of output: 8531


Script:

#!/bin/bash
# Check the shared puddle system and component to understand the core functionality
echo "=== SharedPuddleSystem.cs ==="
cat Content.Shared/Fluids/SharedPuddleSystem.cs

echo -e "\n=== PuddleComponent.cs ==="
cat Content.Shared/Fluids/Components/PuddleComponent.cs

# Check FootPrintsComponent to understand how it interacts
echo -e "\n=== Looking for FootPrintsComponent ==="
rg -l "FootPrintsComponent\.cs$"

Length of output: 8178


Script:

#!/bin/bash
# Look for FootPrints-related files
echo "=== Looking for FootPrints files ==="
fd -e cs FootPrint

# Check for any systems that might handle footprints
echo -e "\n=== Looking for footprint-related systems ==="
rg -l "FootPrint.*System" --type cs

Length of output: 814


Script:

#!/bin/bash
# Check the core footprints implementation
echo "=== FootPrintsComponent.cs ==="
cat Content.Shared/_White/Footprint/FootPrintsComponent.cs

echo -e "\n=== FootPrintsSystem.cs ==="
cat Content.Server/_White/FootPrint/FootPrintsSystem.cs

echo -e "\n=== FootPrintVisuals.cs ==="
cat Content.Shared/_White/Footprint/FootPrintVisuals.cs

Length of output: 7888

Content.Shared/_White/Footprint/FootPrintVisuals.cs (1)

21-25: Verify integration with visualization layer system.

The single layer value Print suggests this integrates with a larger visualization system. Let's verify the layer usage and naming convention matches the existing system.

✅ Verification successful

Based on the search results, I can now generate the final response:

Visual layer naming and usage is consistent with codebase patterns

The FootPrintVisualLayers enum follows the established pattern seen across the codebase, where visual layer enums are consistently named with the VisualLayers suffix and use byte as the underlying type. The Print layer is properly utilized in FootPrintsVisualizerSystem.cs with standard layer mapping operations.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other visual layer enums to verify naming consistency
echo "Searching for other visual layer enums..."
rg -l "VisualLayers.*:.*byte" --type cs

# Search for usage of FootPrintVisualLayers
echo "Checking usage of FootPrintVisualLayers..."
rg "FootPrintVisualLayers\.Print" --type cs

Length of output: 3992

Content.Shared/_White/Footprint/FootPrintComponent.cs (2)

1-4: LGTM! Clean and minimal dependencies.

The using statements are appropriately minimal, and the namespace follows the project's convention.


15-17: Verify PrintOwner always has FootPrintsComponent.

The PrintOwner field references an entity with FootPrintsComponent, but there's no runtime validation to ensure this component exists.

Let's verify the component usage:

Resources/Prototypes/_White/Entities/Effects/puddle.yml (4)

1-5: LGTM! Entity metadata is well-defined.

The entity is correctly configured as a non-persistent effect, which is appropriate for temporary footstep traces.


18-30: LGTM! Physics configuration is well-structured.

The static body type and slip fixture configuration are appropriate for a floor-based effect. The collision masks and layers are correctly set up for item interaction.


31-34: Verify the solution container volume.

Please confirm that the maximum volume of 2 units for the "step" solution is appropriate for footprint effects. This value affects how much liquid can be tracked.


8-12: Verify the footstep sound volume level.

The volume parameter is set to 3, which might be too loud compared to other sound effects in the game. Please verify that this volume level is consistent with other footstep sounds in the game.

✅ Verification successful

Based on the search results, I can generate the final response as we have sufficient information about FootstepModifier volume settings across the codebase:

Volume setting for puddle footsteps needs adjustment

The current volume setting of 3 for puddle footsteps is inconsistent with other water-related footstep sounds in the codebase. The water tile uses volume 8 for the same FootstepWater collection, suggesting the puddle should have a lower volume to maintain proper audio hierarchy.

  • Resources/Prototypes/Entities/Tiles/water.yml: FootstepWater volume: 8
  • Resources/Prototypes/_White/Entities/Effects/puddle.yml: FootstepWater volume: 3

Since puddles are smaller water features compared to full water tiles, the lower volume of 3 is actually appropriate as it creates a sensible audio distinction between walking through a puddle versus walking through deeper water.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other FootstepModifier configurations to compare volume settings
rg -A 5 "type: FootstepModifier" --type yaml

Length of output: 19768

Resources/Prototypes/Entities/Mobs/Species/dwarf.yml (2)

69-73: LGTM! Well-integrated footprints component.

The FootPrints component is properly integrated:

  • Correctly placed after movement-related components
  • Aligns with the entity's Body component that requires 2 legs
  • Uses clear species-specific sprite identifiers
  • Properly marked with edit comments

69-73: Verify footprint sprite assets exist.

The FootPrints component references specific sprite states: "footprint-left-bare-dwarf" and "footprint-right-bare-dwarf". Let's ensure these assets are properly included.

✅ Verification successful

The previous search might have failed due to RSI being a directory. Let's search more broadly for footprint-related assets and then examine any relevant files we find.


Sprite assets verified and available

The referenced sprite states "footprint-left-bare-dwarf" and "footprint-right-bare-dwarf" are properly defined in /Resources/Textures/_White/Effects/footprints.rsi/meta.json. The component configuration is correct and the required assets exist.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the dwarf footprint sprite definitions
rg -g "*.rsi" "footprint-(left|right)-bare-dwarf"

Length of output: 200


Script:

#!/bin/bash
# Search for footprint sprite definitions in RSI metadata files
fd ".rsi" --exec rg -l "footprint"

# Also check for any footprint-related sprite files
fd "footprint" --extension png --extension yml --extension json

Length of output: 149


Script:

#!/bin/bash
# Let's examine the contents of the footprints metadata file to see available states
cat "./Resources/Textures/_White/Effects/footprints.rsi/meta.json"

# Also check the crayondecals file just to be thorough
cat "./Resources/Textures/Effects/crayondecals.rsi/meta.json"

Length of output: 8458

Content.Shared/_White/Footprint/FootPrintsComponent.cs (1)

40-42: Verify the default transparent color.

The default color being fully transparent (#00000000) might prevent footprints from being visible initially. Please verify if this is the intended default behavior.

✅ Verification successful

Based on the search results, I can now provide a final response as I have enough context about how the footprint color system works:

The transparent default color is correct and intentional.

The footprint color system is designed to work dynamically where:

  • The initial transparent color (#00000000) is correct as footprints only become visible when interacting with puddles/fluids
  • Color is added through the AddColor method in PuddleFootPrintsSystem when stepping in puddles
  • The color and visibility are controlled by:
    • The puddle's solution color that is being stepped in
    • A gradual alpha reduction through ReduceAlpha method for fade-out effects
    • Color interpolation between multiple puddle interactions
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for places where PrintsColor is modified to understand the initialization flow
ast-grep --pattern 'PrintsColor = $_'

Length of output: 39


Script:

#!/bin/bash
# Let's try a broader search for color-related patterns in footprint components
rg -i "prints.*color|footprint.*color" -A 3 -B 3

# Also search for any usage or references to FootPrintsComponent
rg "FootPrintsComponent" -A 3 -B 3

# Search for any color initialization patterns in footprint-related files
fd -e cs footprint -i | xargs cat

Length of output: 26636

Resources/Prototypes/Entities/Mobs/Player/human.yml (1)

Line range hint 8-92: LGTM: Well-structured entity definitions.

The new entity definitions for syndicate agents, nuclear operatives, and space ninja are well-organized with:

  • Clear parent-child relationships
  • Appropriate component configurations
  • Consistent naming conventions
  • Proper faction memberships
🧰 Tools
🪛 yamllint

[error] 6-6: trailing spaces

(trailing-spaces)

Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs (1)

22-46: Verify error handling for edge cases.

The OnStepTrigger method should handle potential edge cases:

  1. Empty solutions
  2. Invalid solution references
  3. Null color values
✅ Verification successful

Based on the code analysis, I can now provide a final response regarding the error handling verification:

Error handling is properly implemented for edge cases

The OnStepTrigger method in PuddleFootPrintsSystem has comprehensive null checks and error handling:

  • Guards against missing components using TryComp for all required components
  • Handles empty solutions with solutions.Contents.Count <= 0 check
  • Validates solution resolution with ResolveSolution
  • Handles water content ratio edge case with percentage calculation
  • Safely accesses appearance data with TryGetData
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for error handling patterns in related systems
rg -l "TryComp|ResolveSolution" --type cs

# Look for similar collision handling patterns
ast-grep --pattern 'EndCollideEvent'

Length of output: 49849


Script:

#!/bin/bash
# Search for error handling patterns in PuddleFootPrintsSystem and related systems
rg -A 10 "PuddleFootPrintsSystem|FootPrintsComponent" --type cs

# Look for solution handling patterns
ast-grep --pattern 'ResolveSolution'

Length of output: 10600

Resources/Prototypes/Entities/Mobs/Species/diona.yml (1)

123-127: LGTM! Component placement and configuration look good.

The FootPrints component is appropriately placed after other movement-related components. The configuration aligns well with the Diona species characteristics. Note that this will work alongside the existing NoSlip and StepTriggerImmune components, allowing footprints while maintaining immunity to related effects.

Resources/Prototypes/Entities/Mobs/Species/slime.yml (1)

122-126: LGTM! Verify sprite assets exist.

The FootPrints component addition is clean and follows the established pattern. However, let's verify the referenced sprite assets exist.

Resources/Prototypes/Entities/Effects/puddle.yml (2)

169-169: LGTM: PuddleFootPrints component addition.

The addition of the PuddleFootPrints component to the base Puddle entity is appropriate and aligns with the PR's objective of implementing the footsteps feature.


Line range hint 1-1: Address or remove the TODO comment.

The TODO comment suggests uncertainty about the design intention for blood and vomit puddles. This should be clarified or removed to maintain code quality.

Let's check if this TODO is addressed elsewhere:

Content.Client/_White/FootPrint/FootPrintsVisualizerSystem.cs (4)

1-12: LGTM: Dependencies and class structure are well-organized.

The system correctly inherits from VisualizerSystem<FootPrintComponent> and includes necessary dependencies for appearance management and randomization.


13-19: LGTM: Proper initialization and event subscriptions.

The system correctly initializes and subscribes to necessary component lifecycle events.


77-84: LGTM: Appearance change handler is properly implemented.

The override correctly handles appearance changes and includes appropriate null checking.


1-84: Verify presence of required components and systems.

Since this is a port of a footprints feature, let's verify that all required components and systems are present in the codebase.

✅ Verification successful

Let me check the content of these components to ensure they contain the required functionality.


All required components and assets are present and properly implemented

The verification shows that all necessary components for the footprints feature are present and correctly implemented:

  • FootPrintComponent with required networking and solution handling
  • FootPrintsComponent with all visual states and configuration
  • FootPrintVisuals enum with all required states
  • Complete set of footprint sprites in the RSI directory including:
    • Bare footprints for different species
    • Shoe prints
    • Suit prints
    • Dragging prints
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for presence of required footprint-related components and systems

echo "Checking for required footprint components and systems..."

# Check for FootPrintComponent
echo "Looking for FootPrintComponent..."
rg -l "class.*FootPrintComponent"

# Check for FootPrintsComponent
echo "Looking for FootPrintsComponent..."
rg -l "class.*FootPrintsComponent"

# Check for required visual states
echo "Looking for FootPrintVisuals enum..."
rg -l "enum.*FootPrintVisuals"

# Check for RSI assets
echo "Looking for footprint RSI assets..."
fd -e "rsi" | rg -i "foot|print|step"

Length of output: 1177


Script:

#!/bin/bash
# Check FootPrintComponent implementation
echo "=== FootPrintComponent Implementation ==="
cat Content.Shared/_White/Footprint/FootPrintComponent.cs

echo -e "\n=== FootPrintsComponent Implementation ==="
cat Content.Shared/_White/Footprint/FootPrintsComponent.cs

echo -e "\n=== FootPrintVisuals Enum ==="
cat Content.Shared/_White/Footprint/FootPrintVisuals.cs

echo -e "\n=== Check footprints.rsi contents ==="
ls -la Resources/Textures/_White/Effects/footprints.rsi/

Length of output: 4976

Resources/Prototypes/Entities/Mobs/Species/arachnid.yml (1)

133-135: Verify footprint sprite assets exist.

The FootPrints component configuration looks correct, but we should verify that the referenced sprite assets exist in the game resources.

Resources/Prototypes/Entities/Mobs/Species/harpy.yml (1)

130-134: LGTM on technical implementation.

The FootPrints component is correctly added and follows the established pattern for entity modifications, with clear edit markers.

Resources/Prototypes/Entities/Mobs/Species/arachne.yml (2)

138-142: Consider spider movement mechanics for footprint generation.

The arachne entity has 8 legs (as specified in the Body component's requiredLegs: 8) and uses MovementAlwaysTouching. The current FootPrints component only defines left/right prints which might not accurately represent spider movement patterns.

Consider:

  1. Whether the footprint system needs special handling for multi-legged creatures
  2. If the movement pattern should reflect all 8 legs rather than just left/right prints

Would you like assistance in implementing a more spider-specific footprint pattern?


138-142: Verify footprint sprite assets exist.

The FootPrints component references specific sprite states "footprint-left-bare-spider" and "footprint-right-bare-spider". Since this is a ported feature, we should ensure these assets were also ported correctly.

Content.Server/_White/FootPrint/FootPrintsSystem.cs (1)

110-115: Verify equipment precedence in 'PickState' method

In the PickState method, ensure that the state precedence is intentional. Currently, if an entity is wearing both shoes and a pressure suit, the state will be set to SuitPrint. Verify that this is the desired behavior.

Run the following script to check occurrences of entities with both "shoes" and "outerClothing" equipped:

✅ Verification successful

Let me try a different approach to verify this using simpler commands:

This will help us understand the footprint system's behavior and any existing tests that might validate the state precedence.


Let me check the FootPrintVisuals enum to understand the intended hierarchy:


State precedence in PickState method is intentionally hierarchical

The precedence in the PickState method follows a clear hierarchical progression from least to most protective footwear:

  1. Bare feet (default state)
  2. Shoes
  3. Pressure suit
  4. Dragging state (overrides all)

This is consistent with the enum definition order and makes logical sense as pressure suits should provide more coverage than regular shoes. The current implementation is correct.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find entities with both "shoes" and "outerClothing" equipped to verify state precedence.

# Test: Search for entities with both slots filled.
ast-grep --pattern $'var _ when _inventory.TryGetSlotEntity($_, "shoes", out _)' --json | jq '.nodes[] | .range.start.line' > shoes_lines.txt
ast-grep --pattern $'var suit when _inventory.TryGetSlotEntity($_, "outerClothing", out var suit)' --json | jq '.nodes[] | .range.start.line' > outerClothing_lines.txt
comm -12 shoes_lines.txt outerClothing_lines.txt > common_lines.txt

if [ -s common_lines.txt ]; then
  echo "Entities found with both shoes and outerClothing equipped. Verify if state precedence in PickState is correct."
else
  echo "No entities found with both shoes and outerClothing equipped."
fi

Length of output: 683


Script:

#!/bin/bash
# Search for footprint-related code and state handling
rg -A 5 -B 5 "FootPrintVisuals\." --type cs

# Also check for any tests or documentation related to footprints
rg -l "footprint|FootPrint" --type cs

Length of output: 4983


Script:

#!/bin/bash
# Check the FootPrintVisuals enum definition
cat Content.Shared/_White/Footprint/FootPrintVisuals.cs

# Also check if there's any documentation or comments about the precedence
rg -B 3 -A 3 "enum FootPrintVisuals" --type cs

Length of output: 1020

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (9)
Content.Shared/_White/Footprint/FootPrintsComponent.cs (4)

13-34: Add XML documentation for print type properties.

The print type properties would benefit from XML documentation explaining their purpose and expected values, especially since they represent different visual states.

+    /// <summary>
+    /// The sprite state for left bare human footprints.
+    /// </summary>
     [ViewVariables(VVAccess.ReadOnly), DataField]
     public string LeftBarePrint = "footprint-left-bare-human";

+    /// <summary>
+    /// The sprite state for right bare human footprints.
+    /// </summary>
     [ViewVariables(VVAccess.ReadOnly), DataField]
     public string RightBarePrint = "footprint-right-bare-human";

+    /// <summary>
+    /// The sprite state for footprints with shoes.
+    /// </summary>
     [ViewVariables(VVAccess.ReadOnly), DataField]
     public string ShoesPrint = "footprint-shoes";

+    /// <summary>
+    /// The sprite state for suit-based footprints.
+    /// </summary>
     [ViewVariables(VVAccess.ReadOnly), DataField]
     public string SuitPrint = "footprint-suit";

+    /// <summary>
+    /// Animation frames for dragging effects, played in sequence.
+    /// </summary>
     [ViewVariables(VVAccess.ReadOnly), DataField]
     public string[] DraggingPrint = [/*...*/];

40-42: Document the purpose of transparent initial color.

Add documentation to explain why the PrintsColor starts transparent and how it's expected to be modified during runtime.

+    /// <summary>
+    /// The color of the footprints. Starts transparent and is typically modified
+    /// based on the surface or substance being stepped in.
+    /// </summary>
     [ViewVariables(VVAccess.ReadOnly), DataField]
     public Color PrintsColor = Color.FromHex("#00000000");

55-60: Document the purpose and calculation of offset values.

The OffsetPrint values appear to be magic numbers. Add documentation explaining how these values were determined and what they represent in the game world.

+    /// <summary>
+    /// The offset applied to footprint positions relative to the entity's position.
+    /// X: Horizontal offset (0.1 units right)
+    /// Y: No vertical offset
+    /// </summary>
     [DataField]
     public Vector2 OffsetPrint = new(0.1f, 0f);

8-72: Consider splitting the component into smaller, focused components.

The FootPrintsComponent currently handles multiple concerns:

  • Visual appearance (RSI paths, colors)
  • Physical properties (sizes, offsets)
  • State tracking (step position, right/left alternation)
  • Behavior configuration (color interpolation, reagent transfer)

Consider splitting this into separate components following the Single Responsibility Principle:

  • FootPrintAppearanceComponent for visual properties
  • FootPrintPhysicsComponent for physical properties
  • FootPrintStateComponent for state tracking
  • FootPrintBehaviorComponent for behavior configuration

This would make the system more maintainable and easier to test.

Would you like me to provide an example of how to refactor this into smaller components?

Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs (2)

31-31: Remove non-professional comment.

The comment "alles gut!" should be replaced with a meaningful English comment explaining the purpose of the following code block.

-        // alles gut!
+        // All components are present, proceed with puddle-footprint interaction

11-53: Consider architectural improvements for better separation of concerns.

The system currently handles both puddle interaction and color management. Consider:

  1. Splitting the solution management logic into a separate system or helper class
  2. Using events for color changes to make the system more modular
  3. Adding an interface for footprint interactions to support different types of surfaces

This would make the system more maintainable and extensible for future surface types.

Content.Server/_White/FootPrint/FootPrintsSystem.cs (3)

88-91: Extract magic number into a constant

The solution volume check and reagent addition use a magic number (1). This should be extracted into a named constant for better maintainability and clarity.

+ private const float MaxSolutionVolume = 1f;
+ private const float ReagentTransferAmount = 1f;
...
- || solution.Volume >= 1)
+ || solution.Volume >= MaxSolutionVolume)
...
- _solution.TryAddReagent(footPrintComponent.Solution.Value, component.ReagentToTransfer, 1, out _);
+ _solution.TryAddReagent(footPrintComponent.Solution.Value, component.ReagentToTransfer, ReagentTransferAmount, out _);

94-104: Add XML documentation to explain coordinate calculation

The coordinate calculation logic is complex and would benefit from documentation explaining the coordinate system and angle calculations.

+ /// <summary>
+ /// Calculates the coordinates for footprint placement based on the entity's position and state.
+ /// </summary>
+ /// <param name="uid">The grid entity UID</param>
+ /// <param name="component">The footprints component</param>
+ /// <param name="transform">The transform component of the entity</param>
+ /// <param name="state">True if the entity is dragging, false if walking</param>
+ /// <returns>The calculated coordinates for the footprint</returns>
private EntityCoordinates CalcCoords(EntityUid uid, FootPrintsComponent component, TransformComponent transform, bool state)

110-114: Extract slot names into constants

The slot names "shoes" and "outerClothing" should be extracted into constants to prevent typos and improve maintainability.

+ private const string ShoesSlot = "shoes";
+ private const string OuterClothingSlot = "outerClothing";
...
- if (_inventory.TryGetSlotEntity(uid, "shoes", out _))
+ if (_inventory.TryGetSlotEntity(uid, ShoesSlot, out _))
...
- if (_inventory.TryGetSlotEntity(uid, "outerClothing", out var suit) && TryComp<PressureProtectionComponent>(suit, out _))
+ if (_inventory.TryGetSlotEntity(uid, OuterClothingSlot, out var suit) && TryComp<PressureProtectionComponent>(suit, out _))
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 391b155 and 35c8796.

📒 Files selected for processing (3)
  • Content.Server/_White/FootPrint/FootPrintsSystem.cs (1 hunks)
  • Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs (1 hunks)
  • Content.Shared/_White/Footprint/FootPrintsComponent.cs (1 hunks)
🔇 Additional comments (6)
Content.Shared/_White/Footprint/FootPrintsComponent.cs (1)

1-9: LGTM! Component structure follows best practices.

The component is properly registered and structured according to the codebase conventions.

Content.Server/_White/FootPrint/PuddleFootPrintsSystem.cs (3)

1-20: LGTM! Dependencies and initialization are well structured.

The system follows proper dependency injection patterns and event subscription practices.


48-52: LGTM! Color interpolation is well implemented.

The method properly handles color blending using the component's interpolation factor.


24-29: 🛠️ Refactor suggestion

Simplify the early return pattern.

The multiple TryComp checks could be simplified using pattern matching for better readability.

-        if (!TryComp<AppearanceComponent>(uid, out var appearance)
-            || !TryComp<PuddleComponent>(uid, out var puddle)
-            || !TryComp<FootPrintsComponent>(args.OtherEntity, out var tripper)
-            || !TryComp<SolutionContainerManagerComponent>(uid, out var solutionManager)
-            ||!_solutionContainer.ResolveSolution((uid, solutionManager), puddle.SolutionName, ref puddle.Solution, out var solutions))
-            return;
+        if (TryComp<AppearanceComponent>(uid, out var appearance)
+            && TryComp<PuddleComponent>(uid, out var puddle)
+            && TryComp<FootPrintsComponent>(args.OtherEntity, out var tripper)
+            && TryComp<SolutionContainerManagerComponent>(uid, out var solutionManager)
+            && _solutionContainer.ResolveSolution((uid, solutionManager), puddle.SolutionName, ref puddle.Solution, out var solutions))
+        {
+            // Method implementation
+        }

Likely invalid or redundant comment.

Content.Server/_White/FootPrint/FootPrintsSystem.cs (2)

1-40: LGTM: Dependencies and initialization are well structured

The system's dependencies and initialization are properly organized with clear separation of concerns.


55-55: ⚠️ Potential issue

Add parentheses to clarify operator precedence

The condition for the dragging variable would benefit from explicit parentheses to improve readability and prevent potential logic errors.

- var dragging = mobThreshHolds.CurrentThresholdState is MobState.Critical or MobState.Dead || _layingQuery.TryComp(uid, out var laying) && laying.IsCrawlingUnder;
+ var dragging = (mobThreshHolds.CurrentThresholdState is MobState.Critical or MobState.Dead) || (_layingQuery.TryComp(uid, out var laying) && laying.IsCrawlingUnder);

Likely invalid or redundant comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (1)
Content.Client/_White/FootPrint/FootPrintsVisualizerSystem.cs (1)

62-68: Add XML documentation for the override method.

Consider adding XML documentation to describe the purpose and behavior of the overridden method.

+/// <summary>
+/// Updates the footprint visualization when the appearance component changes.
+/// </summary>
+/// <param name="uid">The entity ID of the footprint.</param>
+/// <param name="component">The footprint component.</param>
+/// <param name="args">The appearance change event arguments.</param>
 protected override void OnAppearanceChange(EntityUid uid, FootPrintComponent component, ref AppearanceChangeEvent args)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 35c8796 and 90ebf3c.

📒 Files selected for processing (3)
  • Content.Client/_White/FootPrint/FootPrintsVisualizerSystem.cs (1 hunks)
  • Content.Server/_White/FootPrint/FootPrintsSystem.cs (1 hunks)
  • Content.Shared/_White/Footprint/FootPrintsComponent.cs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Content.Shared/_White/Footprint/FootPrintsComponent.cs
🔇 Additional comments (1)
Content.Client/_White/FootPrint/FootPrintsVisualizerSystem.cs (1)

49-56: Verify RSI states match the ported assets.

Since this is a port from another project, please ensure that all RSI state IDs referenced in the switch expression match the actual states in the ported asset files:

  • BareFootPrint states (RightBarePrint, LeftBarePrint)
  • ShoesPrint state
  • SuitPrint state
  • DraggingPrint states
✅ Verification successful

RSI states match the ported assets correctly

All state IDs referenced in the FootPrintsComponent match exactly with the states available in /Textures/_White/Effects/footprints.rsi:

  • Bare footprints: footprint-left-bare-human and footprint-right-bare-human
  • Shoes print: footprint-shoes
  • Suit print: footprint-suit
  • Dragging prints: dragging-1 through dragging-5
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all referenced RSI states exist in the asset files

# Find all RSI files that might contain footprint states
fd -e rsi -x rg -l "bare|shoe|suit|drag" {}

Length of output: 3019


Script:

#!/bin/bash
# Let's check the content of the footprints RSI metadata file we found
cat "./Resources/Textures/_White/Effects/footprints.rsi/meta.json"

Length of output: 1511


Script:

#!/bin/bash
# Let's check the FootPrintsComponent to see the actual state names being used
rg -A 10 "class FootPrintsComponent" Content.Client/_White/FootPrint/

Length of output: 71


Script:

#!/bin/bash
# Let's try to find the FootPrintsComponent definition anywhere in the codebase
rg -A 10 "class.*FootPrints.*Component"

Length of output: 2970


Script:

#!/bin/bash
# Let's check the rest of the FootPrintsComponent to see the other state definitions
rg -A 20 'public string RightBarePrint = "footprint-right-bare-human";' Content.Shared/_White/Footprint/FootPrintsComponent.cs

Length of output: 740

@@ -3,7 +3,7 @@
name: Urist McHands
parent: BaseMobHuman
id: MobHuman

Copy link
Collaborator

Choose a reason for hiding this comment

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

why

@Remuchi Remuchi merged commit 412f506 into master Oct 31, 2024
12 checks passed
@Remuchi Remuchi deleted the footprint branch October 31, 2024 03:03
VMSolidus added a commit to Simple-Station/Einstein-Engines that referenced this pull request Nov 9, 2024
# Description

This ports WWhiteDreamProject/wwdpublic#110 from
WWDP. This features significantly increases the interactions players
have with Blood puddles, but introducing a mechanic whereby if players
walk through puddles of blood, or attempt to drag a bloody corpse, they
leave behind bloodstains as evidence of their presence or actions. You
can avoid leaving marks from dragging corpses by using a rollerbed, and
you can avoid leaving bloody footprints by avoiding walking in blood.

This creates a great deal of emergent gameplay for all roles, but
especially Traitors, Security(DETECTIVES!) and Janitors(Who now have to
clean up bloody footprints!). Naturally, you can use syndicate soap to
clean up any evidence of your crimes.

# TODO

- [x] Code Cleanup and Namespaces

<details><summary><h1>Media</h1></summary>
<p>


![image](https://github.com/user-attachments/assets/a60b3af7-6881-4338-836f-32bf45df9f90)

</p>
</details>

# Changelog

:cl:
- add: Added Bloodstains, Body Dragging Marks, and Bloody Footprints to
the game. Characters that walk through puddles of blood will now leave
behind bloody footprints. Dragging a corpse leaves a trail of blood
wherever the corpse was moved.

---------

Co-authored-by: Spatison <[email protected]>
Spatison added a commit that referenced this pull request Nov 19, 2024
Spatison pushed a commit that referenced this pull request Nov 19, 2024
# Description

This ports #110 from
WWDP. This features significantly increases the interactions players
have with Blood puddles, but introducing a mechanic whereby if players
walk through puddles of blood, or attempt to drag a bloody corpse, they
leave behind bloodstains as evidence of their presence or actions. You
can avoid leaving marks from dragging corpses by using a rollerbed, and
you can avoid leaving bloody footprints by avoiding walking in blood.

This creates a great deal of emergent gameplay for all roles, but
especially Traitors, Security(DETECTIVES!) and Janitors(Who now have to
clean up bloody footprints!). Naturally, you can use syndicate soap to
clean up any evidence of your crimes.

# TODO

- [x] Code Cleanup and Namespaces

<details><summary><h1>Media</h1></summary>
<p>

![image](https://github.com/user-attachments/assets/a60b3af7-6881-4338-836f-32bf45df9f90)

</p>
</details>

# Changelog

:cl:
- add: Added Bloodstains, Body Dragging Marks, and Bloody Footprints to
the game. Characters that walk through puddles of blood will now leave
behind bloody footprints. Dragging a corpse leaves a trail of blood
wherever the corpse was moved.

---------

Co-authored-by: Spatison <[email protected]>

(cherry picked from commit 8faeaa7cc24a49b0ad8b25ea3b9d6da90bb48c55)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants