Page 1 of 1

dumb.js: a simple PSO based AI that stronger than bonecrusher

Posted: 02 Dec 2023, 04:44
by wanjia1
It a AI based on PSO algorithm,and it can defeat any insane AI in 15 minutes,only in NTW T1 Fullbase.
It can also defeat 3 insane nullbot or 5 insane nexus in NTW maps.
It only have 255 lines of code.

It have no explicit tactic code,but simply cluster droids when attacked.
It have no memory.everything has to be calculated every step.
Its droid templates is hard-coded, it use cannons exclusive, and don't build factories or AAs.

Re: dumb.js: a simple PSO based AI that stronger than bonecrusher

Posted: 02 Dec 2023, 04:49
by wanjia1
license:CC0
screenshot (AI attached player vs insane bonecrusher):

Re: dumb.js: a simple PSO based AI that stronger than bonecrusher

Posted: 02 Dec 2023, 08:35
by wanjia1
bugfix:
now the AI can build defense structure,laser satellite and AAs.This make it competent for T4 games.
it can defeat any hard AI in 45 minutes,in any NTW Fullbase game.

Re: dumb.js: a simple PSO based AI that stronger than bonecrusher

Posted: 21 Dec 2023, 18:21
by wanjia1
bugfix:
now the AI can build VTOL and oil derricks. its performance in ntw Nobase | Lowbase 1v1 game is above hard bonecrusher and below hard cobra.
also,it will build modules for structures.
it still fails on low oil map (even weaker than nexus). because all truck will move to a structure that being built and unable to get oils.
there is 497 lines of code in total.

Re: dumb.js: a simple PSO based AI that stronger than bonecrusher

Posted: 10 Mar 2024, 19:38
by wanjia1
better verion, not completed:

dumb-flamer: a full flamer made from dumb. have 120 lines of code, used to test bots. only works in NTW 1v1, can beat Insane Cobra in T1.

dumb12: new version of dumb. Its ONLY WORKS IN RO-1v1(or SnowTiny) and MUST PLACED IN NORTH.
It can beat Insane RatBot 0.9, Cobra, Bonecrusher, and average human player, in 12 minutes in T1
- attack when have more than 75 units
- make AA defense when attacked by VTOL
- VTOLs will attack enemy

they were coded in rush and have many bug

version for Ng-RO1v1Spec, because Its waypoints is hard-coded, also must placed in north.
dumb12a.zip
(6.59 KiB) Downloaded 20 times
to avoid overwrite, make sure older version of dumb.zip have been removed

Re: dumb.js: a simple PSO based AI that stronger than bonecrusher

Posted: 17 Mar 2024, 12:23
by wanjia1
dumb10b.zip: a plasma cannon variant made from dumb10. can beat all previous dumb bot (except dumb12a) and cobra.

Re: dumb.js: a simple PSO based AI that stronger than bonecrusher

Posted: 17 Mar 2024, 13:37
by wanjia1
dumb10b rushed by dumb12a

Re: dumb.js: a simple PSO based AI that stronger than bonecrusher

Posted: 22 Mar 2024, 18:31
by wanjia1
Units now move in patrol mode, compare to dumb10,
it slight stronger against AIs, but weaker against humans.
still weaker than dumb12a, because it still can't cover retreating units.

Add chat commands:
say "w" to show all droids
say "r" to show `safeDest`
say "r1" to research Plasma Cannon and EMP cannon
say "r2" to research VTOL

also, split code into 9 files, which make it easier to read(?)

Re: dumb.js: a simple PSO based AI that stronger than bonecrusher

Posted: 28 Apr 2024, 11:09
by wanjia1
dumb20: dumb with memory
(removed recycle, AA and VTOL support, too complex and rarely used)

only works in T1, 1v1, >24 oils

It use schmitt trigger to control defence or attack.
Input variable:
Name Range Description
enemyDistance (24, 36) to repair centre
limitRatio (.5, .8) countDroid(DROID_ANY,me)/getDroidLimit(me)
repairRatio (.1, .5) ratio of droids that health<40
When enemyDistance<24 || (limitRatio>.8 && repairRatio<.1), it will attack enemy with most droids.

Better droid control:
health>80: rush into enemy
health<80 && health>40: hit and run
health<40: return to repair

It can rush all insane built-in AI in 12 minutes with K/D>8:
Time K/D
SemperFi 11 minutes 313/35
Cobra 10 minutes 357/26
Bonecrusher 8 minutes 212/13
Nullbot 7 minutes 133/0

It can beat previous dumb-bot(about 80% chance), usually with needle gun:
Time(average) Win
dumb5 32 minutes 6/7
dumb10 30 minutes 12/15
dumb12a 31 minutes 8/11

It weak against flamers:
Time(average) Win
dumb10-flamer 8 minutes 1/5

Against other bots:
Time K/D
Ratbot(Insane) 10 minutes 266/39