<commit_before>/* A quick script to check the simulation performance of the game. */

const RG = require('./client/src/battles.js');
const RGObjects = require('./client/data/battles_objects.js');
const RGEffects = require('./client/data/effects.js');

const parser = new RG.ObjectShellParser();
parser.parseShellData(RGObjects);
parser.parseShellData(RGEffects);

const game = new RG.Game.Main();
const level = RG.FACT.createLevel('arena', 80, 28);

const conf = {
    maxDanger: 20,
    monstersPerLevel: 40,
    func: (actor) => (actor.danger < 100)
};

RG.FACT.addNRandMonsters(level, parser, conf);

game.addLevel(level);
game.addActiveLevel(level);

let frameCount = 0;
const startTime = new Date().getTime();

const numActorsBefore = level.getActors().length;

const nTurns = process.argv[2] || 10000;

for (let i = 0; i < nTurns; i++) {
    game.simulateGame();
    ++frameCount;
}
const numActorsAfter = level.getActors().length;
<commit_msg>Corrected require paths.<commit_after>/* A quick script to check the simulation performance of the game. */

const RG = require('../client/src/battles.js');
const RGObjects = require('../client/data/battles_objects.js');
const RGEffects = require('../client/data/effects.js');

const parser = new RG.ObjectShellParser();
parser.parseShellData(RGObjects);
parser.parseShellData(RGEffects);

const game = new RG.Game.Main();
const level = RG.FACT.createLevel('arena', 400, 400);

const conf = {
    maxDanger: 20,
    monstersPerLevel: 5000,
    func: (actor) => (actor.danger < 100)
};

RG.FACT.addNRandMonsters(level, parser, conf);

game.addLevel(level);
game.addActiveLevel(level);

let frameCount = 0;
const startTime = new Date().getTime();

const numActorsBefore = level.getActors().length;

const nTurns = process.argv[2] || 10000;

for (let i = 0; i < nTurns; i++) {
    game.simulateGame();
    ++frameCount;
}
const numActorsAfter = level.getActors().length;

{'fraction_non_alphanumeric': 0.1553701772679875, 'fraction_numerical': 0.021897810218978103, 'mean_word_length': 4.660766961651918, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6315649', 'n_tokens_mistral': 698, 'n_tokens_neox': 642, 'n_words': 156}