Skip to content

Add actor attribute service - #2610

Open
Fantaselion wants to merge 4 commits into
TwilitRealm:mainfrom
Fantaselion:actor-attribute-service-pr
Open

Fantaselion wants to merge 4 commits into
TwilitRealm:mainfrom
Fantaselion:actor-attribute-service-pr

Conversation

@Fantaselion

@Fantaselion Fantaselion commented Sep 25, 2026 •

Copy link
Copy Markdown

This new service adds an ability for anyone to modify several different attributes of an enemy

• Movement Speed
• Size
• Health
• Attack Damage
• Gravity
• Notice Range
• Player Knockback
• Stun Duration - this makes enemies impossible to hit at times so best to be carefull with this one.

All the user needs is the fopAc_ac_c pointer.

I made this for my enemy attribute randomizer mod - https://github.com/Fantaselion/enemy-attribute-randomizer since I couldn't figure out any good way (that was reasonable) to have this entirely mod-sided. besides this makes it so that other people can use it!

This has been in the works for about 6 weeks and its all I've been doing all day, extensively tested it and verified every change in game, the reason the code changes are so long is I had to go to basically every part where enemy attributes are consumed (since I didn't want to effect other instance of the same type of actor in the room/cause it to scale an attribute every frame) and put it through my helpers. This got very complicated because movement speed is consumed through many different actor-specific code paths.

For testing, I've played through the game multiple times using big combinations such as 25% enemy size with 400% movement speed and the reverse, 400% size with 25% movement speed. I have also individually tested the other attributes and the actor-specific fixes that were required by those values.

In my mod I have gravity match movement speed since that just looks better.

The knockback Attribute was done with me modifying d_a_alink files and its damage, swim, and wolf includes so it works with each enemy. it says what it does on the tin, link gets pushed that much farther back horizontally based on the attribute. I tested it at 100x and it works just fine (actually was surprised it didn't clip me through walls)

AI disclosure: I used ChatGPT only as a tool during this project, mainly when i was working through some repetitive integrations and math-heavy helper code. I always reviewed and tested any code it gave me. If I didn't understand the code it gave me I didn't use it until I did and agreed with it.

I also did additional cleanup and comparison passes before preparing this PR including making sure all my code have TARGET_PC guards and then checking the final diff against upstream.

there are certain enemies and bosses that required unusaly changes such as having links grab animation match the speed of the enemy so it works properly, having the spinner go faster if the 2nd phase of stalord is going faster, making the hookshot fire faster if morpheal is faster etc... I will admit some of these were creative decisions as the alternative at times was just to clamp the max speed of these bosses.

𝐔𝐩𝐝𝐚𝐭𝐞: I've split the original implementation into smaller PRs for review. This PR now contains only the core Actor Attribute Service, public API, registry integration, and shared helpers. I will PR the other Actor/player integrations seperatly.

@GiorgioMendieta

Copy link
Copy Markdown
Contributor

I think it would be best if you broke down this PR in multiple, smaller chunks. It's over 60k lines of code so it's practically impossible to review imo

@Fantaselion

Copy link
Copy Markdown
Author

I think it would be best if you broke down this PR in multiple, smaller chunks. It's over 60k lines of code so it's practically impossible to review imo

Ahhh good idea. the though never crossed my mind honestly lol.

@Fantaselion
Fantaselion force-pushed the actor-attribute-service-pr branch from f5ca77a to 3c0e86f Compare September 25, 2026 12:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants