Apple's new iPad comes out today, that's pretty cool. I've been debating the pros and cons of getting one myself; and for now I'm leaning to not getting one for the immediate future. I'd love to have an iPad to play with and to develop games on, however right now those 2 reasons aren't quite enough to justify dropping $5-600. I'm still working on an iPhone project, and the iPad would easily distract me because I'd want to play with it.
Speaking of which, Unity3D just came out with an update to their iPhone SDK, Unity iPhone 1.7. I'm pretty stoked about that update, especially being able to play your game in the iPad simulator. That'll let developers without an iPad get a feeling for how their game will look running on the iPad device (not a perfect example though). I already downloaded and installed the update, however now I'm waiting to finish downloading the most recent iPhone/iPad SDK from Apple. Once that's finished and installed, I'm going to rebuild my current test project and upload it to my phone to check for problems. The Unity folks do a fantastic job with their updates, but every now and then a problem slips in, so it's always good practice to do some regression tests.
I'm the co-founder and programmer of Nakai Entertainment (www.NakaiEntertainment.com), a small mobile games company in Raleigh, NC. I talk a lot about programming, game development and design, and games engines like Unity3d and Unreal.
Saturday, April 3, 2010
Tuesday, March 30, 2010
Annoyances with C#'s DirectoryInfo.Delete()
Taking a small break from writing up a game design doc for my iPhone game. It's interesting being the one actually writing a doc for a game, rather than reading one made by someone else. It does make me appreciate the amount of thought and work our designers put in.
Anyway, last week at work I was writing a new C# console utility to automate directory clean-up tasks on our build server. Things went pretty well until I hit a snag with DirectoryInfo.Delete(Boolean) not working properly and throwing a constant stream of exceptions. It ends up it was error'ing out because the directories I was trying to delete (which contain a good number of sub-directories of arbitrary depths, and several thousand files), contained a number of read-only files. After looking around a bit, it appears this is intended behavior, as it follows the idea of the pop-up notification users get when they try to manually delete directories.
To get around this, I ended up creating a simple method to iterate through all directories and files under a particular directory, and set all their Attributes to normal. Sorry for the formatting.
// Set attributes on all dirs and files in the passed in directory to 'Normal'
void SetDirectoryContentsToNormal ( DirectoryInfo Dir )
{
if ( Dir.Exists )
{
Dir.Attributes = FileAttributes.Normal;
DirectoryInfo[] SubDirs = Dir.GetDirectories("*", SearchOption.AllDirectories);
foreach ( DirectoryInfo SubDir in SubDirs )
{
SubDir.Attributes = FileAttributes.Normal;
}
FileInfo[] FilesInDir = Dir.GetFiles("*", SearchOption.AllDirectories);
foreach ( FileInfo file in FilesInDir )
{
file.Attributes = FileAttributes.Normal;
}
}
}
This does cause a little pause when running, however for our particular circumstance it's perfectly fine because the tool runs only once a day in the early morning.
Sunday, March 28, 2010
2010 Census
Finally got around to filling out my 2010 Census. If you received one make sure to fill it out as well. I will say I was surprised how short it was, I thought it would have a lot more questions. There are so many instructions and help hints and clarifications on the form I expected it to be more complex, I thought I did something wrong when I finished in about 10 minutes. Funnily enough, there was a note at the bottom of the form saying on average it would take about 10 minutes.
Thinking about it though, I can see why they had that much help embedded on the form. The Census is done by the Gov. to help determine the distribution of the population; and the results are used as the basis for policy decisions, budgetary allocations and government representation for the next decade. Making sure it's as clear and precise as possible is extremely important.
I do wonder how many iterations, focus tests, expert reviews and God knows what else was done to test the usability of the final Census form. Just the fact they had the 10 minute estimation means some of their testers had the same anxiety as I did...
Thinking about it though, I can see why they had that much help embedded on the form. The Census is done by the Gov. to help determine the distribution of the population; and the results are used as the basis for policy decisions, budgetary allocations and government representation for the next decade. Making sure it's as clear and precise as possible is extremely important.
I do wonder how many iterations, focus tests, expert reviews and God knows what else was done to test the usability of the final Census form. Just the fact they had the 10 minute estimation means some of their testers had the same anxiety as I did...
Friday, March 26, 2010
Looking at website stuff
Finally decided I need to start learning more about web technologies. This area has been a big hole in my field of knowledge, and I figured I need to address that. First thing first has been figuring out WHAT web technology to learn, there are quite a few options out there and narrowing them down is a little daunting.
I'm leaning heavily toward ASP.NET, as I'm passingly familiar with the .NET framework now and feel comfortable working in that sandbox. There's also the huge benefit of being able to use Visual Web Developer IDE, which at first glance appears extremely powerful and well documented. My boss has worked on web stuff on and off for the past 10 years or so, and original came from a php background. He's been rebuilding his website with ASP.NET MVC, and he's enjoying it quite a bit. Personally too, I really don't feel like learning php/javascript all that much. I could learn them, but since I'm currently working on 2 other projects right now, I really don't have a ton of extra time to spare learning completely new languages. Being able to work in libraries and frameworks I'm already working in (.NET) is a pretty big draw.
The next step is actually finding a hosting plan...
I'm leaning heavily toward ASP.NET, as I'm passingly familiar with the .NET framework now and feel comfortable working in that sandbox. There's also the huge benefit of being able to use Visual Web Developer IDE, which at first glance appears extremely powerful and well documented. My boss has worked on web stuff on and off for the past 10 years or so, and original came from a php background. He's been rebuilding his website with ASP.NET MVC, and he's enjoying it quite a bit. Personally too, I really don't feel like learning php/javascript all that much. I could learn them, but since I'm currently working on 2 other projects right now, I really don't have a ton of extra time to spare learning completely new languages. Being able to work in libraries and frameworks I'm already working in (.NET) is a pretty big draw.
The next step is actually finding a hosting plan...
Sunday, March 21, 2010
Annoying distractions
I was working on my iPhone game on Sunday, and wanted to load the latest build onto the device so I could test some stuff out. When the build came up on the screen, the main menu looked suspiciously like the old version of the game, and didn't contain the new test map I wanted to try out. I figured I did something wrong so I went back to XCode to 'Clean' and 'Build' my executable again...and received an Error in the output.
It ends up my iPhone developer certificate had just expired. In hindsight, I'm very glad this issue came up when it did. Since it was a Sunday I had the extra time to renew my iPhone dev certificate, and because the change I wanted to test was obviously not there, finding the underlying issues didn't take very long. It was an annoyance though. I ended up wasting about 20 minutes getting my stuff back in order and at the point I could build against my device again.
Oh well, at least I don't need to worry about this again until next year.
It ends up my iPhone developer certificate had just expired. In hindsight, I'm very glad this issue came up when it did. Since it was a Sunday I had the extra time to renew my iPhone dev certificate, and because the change I wanted to test was obviously not there, finding the underlying issues didn't take very long. It was an annoyance though. I ended up wasting about 20 minutes getting my stuff back in order and at the point I could build against my device again.
Oh well, at least I don't need to worry about this again until next year.
Thursday, March 4, 2010
Optimization fun with new project
I'm working on an iPhone project with a buddy, and the progress has been slow-ish going so far. Our biggest problem is committing to an idea; we have a good number of them, however we haven't found a gameplay combination we're fully ready to jump on. I feel like we're getting closer though, we've done a good job of bouncing new ideas around and trying to prototype stuff out.
While we're figuring out gameplay, I'm working on creating some generic utilities to assist us in development and iteration. One item that comes to mind is a search method I wrote several weeks ago. It provides a nice API method for finding a specific object by a name within a hierarchy of objects in the game scene. This method (call it FindGameObject) worked fairly well, however I found some limitations to it which I knew would cause a slowdown on the iPhone given the number unnecessary operations I was doing. Tonight I decided to trim this down to make it leaner and meaner with some ideas I came up with.
First thing I did was write a test script to provide profiling support and get a baseline of how much time it took to run 10 million searches using FindGameObject on a deep heirarchy (about 8 objects). I decided on 10 million somewhat randomly, however it was deliberately a large number to enhance the visible impact of small changes. Then I wrote the new version of my method (call it FindGameObject2) with my new changes and hooked it into the test script. The results were:
FindGameObject - Took: 6.948123 sec to run 1000000 lookups
FindGameObject2 - Took: 5.916583 sec to run 1000000 lookups
This is a rough average of about 5 runs, not a scientifically acceptable test set but good enough for our purposes. Comparing against the current functionality, you can see I gain ~1 second when doing 10 million lookups, which is about a 15% increase
Before I finish I must mention these tests were run on my PC dev machine, not the actual iPhone hardware. This makes it especially important to possess a test case I can reliably run on the iPhone hardware, so I can compare my changes against the original functionality on the target hardware. However I expect my optimizations to yield a comparable speed increase on the iPhone hardware.
While we're figuring out gameplay, I'm working on creating some generic utilities to assist us in development and iteration. One item that comes to mind is a search method I wrote several weeks ago. It provides a nice API method for finding a specific object by a name within a hierarchy of objects in the game scene. This method (call it FindGameObject) worked fairly well, however I found some limitations to it which I knew would cause a slowdown on the iPhone given the number unnecessary operations I was doing. Tonight I decided to trim this down to make it leaner and meaner with some ideas I came up with.
First thing I did was write a test script to provide profiling support and get a baseline of how much time it took to run 10 million searches using FindGameObject on a deep heirarchy (about 8 objects). I decided on 10 million somewhat randomly, however it was deliberately a large number to enhance the visible impact of small changes. Then I wrote the new version of my method (call it FindGameObject2) with my new changes and hooked it into the test script. The results were:
FindGameObject - Took: 6.948123 sec to run 1000000 lookups
FindGameObject2 - Took: 5.916583 sec to run 1000000 lookups
This is a rough average of about 5 runs, not a scientifically acceptable test set but good enough for our purposes. Comparing against the current functionality, you can see I gain ~1 second when doing 10 million lookups, which is about a 15% increase
Before I finish I must mention these tests were run on my PC dev machine, not the actual iPhone hardware. This makes it especially important to possess a test case I can reliably run on the iPhone hardware, so I can compare my changes against the original functionality on the target hardware. However I expect my optimizations to yield a comparable speed increase on the iPhone hardware.
Saturday, February 27, 2010
Computer security scare
When I was at a friends house last weekend working on an iPhone project, I had a big computer security scare. We'd reached a point where I wanted to transfer a build over him so he could play around with it, so I put the build in my network share folder. When he browsed to my computer though, instead of just seeing my read-only drop box, he saw my entire programming directory with ~10 projects in it...and he had read/write access to it! Let me say that again, my main development folder had read/write access privs set for everyone, essentially it was a shared public folder
Now this is a pretty stupid thing to set, and what makes me kick myself even more is I'd set this many many times, not knowing the implications of what I was doing. I'd exposed my precious data to anyone to read or even modify. This was especially scary because I like working at coffee shops, so I was very lucky some bored, tech-savvy person didn't go and delete the projects I'd spent hours or days on.
In case you're wondering why I'd set public read/write privs on a folder that's so important, the answer is it was a workflow I was using for development. I had to share symlinks between my OS X and WinXP installations (I run WinXP through a virtual machine). There are some nuances regarding sharing symlinks between these two OS's (I don't recall the exact issue), but a workaround I found was to, among other things, publically share my dev folder. What really kills me though, is I found a better workflow several months ago that didn't require symlinks at all.
Moral of the story, make sure your important data directories aren't set to be shared publicly :)
Now this is a pretty stupid thing to set, and what makes me kick myself even more is I'd set this many many times, not knowing the implications of what I was doing. I'd exposed my precious data to anyone to read or even modify. This was especially scary because I like working at coffee shops, so I was very lucky some bored, tech-savvy person didn't go and delete the projects I'd spent hours or days on.
In case you're wondering why I'd set public read/write privs on a folder that's so important, the answer is it was a workflow I was using for development. I had to share symlinks between my OS X and WinXP installations (I run WinXP through a virtual machine). There are some nuances regarding sharing symlinks between these two OS's (I don't recall the exact issue), but a workaround I found was to, among other things, publically share my dev folder. What really kills me though, is I found a better workflow several months ago that didn't require symlinks at all.
Moral of the story, make sure your important data directories aren't set to be shared publicly :)
Subscribe to:
Posts (Atom)