Straight to the point: I'm 30 years old and have no programming experience other than basic HTML in notepad back in the late-90's, early-2000's. I'm seeking to make a Rogue-like single player dungeon exploration game. I'm much less concerned about implementing 2D graphics than I am about making my own turn-based combat engine and random dungeon room generator. The first version of the game could be text-only or ASCII.
I've ran part way through one online tutorial for Python and have enjoyed the experience so far.
In reply to the question posed in the FAQ: "[Do] you want to make games or learn to program," the answer is that I want to learn to program. I thoroughly enjoyed programming in either C++, C, or C# -- whatever programming class it was that I took in school some 10 years ago and never used again -- just as I enjoyed coding basic Web pages back in the day. I don't recall anything I learned from the class other than that I couldn't stand re-making the same business/accounting programs again that we made in all the other languages, such as Visual Basic. Instead, I used the text book to help me figure out how to use the random number generator to make a gladiator-like text-only game. Once I started going off in my own direction, the class became excruciatingly tedious in its slow pace and focus on repetition.
Now, I didn't come lightly to the conclusion that I wanted to program rather than just make games. Some time ago, I started making simple games with RPG Maker VX, which is a front end for a form of Ruby. Long story short, I felt confined by it. I didn't want to learn Ruby just to make games with RPG Maker. Instead, I decided I wanted to learn to program using a language that would support my designs in the long term. So, I chose Python.
To be honest, though, I actually am the type of person who rarely finishes what he starts. I have a short attention span. I'm not very intelligent and math is my weakest subject. I'm unmotivated and I procrastinate. I am more of the creative type, which, as I understand it, is the opposite of the type who do well at programming.
But, I digress.
Programming is fun, in my opinion, so even if I quit before finishing a full-fledged game -- as I probably will -- I'll have fun while I learn and work on my project.
Enough about boring ol' me and on to my request for advice.
So far, after a quick Google search, I learned that the following code will allow my game to generate random numbers in Python 2.7.2:
from random import randint
a = randint (0,0)
So, with that knowledge in mind, I made my first "game" (please don't laugh):
loop = 1
while loop != 0:
print "Guess a number between 1 and 10 or guess 0 to end program."
number = input()
from random import randint
target = randint (1,10)
if number <= 0:
print "End of line."
loop = 0
break
if number == target:
print "You guessed correctly!"
else:
print "You guessed wrong. The correct number was", target
Even as simple as that is, I'm sure it's full of problems or aspects that that can be improved.
I've not yet learned anything about functions or classes; I made it half way through the Loop section of the tutorial I'm following.
After I make it through the tutorial, I would like to learn:
- How to go about the process of making a save file for a game;
- How to make my game in Python, but save it so that it can be played on a Windows-based PC;
- How I should go about structuring a simple text-only dungeon game with monsters and rooms and treasure;
- How I should go about coding a Rogue-like random dungeon room generator.
To save my little game above, I tried using py2exe but my understanding of Python isn't great enough yet to be able to follow the instructions. This is the part I had trouble with:
Importing setup and py2exe to setup.py and call setup() function with the name of entry point script as argument. Now it is time to run the script and create the executable. To build the executable, run "python setup.py py2exe" on the command prompt. You can see lots of output on the console. In the end you can see the output as in the picture below. [/quote]
As I didn't try very hard, I'll probably figure it out myself. For that matter, I've not searched for an answer to my first question either, and the third and fourth are too advanced for me to tackle right now.
However, for the random dungeon generation, for now, I'm considering a text-only game where the size of the room isn't important; it's abstract.
Instead, I am considering a five-by-five-room (or larger) dungeon grid something like this:
-- -- -- -- --
| 1| 2| 2| 2| 3|
-- -- -- -- --
| 4| 5| 5| 5| 6|
-- -- -- -- --
| 4| 5| 5| 5| 6|
-- -- -- -- --
| 4| 5| 5| 5| 6|
-- -- -- -- --
| 7| 8| 8| 8| 9|
-- -- -- -- --
1 = May have doors going right and down.
2 = May have doors going left, down, right.
3 = May have doors going left and down.
4 = May have doors going up, right, and down.
5 = May have doors going in all directions.
6 = May have doors going up, left, and down.
7 = May have doors going up and right.
8 = May have doors going left, up, and right.
9 = May have doors going left and up.
Not all of the rooms should to be accessible, but there must be a path from the entrance to the exit. I guess I should have the game first decide how many rooms there are, then what the path of doors is from the entrance to the exit (up, left, left, left, down, etc), and lastly have it branch off any other possible rooms from existing rooms with doors. I dunno.
After the game decides where the entrance and exits are and what rooms exist, it populates the rooms with doors, monsters, treasure, traps, etc.
I have a long and detailed plan for the game, but here is neither the time nor the place...
Well, thanks again for taking the time to read this. It was really more of an introduction post than a search for advice or answers, but if you feel like giving a complete newbie some help, know that it will be appreciated!
-Sharpe