View Full Version : 16: Rubix Cube
BlackHawk
04-09-2007, 06:44 PM
Idea
Simulate the gameplay of a Rubik's cube. Then expand to a word puzzle story game (a la The Da Vinci Code).
Goals
create base game in standard console out
port base code into XNA for custom and coloured effects
By "custom and coloured effects" I mean using custom fonts and colours.
Gameplay/Features
switch between the different cube faces by pressing the arrow keys
adjust columns and rows individually
undo the previous action
save the current state of the session
load a previously saved state
create an original story with word puzzles along the way
word puzzles will be in the form of a riddle and a solvable "cube".
Download link
Updated Final version - download (http://www.gamedev.za.net/filecloset/data/files/225/RubixPuzzle.exe).
Final version - download (http://www.gamedev.za.net/filecloset/data/files/215/Rubix_Final_20070927.exe).
Requirements
Microsoft .Net 2.0 runtime - download (http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en).
Thaumaturge
04-09-2007, 08:36 PM
Interesting... If I may ask, how do you plan on providing the player with information on the cell colours of sides other than the current one, which should be easily available in 3D or real life. An isometric view, perhaps, with keys to allow the player to change which sides other than the current are visible?
ShadowMaster
04-09-2007, 09:41 PM
One thing I'm going to look into is maybe try to create an auto-solving algorithm. And to do n-rank cubes (ie. 4, 5, 6, 100 cell cubes)
Brute force is a no-no, it would take an eternity to run and use a crap load of memory.
Since a normal 3x3x3 rubics cube has 43252003274489856000 possible combinations, so at one combination a byte it would take 4E+10 terrabytes(a bit more memory my than my comp has ;)). And it is even worse for the larger cases
There are methods for solving a 3x3x3 and 4x4x4 cube:
This is the method I know for solving a 3x3x3 cube: http://peter.stillhq.com/jasmine/rubikscubesolution.html
This is a method I found for a 4x4x4 cube: http://www.speedcubing.com/chris/4speedsolve.html
google for other cases and only provide auto solving for those cases.
I might be able to test it for you since I know how to solve a normal rubics cube.
BlackHawk
05-09-2007, 07:53 AM
@Thaumaturge: I thought the first bullet of the 'Gameplay/Features' stated this clearly enough? However, the old school version will be stock standard console out stuff, so there will be no colours to speak of. In the XNA/Win forms version coloured text will be used to simulate the coloured squares. As for the viewing of the different sides, I'm toying with the idea of showing all 6 faces, but I'm a little concerned info overload.
@ShadowMaster: Wow! I haven't started my research on the auto-solving yet, but with the numbers you quote I'm pretty sure that this feature is now off of my list.
BlackHawk
05-09-2007, 07:59 AM
I'll be the first to admit that this idea is exceptionally boring for 90% of us out there. I haven't solved a real Rubik's cube myself and thus would not find it even appealing as a game. This fact bugged me the whole day yesterday.
So, this morning when I opened my eyes, a new idea flashed through my head: marry the mechanics with a Da Vinci Code-style word puzzles! Add in an interesting story to keep the puzzles together and you have a game, which is much more exciting than a simulation of solving a boring old Rubik's cube.
I'll update the first post later today.
FuzzYspo0N
05-09-2007, 10:20 AM
lol , sounds like you are thinking hard keep it up it would be great to see progress :)
dislekcia
05-09-2007, 01:59 PM
I dunno, I like Rubiks cubes. Played the rings too :)
-D
BlackHawk
05-09-2007, 09:38 PM
Can a Win Form with only text on it (and maybe a textbox to read input) still be considered inside the rules of the competition?
Thaumaturge
05-09-2007, 09:49 PM
I very much like the word-puzzle idea - it sounds as though it might well add quite a bit to the idea. ^_^
@Thaumaturge: I thought the first bullet of the 'Gameplay/Features' stated this clearly enough?
The impression that I think that I got from that was of seeing only the current face at any given time, which I suspect might make it a little more difficult to keep in mind the state of the cube as a whole.
BlackHawk
05-09-2007, 10:13 PM
Added the first version. Consider it a demo more for the way in solving a cube rather than solving a rubik's cube. To show you how the data shift the entire cube's contents is shown and then the eventual side that the user sees is shown. The actions are listed below that. No saving yet, no undo yet. No loading yet, either. Just start a new game :).
You'll notice that there are 9 sides to this "cube". Obviously that's incorrect. So I'm just looking for feedback on if what the user sees will be sufficient and if this needs to be expanded to show all 6 sides.
Thaumaturge
05-09-2007, 11:22 PM
Aah - Am I correct in guessing that this game requires .NET2 (or some other version thereof)? As with kurtkz' cricket game, I am receiving an "Application failed to initialize properly" error, I'm afraid.
(Maybe I should get around to installing .NET2 one of these days...)
BlackHawk
06-09-2007, 07:16 AM
Yes, I'm afraid you need the .Net 2.0 runtime installed on your machine.
BlackHawk
27-09-2007, 07:30 AM
Yeah, I'm way behind on my goals for the Game.Dev Competition 16. I'm about 70% finished but features that will not be done is the undo-ing of actions and the randomization of puzzles. One that might still make it is the saving of the current state of the game. Currently there are 5 puzzles (with accompanying riddles) and it works quite well, I hope. The story and riddles are in an XML file and the player reads sections of text (to prevent unnecessary scrolling, something you could not really do in the console-days of yore).
I still need to finish up the mechanics of the last three puzzles, but OO saved about 30% work (if you were to look at the same game written procedurally). So, tonight is the last night where I must complete as much as possible and try to fix the few remaining bugs/issues. I've only got 6 hours to do it in. That hardly qualifies as "crunch mode", but its usually the last 10% of any dev job that takes the longest to complete.
A new motto for me: An hour a day keeps the crunch away.
BlackHawk
27-09-2007, 10:53 PM
Posted the final version.
Save system is not in.
You still need .Net 2.0 installed on your machine to be able to play this.
Just double-click to extract the files and run RubixPuzzle.exe to run the game.
Thaumaturge
28-09-2007, 12:13 AM
Congratulations on getting your submission in, BlackHawk. ^_^
BlackHawk
28-09-2007, 07:30 AM
Thanks, Thaumaturge. Wrote the last 30% last evening. At 11 PM I couldn't keep my eyes open :), so it was just in time. I'll post a "post-mortem" over the weekend.
BlackHawk
30-09-2007, 07:21 PM
When Comp 16 rolled by I was ready to try my hand again at creating a game in one month. My first try was for Comp 10 (the first R10 000 competition). This time round I didn't set the bar too high. Even if I didn't get a mention it would still feel great just to get something done! I don't know who said it (maybe our father-figure, dislekcia) but the biggest problem would-be individual game developers face is the fact that most don't finish what they start. This is true of myself, too. So I set out to start fighting that particular demon.
My goals
- Create something fast
- Keep it simple
Our time limit was less than a month. Something like 23 days. The fact that is was text-based was a good thing. This meant no intricate graphics, no sound effects or music (unless you wanted to add something to that effect). I had thought about space simulator, much like the Trek-game that was published on XT's and 286's. ASCII characters for the ships, planets, etc. However, that would not be true to the stated goals. So I had to think simpler.
Simulation of a Rubik's cube struck me. The basics are really simple to program: a 2D array of characters, just map out the different sides intelligently. Then its just a matter of presenting each face and shifting rows and columns. Creating the basic code base took about 2 evenings and I published it as a console-only app.
But I had fallen out of love with the idea. A day later, after much thinking and mulling over the mechanics, it struck me that if I combined the shifting gameplay with word puzzles and riddles, I could have a nice playable mechanic that is not too difficult or alien to players. Combine it with a short story to introduce and present the puzzles and you could have something that I would call a game. While I'm sure a Rubik's cube simulator would be cool, the text-only limitation would have been too much.
So work began to extend the engine, as it were, to accommodate different puzzle sizes and methods for solving. I underestimated this part some what. The combined time to get the game as presented in the final version is about 1 week of 2 hour coding sessions. That doesn't sound like much but when real live intruded it was quite a difficult thing for me to pull of.
The story aspect of the game needed to introduce the puzzle element logically and the methods the characters would use to solve each puzzle also had to be easily understandable and approachable. Using a PDA grounds the story in the modern era, provides a centralized place to find each puzzle and also give a spy-gadget feel to the overall presentation of the story. The scattering of the riddles that accompany each puzzle provides the necessary vehicle to move the story forward and get the main character into different situations. There are a lot of problems with the story, but I find it sufficient in the way it is presented. This also proved to be one of the challenging aspects in this game's creation. Writing a semi-believable story and hoping the gamer will suspend some disbelief is not easy.
When the story and puzzles game together, I had to find a way to balance out the story length versus the puzzle complexity. The story had turned out to be a bit lengthy, in my opinion, so I had to either up the difficulty of each puzzle or introduce more puzzles. I went with the first.
What went right
- OO: I used a lot of object oriented programming concepts in the creation of this game. Poly-morphism features huge (basically each puzzle is a rectangle object, but each puzzle must limit itself in certain ways while a rectangle could do all possible actions). As a result my understanding in OO was broadened and all the stuff they teach you in university/technicon became blindingly relevant.
- Choice of gameplay: The choice to go with one simple mechanic as opposed to multiple mechanics was key in finishing this game.
- XML: the use of XML proved quite handing in presenting the story in chunks and tying puzzles and their riddles to certain sections of the story. I'm sure any scripting language (Lua, for instance) would also be great to do this, but I would have had to learn that before being able to use it. A further benefit was that I'm now more comfortable with XPATH expressions.
What went wrong
- Time management: I'm cursed with laziness as soon as I start something I need to finish. I always want to do something else (that's equally interesting or just pushed aside because of a previous interesting thing). I could have finished the game (in its final presented state) about 10 days before the official dead-line. However, work pressure combined with this particular laziness cost me a significant amount of time.
I found that I had the most fun when the plumbing of the game was done and I had to think of methods the player had to employ to solve puzzles. At the moment answers can only be in row-form, but it would be fun to have the user present the answer in a specific column or diagonal. Thus, a future goal will be to design, code and finalize the plumbing of a game in the first week.
Thanks for reading this postmortem. Hopefully you'll have found something to take away my experience. Hope you enjoyed my game!
BlackHawk
02-10-2007, 06:58 PM
My laziness catches up with me. I've uploaded a new version (exe only) that squashes 2 show stopping bugs. Just replace your current executable the downloaded one. This is NOT an SFX.
Thaumaturge
04-10-2007, 12:36 AM
An interesting post-mortem, BlackHawk, thank you for it. ^_^
It's interesting to read the progression of your idea, and to note the things that went right or wrong.
dislekcia
21-11-2007, 03:23 AM
So the third puzzle now registers the correct answer? Unless I'm totally wrong in my thinking or something ;) It's very tricky the way you make the grid have empty spaces so that the player can't use the length of the available spaces to inform their word guesses.
I'm finally trying to play my way through this and I must say that your writing is very good. There are a few things that a good editor would pick up and shift around, stylistically and grammatically, but on the whole it's very well done indeed. Did you find it difficult writing a female protagonist? Also, why is the story set in Holland, with very european elements like trees that no South African would be able to imagine correctly (Birch, for instance)?
I'm curious... Plus at first I thought the game was very confusing until I figured out the puzzle mechanic and devoted time to reading what was going on and why solving these puzzles was important. Great contextualising there.
-D
BlackHawk
22-11-2007, 07:56 AM
So the third puzzle now registers the correct answer? Unless I'm totally wrong in my thinking or something ;) It's very tricky the way you make the grid have empty spaces so that the player can't use the length of the available spaces to inform their word guesses.
All puzzles should now work correctly. Only the very last puzzle, which uses randomized position shifting, can be very difficult to solve should you get bad randomized numbers.
I'm finally trying to play my way through this and I must say that your writing is very good. There are a few things that a good editor would pick up and shift around, stylistically and grammatically, but on the whole it's very well done indeed. Did you find it difficult writing a female protagonist? Also, why is the story set in Holland, with very european elements like trees that no South African would be able to imagine correctly (Birch, for instance)?
Thanks for the kind words. I'm a bit over male protagonists (and the fact that I want to name each and everyone Jack or Jake or J...). Also, I wanted to explore the emotional side of women more. I didn't find it that difficult to write the character. I had more trouble trying to inject tension and keeping the flow of puzzles and story balanced. I could have written a few thousand more words to better pace the tension, but then I would have run out of puzzles long ago :)
As for the trees/idiosyncrasies - I didn't do any research and am terrible with names for stuff that doesn't interest me (trees/plants foremost ;)). Birch was the first word that popped into my head. I wanted "bloekom", is that eucalyptus?
I'm curious... Plus at first I thought the game was very confusing until I figured out the puzzle mechanic and devoted time to reading what was going on and why solving these puzzles was important. Great contextualizing there.
Play WoW much? Do you skip quest text? ;) Since this was more IF than outright puzzle, the player is forced to read the story to get context with the PDA, etc.
BlackHawk
22-11-2007, 08:05 AM
Yesterday, 03:23 AM
Jeepers, dis, when do you sleep?
dislekcia
22-11-2007, 01:38 PM
Jeepers, dis, when do you sleep?
Never ;)
Finished the game, like the N1 at the end and the other CT names. Final puzzle wasn't too hard on me, I got non-divisor numbers so I could just do multiple shifts to get a specific letter in the right place. Do you work your puzzles backwards by starting with the answer and then perturbing the grid to ensure that there's always a solution or did you rely on having prime grid sizes for that particular puzzle?
-D
BlackHawk
22-11-2007, 07:38 PM
Do you work your puzzles backwards by starting with the answer and then perturbing the grid to ensure that there's always a solution or did you rely on having prime grid sizes for that particular puzzle?
The first one. I inject the answer into the grid and then randomize the elements. The grand plan was to do this but also have random grid elements. I ran out of time, had to balance quality vs feature polish.
I didn't notice that the grid(s) was necessarily prime. The answers dictated the grid sizes in width but not height. I think that its more important that the gird is uneven in length, because then you can get away with randomized shifting variables more easily than with even width/height.
Powered by vBulletin® Version 4.2.4 Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.