this post was submitted on 12 Feb 2024
4 points (75.0% liked)

General Programming Discussion

7803 readers
2 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 5 years ago
MODERATORS
 

I'm planning on creating an AI tournament as a project to test out some of the potential AI performance in a game, eg tic-tac-toe.

I'd like the AI to know the full history of a game instead of the instantaneous game-state because I might want some AI that use the historical data, eg AI that always put in the opposite cell of it's previous move if possible.

The question I am wondering is, what is the best way to setup the tournament.

I have a few options in my headspace:

  1. Write everything in Rust (since I also am semi-interested in getting experience with the language)
  2. Write everything in Python
  3. Write the AI's in anything I want, but interact using stdin/stdout. Connect the AI using some shell script.

There are a few nice things I want to have:

  1. able to run AI ad hoc against each other, or easily modify the tourney. ie I might want to add a new AI that runs against each of the previous AI instead of having the re-run the whole tourney
    • Rust would require a re-compile of the tourney code each time which may not be convenient
    • Options 2 and 3 would be much more convenient since it wouldn't require a full compilation and I can easily write a throwaway script
  2. be able to run it in a somewhat performant way since I might want to simulate many rounds
    • Rust AI would be fast, but to avoid the issue in (1), I might go with solution 3 with the underlying AI being in Rust. But I'm not sure how significant the speed of piping IO between programs compare to if I had wrote everything as a Python program

Any advice on this would be great, cause there might be some options that I might have omitted.

you are viewing a single comment's thread
view the rest of the comments
[–] xmunk@sh.itjust.works 4 points 9 months ago

I've always been of the opinion that language choice is supremely unimportant - but in this case you'd probably want to check for good libraries that may be available (so probably python).

However, I'd also point you towards the creator code bullet since they're always doing wacky AI shit and demonstrate the approachability of building such a system.