Skip to content

feat: Standardize SquadAuto#5523

Draft
mbergen wants to merge 33 commits intomainfrom
squadauto-rewrite
Draft

feat: Standardize SquadAuto#5523
mbergen wants to merge 33 commits intomainfrom
squadauto-rewrite

Conversation

@mbergen
Copy link
Collaborator

@mbergen mbergen commented Feb 28, 2025

Summary

Replace old, unmaintainable SquadAuto with a version that is hopefully a bit easier to maintain.

How did you test this change?

dev

@mbergen mbergen force-pushed the squadauto-rewrite branch from dc89f7c to c1f4fad Compare March 12, 2025 13:28
@mbergen mbergen changed the title WIP: SquadAuto rewrite feat: Standardize SquadAuto May 10, 2025
@mbergen mbergen requested review from Rathoz and hjpalpha May 10, 2025 11:41
@mbergen mbergen marked this pull request as ready for review May 10, 2025 11:42
@mbergen
Copy link
Collaborator Author

mbergen commented May 10, 2025

This is an initial version of a (potentially standardized) SquadAuto, without TimelineAuto.
It is not yet feature complete, but should already work on wikis using basic setups (see also various TODO comments).
The idea would be to let other wikis test this version, and add missing features only if necessary.

Once all wikis are on this version, there are also further simplifications possible (e.g. merging SquadAutoPerson and SquadPerson types)

Copy link
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

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

spaces --> tabs pls ;)

@Rathoz Rathoz requested a review from hjpalpha May 14, 2025 07:35
Copy link
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

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

probably oos, but long term we probably should use the model for the transfer queries

overall, seems reasonable on phone

@mbergen mbergen mentioned this pull request May 17, 2025
9 tasks
Copy link
Collaborator

@ElectricalBoy ElectricalBoy left a comment

Choose a reason for hiding this comment

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

some strings use " and others use '; we should use ' to stay consistent with the rest of Lua files

@Rathoz Rathoz marked this pull request as draft August 14, 2025 13:44
@mbergen mbergen marked this pull request as ready for review October 29, 2025 15:05
@mbergen
Copy link
Collaborator Author

mbergen commented Oct 29, 2025

Marking this as ready for review.
It does not use the new Role modules yet, but i'd argue it would only make sense to use them here once they are used in Transfers.

Idea is still to roll out wiki-by-wiki and fix (or implement) necessary things.

@Rathoz Rathoz self-requested a review October 29, 2025 16:08
@mbergen
Copy link
Collaborator Author

mbergen commented Oct 29, 2025

Test page with comparison new (left) vs old squadauto:
https://liquipedia.net/ageofempires/User:SyntacticSalt/ModuleTests

Comment on lines +474 to +481
Array.forEach(self.config.teams, function (templatename)
conditions:add{
Condition.Node(Condition.ColumnName('fromteamtemplate'), Comparator.eq, templatename),
Condition.Node(Condition.ColumnName('extradata_fromteamsectemplate'), Comparator.eq, templatename),
Condition.Node(Condition.ColumnName('toteamtemplate'), Comparator.eq, templatename),
Condition.Node(Condition.ColumnName('extradata_toteamsectemplate'), Comparator.eq, templatename)
}
end)
Copy link
Collaborator

Choose a reason for hiding this comment

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

use ConditionUtil.anyOf maybe?

Copy link
Collaborator Author

@mbergen mbergen Oct 30, 2025

Choose a reason for hiding this comment

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

In what way? It's not a list of values, but a list of columns.
Unless you mean to create an array of columns, and then use anyOf for the list of teams

Copy link
Collaborator Author

@mbergen mbergen Oct 30, 2025

Choose a reason for hiding this comment

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

Suggested change
Array.forEach(self.config.teams, function (templatename)
conditions:add{
Condition.Node(Condition.ColumnName('fromteamtemplate'), Comparator.eq, templatename),
Condition.Node(Condition.ColumnName('extradata_fromteamsectemplate'), Comparator.eq, templatename),
Condition.Node(Condition.ColumnName('toteamtemplate'), Comparator.eq, templatename),
Condition.Node(Condition.ColumnName('extradata_toteamsectemplate'), Comparator.eq, templatename)
}
end)
conditions:add{
Condition.Util.anyOf(Condition.ColumnName('fromteamtemplate'), self.config.teams),
Condition.Util.anyOf(Condition.ColumnName('extradata_fromteamsectemplate'), self.config.teams),
Condition.Util.anyOf(Condition.ColumnName('toteamtemplate'), self.config.teams),
Condition.Util.anyOf(Condition.ColumnName('extradata_toteamsectemplate'), self.config.teams),
}

like this?
I'd prefer the current way, as it is IMO easier to digest and also leads to a simpler rendered condition.

Comment on lines +647 to +649
Condition.Tree(BooleanOperator.any):add{
Condition.Node(Condition.ColumnName('date'), Comparator.gt, date),
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Condition.Tree(BooleanOperator.any):add{
Condition.Node(Condition.ColumnName('date'), Comparator.gt, date),
}
Condition.Node(Condition.ColumnName('date'), Comparator.gt, date),

maybe use Comparator.ge?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That wouldn't work (at least not on it's own) as you'd get the transfer of the person leaving, whereas we are interested in the next transfer of the person joining.
Would need to also check for lt objectid (if eq date) or something.

mbergen and others added 4 commits October 30, 2025 13:34
Co-authored-by: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com>
Copy link
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

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

on mobile, so could be easily wrong, but does this kick the Squad/rank stuff?
if yes we can expect the wikis that use it to cry if this goes live

@mbergen
Copy link
Collaborator Author

mbergen commented Oct 31, 2025

on mobile, so could be easily wrong, but does this kick the Squad/rank stuff?
if yes we can expect the wikis that use it to cry if this goes live

It's not supposed to kick it, just not implemented yet.

@mbergen mbergen marked this pull request as draft March 12, 2026 10:36
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