Mastermind


Tristan

n00bie GP32 coder (MasterMind)
Joined
Mar 24, 2004
Messages
276
Age
38
Location
The Netherlands
Website
Visit site
Before I start, I'd just like to say that this is actually just a beginner's project, and should be treated as such. I wrote this program to learn C, and the GP32 at the same time. I learned some C, I also learned something about the GP32 so for me this project has already done what it should have done. I also thought it might be cool to fix it up a little and release it to the public.

So, here it is. The first release of Mastermind. Most of you probably know what this game is about but for those who don't:

Mastermind is a game of logic. Your opponent chooses a color combination consisting of four pins that each have a different color. These pins are placed in four holes that are then covered.

Your objective is to guess the correct combination in as few attempts as possible. In each attempt, you guess a combination by placing four pins in a row.

Your opponent then informs your of your progress by placing a number of small black and white pins. A black pin means that one of the pins you have choosen has the correct color and is placed in the correct position. A white pin means that you did choose the correct color but that you did not place it in in the correct position.

Ok, enough with the explanation, on to the emotional stuff.

Credits go out to:

The entire #gp32dev channel, for helping me out with even the dumbest questions.
DJWillis, for being there and talking about fantasy books, helping me with my code alot, and for ScummVM ;)
Inopia, for sharing his BMP loader code with me, even though I never really got it to work (my fault :D)
MrMirko, for his excellent SDK and helpfull SDK manual.
And GP32 community, for just plain being there and being nice (Most of the time anyway, when we're not busy with conspiricy theories).


Ok, so, download it then :unsure:

I'd love some feedback, be it good or bad, just don't flame me. I didn't actually write this for you, I wrote it for me to learn some stuff. Just thought some people might appreciate it.

Edit: All bugs fixed, and I hardcoded a mod file into it.

Edit2: New version, has a few new gizmo's, read about it in the bottom post.
 
great work

remember playing this game a looooooooooong time ago :)

some music while playing would be nice.
 
Can you attach a screenshot to the post, just a jpeg like the fxe itself is.

That way, we can see what it is, and it will probably show up on the homepage.

mth411
 
master.JPG


And the second surprise is that I fixed the white pin bug. Made a typo somewhere :p
 

Attachments

  • master.JPG
    master.JPG
    6.1 KB · Views: 191
  • master.JPG
    master.JPG
    6.1 KB · Views: 199
  • master.JPG
    master.JPG
    6.1 KB · Views: 205
mek posted on Jul 20 2004 at 08:42 PM said:
some music while playing would be nice.
After porting this thing from Mirko's 0.7.1 to Mirko's 0.8.5 I implemented MOD support. At the moment the MOD file is hardcoded into the program, but I'm looking into changing that. Hope you enjoy listening to 'wasteland' ;)


(File updated in top post)
 
Last edited by a moderator:
Dozer posted on Jul 21 2004 at 08:41 AM said:
Wow, nice one tristan. Did you know any C before getting your gp32?
Nope, I did know quite a bit of BASIC, which helps a lot. Gives you that programmers mindset of solving problems. But I had ALOT of help from #gp32dev, so kudos to them.
 
Last edited by a moderator:
Nicely done but there are some problems with your game. I noticed the hints didn't seem to work correctly so I decided to write down a full game and only got one pin in total for the combination blue-green-yellow-yellow (twice) with the solution being yellow-yellow-green-blue.

Edit: cancel that, had your older file and missed your line under the screenshot, back to playing and testing :)

Seems to work properly now, sound is nice but gets annoying after a while, could do with fancy graphics and more variation in music but you have got the gameplay down and did a very good job on your first GP32 game. Now where is that thumbs up smilie?
 
raven posted on Jul 21 2004 at 01:00 PM said:
Nicely done but there are some problems with your game. I noticed the hints didn't seem to work correctly so I decided to write down a full game and only got one pin in total for the combination blue-green-yellow-yellow (twice) with the solution being yellow-yellow-green-blue.
Yep, I noticed that too. The problem was because the program draws the black pins first. I then passed the amount of black pins drawn to the white pin draw part. Only if no black pins were drawn, I'd pass -1 to the white pin drawing part. The result? It expected the input to be at least 1 for it to change drawing positions. So it drew all the white pins on top of each other <_<
 
Last edited by a moderator:
well done tristan, this is just the sort of quick and easy puzzle that I love on my gp32. used to play this loads - i still got it!!

not sure if you really need to beef the gfx really, they're perfectly sufficient and makes for a tiny filesize.

Can I ask what clock speed it is running at?
 
frolik posted on Jul 21 2004 at 05:05 PM said:
well done tristan, this is just the sort of quick and easy puzzle that I love on my gp32. used to play this loads - i still got it!!

not sure if you really need to beef the gfx really, they're perfectly sufficient and makes for a tiny filesize.

Can I ask what clock speed it is running at?
I had it running at 40MHz for a while, but then I did some graphics rotating, and drawing multiple graphics at the same time and set it at 66MHz. It probably runs at 40MHz fairly smoothly, but I left it at 66MHz all the same.

I love to hear that this is a game that might linger on some SMCs. Even if it's going to be thrown out after a week, it's served more then it's original purpose. In fact, it's served two extra purposes already. It's now become something that has learned me the GP32 and C, it has provided some people with a quick game and it has given me a few code tidbits that I can use again. All in all, this has been a very valuable project to me. Not to mention that I can now legitimately show my face in #gp32dev :p
 
Last edited by a moderator:
New version out! Has a few new gizmo's, and also has some downsides which I'll tell you later. The good stuff first. When you boot Mastermind you'll see a menu, with two options. The first "Length of board:" allows you to select the amount of rows you want the board to have. It is selectable between 5 and 8, default is 8. Left and right on the D-Pad change the length of the board.

The second option is "Amount of pins:". You see six pins, two of which are greyed out (blacked out really). Moving your joystick left or right will grey out more pins, or ungrey pins. The amount of pins not greyed will be used in the game. You can select between 2 and 6 pins.

Reboot is pretty selfexplanatory, and so is Start (go the the option with the nifty cursor, and press A).

Now, when you press start, you will hear a faint change in the music. I'm not entirely sure what it is, but I have an idea, and will see if it can be fixed. Other then that, the game screen should pop up. Gameplay remains the same, with just a slight difference if you're using less or more pins. More pins mean more combinations possible, less pins means less combinations possible, and thus easier.

Also the random-pin-picker has been updated. It's now more random thanks to RobBrown's rand( idea.

The downsides to this release are that it now runs at 133MHz, the filesize has been doubled (from 50k to over 100k), and you get that weird shift in the music when pressing Start. The first problem I might be able to fix, and the last one too, the second problem you're going to have to deal with ;). The reason why it's running at 133MHz is unknown to me. Well, that isn't, the reason WHY it has to run at 133MHz is a mystery to me. But it might be some MMU problems. This is still the beta-board, so expect beta stuff ;)
 
Nice, really nice. You have made some great improvements. Mastermind may not be my favorite game but it's fun to play every once in a while and you have made a great version.

Really like the improvements, the main screen and graphics make it look a lot more 'professional'. It's nice to be able to change the difficulty settings. This is definately a keeper.

Would like slightly more soothing music if possible, if music could be changed (few different tunes) it would be perfect <--- really just optional, it's great already. Still looking for thumbs up smilies, think you deserve a couple :)
 
raven posted on Jul 23 2004 at 10:19 AM said:
Would like slightly more soothing music if possible, if music could be changed (few different tunes) it would be perfect <--- really just optional, it's great already. Still looking for thumbs up smilies, think you deserve a couple :)
Yep, looking into that. The main problem is that mirko's MOD player is set to loop, so it doesn't give any signal as to wether it's 'done' or not. I tried looking for a MOD merger, but can't find any. If anyone has any idea? Or maybe a suggestion for which MOD to use?
 
Last edited by a moderator:
Yeah, good job, Tristan! I spent most time of GPplaying on GPgames and Mastermind (besides Kreader) :p Greetings from Spain!
 
Fixed the annoying music by letting y'all choose your MOD for yourselves. Rename the mod to mm.mod and place in /GPMM/MM/. If you don't place a MOD file there, a hardcoded MOD will begin to play. This one will ofcourse become as annoying as the other one after a while, so I suggest you pick one out yourself ;)

Oh, and rename the mm.rer to mm.rar and extract to /GPMM/ Happy playing!
 
Back
Top