Jump to content

  • Log In with Google      Sign In   
  • Create Account


Zork-like text game in C#

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

#1 Aliquis   Members   -  Reputation: 101

Like
0Likes
Like

Posted 02 August 2014 - 08:05 AM

Hello everyone.

I have just started to learn C#, and decided to make my first project a text RPG along the lines of Zork or Adventure. I have some programming experience with C++ and Java, so I am not a total beginner. My knowledge is a bit limited though, and I know nothing about C#. So, I wanted to make sure I do everything right from the beginning, to avoid stupid mistakes that will force me to redo the whole project.

I'd like my game to have a GUI - basically, a window with a text field, a line to enter commands, and some buttons to open other windows like inventory, stats, etc. How do I best approach this? I've read there are two different ways to make a GUI in C#, WinForms and WPF, which would you recommend?

Thanks.

Sponsor:

#2 RaoulJWZ   Members   -  Reputation: 595

Like
1Likes
Like

Posted 02 August 2014 - 09:10 AM

Altought i'm not a c# programmer, it seems better to me for you to start simple: 

maybe with a simple text-based RPG without GUI, while this can become quiete hard if you don't know anything about the language.

I know it isn't that cool, but it's a good way to get an understanding of the syntax and the principes (if you don't know these already from c++ and java).

 

I hope this will be a bit usefull for you and that someone else can maybe give you some c# information.



#3 Aliquis   Members   -  Reputation: 101

Like
0Likes
Like

Posted 02 August 2014 - 09:18 AM

I did make a simple game in C++ without GUI a few years ago, it had like 3 rooms, 2 monsters, 3 spells, something like that. So I'm fairly confident I'll be able to write something. It was probably very sub-optimally written though.

#4 Glass_Knife   Moderators   -  Reputation: 4101

Like
1Likes
Like

Posted 02 August 2014 - 09:34 AM


So, I wanted to make sure I do everything right from the beginning, to avoid stupid mistakes that will force me to redo the whole project.

 

If you ever figure out how to do this, write a book.  You will make a lot of money.  :-)

 

Making many games, all with errors, is the path to becoming a developer.  There isn't a short cut to skip this part.  Go make your game.


Edited by Glass_Knife, 02 August 2014 - 09:34 AM.

I think, therefore I am. I think? - "George Carlin"
Indie Game Programming

#5 Aliquis   Members   -  Reputation: 101

Like
0Likes
Like

Posted 02 August 2014 - 09:44 AM

But still, should I pick WinForms or WPF?

#6 Lodeman   Members   -  Reputation: 750

Like
0Likes
Like

Posted 02 August 2014 - 11:47 AM

But still, should I pick WinForms or WPF?

I have no experience with WPF, all I can tell you is that WinForms is incredibly straight-forward and easy to implement considering the needs you mentioned. So that would definitely not be a bad choice.



#7 Xai   Crossbones+   -  Reputation: 1363

Like
0Likes
Like

Posted 03 August 2014 - 06:51 PM

WinForms is outdated and has no real future, but it actually is incredibly easy to do something like this ... I actually found that my "zork like" prototype was easier in WinForms than as a console app, because I didn't have to think in terms of paying attention to building everything in the world in terms of term arrangement and layout.  Also, WinForms isn't too bad of an experience if you later use any other standard GUI library, like GTK#, QT, wxWindows, etc.

 

I gave mine a menu:  nothing but Exit and About to start ... later added New Game, Save Game and Load Game

A main output text area - where all the output was shown to the user.

A main input text box - for the user to type into.

AND - a debugging box, that had a second output text area (for sending debugging info), including outputting the "normalized" version of the user's parsed command (helped a lot in debugging early issues).

 

Good Luck.



#8 LennyLen   Crossbones+   -  Reputation: 3729

Like
1Likes
Like

Posted 04 August 2014 - 12:14 AM


Altought i'm not a c# programmer, it seems better to me for you to start simple: 

 

A basic GUI such as the one he wants is actually extremely simple using C# and Visual Studio.  My first C# project had a more complicated GUI (drop down menus that were generated at runtime as the data had to be read in from another program), and I finished the entire program in one afternoon, having never seen the language before or having ever used the IDE.

 

The game logic will be far more complicated than doing the GUI.







PARTNERS