• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Alpha_ProgDes

Are these games really "beginner" games?

16 posts in this topic

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.

0

Share this post


Link to post
Share on other sites
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
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0