Mythruna
April 28, 2024, 11:41:52 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: 1 [2] 3
  Print  
Author Topic: Mansion of Azazel FINAL RELEASE [Shzylo's Text Adventure]  (Read 26003 times)
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #15 on: May 01, 2013, 09:33:15 PM »

You could just put it aside and take a break, then work on it again when you feel like it. Dropping a learning experience altogether isn't a good idea.

I have used a bit of methods within it.. I want to get to 20 rooms at max, i haven't even done 8 Tongue I have been trying programming with other criteria that is out of my league (such as McBukkit plugins) the furthest I got with Bukkit plugins is to reload the plugin and to make an item do something weird. EX: if i right/left-click something with a wooden axe, i lose health xD
If you aren't learning anything programming-wise with your text adventure then I say put it down and pick up something more challenging.

In the last month, I learned the Switch statement, which took me 1.2 minutes.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #16 on: May 01, 2013, 09:45:40 PM »

I proper text adventure would use data files for the rooms, exits, etc... if you haven't gone that route yet then there is an opportunity for learning.
Logged
Iggyjeckel
Donators
Hero Member
***
Posts: 510


View Profile
« Reply #17 on: May 02, 2013, 08:55:19 AM »

I finished my project, what started as a remake of pacman became a tiled based maze escape from zombies. Kind of sucks because it doesn't have everything I want on it but it's a good start.

I haven't played unns game yet but I'll take a look when I get a chance
Logged
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #18 on: May 02, 2013, 01:17:49 PM »

I finished my project, what started as a remake of pacman became a tiled based maze escape from zombies. Kind of sucks because it doesn't have everything I want on it but it's a good start.

I haven't played unns game yet but I'll take a look when I get a chance
Don't check the current version, buggy and only works with j7.

@Paul, I set up exits, entry points, ect., but probably not the way you may think of it. I will work on the Text-Adventure, get to 20 rooms at max, post it and the source code for anyone who wants to see how I worked with it Smiley
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #19 on: May 02, 2013, 01:26:46 PM »

I finished my project, what started as a remake of pacman became a tiled based maze escape from zombies. Kind of sucks because it doesn't have everything I want on it but it's a good start.

I haven't played unns game yet but I'll take a look when I get a chance
Don't check the current version, buggy and only works with j7.

@Paul, I set up exits, entry points, ect., but probably not the way you may think of it. I will work on the Text-Adventure, get to 20 rooms at max, post it and the source code for anyone who wants to see how I worked with it Smiley

I just figured you were doing it in code instead of in a data file.  Maybe you are even still using a bunch of if/else if/else if/else if blocks.  I haven't looked.

A proper text adventure will be using objects and data structures and the main loop won't have any game-specific code in it.  Just routing the commands.
Logged
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #20 on: May 02, 2013, 01:33:30 PM »

I finished my project, what started as a remake of pacman became a tiled based maze escape from zombies. Kind of sucks because it doesn't have everything I want on it but it's a good start.

I haven't played unns game yet but I'll take a look when I get a chance
Don't check the current version, buggy and only works with j7.

@Paul, I set up exits, entry points, ect., but probably not the way you may think of it. I will work on the Text-Adventure, get to 20 rooms at max, post it and the source code for anyone who wants to see how I worked with it Smiley

I just figured you were doing it in code instead of in a data file.  Maybe you are even still using a bunch of if/else if/else if/else if blocks.  I haven't looked.

A proper text adventure will be using objects and data structures and the main loop won't have any game-specific code in it.  Just routing the commands.
Yah,.. I am using else..if :/ I may or may not try to work with data files.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #21 on: May 02, 2013, 04:36:11 PM »

If I ever get around to writing a game programming book... this will all be covered in the first third (or so) of the book. Smiley
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #22 on: May 02, 2013, 04:39:48 PM »

...maybe doing some reading on the "command pattern" will give you some inspiration.  It won't necessarily help you structure your rooms and exits but can break you from having to have if( cmd == "go" ) { do this go specific stuff } else if( cmd == "take" ) { do this take specific stuff }
Logged
Iggyjeckel
Donators
Hero Member
***
Posts: 510


View Profile
« Reply #23 on: May 02, 2013, 06:10:17 PM »

If you write a book I'll buy it lol
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #24 on: May 02, 2013, 06:52:56 PM »

If you write a book I'll buy it lol

If I write a book it will be in sections sold as separate Amazon e-books until all sections are done and then I'd offer a "complete" edition in print.  The idea would be to put my advice of "writing a text adventure" and "write a simple Asteroids clone" into more detail for super-beginners.  In fact, in my imagination, for the text adventure section I wouldn't even include any complete sample code.  Just the excerpts here and there in the book.  The idea is to give some guidance learning game programming in "language of choice" and the theory is that having a completely working example would make it too easy to cheat.

The second section would be more tech-specific and I'd probably include a working app in that case... though I'm tempted to wait for the third section for that, too.

I imagine writing this a lot but I haven't even done one bit of work on it other than thinking about it every time someone asks me how to write a game.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #25 on: May 02, 2013, 06:57:21 PM »

And since after thinking about the other answer, I realize that over the past decade I've stretched how I use "command pattern" all out of shape, I'll provide another hint.

Here is what the Java code for your main control loop should look like:
Code:
BufferedReader in = new BufferedReader( new InputStreamReader(System.in) );
String line = null;
while( (line = in.readLine) != null ) {
    Command cmd = getCommand(line);
    if( cmd == null ) {
        break;
    }
    cmd.execute(line);
}

You could also preparse the line into command and arguments and just pass the command name to getCommand().  It's slightly less flexible but keeps you from having to parse the line more than once.  I think the gist of where I'm coming from is there, though.

Edit: modified the "null" condition to be the loop exit.
« Last Edit: May 02, 2013, 07:03:19 PM by pspeed » Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #26 on: May 02, 2013, 07:13:04 PM »

So, the engineer in me has me going against the "keep it simple" principles... so here's a revision that makes the concept simpler by parsing the command line ahead of time.

Code:
BufferedReader in = new BufferedReader( new InputStreamReader(System.in) );
String line = null;
while( (line = in.readLine) != null ) {
    if( line == null ) {
        break;
    }
    String[] args = line.trim().split(" ");
    String commandName = args[0];
    Command cmd = getCommand(commandName);
    if( cmd == null ) {
        break;
    }
    cmd.execute(args);
}
Logged
ebag51
Donators
Hero Member
***
Posts: 531


View Profile
« Reply #27 on: May 02, 2013, 07:28:43 PM »

this thread has been a vary informative example of how test adventure works
Logged

Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #28 on: May 02, 2013, 07:31:09 PM »

So, the engineer in me has me going against the "keep it simple" principles... so here's a revision that makes the concept simpler by parsing the command line ahead of time.

Code:
BufferedReader in = new BufferedReader( new InputStreamReader(System.in) );
String line = null;
while( (line = in.readLine) != null ) {
    if( line == null ) {
        break;
    }
    String[] args = line.trim().split(" ");
    String commandName = args[0];
    Command cmd = getCommand(commandName);
    if( cmd == null ) {
        break;
    }
    cmd.execute(args);
}
A modification, of what you have said HERE. Lol for once I linked you to something YOU have posted Smiley
Logged
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #29 on: May 02, 2013, 07:32:10 PM »

this thread has been a vary informative example of how test adventure works
There are multiple ways, but this way Paul is showing is the most efficient or close to most efficient way to make a text adventure, command part anyways.
Logged
Pages: 1 [2] 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!