Hacker News new | ask | show | jobs
by DrHuman 2914 days ago
I actually wrote a toy app recently following the Fetlar rules as a React exercise:

https://htafl.herokuapp.com/

Not sure how it renders across machines but it looks ok on my Mac.

2 comments

If you could add a rooms feature and online game like http://tafl.herokuapp.com/ then I think you'd see some real use of that app.

The one I linked looks much worse than your board.

I would like to flesh it out at some point. Not sure how to go about doing the back end though. I'm currently taking a Node course so maybe after that I'll give it a shot.
Or release the source. I'm good at backend but only a hobbyist with node. Perhaps I could do something with your ready-made frontend code.
Yeah, I did the same (VanillaJS) a couple of years back, and started thinking about implementing a computer opponent, but it's really not clear what the evaluation function should be.
You need only codify the victory and loss conditions to build an AI using standard Reinforcement learning algorithms. Feel free to message me if you want more detail on how this would work. We should be able to hammer something out in less than a day.
Thanks for the pointer, but I'm afraid I have zero knowledge of ML and wouldn't be any help.

I have to say I'm a bit sceptical that this approach can work purely based on win/loss conditions - an attacker victory in particular can often take hundreds of moves in Tafl games.

Agreed. The only thing I could think to do would be look for pieces to capture in any given turn, but that would never get it to an end game condition. It's beyond my current capabilities to make a proper computer opponent, but it would be a good exercise.
> look for pieces to capture in any given turn

Not as a general rule. If you're playing as the attacker, you don't always want to take defender pieces even if they're "free" - they're more useful boxing their own king in.

Yea, it's not even a good strategy really. Just the only thing that I felt like I could code that would be a step up from just making a random legal move.