Hey guys. I'd like to know how I would get started coding a game like Boggle. I don't think it would require a full-fledged game engine with all its bells and whistles since there is very little to do. There aren't many rules to the game and most of the work is in the procedure making sure all the words the user enters are valid. What kind of structure can I use ? I thought maybe the best option would be going procedural all-the-way yet I'm afraid to lose the code clarity and structure object-oriented programming provides... Yet object-oriented programming seems like hitting a fly with an hammer.
What is you guys' opinion on that ?
Here's a link for you guys in case you do not know what the Boggle game is.
Pick your development method and stick with it. If you want to do the program using proceedural programming then do so. If you want to use OOP then do so. It is your project, so you can do whatever you want. You don't need a game engine for any game. Game engines are made so it is easier to make games. You would start off with a basic working framework that you can hang the rest of your pieces of game code on instead of having to code those parts for each game. You do not make a game engine if you are only going to make just a single game. You would probably use one that has already been made by someone else. The first step in getting started is analyzing your problem. You need to break down the game of Boggle. What are the variables you will need? You are going to have a grid either 4x4 or 5x5. Maybe you could use a 2d vector or map. You are going to have that many number of word dice with letters on each side. So 6 letters per word dice with the exception of Qu being two letters. You need to have some way of randomizing not only what side of the dice is face up but also where the dice will be in the grid. You will need a timer. You will need a way to enter words you have found. You would need to verify that 1. they are valid words and 2. that they appear in the grid in a valid form. You will need to keep a list of all the valid words entered so a vector of strings would probably work. You will then need to score each word for points. So you will need to go over each letter in each word and add it to your point total. A lot of these can be considered objects which would make it easy to do OOP. They also group nicely into functions that you could use a proceedural approach so it is really up to you.
If your only concern about OOP is that it is "like hitting a fly with a sledgehammer," I would go with OOP. Since your concern for losing clarity is probably more serious.
I think it would be a small enough project for you to do it in procedural C without it becoming a mess. Then again, I don't know a lot and I'm probably biased because I suck at OOP :P
Just incase you are interested theres some C source code for solving Boggle games and stuff on this page. The D/L link is under FINDWORD.ZIP. I had a look at it when I was coding a prog to find words in a string. It was created by the guy who made duke nukem so it should be good, shame I couldent understand any of it :'( Maybe you would have better luck ;)
OOP would certainly make is easier for you, but if you can handle it procedurally, and wish to do so, then go for it. I guess it depends how advanced you want to make this. Will it be a console app? Procedural might make a little more sense if you plan on just implementing the bare basics and want to rush it. If you want a GUI with it, and such, then I'd suggest going OOP.
The main problem I see would be your dictionary. Depending on how large it is, you may want to get slightly creative with how you manage it, although I imagine you're already ahead of the game and have plans for this.
This was just asked about recently.
You'll find the solution I mentioned last time, in this thread:
Moved to Game programming forum.