Turn Based Ai Help

Hi I’m Making A Turn Based Strategy Game And Was Wondering What That Best Way To Make An Ai Enemy Would Be.

I Thought Of Neural Networks But Those Are Extremely Complicated And Beyond My Current Capabilities.

If Anyone Has A Better Method Or A Good Implementation Of Neural Networks I’m All Ears.

Thanks For Your Time

-Your Pal William Boersma

You could start learning BrainJS, it’s a fantastic tool to implement neural networks for beginners. This course from the creator of the framework is fantastic - Neural Networks In JavaScript - Brain.js Tutorial | Scrimba. The framework is really simple to pick up, and you learn the basics of neural networks well enough to transfer your knowledge to more advanced frameworks later.

Hope this helps!

1 Like

Hey @DevilZ I’m A Complete Noob To This Would You Mind Walking Me Through The Basics?

I’d recommend learning the content in the course I’ve linked above. That course starts from the basics for beginners.

But it’s not Playcanvas I need a Playcanvas implementation but all I saw there was command console prompts

It’s a JS framework. Once you learn how to use it, you can simply add the CDN to the “External Scripts” section in your project settings and use it as you would any other JS library. You can also read this post - How do I use brain.js in PC without slowing the browser down massively? - #5 by DevilZ - I had some issues a few years back which were resolved.

ok thanks

1 Like

@DevilZ I got brain js into my project but can’t get it to do anything can I get some guidance here?

Have you followed the example project in the forum post I linked above? And if you’re unsure of how to use BrainJS, please use the course I linked to learn it first, before you actually try implementing anything.

yes

Then I’d suggest going through the course if you’re confused about the fundamentals of neural networks. Let me know if you have any queries on implementation post this and I’ll be happy to help.

I’ve Watched Through Half Of It But It Hasn’t Shown As Of Yet Me What I Need To Know Mainly Getting It To Train Against Me (I Want It To Be Rewarded For Damaging Me And Punished For Taking Damage)

The course will not teach you your EXACT application of course, but it will give you a good understanding of how to use the framework to build neural networks. After that, you’ll need to practise just as you have with PlayCanvas, and learn it better by building further examples. Once you have that background knowledge, you can apply it to your application.

@DevilZ Is It Even Possible To Get It To Train Against Me Live Similar To What Nintendo Did With Amiibo In Smash Bros Using Brain JS?

You’ll have to get your own training data for this. Neural networks aren’t a one step solution - you have to get training data, process it, build the model, train it, and only then you can actually use it.