I have recently released my second live wallpaper for android on the Google play store. This one is called Plasma Ring Live. It is a small shader that allows the user to control 3 rings or spirals of color (red, green and blue) that either escape or flow into the center of the screen. There are also controls for mirroring the effect, producing a grid of spirals or rings as the user sees fit.
It can be downloaded here: Plasma Ring Live on Google Play
Here are some pictures of the app.
Showing posts with label Development. Show all posts
Showing posts with label Development. Show all posts
Sunday, February 23, 2014
Sunday, January 19, 2014
Fractal Live Generator - Live wallpaper for Android
In my previous post I had mentioned that I was working on an Android app to be released soon. I have since released my first Android app to the market place. This app is called Fractal Live Generator and it is a live wallpaper for generating animated Mandelbrot and Julia sets.
You can download it from the Google Play Store here: https://play.google.com/store/apps/details?id=com.chrissteinberg.fractalwallpaper
And for some pretty pictures:
To test the waters of Android development I wanted something fairly simple and non-expensive to develop so that I could get an understanding of the publishing path for the Android market place. I felt that a live wallpaper would both be fun and straightforward to develop. I was right on both accounts. Doing a fractal generation application in OpenGL 2.0 was something I had planned on writing for a while regardless, but the excuse to put it on my Nexus 7 was too great. The biggest issue I ran into was determining what customizable features to add to the initial release and to keep feature creep down to a minimal to actually get the app released.
The actual process to release an app on the Google Play store was surprisingly simple. Once I had done a little research to determine what was required and what I was agreeing to in all of the legal documentation, actually producing the release apk and uploading it to the store was much easier than I expected. The major pitfall that I did run into was not being able to test on multiple devices since I only have the Nexus 7. It turns out that this is an issue as there have been multiple reports of people's devices not rendering correctly. Until I can get my hands on one of these devices that are not working properly, I simply have to accept that there will be people currently who cannot use my software. This was a valuable lesson to learn early however, as I now know that for future Android applications that the OpenGL ES 2.0 standard is not implemented or supported the same on all devices. It is much cheaper to have issues like this on a free app that I only spent a few weeks of spare time developing than in an app that I potentially have invested money to develop and months of effort into producing. I will have to invest in larger ranges of devices for testing and budget accordingly.
I do plan on doing some more live wallpapers as I think that the wallpaper is a great canvas to make some eye candy shader toys. It is also a great way to experiment with OpenGL ES 2.0 GLSL shaders in the mobile space. So definitely keep an eye out for more of these types of things from me.
You can download it from the Google Play Store here: https://play.google.com/store/apps/details?id=com.chrissteinberg.fractalwallpaper
And for some pretty pictures:
To test the waters of Android development I wanted something fairly simple and non-expensive to develop so that I could get an understanding of the publishing path for the Android market place. I felt that a live wallpaper would both be fun and straightforward to develop. I was right on both accounts. Doing a fractal generation application in OpenGL 2.0 was something I had planned on writing for a while regardless, but the excuse to put it on my Nexus 7 was too great. The biggest issue I ran into was determining what customizable features to add to the initial release and to keep feature creep down to a minimal to actually get the app released.
The actual process to release an app on the Google Play store was surprisingly simple. Once I had done a little research to determine what was required and what I was agreeing to in all of the legal documentation, actually producing the release apk and uploading it to the store was much easier than I expected. The major pitfall that I did run into was not being able to test on multiple devices since I only have the Nexus 7. It turns out that this is an issue as there have been multiple reports of people's devices not rendering correctly. Until I can get my hands on one of these devices that are not working properly, I simply have to accept that there will be people currently who cannot use my software. This was a valuable lesson to learn early however, as I now know that for future Android applications that the OpenGL ES 2.0 standard is not implemented or supported the same on all devices. It is much cheaper to have issues like this on a free app that I only spent a few weeks of spare time developing than in an app that I potentially have invested money to develop and months of effort into producing. I will have to invest in larger ranges of devices for testing and budget accordingly.
I do plan on doing some more live wallpapers as I think that the wallpaper is a great canvas to make some eye candy shader toys. It is also a great way to experiment with OpenGL ES 2.0 GLSL shaders in the mobile space. So definitely keep an eye out for more of these types of things from me.
Thursday, October 27, 2011
UDK Day 1
Today is the day that I start really cracking down and learning unreal script. I have worked with it in the past on and off, but never really got into it as my real world life tends to take me a little deeper down the rabbit hole (i.e. C/C++/C#/HLSL/GLSL/etc...).
The reason today is the day is that my friend and I have some serious plans that we have been talking about for about a year now. Hopefully getting the game play mechanics in place won't take that long... assuming that I get this unreal scripting stuff figured out.
A few issues that I already foresee:
Oh and as a follow up to my last post, its not a social game, its not gonna be shovelware, both of us feel that we want to make a game WE want to play. Hopefully others will like it too as a result and as any indie developer hopes, maybe it will revolutionize the industry.
The reason today is the day is that my friend and I have some serious plans that we have been talking about for about a year now. Hopefully getting the game play mechanics in place won't take that long... assuming that I get this unreal scripting stuff figured out.
A few issues that I already foresee:
- No free to use IDE with code highlighting + code complete/intellisense. I can use visual studio which is great, but I still get no code highlighting. Apparently there is a tool called nFringe but its not free to use for commercial projects, and we hope to eventually sell this jewel.
- No free to use IDE... oh I already said that one, well looks like I'm gonna have to Rambo program this stuff. The biggest problem is class member and function lookups. I have to open the script file that I am working with just to find out what functions I have access to. Makes me sad if you can't tell.
- Syntax is close to C++ or C# however it is just enough different that when I'm coding quickly I can already tell my brain is going to flip back to C++ land and I will bork something up.
- No project file containing all the script files. I could set this up in visual studio, but then I will have an .sln file sitting around that doesn't make a whole lot of sense and I am not yet sure if that will cause the compiler to have issues if it is in the same folder as the script files it is housing. I will figure something out with this, just not there yet at the moment.
Oh and as a follow up to my last post, its not a social game, its not gonna be shovelware, both of us feel that we want to make a game WE want to play. Hopefully others will like it too as a result and as any indie developer hopes, maybe it will revolutionize the industry.
Sunday, July 24, 2011
Update: Looking for work
So I was unfortunately a casualty in the recent layoffs at UTV Ignition. I am sad to leave and I believe that Faxion Online is a great game and a great product. Unfortunately there just wasn't the support that the game needed to succeed and a development team is too expensive to keep around. I understand it was business and that is fine. Unfortunately that means I am currently unemployed.
I recently had an interview but that was not as successful as I had hoped. Thus I am reviewing what is currently in my portfolio and am redesiging this site to include more of my work. I may need to port it over to crystal space or something but I will figure that out. I might just end up redirecting for the art and such.
Anyways, I have been programming and making a game. No details yet, but safe to say that I am confident in the chosen tech and the ability to quickly get to a level building alpha state. It has renewed my energy from an unsuccessful interview and it has helped me keep busy during my unemployment. Hopefully more on this very soon.
That leads me to my last update, I am looking for work in the Austin area. If you are interested in receiving a resume, please let me know.
I recently had an interview but that was not as successful as I had hoped. Thus I am reviewing what is currently in my portfolio and am redesiging this site to include more of my work. I may need to port it over to crystal space or something but I will figure that out. I might just end up redirecting for the art and such.
Anyways, I have been programming and making a game. No details yet, but safe to say that I am confident in the chosen tech and the ability to quickly get to a level building alpha state. It has renewed my energy from an unsuccessful interview and it has helped me keep busy during my unemployment. Hopefully more on this very soon.
That leads me to my last update, I am looking for work in the Austin area. If you are interested in receiving a resume, please let me know.
Wednesday, June 15, 2011
E3 2011 Awards
Now that E3 is over, there are always awards given to developers for various categories from various sites. UTV Ignition Games, the company that I work for while developing Faxion Online, received an award from Massively. The full article can be read here. Otherwise our award and comments are shamelessly listed below.
Beau Hindman: UTV True Games. They not only showed off Faxion and were ready to discuss how much they were concerned about fixes and future updates, but they seemed to be having fun. I like an accessible developer. I believe in Faxion because it comes from the same place I would if I were a developer. Sure, it needs its fixes, but it's brand new...and what game doesn't need a few patches when it launches? Also, the rest of the games they offered made me smile. Planet Crashers? I must have it, now.
I'm very excited, this is the first award that any team I have worked on has won since I have moved to the game development community. We have all worked very hard on Faxion and the rest of UTV has been working hard to bring games like Swarm, Planet Crashers, El Shaddai, and Sky Legends to the public. So I want to congratulate both the Faxion Team (myself included I suppose) and the rest of UTV for a great first half of the year and continued success.
Shawn Schuster: UTV Ignition/UTV True Games. Their first showing at E3 was preceded by months of tongue-in-cheek humor in trailers and advertising campaigns, which simply reminds us that we're playing games to have fun. Their booth was impressive for a first-timer, and they seemed to get some healthy foot traffic. Will Faxion Online prove to be a hit? That I don't know, but the team behind it is still catching our attention.
I'm very excited, this is the first award that any team I have worked on has won since I have moved to the game development community. We have all worked very hard on Faxion and the rest of UTV has been working hard to bring games like Swarm, Planet Crashers, El Shaddai, and Sky Legends to the public. So I want to congratulate both the Faxion Team (myself included I suppose) and the rest of UTV for a great first half of the year and continued success.
Saturday, June 4, 2011
Faxion Online Post Release
Well its launched. Faxion Online, the game I have been working on with UTV for the last year has launched. Its fun to play and momentum is building in the community. I am very happy to see this work put forth in front of so many people. It has been really fun working with the Faxion Team and I have learned a lot since starting here a year ago (as of June 2).
I think there is a lot that Faxion still has to do to see it where it should be, and we have a lot of content planned for future patches. That excites me because I am not ready to be done supporting that product and making improvements for the product that I am creating and offering to the public.
On that note though, I am happy to say my second game is released for sale. Possibly looking at doing another side IPhone game in the future. With who is still left to be decided, I guess it just depends where momentum picks up on a new game idea.
I wish that I could highlight here some of the more complex stuff I worked on with the Faxion project but unfortunately you can't really discuss code like art without risking encroaching on copy write laws. For the most part it was tools development for particle systems and full screen effects. I created optimized terrain editing tools and I also wrote and maintain the Login system for the client. Overall I maintain the client in general and work on optimization.
Engines are funny things, there are so many working parts in them that one silly mistake in a single subsystem can impact performance. Also knowing what the tools do and how to best utilize them is really important for a team to understand. Getting a good balance between assets on screen at once and good play performance is a tricky number to maintain in a dynamic environment.
Anyways, I am wandering away from the subject of this post. I want everyone to go try Faxion if they are in to open world pvp and real time character leveling. Its a great game with more stuff coming every patch.
www.faxiononline.com
I think there is a lot that Faxion still has to do to see it where it should be, and we have a lot of content planned for future patches. That excites me because I am not ready to be done supporting that product and making improvements for the product that I am creating and offering to the public.
On that note though, I am happy to say my second game is released for sale. Possibly looking at doing another side IPhone game in the future. With who is still left to be decided, I guess it just depends where momentum picks up on a new game idea.
I wish that I could highlight here some of the more complex stuff I worked on with the Faxion project but unfortunately you can't really discuss code like art without risking encroaching on copy write laws. For the most part it was tools development for particle systems and full screen effects. I created optimized terrain editing tools and I also wrote and maintain the Login system for the client. Overall I maintain the client in general and work on optimization.
Engines are funny things, there are so many working parts in them that one silly mistake in a single subsystem can impact performance. Also knowing what the tools do and how to best utilize them is really important for a team to understand. Getting a good balance between assets on screen at once and good play performance is a tricky number to maintain in a dynamic environment.
Anyways, I am wandering away from the subject of this post. I want everyone to go try Faxion if they are in to open world pvp and real time character leveling. Its a great game with more stuff coming every patch.
www.faxiononline.com
Tuesday, November 16, 2010
Device Reset in Direct X 9
So, an issue that I have been battling for about a week involved resetting devices in Direct X. I wanted to cover how to do this and the possible downfalls you might run into while performing something that should be fairly straight forward to accomplish.
Q. When would you need to reset the device?
A. Anytime the device becomes "lost", this could occur when you resize the viewport, minimize the window, switch between fullscreen and windowed modes, and when in fullscreen, giving focus to another window other than the application which is running direct x.
Q. Why is this so difficult?
A. That is a great question, I am not sure. It seems like the Direct X interface should be smart enough to recover itself in the event that the device is lost. This is not the case. Not only is it not able to recover itself, it requires quite a bit of tender loving care when resetting occurs.
Q. What is required to reset a device.
A. After you have set up the code to create a device, your application loop must regularly check to see if the device is still active. This can be performed by calling the Device.TestCooperativeLevel() function. This function tests the device to determine if it is in a state ready to render. The possible outcomes of this function call are D3D_OK, in which case you may proceed to render your scene, D3DERR_DRIVERINTERNALERROR, in which case the device is in a bad state or the drivers are unable to process commands for some reason. The other two states are the important ones, these are D3DERR_DEVICELOST and D3DERR_DEVICENOTRESET. These indicate that the device is lost and needs to be reset.
Once either of the Device Lost or Device Not Reset errors are identified, code must be written to reset the device. The important thing to understand is that the device is very stupid about how it handles passing out resources. As such, you must ensure that the device reset occurs on the same thread as it was created. Additionally, Microsoft documentation indicates that the device releases all explicit render targets, depth stencil surfaces, additional swap chains, state blocks and default resources associated with the device. This means that any resource that is returned from the Device "Get" functions that return pointers to resources, must have their resource.release() function called on them to notify the device that the resource is no longer required. The down side to this is that any of these resources that will be required again once the device is reacquired, must be recreated before they can be used again.
The most frustrating thing here is that the Microsoft documentation states that these resources SHOULD be released, however, it is my experience that failure to release these resources causes the reset to fail, returning an D3DERR_INVALIDCALL. As a result, it really isn't just recommended, but a must, to ensure that all modules that request resources from the device have both a OnLostDevice and OnResetDevice functions that handle freeing and recreating these resources.
Another note, it is also a good idea to call the Device.EvictManagedResources function. This function removes any additional resources that were allocated using the managed resource pool. See this article for more information on the managed resource pool. Using the managed resource pool can also help prevent the need for the OnLostDevice and OnResetDevice functions for your modules, however there is a cost/benefit trade off here that must be understood and should be researched before choosing either method of resource management.
Once all resources have been released, we can reset the device. To do so, we must first build a set of Present Parameters similar to what we created when first creating the Direct X Device. This is the tricky part as there are many options here to set and any bad combination of these will cause the device to fail to reset. The important thing to note here is that you need some way for your application to know if it is in windowed mode or fullscreen mode when it resets (assuming that you want your application to have both a fullscreen and windowed modes). The reason for this is that depending on the mode, different settings require different values. For example, in fullscreen mode, you need to specify BackBufferWidth and BackBufferHeight values that equal a value that is equivalent to a supported display resolution. These can be retrieved using the EnumAdapterModes function. If the application is a windowed application, these values need to be set to the dimensions of the HWND object that is stored in the hDeviceWindow of the Present Parameters. Also, importantly, FullScreen_RefreshRateInHz should be set to the window resolution selected from the EnumAdaptersModes function in fullscreen mode, but should always be set to 0 in windowed mode, otherwise the reset will fail.
The rest of the parameters can be referenced here. Rules for setting each of them are listed. Be sure to verify that each of them are set accordingly depending on what mode your device is in.
Finally, reset the device by calling the device.reset(presentParameters) function. This will attempt to reset the device. If it was successful, it will return a D3D_OK and you should proceed with recreating all of your required resources by calling the OnResetDevice functions of your applications modules. If it does not, this is where the difficulty comes in. In most failure events the function will return D3DERR_INVALIDCALL, if this occurs then check your parameters to make sure they are correct. Otherwise, it is most likely due to a non-released resource. Running your application using the debug version of the Direct X dll will improve the quality of the error message received from the Direct X driver. This may not be an option for you if your application is already pushing the limits of available frame rates.
I hope that this tutorial has been helpful. I know that when I went looking for information on how this stuff works, the tutorials were brief, mostly directed at solving specific problems and less about the actual theory behind the information. I cannot claim to be a Direct X expert and if any of the information in this article is false, as always feel free to correct me and I will update the tutorial.
Q. When would you need to reset the device?
A. Anytime the device becomes "lost", this could occur when you resize the viewport, minimize the window, switch between fullscreen and windowed modes, and when in fullscreen, giving focus to another window other than the application which is running direct x.
Q. Why is this so difficult?
A. That is a great question, I am not sure. It seems like the Direct X interface should be smart enough to recover itself in the event that the device is lost. This is not the case. Not only is it not able to recover itself, it requires quite a bit of tender loving care when resetting occurs.
Q. What is required to reset a device.
A. After you have set up the code to create a device, your application loop must regularly check to see if the device is still active. This can be performed by calling the Device.TestCooperativeLevel() function. This function tests the device to determine if it is in a state ready to render. The possible outcomes of this function call are D3D_OK, in which case you may proceed to render your scene, D3DERR_DRIVERINTERNALERROR, in which case the device is in a bad state or the drivers are unable to process commands for some reason. The other two states are the important ones, these are D3DERR_DEVICELOST and D3DERR_DEVICENOTRESET. These indicate that the device is lost and needs to be reset.
Once either of the Device Lost or Device Not Reset errors are identified, code must be written to reset the device. The important thing to understand is that the device is very stupid about how it handles passing out resources. As such, you must ensure that the device reset occurs on the same thread as it was created. Additionally, Microsoft documentation indicates that the device releases all explicit render targets, depth stencil surfaces, additional swap chains, state blocks and default resources associated with the device. This means that any resource that is returned from the Device "Get" functions that return pointers to resources, must have their resource.release() function called on them to notify the device that the resource is no longer required. The down side to this is that any of these resources that will be required again once the device is reacquired, must be recreated before they can be used again.
The most frustrating thing here is that the Microsoft documentation states that these resources SHOULD be released, however, it is my experience that failure to release these resources causes the reset to fail, returning an D3DERR_INVALIDCALL. As a result, it really isn't just recommended, but a must, to ensure that all modules that request resources from the device have both a OnLostDevice and OnResetDevice functions that handle freeing and recreating these resources.
Another note, it is also a good idea to call the Device.EvictManagedResources function. This function removes any additional resources that were allocated using the managed resource pool. See this article for more information on the managed resource pool. Using the managed resource pool can also help prevent the need for the OnLostDevice and OnResetDevice functions for your modules, however there is a cost/benefit trade off here that must be understood and should be researched before choosing either method of resource management.
Once all resources have been released, we can reset the device. To do so, we must first build a set of Present Parameters similar to what we created when first creating the Direct X Device. This is the tricky part as there are many options here to set and any bad combination of these will cause the device to fail to reset. The important thing to note here is that you need some way for your application to know if it is in windowed mode or fullscreen mode when it resets (assuming that you want your application to have both a fullscreen and windowed modes). The reason for this is that depending on the mode, different settings require different values. For example, in fullscreen mode, you need to specify BackBufferWidth and BackBufferHeight values that equal a value that is equivalent to a supported display resolution. These can be retrieved using the EnumAdapterModes function. If the application is a windowed application, these values need to be set to the dimensions of the HWND object that is stored in the hDeviceWindow of the Present Parameters. Also, importantly, FullScreen_RefreshRateInHz should be set to the window resolution selected from the EnumAdaptersModes function in fullscreen mode, but should always be set to 0 in windowed mode, otherwise the reset will fail.
The rest of the parameters can be referenced here. Rules for setting each of them are listed. Be sure to verify that each of them are set accordingly depending on what mode your device is in.
Finally, reset the device by calling the device.reset(presentParameters) function. This will attempt to reset the device. If it was successful, it will return a D3D_OK and you should proceed with recreating all of your required resources by calling the OnResetDevice functions of your applications modules. If it does not, this is where the difficulty comes in. In most failure events the function will return D3DERR_INVALIDCALL, if this occurs then check your parameters to make sure they are correct. Otherwise, it is most likely due to a non-released resource. Running your application using the debug version of the Direct X dll will improve the quality of the error message received from the Direct X driver. This may not be an option for you if your application is already pushing the limits of available frame rates.
I hope that this tutorial has been helpful. I know that when I went looking for information on how this stuff works, the tutorials were brief, mostly directed at solving specific problems and less about the actual theory behind the information. I cannot claim to be a Direct X expert and if any of the information in this article is false, as always feel free to correct me and I will update the tutorial.
Wednesday, November 3, 2010
Tower Assault! Curse of Zombie Island
Working with Rogue Pirate Ninja Interactive LLC, we have completed our IPhone title, "Tower Assault! Curse of Zombie Island". We are very proud and excited to bring this game to the app store for purchase. You can purchase it here or from your IPhone or IPod Touch device.
Tower Assault! Curse of Zombie Island is a reverse TD style game where you control a horde of zombie pirates against the forces of an Evil Witch Doctor who has stolen your pirate loot and cursed your crew. You control them by firing brains out of a cannon.
The goal of the game was to provide small bite sized levels that varied in the goals and difficulty as the game progressed. We didn't want to make a simple puzzle style game though and have weaved a story of revenge into the over all game play.
I hope that you try Tower Assault! Curse of Zombie Island and enjoy it. I should have more time to start posting again now that the work on this title is complete, so look forward to that as well.
Tower Assault! Curse of Zombie Island is a reverse TD style game where you control a horde of zombie pirates against the forces of an Evil Witch Doctor who has stolen your pirate loot and cursed your crew. You control them by firing brains out of a cannon.
The goal of the game was to provide small bite sized levels that varied in the goals and difficulty as the game progressed. We didn't want to make a simple puzzle style game though and have weaved a story of revenge into the over all game play.
I hope that you try Tower Assault! Curse of Zombie Island and enjoy it. I should have more time to start posting again now that the work on this title is complete, so look forward to that as well.
Monday, April 5, 2010
Downloads - PC : OctTree Implementation in Direct X
Well, here is something I dusted off today. This was something I was working on about 2 years ago. It is an implementation of an OctTree in Direct X. I started this with the hopes that it would turn into a full fledged 3D scene editor at some point, however with a lack of a development team and the challenges of working with Direct X, it was decided by myself that this may be a bit more than I was willing to take on at the time with my limited graphics experience.
Screenshot:
If you take a look at some of my old posts about Direct X you will see around the time I decided it was a good idea to switch back to OpenGL and other projects. I would love to see this go somewhere in the future, but in my current state of affairs (job hunting, my impending homelessness, my impending marriage - hopefully after I or my fiancee find a new job/home) I really don't have time to pursue this project anymore. Since I am not using it and it really isn't super functional, however the OctTree is and there is some interesting stuff I was doing in MFC to try and build a properties window, I figure it might be useful for someone trying to learn Direct X. It is written for DX9 however, so don't expect any fancy DX10 or DX11 code in here (remember... 2 years ago). You will also need Visual Studio 2008, so bust that baby out if you got it, else you are kinda dead in the water.
I figure it is better to get it out there to at least show that I have been proactive in learning about graphics and if I help someone learn then I will be happy for that. You can download the source here from drop.io (or from the Downloads side bar). Let me know if you have any questions... I might be able to help, maybe... I did comment the code fairly well so I hope that helps those of you trying to read it.
Controls for moving about are currently just using the arrow keys to move about the plane, there is code in there to support moving in the Y direction, either both rotation or translation in that direction. Once again, old project so what you see is what you get. The application supports .X format for models.
Enjoy!
Screenshot:
If you take a look at some of my old posts about Direct X you will see around the time I decided it was a good idea to switch back to OpenGL and other projects. I would love to see this go somewhere in the future, but in my current state of affairs (job hunting, my impending homelessness, my impending marriage - hopefully after I or my fiancee find a new job/home) I really don't have time to pursue this project anymore. Since I am not using it and it really isn't super functional, however the OctTree is and there is some interesting stuff I was doing in MFC to try and build a properties window, I figure it might be useful for someone trying to learn Direct X. It is written for DX9 however, so don't expect any fancy DX10 or DX11 code in here (remember... 2 years ago). You will also need Visual Studio 2008, so bust that baby out if you got it, else you are kinda dead in the water.
I figure it is better to get it out there to at least show that I have been proactive in learning about graphics and if I help someone learn then I will be happy for that. You can download the source here from drop.io (or from the Downloads side bar). Let me know if you have any questions... I might be able to help, maybe... I did comment the code fairly well so I hope that helps those of you trying to read it.
Controls for moving about are currently just using the arrow keys to move about the plane, there is code in there to support moving in the Y direction, either both rotation or translation in that direction. Once again, old project so what you see is what you get. The application supports .X format for models.
Enjoy!
Saturday, March 27, 2010
ACM Programming Competition Tips
This article is being spawned from my experience at the Northern Michigan College ACM style Programming Competition that I attended today. While the competition is fresh in my mind I wanted to cover some tips I learned from failing miserably this time in the competition.
First tip, and probably the most important thing to understand, ACM competitions are not so much about raw programming skills as they are about knowing certain API's and knowing how to solve certain categories of programming questions. The API's you need to understand are a language's File IO, String parsing (especially tokenizing), Collection classes (List, Dictionary, Vector), and Math libraries. The reason for this is that almost every problem that you will encounter in an ACM style competition is rooted in this problem format:
Step 1: Parse input line by line
Step 2: Perform computation on each entry parsed, or on a collection of entries parsed
Step 3: Output result in a specific format
This implies two very important things:
Tip two, KNOW how to write very versatile parsing code. The number one issue that I had today was that although I know C# file IO, and I would say that I am fairly proficient at it. I generally tend to use documentation heavily when I write code. In an ACM competition you rarely have documentation. Everything is basically from memory. If you are lucky and do get documentation, the reliance of API documentation for something like parsing, which will need to be done at some level for each problem, becomes a hinder and a time sap. If you practice writing versatile parsing, code that can handle tokenizing both strings and integers (C# Split function works really well for this and you can easily write a re-usable block of tokenizing code in about 4-6 lines using it), the ability to simply write this from memory when you walk into the competition is crucial for a good time on the first couple of easy questions.
Tip Three: Have a working knowledge of Math libraries. I can not stress this enough, there is inevitably some problem that requires you to use at a minimum the Pow function (pretty much a standard in any languages Math API). I recommend knowing the parameter order from memory. There really isn't a whole lot more to say on this other than to have a somewhat working knowledge of math, which if you are a computer scientist, you should have.
The rest of the tips that I have are domain specific tips. These are good to have a fundamental understanding of how to use effectively.
Tip four: Understand sorting algorithms. The better you are at understanding sorting algorithms (or at least their use as part of a language's API) the better off you will be. Generally optimization isn't the primary concern at a competition, output correctness is. However when a grader is testing your problem, they will generally have that one input test that will destroy O(n^2) operations. It is best if you can work your sorting algorithms to be O(n log n) on general practice. Search algorithms are also another similar domain, these should be on average O(log n) if you can. Keep in mind that most languages already have optimized searching and sorting algorithms as long as you are using the provided data structure types (I.E. System.Collections.Generic package in C# or your standard java.util.AbstractCollection package in java). Use these to your advantage whenever possible.
This leads me to my final domain specific tip:
Tip five: Understand recursion and how to define a recursive problem. This is the one topic that spurred me today. I do not use recursion at work (in fact I am required not to by my works coding standards). This has lead me to be a bit rusty on looking at problems in a non-iterative manner. A problem that I had fundamentally correct in an iterative solution was too slow (see tip four), and as a result was returned incorrect. Less than 15 minutes before the competition was over, I saw the recursive solution but it was too late to implement it for points. Had I brushed up on my recursive algorithm design practices prior to the competition I may have been able to do better on this problem.
Overall, the best method of doing well in an ACM competition is to practice, practice, practice. Try implementing simple programs that manipulate some sort of text input, and output it in another format after some sort of computation. This is also useful for any career where you work with managers that do not know how to program, because if they give you menial documentation work, or data parsing work to be done by hand (first hand experience talking here, it happens), you are more prepared to take what could be a 20-40 hour task and turn it into about 3-8 hours of fun programming.
As far as practice, there are resources online, where you can get old ACM competition questions to practice with. You can see some of the world finals problems here. There are other sites out there that have varying degree of difficulty programming problems that are like little brain teasers and can also help build the skills needed to do well in a programming competition. Like I said, you can study for this test like you would any standardized test, it is not about skill as a programmer, but skill as an ACM problem solver.
Good luck to anyone who goes to take part in an ACM competition, they are a lot of fun and they let you let your geek hang out. I did the one this weekend as an independent team since I am no longer in college, I did it for fun, and fun was had. If you can not find an ACM competition that you can participate in, start your own competition, let me know if you do.
First tip, and probably the most important thing to understand, ACM competitions are not so much about raw programming skills as they are about knowing certain API's and knowing how to solve certain categories of programming questions. The API's you need to understand are a language's File IO, String parsing (especially tokenizing), Collection classes (List, Dictionary, Vector), and Math libraries. The reason for this is that almost every problem that you will encounter in an ACM style competition is rooted in this problem format:
Step 1: Parse input line by line
Step 2: Perform computation on each entry parsed, or on a collection of entries parsed
Step 3: Output result in a specific format
This implies two very important things:
Tip two, KNOW how to write very versatile parsing code. The number one issue that I had today was that although I know C# file IO, and I would say that I am fairly proficient at it. I generally tend to use documentation heavily when I write code. In an ACM competition you rarely have documentation. Everything is basically from memory. If you are lucky and do get documentation, the reliance of API documentation for something like parsing, which will need to be done at some level for each problem, becomes a hinder and a time sap. If you practice writing versatile parsing, code that can handle tokenizing both strings and integers (C# Split function works really well for this and you can easily write a re-usable block of tokenizing code in about 4-6 lines using it), the ability to simply write this from memory when you walk into the competition is crucial for a good time on the first couple of easy questions.
Tip Three: Have a working knowledge of Math libraries. I can not stress this enough, there is inevitably some problem that requires you to use at a minimum the Pow function (pretty much a standard in any languages Math API). I recommend knowing the parameter order from memory. There really isn't a whole lot more to say on this other than to have a somewhat working knowledge of math, which if you are a computer scientist, you should have.
The rest of the tips that I have are domain specific tips. These are good to have a fundamental understanding of how to use effectively.
Tip four: Understand sorting algorithms. The better you are at understanding sorting algorithms (or at least their use as part of a language's API) the better off you will be. Generally optimization isn't the primary concern at a competition, output correctness is. However when a grader is testing your problem, they will generally have that one input test that will destroy O(n^2) operations. It is best if you can work your sorting algorithms to be O(n log n) on general practice. Search algorithms are also another similar domain, these should be on average O(log n) if you can. Keep in mind that most languages already have optimized searching and sorting algorithms as long as you are using the provided data structure types (I.E. System.Collections.Generic package in C# or your standard java.util.AbstractCollection package in java). Use these to your advantage whenever possible.
This leads me to my final domain specific tip:
Tip five: Understand recursion and how to define a recursive problem. This is the one topic that spurred me today. I do not use recursion at work (in fact I am required not to by my works coding standards). This has lead me to be a bit rusty on looking at problems in a non-iterative manner. A problem that I had fundamentally correct in an iterative solution was too slow (see tip four), and as a result was returned incorrect. Less than 15 minutes before the competition was over, I saw the recursive solution but it was too late to implement it for points. Had I brushed up on my recursive algorithm design practices prior to the competition I may have been able to do better on this problem.
Overall, the best method of doing well in an ACM competition is to practice, practice, practice. Try implementing simple programs that manipulate some sort of text input, and output it in another format after some sort of computation. This is also useful for any career where you work with managers that do not know how to program, because if they give you menial documentation work, or data parsing work to be done by hand (first hand experience talking here, it happens), you are more prepared to take what could be a 20-40 hour task and turn it into about 3-8 hours of fun programming.
As far as practice, there are resources online, where you can get old ACM competition questions to practice with. You can see some of the world finals problems here. There are other sites out there that have varying degree of difficulty programming problems that are like little brain teasers and can also help build the skills needed to do well in a programming competition. Like I said, you can study for this test like you would any standardized test, it is not about skill as a programmer, but skill as an ACM problem solver.
Good luck to anyone who goes to take part in an ACM competition, they are a lot of fun and they let you let your geek hang out. I did the one this weekend as an independent team since I am no longer in college, I did it for fun, and fun was had. If you can not find an ACM competition that you can participate in, start your own competition, let me know if you do.
Monday, February 22, 2010
Recent Work, Lua Love, and My Weekend Retreat
It has been a while since I updated. Been a hectic February, life moves too fast and work is a pain at times. I had to pull an all nighter last Thursday to get a demo finished. I would normally have just asked for more time but this was my project and really my ass on the line. I wrote the research paper that was behind it, not really expecting the funding to come through and when it did, I got the work. I was very proud of the work I did but damn it was a struggle.
The project involved Lua, which I must say after working with Lua in both C and C# integration. I like C# much better. The .Net version of Lua integration is extremely easy to work with and the ability for C# to have attributes which can be put to use in registering exposed functions to Lua is a dream compared to working with Swig or writing your own function wrappers. I learned a lot though, about Lua and about C. I consider myself a good C programmer, a professional if you will, but there is never a shortage of things to learn. This project really stretched my expertise in DLL handling in windows in a C environment (not for Lua but still, I learned it because of this Lua project).
It is interesting to note that a DLL can be loaded into the program space more than once. Mind you this is generally not a good method of doing things, but sometimes a necessary evil. Care must be made though that DLLs are not loaded from multiple copies of the same DLL in the file system. All references to a DLL should be made on the same DLL file. If you do not you will give yourself problems because it will actually load two copies into program space and when you expect the DLL to have global variables that are maintained in the program space environment you will be rudely awakened to find that those global variables in your other DLL are in fact different than the ones you expect them to be.
Another interesting thing I picked up last week was the use of Lua userdata types. These data types are used to represent "objects" in Lua that are not considered one of the standard primitive types. These can be anything from C structs or pointers to C++, C#, or Java objects. It is basically just a pointer to memory in the Lua environment. The tricky things about these datatypes is that you can not create them in the Lua environment. You can only receive them from the main application. Thus the use of these data types are heavily reliant on the host application, functions that receive a pointer to something must be represented as a userdata type and not the primitive that it points to (if it is a pointer to a primitive of course). This obviously can cause some issues, especially when generating interfaces to pre-existing libraries. I found that Swig is not so good at handling this, so care had to be taken to fix some of my wrappings. Also, typedefs can be a cause of torment when dealing with Swig if the typedefs are not included in the header that is being "Swigged". The reason for this is that Swig thinks that these typedefs need to be represented as a userdata type which can cause problems when working with things like handles.
Finally, it should be mentioned that applications that use functions that have output parameters are also a very complicated issue when working with Lua. Lua has no concept of pass by reference. It only allows pass by value and as a result, any pointer passed to the function, when converted to a Lua wrap, is treated as a userdata type. Very inconvenient when Lua has a perfectly good multi-return mechanism built into the language. In fact this is so good that great care must be made to utilize it, unfortunately Swig once again fails at this because it does not know what is an input parameter and what is an output parameter. Now I don't know if I am just too thick skulled to know how to use Swig in all its faceted feature set, but I handled this by brute force modification of my generated Lua wrappings. I feel like modifying these wrappings not only gave me more control over what was being done in each function, but also provided better functionality and ensured that each function was being generated correctly. It took a bit more time but I was happier with the results, and I was able to fix all of the issues that possibly would have gone undetected for a few weeks, or months, or years, until those functions were used by a scripter.
Overall, I still love Lua, I think it is one of the best scripting languages out there. It is easy to use (on the scripting side of things) and not overly complicated to integrate. I was able to get scripts executing within a matter of two hours at the most, much can be said for that. The demo was a success and I am very excited to say that I was able to secure additional funding to continue my work. My managers were happy and thus I was happy. Glory day!
Oh and I beat Dante's Inferno this weekend... also a bonus, saw the anime for Dante's Inferno I was not impressed, more just a retelling of the game storyline. I think EA did a better job with Viceral when they made the Deadspace anime for that games release. It added something to the story that was not in the game. I also am not a fan of anime where they have a handful of different studios with different art styles writing different parts of one story. The change in art style confuses me, not that I am dumb, it just makes my eyes readjust to the changes in color pallets and the character movements. I hope to write a review on Dante's Inferno to finish up the trillogy of reviews (First Impression, First Look, and Overall review) but life is killer and I am super busy looking for a new job, planning my wedding, working at my current job, and working on side projects. As a result the blog always seems to fall to the back burner. Well... back to watching some anime before bed, and back to the grind tomorrow.
The project involved Lua, which I must say after working with Lua in both C and C# integration. I like C# much better. The .Net version of Lua integration is extremely easy to work with and the ability for C# to have attributes which can be put to use in registering exposed functions to Lua is a dream compared to working with Swig or writing your own function wrappers. I learned a lot though, about Lua and about C. I consider myself a good C programmer, a professional if you will, but there is never a shortage of things to learn. This project really stretched my expertise in DLL handling in windows in a C environment (not for Lua but still, I learned it because of this Lua project).
It is interesting to note that a DLL can be loaded into the program space more than once. Mind you this is generally not a good method of doing things, but sometimes a necessary evil. Care must be made though that DLLs are not loaded from multiple copies of the same DLL in the file system. All references to a DLL should be made on the same DLL file. If you do not you will give yourself problems because it will actually load two copies into program space and when you expect the DLL to have global variables that are maintained in the program space environment you will be rudely awakened to find that those global variables in your other DLL are in fact different than the ones you expect them to be.
Another interesting thing I picked up last week was the use of Lua userdata types. These data types are used to represent "objects" in Lua that are not considered one of the standard primitive types. These can be anything from C structs or pointers to C++, C#, or Java objects. It is basically just a pointer to memory in the Lua environment. The tricky things about these datatypes is that you can not create them in the Lua environment. You can only receive them from the main application. Thus the use of these data types are heavily reliant on the host application, functions that receive a pointer to something must be represented as a userdata type and not the primitive that it points to (if it is a pointer to a primitive of course). This obviously can cause some issues, especially when generating interfaces to pre-existing libraries. I found that Swig is not so good at handling this, so care had to be taken to fix some of my wrappings. Also, typedefs can be a cause of torment when dealing with Swig if the typedefs are not included in the header that is being "Swigged". The reason for this is that Swig thinks that these typedefs need to be represented as a userdata type which can cause problems when working with things like handles.
Finally, it should be mentioned that applications that use functions that have output parameters are also a very complicated issue when working with Lua. Lua has no concept of pass by reference. It only allows pass by value and as a result, any pointer passed to the function, when converted to a Lua wrap, is treated as a userdata type. Very inconvenient when Lua has a perfectly good multi-return mechanism built into the language. In fact this is so good that great care must be made to utilize it, unfortunately Swig once again fails at this because it does not know what is an input parameter and what is an output parameter. Now I don't know if I am just too thick skulled to know how to use Swig in all its faceted feature set, but I handled this by brute force modification of my generated Lua wrappings. I feel like modifying these wrappings not only gave me more control over what was being done in each function, but also provided better functionality and ensured that each function was being generated correctly. It took a bit more time but I was happier with the results, and I was able to fix all of the issues that possibly would have gone undetected for a few weeks, or months, or years, until those functions were used by a scripter.
Overall, I still love Lua, I think it is one of the best scripting languages out there. It is easy to use (on the scripting side of things) and not overly complicated to integrate. I was able to get scripts executing within a matter of two hours at the most, much can be said for that. The demo was a success and I am very excited to say that I was able to secure additional funding to continue my work. My managers were happy and thus I was happy. Glory day!
Oh and I beat Dante's Inferno this weekend... also a bonus, saw the anime for Dante's Inferno I was not impressed, more just a retelling of the game storyline. I think EA did a better job with Viceral when they made the Deadspace anime for that games release. It added something to the story that was not in the game. I also am not a fan of anime where they have a handful of different studios with different art styles writing different parts of one story. The change in art style confuses me, not that I am dumb, it just makes my eyes readjust to the changes in color pallets and the character movements. I hope to write a review on Dante's Inferno to finish up the trillogy of reviews (First Impression, First Look, and Overall review) but life is killer and I am super busy looking for a new job, planning my wedding, working at my current job, and working on side projects. As a result the blog always seems to fall to the back burner. Well... back to watching some anime before bed, and back to the grind tomorrow.
Tuesday, February 2, 2010
Downloads Now Functional
I have to apologize, it appears that the applications that I had up here on this blog for download since the blogs inception were not functional... I am not sure why I never knew this. Maybe nobody has tried to download them. Well, now I have proper installers working that seem to function correctly on both Windows XP and Windows Vista without Visual Studios installed.
All applications (for the PC) still require the .Net Framework to execute.
If anyone has any more issues with installing, please let me know as I am trying to work out my release procedures so that everyone can use the applications. Thanks a ton!
All applications (for the PC) still require the .Net Framework to execute.
If anyone has any more issues with installing, please let me know as I am trying to work out my release procedures so that everyone can use the applications. Thanks a ton!
Monday, February 1, 2010
Downloads - Alarm Clock : PC
Application time... literally. My dad asked me to make him an alarm clock application that he could set up multiple alarms with custom messages and sound to remind him of things he had to do. It must be because he plays too much farmville and Civilization IV (although the Civ IV is my fault). But since I made the application, I figure give it to the world, it might be useful to someone.
Features:
Features:
- Almost unlimited custom alarms (limited by RAM of course)
- Custom Alarm Messages (for each alarm)
- Custom Alarm Sounds (for each alarm)
- Enable/Disable alarms in your list by using the check box in the alarms list
- Customize Alarm date/time and re-occurrence settings (for each alarm)
- Set custom snooze times so you can avoid canceling and forgetting about your important meeting
- Save/Load Alarm lists
- Minimize the application to your system tray so it's not in the way
- Alarms pop up over other applications when they go off
Wednesday, September 23, 2009
Google SideWiki and Gaming
I have recently heard about this new tool that Google is coming out with called SideWiki. Basically what this does is allow Google toolbar users to add wiki like elements to a side bar on web pages that they visit. These are then visible to everyone who uses SideWiki that visit a web page.
My interest is to see what people do with this tool in the arena of altered reality gaming. We have seen this in the past with, for example, the Nine Inch Nails site when Trent Reznor was preparing to release the Year Zero album. The series of sites had unique and hidden context that could only be discovered by closely inspecting the sites.
The concept is interesting, not really what I would call a game, but could conceivably be turned into one. Such as the legendary Majestic from EA back in 2001. That game had a great concept and a real story line. What I imagine for the Google SideWiki is something more like your standard pen and paper RPG, where perhaps one group of people create a plot line based on a series of sites that the other group of people playing must discover/navigate to collect all of the clues to solve some sort of web mystery. Perhaps a secret web site that they could log into and find out if they were the first to figure out all the clues. The best part is that if you found a clue, you could in theory, alter the SideWiki to throw others off of the trail if they weren't smart enough to look at the history.
I think it is an interesting idea and one that maybe other might find interesting as well. The thought makes me think of geo-cacheing, something I find fascinating but would never personally partake in. I hope someone takes this idea and runs with it.
My interest is to see what people do with this tool in the arena of altered reality gaming. We have seen this in the past with, for example, the Nine Inch Nails site when Trent Reznor was preparing to release the Year Zero album. The series of sites had unique and hidden context that could only be discovered by closely inspecting the sites.
The concept is interesting, not really what I would call a game, but could conceivably be turned into one. Such as the legendary Majestic from EA back in 2001. That game had a great concept and a real story line. What I imagine for the Google SideWiki is something more like your standard pen and paper RPG, where perhaps one group of people create a plot line based on a series of sites that the other group of people playing must discover/navigate to collect all of the clues to solve some sort of web mystery. Perhaps a secret web site that they could log into and find out if they were the first to figure out all the clues. The best part is that if you found a clue, you could in theory, alter the SideWiki to throw others off of the trail if they weren't smart enough to look at the history.
I think it is an interesting idea and one that maybe other might find interesting as well. The thought makes me think of geo-cacheing, something I find fascinating but would never personally partake in. I hope someone takes this idea and runs with it.
Friday, September 18, 2009
Ogre3D updates Licensing
Ogre3D, the open source 3D graphics engine by Torus Knot Software Ltd had decided to change their licensing from their current LGPL licensing to the MIT Licensing. This is really exciting as this new licensing that they will be using in their up and comming release 1.7 is less restrictive by not requiring developers who use the free open source engine to release any base source code changes.
The reasoning behind this is to provide more incentive to get commercial and non-commercial to use and extend the Ogre engine in their projects. I am personally hoping that this does push the Ogre engine a bit more towards the mainstream game development scene. I hope that more companies will consider using this flexable and free engine in their development model. I think that using Open Source software in mainstream development will help to reduce the large cost of game developent and allow developers more time and money to be more flexable and creative in the types of games that they are creating. By allowing them to keep their proprietary custom code private, I feel that this will encourage them to use the engine more freely.
The reasoning behind this is to provide more incentive to get commercial and non-commercial to use and extend the Ogre engine in their projects. I am personally hoping that this does push the Ogre engine a bit more towards the mainstream game development scene. I hope that more companies will consider using this flexable and free engine in their development model. I think that using Open Source software in mainstream development will help to reduce the large cost of game developent and allow developers more time and money to be more flexable and creative in the types of games that they are creating. By allowing them to keep their proprietary custom code private, I feel that this will encourage them to use the engine more freely.
Wednesday, September 9, 2009
Tool Review - Redmine : Project Management Software
Review time again, this time I will be reviewing a utility that I have used on a couple of projects that I have worked on. It is a great utility for managing your personal/independent projects and project teams. The software is called Redmine. You can find it here at http://www.redmine.org/.
The Redmine web server allows you to create projects and add employees to the project. Each employee can be given different rolls on the project providing customization over the project development process and data representation to individual users. The software is very flexible, allowing for the creation of custom work flows and project specific milestones. Gaunt chart features are available project leaders for use in tracking individual tasks as well as entire milestones or projects.
Wiki features are also provided, allowing for streamline design documentation functionality. This is really handy when it comes to group development, documentation can be updated effortlessly while team members are updating status. The Redmine application also supports integrating with SVN servers and files can be browsed directly from the Redmine site. You can even use the revision numbers as links in the wiki pages.
Built in bug tracking software also provides a centralized bug tracking system and task assignment functionality for project managers, these bugs and tasks are easily linked to milestones, where progress of individual tasks attribute towards milestone percentages.
The system is easy to use and is fully customizable since it is built on Ruby and the full source is provided for your individual customization. I recommend anyone who is looking to start up a project for themselves and their friends, Independent game developers who can not afford to spend a lot of money on bug tracking and project management suites, or anyone who would like to be a bit more organized about their development practices. The best demonstration of the system is to simply go to the Redmine site as they use their own software to manage their external face of their project. I have found this software tremendously useful and I hope by spreading the word, others will too.
The Redmine web server allows you to create projects and add employees to the project. Each employee can be given different rolls on the project providing customization over the project development process and data representation to individual users. The software is very flexible, allowing for the creation of custom work flows and project specific milestones. Gaunt chart features are available project leaders for use in tracking individual tasks as well as entire milestones or projects.
Wiki features are also provided, allowing for streamline design documentation functionality. This is really handy when it comes to group development, documentation can be updated effortlessly while team members are updating status. The Redmine application also supports integrating with SVN servers and files can be browsed directly from the Redmine site. You can even use the revision numbers as links in the wiki pages.
Built in bug tracking software also provides a centralized bug tracking system and task assignment functionality for project managers, these bugs and tasks are easily linked to milestones, where progress of individual tasks attribute towards milestone percentages.
The system is easy to use and is fully customizable since it is built on Ruby and the full source is provided for your individual customization. I recommend anyone who is looking to start up a project for themselves and their friends, Independent game developers who can not afford to spend a lot of money on bug tracking and project management suites, or anyone who would like to be a bit more organized about their development practices. The best demonstration of the system is to simply go to the Redmine site as they use their own software to manage their external face of their project. I have found this software tremendously useful and I hope by spreading the word, others will too.
Thursday, September 3, 2009
Philosophy of Software Test
I have been a test software engineer professionally for three years (going on four). I have done everything from writing automated GUI control test scripts in visual basic to embedded test systems engineering in c for a wind river operating system running Ada with c interfaces. I know that software test is important for any application. I have seen product fail test evaluation that would have gone to the customer otherwise.
Unfortunately not everyone has the same opinion that I do on the matter. Some feel that test software is wasted code, providing no economic gain in the long term of the project. These people tend to be the ones who write the checks for your project so usually you have to do some serious convincing to get them on board. Once you do, you still need to have a good method of approaching your test system otherwise you will be wasting money, a lot of money.
Here I will try to lay out some basic principles and guidelines to follow when writing test code for any project.
Step 1: Determine your systems primary method of outputting debug information
Many applications use the standard console window as their primary source of debug output. I do not recommend this, the reason being that once you have 100+ modules that you are trying to integrate and test, the debug information spewing to your console will be unreadable.
A better solution is to output all of your debug to a common log file for your system. I will elaborate more as to why only one log versus one for each module in a bit.
Step 2: Design your Test Strategy Early
This is probably the biggest problem for people. They know what type of software they want to write, so they go for it. Then approximately 50 - 70% of the way through development, they realize that their system is poorly designed and half of their code doesn't work. The reason for this is that generally people do not take into consideration that it generally takes a while to get a system into a testable state. By the time you have gotten to this point, so much of your code could be wrong and not true to the original design of the system. Trust me on this one, I have worked on major projects that have gone astray from their original design. No matter how well it functions after that, you are always bending your own rules to get stuff to work right. This rule bending is painful and costly, sometimes whole portions of the system need to be redesigned to accommodate some minor tweak made to fix an issue that resulted in a poorly structured architecture/test combination.
The key to success is to decide on how you are going to systematically test each component (software or hardware) before integrating it into the entire system. This is called a functional test or unit driven test, depending on what camp you come from. The idea here is that each module has a set of tests that test out its basic functions as they would be used in the actual system. Now, I do not mean to say that you need to write a whole platform to test the module, that would defeat the purpose of testing. What I mean is that you create a harness to place your module in that exercises the functions input and output to verify that your internal algorithms function appropriately. It is probably a good idea if this is a centralized module that will allow you to turn on and off specific modules for test so that way as you incorporate more modules in your system, they are not only easy to add, they can be tested together within the same test structure.
An example of this is a custom dictionary. Say your custom dictionary is going to be used by two separate modules within the system. For example a means of passing data between two separate threads. Now, if you write your dictionary to have a set of tests that test each of its functions by supplying artificial data for each of its fringe cases, then you can be confident that the Dictionary itself is functional. Now, once you start implementing the worker threads that are going to access this dictionary, you will obviously want to test each of their functions (including the function to write or read data from the dictionary) in a similar manner as you did the dictionary in the first place. This all seems to check out, all is going well. Now once we start integrating, we see a problem. For some reason we are getting corrupt data from one module in the other module. We can't just run our tests because they only prove out their individual components. However, if we design our system in such a way that a fully tested module can be used to write data to the dictionary and just the test that is used to test the dictionaries read function can be used to verify the dictionary, you have now eliminated one third of the potential problem area of the system. The same can then be done against the other module.
This type of approach will help you narrow down the possible problem areas of your system. A useful strategy that I have implemented in the past for checking for memory leaks within a data structure, was to create a separate test module that simply queried my memory manager to print out its allocation table. I then set up this test module to run between integration components and modules self tests. This provided me a way to quickly identify whether a section of the system was using more memory than was previously expected. It was also useful because it tested out the functions of my memory manager as well as the memory managers integration with the other components in the system.
Step 3: Let your Architects/Designers Identify your tests
The reason for this one is that unit testing should be done before any system code is written, and who else better knows what data will be required for input and output of your functions than your Architects.
Step 4: Identify WHAT to test and HOW MUCH to test it
Of course, if you are the architect, then this section is for you.
This is actually a tricky question. Many times your test team will want to test every component and module in the system. In a perfect world, this would be the case all the time. However, in the real world, cost and schedule demand that you use agile practices and identify key areas of testing. If you were to test everything, writing the test code would take more time than writing the actual code. Performing modular testing is a part of the agile development practice because it allows you to release stable code and integrate new features into your software quicker with less bugs, yet it still requires too much time generally to perform modular testing on all components in the system. The trick is to rely on your foundation classes.
API's such as the .net framework and the Apple OS are expected to be stable. They perform their own unit testing and provide their APIs to test developers to work with and exercise before they release them to the general public. By utilizing their work, you alleviate having to write most of your own data structures, and as a result save both development time and test development and execution time. Many companies seem to not want to rely on these APIs from what I have experienced. I am not sure as to the reason for this, but if faced with the dilemma of either using a pre-built table class or to roll your own, think twice about rolling your own. When you are writing software for yourself or for your company, its not about academics, its about money, its about maintainability, and its about rapid stable development.
Also, it is unfortunate, but anytime your company runs into either a budget or schedule crunch, test will be the first thing to go. Manager's priorities lie with meeting their deadlines, not making sure the product is 100% quality assured. This is even more the case when it comes to writing test software to test out hardware. Generally, a computer engineer designing a board for some device will perform a flying probe or a functional board test to verify that their module works (similar to my description of the unit driven testing of software above). As a result, if you can not finish your testing in time for the product release, more than likely the computer engineer/manager will determine that the functional board test was sufficient to satisfy that the product is working... This is wrong. The reasoning behind why it is wrong is the same reasoning behind why it is possible for a module to test out 100% on a unit driven test, but fail once it is integrated into the rest of the software system. It is impossible to fully understand how two devices are going to behave together prior to actually hooking them up and making them communicate with each other.
Step 5: Debug Information - Better Information is Better Information
As I stated before, you really should centralize your debug data. It makes it much faster when sorting through your runtime output than if it was in individual files for each module. I know this seems counter intuitive, but realize that text editors, along with processors and ram, has improved over the years and searching a text file is no longer a computationally heavy task. Well, this is assuming you don't have a hundred megs of output, which may happen at times but most of the time it won't.
Now what I mean by Better Information is Better Information is that more information is not usually proportional to the quality of information that is being output. Sometimes having too much information is more detrimental than having too little. On the other hand, having too little information can also mask your problem. The best bet is to determine early a format for your debug output. This will allow you to quickly identify the major components of the debug output messages. My preferred format is:
[module debug information is coming from]:[message (error, recovery, status)], [message specific data], [expected results], [actual results] [optional time stamp].
This format is uniform and quickly identifiable. For example if you have a player class that checks collision and you wanted to identify during runtime if you collided with other objects in the scene, it might look like this.
"Player: Error, Collision encountered with [object] at (x, y, z), Collision flag = true, [object] Type should not be collidable."
Now here we can see that there was an Error thrown by our error manager framework. It was output to the log, and it contains all the data we need to see what is going on. It appears that the problem lies in the Players collision function (at least at first glance) and that the [objects] collision type was not set to collidable. If this is not the case, the only other possibility is that the [objects] collision mode read function is not passing data correctly back to the player class for some reason, either the player is overriding the data it receives, or it is corrupt for some reason when it gets there. I think this is personally much better than something that looks like this:
t: 0
I could continue to talk about this topic all day, however this post is getting a bit large so I will cut this session short for now. I will probably be adding additional little discussions about testing philosophy here as that is what I do for a living. I am starting to implement a new game idea and I will be implementing some of these things in that title. I will share my experience doing so here. If you have any comments on this, I am always willing to be persuaded to better methods, so don't feel shy about telling me you think I am wrong. I hope this has helped some of you identify your weaknesses in your testing strategies. Remember, its O.K. to be OCD when it comes to software perfection.
Unfortunately not everyone has the same opinion that I do on the matter. Some feel that test software is wasted code, providing no economic gain in the long term of the project. These people tend to be the ones who write the checks for your project so usually you have to do some serious convincing to get them on board. Once you do, you still need to have a good method of approaching your test system otherwise you will be wasting money, a lot of money.
Here I will try to lay out some basic principles and guidelines to follow when writing test code for any project.
Step 1: Determine your systems primary method of outputting debug information
Many applications use the standard console window as their primary source of debug output. I do not recommend this, the reason being that once you have 100+ modules that you are trying to integrate and test, the debug information spewing to your console will be unreadable.
A better solution is to output all of your debug to a common log file for your system. I will elaborate more as to why only one log versus one for each module in a bit.
Step 2: Design your Test Strategy Early
This is probably the biggest problem for people. They know what type of software they want to write, so they go for it. Then approximately 50 - 70% of the way through development, they realize that their system is poorly designed and half of their code doesn't work. The reason for this is that generally people do not take into consideration that it generally takes a while to get a system into a testable state. By the time you have gotten to this point, so much of your code could be wrong and not true to the original design of the system. Trust me on this one, I have worked on major projects that have gone astray from their original design. No matter how well it functions after that, you are always bending your own rules to get stuff to work right. This rule bending is painful and costly, sometimes whole portions of the system need to be redesigned to accommodate some minor tweak made to fix an issue that resulted in a poorly structured architecture/test combination.
The key to success is to decide on how you are going to systematically test each component (software or hardware) before integrating it into the entire system. This is called a functional test or unit driven test, depending on what camp you come from. The idea here is that each module has a set of tests that test out its basic functions as they would be used in the actual system. Now, I do not mean to say that you need to write a whole platform to test the module, that would defeat the purpose of testing. What I mean is that you create a harness to place your module in that exercises the functions input and output to verify that your internal algorithms function appropriately. It is probably a good idea if this is a centralized module that will allow you to turn on and off specific modules for test so that way as you incorporate more modules in your system, they are not only easy to add, they can be tested together within the same test structure.
An example of this is a custom dictionary. Say your custom dictionary is going to be used by two separate modules within the system. For example a means of passing data between two separate threads. Now, if you write your dictionary to have a set of tests that test each of its functions by supplying artificial data for each of its fringe cases, then you can be confident that the Dictionary itself is functional. Now, once you start implementing the worker threads that are going to access this dictionary, you will obviously want to test each of their functions (including the function to write or read data from the dictionary) in a similar manner as you did the dictionary in the first place. This all seems to check out, all is going well. Now once we start integrating, we see a problem. For some reason we are getting corrupt data from one module in the other module. We can't just run our tests because they only prove out their individual components. However, if we design our system in such a way that a fully tested module can be used to write data to the dictionary and just the test that is used to test the dictionaries read function can be used to verify the dictionary, you have now eliminated one third of the potential problem area of the system. The same can then be done against the other module.
This type of approach will help you narrow down the possible problem areas of your system. A useful strategy that I have implemented in the past for checking for memory leaks within a data structure, was to create a separate test module that simply queried my memory manager to print out its allocation table. I then set up this test module to run between integration components and modules self tests. This provided me a way to quickly identify whether a section of the system was using more memory than was previously expected. It was also useful because it tested out the functions of my memory manager as well as the memory managers integration with the other components in the system.
Step 3: Let your Architects/Designers Identify your tests
The reason for this one is that unit testing should be done before any system code is written, and who else better knows what data will be required for input and output of your functions than your Architects.
Step 4: Identify WHAT to test and HOW MUCH to test it
Of course, if you are the architect, then this section is for you.
This is actually a tricky question. Many times your test team will want to test every component and module in the system. In a perfect world, this would be the case all the time. However, in the real world, cost and schedule demand that you use agile practices and identify key areas of testing. If you were to test everything, writing the test code would take more time than writing the actual code. Performing modular testing is a part of the agile development practice because it allows you to release stable code and integrate new features into your software quicker with less bugs, yet it still requires too much time generally to perform modular testing on all components in the system. The trick is to rely on your foundation classes.
API's such as the .net framework and the Apple OS are expected to be stable. They perform their own unit testing and provide their APIs to test developers to work with and exercise before they release them to the general public. By utilizing their work, you alleviate having to write most of your own data structures, and as a result save both development time and test development and execution time. Many companies seem to not want to rely on these APIs from what I have experienced. I am not sure as to the reason for this, but if faced with the dilemma of either using a pre-built table class or to roll your own, think twice about rolling your own. When you are writing software for yourself or for your company, its not about academics, its about money, its about maintainability, and its about rapid stable development.
Also, it is unfortunate, but anytime your company runs into either a budget or schedule crunch, test will be the first thing to go. Manager's priorities lie with meeting their deadlines, not making sure the product is 100% quality assured. This is even more the case when it comes to writing test software to test out hardware. Generally, a computer engineer designing a board for some device will perform a flying probe or a functional board test to verify that their module works (similar to my description of the unit driven testing of software above). As a result, if you can not finish your testing in time for the product release, more than likely the computer engineer/manager will determine that the functional board test was sufficient to satisfy that the product is working... This is wrong. The reasoning behind why it is wrong is the same reasoning behind why it is possible for a module to test out 100% on a unit driven test, but fail once it is integrated into the rest of the software system. It is impossible to fully understand how two devices are going to behave together prior to actually hooking them up and making them communicate with each other.
Step 5: Debug Information - Better Information is Better Information
As I stated before, you really should centralize your debug data. It makes it much faster when sorting through your runtime output than if it was in individual files for each module. I know this seems counter intuitive, but realize that text editors, along with processors and ram, has improved over the years and searching a text file is no longer a computationally heavy task. Well, this is assuming you don't have a hundred megs of output, which may happen at times but most of the time it won't.
Now what I mean by Better Information is Better Information is that more information is not usually proportional to the quality of information that is being output. Sometimes having too much information is more detrimental than having too little. On the other hand, having too little information can also mask your problem. The best bet is to determine early a format for your debug output. This will allow you to quickly identify the major components of the debug output messages. My preferred format is:
[module debug information is coming from]:[message (error, recovery, status)], [message specific data], [expected results], [actual results] [optional time stamp].
This format is uniform and quickly identifiable. For example if you have a player class that checks collision and you wanted to identify during runtime if you collided with other objects in the scene, it might look like this.
"Player: Error, Collision encountered with [object] at (x, y, z), Collision flag = true, [object] Type should not be collidable."
Now here we can see that there was an Error thrown by our error manager framework. It was output to the log, and it contains all the data we need to see what is going on. It appears that the problem lies in the Players collision function (at least at first glance) and that the [objects] collision type was not set to collidable. If this is not the case, the only other possibility is that the [objects] collision mode read function is not passing data correctly back to the player class for some reason, either the player is overriding the data it receives, or it is corrupt for some reason when it gets there. I think this is personally much better than something that looks like this:
t: 0
Player: (x, y, z)
Object: (x2,y2,z2)
t: 1 Player: (x, y, z)
Object: (x2,y2,z2)
t: 2 Player: (x, y, z)
Object: (x2,y2,z2)
t: 3 Player: (x, y, z)
Object: (x2,y2,z2)
Collision: (x, y, z)
Or even worse, no data at all. The difference here is that we are only reporting on a failure or critical status in the better version. This helps cull data that is unimportant to us, making finding what we are looking for much easier.
I could continue to talk about this topic all day, however this post is getting a bit large so I will cut this session short for now. I will probably be adding additional little discussions about testing philosophy here as that is what I do for a living. I am starting to implement a new game idea and I will be implementing some of these things in that title. I will share my experience doing so here. If you have any comments on this, I am always willing to be persuaded to better methods, so don't feel shy about telling me you think I am wrong. I hope this has helped some of you identify your weaknesses in your testing strategies. Remember, its O.K. to be OCD when it comes to software perfection.
Saturday, August 1, 2009
Art - New Logo
For the Anime Rename File Utility, I decided it would be nice to make a little piece of art for the about window. Nothing too fancy. But, I wanted something related to the use of the application. I decided to learn a little more about Photoshop as a result and got a little more familiar with the pen tool.
Here is my attempt at a logo:

I think it turned out decent. Much better job than I have done in the past. I think I am getting a bit better at using the tool. I don't know if I like the text so much but perhaps this is just a first draft. Later revisions may be popping up. I may also decide to go with this art style in the future for a game idea that I am starting to brew in my brain. We shall see :)
Here is my attempt at a logo:

I think it turned out decent. Much better job than I have done in the past. I think I am getting a bit better at using the tool. I don't know if I like the text so much but perhaps this is just a first draft. Later revisions may be popping up. I may also decide to go with this art style in the future for a game idea that I am starting to brew in my brain. We shall see :)
Download - PC : Anime File Rename Utility
Hello All, It has been a while. GE has been keeping me busy in Grand Rapids this last month and I have been working some major overtime on my current project at work. Thus leaves me little time to work on my side projects (as usual). To top it off I bought an IPhone and that has been a bit distracting in its own right (reviews to come).
Anyways, I did take this weekend to write some software to rename files for TV shows (specifically Anime series). Now of course I can not condone piracy, it is illegal and it is wrong. However, there are many Anime series that have become available on the web via sites such as Anime Take (pronounced "Ta-ke") which follow DMCA policies very closely. I have noticed that many of these are done by release groups that tend to "tag" their files in a very ugly manor. As a result, I have decided to take it upon myself to write a file rename utility that will parse all of the garbage out of the names of files and order them by numbers.
This may be useful for other reasons as well. Picture files perhaps. It is not limited to only Anime, but it was my source of inspiration. The software does not in any way shape or form allow illegal downloading of shows, so please do not ask me where to get illegal Anime. This software is provided free "as is" and if you have any suggestions for improving the software, let me know and I will consider updating it for that purpose.
You can download the installer for Windows PC here.

The software is very simple, once it is installed by running the setup installer. Open the application and click "Browse". Navigate to your folder with the series in it and press ok. This will populate the path field and display all of the files in the folder. The application attempts to use the first file name to deduce what the expected series name is. If this is not what you would like to name it, change the name in the "Series Name" field before doing a rename. The "Numbers in Name" field is used so that series that have numbers in their name like "Super 7 Ninja Magic Yea!" (name totally made up btw :), you can put a 1 in that box and the application will know to skip over the first numeral character in the file name before trying to deduce what episode it is. You can use the "Rebuild Name" button to have the application "guess" the series name after a change to the number field.
You can use the preview button before doing an actual rename to see what the paths for the files will be changed to. These replace the entries in the file list box on the left. Finally, "Rename" actually performs the rename of the files.
Drop me a line if you are having problems with anything.
Later!
Anyways, I did take this weekend to write some software to rename files for TV shows (specifically Anime series). Now of course I can not condone piracy, it is illegal and it is wrong. However, there are many Anime series that have become available on the web via sites such as Anime Take (pronounced "Ta-ke") which follow DMCA policies very closely. I have noticed that many of these are done by release groups that tend to "tag" their files in a very ugly manor. As a result, I have decided to take it upon myself to write a file rename utility that will parse all of the garbage out of the names of files and order them by numbers.
This may be useful for other reasons as well. Picture files perhaps. It is not limited to only Anime, but it was my source of inspiration. The software does not in any way shape or form allow illegal downloading of shows, so please do not ask me where to get illegal Anime. This software is provided free "as is" and if you have any suggestions for improving the software, let me know and I will consider updating it for that purpose.
You can download the installer for Windows PC here.

The software is very simple, once it is installed by running the setup installer. Open the application and click "Browse". Navigate to your folder with the series in it and press ok. This will populate the path field and display all of the files in the folder. The application attempts to use the first file name to deduce what the expected series name is. If this is not what you would like to name it, change the name in the "Series Name" field before doing a rename. The "Numbers in Name" field is used so that series that have numbers in their name like "Super 7 Ninja Magic Yea!" (name totally made up btw :), you can put a 1 in that box and the application will know to skip over the first numeral character in the file name before trying to deduce what episode it is. You can use the "Rebuild Name" button to have the application "guess" the series name after a change to the number field.
You can use the preview button before doing an actual rename to see what the paths for the files will be changed to. These replace the entries in the file list box on the left. Finally, "Rename" actually performs the rename of the files.
Drop me a line if you are having problems with anything.
Later!
Saturday, July 18, 2009
Scribd - Excellent resource for programming texts
I am probably way behind on the times on this one but for those like me who don't always read all the tech blogs every day since I have a real job. One that keeps me busy, unlike some other tech jobs held by people I know. Here is a web site that I just found the other day that is like the YouTube of the written world. Scribd.com lets users upload documents in a variety of formats from PDF to DOC. The best part is that I have been able to find full length tech books on topics ranging from iPhone development to software testing practices, and I was only searching for a little while. Now I don't know the legalities of all the texts that are up, but one thing is for sure, I'm going to take advantage of it while I can.
Subscribe to:
Posts (Atom)








