GITHUB_API_TOKEN=TOKEN ./scripts/make-release-trainer.sh RELEASE
./scripts/make-mq-cli.sh
Byte Arena CLI
Home Page: https://doc.bytearena.com
License: Other
Crash on protocol error during training, and not during competition
./ba train -tps 20 -no-browser -map training-dojo -agent t --debug
├ version: dev (unspecified)
└ Could not open file in archive
├ filename: lib/bytearenaviz.min.js
└ zip: not a valid zip file
./ba train --agent baagent --agent baagent --no-browser --tps 30 --port 8080 --agent baagent --agent baagent --agent baagent
├ version: dev (unspecified)
└ Assertion error
└ Failed to unmarshal incoming JSON in CommServer::Listen()
├ raw: [50 44 45 53 52 51 51 46 51 55 53 57 93 125 93 125 125 10 123 34 97 103 101 110 116 105 100 34 58 34 53 97 51 53 102 100 98 102 45 100 97 51 56 45 52 51 97 53 45 97 51 51 53 45 102 49 50 97 101 99 97 50 55 102 98 53 34 44 34 109 101 116 104 111 100 34 58 34 77 117 116 97 116 105 111 110 34 44 34 112 97 121 108 111 97 100 34 58 123 34 109 117 116 97 116 105 111 110 115 34 58 91 123 34 109 101 116 104 111 100 34 58 34 115 116 101 101 114 34 44 34 97 114 103 117 109 101]
├ string: "2,-5433.3759]}]}}
{"agentid":"5a35fdbf-da38-43a5-a335-f12aeca27fb5","method":"Mutation","payload":{"mutations":[{"method":"steer","argume"
└ invalid character ',' after top-level value
Agent should be informed of these lifecycle events as they happen:
ba train -map labyrinth --agent sven
├ version: dev-2018-01-05_08:29:41
└ Failed to send perception
├ agent: 0e91acc7-71f7-424f-b47a-d501c4d86471
└ write tcp4 192.168.1.55:36085->172.17.0.2:40152: write: broken pipe
The agent unexpectedly disconnected (because it crashed, see following log)
Agent log:
[agent] [sven:latest] undefined:1
[agent] [sven:latest] {"method":"perception","payload":{"score":0,"energy":0,"velocity":[0,1.25],"azimuth":0.6159502219252506,"vision":[{"tag":"obstacle","nearedge":[13.836839917699558,2.439808205234344],"center":[7.15276183843132,24.12687101970846],"faredge":[0.4686837591630814,45.81393383418258],"velocity":[0,0]},{"tag":"obstacle","nearedge":[0,2.152650407040147],"center":[0,15.52964688272233],"faredge":[0,28.906643358404516],"velocity":[0,0]},{"tag":"obstacle","nearedge":[0,28.906643358404516],"center":[0,38.12063086119268],"faredge":[0,47.33461836398085],"velocity":[0,0]},{"tag":"obstacle","nearedge":[-4.381310039920868e-13,47.33461836308098],"center":[-4.381310039920868e-13,47.33461836308098],"faredge":[-4.381310039920868e-13,47.33461836308098],"velocity":[0,0]},{"tag":"obstacle","nearedge":[NaN,NaN],"center":[NaN,NaN],"faredge":[NaN,NaN],"velocity":[0,0]},{"tag":"obstacle","nearedge":[0,47.33461836398085],"center":[0,62.43351807102066],"faredge":[0,77.53241777806046],"velocity":[0,0]},{"tag":"obstacle","nearedg
[agent] [sven:latest]
[agent] [sven:latest] SyntaxError: Unexpected token N in JSON at position 786
[agent] [sven:latest] at JSON.parse (<anonymous>)
[agent] [sven:latest] at Interface.onGameServerData (/usr/app/node_modules/bytearena-sdk-comm/lib/index.js:68:24)
[agent] [sven:latest] at emitOne (events.js:96:13)
[agent] [sven:latest] at Interface.emit (events.js:191:7)
[agent] [sven:latest] at Interface._onLine (readline.js:241:10)
[agent] [sven:latest] at Interface._normalWrite (readline.js:384:12)
[agent] [sven:latest] at Socket.ondata (readline.js:101:10)
[agent] [sven:latest] at emitOne (events.js:96:13)
[agent] [sven:latest] at Socket.emit (events.js:191:7)
[agent] [sven:latest] at readableAddChunk (_stream_readable.js:178:18)
The agent logged undefined
might be a hint here.
It would be nice to provide a CLI option to change the default ports since 8081
and 8080
are often already used.
I noticed that in some cases the vector pointing to an obstacle is negative (1/2 ticks).
You can use https://github.com/xtuc/baagent to reproduce this issue.
It seems that I already had to mitigate the issue some time ago: https://github.com/xtuc/baagent/blob/master/src/index.js#L50-L54
To improve UX we can add a few colors to the output in the console.
ba generate nodejs
├ version: v0.0.8
└ Failed to execute command
├ command: generate
└ exec: "git": executable file not found in $PATH
├ error:
While wget is more common that curl it seems to not be by default on mac os x.
To allow for agent sharing at the git level between players, it seems required to introduce some (optional) ba.json file containing metadata and placed at the root of the agent.
Typical Metadata:
Would be useful also in the website, as all agent setup could be achieved (and thus versionned) in the code.
Projectile range should be specified as distance, not as number of ticks like now (TTL), because it's a measurement of space, not time.
ba generate nodejs
├ version: v0.0.9
└ Failed to execute command
├ command: generate
└ ba build failed
└ Unknown flag: from
The steering limit is how much the agent velocity can change from one tick to the other.
Corresponds to the max length from the tip of the current velocity vector to the tip of the new velocity vector.
=> defines maximum acceleration between ticks, whatever it's direction (forward acceleration, braking, or turning).
=> also means that, depending on the limit value, one could not turn as fast as required when at full speed.
In the welcome method, some agent specs (Gear
and sub-props) are defined on title cased props, which shlould not be the case (lowercase only is the way to go);
{
"method":"welcome",
"payload":{
"maxspeed":1.25,
"maxsteeringforce":10000,
"maxangularvelocity":0.2617993877991494,
"visionradius":150,
"visionangle":2.792526803190927,
"bodyradius":0.5,
"maxshootenergy":1000,
"shootrecoveryrate":10,
"Gear":{
"gun":{
"Genre":"weapon",
"Kind":"gun",
"Specs":{
"shootcost":200,
"shootcooldown":3,
"projectilespeed":15,
"projectiledamage":400,
"projectilerange":1200
}
}
}
}
}
Would be nicer imho if our built-in generated agents were all under the BA org.
The issue observed in #45 is likely (to be confirmed) is that the items in the perception are not in a consistent order.
That prevents the ability the scan consistently the vision of the agent.
When using ba generate nodejs
, the agent name built is not the one mentionned in the Makefile.
I see 4 possibilities here:
ba build
in the makefile with a default of ba build
to use the current directory name as a docker tagIn this page: https://bytearena.com/doc/your-first-agent
section: Prerequisite
Add the page that contain how to get the CLI tool from https://bytearena.com/doc/the-bytearena-cli
Currently localhost is hardcoded.
Line 227 in 5fd2c47
When running ba t --port 3
I get the following output:
Please, specify at least one agent image using --agent
Usage of ba:
Usage is not displayed.
./ba train --agent xtuc/baagent
├ version: dev (unspecified)
└ Could not open archive
├ filename: /home/sven/.bytearena/maps/hexagon.zip
└ zip: not a valid zip file
Even after ba map update
Add a ba selfupgrade
command that updates the ba command with the latest release.
Bonus points: display the changelog between the two versions.
You need to emit a \n
to be able to show the logs of your agent in the console.
We should show the logs whenever the agent logs a character.
Agent should know the specs regarding its firepower:
It would be great if one could fetch and build a git url in one command.
Something like:
ba generate http://github.com/example/awesome-agent
Add a changelog with every API changes between CLI versions would be really nice instead of manually looking for changes in the doc and the js sdk.
Better readabilty of agent information on viz would be cool :
ba build .
├ version: v0.0.5
└ Failed to execute command
├ command: build
└ Docker build failed
└ Error response from daemon: invalid reference format
Probably gave an invalid directory to Docker.
The line
debug "Installation completed; the command 'ba' should now be available\n"
prints a literal '\n'.
This can be fixed by changing debug
from using echo $1
to echo -e $1
From the echo
man page:
-e enable interpretation of backslash escapes
Restrict the viz to 20 tps, otherwise use the file recorder
Restore recording feature
It would be nice if the BA trainer can export some port of the agent (if you have an http server used for debugging)
or if you want to make a remote controlled agent to train your "real agent"
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.