@ChevyRay Yeaah sucks. I really want to see how much changed between their original ideas and what they ended up doing too. (Today)

@ChevyRay I kinda felt like both season 3 and 4 needed way more episodes. (Today)

@EventheOcean <3 (Yesterday)

RT @EventheOcean: Re-tweet, it will help us with exposure! In-game screen from Even the Ocean! (repost) #screenshotsaturday #gamedev http:/… (Yesterday)

@theBanov disco guard (Yesterday)

@kinifi just 640 x 480. Nothin fancy (Yesterday)

@theBanov what! (2 days ago)

@BenRuiz Latch's special seems a little OP compared to everyone else's so you should always pick Latch (2 days ago)

@MarioKid591 hey sorry I forgot. Send me an email hi@kpulv.com (2 days ago)

@BomuBoi oh my god I hate these so much. "What if ash hallucinated Pokémon cause his dad died and he was sad" (2 days ago)

@BenRuiz LL is one of the best feeling games I've played in the past forever. Some minor visual criticisms but aside from that its NOICE (2 days ago)

@TommyRefenes PARCEIL ONIY!!! (3 days ago)

@AsherVo @ADAMATOMIC I'm pretty sure making a game that isn't playable in a weekend is impossible (4 days ago)

@tom_hunt haha oh man that's a slippery slope... (4 days ago)

@GreyAlien Hmm yeah that's good. Right now I'm tinkering with a board game and having fun editing spread sheets full of stuff. (4 days ago)

@GreyAlien I feel like I run out of simple things to do... haha (4 days ago)

Really wish I could figure out why my brain goes from being super productive to having no motivation at all UGH (4 days ago)

@kertgartner @gabrielverdon It seems that people are really getting into this "internet" stuff! Some are even using it for businesses! (5 days ago)

@gabrielverdon @kertgartner I thought canadian internet lines were wood. (5 days ago)

@gabrielverdon @kertgartner The internet lines get cold and moose nibble on 'em so they're pretty slow, eh? (5 days ago)

follow
search
posts filed under: tools

2014 - 11 - 30 / 9:59 pm / tools

Easy CSV Parsing in .Net

Easy CSV Parsing in .Net

Working on getting a public build of my latest game jam game up, and one thing I'm experimenting with is using CSVs for certain types of data. There's a bunch of enemies in the game that all have different stats, and usually I just store this information in the class for each enemy. Storing this data on a CSV has the benefit of being able to see all the data next to each other.

While I could achieve the same thing by having a dictionary set up in the code itself, storing the data in a csv file makes it a little bit easier to view and edit. Tweaks can be made more easily, and storing a bunch of data in dictionaries in code can get a little crazy looking depending on how much data there is to store.

Image

At first I was using OpenOffice Calc for my CSV editing, but there's a huge down side with that: file locking! OpenOffice thinks it's an awesome idea to put any file its editing into a crazy lock down mode, so I can't even read from the file while OpenOffice has it open. So I had to ditch it, and instead I'm using Ron's Editor. So far this is the best free csv editor I can find, even though it's a quite bit more strict about editing than a big spread sheet.

Now for loading the CSV data I'm using CsvHelper which makes parsing a csv as painless as possible. My enemies.csv looks like this:

EnemyType,Supply,Mass,MaxHealth
BasicTest,1,1,10
BigSkeleton,10,0,-1
TestPart,0,0,5


And the code to parse that looks like this:

var csv = new CsvReader(File.OpenText(Assets.Data.Enemies));
while (csv.Read()) {
var record = new Record();

record.EnemyType = Util.GetTypeFromAllAssemblies(csv.GetField<string>("EnemyType"));
record.Supply = csv.GetField<int>("Supply");
record.Mass = csv.GetField<float>("Mass");
record.MaxHealth = csv.GetField<int>("MaxHealth");

Records.Add(record.EnemyType, record);
}


I'm using a tiny class called Record to store the data. Record looks like this:

public class Record {
public Type EnemyType;
public int Supply;
public float Mass;
public int MaxHealth;
}


I end up loading the csv data into a dictionary with the enemy Types as the key, and the Records as the values. When an enemy is created it can look into that dictionary by using its own type and get out a Record object that contains all the data it needs to initialize.

var r = Records[this.GetType()];

AddComponents(
new Team(TeamType.Enemy),
new Heart(r.MaxHealth),
new SpriteEffects()
);
Group = O.GroupGameplay;

if (r.Mass > 0) {
AddComponent(new PushAway(r.Mass, Tag.Enemy));
}

var h = GetComponent<Heart>();

h.OnDeath += () => {
Death();
};
h.OnDamage += (d) => {
};


Pretty straight forward! I think I'm going to extend this to expose more fine tunings of things. It might also be fun to leave the files totally exposed for players to mess around with as well.

1 Comment

2014 - 11 - 25 / 12:04 pm / tools

Google Spreadsheet and nanDeck Workflow

Google Spreadsheet and nanDeck Workflow

One of the things I've been fiddling with for the past month or so is a prototype of a board game inspired by stuff like Dominion and Legendary and a mix of other stuff. It's been a collaboration with some of the local developers in the Phoenix area, and we we're getting to the point where hand writing a bunch of cards was getting really cumbersome, so I looked into tools for generating cards.

Image

I ended up finding nanDeck, which at first looks like a pretty weird program. Okay it is a pretty weird program, but after spending some time with it it really does get the job done. There are some basic tutorials that can get you started, and some neat posts about it here as well.

nanDeck has the ability to read data from a csv file. At first I was using Open Office to manage some spreadsheets and export them to csv files for nanDeck to import, but that wasn't going to last if I wanted to collaborate with others.

I converted all of my spreadsheets into a Google Drive spreadsheet so that I could share it with others, but now the question was how can I take all of that sheet and spit out a csv for each individual spreadsheet that is a part of the document?

The first thing I needed to do was download and install the desktop version of Google Drive. This lets me access my files on Google Drive as just files on my computer, much like Dropbox.

Next I needed a csv export script. I found one here, and then modified it to fit my needs more. The script runs the onOpen method and that adds a custom menu to the document so that anyone that the document is shared with can also use the script. Adding a script to a document is located in Tools, Script Editor.

Image

After loading the script I get a new menu option with my script function.

Image

The script ends up spitting out a bunch of csv files into a folder on my Google Drive. These folders end up syncing to my computer, and now all I have to do is move them from there into a folder where my nanDeck project lives.

Image

Image

That's where a Windows batch file comes in handy. I whipped up a quick batch file that will take all of the csv files from that generated folder and copy them into my project folder. Using some custom system variables it's easy to make this work on my various work computers just by setting those variables on each of them. Just using XCOPY works great.

XCOPY "%NANDECK_CSV_SOURCE%" "%NANDECK_CSV_DEST%" /S /Y /I


After the batch file runs all I have to do is click "Validate Deck" in nanDeck and it will update the data from the newly updated files, and now my new deck is ready to rock. Eventually I can even use nanDeck's command line features to copy the files and render the new deck from the batch file. Neat!

There's one major issue to look out for and that's using the Linked Data editor in nanDeck. If you click the button to edit the linked data, nanDeck seems to place the .csv file in lock down, meaning that XCOPY cant write over it. If this happens you'll have to close nanDeck to unlock the file so XCOPY can do its thing. As long as you don't use the linked data editor you'll be okay.

No Comments

2013 - 6 - 5 / 1:14 pm / tools

Some Shader Resources

Some Shader Resources

As I've been messing around with C# and SFML, one of the major benefits is the support for shaders! I've been crawling the internet trying to find examples of shaders, but for awhile all I could find were types like this that created entire images, or produced super elaborate effects that I wasn't really interested in.

Image

After a quick trip to Twitter I realized that what I was looking for were post processing shaders. I want to be able to adjust an image that I've already drawn for the most part, instead of creating new imagery. A lot of people gave me suggestions (mostly Sven) so here's a quick list of what was found!

GeekXLab
There's a handful of post processing shaders here that all look pretty neat, but unfortunately I can only get some of them to work with SFML right off the bat. Others throw errors that I don't yet know how to diagnose. They also have some software you can use to demo the shaders in, which is pretty rad! A couple of them worked right off the bat, like Thermal Vision, Dream Vision, and Pixelation, but the rest I have to mess with to figure out.

nVidia Shader Library
It turns out the nVidia site has a bunch of shader examples but unfortunately none of them seem to be in GLSL. The CgFX shaders should be able to compile into GLSL though. I haven't personally tried any of the shaders here, but it seems like a good sampling.

Image

hunterk GLSL Shaders
Somewhere a mysterious mediafire folder full of shaders exists. This one was pointed out to me by Loren, and I haven't dug too deeply into this yet. It's a lot easier to browse the sites that have previews of all the shaders, but it looks like there's a lot of cool stuff to be found in the depths of these files.

Shaders for Game Programmers and Artists
This book was recommended by Sven, and the fact that it might be also geared toward artists is interesting. This was published in 2004 and I'm not sure how much has changed in the world of shaders since, and I'm also unsure on how much focus there is on post processing vs. other types of shaders in here, but maybe worth a look!

Pixel Art GLSL Shading
I was also pointed in the direction of this beautiful piece of work which uses shaders to light pixel art in an incredibly good looking way. I haven't checked out the real time demo yet, but just that preview image looks absolutely delicious!

Photoshop Blend Mode Math
Of course there is this classic post about Photoshop GLSL shaders that I first started looking at in the early days of Snapshot development. I really wanted Photoshop blending modes since I do all of my art in Photoshop anyway. I haven't tried these out in real time yet in SFML, but it looks promising!

Image

That's all I got so far! I'll see what happens in the coming weeks in shader town. I've had some fun just pixelating and blurring and warping stuff so far. One of my next game projects in C# will be having a lot of special effects (I hope) so I need to become a shader master as soon as possible. If you know of any awesome resources not featured here please let me know!

Oh also here's a pro tip for writing shaders: don't use Visual Studio C#. It seems to be adding funky white space characters that causes the shader compiler in SFML to fail. So on that topic, what is an awesome shader IDE?

1 Comment

2013 - 5 - 8 / 11:41 am / tools

More Development Options!

More Development Options!

Since my last post about trying out a bunch of different engines and coding languages, a bunch more options were pointed out to me by various people through the comments and through facebook and twitter, so here's a quick rundown of these things I've never even heard of or considered until last week! read more

6 Comments

2013 - 5 - 3 / 4:05 pm / tools

Dev Log: What the hell am I doing?

Dev Log: What the hell am I doing?

I'm not really sure what I'm doing right now. I'm kinda going all over the place if you can tell from my past two or three weeks of blog posts.

I got back from GDC and I saw what people were working on and I felt kinda crappy about putting all this effort into yet another AS3 game with Adobe AIR. The problem is performance. Flashpunk has a hard time maintaining 60 frames per second because of weird Flash things... it's just not that super stable. Offspring Fling is a relatively simple 2d game and for whatever reason some people with modern computers have a hard time running it at 60 fps and this is extremely frustrating for both them and me.

Image

One day I went through some of my old prototypes. I took a look at Gaiadi, my Ludum Dare game from three years ago (WHAT THE HELL HOW IS IT THREE YEARS OLD ALREADY.) One of the most disturbing things about it was how smooth it ran. The Game Maker run time is actually pretty dang impressive and it runs at a solid 60 fps, especially when compared to flash. This made me actually feel pretty bummed because Offspring Fling isn't nearly as stable (at least in my eyes.) It's one of those moments where I asked myself "am I somehow getting worse at making games?"

Image

So I want to learn something new... but then I've already put all this work into this AS3 framework that I'm using. The amount of friction to start on something new is really tough, because right now in AS3 making things is extremely fast and efficient because I've solved a lot of my issues and have a bunch of helper classes with super fast solutions to common problems across my projects. AS3 just also has a ton of useful libraries that I make use of like TweenLite and AS3Crypto. read more

30 Comments

2013 - 3 - 11 / 2:27 pm / tools

Flashpunk NineSlice Class (Updated!)

Flashpunk NineSlice Class (Updated!)

Last week I posted a quick NineSlice class that I wrote to work in Flashpunk. It was a little clunky, so this past week I cleaned it up and integrated it with Flashpunk's graphic system. The new version now extends Image, so you get all the awesome Image effects like color tinting, rotation, scaling, and more. Check out the new version!

NineSlice.as

As a quick example, here's how I'm using it in my current project. Check out this screenshot of a menu:

Image
Thanks to the handy dandy nine slice object, most of this menu is just drawn with a couple of simple source images. I scaled them up 4x so you could see them a little better.

Image
Just using these images as sources means I don't have to make a new image every time I want to change the size of one of the widgets. I can also do some cool animations with tweening the width and heights of the panels over time.

Feel free to use the NineSlice.as class however you want. If you use it or improve it in anyway, let me know!

6 Comments

about

About

Hi there, my name is Kyle, and I'm a kid disguised as a grown up. I'm making video games and living the indie game developer life in Tempe, Arizona. Here you will find my thoughts, games, websites, doodles, and other stuff like that. I worked on Snapshot, Offspring Fling, and a whole bunch of other games. I also created and maintain Otter, a 2d game making framework. If you want to get a hold of me use the form on the bottom of the page, leave a comment, or just tweet at me. I try to post three times a week. Thanks for stoppin' by! You're the coolest.

facebook

videos

Do you want to make a Let's Play of one of my games, or a just a video featuring footage of my games? You have my full permission to do so! Even if you are monetizing your videos, you still have my full permission to use any footage from any of my games. Go for it!

contact

Your message has been sent! Thanks :)
SEND MESSAGE