rubensolv / grojoa3n Goto Github PK
View Code? Open in Web Editor NEWBot for MicroRTS 2020 competition
Bot for MicroRTS 2020 competition
I'm running PPO-based trainings in MicroRTS-Py, in a work-in-progress branch where I'm trying to get the training and evaluation code there to work on mixes of different maps of different sizes. These trainings use a mix of different opponent AIs to train and evaluate against, of which guidedRojoA3N
is one. In one of my test runs just now, this bot ended up crashing.
Here is the stacktrace produced for the crash:
java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 1
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
at java.base/java.util.Objects.checkIndex(Objects.java:385)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
at ai.CMAB.GuidedA3NWithinMCTSNode.selectLeafUsingLocalMABs(GuidedA3NWithinMCTSNode.java:231)
at ai.CMAB.GuidedA3NWithinMCTSNode.selectLeaf(GuidedA3NWithinMCTSNode.java:154)
at ai.CMAB.GuidedA3NW.iteration(GuidedA3NW.java:343)
at ai.CMAB.GuidedA3NW.computeDuringOneGameFrame(GuidedA3NW.java:324)
at ai.CMAB.GuidedA3NW.getAction(GuidedA3NW.java:275)
at ai.competition.GRojoA3N.GuidedRojoA3N.getAction(GuidedRojoA3N.java:62)
at tests.JNIGridnetClient.gameStep(JNIGridnetClient.java:172)
at tests.JNIGridnetVecClient.gameStep(JNIGridnetVecClient.java:271)
Traceback (most recent call last):
File "JNIGridnetVecClient.java", line 271, in tests.JNIGridnetVecClient.gameStep
File "JNIGridnetClient.java", line 172, in tests.JNIGridnetClient.gameStep
File "GuidedRojoA3N.java", line 62, in ai.competition.GRojoA3N.GuidedRojoA3N.getAction
File "GuidedA3NW.java", line 275, in ai.CMAB.GuidedA3NW.getAction
File "GuidedA3NW.java", line 324, in ai.CMAB.GuidedA3NW.computeDuringOneGameFrame
File "GuidedA3NW.java", line 343, in ai.CMAB.GuidedA3NW.iteration
File "GuidedA3NWithinMCTSNode.java", line 154, in ai.CMAB.GuidedA3NWithinMCTSNode.selectLeaf
File "GuidedA3NWithinMCTSNode.java", line 231, in ai.CMAB.GuidedA3NWithinMCTSNode.selectLeafUsingLocalMABs
File "ArrayList.java", line 427, in java.util.ArrayList.get
File "Objects.java", line 385, in java.util.Objects.checkIndex
File "Preconditions.java", line 302, in jdk.internal.util.Preconditions.checkIndex
File "Preconditions.java", line 106, in jdk.internal.util.Preconditions.outOfBoundsCheckIndex
File "Preconditions.java", line 100, in jdk.internal.util.Preconditions.outOfBounds
Exception: Java Exception
So, it looks like int code = unitActionTable.get(j).actions.indexOf(gua);
in line 229 of GuidedA3NWithinMCTSNode.java
ends up with code = -1
, and then in line 231 this produces a crash.
Right now, I don't really have much other info. I was training/evaluating on a whole bunch of different maps, and the stacktrace doesn't tell me which map was being used during this particular crash. I did include some "strange" maps though, like maps/EightBasesWorkers16x12.xml
(which, judging from the name, I assume includes many many more bases than most maps), and maps/melee14x12Mixed18.xml
(which, I assume is a combat-units-only map, though I didn't check).
If you need this info, I can try to get it, but I'm not sure yet how long it'll take till I can reproduce this crash again (with modified code to catch such exceptions and print the map being used). If you can think of any other info that might also be useful to collect, please let me know.
I also didn't really dive into the details of how your AI works. I have no idea whether a code
of -1
in this place is indicative of there being some other bug somewhere earlier on, or if this is actually a perfectly reasonable case and you simply have to add some code after it to deal with it. Hopefully you might know though :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.