Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Are these games really "beginner" games?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
16 replies to this topic

#1 Alpha_ProgDes   Crossbones+   -  Reputation: 4692

Posted 31 March 2013 - 11:12 PM

First of all, I've never attempted any of these games, so I don't know.

 

Second, please rank these games on programming difficulty level (beginner, intermediate, advanced, expert). If you can be so kind, please give a quick sentence or two (or more if needed), as to why you gave the game that rank.

  • Go
  • Hangman
  • Tic-Tac-Toe
  • Chess
  • Connect Four
  • Battleship
  • Checkers

 

The reason I am asking the question is that the programming to get these games right and deal with the various strategies seems far more complex than a simple switch statement. A lot of the games I've listed don't seem ...appropriate... for a beginner to tackle. Or another way of putting it, the AI for these games seem far more complex than SMB. But again, I'm guessing and don't really know. So I'm asking.


Beginner in Game Development? Read here.
 
Super Mario Bros clone tutorial written in XNA 4.0 [MonoGame, ANX, and MonoXNA] by Scott Haley
 
If you have found any of the posts helpful, please show your appreciation by clicking the up arrow on those posts Posted Image
 
Spoiler

Sponsor:

#2 slicer4ever   Crossbones+   -  Reputation: 3949

Posted 31 March 2013 - 11:24 PM

Go
Don't know, I don't even know this game.

Hangman
Beginner level, hangman is pretty much just "reveal the letter" game, and in my opinion is probably one of the easiest things to program, just requires an understanding of strings.

Tic-Tac-Toe
Beginner level, the gameplay itself is incredibly simple.

Chess
Intermediate-advanced. the gameplay has alot of diffrent moving pieces, pieces can attack only a certain way. their's also things like castle move, and first move for pawns that need to be taken into consideration.

Connect Four
Beginner, maybe Intermediate. it's mostly just finding the next available slot to place your piece, and scanning the board for any possible win conditions.

Battleship
Intermediate, battleship could be thought of as an extension of tic-tac-toe, except with targeting specific spots on the board.

Checkers
Intermediate. checkers is a bit easier imo than chess, there's really only two types of pieces(king and regular), and there's a specific order to move/attack. Really checkers is imo what you should make before doing chess.


Of course none of my answers take into consideration building ai for the games, and only the gameplay itself.


EDIT: Fixed forum eating my post.

Edited by slicer4ever, 31 March 2013 - 11:28 PM.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

#3 radioteeth   Prime Members   -  Reputation: 1106

Posted 01 April 2013 - 02:18 AM

Go, tic-tac-toe, battleship, and connect-four are all of the same basic dynamic - a grid in which both players can modify the state of each grid point, each game with its own specific dynamic/mechanic.. eg: connect four, grid contents 'fall', and battleship the points are sets of 2/4/5 grid points at different orientations. Detecting various gameplay situations/states, and how each player can 'move' from the current state to the next is a fairly simple static set of rules.

 

Chess and checkers, on the other hand, are a bit more complicated.. Both require greater state-searching capacity if one desires to supply worthy a worthy AI opponent for single-player experience. Chess, especially, demands specific rules per the different game pieces the game entails, which further complicates implementation what with the validation of player moves and generation of AI moves.

 

The dynamic of Go's gameplay is somewhat abstract, and might involve a similar high-capacity state-search in an AI implementation, similar to chess/checkers, but the fact that there are only two game pieces, black and white, should simplify things.

 

Go and checkers are similar, in some respect. But I imagine checkers, and its rules, as being much simpler to implement.

 

Presentation is a seperate issue, and can be as basic or involved as desired (or capable of). You can go with text-mode graphics for all of these games, to eliminate the need for any complex graphical work. My assessment of these games and their difficulty in implementation is purely based on my perception and understanding of their mechanics and imagined complexity of their implementation.



#4 Paradigm Shifter   Crossbones+   -  Reputation: 5412

Posted 01 April 2013 - 02:57 AM

I'll just comment on the AI part (none of the AI except maybe tic tac toe can be done with a series of switch or if/else statements)

  • Go

Very hard, you can't use standard tree search (minimax and related algorithms) to generate lots of potential moves and evaluate how good they are after looking ahead, since the number of moves that can be made each turn is enormous (far more than in chess or checkers). This is an ongoing AI research problem and the best human players can still tonk the AI...

 

  • Hangman

This involves having a large dictionary of potential words if you want the computer to guess the word. Eliminate large parts of the dictionary after the result of each guess (best strategy is to try and eliminate the most words from the dictionary regardless of whether your guess is correct or not, also guess common letters first, etc.). If you see a new word, add it to the dictionary. Not too hard.

 

EDIT: You can use statistics for this, for each letter that is a potential guess calculate the expected value of the number of words that will be removed from the dictionary, and pick the one with the highest expected value.

 

  • Tic-Tac-Toe

Or "my first minimax algorithm implementation". Easy. You can also do it by hard coding in a perfect strategy, but that only applies to tic tac toe and not other 2 player games with perfect information like chess/checkers etc.

 

  • Chess

Hard to get it to play well, there are lots of forums about it and you probably want to ask Alvaro questions in the AI forum. Uses variants of minimax along with large databases of opening moves and endgame databases as well.

 

  • Connect Four

 

Minimax again should get this to play fairly well. It has been solved (i.e. computer algorithm exists which plays perfectly) recently

 

EDIT: I think the standard board size has been solved but larger boards still remain open research

 

  • Battleship

This is more about distributing your shots to find all the ships in the most optimal way but I suspect for every strategy there may be a counter strategy for ship placement...

 

  • Checkers

Easier than chess and harder than Connect 4, same sort of principles (i.e. minimax based) apply. I think this was solved fairly recently as well...


Edited by Paradigm Shifter, 01 April 2013 - 03:01 AM.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#5 Sik_the_hedgehog   Crossbones+   -  Reputation: 1817

Posted 01 April 2013 - 03:44 AM

They're easy for a beginner in the sense that UI-wise they can be done in a pretty simple way, you don't even have a timer to cope with (actions aren't in real time, it's entirely turn-based). The AI is a completely different situation, though you can always avert that by forcing only humans to play =P The rules of board games are also complex, but at least they're very well defined (they need to be interpreted by humans, after all!) so ultimately they're more of a time sink than actually being hard to implement. You don't even need to do it in a very optimal way given it's all turn based (no framerate to worry about).

 

For AI on board games the most common trick is to assign points to each possible thing that can happen, then try all possible moves and see which one has the best score (then do that). To make the AI harder you can try several turns ahead, but then the computation time can explode exponentially so maybe as a beginner you may want to avoid considering that one.

 

Tic-Tac-Toe has so few possible combinations you can just brute-force the way through it...

 

EDIT: by the way, there's an old DOS game called Tetris Deluxe that does exactly the same thing as I mentioned for board games. Even when you take into account the next piece it amounts to a total of 81 possible moves, and the "AI" can end up doing some surprisingly smart moves a human player would initially consider stupid. So yeah, that method works on Tetris too. It's pretty fast, consider that game was made on a 4.77MHz 8088 =P


Edited by Sik_the_hedgehog, 01 April 2013 - 03:48 AM.

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

#6 alnite   Crossbones+   -  Reputation: 2124

Posted 01 April 2013 - 03:13 PM

I think programming any games is not an easy task.  Even the seemingly simple games like Tic-Tac-Toe require some effort to make it work as expected.  However, that is the whole point of the exercise, is to create something that seems simple and realize how much work is actually needed.

 

It'd make any beginners rethink their MMORPG dream.



#7 jwezorek   Crossbones+   -  Reputation: 1949

Posted 01 April 2013 - 03:42 PM

I think to write machine players for these games from easiest to implement to hardest would be:

 

 

  • Tic-Tac-Toe: beginner. Tic-tac-toe is easy because perfect play can be expressed as a list of rules that would be relatively straight-forward to implement in a function. See here.
  • Hangman : beginner. You need to implement a dictionary as a data structure that can be searched with wild cards, basically. A beginner could do this by doing the naive linear time search, building a set of all possible matches, picking a word at random from this set, and picking a letter that hasn't been played yet at random from this word.
  • Battleship: intermediate. Wouldn't be entirely trivial to implement a good machine player, I think, although not sure I remember how you play battleship so am not sure.
  • Connect Four: advanced. This is the easiest of the games listed for which you would want to implement the alpha beta algorithm, but realistically doing this at all competently is advanced in my opinion; others may find this conservative.
  • Checkers: advanced. 
  • Chess: expert.
  • Go: expert. 

But basically writing machine players for any of these besides Tic-Tac-Toe would not be a good project for a total beginner.


Edited by jwezorek, 02 April 2013 - 01:34 AM.


#8 Paradigm Shifter   Crossbones+   -  Reputation: 5412

Posted 01 April 2013 - 03:55 PM

Implementing a tic tac toe AI with an expert (i.e. rules based) system is no use for learning though, you want to use it to learn about minimax and related algorithms, which you can then use as a platform to move onto reversi, connect4, checkers, chess, etc.


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#9 frob   Moderators   -  Reputation: 22293

Posted 01 April 2013 - 03:57 PM

please rank these games on programming difficulty level ... Or another way of putting it, the AI for these games seem far more complex than SMB. But again, I'm guessing and don't really know.

Assuming SMB = Super Mario Bros, the original doesn't have much for AI.

SMB scripts for AI are pretty simple:
Buzzy Beetle, Goomba, Green Koopa Troopa and Paratroopa, and Spiny: move left until you hit an obstacle, then walk right until you hit an obstacle.
Red Koopa Troopa and Paratroopa: Move left/right or up/down within two points.
Spiny Egg: Fall
Podobo (fireball) and flying Cheep Cheep: arc
Bullet Bill, swimming Cheep Cheep: Straight line
Firebar: Spin
Piranha Plant and Bill Blaster: Timer with minimum distance

The remaining characters (blooper, hammer bro, lakitu, and Bowser) all have a slighly more involved AI, but these are all in the beginner or intermediate level.



On to my view of the sorted list:

* Hangman: beginner. Sometimes used in schools for string manipulation.
* Tic-Tac-Toe: Game logic: beginner. AI: intermediate. The AI is frequently used in schools.
* Connect Four: Game logic: beginner/intermediate.  AI: Advanced
* Checkers: Game logic: Intermediate.  AI: Advanced/expert. A proper AI needs to rank risk vs rewards and use the logic of forced choice, but a simple AI can use minimax.
* Battleship: Advanced
* Chess: Game logic: Advanced.  AI: expert. There are occasional research papers on the chess AI.
* Go: Game logic:  beginner/intermediate.  AI: very expert.  You can still easily write doctoral dissertations on Go AI.

Edited by frob, 01 April 2013 - 04:04 PM.

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#10 jwezorek   Crossbones+   -  Reputation: 1949

Posted 01 April 2013 - 05:35 PM

Implementing a tic tac toe AI with an expert (i.e. rules based) system is no use for learning though, you want to use it to learn about minimax and related algorithms, which you can then use as a platform to move onto reversi, connect4, checkers, chess, etc.

 

Didn't mean rules in the sense of rule-based expert system. I meant rules in the sense of what each item in the following is:


  • Win: If the player has two in a row, they can place a third to get three in a row.
  • Block: If the [opponent] has two in a row, the player must play the third themself to block the opponent.
  • Fork: Creation of an opportunity where the player has two threats to win (two non-blocked lines of 2).
  • Blocking an opponent's fork:
    • Option 1: The player should create two in a row to force the opponent into defending, as long as it doesn't result in them creating a fork. For example, if "X" has a corner, "O" has the center, and "X" has the opposite corner as well, "O" must not play a corner in order to win. (Playing a corner in this scenario creates a fork for "X" to win.)

    • Option 2: If there is a configuration where the opponent can fork, the player should block that fork 

  • Center: A player marks the center. (If it is the first move of the game, playing on a corner gives "O" more opportunities to make a mistake and may therefore be the better choice; however, it makes no difference between perfect players.)
  • Opposite corner: If the opponent is in the corner, the player plays the opposite corner.
  • Empty corner: The player plays in a corner square.
  • Empty side: The player plays in a middle square on any of the 4 sides.

which I think an "advanced beginner" should be able to do.


Edited by jwezorek, 01 April 2013 - 05:36 PM.


#11 Paradigm Shifter   Crossbones+   -  Reputation: 5412

Posted 01 April 2013 - 05:58 PM

Ah ok. I still think it is better off implementing minimax since that is such a widespread algorithm with many applications.

 

I still consider that list of rules an "expert system", since it is so coupled to tic tac toe, and isn't applicable to a wider set of problems. It's just that a lower level version of "expert" is required ;)

 

I'm sure it can be adapted to Connect4 though, but it's likely to run into a load of special cases and then you're better off using some kind of tree search like minimax instead.


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#12 frob   Moderators   -  Reputation: 22293

Posted 01 April 2013 - 07:13 PM

I would agree with minimax for connect four. I'd do it for the same reason you study minimax with tic-tac-toe rather than the hard-coded correct solution.

In some ways a rules-based approach could be more difficult to get right connect four. On a standard 7x6 board there will be many different rules in play at different locations on the board. With a rules-based approach there is only one rule with obvious priority: win. Everything else will have a higher or lower priority based on the state of the board. A minimax solver would be able to tell which of those multiple rules is the best to act on; it also would identify places that satisfy multiple rules simultaneously.

The implementation would be much harder than either tic-tac-toe or Stratego (which is another frequently-used minimax game). In tic-tac-toe you consider eight sets of data in isolation. In Stratego you have 80 pieces and you have the option of considering each piece in isolation. In connect four it is more difficult to consider each piece of data in isolation; everything is based on the run length of sets.

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#13 tom_mai78101   Members   -  Reputation: 576

Posted 02 April 2013 - 01:43 AM

I think programming any games is not an easy task. 

 

And I thought the game of Heads and Tails coin game so easy, just 4 lines of code is enough... What am I missing here?


Edited by tom_mai78101, 02 April 2013 - 01:44 AM.


#14 Paradigm Shifter   Crossbones+   -  Reputation: 5412

Posted 02 April 2013 - 08:16 AM

What physics library did you use for the heads and tails game?


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#15 tom_mai78101   Members   -  Reputation: 576

Posted 02 April 2013 - 11:19 AM

What physics library did you use for the heads and tails game?

 

In my mind, I was thinking of a pseudo-random output return either true or false. And that's it. And it's a console application, not a Win32 app.



#16 Paradigm Shifter   Crossbones+   -  Reputation: 5412

Posted 02 April 2013 - 12:14 PM

It was a joke ;)

 

The correct answer was of course "rand()"


"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

#17 markr   Crossbones+   -  Reputation: 1653

Posted 02 April 2013 - 03:44 PM

It really depends what you want to do. Making a computer opponent which plays a *competitive* games in some of these is overwhelmingly difficult (Go!)

 

Making a computer opponent which plays them in a way which is better-than-random is in some cases easier.

 

The complexity of the rules is only one part. The difficulty of a game is not related to the compexity of its rules.

 

  • Go - Rules: Fairly easy to implement, Competitive AI: Outlandishly difficult.
  • Hangman - Rules: Trivial; Competitive AI: depends which side and what dictionary is used. Probably very easy.
  • Tic-Tac-Toe - Rules: Trivial; Competitive AI: Trivial. Perfect AI: Easy.
  • Chess - Rules: fairly easy to implement (although there are quite a lot of them!) Competitive AI: Challenging.
  • Connect Four - Rules: Trivial; Competitive AI: Moderate (I don't really know). Perfect AI may be possible.
  • Battleship - Rules: Trivial; Competitive AI: Fairly easy
  • Checkers - Rules: Fairly easy to implement; Competitive AI: Challenging (or maybe not, I haven't researched it in detail)

Mark






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS