Jump to content
  • Advertisement
Sign in to follow this  
Joshnathan

AI

This topic is 4991 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I know that the first reaction after reading my title would be "why not post in AI forum" :) answer: see question lol I only recently started programming in c++ because there is a school contest thingy in march about programming. For that contest I have to present a project. Me and my friend(who also started programming very recently, even after me) were thinking of creating a chess program with a very basic AI. Does anyone know if it possible to learn c++ quick enough to be able to have one ready in march? taking in account that I have programming experience in javascript but m friend does not... Thank you very much in advance, Joshua

Share this post


Link to post
Share on other sites
Advertisement
chess might be a bit much to write yourself by march. especially if you're learning C++ and a graphics API at the same time. Unless you've done a lot of this sort of thing before, but in that case you'd know if you could do it by march.

Anyway. Maybe a simpler game? Like Dots and Boxes?

Share this post


Link to post
Share on other sites
I've got nice idea - 3-dimensional naught-and-crosses with 4x4x4 tables. It could look like 4 isometric planes one over another with 16 (4x4) rombic squares. It is some more difficult than 2D n&c, but may be more exciting!

Share this post


Link to post
Share on other sites
The quick answer: not likely.

If I asked a person who knew c++ and even knew a graphics API (directx, opengl) but didn't know anything about AI they would be hard pressed to finish a fully functioning chess game with AI by march. AI (even simple AI) in chess is fairly complex and looks even more complex if you haven't attempted other AI projects previously. Another big hurdle for you is the graphics API. Check out some of the posts in the directx forum to get an idea of the work involved with that. Though, you could avoid graphics all together and instead just have test input/output of the "rook to queen 3" sort.

Don't think this means that you shouldn't try. I suggest that you continue to learn c++, start reading the articles on this website and on others about AI and a graphics API, and stick with it. Even if you don't complete your project before the deadline you'll still learn a lot.

Good luck to you and your friend.

Share this post


Link to post
Share on other sites
We can break this down into 4 things.

- The language itself.
- The graphics API.
- The input system.
- The AI.

The language itself can be learned in about a month. It fully depends on how much time you plan on investing in learning it, how good your resources are, and what your prior experience is. If you've programmed in, say, Java before, then you've got a good headstart on the basics. If your only experience is C-64 BASIC, then you're in for a very rough ride that could easily take more than a month.

The graphics API depends a little on what you plan on doing. Let's suppose you want something basic and don't care about trippy stuff. Learning enough of the Win32 API, for instance, to load a bitmap and BitBlt sprites into a window without considering transparency is something that could take about a month or two, again depending on your resources and prior experience. The hidden cost in this is learning some of the Win32 API and how a Windows app behaves. You could go for SDL too, you'll strip away much of the work and probably get the hang of it in a few weeks. It took me literally a handfull of hours to convert an old sprite-based GDI shooter game to SDL, but then again I had a lot of experience with the GDI and a few other graphical APIs beforehand. Text-only display is an other option that could take very little time.

Input is simple if you just plan on sticking to the keyboard. SDL, again, is a good choice since it features some input handling (IIRC). You could just have some simple "Enter piece to move," "Enter position to move to" input; that would take very little time to get the hang of once you've understood the basics of C/C++. If you want to go a little further and use the mouse, you're in for a lot of learning.

Finally, there's the AI. This is language independant, so it depends on your understanding of AI. If you already know how to code a chess AI and just need to convert your knowledge into C++ code, then this bit should be a breeze. If, on the other hand, you have no idea what to do, expect a good 2-3 months if you want a really good system. Something basic could probably be rigged up in a few weeks at this point.

So... quality and time are the two factors you'll have to weight if you plan on doing this. If you've only recently started, you've got yourself a major learning curve to deal with if you plan on finishing in time even with something that's just "ok." If you want something that's "woahhh!" with little experience and by that time, you may as well give your hopes up. ;)

My suggestion is give C++ a try and see if you can come up with something REALLY basic. Not a chess game, just... anything. Having a feel for the language should give you an idea how difficult this sort of thing can be when you actually get down to it, and you may be able to sort your ideas out a little more. :)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Thank you all very much, I will discuss it again with my friend and we will see what we can do. The problem is that for the contest we need to solve a "problem" using c++. This problem would be creating an AI, anyone comes up with another "problem" knowing that I can not(or at least I think so) come up with something like "create a game" :)

Share this post


Link to post
Share on other sites
Yup, I wouldn't suggest chess. If you really don't know much c++, it will be extremely difficult for you to write a chess program. In fact, I've been programming for quite a while, and I'd have a very hard time trying to write one. Anyawy, try checkers. I'd suggest looking up minimax, or neural networks.. Probably minimax, otherwise you will have to play checkers against the computer hundreds of times to make it even slightly good.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I would suggest making a Tetris clone and then try to make it play by itself. I had to do this in my intro to AI class and it was really fun. I even think there's a "tetris in an hour" thread in the beginners forum. Just think about how you play tetris and figure out how to make the game think like that. How do you make a decision on where to put the piece?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!