Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

Universal deploy from any techno into any techno

Open FS-21 opened this issue 1 year ago • 3 comments

  • Now is possible to convert any infantry/unit/structure into any infantry/unit/structure.
  • No direct support for aircrafts but they can be converted through warheads or super weapons (see below).
  • Convert.UniversalDeploy specifies the TechnoType which is the result of conversion.
  • Convert.DeployingAnim specifies the deployment animation. If no animation is declared then the conversion will be instantaneous.
  • Convert.DeployToLand forces the deployer to land before starting the deployment process.
  • Convert.PreDeploy.AnimFX specifies an animation at the same time the conversion starts.
  • Convert.PostDeploy.AnimFX.FollowDeployer attach the animation to the deployer.
  • Convert.PostDeploy.AnimFX specifies an animation at the end of the conversion.
  • Convert.PostDeploy.AnimFX.FollowDeployer attach the animation to the deployed TechnoType.
  • Convert.PostDeploySound specifies the sound that will be played when the deployemnt ends.
  • Convert.DeployDir determines the initial facing of created TechnoType.
  • Convert.TransferPassengers transfers passengers into the deployed TechnoType. If the new TechnoType has no enough space will kick out all the remaining passengers.
  • Convert.TransferPassengers.IgnoreInvalidOccupiers if the deployed TechnoType is a structure all infantry passengers can be transfered ignoring the passenger's Occupier tag.
  • Convert.ForceVeterancyTransfer transfer the veterancy from the deployer to the deployed TechnoType ignoring the Trainable tag of the deployed TechnoType.
  • The use of Convert.UseUniversalDeploy=true in warheads or super weapons replaces the Ares techno deploy conversion logic by this logic. In this case it uses the Convert.From && Convert.To tags from the Ares logic.
  • Convert.UseUniversalDeploy=true skips lots of checks so in the case of deploying a structure into structure keep the same foundation size.
  • Don't combine with the undeploy "Structure into vehicle" logic (the Tiberian Sun deploy logic used here for MCV) or a desync will appear in online games.

In rulesmd.ini:

[SOMETECHNO]                                             ; TechnoType
Convert.UniversalDeploy=                                 ; TechnoType
Convert.DeployingAnim=                                   ; Animation
Convert.DeployToLand=false                               ; WeaponType
Convert.PreDeploy.AnimFX=                                ; Animation
Convert.PreDeploy.AnimFX.FollowDeployer=false            ; Boolean
Convert.PostDeploy.AnimFX=                               ; Animation
Convert.PostDeploy.AnimFX.FollowDeployer=false           ; Boolean
Convert.PostDeploySound=                                 ; Sound entry
Convert.DeployDir=-1                                     ; Integer, facings in range of 0-7
Convert.TransferPassengers=true                          ; Boolean
Convert.TransferPassengers.IgnoreInvalidOccupiers=false  ; Boolean
Convert.ForceVeterancyTransfer=false                     ; Boolean

[SOMEWARHEAD]                     ; Warhead
Convert.UseUniversalDeploy=false  ; Boolean

[SOMESW]                          ; Superweapon
Convert.UseUniversalDeploy=false  ; Boolean

Summary by CodeRabbit

  • New Features

    • Introduced a universal deployment feature allowing any unit, infantry, or structure to transform into any other type, enhancing gameplay flexibility.
    • Added animations, sound effects, and passenger transfer capabilities for the new universal deployment feature.
    • Weapons can now be fired during the warp-in and warp-out phases of deployment.
    • Implemented a visual indicator for deployable units when the cursor hovers over them.
  • Enhancements

    • Improved building animations with new hide and unhide functionalities.
    • Streamlined the serialization process for new deployment-related properties.
  • Documentation

    • Updated documentation to include details on the new universal deployment feature and its impact on game mechanics.

FS-21 avatar Feb 27 '24 22:02 FS-21

Walkthrough

This update introduces a groundbreaking feature allowing for universal deployment across different technos, enhancing flexibility and versatility within the game. It encompasses the ability to convert any infantry, unit, or structure into another, complete with animations, sound effects, and the handling of passengers and weapons during the conversion process. This feature is meticulously integrated into the game's codebase, touching on various aspects such as building animations, superweapon logic, and the handling of deployment animations and conditions.

Changes

Files Change Summary
CREDITS.md, docs/New-or-Enhanced-Logics.md, docs/Whats-New.md Documented the addition of universal deployment functionality.
Phobos.vcxproj, src/Ext/Techno/Body.UniversalDeploy.cpp, src/Ext/Techno/Hooks.UniversalDeploy.cpp Added new source files for handling universal deployment logic.
src/Ext/Building/Body.cpp, src/Ext/Building/Body.h Added functions to manage building animations visibility.
src/Ext/Building/Hooks.Grinding.cpp, src/Ext/Techno/Hooks.cpp Updated to show deploy icon and manage universal deployment updates.
src/Ext/SWType/Body.cpp, src/Ext/SWType/Body.h, src/Ext/SWType/FireSuperWeapon.cpp Enhanced superweapon logic to include universal deployment conditions.
src/Ext/Techno/Body.cpp, src/Ext/Techno/Body.h Updated to handle various aspects of universal deployment, including animations and property transfers.
src/Ext/TechnoType/Body.cpp, src/Ext/TechnoType/Body.h, src/Ext/WarheadType/Body.cpp, src/Ext/WarheadType/Body.h, src/Ext/WarheadType/Detonate.cpp Modified to read, serialize, and process new deployment properties.
src/New/Type/Affiliated/TypeConvertGroup.cpp, src/New/Type/Affiliated/TypeConvertGroup.h Added methods for performing universal conversions.

"In the realm of code, where the bits frolic and play,
A rabbit hopped in, with a feature so gay.
From techno to techno, it leaps without bound,
Transforming the old, as the new takes the ground.
With a twitch of its nose, and a flick of its ear,
The digital world, now more flexible, it's clear. 🐇✨"

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

coderabbitai[bot] avatar Feb 27 '24 22:02 coderabbitai[bot]

universaldeploy_test_01

FS-21 avatar Feb 27 '24 22:02 FS-21

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Feb 27 '24 22:02 github-actions[bot]

I'll close this PR for now until I fix the online desync I found.

FS-21 avatar Mar 24 '24 14:03 FS-21