I moved to a new URL! Check it out!

posts tagged with: tools

Dev Log: Productivity Experiements

Dev Log: Productivity Experiements
When the new year came about I was determined to break my cycle of endless procrastination loops. I find that my productivity is tied to my mood, and my mood is tied to my productivity, so when things are going great in either one of those then it's awesome, but if one of those drops then it's kind of a self reinforcing downward spiral into the abyss. It's not impossible to break out of it, but it is really really difficult.

When I got back from my holiday season travels the very first thing I did on my main workstation computer was completely block reddit. I'm using a website blocking extension for Chrome that will just straight up block the site entirely. Reddit is a big problem for my procrastination. When facing a super hard problem I could either sit down spend a lot of time trying to solve it... or maybe open a browser and type "r" and suddenly an hour has gone by.

I've blocked reddit before, but not as hard. Usually my previous reddit blocks have just been totally mental. I would catch myself starting to type in reddit and then divert to something else, but this time I wanted to try a more all out approach. Also I can still browse it on my phone which I still do sometimes before bed, but having it blocked on my computer I should be doing work on feels different.

In similar fashion I've also limited my Twitter and Facebook time on my computer to one hour every 24 hours. Other sites are included in this time limit but it's mostly the big T and F. I actually don't think Twitter and Facebook are that much of a problem for me, but it is nice to have a hard limit on it per day, and even just having that limit does make me mindful of how much time I'm actually spending on those sites. For limiting time on sites I'm using the Chrome extension StayFocusd. I think I've only ever hit the hour limit once, but there are some times where working on various projects does involve Facebook and Twitter usage.

Blocking and restricting sites on my computer felt weird at first. I thought "well if I do this won't I just immediately find ways around my own restrictions?" As time goes on though the restrictions feel more like a part of my routine. Since I only have an hour of Twitter and Facebook I spend very little time on those sites now, and the time I do spend on there is very focused and brief. I haven't really felt a need to go to reddit lately, and I feel like I might just be better off without it. If I really really want to browse it I can use my phone which is a separate entity from my work computer.

The last thing for now is toggl which I've mentioned before. It's a simple time tracking application which can also be downloaded as a desktop program. I have a couple of different work categories such as game dev, drawing, blog, misc tasks, and I put exercise on there to track that as well. So far it's been working out pretty well and I am interested to see the results of it after a month or so. It is useful to see how much time was actually spent on certain things during the day.

I'm not holding myself to any sort of requirements through the day. Right now I just work on stuff as much as I feel like I can. Between drawing, game dev, and other stuff I'm logging about 4.5 to 5 hours of productivity a day which seems pretty decent.

As a continue to experiment with productivity I'll be sure to talk more about the results. Right now things are going pretty well with a weird prototype. It's getting me back into the groove of coding which I'm hoping will transfer back to my current projects like Super Sky Sisters and Stratoforce.

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.

Visual Studio Asset Class Generator

Visual Studio Asset Class Generator
One of the key things I learn from every game jam is what the major knots are in my work flow. The past two jams I did with Otter had a common issue: getting assets from my assets folder to the game was annoying!

I don't like to rely on strings in my code to reference things. A typo can cause a major headache, especially when referencing a path to a file that needs to be loaded. Usually I like to just keep an Assets.cs class that has a bunch of static references to various file paths. Something like this:
class Assets {

static string Asset(string str) {
string assets;
#if DEBUG
assets = "../../Assets/";
#else
assets = "Assets/";
#endif
Console.WriteLine("[ASSET] Register asset {0}.", assets + str);
return assets + str;
}

public static string ImageIcon = Asset("img/icon.png");

public static string ImagePalette = Asset("img/palette.png");
public static string ImageTile = Asset("img/tile.png");
public static string ImageTiles = Asset("img/tiles.png");

// and so on...

This makes it so I can just do something like this later:
public Image Image = new Image(Assets.ImageIcon);

Instead of having to remember that the path to the icon whenever I want to use it, I just keep a reference to it in once spot. This drastically reduces the amount of typos I could possibly hit, and it also makes it easy to bring up with auto complete and intellisense stuff.

However the process of saving out a png, then remembering the exact path to the png, and then opening up Assets.cs and adding lines to it for every new asset every single time becomes a giant pain. The more assets I have, the more complicated this becomes, and the more I'm modifying the assets folder the more annoying it gets! Back when I was using Flash I created an asset generator script to overcome this, so why not just do the same for C#? Wouldn't it be awesome to just be able to click a button in Visual Studio and have an Assets.cs generated from the files in my Assets folder?!

Download AssetClassGenerator.exe (v1.0 Windows 11kb)

This program will execute in the console and build an Assets.cs file based off of the Assets folder in your project directory. This was built with my specific use case in mind so this may not be an exact fit for your needs currently.

Asset Class Generator for Actionscript 3

Asset Class Generator for Actionscript 3

The Reason


As I set forth to try and jam out the rest of this metroidvania game before GDC 2013, I've been trying to think of ways to make content generation as fast as possible. One of the big hurdles that I run into with AS3 when making a lot of content is constantly having to embed assets into the code. FlashDevelop makes this incredibly easy though. Right click a file, click generate embed, and there you go. However this still takes a lot of time when I'm talking about a game that is going to have nearly a hundred level files and who knows how many image assets, and I'm constantly switching assets around.

After a quick consultation with Twitter I got a crash course on Python and spent a couple hours making assetGenerator.py.

Download!


Download assetGenerator.py 1.0, along with an example project right here. You can also just view the code. All the files in the example project are blank files just to use as an example, and keep the download size tiny. Here's an example of the code it spits out. If you want to know more, then read the rest of the post!