Tuesday, November 3, 2015

Cutscene Creation

Here's a quick demo of the current build:



Designing and building a Cutscene Screen - used to convey narrative, or even a loading screen between other gameplay screens:

Switching Gears - A New Focus for the Month



We're getting really close to having an alpha of the Unity RPG system.  But right now there's really no content for the actual game I'm planning on building.  I have some character designs, world design and a rough plot, but none of the dialog, character and sprites or tilesets.  Even the stats, items and battles still need to be created. 

So I want to switch gears to focus on the creative side, instead of the hardcore bug fixing grindfest that we're in right now. 

Building the actual content of the real game will lead to thinking about programming problems that will arise.  For example – if there’s an ability of an enemy, player, or a boss fight with a scripting event and the current system doesn't support it, I'll have to go and build that.

So I'm thinking of tabling the project for the rest of the month, even the year, and really focusing on content.

I'll still be occasionally posting to this blog and youtube channel, but it will be character and world designs, tactical battle puzzles, art mock-ups and musings on RPG game design rather than hardcore programming.


Tuesday, October 13, 2015

Tiled - Terrain and Automapping

I finally figured out how to use the Terrain and AutoMapping features of Tiled with RPG Maker style spritesheets. I'm using the High Fantasy Bundle, which has a lot of awesome sprites, but was tough to get to play nicely with Tiled.





Examples:

Battle Tile Highlighting and Projectiles

Tiles in the Battle are now highlighted, depending on pending action:



Dev Stream of Projectiles shooting across the screen (arrows, spells, etc):

Saturday, September 19, 2015

Friday Night Gamedev Progress Report

Recorded yesterday - an update on the sprites, and showing off some of the new menus. Saving is also now functional!

Gamedev Timelapse!

I put together a timelapse of some gamedev from the other night. Turned out to be sort of fun to watch code and asset fine-tuning happen at 4x speed! Plus chiptunes!

May do this for some other long and boring coding streams in the future.

Closer to Alpha

I'm still here, hacking away. Here's my update on the current progress towards alpha, along with a demo of the latest build:



Friday, August 21, 2015

Character system and RPG Design - Brainstorming

Last night I also did some open ended brainstorming about character systems, progression, talent trees and rpg design in general. Here's the recording:

Building a Store - Part III

Here's the demo of the completed store -

Tuesday, August 18, 2015

Battles and Dialog Test wired up, and Building a Store

A big milestone was reached over the last two weeks. Wiring up the Battle Game with the DialogTest Unity projects. These are both merged together, share data structures, and live in the UnityRPG solution.

Here's a short demo walking through the current game on the dev branch:



I also started working on a store. Last night I was able to build most of the backend, and a rough UI. I'm still wiring up the UI to buy and sell, but should have that done shortly, and will stream the progress.



Thursday, August 6, 2015

Quest System Demo

Quick overview of the quest system in the RPG. Flags can be set in dialog, battles, or info-popups on screen.

Tuesday, July 28, 2015

2D TileArray from Prefabs, Loading sprites at runtime, Pause Menu and More!

Some highlights from the stream last night:

Demo of generating 2D TileArray from the Tiled Prefab, then using A* pathfinding for player movement:



Adding sprites to the gameworld:


 Pause Menu Implementation:

Friday, July 24, 2015

Wiring Tilemaps

Here are some highlights from last night's stream, where I made some new tile maps, then wired them up in Unity to the World Maps, and some dialog scripts:

 Creating Tile Maps in Tiled:

 Wiring up in Unity, and testing:

Tuesday, July 21, 2015

Down, But Not Out

I'm still alive and kicking!

I've been pretty busy with RL stuff the last few months, but I've been hacking away on a few things in my limited free time.  I recorded a session over on twitch to go over what I've been working on.  Here are the highlights!

I'm hoping to do a little bit of work every day, and post to the blog or stream at least once a week!


Tiled2Unity Demo

Object Triggers in Tiled wired up in Unity

Overview of the RPG tree structure

Thursday, April 9, 2015

Pre-Alpha 0.0.3, now with more explosions!

The build of pre-alpha 0.0.3 is here.

Notes:
-New project structure
-Battlemap defined in data, loaded at runtime
-Using temp gameobjects for particles, sprites and text popup notifications (floating damage, explosions, etc)
-New Font, Background images

Wednesday, April 8, 2015

Art Style Brainstorming

I've been brainstorming the style I want for the game I'm building over the last few weeks and months.  There will be fantasy elements, but won't be a straight elves-in-forest world.  I'm actually thinking of a story set on a distant planet, after the first wave of colonization has disastrous results for the locals.

So I'm trying to find a thematic and visual tone somewhere between fantasy and gritty sci-fi.  I like the ideas of spells and swords, and don't want everything cloaked in the stereotyped language of sci-fi.

Here are some background images I experimented with.  There are some cool filters to bring out expressionist / Van Gogh effects:





As far as sprites, I really like some of the classic JRGPs, with detailed and horrific looking beasts.  I'd like to avoid the overly cutesy chibi or anime style that’s pretty common in JRPGs though.  The Angband sprites are pretty great, but I'd like the final art to be a little more detailed and less generic-fantasy.



I really like BioWare style portraits for the dialog portions.  There are a few sets free online, and may use those, or work on photoshopping existing photographs into an appropriate style.



I really like Blizzard user interfaces.  The buttons are very clicky, and the workflow design is always simple, straightforward and intuitive.  The "flat" trend may have caught on in mobile apps, but I think in games, you still need some depth and texture to user interfaces, especially in something like an RPG, where the goal is to tell a narrative and enable tactical control, rather than pure immersion.



For sound and music, I actually really dig some of these ambient tracks.  A big boss fight can have an orchestral score, but if you are trekking through creepy caves and forests, ambient noises of dripping water or echoing wind is pretty great.

For now, building actual game assets is pretty far off.  I work from the code up, and get the game working mostly with programmer art.  Of course, plugging in a cool asset can dramatically change the feel of the game, and buffs morale when you've been banging you head against the wall for a while.

April Goals

The last few weeks have been pretty hectic with RL stuff, but I still have some realistic goals for April.  The 0.0.3 pre-alpha build is pretty much done, but there's a few finishing touches before I upload it.

Once its done, I'll be changing gears to focus on the tree structure that will drive the non-combat portions of the game.

-Complete 0.0.3 pre-alpha build
-new project structure
-battlemap defined in data, loaded at runtime
-using temp gameobjects for particles, sprites and text popup notifications (floating damage, explosions, etc)

-TreeTest demo
-loading sample world, zone, dialog and quest from data
-able to navigate using text interface
-able to navigate through Unity interface (with icons, backgrounds, etc)

-Story / Game Design
-Continue to brainstorm game title, style, story
-Narrow down visual style for user interfaces, pixel art, backgrounds
-Writing character design, dialog, etc
-Brainstorming audio (music, sound effects)

Friday, March 20, 2015

TreeTest

Just pushed a test project I've been working on to GitHub: https://github.com/tdonlan/TreeTest/

I'll be writing another post that explains in more detail what this is, but the code is out there.

Pre-Alpha 0.0.2

Pre-Alpha 0.0.2
Play: https://dl.dropboxusercontent.com/u/53832568/GameDev/0.0.2.html

Release Notes:
-Upgraded project to Unity 5
-Mouse-Wheel zooming of game board
-Configuration timestep for battle (enemies vs players)
-Fix to Haste/Slow abilities
-End Battle / Restart Battle buttons
-View Battle Log on Battle End screen
-Bug fix to AI that caused enemies to not act.
-Additional entries to battle log
-Fixes to Passive and Active Effects for items and abilities


Tuesday, March 17, 2015

GameDev Session - Pre-Alpha bug fixes



Here's a recording of the gamedev session from last night.

Things covered:
-Mousewheel zooming
-Variable timestep of player / enemy actions
-Fixes to multi-scene transitions with DontDestroyOnLoad / OnLevelWasLoaded
-Passive / Active Effects are now working for stats (Attack Ring, Haste, Slow)
-Some other minor bug fixes.

-New build of Pre-Alpha soon!

Friday, March 6, 2015

March Goals

Onto the next month of game development!  At the end of February I was able to hack together a rough battle-game demo (pre-alpha 0.0.1), which is playable below.

In March, I'm going to diversify my efforts.  Unity 5 was released, so upgrading the project is key.

I'm still going to work on implementing features and fixing bugs in the battle game, but also starting to do some writing about the world, story, and characters.

Lastly, one of the key pieces of technology I still need to make is a tree-traversal engine that can incorporate conditional / scripted logic.  This engine will be used to traverse the game map, dialog trees, and quests.  Look for a separate project / blog post focusing on the design and implementation of this.

March Goals:

  • Upgrade project to Unity 5
  • Polish / Bug fixes for the battle demo
  • Continue working on design of world, lore, characters, stories, quests, etc
  • Design of tree-structure engine that will power the map, dialog trees, quests, etc


Demo of new build


Watch live video from daydalus9 on Twitch

Pre-Alpha Release!

Here's the first rough build of the RPG!


Pre-Alpha 0.0.1 
Build Notes:
  • Improved Initiative List
    • Color coding for character type. 
    • Scrolls to fit screen
  • Current Player Avatar highlighted in Yellow
  • Enemy characters - red highlight
  • Player characters - green highlight
  • Mouseover character tiles - display stats
  • AP Count should be highlighted for Active Character
  • Show Battle Log on screen
  • Equipment Screen - Fixed to update for Active Character
  • Buttons should only be enabled during Player decision state

To Do / Known Issues:
  • Enemy AI - sometimes doesn't move. 
  • Enemy AI - only takes one attack, even if it has more AP
  • Improvements to mouse over stats (better buff/debuff indicator.  bugs with positioning)
  • Group Heal - temp effect should show up on all chars?
  • haste - not working?
    • how are we adding additional AP?  game needs to be more dynamic with 10AP
  • Able to quit / end battle from battle screen.
  • Some sort of end-battle stats (damage done, etc)
  • Dragon battle - killed someone -> crash
  • When you click a pending action (Move, Attack, etc), screen should indicate.  Select box should change (gray -> green?)  Red if move isn't possible.
    • need to have service to return bool, given location, if possible.
    • could also return patterns for Aoe effects.
  • PCs should start in semi-close position on battle, near edge
    • need to store extra data on board object for start locations - players / enemies

Tuesday, February 24, 2015

On character classes and balance


A staple of RPGs are character classes.  A few modern games have let the player accumulate skills without limit (Elder Scrolls series), but the majority of them lock the player abilities and progression to a fantasy archetype (warrior, rogue, mage, etc).  Of course, they inherited from Dungeons and Dragons, which codified the rules and powers from the old myths and fantasy classics (Greek mythology, Conan the Barbarian, Lord of the Rings).



So classes make sense from a narrative perspective, but what about from a game play perspective?  Particularly for a grid-based tactical combat game?  For that, we can look at the granddaddy of all grid-based combat games: Chess.

In chess, every "class" can kill any other, although their method of attacking varies.  They also have different move sets.  What makes chess interesting is that there isn't a straight curve of power. In some situations a knight is better than a queen, a pawn over a rook.

One way I've been looking at character classes is through their strengths and weaknesses, in relation to the grid-based tactical combat. Here's the breakdown:

mobility - how can a character move around the board (charges, teleports, diagonal)
range - how far away a character can attack (ranged weapons, spells, cleave, AoE)
damage - how much raw damage the character can inflict (crits, bleeds, poison)
survivability - how much damage a character can take (armor, resistance, regen)
utility - how can the character alter itself, allies, enemies or the board for the other categories (slow, haste, web, stun, shield)

In chess, the only attributes in play are mobility and range.  You could argue the "castling" move is sort of a utility of the rook.  But mostly, all the pieces have the same damage and survivability. 



Lots of RGPs try to create balance by giving all the character classes the same amount of power.  In a way, you end up with a single character classes "skinned" to look like a mage or warrior.  Chess blatantly has different powers in the pieces.  A queen can completely dominate the board.  But a knight can jump other pieces; a pawn can reach the end of the board and ascend to any other piece.  A chess game fought entirely of queens would be dull. 

So what I'd like to do in my RPG is take some tips from Chess and design classes that play in very different ways, and possibly aren't even balanced in relation to each other.  But in the context of grid-based tactical combat, each class would have use.

What I did was take the five attributes above and try to find some interesting combinations.  A lot of them end up as the classic character tropes from RPGs (heavily armored warrior, agile rogue, weak mage nuking from afar), but there some interesting ones as well.

mobility
range
damage
survive
utility
class?
1
1
0
0
0
fast archer
1
0
1
0
0
teleporting rogue
1
0
0
1
0
armored sprinter
1
0
0
0
1
bard
0
1
1
0
0
sniper
0
1
0
1
0
turret
0
1
0
0
1
buffer
0
0
1
1
0
blademaser
0
0
1
0
1
caster
0
0
0
1
1
armored cleric


Friday, February 13, 2015

Equipment Screen!

Here's a rough prototype of the equipment screen I've been building.  Will post a video once its fully wired up!


Tuesday, February 3, 2015

February Kickoff

January Wrap-up

In January the goal was to have a rough prototype of the battle game working in Unity, using a tileset to display the world, and controlling the player using the Unity UI.  Our current build we're able to Move, attack and use some of the basic abilities, despite a pretty rough user interface.

Since the holidays are over, I haven't had as much time for coding.  And lots of the work with Unity UI was simply experimenting with different techniques and APIs, so not all of it was directly productive.  But I think I have some good methods down now to do what I want (see the previous post on dynamic menus).

February Goals

By the end of February, I'd like to have a minimum viable pre-alpha build.  Here's what I'm shooting for:


  • 2-3 battles with an assortment of players / enemies to test difficulty / tactics / AI.
  • Functional menus for using Abilities, Items and changing equipment
  • Win/Lose conditions and displays
  • "Wrapper" menus that let you choose opponents, start battle, etc
  • Indicators in the UI for range of spells, area of effect, failure to hit, etc
  • More abstraction for loading resources from external files (maps, characters, tilesets, etc)


A more abstract goal I'll be working on in parallel:


  • Start brainstorming the story, characters, lore and gameplay elements of the game itself.  This brainstorming will drive the design of the actual assets used in the final game: graphic design of UI, tilesets, music, gameplay abilities, writing, etc.


I'm not sure I'll do as much streaming this month.  For one, my laptop is somewhat weak, and the stream lags and skips.  And lots of the plumbing I'm doing right now is pretty repetitive, boring, and not worthy of watching for hours on Twitch.

Once I get more into the content creation and testing, I'll record some more videos and post them.

Wednesday, January 28, 2015

Creating dynamic scrolling menus in Unity UI

Menus are a fact of life in any RPG.  There are menus for abilities, items, stores, quests, and tons of other things.  Thankfully, Unity UI has some nice tools to quickly build dynamic menus with custom content.  Here’s the recipe I’ve been using:

In Unity:

1. Create a panel to hold the Scrolling content.  Give this a name “AbilitiesPanel”.

2. Add a Game Object as a child.  This is the actual Scroll Container.  Add the Scroll Rect Component.

3. Add an Image Component, and a Mask Component.  These two are used so the scrollable content is “cut off” by the boundaries of the scroll container.


4. Create the scrolling content Panel, as a child of the Scroll Rect GameObject.  Give this the Vertical Layout Group Component.  Give the scrolling content a name and a tag (AbilityContentPanel) so you can quickly get a reference in script.



5. Drag the Scrolling Content to the content field in the parent Scroll Rect Component.




6. Create the UI content of each item inside the scrollable menu.  In this case, we have a parent Panel, with a child Button and Text UI elements, in a horizontal layout.



7. Add a Prefab to the Assets, in the Resources folder.  This prefab will need to be loaded at runtime, so it needs to be in Resources.  Give it a name (AbilityPrefab).  Drag your menu item to the prefab.  Once it turns blue, it’s synced with the prefab.  The original UI elements can now be deleted from the Hierarchy.



In Script:


1. Get a reference to your scroll content container.
Transform AbilityPanel = GameObject.FindGameObjectWithTag("AbilityContentPanel").transform;

2. Initialize the Prefab. Hold onto the created Game Object.
      
   var AbilityItemPrefab = Resources.Load<GameObject>("AbilityPrefab");
foreach (var ab in usableAbilityList)
 {
            GameObject abilityItem = (GameObject)Instantiate(AbilityItemPrefab);
updateAbilityButton(abilityItem, assetLibrary.getSprite(SpritesheetType.Particles, 0), ab);
            abilityItem = updateAbilityItem(abilityItem, ab);
            abilityItem.transform.SetParent(AbilityPanel, true);
        }
3. Update the GameObject components with the custom content from your list.

private void updateAbilityButton(GameObject parent, Sprite sprite, Ability selectedAbility)
{
        Image buttonImage = parent.GetComponentInChildren<Image>();
        buttonImage.overrideSprite = sprite;

        Button buttonClick = parent.GetComponentInChildren<Button>();
        buttonClick.onClick.AddListener(() => PlayerAbilityStart(selectedAbility));
}

private GameObject updateAbilityItem(GameObject abilityItem, Ability a)
{
        string abilityText = string.Format("{0} - {1}. AP: {2} Uses: {3}",a.name,a.description,a.ap,a.uses);
       
        //set click on icon
        UpdateTextComponent(abilityItem, "AbilityText", abilityText);

        return abilityItem;
}


4. Change the transform parent of the Initiated Prefab GameObject to the Scroll Content container.

   abilityItem.transform.SetParent(AbilityPanel, true);
 
That’s pretty much it. You’ll have to have methods that are called when you click on the button. And remember if you want to update your Menu, you’ll need to remove all the Initialized Game Objects from the prefab first.

Here’s a helper method:

private void DestroyAllChildren(Transform parent)
{
        for (int i = parent.childCount - 1; i >= 0; i--)
        {
            Destroy(parent.GetChild(i).gameObject);
        }
}
 
 

Tuesday, January 27, 2015

Game Progress

Short video showing the current progress:

Design in Brief

Here are the design goals I have for the game:

  • Turn based tactical battle system.  Multiple player characters, NPCs and enemies.  Complex spells, abilities, items that affect both the board and characters

  • Multiple character classes.  Level up both stats and abilities.  Can also find special abilities throughout game world (scrolls).  Abilities are defined by both the effect, and the pattern they have in the tileset.  When viewing abilities, should show both.

  • Nested and well-written dialog with NPCs.  Communication of the game narrative is primarily through dialog / stylized cut scenes?
    • Can have 2+ people involved in dialog.
    • Format is similar to old Bioware games: Portrait of speaker with text.  Multiple options for responses.
    • Traveling down certain paths locks the dialog / unlocks quests or items.

  • Exploration is done through a world map that populates with locations.  Locations can lead to further Location maps, which in turn contain scripted battles, NPC dialog, stores, etc
    • The tile-based map will only be used for tactical battles. Dungeon exploration / towns / world exploration simply done through maps that unlock visitable locations.  Non-combat exploration via tile based world is frankly boring but takes a lot of work.  Would rather have a single artistic backsplash + icons to represent town, dungeon, etc

  • Straightforward but system with depth: inventory, equipment, stores, crafting
    • Lists of icons + name.  Hover over to see detail / compare.  Auto-stacks.  Use checkmark to buy/sell multiples.
    • Crafting (discover by luck + find recipes)

  • Quests are revealed via dialog.  Quests are maintained in a game journal.  Instead of having everything defined directly (kill x, collect 5 widgets), the quest entry should simply paraphrase the game narrative, but also be able to review narrative so far.  

  • Data Driven: The majority of the game (98%) is defined by external data files and assets.  This will allow modders and players to change the game on the fly, create custom quests, even full games.  

Unity project on Github!

I've finally pushed the Unity RPG project up to Github: https://github.com/tdonlan/UnityRPG

This is the full source of what I've been working on, the integration of the turnbased battle game with UI / tileset in Unity.

Other oldschool RPGs

Some pretty good discussion on other RPGs being released or developed in the same style that I'm going for: http://www.reddit.com/r/gamedev/comments/2ts0js/are_there_still_decent_turn_based_rpgs_being_made/

Saturday, January 10, 2015

Screenshot!


Here's a screenshot of our game world, rendered in Unity using the Angband spriteset.  #screenshotsaturday

Sunday, January 4, 2015

Happy New Year!

Happy New Year!

It's always nice to get a free dose of motivation when the calendar resets.

We've made some good progress on the game so far - we have a semi-functioning battle game written in .NET that can be played through the command line.  The goals outlined in the first post are probably 80% complete.

Of course, there's a lot of code to be written for the AI, items and abilities, but the framework is there.  My philosophy with this game is to move fast and get a working structure in place, rather than fiddling around till something is 100%.

This month I'm going to be switching gears and mostly experimenting around in Unity.  I've done some small Unity projects in the past, but I'm a little rusty right now.  Spending some time in the environment is key to solving the big challenges I'll have down the line.

Here are my goals for January:

  • Unity
    • Get familiar  doing stuff in Unity
    • Accessing GameObject / Components
    • UI - user input, building menus, etc
    • Assets - Spritesets, animations, etc
  • Game
    • Linking the .NET gameworld to user entry / display in Unity


At the end of the month, I'd love to be able to load the game in Unity with an existing tileset (I'll be using the free Angbad TK spritesets from here ) and play using the mouse (move / attack).

Artificial Intelligence - Weighted Heuristics

One of the goals of my game is to have enemy AI that's robust enough to drive interesting and challenging battles, and also defined by external data. Ideally, enemy behavior would simply be defined by a few enumerated types, and from there, the state of the world (items, HP, positioning) and the enemy type (mage, warrior, priest) would lead to good gameplay.

It's going to be a while before I can say I'm at that point, but for now I've come up with an approach I'm calling weighted heuristics.


Watch live video from daydalus9 on Twitch

Each AI Actor has a collection of Actions, which have a weight and cost.

public Dictionary<AIActionType, int> actionWeightDictionary { get; set; } //static for life of character
public List<AIAction> AIActionList { get; set; } //updates every turn

    public enum AIActionType
    {
        Attack,
        RangedAttack,
        Heal,
        Buff,
        Nuke,
        Flee
    }

    public class AIAction
    {
        public AIActionType actionType { get; set; }
        public List battleActionList { get; set; }
        public int cost { get; set; }
        public int weight { get; set; }
    }


The default weights are defined by the enemy type, and range from 0-100. They can be thought of as a percentage that the action would be chosen.

A warrior would have something like:

case EnemyType.Warrior:
  dict.Add(AIActionType.Attack, 80);
  dict.Add(AIActionType.Heal, 10);
  dict.Add(AIActionType.Flee, 5);


while a priest would have something like:

case EnemyType.Priest:
  dict.Add(AIActionType.Attack, 10);
  dict.Add(AIActionType.Buff, 50);
  dict.Add(AIActionType.Heal, 75);
  dict.Add(AIActionType.Nuke, 50);
  dict.Add(AIActionType.Flee, 25);


The weights can also be altered each round. Healing self can be a function of current hitpoints:

int healWeight = 100 - ((character.hp / character.totalHP) * 100);


The cost of each action is driven by the actual battle actions available.

Ex: A warrior trying to attack someone 5 spaces away would cost 5 + weapon AP.

Once you have a collection of Actions, with weights and costs, you can sort them based on this formula:

AIActionList.Sort((x1, x2) => (x1.cost * (100 - x1.weight)).CompareTo(x2.cost * (100 - x2.weight)));


Once you have your sorted list, you can return the first action and get the optimum BattleAction the AI should take. If any Action Points are remaining, you can recalculate the list and get the next available Battle Action.

Right now I've built out the logic for attacking, ranged attacking (which will seek out the nearest LOS to fire the ranged weapon), and healing self. There's still a good bit more code to write, but the framework is there for the enemies to fight somewhat intelligently.