phosit
8b1e78ae1e
Use JS classes for the AI
...
Fixes : #6285
2026-07-23 15:15:59 +02:00
phosit
f35595610a
Sort entitycollections when adding entities
...
On joining clients entitycollections are always sorted. To stay in sync
non-joining clients also have to sort entitycollections.
2026-05-10 14:18:50 +02:00
phosit
0a2bd6a5a4
Use proper js-modules for ai common-api
...
The common-api already used a coding pattern which was called modules.
That is replaced with native js-modules.
Refs: #8081
2025-08-13 14:04:16 +02:00
Stan
dc04f3f432
Fix autofixable eslint warnings for eqeqeq
...
Ref: #7812
Pull Request: #8129
2025-06-26 11:03:19 +02:00
Ralph Sennhauser
a9987868c4
Fix eslint rule 'no-use-before-define'
...
Manual fixes needed for:
eslint --no-config-lookup --rule '"no-use-before-define": ["error", "nofunc"]
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-14 16:35:58 +02:00
Ralph Sennhauser
ac3f56fa9e
Fix eslint rule 'prefer-const' in ai/[a-f]*
...
eslint --no-config-lookup --fix --rule '"prefer-const": 1' \
binaries/data/mods/public/simulation/ai/common-api/class.js \
binaries/data/mods/public/simulation/ai/common-api/entity.js \
binaries/data/mods/public/simulation/ai/common-api/entitycollection.js \
binaries/data/mods/public/simulation/ai/common-api/filters.js
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-05-10 18:55:13 +02:00
Freagarach
9552a9720c
Add pushFront logic to the entity collection of the AI.
...
Not done in afd1eaee0d .
Also remove references to `queued` and `pushFront` in the `setStance`
functions, since they (currently) have no meaning.
Reported by: @bb
Differential revision: https://code.wildfiregames.com/D4261
Reviewed by: @bb
This was SVN commit r25902.
2021-09-08 06:05:22 +00:00
Freagarach
21e866fcf0
Technically seperate Turrets from GarrisonHolder.
...
While they often look alike, their behaviour is totally different.
This split has some implications:
- There are now separate auras for garrisoning and turrets.
- Entities can now have both turret points and garrison slots,
independent of eachother.
In general previous behaviour is maintained as much as possible.
Differential revision: D3150
Comments by: @Nescio, @wraitii
Tested by: @v32itas
This was SVN commit r25123.
2021-03-26 10:18:30 +00:00
bb
a9d1d16d5f
Allow garrison and attack to be queued order in entityCollection
...
Differential Revision: D2823
Reviewed By: Angen
This was SVN commit r23849.
2020-07-19 10:41:30 +00:00
mimo
4ded9cbec2
ai: cleanup of common-api following eslint
...
This was SVN commit r21447.
2018-03-06 18:34:33 +00:00
mimo
5df1f4ec4c
add allowCapture argument to moveAttack (and patrol) commands
...
Discussed with elexis
Differential Revision: https://code.wildfiregames.com/D1150
This was SVN commit r20665.
2017-12-19 19:24:48 +00:00
mimo
93b777b9fe
Use Array.from intead of the spread operator (that's more readable and more performant)
...
Patch by elexis
Reviewed and extended by mimo
Differential Revision: https://code.wildfiregames.com/D1135
This was SVN commit r20657.
2017-12-16 16:39:28 +00:00
mimo
4241cf441d
Petra: use moveToRange() instead of move() in some cases
...
Patch by Sandarac
Reviewed By: mimo
Differential Revision: https://code.wildfiregames.com/D676
This was SVN commit r19834.
2017-06-26 18:25:18 +00:00
mimo
3eea0df931
ai cleanup
...
This was SVN commit r18274.
2016-05-31 21:06:53 +00:00
mimo
9c9796d8ad
Changes in AI: Decrease a bit the required number of champions in attacks because of the recent increase of their cost,
...
Make more use of corrals when no fields and Cleanups
This was SVN commit r18216.
2016-05-21 17:06:25 +00:00
elexis
4b5f8dfca6
Remove trailing whitespace and simplify some length checks. Refs #252 .
...
This was SVN commit r18214.
2016-05-21 16:20:27 +00:00
mimo
b780073e24
petra cleanup
...
This was SVN commit r18105.
2016-04-28 17:14:07 +00:00
mimo
d7b62e0af7
cleanup of the ai api, with removal of some old stuff
...
This was SVN commit r17973.
2016-04-04 18:12:48 +00:00
mimo
dd7287c1c8
additionnal petra cleanup
...
fix a case with foundation access not defined
This was SVN commit r17688.
2016-01-22 19:46:51 +00:00
mimo
489822e384
some cleanup in the ai common-api
...
This was SVN commit r17437.
2015-12-11 18:35:01 +00:00
mimo
e42e02d4fe
bunch of cleanup (mainly missing semicolon) signaled by jshint
...
This was SVN commit r17044.
2015-09-19 12:41:21 +00:00
mimo
a286091470
mostly some cleanings of AI code + a petra fix when a player is defeated
...
This was SVN commit r16710.
2015-06-02 20:52:12 +00:00
mimo
802320e753
some petra cleanings
...
This was SVN commit r16094.
2014-12-31 09:59:47 +00:00
mimo
e435ef2704
several optimisations on the ai, refs #2370
...
This was SVN commit r16035.
2014-12-11 20:24:33 +00:00
mimo
21ecb22432
remove some now empty functions following previous patch
...
This was SVN commit r16032.
2014-12-09 20:30:27 +00:00
mimo
ae7c2f9586
ai: entitycollections switch to maps, see #2370
...
This was SVN commit r16030.
2014-12-09 19:55:37 +00:00
mimo
3e09cf4797
improve petra performances, see #2370
...
This was SVN commit r16027.
2014-12-07 16:36:56 +00:00
mimo
2f1d143dc2
give possibility to choose type of targets in moveAttack, fixes #2740
...
This was SVN commit r15671.
2014-08-24 11:51:03 +00:00
mimo
3596f1c341
modify AI common-api to allow fishing and minor fixes
...
This was SVN commit r15152.
2014-05-18 10:50:44 +00:00
sanderd17
ad36c0eb7b
Parse entity ids to numbers again
...
This was SVN commit r14916.
2014-04-11 12:35:50 +00:00
sanderd17
7840fd3049
fix capitalisation
...
This was SVN commit r14912.
2014-04-10 14:00:44 +00:00
sanderd17
7f77bb7cb0
Small improvements to entitycollection + add a serialization method (serialization is never executed though)
...
This was SVN commit r14911.
2014-04-10 09:51:43 +00:00
mimo
9f1bcc2475
fix AI error
...
This was SVN commit r14829.
2014-03-09 22:26:41 +00:00
mimo
c2c172271f
fix AI error, not reseting all units after a successful attack
...
This was SVN commit r14796.
2014-03-01 14:36:35 +00:00
wraitii
bd22432fe8
Rename common-api-v3 to common-api.
...
Fix warnings with the new AI.
Fix an error with the per-player gatherer counts.
This was SVN commit r14559.
2014-01-10 17:46:48 +00:00
wraitii
a6032ddd3f
Removes older AIs and APIs.
...
For the sake of it, we should have a minimal AI sometimes.
This was SVN commit r14553.
2014-01-10 01:48:09 +00:00
quantumstate
8383f35eb8
Added queued as an optional parameter so that AI's can set waypoints
...
This was SVN commit r10653.
2011-12-02 00:25:20 +00:00
Ykkrosh
16a4eb36dd
Various minor optimisations.
...
Enable SpiderMonkey method JIT in Release mode.
Add Engine.ProfileStart/Engine.ProfileStop functions for scripts.
Fix AI to clone initial entity data and shared metadata.
This was SVN commit r9003.
2011-03-03 00:16:14 +00:00
Ykkrosh
b8925fbbc9
# Support AI construction of buildings.
...
Pass terrain passability data to AI scripts.
Expand pathfinder passability data to 16 bits per tile, to allow more
classes.
Support 16-bit ints in serializer.
Partially support JS typed arrays.
Allow foundations to be placed on top of units (fixes #499 ).
Stop farms and fishes blocking movement (fixes #534 ).
Add obstruction flags to allow finer control over what they block.
Associate entity IDs with obstruction shapes, to allow finding colliding
entities.
Support moving to the edge of a target entity with inactive obstruction.
Support foundation entities in AI.
Support playing as non-hele civs.
This was SVN commit r8899.
2011-02-10 16:06:28 +00:00
Ykkrosh
57e5bb878a
Initial terrible AI player scripts.
...
This was SVN commit r8891.
2011-02-05 20:35:34 +00:00
Ykkrosh
f39f279132
Add AI script code to provide a cleaner API around the engine interface.
...
Handle AIProxy entirely through scripts.
Support structured clones of script values.
Improve performance.
Support multiple script contexts sharing a runtime.
Use a separate context per AI player.
This was SVN commit r8866.
2011-01-15 23:35:20 +00:00