I’m trying the Greed challenge and already have a lot of fun with it.
I would like to test many variations of some algorithms, and for this having a local arena on my computer would be very useful. I found some documentation for setting up a development environment but I have a few questions:
can the arena be simulated without a browser? I guess there should be somewhere a server side simulation engine and not only a browser-based simulation process.
what are the minimal components I need to install ?
The arena is usually simulated on people’s browsers–we primarily crowdsource the simulations to properly scale simulation supply with demand. We do have a server-side simulator, but it’s sometimes buggy. You can try it, though. We’ll be working the bugs out of it next week. I am not sure why you’d need to use the headless simulator, though.
You should be able to follow the dev setup instructions (including restoring the database), create some accounts and submit their solutions to the leaderboards locally, and then run the simulator (from the ladder page’s Simulate tab) on your local instance.
Thank you for the link. It works without options but I can’t use it to simulate a game between two given oppents (see traceback below).
Cheers,
$ ./node_modules/coffee-script/bin/coffee headless_client.coffee one-game 537c0f3f0ff88b2c06287c2b 537be145a3b60b390500dcc3
Simulating 537c0f3f0ff88b2c06287c2b vs 537be145a3b60b390500dcc3
Error: ENOENT, no such file or directory '/home/adrien/codecombat_install/coco/node_modules/aether/node_modules/iota-compiler/one-game'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.readFileSync (fs.js:284:15)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/node_modules/aether/node_modules/iota-compiler/iota.js:26:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (/home/adrien/codecombat_install/coco/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/node_modules/aether/lib/languages/io.js:8:10)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/node_modules/aether/lib/languages/io.js:89:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (/home/adrien/codecombat_install/coco/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/node_modules/aether/lib/languages/languages.js:8:9)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/node_modules/aether/lib/languages/languages.js:11:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (/home/adrien/codecombat_install/coco/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/node_modules/aether/lib/aether.js:33:15)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/node_modules/aether/lib/aether.js:527:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (/home/adrien/codecombat_install/coco/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/headless_client/worker_world.coffee:7:26)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/headless_client/worker_world.coffee:5:1)
at Module._compile (module.js:456:26)
at Object.loadFile (/home/adrien/codecombat_install/coco/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
at Module.load (/home/adrien/codecombat_install/coco/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/headless_client.coffee:14:15)
at Object.<anonymous> (/home/adrien/codecombat_install/coco/headless_client.coffee:1:1)
at Module._compile (module.js:456:26)
iota.js is interfering when you run Aether from node.
As a workaround, go into node_modules/aether/node_modules/iota-compiler/iota.js and edit the conditional that’s like if (filename) to something like if (false) and things will work. I also am pushing a few changes to do with user code errors and correctness today.
Error: Cannot find module 'jason'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/manu/Desktop/CodeCombat/coco/headless_client/worker_world.coffee:5:9)
at Object.<anonymous> (/home/manu/Desktop/CodeCombat/coco/headless_client/worker_world.coffee:5:1)
at Module._compile (module.js:456:26)
at Object.loadFile (/home/manu/Desktop/CodeCombat/coco/node_modules/coffee-script/lib/coffee-script/register.js:16:19)
at Module.load (/home/manu/Desktop/CodeCombat/coco/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/manu/Desktop/CodeCombat/coco/headless_client.coffee:14:15)
at Object.<anonymous> (/home/manu/Desktop/CodeCombat/coco/headless_client.coffee:1:1)
at Module._compile (module.js:456:26)
I suppose It doens’t know where to find the libraries.
How would I go about fixing this?
Philipp@PHILIPP-PC /d/Projekte/CodeCombat/GitCode/codecombat (master)
$ npm install
npm WARN package.json karma-firefox-launcher@0.1.4 No README data
npm WARN package.json karma-phantomjs-launcher@0.1.4 No README data
npm WARN package.json passport-local@0.1.6 No README data
npm WARN package.json karma-chrome-launcher@0.1.7 No README data
Philipp@PHILIPP-PC /d/Projekte/CodeCombat/GitCode/codecombat (master)
$ bower install
Philipp@PHILIPP-PC /d/Projekte/CodeCombat/GitCode/codecombat (master)
$ coffee headless_client.coffee
Error: ENOENT, no such file or directory 'd:\Projekte\CodeCombat\GitCode\codecombat\public\javascripts\lodash.js'
at Object.fs.openSync (fs.js:438:18)
at Object.fs.readFileSync (fs.js:289:15)
at Object.<anonymous> (d:\Projekte\CodeCombat\GitCode\codecombat\headless_client\worker_world.coffee:193:28)
at Object.<anonymous> (d:\Projekte\CodeCombat\GitCode\codecombat\headless_client\worker_world.coffee:5:1)
at Module._compile (module.js:456:26)
at Object.loadFile (c:\Users\Philipp\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\register.js:16:19)
at Module.load (c:\Users\Philipp\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\register.js:45:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (d:\Projekte\CodeCombat\GitCode\codecombat\headless_client.coffee:14:15)
at Object.<anonymous> (d:\Projekte\CodeCombat\GitCode\codecombat\headless_client.coffee:1:1)
at Module._compile (module.js:456:26)
Philipp@PHILIPP-PC /d/Projekte/CodeCombat/GitCode/codecombat (master)
$