How do I make the Engine not Let Algos Time Out?

Basically, I thought that I would be really smart by just running all of the matches I wanted to run in parallel because letting them wait the three seconds one after another is really inefficient.
My plan was just to completely overload my CPU (which it already is by just running a few matches because it needs to start them all up individually) by running them all (as many as my memory allows) in parallel and then let the individual matches run as long as they need to.

For that I set "waitForever": true in game-configs.json in the "timingAndReplay": {} object, but the algos are timing out nonetheless.

Is it even possible to disable timeouts? Would I need to increase the other numbers in timingAndReplay to insanity?

What did not work

As I mentioned above: "waitForever": true

Also, I have no idea how far I should increase the time out numbers. I added an unhealthy amount of 0's to them, but time outs still occurred.


I feel like the engine.jar should have running multiple games built-in because that is a lot less resource intensive to run many matches that way, but maybe it is a challenge for us to write our own engine.

Allowing multiple matches built into the jar itself is something to consider adding thanks for the suggestion. It wouldn’t be too hard either, but would you want it to be different algos every time or the same 2 algos?

I find it strange waitForever didn’t work I’ll look into it when I have time. For now try changing the variables “waitTimeBotMax” and “waitTimeBotSoft” to really high numbers (they are in milliseconds).

@C1Junaid I obviously would want to be able to provide a list of algos that match against each other.
The point of it is that starting the engine.jar each time is resource intensive itself.

Because you said that really high numbers in waitTimeBotMax + waitTimeBotSoft and potentially waitForever should be working, although I tried it before, I tested both again, but I am still having the same issue:

Some matches print the following: timed out{algo_name}\nLast state:{data} (the line break is a real line break in the output)

An interesting observation here is that it prints to standard out, although I muted (did not direct the output to the standard out of my own program) the sub process.
This is very visible to me because my console is flooded when time outs happen, whereas I do not print otherwise.
I guess engine.jar prints that on a different channel than all the other output.

Because my CPU is overloaded, it could just be that e.g. the JVM is killing the sub processes and waitForever has no influence on that.

The ability to control what bots match up, etc would be really nice. Maybe something like where you can have a JSON config file where you specify which bots and who they would compete against.

I imagine this likely has something to do with it. When I was working on the shell script to run multiple games at once it became clear the resources required from the cpu screwed up times (in extreme cases crashing - tried 100 games simultaneously :slight_smile:). When I ran many games (20+) the first few games would work normally and run but all others after that would “crash” due to time errors, so only the first games actually worked. The cpu being overworked causes the algos to time out.

Ah thanks for the interesting experiences.

So some kind of json list of algo locations that then all get matched up inside the engine is what you want. Would it be better if you just list algos and it runs a match for every permutation of them (could waste time on matches you don’t care about), or if you put in the pairs of algos for the exact matches you want to run (more tedious to create the JSON).

I’ll try to work on that next week but can’t make any promises.

Also so the config time variables weren’t the issue it was out of memory problems?

1 Like

I always like having control over specific things, but in terms of general use I think permutations would be just fine and I can’t imagine many other uses than that anyway.

@C1Junaid has there been any work on running multiple games without initializing multiple engine.jar’s? I will be working with this very soon and speed improvements for running lots of games will be extremely important. It’s fine if the team is busy on other things, since I imagine this is a lower priority, but knowing C1’s plans will help me know how to dedicate my time when working on this speed issue.

Side Note: You mentioned here that there is 3 seconds on init and end of each game, is there a way to disable this time or is it necessary for the game to run?

The 3 second delay is going to be a configurable variable soon probably within a week.

But the multiple games with a single engine would be tough to do soon.

No problem, that helps a lot, thanks.