[C#] [1.1.0] Escape - A Console-Based RPG Like No Other
35 replies, posted
[B][U]Escape - A Console-Based RPG Like No Other[/U][/B]
[I]Current Version: 1.2.0[/I]
[I]Current Pre-release: 1.3.0-10.31[/I]
[B][U]Overview[/U][/B]
Escape is a project I recently started working on, with the purpose being to both learn C#, and change the way we think of text RPGs. While it may not look like much right now, there is much more to come. Please note that I have not started making the actual story, rooms, or items of the final game. This is currently in the "engine development" stage.
[B][U]Current Features[/U][/B]
Input interpretation with different sets of commands
Easy to manage world / item structure
Move between rooms; pickup, drop, examine, and use items, check your inventory
Saving and loading
Enemies
[B][U]Coming Features (by priority)[/U][/B]
Battle system (in development)
Stats (in development)
Puzzles in the form of mini-games
Interactive conversations with characters
Actual story!
[B][U]Source Code and Other Tat[/U][/B]
Please check out the source code on Google Code here:
[B][URL="https://github.com/ryansworld10/Escape/tree/master"]Source Code (Master)[/URL][/B]
[B][URL="https://github.com/ryansworld10/Escape/tree/develop"]Source Code (Development)[/URL][/B]
I ask that you please leave comments on the code to help me improve the game!
You can also download the current version of the game from here:
[B][URL="https://github.com/ryansworld10/Escape/releases"]Downloads[/URL][/B]
[U][I][B]Please leave feedback and suggest improvements![/B][/I][/U]
[url]http://code.google.com/p/escape-text-rpg/source/browse/Escape/Player.cs#47[/url]
wuts a dispatch table???????
[editline]3rd May 2012[/editline]
even if you want to avoid using a dispatch table, it'd be a good idea to reread about switch statements (specifically the part about default case)
[QUOTE=synthiackup;35804097][url]http://code.google.com/p/escape-text-rpg/source/browse/Escape/Player.cs#47[/url]
wuts a dispatch table???????
[editline]3rd May 2012[/editline]
even if you want to avoid using a dispatch table, it'd be a good idea to reread about switch statements (specifically the part about default case)[/QUOTE]
I didn't know there was such a thing as a dispatch table until now.
I know how a switch statement works (including the default part). Are you suggesting I just remove the command validation, and add the "Not valid" notifier in the default statement?
I get this error as soon as it launches.. [Windows 7 64bit]
[img]http://img.photobucket.com/albums/v701/roflmfao/escape.png[/img]
But I'm probably missing some important step that is going to make me look stupid for not doing.
actually i'm going to suggest that you use a dispatch table instead since you could easily factor out that WriteCommands() method by attaching metadata to commands in the table
[QUOTE=Averice;35804164]I get this error as soon as it launches.. [Windows 7 64bit]
[img]http://img.photobucket.com/albums/v701/roflmfao/escape.png[/img]
But I'm probably missing some important step that is going to make me look stupid for not doing.[/QUOTE]
Oh whoops, I just realized I uploaded the wrong exe file. Try downloading it again in a sec.
Edit:
Download fixed, try again.
[QUOTE=synthiackup;35804179]actually i'm going to suggest that you use a dispatch table instead since you could easily factor out that WriteCommands() method by attaching metadata to commands in the table[/QUOTE]
I'll put that on my todo list. I'll have to learn about dispatch tables first.
[QUOTE=ryansworld10;35804185]I'll have to learn about dispatch tables first.[/QUOTE]
dictionary + delegate/action
[QUOTE=synthiackup;35804250]dictionary + delegate/action[/QUOTE]
Ok so I tested it out, and its simpler to use a switch statement in the end. However, I did remove the command validation method to instead use the default case statement.
I can't seem to download the code rep with TortoiseSVN. What gives?
[QUOTE=Corewarp3;35827371]I can't seem to download the code rep with TortoiseSVN. What gives?[/QUOTE]
I'm using git, not SVN.
I'd suggest you not hardcode things like keys, rather have doors as their own entity with a linked key.
Also you should make a simple scripting language (or just implement one) and use that to create all the content.
[QUOTE=ryansworld10;35803143]change the way we think of text RPGs.[/quote]
I somehow doubt this, at the moment it's looking like a simple interactive fiction with a few combat elements, but keep working on it.
[QUOTE=Chryseus;35827547]I'd suggest you not hardcode things like keys, rather have doors as their own entity with a linked key.
Also you should make a simple scripting language (or just implement one) and use that to create all the content.
I somehow doubt this, at the moment it's looking like a simple interactive fiction with a few combat elements, but keep working on it.[/QUOTE]
1. The current way items are implemented is in no way final. I'm just testing out different things.
2. I have no clue how I would build a scripting language in it. It gives me more freedom in how different things act if I'm not limited by a scripting language.
3. This is so early in development, that you can't really make that conclusion at this point. I'm always learning new stuff as I go, and thus the way the game works will constantly change. Remember that this is mainly a learning experience for me.
Cool project man. I'm doing the same so I can learn C# and about Object Oriented Programming.
It's a Text Adventure, more influenced by ZORK, where you can make your own adventure by creating new areas, objects, commands and switches* in a text file.
*It's like an on/off status in the area, you can use it to set puzzles.
I have to say though your code is a LOT neater than mine; I will probably have to try to learn a few things while reading your source code.
Hey, here is a nice idea: C#/Net has a speech recognition function. Use it to double the fun :D
[QUOTE=Giacomand;35832960]Cool project man. I'm doing the same so I can learn C# and about Object Oriented Programming.
It's a Text Adventure, more influenced by ZORK, where you can make your own adventure by creating new areas, objects, commands and switches* in a text file.
*It's like an on/off status in the area, you can use it to set puzzles.
I have to say though your code is a LOT neater than mine; I will probably have to try to learn a few things while reading your source code.[/QUOTE]
You have no clue how happy it makes me to hear my code is neat.
Just have a look at some code from a Pong redux I made in JS, and you will see how far I've come in terms of code readability...
[url]http://code.google.com/p/pong-redux/source/browse/js/gameloop.js[/url]
[QUOTE=jack5500;35833016]Hey, here is a nice idea: C#/Net has a speech recognition function. Use it to double the fun :D[/QUOTE]
Oooh! I didn't know that existed. I'll have to give it a try when the game is mostly finished.
It's mainly just the Windows 7 speech recognition (System.Speech.Recognition) and it's still shitty for whole sentences, but it works pretty well for single words
[B]Update Released - v1.1.1[/B]
Whats new in this version?
[CODE]- Revamped command validation to only need a couple lines of code.
- Revamped the way text is positioned to support drawing blocks of text to a specific location.
- Text code is a little messy; will be trying to clean it up.[/CODE]
[B][URL="http://code.google.com/p/escape-text-rpg/downloads/detail?name=Escape%20v1.1.1.exe"]Download it here![/URL][/B]
[B]Update Released - v1.1.2[/B]
Whats new in this version?
[CODE]- Revamped UI to be more organized and pretty to look at
- Changed how notifications and errors appear[/CODE]
[B][URL="http://code.google.com/p/escape-text-rpg/downloads/detail?name=Escape%20v1.1.2.exe"]Download it here![/URL][/B]
Haha, brilliant!
I have been trying to get around doing a text based RPG too a few months ago but kinda forgot about it after a few weeks, this will be a really nice inspiration. Really nice work!
v1.2.0 will contain saving and the basics of the battle engine, so it will probably be a little while until it comes out. The saving part has already been coded, but the battle engine might take a while.
School is almost over for me so I'll be picking up development again shortly.
Please post any suggestions for features or fixes you have for the next version!
Items are now constructed as their own class type, instead of just items. This will allow for much more complex item structure.
[CODE]private static void GenerateItems()
{
Items.Add(new BrassKey(
"Brass Key",
"Just your generic key thats in almost every game.",
true));
Items.Add(new ShinyStone(
"Shiny Stone",
"Its a stone, and its shiny, what more could you ask for?"));
Items.Add(new Rock(
"Rock",
"It doesn't do anything, however, it is said that the mystical game designer used this for testing."));
}
[/CODE]
This is the new Items.cs.
[CODE]abstract class Item : Entity
{
#region Declarations
public bool SingleUse;
#endregion
#region Constructor
public Item(string Name, string Description, bool SingleUse = false)
:base(Name, Description)
{
this.SingleUse = SingleUse;
}
#endregion
#region Item Using Methods
public virtual void Use() {}
#endregion
#region Public Methods
public void NoUse()
{
Program.SetError("There is a time and place for everything, but this is not the place to use that!");
}
#endregion
}
class BrassKey : Item
{
public BrassKey(string Name, string Description, bool SingleUse = false)
:base(Name, Description, SingleUse)
{
}
public override void Use()
{
if (Player.Location == 2)
{
Program.SetNotification("The key opened the lock!");
World.Map[2].Exits.Add(3);
}
else
{
NoUse();
return;
}
}
}
class ShinyStone : Item
{
public ShinyStone(string Name, string Description, bool SingleUse = false)
: base(Name, Description, SingleUse)
{
}
public override void Use()
{
if (Player.Location == 4)
{
Player.Health += Math.Min(Player.MaxHealth / 10, Player.MaxHealth - Player.Health);
Program.SetNotification("The magical stone restored your health by 10%!");
}
else
{
Program.SetNotification("The shiny orb glowed shiny colors!");
}
}
}
class Rock : Item
{
public Rock(string Name, string Description, bool SingleUse = false)
: base(Name, Description, SingleUse)
{
}
public override void Use()
{
Program.SetNotification("You threw the rock at a wall. Nothing happened.");
}
}
[/CODE]
I need some opinions on what the best way to handle attacks would be.
Enemies are currently handled like items (each type has its own class). Should attacks be done the same way or should I store all attack information in the Attack method of each enemy?
For example:
[CODE]class Rat : Enemy
{
public Rat(
string Name,
string Description,
List<int> Stats,
List<int> Attacks)
:base(Name, Description, Stats, Attacks)
{
}
public override void Attack()
{
// Attack info would go here
}
}[/CODE]
Note: Could a moderator please remove "[C#][1.1.0]" from the title?
[B]Update Released - v1.2.0[/B]
Whats new in this version?
[CODE]- Added saving and loading
- Tweaked HUD
- Restructured item code to add flexibility
- Added incomplete enemy and battle code. Will be completed in v1.2.1[/CODE]
[B][URL="http://code.google.com/p/escape-text-rpg/downloads/detail?name=Escape%20v1.2.0.exe"]Download it here![/URL][/B]
So I decided to pick this project back up as of last month. Since then I've doubled the size of my code. Version 1.3 is coming soon! I'll either properly update this thread when it drops or just create a new thread.
In the meantime you can check out my recent progress on my new GitHub repo here:
[url]https://github.com/ryansworld10/Escape/tree/develop[/url]
ATM I'm trying to mod this. It's kinda weird to mod because this code isn't commented/documented (obviously). I'll try as best I can to make somethin' as amazing as I can make it with the limited amount of time I have right now.
[B][I]Edit:[/I][/B]
I bring you,
Escape: Retarded Edition
features your ass
I made this in 30 minutes
here you go: [URL="https://dl.dropboxusercontent.com/u/73524059/EscapeRetardedEdition.exe"]https://dl.dropboxusercontent.com/u/73524059/EscapeRetardedEdition.exe[/URL]
I'll release source code later but I'm tired so I guess you can live without it for a little bit
also I might try making something a little better when I have more time
also I don't know how to make new levels or add new mobs/items properly so if you could give me some insight that would help make Escape: Retarded Edition better kthxbai
[QUOTE=SteelSliver;42626651]ATM I'm trying to mod this. It's kinda weird to mod because this code isn't commented/documented (obviously). I'll try as best I can to make somethin' as amazing as I can make it with the limited amount of time I have right now.
[B][I]Edit:[/I][/B]
I bring you,
Escape: Retarded Edition
features your ass
I made this in 30 minutes
here you go: [URL="https://dl.dropboxusercontent.com/u/73524059/EscapeRetardedEdition.exe"]https://dl.dropboxusercontent.com/u/73524059/EscapeRetardedEdition.exe[/URL]
I'll release source code later but I'm tired so I guess you can live without it for a little bit
also I might try making something a little better when I have more time
also I don't know how to make new levels or add new mobs/items properly so if you could give me some insight that would help make Escape: Retarded Edition better kthxbai[/QUOTE]
This is funny as shit. Thank you for that.
On a serious note fortunately for you I am in the process of properly commenting the code. FYI I think you are using very old code from the master branch. Take a look at my develop branch.
[url]https://github.com/ryansworld10/Escape/tree/develop[/url]
[QUOTE=ryansworld10;42633740]This is funny as shit. Thank you for that.
On a serious note fortunately for you I am in the process of properly commenting the code. FYI I think you are using very old code from the master branch. Take a look at my develop branch.
[url]https://github.com/ryansworld10/Escape/tree/develop[/url][/QUOTE]
Yeah I assumed so. Adding new locations/mobs/items/other stuff seem to look better implemented in your newer code, so I might take a stab at it again this weekend :D
[B]New Pre-release! - Alpha 1.3.0-10.31[/B]
Whats new in this Pre-release?
[CODE]- Enemies
- Battle System
- Exp Points and Leveling
- Updated HUD
- Reorganized code
- Updated Saving and Loading
- Partial code documentation
...and some other stuff I don't remember off the top of my head.[/CODE]
[B][URL="https://github.com/ryansworld10/Escape/releases/tag/a1.3.0-10.31"]Git it here![/URL][/B]
[QUOTE=ryansworld10;42714433][B]New Pre-release! - Alpha 1.3.0-10.31[/B]
Whats new in this Pre-release?
[CODE]- Enemies
- Battle System
- Exp Points and Leveling
- Updated HUD
- Reorganized code
- Updated Saving and Loading
- Partial code documentation
...and some other stuff I don't remember off the top of my head.[/CODE]
[B][URL="https://github.com/ryansworld10/Escape/releases/tag/a1.3.0-10.31"]Git it here![/URL][/B][/QUOTE]
Oh my god! This is really beautiful! (I had in my had what i was doing while i was tipyng)
Really good job!
Sorry, you need to Log In to post a reply to this thread.