The Student Room Group

A Level NEA - AI Chess

For my A level NEA, I have decided to go all out and have a crack at a chess AI.

So I'm not planning for my AI to be anything special, in fact just something that demonstrates how AI might work on a basic level. I would like to program it in a way that it analyses certain trades and moves at 1 depth based on material gain/loss or percentage win rate for that position based on games it has played in the past. So it will simulate and play games against itself until it builds up a winrate for a vast number of positions which it can then store in a database somehow.

This doesn't even mention the work that I will have to spend on board and piece representation, making the game actually work without bugs and figuring out how to conceptualise different ideas so that the computer can actually understand how the game works.

Also, if it would be possible, python is something I want my game to be mostly programmed in.

For someone who considers themselves an amateur at programming in general, too ambitious?

Also, should I try to apply some neural networks wizardry or is that something that would be wayyy out of my depth?

I'm going to guess yes but these things can be simplified and I am willing to put in a lot of time for this project. It's not just about the NEA, it is about my experience with machine learning and programming in general that I want to expand.
It seems complete overkill for the NEA, if I'm completely honest. If you're an amateur in programming, dipping into neural networks and artificial intelligence to develop chess AI may be more work that it's worth, especially for an NEA.

A side project? 100% go for it, but for A-Level? I'm not so sure. I understand you want to expand your knowledge in the realm of programming and AI, and I encourage you to do so, but not for the likes of this.

Even on a basic level it will still be very complex. Especially with machine learning and neural networks. I hope this doesn't discourage you for investigating these topics in your own time, but for the sake of academics and an NEA I'd say this is a little too ambitious.

A 2 player chess game might work though :smile:
(edited 3 years ago)
Reply 2
Original post by Strange5050
It seems complete overkill for the NEA, if I'm completely honest. If you're an amateur in programming, dipping into neural networks and artificial intelligence to develop chess AI may be more work that it's worth, especially for an NEA.

A side project? 100% go for it, but for A-Level? I'm not so sure. I understand you want to expand your knowledge in the realm of programming and AI, and I encourage you to do so, but not for the likes of this.

Even on a basic level it will still be very complex. Especially with machine learning and neural networks. I hope this doesn't discourage you for investigating these topics in your own time, but for the sake of academics and an NEA I'd say this is a little too ambitious.

A 2 player chess game might work though :smile:

Thanks for the reply :smile:

Yeah it is definitely something I would like to do on the side. I'll switch projects now while it's still early.

In the meantime, you seem to know what your talking about. Any suggestions for where to start if I'm thinking of taking on AI?
Original post by Revivan
Thanks for the reply :smile:

Yeah it is definitely something I would like to do on the side. I'll switch projects now while it's still early.

In the meantime, you seem to know what your talking about. Any suggestions for where to start if I'm thinking of taking on AI?

No problem :smile:.

A good understanding of programming and related concepts should definitely be a starting point. You're obviously doing Python at the minute which is great, I'd also try learning another language, something like Java or C# to give you a solid foundation on OOP concepts. I know Python does have classes/objects, but it's always worth reinforcing and expanding that. I started with Java, and it gave me a very solid foundation. This course was what I used to get into it and is very good imo https://www.udemy.com/course/java-tutorial/

As for the core AI stuff. Understanding the basic concepts on AI (not necessarily the coding aspect) I think is the no-brainer starting point. AI is a broad field delving into topics like Machine Learning, Neural Networks etc.. You may find this resource valuable to get you started on the concepts/algorithms https://www.elementsofai.com/

Apart from this, when you feel confident enough is to simply search 'Neural Networks for beginners, Machine Learning for beginners' on YouTube or online and see where that takes you. YouTube is always a great resource. If you watch videos and there are topics are brought up you're not familiar with, pause and research. It won't necessarily be easy, but if you're interested in it and determined to learn, you'' find a way.

Hope this helps.
Reply 4
Original post by Strange5050
No problem :smile:.

A good understanding of programming and related concepts should definitely be a starting point. You're obviously doing Python at the minute which is great, I'd also try learning another language, something like Java or C# to give you a solid foundation on OOP concepts. I know Python does have classes/objects, but it's always worth reinforcing and expanding that. I started with Java, and it gave me a very solid foundation. This course was what I used to get into it and is very good imo https://www.udemy.com/course/java-tutorial/

As for the core AI stuff. Understanding the basic concepts on AI (not necessarily the coding aspect) I think is the no-brainer starting point. AI is a broad field delving into topics like Machine Learning, Neural Networks etc.. You may find this resource valuable to get you started on the concepts/algorithms https://www.elementsofai.com/

Apart from this, when you feel confident enough is to simply search 'Neural Networks for beginners, Machine Learning for beginners' on YouTube or online and see where that takes you. YouTube is always a great resource. If you watch videos and there are topics are brought up you're not familiar with, pause and research. It won't necessarily be easy, but if you're interested in it and determined to learn, you'' find a way.

Hope this helps.

Wow, this definitely helps, I'll get right on that java course when I have the time and look into the AI stuff.

Thanks again for the indepth responses and hope you have a great day :smile:
Reply 5
Original post by Revivan
For my A level NEA, I have decided to go all out and have a crack at a chess AI.

So I'm not planning for my AI to be anything special, in fact just something that demonstrates how AI might work on a basic level. I would like to program it in a way that it analyses certain trades and moves at 1 depth based on material gain/loss or percentage win rate for that position based on games it has played in the past. So it will simulate and play games against itself until it builds up a winrate for a vast number of positions which it can then store in a database somehow.

This doesn't even mention the work that I will have to spend on board and piece representation, making the game actually work without bugs and figuring out how to conceptualise different ideas so that the computer can actually understand how the game works.

Also, if it would be possible, python is something I want my game to be mostly programmed in.

For someone who considers themselves an amateur at programming in general, too ambitious?

Also, should I try to apply some neural networks wizardry or is that something that would be wayyy out of my depth?

I'm going to guess yes but these things can be simplified and I am willing to put in a lot of time for this project. It's not just about the NEA, it is about my experience with machine learning and programming in general that I want to expand.

Probably a bit late, but I am also doing a chess AI, and after speaking to my teacher, I have to disagree with the other comment about overkill. Apparently you only have to code only 40% of the overall program and the other 60% can be libraries and stuff. So basically you can use a pre-made chess engine and do the AI stuff yourself. If you do a little research on minimax algorithms, you could easily code it while also getting an A*.
Reply 6
Original post by OGMoiz
Probably a bit late, but I am also doing a chess AI, and after speaking to my teacher, I have to disagree with the other comment about overkill. Apparently you only have to code only 40% of the overall program and the other 60% can be libraries and stuff. So basically you can use a pre-made chess engine and do the AI stuff yourself. If you do a little research on minimax algorithms, you could easily code it while also getting an A*.

I am also thinking of doing the chess AI and I did not know you could just use a made algorithm. If this is possible, then making this game would be realistic, although I am still debating whether or not it would take a lot of time and if I would be better of doing something like a stock system.
I'm currently doing the same kind of project. I've finished the program but am struggling with the documentation. Would anyone be able to send me any relevant work? Any help is much appreciated
Reply 8
Original post by Strange5050
It seems complete overkill for the NEA, if I'm completely honest. If you're an amateur in programming, dipping into neural networks and artificial intelligence to develop chess AI may be more work that it's worth, especially for an NEA.

A side project? 100% go for it, but for A-Level? I'm not so sure. I understand you want to expand your knowledge in the realm of programming and AI, and I encourage you to do so, but not for the likes of this.

Even on a basic level it will still be very complex. Especially with machine learning and neural networks. I hope this doesn't discourage you for investigating these topics in your own time, but for the sake of academics and an NEA I'd say this is a little too ambitious.

A 2 player chess game might work though :smile:


I completely disagree with this assessment. If the project is something the OP is interested in, it is that interest that will carry them through. AI chess has all the hallmarks required to hit the upper mark bands and is certainly vastly more interesting than some dull booking system or other "default" it'll-do-project title.

Original post by Revivan
For my A level NEA, I have decided to go all out and have a crack at a chess AI.


I think you are onto a winner. However, to start with, keep things simple. Don't worry about the graphics or game play. You could represent the board using a 2D matrix and simply use different letters or numbers to represent the different chess pieces. You might even start with a two player version and then implement the AI part as player 2. Players could simply input the move they wish on a command line basis whilst you sort out the AI and by the time you have figured that out, the graphics and game play will be a doddle.

I am sure there will be lots of information online about basic AI models used in chess, but even without doing that, I wonder if representing potential moves as some sort of graph that is searched using a breath first traverse might be the way to start off?

Go for it and good luck!!!
Reply 9
Original post by Revivan
For my A level NEA, I have decided to go all out and have a crack at a chess AI.
So I'm not planning for my AI to be anything special, in fact just something that demonstrates how AI might work on a basic level. I would like to program it in a way that it analyses certain trades and moves at 1 depth based on material gain/loss or percentage win rate for that position based on games it has played in the past. So it will simulate and play games against itself until it builds up a winrate for a vast number of positions which it can then store in a database somehow.
This doesn't even mention the work that I will have to spend on board and piece representation, making the game actually work without bugs and figuring out how to conceptualise different ideas so that the computer can actually understand how the game works.
Also, if it would be possible, python is something I want my game to be mostly programmed in.
For someone who considers themselves an amateur at programming in general, too ambitious?
Also, should I try to apply some neural networks wizardry or is that something that would be wayyy out of my depth?
I'm going to guess yes but these things can be simplified and I am willing to put in a lot of time for this project. It's not just about the NEA, it is about my experience with machine learning and programming in general that I want to expand.

could i see your NEA write up for inspiration, I'm also gonna attempt this project but I'm just confused on how i should start with the analysis
Original post by Revivan
For my A level NEA, I have decided to go all out and have a crack at a chess AI.
So I'm not planning for my AI to be anything special, in fact just something that demonstrates how AI might work on a basic level. I would like to program it in a way that it analyses certain trades and moves at 1 depth based on material gain/loss or percentage win rate for that position based on games it has played in the past. So it will simulate and play games against itself until it builds up a winrate for a vast number of positions which it can then store in a database somehow.
This doesn't even mention the work that I will have to spend on board and piece representation, making the game actually work without bugs and figuring out how to conceptualise different ideas so that the computer can actually understand how the game works.
Also, if it would be possible, python is something I want my game to be mostly programmed in.
For someone who considers themselves an amateur at programming in general, too ambitious?
Also, should I try to apply some neural networks wizardry or is that something that would be wayyy out of my depth?
I'm going to guess yes but these things can be simplified and I am willing to put in a lot of time for this project. It's not just about the NEA, it is about my experience with machine learning and programming in general that I want to expand.

how did it go? Which scpre have you got?

Quick Reply