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 frontier station 14's sizeattribute system #965

Conversation

Mnemotechnician
Copy link
Contributor

About the PR

Frontier station has a sizeattribute system that allows certain species to change their size via two traits: small and tall.

This PR fully ports it, with some minor changes to adapt it for deltav.

Only 3 species are currently affected:

  • Catgirls can become tall, becoming on par with humans, although losing the ability to fit in bags. Other than that, this change is cosmetic-only.
  • Lizards can become tall, this is purely cosmetic
  • Vulps can become small, which makes them on par with felinids. They can fit in bags, they get a smaller collision fixture, they get smaller mass (so harder to push things around).

Why / Balance

This system, albeit being far from ideal, allows for some more additional character customization and should hopefully benefit roleplay. These changes should HOPEFULLY not have any noticable impact on the balance.

The tall trait is cosmetic-only for lizards and cats because it used to breed a lot of powergaming when it had effect on character's stats. Although mass contests are no longer a thing, it's still not a very good idea to give people a "make me stronger" button.

Technical details

First off, the code sucks a lot (it was written by a rather newbie coder). But it worked for months on frontier, and I'd rather not touch something that works already. A few adjustments were made, though.

  1. Every species that are supposed to be able to use the tall/small traits must have a SizeAttributeWhitelistComponent attached to them. The component specifies what changes are to be done to the character if they choose either of the two traits.
  2. Choosing one of the traits adds a SizeAttributeComponent to your character. The SizeAttributeSystem then checks if the whitelist allows it, and does the neccessary changes, which currently can include:
    • Scaling the character (either just cosmetically, or, if shortCosmeticOnly/tallCosmeticOnly are false, then also physically - their fixture is also scaled, affecting their mass)
    • Changing the density of the character's collision fixture, affecting their mass (if non-cosmetic)
    • Adding or removing the pseudoitem comp to/from the character

Also this includes a new interface for components - ITransferredByCloning. Here, it's only used to transfer the SizeAttributeComponent when the person is cloned (because, for some reason, without this cloning doesn't preserve these traits correctly, causing, for example, small vulps to come out of the cloning pod normal-sized). However, it can be added to any other component to make it carry over when the person with it is cloned. This introduces a couple new lines to upstream's cloning system.

Media

Github won't allow me to upload a 20 mb recording, so here's it uploaded to discord: https://cdn.discordapp.com/attachments/732665247302942730/1217934790528077925/weeee-2024-03-14_23.09.08.mp4?ex=6605d52a&is=65f3602a&hm=2b16795e3cae09aad16ec70a69742918a24efe5018822f207ec1a46db776ad12&

  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

None? I hope.

Changelog

🆑

  • add: Two new traits were added: "short" and "tall". Currently, only the Vulpkanin can become shorter, and only Felinids and Reptillians can become taller.

@github-actions github-actions bot added Status: Needs Review Changes: C# Changes any cs files Changes: YML Changes any yml files labels Mar 14, 2024
@noctyrnal
Copy link
Contributor

hope the other races get these traits in the future, would be cool

@Adrian16199
Copy link
Contributor

Im uncertain how it will be received when it comes to a vulpkanin being smaller like a felinid, a size change isnt only just mass contest but in combat aswel, smaller sprite always hides in bigger's sprite plus gaining the hiding in duffelbag due to the trait? hm.... like yeah, i guess there are small dogs irl that are just carried in bags but I suppose. Overall a cool feature but definitely needs to be looked at when it comes being smaller, being taller is definitely very cool. Sad that you would lose the funny duffelbag mechanic but oh well. At the least PR doesnt touch the main files almost at all.

@DangerRevolution
Copy link
Contributor

Im uncertain how it will be received when it comes to a vulpkanin being smaller like a felinid

Like what people would think or mechanically?

@Adrian16199
Copy link
Contributor

Im uncertain how it will be received when it comes to a vulpkanin being smaller like a felinid

Like what people would think or mechanically?

Both, well, maybe not both, i guess the first would just be: Oh a small doggo, pretty cool, OH CARRIABLE ONE ASWELL.
Mechanic wise:
Felinids are payin for duffelbag plus bein smaller with 15% more damage received from blunt category.
Vulps would get it for free pretty much with no minuses. Im skeptical regardin that specific change.

@Mnemotechnician
Copy link
Contributor Author

Both, well, maybe not both, i guess the first would just be: Oh a small doggo, pretty cool, OH CARRIABLE ONE ASWELL. Mechanic wise: Felinids are payin for duffelbag plus bein smaller with 15% more damage received from blunt category. Vulps would get it for free pretty much with no minuses. Im skeptical regardin that specific change.

I'd argue that being small is not that much of an advantage, but we certainly could add some debuff to counterweight it. Although if I have to add something, I might as well rewrite the system because the old code hurts my soul...

@Adrian16199
Copy link
Contributor

If there is room for improvement, go ahead, just keep the changes to main files as low as possible.
Regarding the debuff aspect, just a balance thing is nice to consider, who knows, maybe those few pixels could make vulps alot more robust/more threatening. Especially if they are gaining a duffelbag hiding aswell.
Probably not more damage received but soemthin else. Always time to think about it.

@OCOtheOmega
Copy link
Contributor

OCOtheOmega commented Mar 15, 2024

Check this out - Simple-Station/Parkstation-Friendly-Chainsaw#45
Yeeeah a real height system
You can control max and min height for all species and it's much more better than just have a two traits with scale.

@DangerRevolution
Copy link
Contributor

Check this out - Simple-Station/Parkstation-Friendly-Chainsaw#45 Yeeeah a real height system You can control max and min height for all species and it's much more better than just have a two traits with scale.

Pretty sure this isn't wanted due to sprite fucker-y

@OCOtheOmega
Copy link
Contributor

Check this out - Simple-Station/Parkstation-Friendly-Chainsaw#45 Yeeeah a real height system You can control max and min height for all species and it's much more better than just have a two traits with scale.

Pretty sure this isn't wanted due to sprite fucker-y

The solution in pr is not better, I played on frontier and I'll be honest it doesn't work properly, for small races nothing changes and big races become normal size and it's not visible in the customization menu. To be honest this is a crutch and not a game innovation that will diversify the game. In any case you should check for yourself how it works before making such assumptions.

@VMSolidus
Copy link
Contributor

Check this out - Simple-Station/Parkstation-Friendly-Chainsaw#45 Yeeeah a real height system You can control max and min height for all species and it's much more better than just have a two traits with scale.

Pretty sure this isn't wanted due to sprite fucker-y

The solution in pr is not better, I played on frontier and I'll be honest it doesn't work properly, for small races nothing changes and big races become normal size and it's not visible in the customization menu. To be honest this is a crutch and not a game innovation that will diversify the game. In any case you should check for yourself how it works before making such assumptions.

If we were unconcerned about the volume of wizden code being touched, I'd merge parkstation's implementation of the height sliders in a heartbeat(Albeit after testing to make sure I'm not crashing things). However since right now we are concerned about maintaining compatibility with upstream, the frontier's approach that touches a minimum of upstream code is more desireable. However I also see a problem in that the TransferedByCloning function is incompatible with metempsychosis. We do not have wizden's cloning system. Since upstream cloning is unmaintained and deprecated, I opted to radically alter it with the Metempsychosis rebase.


///Nyano - Summary: adds the potential psionic trait to the reanimated mob.
EnsureComp<PotentialPsionicComponent>(mob);

// Frontier - transfer of special components, e.g. small/big traits
Copy link
Contributor

Choose a reason for hiding this comment

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

I need you to move "Transfer of Special Components" down into the FetchAndSpawnMob function, and then split it into two different conditions. We don't actually have Wizden cloning, we instead have a hybrid system that handles both Cloning and Metempsychosis based on checking for a bool. By placing this function up here, you are essentially making it so that when someone is reincarnated into a new body by the Metem machine, it transfers their tallness/shortness from old body to new body. Which is a big problem if for example their old body was a small vulpkanin and the new body is an Oni.

This instead needs to be done only if the entity was cloned and not reincarnated. If they are instead reincarnated, an alternative behavior needs to be performed where it has a random chance of giving them the tallness/shortness(I would say at most 10% tall, 10% short, 80% normal).

short: true
shortscale: 0.8
shortDensity: 140
shortPseudoItem: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Felinid mains are going to be upset when they find out Smol dogs have their gimmick too LOL. If you're going to do this to Vulps, you might as well do this to Harpies too.


private void Scale(EntityUid uid, SizeAttributeComponent component, float scale, float density, bool cosmeticOnly)
{
if (scale <= 0f && density <= 0f)
Copy link
Contributor

Choose a reason for hiding this comment

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

It would probably be better to do
if (scale <= 0f | density <= 0f) return;
since && only returns if both scale and density aren't a natural number at the same time. Scale could be a negative number and density any natural number, and the function would continue as normal. Which would produce huge problems since we don't want to accidentally mirror people's character models in the case of a negative scale being put in somewhere. Keep in mind that the compiler doesn't actually know that having negative inputs for scale isn't acceptable, since it's technically possible and won't throw any errors.

Alternatively you could put in a check for if scale is a negative number, and then set it to *= -1 to get a natural number again.


private void OnComponentInit(EntityUid uid, SizeAttributeComponent component, ComponentInit args)
{
if (!TryComp<SizeAttributeWhitelistComponent>(uid, out var whitelist))
Copy link
Contributor

Choose a reason for hiding this comment

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

Since by introducing this system to Metempsychosis means having the possibility for entities to be handed a SizeAttribute after character creation, you now need to account for SizeAttribute being handed to an entity that potentially doesn't have SizeAttributeWhitelist. Since we're exiting out if a species isn't whitelisted for SizeAttribute, you might as well cleanup by RemComping the component if for whatever reason it was handed to a species lacking the whitelist. That will also be useful if for example someone hits AddComponent in VV without first doing so with SizeAttributeWhitelist.

@DebugOk
Copy link
Contributor

DebugOk commented Mar 15, 2024

We don't do suggestions on code that isn't ours. When these problems are addressed on Frontiers GitHub, this pr may be reopened.

@DebugOk DebugOk closed this Mar 15, 2024
@Mnemotechnician
Copy link
Contributor Author

Mnemotechnician commented Mar 15, 2024

We don't do suggestions on code that isn't ours. When these problems are addressed on Frontiers GitHub, this pr may be reopened.

May I ask you what you mean by that, and which exact problems? Balance, or what was requested above? And, is it possible for me to just rewrite this from scratch and make it deltav code instead? (and then pr back to frontier, getting it merged there will take weeks or months)

And yea sorry for not responding, I didn't have time today

@Adrian16199
Copy link
Contributor

It would be an issue to adress this issues on frontier if half of the issues appear only on our side due to us having a metem cloning while any other server does not have it, especialy frontier so it technicly would mean that you would need to rewrite it from scratch. Atleast thats how I interpretated it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: C# Changes any cs files Changes: YML Changes any yml files Status: Needs Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants