Skip to content

Conversation

@sruon
Copy link
Contributor

@sruon sruon commented Dec 20, 2025

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?

Not for merging.

I started typing out a long essay on where this is going but I'll defer for a little later.

All you need to know is Targetfind needs to be slightly rewritten to eliminate hacks but before that can happen the way targeting is defined needs to evolve to clearly separate targets from AoE-affected entities.

Since targeting is a major part of these SQL rows, we may as well just pull in all the information and reduce the SQL to just ID/name - that is very much a stretch goal and doesn't need to happen at the same time as AoE definitions.

Proposal

Introduce various onXXSetup returning a """strongly typed""" table sharing 75% of their definition between all type of actions.

I have included examples representing most cases, there are very likely some edge cases I haven't addressed at this point in time.

Key benefits:

  • AoEs are defined in a way Tanaka would probably approve
  • We can make use of existing lua enum and not have to deal with SQL magic numbers
  • LLS should be able to statically validate action definitions, unlike SQL today.
  • Reviews should be simpler

Possible cons:

  • Functions returning tables to core are not that common in this codebase
  • Possibly longer initialization time
  • Lua completion in IDE is notoriously poor and may make defining these tables a hassle, though I doubt it can be worse than SQL

Alternatives:

  • Embrace YAML so core can load everything at once
    • The codebase is not ready for it but willing to make that happen first if we feel its best.
    • One added benefit of YAML is we could have very strong schema validation, something LLS cannot entirely do
  • Just keep going with SQL and rework the columns
    • Admittedly a lot less work

All of this is highly tentative - I can't really start working on targetfind itself until I know where I'm going with AoE definitions.

Steps to test these changes

UNBRIDLED_LEARNING = 0x04, -- Requires "Unbridled Learning" or "Unbridled Wisdom" for access
TABULA_RASA = 0x08, -- Requires "Tabula Rasa" for access
MAIN_JOB = 0x10, -- Only available if obtained from main job current level
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a "job point" requirement aswell?

@Skold177
Copy link
Contributor

Skold177 commented Dec 20, 2025

Seems like a thoughtfully designed proposal in my opinion. I have captured hundreds of hours of content in the past few months and it seems obvious to me that barring any server performance issues this should be the way foward. The game just quite literally does not handle target finding and AOEs in general the same way as LSB right now and this would be a huge step towards era accuracy. Not to mention the accessibility from a developer standpoint to implement the hundreds (thousands?) of commented out skill IDs in the SQL. Having a majority of the information centralized into the lua would go a long way in speeding up that process.

@Alphiez
Copy link
Contributor

Alphiez commented Dec 21, 2025

Hi all, I'm still getting use to the FFXI code and may not understand the full extent of how the code maps together so, I'm sharing my point of view.

From a testing standpoint, I personally find Lua a lot easier to work with, especially when iterating on TargetFind. Being able to make quick changes and test them without rebuilding every time makes a huge difference when you’re trying to understand why an AoE is hitting or not hitting something.

While debugging TargetFind, I ran into cases where findWithinArea was checking basically everything. It would walk through every conditional for every entity, sometimes more than once, and even check entities that weren’t actually part of the active battlefield but were still registered because they exist elsewhere. That made AoE debugging pretty noisy and hard to reason about.

Here’s an example of the kind of output I was seeing during testing:

TFDBG output (click to expand)
[TFDBG][findSingleTarget] ===== BEGIN TARGET CHECK =====
[TFDBG][caster=Promathia:16924673][zone=36] FLAGS findFlags=0x0 targetFlags=0x4
[TFDBG][caster=Promathia:16924673][zone=36] ACCEPT Prishe:16926720 obj=4
[TFDBG][findSingleTarget] ===== END TARGET CHECK =====

[TFDBG][findWithinArea] ===== BEGIN TARGET CHECK =====
[TFDBG][caster=Promathia:16924673][zone=36] FLAGS findFlags=0x0 targetFlags=0x4 radiusType=ATTACKER selfCentered=1 conal=0 radius=15.00
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia:16924673 reason=offensive_same_allegiance
[TFDBG][caster=Promathia:16924673][zone=36] ACCEPT Prishe:16926720 obj=4
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Selh'teus:16926721 reason=outside_radius
[TFDBG][caster=Promathia:16924673][zone=36] ACCEPT Alphiez:1 obj=1
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia_2:16924674 reason=offensive_same_allegiance
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia_2:16924675 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia_2:16924676 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia_2:16924677 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia_2:16924678 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Kamlanaut:16924679 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Eald'narche:16924680 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Kamlanaut:16924681 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Eald'narche:16924682 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Kamlanaut:16924683 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Eald'narche:16924684 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Metus:16924721 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Prishe:16926720 reason=already_added
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Selh'teus:16926721 reason=outside_radius
[TFDBG][findWithinArea] ===== END TARGET CHECK =====

[TFDBG][findSingleTarget] ===== BEGIN TARGET CHECK =====
[TFDBG][caster=Promathia:16924673][zone=36] FLAGS findFlags=0x0 targetFlags=0x4
[TFDBG][caster=Promathia:16924673][zone=36] ACCEPT Selh'teus:16926721 obj=4
[TFDBG][findSingleTarget] ===== END TARGET CHECK =====

[TFDBG][findWithinArea] ===== BEGIN TARGET CHECK =====
[TFDBG][caster=Promathia:16924673][zone=36] FLAGS findFlags=0x0 targetFlags=0x4 radiusType=ATTACKER selfCentered=1 conal=0 radius=30.00
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia:16924673 reason=offensive_same_allegiance
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Prishe:16926720 reason=dead
[TFDBG][caster=Promathia:16924673][zone=36] ACCEPT Selh'teus:16926721 obj=4
[TFDBG][caster=Promathia:16924673][zone=36] ACCEPT Alphiez:1 obj=1
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia:16924673 reason=offensive_same_allegiance
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia_2:16924674 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia_2:16924675 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia_2:16924676 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia_2:16924677 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Promathia_2:16924678 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Kamlanaut:16924679 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Eald'narche:16924680 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Kamlanaut:16924681 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Eald'narche:16924682 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Kamlanaut:16924683 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Eald'narche:16924684 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Metus:16924721 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Prishe:16926720 reason=dead
[TFDBG][REJECT][caster=Promathia:16924673][zone=36] target=Selh'teus:16926721 reason=already_added
[TFDBG][findWithinArea] ===== END TARGET CHECK =====

Having clearer and more explicit targeting and AoE definitions in Lua feels like it would make this stuff a lot easier to reason about and debug, and probably help cut down on special cases in TargetFind over time.

Also am happy to help where I can to move this forward.

@LandSandBoat LandSandBoat deleted a comment from github-actions bot Dec 21, 2025
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

This PR has been automatically marked as stale because
it has not had recent activity. It will be closed if no
further activity occurs.

@github-actions github-actions bot added the stale label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants