Jump to content

  • Log In with Google      Sign In   
  • Create Account

What do I need to learn for a zork clone in C#


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 lotlat   Members   -  Reputation: 103

Like
0Likes
Like

Posted 08 June 2012 - 10:14 AM

Hello, this is my first post ever on the forum. I'd like to know what I'd first need to know to create a zork-like game in C#. I am an absolute beginner at C# programming but I do know some commands here and there. What kinds of commands would I need to learn to make a game like that, preferably in a book? I already know how to make those simple 1 2 3 option text adventures since it only uses the case break etc. commands. I don't feel like going into graphical gaming just yet, and if I do, I only want to stay 2D.

Sponsor:

#2 laztrezort   Members   -  Reputation: 968

Like
0Likes
Like

Posted 08 June 2012 - 01:00 PM

I don't want to disuade you (and perhaps I'm misunderstanding your goal), but Zork-like games (traditionally called interactive fiction, or text adventures) can get very complex. This is due to the rather complex world models involved, and the parser itself.

That said, you can throw together a very simplified type of IF parser by limiting commands to Verb + Noun (or just Verb). If doing this, I doubt you would need a "real" parser, just a series of switch cases. Adding a large number of verbs, or allowing more flexible input, will quickly render this approach infeasible, however.

If you are just beginning (which it sounds like), try putting together a simple three room adventure, where each room has a description, and allow movement between them by checking for cardinal direction commands. Later you can add items and inventory.

If you are past that point (which is doesn't sound like), then I can provide some links I found helpful when I was dabbling with IF parsers a while back - be warned, however, if you do not have any background in parsing theory it will be a large bite to take at once.

#3 lotlat   Members   -  Reputation: 103

Like
0Likes
Like

Posted 08 June 2012 - 06:47 PM

Hmm... I didn't know that games like that would be so complex. Okay, I guess I can start by making a simple maze game with the wasd keys and I'll come back when I become familiar with it. I heard that I could use booleans as a way of storing inventory but I don't know if it's reliable. Also, I've never learned about parsing, so do you have a link I could follow that could teach me more about parsing?

#4 laztrezort   Members   -  Reputation: 968

Like
0Likes
Like

Posted 08 June 2012 - 08:28 PM

There is just simple "parsing" which, in the above case, would just be getting input into a string, splitting it at the space character into 2 strings (verb and noun), then comparing them to known values (commands and nouns, the latter usually being items or objects the player can interact with).

Then there is the more technical definition, which is a whole different beast - I wouldn't worry about that now. If you are curious, Wikipedia can give you a rundown.

At this point it sounds like you need to concentrate on honing your programming skills. Incrementally add more complexity to something you have already written, or start the small maze project you mentioned. Make sure you understand string handling (which is amazingly great in C#), and reading and writing to the Console. Learn collections, especially List and maybe Dictionary. Become comfortable with using the standard library and classes - you don't need them memorized, but you should find them predictable enough that a quick glance at MSDN is all you might need to use something you haven't before.

Understanding Classes and object oriented programming will come in handy when your projects get to be larger and more complex.

I don't have any useful links to learning resources or books, but I bet if you search this site for "C# tutorials" or "C# learning" you will likely find some useful posts.

#5 Narf the Mouse   Members   -  Reputation: 318

Like
0Likes
Like

Posted 09 June 2012 - 01:19 AM

The only game I've never found complex is Guess My Number...Everything takes longer and is harder than you think, as a general rule.

Edited by Narf the Mouse, 09 June 2012 - 01:20 AM.


#6 lotlat   Members   -  Reputation: 103

Like
0Likes
Like

Posted 09 June 2012 - 01:29 PM

There is just simple "parsing" which, in the above case, would just be getting input into a string, splitting it at the space character into 2 strings (verb and noun), then comparing them to known values (commands and nouns, the latter usually being items or objects the player can interact with).

Then there is the more technical definition, which is a whole different beast - I wouldn't worry about that now. If you are curious, Wikipedia can give you a rundown.

At this point it sounds like you need to concentrate on honing your programming skills. Incrementally add more complexity to something you have already written, or start the small maze project you mentioned. Make sure you understand string handling (which is amazingly great in C#), and reading and writing to the Console. Learn collections, especially List and maybe Dictionary. Become comfortable with using the standard library and classes - you don't need them memorized, but you should find them predictable enough that a quick glance at MSDN is all you might need to use something you haven't before.

Understanding Classes and object oriented programming will come in handy when your projects get to be larger and more complex.

I don't have any useful links to learning resources or books, but I bet if you search this site for "C# tutorials" or "C# learning" you will likely find some useful posts.

Okay, thanks for the information >.< I'll come back in a couple months once I get the hang of it.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS