I moved to a new URL! Check it out!

Otter Example: Tweening

Otter Example: Tweening
Did you know that Otter supports tweening? Now you do! Tweening is one of the coolest things in the world in my opinion and it's one of the easiest ways to create sweet effects and animations in games.

Image

(I don't know what's up with the end of this gif so whatever.)

Otter makes use of the Glide tweening library by Jacob Albano. It has a similar syntax to TweenLite from the AS3 days of using FlashPunk, and since Otter is based off of FlashPunk having a syntax similar to a flash tweening library makes a lot of sense to me.

Check out the full source code of this example on the Otter example page!

Doodle Post

Image

Dev Log: GUI Stuff

Dev Log: GUI Stuff
I've been making some good progress on my latest prototype over the past few days. I got a quick GUI system working in the game but then quickly realized that my approach was pretty bad. After reading up on some articles written about making simple lightweight GUI stuff for video games I scrapped almost all the code and rewrote it.

My first approach was just having each GUI Entity operate independently and that worked for a bunch of simple cases such as a single drag and drop item, or a button that does something when it's pressed. However doing things beyond that, such as multiselect, and having different GUI elements pass info along to one another, requires a different approach.

The approach I settled on for now is something I've done briefly before with a quick prototype a few months ago. I'm now electing to use a single "controller" class as the base of the GUI system. The controller has a list of all the GUI elements it's in charge of, and almost all of the logic for the system is handled inside the controller.

Image


A controller has a list of child elements that it controls, and each element can also have even more child elements added to it. The controller is the only element that receives input from the game, and anything resulting from that input is passed along to the appropriate element on the list of children.

I still have a little ways to go on a few things. I want to be able to get modal elements working so that I can do things like message boxes that have to be cleared before continuing and interruptions when important things happen. There are still a few bugs to sort out with clicking through elements and dragging stuff around, but so far I feel like my progress has been pretty great and I might have something playable way sooner than I thought!

Doodle Post

Image


Image


Image

Dev Log: RPG and YAML Stuff

Dev Log: RPG and YAML Stuff
With the move to Denver pretty much complete I've gotten back into some sort of groove of working on stuff, but I guess my brain must've been pretty scrambled with this sudden weather change because now I'm taking some time to work on a completely different project again!

This is actually a project I've worked on here and there over the past year, but I think I finally have narrowed down some ideas in my head on more of the finer details and that's inspired me to work on it some more.

Without spoiling too much about it: it is some sort of RPG, and it does have some sort of procedural generation element to it. I've been digging into using YAML for the data since I've been looking for something easy to parse and easy to write out. I think the failings of JSON and XML are that it is a giant pain to write out by hand, so YAML seems to be covering that gap quite well.

Here's an example of some of my YAML data:
---
bob:
name: "Bob"
health: 10
money: 5
drop: [null, null, basicattack]
color: ff0000
combat:
- Attack 1
- Attack 1
- [Attack 1, Attack 1, Charge]
- Attack 1
- [Flee, Defend]
- Restart
...

And to parse it in Otter I'm using a library called YamlDotNet. It makes parsing YAML pretty easy but unfortunately it is lacking in documentation and community.

The parsing code for the above data looks like this:
// An enemy class to match the structure of the YAML
public class Enemy : DataObject {
public static string DataPath = Assets.Data.Enemies;

public int Health { get; set; }
public int Money { get; set; }
public List<string> Drop { get; set; }
public List<object> Combat { get; set; }
public string Color { get; set; }
}
...
// A method to load the data from the YAML
enemies = Load<Parsed.Enemy>();
...
// The method to load the data from YAML
static Dictionary<string, T> Load<T>() where T : Parsed.DataObject {
string dataPath = "";
try {
dataPath = (string)Util.GetFieldValue(typeof(T), "DataPath");
}
catch {
throw new Exception(string.Format("No data path found on type {0}", typeof(T)));
}

var dict = DD.Yaml.Deserialize<Dictionary<string, T>>(File.ReadAllText(dataPath));
dict.Each((k, v) => {
v.Id = k;
});
return dict;
}
Normally I would be using my Google Spreadsheet tools for data, but unfortunately spreadsheets break down at a certain point. When my data starts to need more than just scalar values in each field spreadsheets become a pain to use. Basically if I want an enemy to have a list of attacks to perform on the player I have to enter that list into a single cell of a spreadsheet which just doesn't look or feel good.

More updates on this and hopefully Super Sky Sisters coming soon!

Doodle Post

Image