Sunday, August 29, 2021

Campaign Manager Progress

I've made solid progress on my Campaign Manager this past month. I'm hoping I can polish it sufficiently in the next month to post it to itch.io for others to try.

Some of the latest improvements:

- You can now drag a window to multi-select encounters. And consistent with other Windows apps, if you hold down CTRL you can add or remove selected encounters.

- Items within an encounter can be reordered and resized. (Arrow buttons on far right side.)

- You can define a player list for the whole campaign and a NPC list for each individual encounter.

- Then with a single click it can create a combat with automatically assigned initiative orders from the user entered Initiative Modifier values. Have the players report their initiatives and you're ready to combat. A "Health +/-" button is available to do the math for you as enemies are damaged or healed.

- I have several notepad files for my campaign that aren't encounter specific. Just notes of future campaign ideas, potential magical items, and player equipment. So now you can have a general notepad embedded in the campaign file to type anything you want.

- After each session with my players, I type out what we did so we have an easy reminder of where we left off for our next session (and so in a few years I can make a short book covering the entire adventure).

- And a whole bunch of other smaller changes.

Saturday, July 24, 2021

Campaign Manager

I've been running a DnD campaign for a couple years now. It's not only my first time being a dungeon master, it's basically my first time playing DnD. (Had 2 single sessions attempts as a player before that didn't continue.) The vast majority of my Dungeons and Dragons knowledge before playing came from listening to Critical Role Campaign 1, which is quite a few hours of education.

My campaign began with the DnD Starter Set, but I diverged pretty far by the time the players reached Wave Echo Cave. Before they reached the cave, I had added in hooks for future places to go and gone totally homebrew.

To organize my sessions, I've been using folders for each area the players may go to. The folders contains maps and text files of what they may encounter. There are references within one text file that may point to other folders or text files. I also attempt to play music during my sessions based on if the players are outdoors, in a tavern, in a battle, etc. However I frequently forget to swap it out when appropriate.

I've seen a variety of online tools for battle maps and individual encounters, but I didn't see a good way to manage your entire campaign. (Admittedly, I didn't look that hard. It's fun making my own program tailored exactly to what I need, so I did that...)

Presenting (the work in progress) Campaign Manager!

It is now at minimum-viable-product stage. You can add encounters, link them together, play music, and save and load the campaign.

Encounters are the individual pieces of a campaign. On the overview window for any encounters you've added, you can assign a name, status (editing, reviewing, done, skipped), background color, and links.

The + button on the encounter is how you get to the details. That's where you can add in links to files, websites, folders, text, checklists, and music.


Adding one of each...


You can pick and choose which items to add and have multiples of the same type. So I could have several websites linking to a bunch of monster stats, notes describing what the area is to the player, and appropriate music ready to play with a single click.

And there are no limits to the number of encounters and how they're linked...


(Oh, and you can set the background color and image.) Scroll bars automatically appear as encounters are added / moved outside the current visible window.

The encounter details are (optionally always-on-top) separate forms that can be rearranged as desired.


Future plans are a way to group encounters, sizable background images that can go behind encounters, easier ways to link encounters, and better ways to manage players with monsters / initiative order. I've got a couple other people that I'm hoping will try it out and give me feedback over the next couple months. Ultimately though I expect to publish it on itch.io for anyone to use.

Saturday, June 26, 2021

RPG: Skills

Stats in my game are things that can go up and down as you venture in the world. If you concentrate on melee combat, those stats will go up and spells will suffer. If you concentrate on spells, those stats will go up and melee combat will suffer. If you stay a balanced player using both, then all stats can be high, but it will be essentially impossible to keep them all maxed.

Skills though are something that you learn and never forget. Even getting knocked out, your stats may go down but your skills won't budge. Repeat from my post on stats: "You never forget how to ride a bike, but if you haven't been on one in a couple years you're not going to win the Tour De France."

What I don't like:

I hate when games only allow you to pick a single skill to improve each time you level. I don't have a problem with requiring points in lower skills to unlock higher skills, but it's designed to force you to concentrate on one skill path. Trying to be a well rounded character or attempting to try all skills just means the "good" skills you want in the end game are never going to be as powerful as they could have been. This is my only real gripe with Diablo 2.

What I like:

A few decades ago, I played a MUD (text based Internet telnet game) that had the best implementation of skills I'd ever seen. They were all in categories and subcategories, and improving a single item in a subcategory would benefit everything in the tree.

For example say there were short swords, broadswords, longswords, daggers, and spears as available melee weapons. And say my character mostly used a short sword but just started using a broadcast. His skill tree may look something like this:

- Melee Weapons : 5
  - Swinging Weapons : 15
    - Short Sword : 30
    - Broadsword : 25
    - Longsword : 15
  - Thrusting Weapons : 5
    - Dagger : 5
    - Spear : 5

Using any melee weapon increases the overall "Melee Weapons" value a little. With how much my character has used short swords and broadswords, the overall value has reached 5. Any subcategory of "Melee Weapons" will be at least 5 as well. Since my character hasn't used thrusting weapons, it's a 5 and each thrusting weapon is 5. Which makes sense... although the motion of a swinging weapon is very different vs a thrusting weapon, someone highly experienced in one can likely pick up the related melee weapon very quickly.

Digging down a bit further, short sword is the highest (because that is what my character practiced with most) followed by broadsword (next highest). My character has never used a longsword, but because he has so much experience in swinging weapons, he automatically has a skill level of 15 in that.

This was absolutely something I wanted in my game. I haven't broken it out to specific weapons, but skills are now categorized with subcategories. Improving a skill in a subcategory ultimately helps all skills in that category.


Spells are broken out as well...


In the process of implementing the skills, I also added more capabilities. For defense, there is blocking and dodging. If you're holding a shield, it uses blocking. Otherwise it uses dodging. So now you can use shields in my game.


Additionally, the game now supports single handed weapons, two handed weapons, and dual wielding two single handed weapons. If you pick a weapon combination that is not acceptable, then it puts a red mask over the weapon so you know it's not in use.


In the above screenshot, I'm holding a single handed weapon and a two handed weapon. Since both hands are required for the two handed weapon, it's masked in red and I don't get its attack benefits. If I stop using the single handed weapon though...


It becomes available and I get its full attack benefit. How about the one handed weapon and a shield?


Now players can have interesting combinations of two handed weapons, dual wielding weapons, or mixing single handed weapons and shields. The more they use a certain combination they more they'll improve with it, but they can still switch to other weapon types without it being a complete loss.

Wednesday, May 26, 2021

RPG: Attack Types & Resistances

May has been a great month for improvements to the game. Invisible to the user was reworking memory to handle large numbers of terrain types, items, characters, and animations. Characters unarmed attack sounds were externalized along with timing of the weapon attacks. 

On the visible side to the user are Attack Types and Resistances.

There are 6 damage types: blunt (a club), piercing (a dagger, bow), slashing (a sword), water, fire, and electricity. The last three are used in spell attacks and magical weapons.

Each character has its own unarmed damage types. My "rats of unusual size" do piercing damage for their unarmed attack whereas my humans do blunt unarmed attacks. Swords do slashing damage. Any weapon or spell can have any combination of any value of damage types. For example a Blizzard spell does blunt and water damage.

The attack stats are shown to the user; unarmed my player only has a blunt attack of 0.2

Armed with a sword my player has a slashing attack of 1.

In addition to the attack type, each character has its own base resistance. For example trees are resistant to piercing and water damage. Items can adjust a character's resistance.

If I equip some armor, my blunt and piercing resistances go up.


Skills are next up to be revamped, and I already have significant progress on them. That however will wait for the June update.


Sunday, April 25, 2021

RPG: 3D Art Assets from Unity

I really like the Diablo 1 / Diablo 2 art style, but I don't have the time or skill to model that number of 3D characters. Even though I'm not using Unity as the game engine, it has an asset store with a huge library of 3D models that many of which match my desired art style. So, how about use the Unity art assets and just convert them into sprites for my game? I had no experience with Unity and I've got plenty of work to do without becoming a Unity expert, so I attempted the least amount of work possible to generate usable sprite sheets.

To generate the sprites from the 3D models, I found an asset called "Animation Baking Studio" for $24. As a test I found some free models that I'll likely replace in the future, but they're far better placeholders than the eyesores I had before.

My steps to produce a sprite sheet from a 3D model (written here for my own documentation just as much to help someone else!):

1. Create a new Unity project.

2. Wait for it to build...

3. Go to Window->Package Manager, under Packages select "My Assets". Import "Animation Baking Studio" and the desired art model.

4. Wait for the import...

5. Navigate to Assets->AnimationBakingStudio in the Project, double click Studio. Studio will be selected in the Hierarchy.

6. Delete the sample models under the Hierarchy.

7. Navigate to the desired asset model, drag from the Project folder into the Hierarchy window.

8. Select the new art model in Hierarchy, in the Inspector on the side, click add Component and select "Mesh Model (Script)".

9. Drag all desired animations into Mesh Model (Script) Animations list. This is so the AnimationBakingStudio will know which animations to apply to the character.

10. Select "Studio" under "Studio" in Hierarchy. In the Inspector "Models" section, drag the desired art asset in.

I'm still fine tuning the options to find what works best, but my current setup is as follows:

Main Camera:
  Perspective, Field of View 60 deg
  Relative Distance, 2
Directional Light: Directional light (Light)
  Follow Camera Rotation Checked
  Follow Camera Position Checked
Model Rotation:
  View Slope Angle 30
  Show Reference Tile Unchecked
  View Size 8
  Base Angle 0
  Angles checked: 0, 45, 90, 135, 180, 225, 270, 315
Shadow Type:
  None
Extractor:
  DefaultExtractor
Apply Variation:
  Unchecked
Show Preview:
  Checked
  Background Type: Checker
Resolution:
  X: 150, Y: 150
  Frame Size: 10
  Simulate: 0
  Delay: 0
Trim:
  Unchecked
  (Ensure Unified for All Frames is also Unchecked, otherwise a bug prevents it from generating the animations. Developer said they'll have the bug fixed in the next version though.)
Pack:
  Unchecked
Make Animation Clip
  Checked, Frame Rate 20, Interval 1
  Make Animator Controller Unchecked
  Make Prefab Unchecked
  Generate Normal Map Unchecked
File Name Prefix: Empty
Output Directory: As Desired

11. Once the options have been entered, click "Bake all models".

12. And wait for the render...

13. When it's complete, navigate to the sprite sheet folder and enjoy!

I made some modifications to how sprites are loaded in my game so I don't need to do any additional processing on the images. The game can load the Unity exported images as is; including even the files names. I still have some changes to make to support all the animation frames, but the proof of concept is overwhelming successful.

Again long term I'll likely not use these 3D art assets, but it's a gigantic step from where I was and now I've developed the process for potentially all future characters in the game.

There may be better ways to do this in Unity, but so far this has been the least amount of effort for greatest return I've found.




Sunday, March 28, 2021

RPG: Map Pins / Packaged Build / Sounds

Map Pins

This month had many improvements in the game. First off are Map Pins. I don't like the modern ARPG mechanic of "here's a quest you don't need to read, here's an arrow on your mini map pointing directly to the quest location, break everything there, and after that you'll get a new arrow with where to go next". Players don't read the quest text because there isn't any need to. On the other hand, modern players aren't going to get out the graph paper and take copious amounts of notes (nor should they have to).

I liked how Dragon Warrior on the NES did quests. You had to talk to the NPCs to get clues on where to go and what to do. But if you wanted to have any sort of break from the game, you were going to have to jot down a few notes to remember how everything came together for the next time you played. Just a few words and a marker on the map would suffice.

My game's presentation is of a giant map you're walking around on. What better way for a user to write down notes on quest items than as pins on a map. In the bottom right section under Notes, you can select to "Add Map Pin".


A dialog box will then appear where the map is centered asking for a name. (You can pan the map using the middle mouse button, so the map pins can be placed anywhere; not just where your player is.)


Give it a name, and the pin is placed! Multiple pins on the map...


Adding pins for areas I've never even been to but someone told me to go there...


You can toggle the visibility of the pins with the "Show Pins on Map" checkbox. Now someone can play the game, get a clue of a quest item, mark it on the map, and even if they don't play for weeks they'll have their notes loaded and ready to go. But at the same time it's not the modern complete hand-holding of a "go here arrow".  


Packaged Build

Something very important in software development (or anything really) is fast iteration and minimizing steps to deployment. When just debugging on my local computer it wasn't a big deal, but I commonly test this multiplayer with other computers. I've added a Post-Build event when compiling in Release to execute a batch file that packages the game up in a ready to deploy zip file.


One click in Visual Studio and I have a build ready for release...


It's not uploading anywhere (I'm not at that point yet), but that will be the natural addition to the script when the time comes.

Sounds

A while ago I had added random sounds that game characters could play (birds chirping from trees). Last month I added sounds when you got hurt. I had considered sounds to be a minor part of the game, but the more I played with them the more ideas I had.

All the code handling loading sounds and what sounds to use has now been externalized. Terrain tiles can now play sounds (waves on the beach), different sounds play depending on what you're moving on (walking on gravel vs walking on dirt vs walking on stone), and attack sounds play when using weapons. All volumes are adjusted based on your distance from them source of the sound.


These few additions have really made the world more immersive. When standing in the town, a street musician could be playing a song (fairly loud if you're close by). The beach isn't far off so you can hear the waves on the shore but much quieter than the musician. Then occasionally you'll hear birds chirping from the trees. If you walk through town on the path you get a unique sound for it.

Since the birds chirping is random and the volumes are based on your distance, it sounds very natural and immersive. (And if you cut down all the nearby trees, you won't hear birds singing anymore!) Sounds went from a minor part of the game to something that can be really key to the gameplay.







Sunday, February 28, 2021

RPG: Various Updates

Various updates this month to the game:

  • Packet counter to debug network message traffic.

Which was used to dramatically reduce the number of packets sent over the network so it's far more efficient.

  • Fixed bugs with the new collision detection / avoidance and pathfinding.
  • Now playing "hurt" sound effects when the player is hit by a monster.