forked from harrischristiansen/generals-bot
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrun-bot.ps1
More file actions
1900 lines (1729 loc) · 57.4 KB
/
run-bot.ps1
File metadata and controls
1900 lines (1729 loc) · 57.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
function Run-BotOnce {
Param(
$name,
$game,
[switch]$public,
[switch]$right,
[switch]$privateGame,
$roomID = $null,
[switch]$noui,
$path = "$PSScriptRoot/BotHost.py",
$userID = $null,
[switch]$nolog,
[switch]$noTextLog,
[switch]$publicLobby
)
$ErrorActionPreference = 'Stop'
if (-not (Test-Path "$PSScriptRoot/../temp")) {
mkdir "$PSScriptRoot/../temp"
}
$blockBotFile = "$PSScriptRoot/../block_bot.txt"
if (-not (Test-Path $blockBotFile)) {
throw "Unable to find a block_bot.txt file one folder above this scripts folder at $blockBotFile. The file should contain either the string False or the string True."
}
$content = Get-Content -Path $blockBotFile -Raw
if ($content.Trim().ToLower() -eq 'true')
{
Write-Host "Bot blocked by $blockBotFile"
Start-Sleep -Seconds 15
return
}
$configFile = "$PSScriptRoot/../run_config.txt"
if (-not (Test-Path $configFile)) {
throw "Unable to find a run_config.txt file one folder above this scripts folder at $configFile. The file should contain multiple lines with:
log_folder=D:/GeneralsLogs
grouped_folder=D:/GeneralsLogs/GroupedLogs
left_pos=0
right_pos=1920
top_pos=0
bottom_pos=1080
where window positions are pixels relative to the top left corner of your primary monitor, and correspond to where the game UI will show up when the bot is run with a UI and some combination of the -right / -bottom flags provided (default is top left if no positional flags passed).
This allows you to have different bots running on different monitors, etc.
";
}
$logFolder = ""
$groupedFolder = ""
$cfgContent = Get-Content -Path $configFile
foreach ($line in $cfgContent) {
if ($line -like 'log_folder=*') {
$logFolder = ($line -split '=')[1].TrimEnd('/', '\')
}
if ($line -like 'grouped_folder=*') {
$groupedFolder = ($line -split '=')[1].TrimEnd('/', '\')
}
}
if ([string]::IsNullOrWhiteSpace($groupedFolder)) {
throw "run_config.txt file at $configFile is required to have a grouped_folder=<path> entry."
}
if ([string]::IsNullOrWhiteSpace($logFolder)) {
throw "run_config.txt file at $configFile is required to have a log_folder=<path> entry."
}
$df = Get-Date -format yyyy-MM-dd_hh-mm-ss
$arguments = [System.Collections.ArrayList]::new()
$roomName = ''
if ($privateGame) {
$game = "private"
if ($publicLobby) {
$game = "custom"
}
$roomName = "_$roomID"
}
if ($roomID) {
[void] $arguments.Add("-roomID")
[void] $arguments.Add($roomID)
}
if ($userID) {
[void] $arguments.Add("-userID")
[void] $arguments.Add($userID)
}
if ($right) { [void] $arguments.Add("--right") }
if ($noui) { [void] $arguments.Add("--no-ui") }
if ($nolog) { [void] $arguments.Add("--no-log") }
if ($noTextLog) { [void] $arguments.Add("--no-text-log") }
if ($public) {
[void] $arguments.Add("--public")
}
$arguments = $arguments.ToArray()
$argString = $([string]::Join(" ", $arguments))
Write-Verbose $argString -Verbose
$host.ui.RawUI.WindowTitle = "$game - $($name.Replace('[Bot]', '').Trim())"
$pythonVer = "python"
$pythonVer = "python3.14"
if ($path -notlike '*[/\]generals-bot[\/]*') {
$pythonVer = "python"
}
Write-Host "Python ver $pythonVer for path $path"
# this exeString is a hack due to the powershell memory leak, need to keep opening new PS processes
# or we fill up memory to 1GB per powershell window overnight :(
# Maybe fixed in PS 5.2? Wouldn't know because can't install on win8 lul
$exeString = @"
`$name = '$name'
`$game = '$game'
`$df = '$df'
`$privateGame = '$privateGame'
`$argString = '$argString'
`$path = '$path'
`$arguments = @('$([string]::Join("', '", $arguments))')
Write-Output "arguments $([string]::Join(', ', $arguments))"
`$cleanName = '$name'.Replace('[', '').Replace(']', '')
`$logName = "`$cleanName-$game-$df$roomName"
`$logFile = "`$logName.txt"
`$logPath = "$logFolder/`$logFile"
`$startProcSplat = @{}
if (-not `$$($nolog.ToString()))
{
#Start-Transcript -path "`$logPath"
`$startProcSplat['RedirectStandardError'] = "`$logPath"
}
try
{
#Write-Verbose `"$pythonVer $path -name $name -g $game $argString`" -verbose
#$pythonVer "$path" -name '$name' -g '$game' @arguments
`$procArguments = @("$path", '-name', '$name', '-g', '$game')
`$procArguments += `$arguments
`$Process = Start-Process -FilePath "$pythonVer.exe" -ArgumentList `$procArguments -PassThru -NoNewWindow @startProcSplat
`$Process.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::High
`$Process | Wait-Process 2>&1
}
catch
{
Write-Error `$_
}
finally
{
if (-not `$$($nolog.ToString()))
{
#stop-transcript
`$content = Get-Content `$logPath
`$prevLine = [string]::Empty
`$repId = `$null
if (-not `$content) {
Write-Warning "No content found in `$logPath"
}
`$newContent = foreach (`$line in `$content)
{
if (`$line -ne [string]::Empty)
{
`$prevLine = `$line
`$line
if (`$repId -eq `$null -and `$line -match 'replay_id:\[([^\]]+)\]')
{
`$repId = `$Matches[1]
}
}
elseif (`$prevLine -eq [string]::Empty)
{
`$line
`$prevLine = `"h`"
}
else
{
`$prevLine = [string]::Empty
}
}
if (`$repId -and (`$path -notlike '*historical*'))
{
`$filter = "*`$cleanName*`$repId*"
Write-Output "filter `$filter"
`$folder = Get-ChildItem "$logFolder" -Filter `$filter -Directory
`$newLogPath = Join-Path `$folder.FullName "_`$logFile"
`$newContent | Set-Content -Path `$newLogPath -Force
`$null = mkdir "$groupedFolder" -Force
`$newFolder = Move-Item `$folder.FullName "$groupedFolder" -PassThru
`$newName = "`$logName---`$repId"
Rename-Item `$newFolder.FullName `$newName -PassThru
Write-Warning "`$newName"
Write-Warning "`$newName"
Write-Warning "`$newName"
}
Remove-Item `$logPath -Force
}
}
Start-Sleep -Seconds 1
`$rand = Get-Random -Maximum 100
if (`$rand -eq 0) {
Get-ChildItem "$logFolder" |
? { `$_.FullName -notlike '*_chat*' } |
? { `$_.LastWriteTime -lt (get-date).AddMinutes(-120) } |
Remove-Item -Force -Recurse -ErrorAction Ignore
Get-ChildItem "$groupedFolder" -Directory |
? { `$_.FullName -notlike '*_chat*' } |
? { `$_.LastWriteTime -lt (get-date).AddMinutes(-120) } |
Remove-Item -Force -Recurse -ErrorAction Ignore
}
"@
$randNums = 1..10 | Get-Random -Count 10
$randName = $randNums -join ''
$ps1File = "$PSScriptRoot/../temp/$randName.ps1"
$exeString | Out-File $ps1File
Write-Verbose $ps1File -Verbose
if ($IsWindows) {
Start-Process Powershell "-File $ps1File" -Wait -NoNewWindow
} elseif ($IsLinux) {
Start-Process pwsh "-File $ps1File" -Wait -NoNewWindow
}
try {
Remove-Item $ps1File
}
catch {
# no op I guess
}
}
function Run-SoraAI {
Param(
$game = @('1v1', '1v1', 'ffa', 'ffa'),
[switch]$public,
[switch]$nolog,
[switch]$noTextLog,
[int]$sleepMax = 3
)
while ($true)
{
$userId = 'EKSORA'
if ($public)
{
$userId = 'SmurfySmurfette'
}
foreach ($g in $game)
{
run-botonce -game $g -name "Sora AI" -userID $userId -path "D:/2019_reformat_Backup/Sora_AI/run_bot.py" -public:$public -nolog:$nolog -noTextLog:$noTextLog
SleepLeastOfTwo -sleepMax $sleepMax
}
}
}
function Run-SoraAlt {
Param(
$game = @('1v1', '1v1'),
[switch]$public,
[switch]$nolog,
[switch]$noTextLog,
[int]$sleepMax = 3
)
while ($true)
{
$userId = 'soraAlt1Abc'
$name = "asdfjk;l :D:D"
$time = (Get-Date).TimeOfDay;
if ($time -lt ([timespan]'06:00:00')) {
$userId = 'soraAlt2Abc'
$name = "oaisdnvzsxdfg98"
} elseif ($time -lt ([timespan]'12:00:00')) {
$userId = 'soraAlt3Abc'
$name = "ShowerPower"
} elseif ($time -lt ([timespan]'18:00:00')) {
$userId = 'soraAlt4Abc'
$name = "wsedxbvtioun"
}
# $userId = 'soraAlt1Abc'
# $name = "asdfjk;l :D:D"
# $userId = 'soraAlt2Abc'
# $name = "oaisdnvzsxdfg98"
# $userId = 'soraAlt3Abc'
# $name = "ShowerPower"
# $userId = 'soraAlt4Abc'
# $name = "wsedxbvtioun"
foreach ($g in $game)
{
run-botonce -game $g -name $name -userID $userId -path "D:/2019_reformat_Backup/Sora_AI/run_bot.py" -public:$public -nolog:$nolog -noTextLog:$noTextLog
SleepLeastOfTwo -sleepMax $sleepMax
}
}
}
function Run-SoraAITeammate {
Param(
)
while ($true)
{
run-botonce -game 'team' -name "Sora_ai_2" -userID "EKSORA2" -path "D:/2019_reformat_Backup/Sora_AI/run_bot.py" -nolog -public:$public
}
}
function Start-WindowsTerminalAltBots {
Param(
)
$windowName = 'AltBots'
# starts a windows terminal that runs the FFA bots and a second instance of Sora AI that joins 1v1s
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-Blob -game ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
# time for the terminal window to open
start-sleep -seconds 3
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-Path -game ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-Path -game 1v1, ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-Blob -game 1v1, ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-SoraAI -game ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-SoraAI -game 1v1,ffa,1v1'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
}
# starts a windows terminal that runs many historical versions of EklipZ_ai
function Start-WindowsTerminalHistoricalBots {
Param(
)
$windowName = 'HistBots'
<#
original timings and bugs from 2019, with connection code fixed
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa, 1v1, 1v1, 1v1 -name "EklipZ_ai_14" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-07-24/bot_ek0x45.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
# time for the terminal window to open
start-sleep -seconds 3
<#
more frequent 100 cycle timings, no quick-expand at all
all in based on enemy took city too aggressively,
prioritize enemy tiles in path again,
explore undiscovered starting turn 50 instead of 100
de-prioritize fog undiscovered upon discovering nearby neutrals.
Increase army emergence fog distance to 10 from 6, first 3 tiles into undiscovered get same rating
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa, 1v1, 1v1, ffa -name "EklipZ_ai_13" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-07-29/bot_ek0x45.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
Hopefully defense off-by-one threat detection fixed
Additional panic gather defense added, defense now negatives all tiles in shortest path on attack path
undiscovered priority improvements
AGGRESSIVELY take cities while cramped. Cramped detection takes into account the distance to enemy territory
gather to enemy tiles inside territory more aggressively
play turns 25-50 more aggressively (too aggressively?)
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa, 1v1, ffa, 1v1 -name "EklipZ_ai_12" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-07-31/bot_ek0x45.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
improved 'vision tile' kill gathers to only gather for the quickexpand turns, and are included in the main gather phase with a 2
tile exclusion radius around them to prioritize killing them over gather path gather movement if adequate tile counts are near them.
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa, 1v1, ffa, 1v1 -name "EklipZ_ai_11" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-08-04/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
semi-optimal first 25, unit tests
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa, 1v1, ffa -name "EklipZ_ai_10" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-08-07/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
tweaked gathers taking neutral / enemy tiles to include extra gather moves.
tweaked initial expansion.
tweaked optimal_expansion to include move-half when appropriate and draw the boundaries for when move-half is limited to closer-only moves and when it is limited to flankpath-or-closer-only moves.
reduced neutral city aggressiveness right before launch timings.
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa, 1v1, ffa -name "EklipZ_ai_09" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-08-08/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
more optimal first 25
defense gathers...?
improved economy defense to make sure that it doesn't leave its king undefended while switching to hunt mode
tons of code refactors
much better map data in map state log
map data loader
first get_optimal_expansion unit test +
bugfixed early expansion not using 2's
Army Engine, brute force, all known bugs fixed except repetition being undervalued vs end board state.
Bugfixed tons of fog army issues
Bugfixed tile delta issues
iterative gather pruning (still sometimes gathers stupid small bits at end for some reason...?)
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa, ffa, 1v1, ffa -name "EklipZ_ai_08" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-08-26/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
loads of fog / engine bugfixes but still not MCTS working.
Tweaked attack timings.
Better defense.
Brute force army engine time cutoff.
Dropped file logging.
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa, ffa, 1v1, ffa, 1v1 -name "EklipZ_ai_07" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-09-15/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
MCTS based army engine.
2v2
fog / movement detection rework
way too much stuff to list
broken 1v1 in some ways due to 2v2 changes
defense gather forward instead of back
found-no-move mcts (need to tune back for historical bots I think)
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa, ffa, 1v1, ffa, 1v1 -name "EklipZ_ai_06" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-10-23/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
}
# starts a windows terminal that runs many historical versions of EklipZ_ai
function Start-WindowsTerminalBigFfaBots {
Param(
)
$windowName = 'BigFFA'
<#
original timings and bugs from 2019, with connection code fixed
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_14" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-07-24/bot_ek0x45.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
# time for the terminal window to open
start-sleep -seconds 3
<#
more frequent 100 cycle timings, no quick-expand at all
all in based on enemy took city too aggressively,
prioritize enemy tiles in path again,
explore undiscovered starting turn 50 instead of 100
de-prioritize fog undiscovered upon discovering nearby neutrals.
Increase army emergence fog distance to 10 from 6, first 3 tiles into undiscovered get same rating
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_13" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-07-29/bot_ek0x45.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
Hopefully defense off-by-one threat detection fixed
Additional panic gather defense added, defense now negatives all tiles in shortest path on attack path
undiscovered priority improvements
AGGRESSIVELY take cities while cramped. Cramped detection takes into account the distance to enemy territory
gather to enemy tiles inside territory more aggressively
play turns 25-50 more aggressively (too aggressively?)
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_12" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-07-31/bot_ek0x45.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
improved 'vision tile' kill gathers to only gather for the quickexpand turns, and are included in the main gather phase with a 2
tile exclusion radius around them to prioritize killing them over gather path gather movement if adequate tile counts are near them.
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_11" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-08-04/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
semi-optimal first 25, unit tests
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_10" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-08-07/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
tweaked gathers taking neutral / enemy tiles to include extra gather moves.
tweaked initial expansion.
tweaked optimal_expansion to include move-half when appropriate and draw the boundaries for when move-half is limited to closer-only moves and when it is limited to flankpath-or-closer-only moves.
reduced neutral city aggressiveness right before launch timings.
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_09" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-08-08/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
more optimal first 25
defense gathers...?
improved economy defense to make sure that it doesn't leave its king undefended while switching to hunt mode
tons of code refactors
much better map data in map state log
map data loader
first get_optimal_expansion unit test +
bugfixed early expansion not using 2's
Army Engine, brute force, all known bugs fixed except repetition being undervalued vs end board state.
Bugfixed tons of fog army issues
Bugfixed tile delta issues
iterative gather pruning (still sometimes gathers stupid small bits at end for some reason...?)
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_08" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-08-26/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
loads of fog / engine bugfixes but still not MCTS working.
Tweaked attack timings.
Better defense.
Brute force army engine time cutoff.
Dropped file logging.
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_07" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-09-15/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
MCTS based army engine.
2v2
fog / movement detection rework
way too much stuff to list
broken 1v1 in some ways due to 2v2 changes
defense gather forward instead of back
found-no-move mcts (need to tune back for historical bots I think)
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_06" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-10-23/BotHost.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
ffa only 2
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_i2" -right -noui -nolog'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
ffa only 3
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_i3" -right -noui -nolog'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
ffa only 4
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_i4" -right -noui -nolog'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
ffa only 2
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:\2019_reformat_Backup\generals-bot\";
. .\run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_i2" -right -noui -nolog'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
ffa only 3
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:\2019_reformat_Backup\generals-bot\";
. .\run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_i3" -right -noui -nolog'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
ffa only 4
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:\2019_reformat_Backup\generals-bot\";
. .\run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai_i4" -right -noui -nolog'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
ffa only
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game ffa -name "EklipZ_ai" -right -nolog'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-Blob -game ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-Blob -game ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-Path -game ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-Path -game ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-SoraAI -game ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'Run-SoraAI -game ffa'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
}
# starts a windows terminal that runs many bots in the big team queue
function Start-WindowsTerminalBigTeamBots {
Param(
)
$windowName = 'BigTeam'
<#
original timings and bugs from 2019, with connection code fixed
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game bigteam -name "EklipZ_ai_14" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-07-24/bot_ek0x45.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
# time for the terminal window to open
start-sleep -seconds 3
<#
more frequent 100 cycle timings, no quick-expand at all
all in based on enemy took city too aggressively,
prioritize enemy tiles in path again,
explore undiscovered starting turn 50 instead of 100
de-prioritize fog undiscovered upon discovering nearby neutrals.
Increase army emergence fog distance to 10 from 6, first 3 tiles into undiscovered get same rating
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game bigteam -name "EklipZ_ai_13" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-07-29/bot_ek0x45.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
Hopefully defense off-by-one threat detection fixed
Additional panic gather defense added, defense now negatives all tiles in shortest path on attack path
undiscovered priority improvements
AGGRESSIVELY take cities while cramped. Cramped detection takes into account the distance to enemy territory
gather to enemy tiles inside territory more aggressively
play turns 25-50 more aggressively (too aggressively?)
#>
wt -w $windowName new-tab pwsh -NoExit -c {
cd "D:/2019_reformat_Backup/generals-bot/";
. ./run-bot.ps1;
$command = 'run-bot -game bigteam -name "EklipZ_ai_12" -noui -nolog -path D:/2019_reformat_Backup/generals-bot-historical/generals-bot-2023-07-31/bot_ek0x45.py'
try {
Invoke-Expression $command
} finally {
Write-Host $command
Start-Sleep -Seconds 1
}
}
<#
improved 'vision tile' kill gathers to only gather for the quickexpand turns, and are included in the main gather phase with a 2
tile exclusion radius around them to prioritize killing them over gather path gather movement if adequate tile counts are near them.
#>
wt -w $windowName new-tab pwsh -NoExit -c {