Scott Lilly has an excellent, excellent tutorial on his website for how to build an RPG in Visual Studio.
Not just one, actually, but two.
But today we're going to just get halfway through one of the tutorials (the beginner friendly one) and lay out the groundwork done so far to customize it and add some bells and whistles. So, we'll cover some coding, object-oriented programming, and game design.
This blog needs its own dedication/thanks page, but I wouldn't be here without the following dudes:
The Coding Train (Github for Poets)
Scott Lilly (Original Tutorial)
Mark (who kindly created a wonderful all-in-one PDF mockup of the tutorial)
Bob Tabor (for his course on Object-Oriented programming)
But this project is indicative of what learning C# is like in a nutshell: it's learning C# and everything else (design patterns, repositories) in bits and pieces.
The Tutorial (Est. 6-8 Hours)
Lilly's got an OLD and a NEW tutorial on his website, but really the difference between the two is that the OLD is more newb-friendly and the NEW has more bells and whistles. I started with the OLD but decided I wanted to blend the best of both worlds.
Now, there's no point in reiterating everything Scott Lilly has already put together. If you're in the process of learning C# too, I see no reason not to pop off here now and spend a few hours on the tutorial. Have some fun with it. There's even an excellent PDF version of the tut linked on his website.
General Train of Thought:
What I loved about this tutorial was the careful pacing and layering of concepts. I'm not sure how much I was helped by previous exposure to the concept of properties and classes and libraries, but I understood 90% of everything in this tutorial the first time through, instead of barely anything the whole way through. And along the way, it pretty much illustrates the core design concepts of Object-Oriented programming.
Object-Oriented Programming (Est. 4.5 Hours)
Between this tutorial and Bob Tabor's OOP course, I'm really starting to appreciate objects and classes. Sure, there's still debate over which approach in programming is best. But frankly, I don't care. Or, I should say, I care more about have clean, functional code that I can understand. I'll be able to afford opinions later.
Bob Tabor's course is $30 on his website. You definitely don't have to shell out that money in order to learn these concepts. Like I said before, Scott Lilly's tutorial pretty much illustrates the concepts as it goes along. However, Tabor has provided a lot of excellent free material over the years (such as this C# tutorial for absolute beginners), and I wanted to support him. (I'll also say the course had been sitting collecting virtual dust and was happy I found a project that went hand-in-hand).
Ok, but get this. Need a design for your code? Find your nouns. This approach was previously touched upon in Project #1. And here's an illustration of how Scott Lilly did it for this particular project:
But we'll cover more in the next blog.
My Game Design Choices (Est. 2 Hours)
Once the tutorial hit Lesson 11 and we created the World of our game, I took a step back and thought about what kind of world I wanted to create.
Lilly creates a basic RPG landscape, one populated with rats, spiders, rusty swords, and farms. Pretty much, it's a perfect template to run with, throw away , rework, what-have-you. At the risk of adding too much and never finishing the darn thing, I wanted to do some world-building a la Dark Souls and explain the world/make it interesting via the in-game descriptions.
I went with the wintery theme after considering (and not actually participating in) a game jam whose theme was "cold."
So, the first thing I did was take the World Map that Lilly created...
...sprinkled some thought over it, found an open-source mapping tool called Trizbort, dragged and dropped, baked it all, and came up with the following. Below is the first working result. Changes may be implemented as we go along.
And then I thought about the world, going back to that theme we mentioned earlier: cold. Eternal winters and Nordic landscapes are popular in fantasy for a reason. How to invoke that chilly nostalgia in players while also spicing things up a bit? All that thought went into the types of items and monsters, the names of locations, and the lore-rich descriptions.
(Items did not previously have a property for Item Description, so I added that to the Item base class. Hey look Mom, no hands).
This also opened up different avenues of gameplay. While more is explained in-depth in the Bells and Whistles section, I decided I wanted to add the following to the game design:
Alright, based on all of that, we can define the new additional classes and objects of this extended game:
Words of Power
Martial School (to store information on Attack/Defense/Evade maneuvers)
Mystick School (to store information on Light/Dark/Water/Fire maneuvers)
Ritual (dealing with the Victory, Defeat, and Player Progression after battles) (at least, I think we'll need a class for this)
DeBuffItem (added two poisons to the game that gave adverse side effects)
Alcohol (a special item that both buffs and debuffs)
I'll also need to modify the code for specific interactions with the Rusty Sword, which was now the only weapon in the game, but which could progress along similar lines with the player's progression. The player will be able to name the sword and use it to unlock certain areas.
To keep track of the list of items in the game and their descriptions, I went Full Geek and started making a spreadsheet on Google Sheets. Here's what we've got so far:
Bells and Whistles (Est. 6-8 Hours)
At this point I went over the NEW tutorial to see what was different. Would I have to start over from scratch?
(I should be honest and say that I looked at the NEW tutorial before I was even halfway through the OLD one, wondering what I needed to plan for).
What I liked best about the NEW tutorial was that it included Character Creation and more visual UI.
But I began thinking of my own design choices and how I could already look at implementing this early in the new conception stage.
One thing I wanted to do here (and in future projects) was more to put in more thought when it came to "clearing" battles. Specifically, the aftermath. Whether you're fighting a sewer rat or the final boss, most RPGs conclude battles in the same way: little victory diddy, XP points, gold, loot. You're essentially rewarded with a bell, a whistle, and a glorified Excel spreadsheet outcome.
Well, I liked the idea of battles also having an emotional impact on the Avatar (and player, with any luck). But nothing that would go so far and speak down to the player or make them feel guilty for "killing" things in game. Really, it was more about treating the world, the creatures, and the player Avatar more seriously--and so the player could feel like they were being taken seriously.
So, fighting the battle is half the battle. Or, I should say, half the reward. If a player successfully kills all enemies in combat, they must perform a ritual. This is just a cultural touchstone in the game world, but gameplay-wise, the player makes a small offering of thanks to the memory of the deceased. I remember reading somewhere about several different native American tribes doing something similar after a hunt. It's a Judeo-Christian tradition, too: historically, prayers of thanks were said after a meal.
So, no, it's not a plug for vegetarianism or anti-violence. But to my mind it does several things:
Rinse, Repeat, Release
Of course, now the next step is to continue taking steps.
I'm trying out my ideas as I'm following the tutorial, modifying as I go along.
And playtesting and debugging, ad nauseum as they do, till I get a working prototype.
Until then, uh, pray for me!
And hey, thanks for stopping by!
In Excelsis Deo.
Another day, another generator.
This generator provides a list of personality traits--but embellishes them with adverbs. To describe someone as accidentally protective or waspishly honorable piques my interest.
This one was still pretty simple and piggy-backed on the last generator I made, but I still had trouble figuring out how to cleanly loop or exit the application. I ended up copying the same method I used in the last project, but the whole structure has still been implemented in a slightly different way.
This is a generator I simply wanted for myself. Still trying to figure out how to make these applications playable--may eventually need to convert them, but for now, here's some examples of what you can get with this generator:
Till next time.
In Excelsis Deo.
What I Learned:
Till next time.
In Excelsis Deo.
Codewise, this project is way simpler than our Consignment Shoppe Demo. Probably because the Demo was coded by a professional and this one was coded by me.
Today we've got a simple Mad Libs console application in C#. It uses random, switch case, an array, Console.ReadLine, Console.WriteLine, and a loop.
I enjoyed doing this from scratch and having a finished product in less than an hour!
Here's the Code:
Arrays and Switch Cases:
The main hurdles were making sure the array, switch case, and random variable worked together. I may have cheated a little, but in order for each of the switch cases to match up with the appropriate author in the array, I put in a dummy string "" for the first array index. Without this dummy string, the random.Next feature would pick, say, Virginia Woolf, who is Case 5, but because Arrays index starting from 0 instead of starting from 1, Virginia Woolf was actually considered Case 4, so the text was off by one.
There's probably a better way to do that, but it worked, and this is all learning curve right now.
Instead of just one determined writing sample that plays out the same each time, I wanted to create a relatively tidy index of random writing samples from famous authors: Willy Shakespeare, Jane Austen, Homer, Virginia Woolf, Herman Melville.
So I created a random variable, gave it an index, and plugged it into a switch case--all things that would still have sounded like mumbo-jumbo about a month ago.
Clean Up On Lines 17, 18, 19...
Reminded of the importance of spaces when dealing with multiple lines of strings. The things you take for granted!
It's still not perfect, but at least it reads a little more clearly!
Replay Or Exit:
Had a bit of a time with this one, and it's still not the clean exit I want. But I learned the importance of method parameters. I originally had everything in the Main method, then realized I couldn't easily ask the user if they wanted to play or exit. So I put the main game loop inside a method called Start and then allowed the player to either choose to play again or exit. The exit still goes to debug mode instead of closing down the console, but for some reason neither this.Close, Application.Exit, or Console.Close/Exit/Whatever seemed to be recognized.
But the point, this baby is finished, and I know what areas I need to work on.
The writing samples used in the application are from the following:
1. Shakespeare's "Much Ado About Nothing"
2. Jane Austen's "Emma"
3. Herman Melville's "Moby Dick"
4. Virginia Woolf's "Orlando"
5. Vince Lombardo's translation of Homer's "The Odyssey"
Glad you were here; till next time!
In Excelsis Deo.
Recently I came across Jennifer Dewalt's inspiring website about, well, building websites.
A few years ago, Dewalt decided to learn to code by building 180 websites in 180 days. This struck a chord with me.
So I changed up my own website. There's now a tab called "100 Projects." And I'm going to split it into quarters. This website is about where writing meets games--so there's a lot to learn beside coding! But I immensely liked the idea of doing 25 Code Projects in 25 Days, followed by other subjects: pixel art, game design, UI, audio, etc.
But let's not put the cart before the horse. Today, taking inspiration from Dewalt, I wanted to funnel that syllabus I wrote a few weeks ago into these more streamlined deadlines.
Well, my first step was to create this super cool take on Rock Paper Scissors, complete with a new rule system and everything. But seeing as how I've been troubleshooting that all week, I realized that I needed some kind of goods to deliver. So I needed to think even smaller. More by-the-book.
So I found a two-hour C# tutorial that has nothing to do with game development but we're going to follow along anyway.
Project 1/100 = Consignment Shoppe
Step One: Bird's Eye View
When I pay attention to professional programmers, I find one thing they do right off the bat: they define their mission. It's more like they translate their idea into a bullet list of requirements. Once they have a list of the things they want to happen in their program, they can then underline the nouns and pretty much figure out what kind of classes/objects they will need to create. It's both a big picture and fine details approach, and makes code seem a lot more concrete and a lot less abstract.
For Tim Corey, he defined the consignment shop demo in the following way:
1. List of Vendors
2. List of Items per Vendor
3. Each Vendor should have a default Commission rate
4. Commissions can change
5. Track how much to pay the Vendor
6. Track how much to pay the Store
Step Two: Using Excel and Visual Studio To Create Back End Design
We can use Excel to quickly organize all our "moving parts" if you will, and organize them by class and data type. I've never been a huge fan of Excel, but I have to admit, looking at that simple and well-organized table did have a Zen-like effect on me.
Then, Corey set up what our UI should look like in Windows Form.
All of this before hardboiling any code.
This is what's meant by Back End Design: putting down the bones before we make them move.
Step Three: Wiring the Front End to the Back End
Step Four: Testing Small Changes
Step Five: Clean Up
What I Learned:
In Excelsis Deo.
K.W. writes novels, short stories, the occasional ode, game scripts, and (with actual evidence!), this here blog.