|
| |
|
Click here to join CGEmpire, a quickly growing indie / commercial game development community with free tutorials, advice, member blogs, discussion forums, activities and competitions! |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
Welcome to the CGEmpire forums. A friendly online community aimed at professional and amateur game developers, artists, coders and musicians. You are currently here as a guest - you may read the discussions, but by joining our free community, you'll have access to post topics, PM, and many other features. These include CGEspace, where you can upload art into the advanced personal gallery system, music into your own online jukebox and a detailed profile! Registration is fast, simple and absolutely FREE so please, join our community today! |
|
| LinkBack (2) | Thread Tools | Display Modes |
|
|||
|
ASCII Dungeon
In this tutorial we will look at the process of making a really simple (yet really cool) RPG dungeon using ASCII art (letters, numbers and symbols [^$%&()”$:@~}{P<>] put together to make pictures). The game will be inspired heavily by an old freeware ASCII RPG called Rogue that, despite being a bit basic on the graphics front, was perhaps one of the most fondly remembered games I’ve ever played… In fact one of the top on my list of games I’d love to have made… ![]() Kill that demonic bat! ![]() Make sure you don't get lost in... ASCII Dungeon! In our game, you will be able to explore randomly generated dungeons with your ever smiling hero ASCII Man, and meet a range of terrifying ASCII enemies to fight, and funky ASCII weapons and magical items to use. The beauty of it being ASCII is it’s so symbolic you can stick whatever setting you would like on this. Is it a dark, dank industrial space-ship? Or some parallel universe where sheep are the dominant species? Will you meet bats and trolls, or perhaps Nazis? You decide. This tutorial will try to encourage a bit of creativity, so you don’t all end up with exactly the same game. This tutorial is aimed at those who want to understand how to make a game, but are simply not ready to plunge all into all that whole low-level computer math stuff that seems so daunting to the newbie. After following this tutorial you will hopefully have a good overall idea about the following things: 1)Game loops: how a game runs through a “loop” of instructions constantly and updates all the various bits and pieces to make your game do funky stuff.I’m going to skip through a lot of fundamental stuff about C/C++ and programming in general. Not to say it is not incredibly important, but that you’ll be much more prepared to take all that in once you have a game under your belt. And this time round, you don’t need to know these little bits and bobs, because I’m here to help you through this one ![]() How a Game Works Think of your PC running a program like a bunch of actors on-stage reading a script. The script gives the actors a bunch of instructions: “Walk to there, say that, walk to there, pick that up.” The actors carry out these instructions, but whilst there may be several actors on stage, there is no point in them all reading different parts of the play at the same time. .. That would be too confusing. They all keep track and work through their script together, taking turns at reading lines, one line at a time, until they get to the end. Then they wait for applause and sod off home. This is kind of how your PC acts when running a game (though it doesn’t often get applause, or sod off home). The PC starts running the program from the first line of its “script” (the .exe file you run), and works its way through the script line by line, one line at a time, until it gets to the end. Using a “debugger” that comes with C/C++, you can stop the game in its tracks and see the current line it is looking at. You can press a button to step through line by line, having a good nosey inside your computer’s memory and seeing what it is up to. The major difference between a computer game and a stage-play, is that in a computer game, instead of having a single path from beginning to end, there are always many different paths the script could take. It is a bit like those Fighting Fantasy adventure novels where you get a choice of what you want to do next: If you want to climb back up the mountain, turn to 67. If you want to run away like a girl, turn to 232 If you understand this, then remarkably, this is the most fundamental concept to get your head around with making games. It’s simply a flow of logic… the computer asking your game questions your game had instructed it to, with different paths depending on the questions asked and the answers received. “… if this is true, do this… but if that is true, do that instead… you always want to do this bit… but then, hey! You’ve just done this, so I’m going to do that… “ Learning and understanding the syntax of the C++ code is going to be the thing that takes the most time, but the syntax is just the language used… it’s not what language in which you say something, it’s what you should say that’s the important thing to learn. So, bearing this in mind, in the next section we’re going to design how our code is going to work, using a language we are a little more familiar with. English! Huzzah. But don’t be disheartened, as you will learn how the code works without needing to learn the code at the same time, and in the very next section, we will set about making our game a reality with C++ code! Click here for part 2 Last edited by chris : 08-12-2006 at 02:48 PM. |
![]() |
LinkBacks (?)
LinkBack to this Thread: http://www.cgempire.com/forum/tutorials-101/terror-ascii-dungeon-c-tutorial-codephobes-part-1-a-379.html
|
|||
| Posted By | For | Type | Date |
| Untitled document | This thread | Refback | 10-30-2006 05:43 PM |
| Untitled document | This thread | Refback | 10-29-2006 10:25 PM |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Terror in ASCII Dungeon! A C++ tutorial for codephobes - Part 3 | chris | Tutorials | 36 | 09-07-2008 08:43 PM |
| Terror in ASCII Dungeon! A C++ tutorial for codephobes - Part 2 | chris | Tutorials | 10 | 09-18-2006 10:38 PM |
| [TUTORIAL] Debugging: Part 1 | MillsJROSS | Tutorials | 11 | 07-24-2006 01:58 AM |
| Games Programming for beginners: Part 9 - Number conversions (PART 2 - DEC to BIN) | Nickenstien | Registered Members Only | 0 | 06-11-2006 04:45 AM |
| Games Programming for beginners: Part 8 - Number conversions (PART 1 - DEC to HEX) | Nickenstien | Registered Members Only | 0 | 06-11-2006 04:39 AM |