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

Move Draw-In to Lua #6566

Merged
merged 4 commits into from
Dec 28, 2024
Merged

Move Draw-In to Lua #6566

merged 4 commits into from
Dec 28, 2024

Conversation

cocosolos
Copy link
Contributor

@cocosolos cocosolos commented Dec 20, 2024

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

// TODO: can this be moved to scripts entirely?

Other implementations of draw-in rely heavily on mob mods and hard coded values. With the variety of types of draw ins, it should just be pulled out into the scripts. This provides a framework for creating one or multiple conditions to trigger draw in, draw-in position that can be set on the fly and not necessarily at the mobs position, and options to place the player somewhere around a point (center of hitbox, in front, behind, some specific spot(s) on the map, etc).

Ports AirSkyBoat#2031 arenaDrawIn function and expands it to handle basically all types of draw in. Gets rid of the mob mods and moves most functionality out of core into Lua. Some of the conditions need to be verified but work well enough for now (for example, Cassie may have boundaries at each door/hallway instead of a boundary around her spawn point). A draw_in mixin was made to provide an easy way to add basic draw in that triggers when the target is >2x melee range and draws in to center of mob. A mimic family mixin provides similar utility, drawing in to the front of the mob. For things that don't fit the mixins, it's easy enough to rig the functionality you need. I converted all existing draw-in to this system so there's plenty of different kinds of examples. We still check for a valid floor position, so I'm not sure if this is a big loss.

Here's a video showing some of the changes.

Steps to test these changes

16806227 Tiamat ID
17379783 Mimic

!gotoid
!mobhere

Spawn some stuff that draws in, try to escape.

Convert Old Format To Util
@cocosolos cocosolos force-pushed the drawin branch 2 times, most recently from f7d4b5e to e61289c Compare December 20, 2024 08:57
@Xaver-DaRed
Copy link
Contributor

Xaver-DaRed commented Dec 20, 2024

As a general comment, while I like what I see in general, it worries me all of it is done in onMobFight.

Unfortunately, we do not have something that ticks less times, like onMobAttackCheck, or something not prone to tick 3 times per second.

This has nothing to do with you or the PR. Just writing my thoughts.

@cocosolos
Copy link
Contributor Author

As a general comment, while I like what I see in general, it worries me all of it is done in onMobFight.

Unfortunately, we do not have something that ticks less times, like onMobAttackCheck, or something not prone to tick 3 times per second.

This has nothing to do with you or the PR. Just writing my thoughts.

True, and I think there's some added variability because things can delay the combat tick, like mobskills (I may be wrong, there's a lot going on). That being said, it's currently being handled in the Move function which is also called on the combat tick. The position based conditions will be cheap though, and the distance based ones can probably used distance squared to lighten them up a bit.

@TracentEden2
Copy link
Contributor

Please check this PR #6007 and take that into account. The PR is still pending as I was waiting for a reply from Zach after I replied to a comment of his. Thanks!

@cocosolos
Copy link
Contributor Author

Please check this PR #6007 and take that into account. The PR is still pending as I was waiting for a reply from Zach after I replied to a comment of his. Thanks!

Yeah I saw that and #6532 and they both go for relatively complicated approaches to modification that rely heavily on mob mods to do specific behavior and I think this is just a better approach. This provides a real framework that can be as extensible as needed without needing any additional mob mods or dealing with bitmasks. For example both of those implementations have a specific flag or mod just for drawing in to the front of the mob, when there's a huge variety or potential locations. Roc draws in to some area behind it, Naga Raja and probably the other DI wyrms draw in to 90 degrees at their side. Mobs like Tiamat draw in if you cross some boundary that's completely unrelated to the mobs position. That is all easy to deal with with this system and doesn't rely on any extra flags or whatever. There's no reason so much of the draw in code needs to be in the core.

@WinterSolstice8
Copy link
Member

Is this PR supposed to still be in draft?

@cocosolos
Copy link
Contributor Author

Is this PR supposed to still be in draft?

I have some coordinates I need to add for Hydra and Khimaira and want to rename utils.sameSide to utils.sameSideOfLine but otherwise I think this is all set. Should have that done some time today.

Expand arenaDrawIn to handle all draw-in functions.
Mixins created for mimics and "standard" draw-in that
triggers when out of melee range. Boundaries, ranges,
timing, etc aren't verified.
Checks if 2 points are on the same side of a line.
Improve Capricious Cassie arena definitions.
Define Cerberus arena and draw in positions.
Change getSpawnPos to return same type as getPos.
@cocosolos cocosolos marked this pull request as ready for review December 27, 2024 19:54
@zach2good zach2good merged commit e546062 into LandSandBoat:base Dec 28, 2024
13 checks passed
@cocosolos cocosolos deleted the drawin branch December 28, 2024 22:18
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.

6 participants