I moved to a new URL! Check it out!

posts that are featured

Google Spreadsheet Sync

Google Spreadsheet Sync
Have you ever wanted to take the contents of a Google Spreadsheet and drop it right into your game project? So have I! That's why I made a tool that will take the contents of a Google Spreadsheet and turn it into a C# code file full of data!

Demo


Let's say we have a spreadsheet full of data for our video game written in C#, and it looks something like this.

Image


The resulting output of that spreadsheet will be this.
class Sheets {

public static Dictionary<string, CharactersRow> Characters = new Dictionary<string, CharactersRow>() {
{"Adventurer", new CharactersRow() {
Name = "Adventurer",
Health = 100,
Magic = 100,
Attack = 100,
Defense = 100,
Speed = 100,
VictoryPhrase = "Nice try, \"chump!\"",
FailurePhrase = "Ah... well done..."
}},
{"Thief", new CharactersRow() {
Name = "Thief",
Health = 75,
Magic = 100,
Attack = 100,
Defense = 50,
Speed = 200,
VictoryPhrase = "I take what I want!",
FailurePhrase = "Not fair!"
}},
{"Assassin", new CharactersRow() {
Name = "Assassin",
Health = 100,
Magic = 50,
Attack = 200,
Defense = 50,
Speed = 100,
VictoryPhrase = "You're lucky to be alive.",
FailurePhrase = "How could you defeat me?!"
}}
};

public class CharactersRow {
public string Name;
public int Health;
public int Magic;
public int Attack;
public int Defense;
public int Speed;
public string VictoryPhrase;
public string FailurePhrase;
}

public static Dictionary<string, WeaponsRow> Weapons = new Dictionary<string, WeaponsRow>() {
{"Bronze Sword", new WeaponsRow() {
Name = "Bronze Sword",
Attack = 45,
Defense = 0,
Type = WeaponType.Sword,
Value = 100,
CanUpgrade = true
}},
{"Silver Bow", new WeaponsRow() {
Name = "Silver Bow",
Attack = 20,
Defense = 0,
Type = WeaponType.Bow,
Value = 250,
CanUpgrade = true
}},
{"Fire Wand", new WeaponsRow() {
Name = "Fire Wand",
Attack = 35,
Defense = 15,
Type = WeaponType.Staff,
Value = 400,
CanUpgrade = false
}},
{"Lasso", new WeaponsRow() {
Name = "Lasso",
Attack = 30,
Defense = 0,
Type = WeaponType.Whip,
Value = 150,
CanUpgrade = true
}}
};

public class WeaponsRow {
public string Name;
public int Attack;
public int Defense;
public WeaponType Type;
public int Value;
public bool CanUpgrade;
}
}

With a class like that in my project now it becomes very simple to get data from the spreadsheet with the key of the row (the first column.)
var charName = "Adventurer";
var health = Sheets.Characters[charName].Health;
var victoryPhrase = Sheets.Characters[charName].VictoryPhrase;
Console.WriteLine(victoryPhrase);

Download


Download GoogleSpreadsheetSync.zip (0.02MB)

Usage


I use Visual Studio, so I can only really tell you about that.

It's easiest to set this up as an EXTERNAL TOOL in Visual Studio.
* In Visual Studio go to the Tools menu at the top, select "External Tools..."

Image

* Click "Add"
* Name it something like "Google Spreadsheet Sync"
* For Command, press the "..." button to the right and find the exe.
* For arguments you can use "$(TargetName)" "$(ProjectDir)GoogleSheet.key"
* Include the quotes in those arguments!
* For Initial Directory put $(ProjectDir)
* No quotes in that one.
* Below that check the "Use Output Window" option.

Image


Before you run it though you're going to need to create a GoogleSheet.key file. That file should only contain google spreadsheet key.

For this example here's a URL to a published google spreadsheet: https://docs.google.com/spreadsheets/d/11Ia3wr-Pon1180M0_KRR1hywEITLn_P1BoUedbNQeqw/pubhtml

The key is that big long section: 11Ia3wr-Pon1180M0_KRR1hywEITLn_P1BoUedbNQeqw So in this example the contents of your GoogleSheet.key file should only be:

11Ia3wr-Pon1180M0_KRR1hywEITLn_P1BoUedbNQeqw

Save the file as GoogleSheet.key inside your root project folder. (So probably the same folder as your Program.cs)

Image


You should be all set to now run it from Visual Studio! It should appear in your Tools menu. You can even set a keyboard shortcut for it later if you want.

Run the tool from the Tools menu and what should happen is a Sheets.cs file is generated with all the data from your spreadsheets.

Image


Source


Of course it would be way better if you're able to take this tool and craft it into your own needs, so here's the source code!

I've started a public repository where I'll keep any useful tools I create right here.

Trouble?


If you run into any trouble feel free to post a comment and I'll try to help! Or you can reach me at hi@kpulv.com, or the contact form at the bottom of my site.

Starforger II

Starforger II
A few weeks ago I went to a local game jam in Phoenix! The them was discovery and I set out to make some kind of space exploration procedural thing. The final result was a game I named Starforger II. There is no Starforger I, but maybe I can make a prequel someday.

Download


Starforger II v1.0 - Windows (92mb)

Whoa what's with the file size? Well this game has a lot of weird sounds in it, and maybe I can figure out how to get them more compressed, but right now they take up a lot of space.

The game uses Enter, X, C, and the arrow keys, or a USB game controller (although the game is designed around the 360 controller, so using one of those would be ideal.)

Screenshots


Image


Image


Image


Image

All the King's Men

All the King's Men
Over the weekend I went to a local game jam in Phoenix to try out making a game using Otter. I was fully prepared to face the reality that Otter would have major problems preventing me from using it for this jam... but everything turned out way better than I expected. Check out the first game ever made using Otter!

Download


All the King's Men v1.0 - Windows (6mb)

Apologies to Mac and Linux people, I don't have a solid way to get builds for anything but Windows right now.

There's a readme included in the download that has some more info in it as well.

Screenshots


Image


Image


Image


What's Next


Eventually I would like to open source All the King's Men, but right now I need to figure out what kind of license I should use for it. Open sourcing a game is a little different than open sourcing a framework. I want to maintain control of the distribution of the game, but also allow people to look at and use the code for their own projects. Basically I just don't want people to edit the game slightly and then re-release it as their own work, or something sneaky like that. I'm sure whatever license I choose won't actually prevent that from happening if someone really wants to do that, but I guess I would still feel slightly better by using the right thing.

I also recorded a time lapse of the production of the game during the 48 hour game jam, so once I put that together I'll release that as well!

If you have any feedback then leave a comment, or stop over to the Otter forums.

Otter

Otter
For the past couple of months I've been working on a little framework using C# and SFML, and I think it's time to finally release it (in beta form) to the public!

Check out Otter!

Image


Right now Otter is only officially working in Windows with Visual Studio, but if anyone wants to figure out how to get it working in other programs and operating systems then let me know! The SFML dll files should be able to be used with Mono for Mac and Linux, but I don't know how to do that yet.

It's important to know that this is a beta release of the framework. There's still no official documentation, so you'll have to fumble around on your own for now if you're planning on using it. I also would advice against tackling any huge game projects for now unless you're comfortable digging into the source and changing stuff around yourself.

I'll be posting updates about Otter here on my web zone, and the latest version and updates will be available on Otter's website.

Platforming Ledge Forgiveness

Platforming Ledge Forgiveness
When it comes to making a cool platforming game there's all kinds of little tricks you can do to make your game shine above all the rest. I mentioned jump input buffering in a previous post and how silently helping the player out here and there can make a huge difference in the feel of your game. The topic of this post is very similar to that!

Image


Take a look at this typical platforming scenario. Our player is barreling toward a ledge at top speed, just holding right without a care in the world. They're going to want to jump when they get to the end of that ledge, and they're probably going to want to hit jump as late as possible so that they get the maximum distance out of their jump.

FlashDevelop to iPad Workflow

FlashDevelop to iPad Workflow
I recently got one of them new fangled iPad things and I heard on the internet that Adobe AIR is actually pretty decent at building things for iOS. Offspring Fling used Adobe AIR so I'm already a little familiar with how to build for Windows and Mac, but it turns out that iOS is an entirely different beast... sort of. The set up and configuration of the whole workflow can be a nightmare, but once it's over then you'll have a set up that lets you push F5 to build right to your device!

Follow along on this series of text and images and hopefully you will be enjoying pushing the F5 key on your keyboard and seeing an app pop up on your iOS device! Also put on some relaxing music because some parts of this tutorial might be hard to understand and frustrating. I'm using Windows 7 64-bit for this.