Site Sections

Monday, August 2, 2010

Where I have been...

So it has been a while since I have posted, this was due to my job hunting and subsequent relocation to my new place in Austin Texas. It was quite a journey to get to where I am now, but I am much happier than I was before at GE Aviation.

The biggest reason, I got a job in the game industry.

My new employer is UTV True Games and I am working on the Faxion Online MMO (www.faxiononline.com). This has been very exciting for me and an amazing learning experience. I can't talk about much now, but I hope to be able to write more once the game gets closer to release.

In other news, work that I have been doing with an independent game group, Rogue Pirate Ninja Interactive (www.roguepirateninja.com) is going well. We are working on an IPhone game that has been announced called "Tower Assault! Curse of Zombie Island" and will hopefully be released in the coming months.

Finally, the other big announcement is that I will be getting married the 21st of August. So it has been a hectic couple of months and I do hope to get back into the swing of things with some reviews, some programming stuff, and some art.

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!

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.

Monday, March 22, 2010

Book Review - Programming In Lua, 2nd ed. @ The Books We Love

Just a quick post to have you all take a look at the latest post on my other blog "The Books We Love". I have recently reviewed Programming in Lua 2nd edition. It is a great book, so take a look at the review here: http://thebookswelove.blogspot.com/2010/03/book-review-programming-in-lua-2nd-ed.html

For future note, I have started this second blog to house my book reviewes and all future book reviewes will be hosted there, I will reference them here if they pertain to Game Development or Software Engineering. So check both often :D

Thanks!

Thursday, February 25, 2010

Scheduling

Scheduling is something that since leaving school as a graduate I really have not had to deal with. The reason being that my day usually consists of working on various tasks that are assigned to me through our task tracking system. Granted some adhoc scheduling is required to ensure that the top priority task is worked on first or to balance due dates with priorities to insure that all of the tasks are completed on time and under budget.

The scheduling that I am referring to is my out of work time. This has mostly been open due to no extra curricular activities with a fraternity or school organizations. The problem I have noticed is that I have a lot of things I want to work on, and I tend to get sidetracked easily. As a result I feel that it is time to schedule my after work activities again like I did when I was very busy in school.

My schedule looks something like this:

Monday Tuesday Wednesday Thursday Friday Saturday Sunday
9 am Work Work Work Work Work Videogames Videogames
10 am Work Work Work Work Work Videogames Videogames
11 am Work Work Work Work Work Videogames Videogames
12 am Work Work Work Work Work Videogames Videogames
1 pm Work Work Work Work Work Videogames Videogames
2 pm Work Work Work Work Work Videogames Videogames
3 pm Work Work Work Work Work Videogames Videogames
4 pm Work Work Work Work Work Programming Programming
5 pm Work Work Work Work Work Programming Programming
6 pm Web Web Web Web Web Programming Programming
7 pm Dinner Dinner Applebees Dinner Dinner Programming Japanese
8 pm Japanese Programming Applebees Japanese Programming Programming Japanese
9 pm Japanese Programming Applebees Japanese Programming Programming Personal
10 pm Personal Personal Applebees Personal Personal Personal Personal
11 pm Personal Personal Personal Personal Personal Personal Personal
12 pm Bed Bed Bed Bed Bed? Bed? Bed

The major reason for this is that I feel like I do not get enough work done on my personal projects (and I play too many video games) if I do not have a schedule. I am starting this this week and I hope that I can stick with it. I have a few really important goals with this:
  1. Work more on personal programming projects.
  2. Learn Japanese (which I keep meaning to do but never stick with it, I think scheduled time for this will help)
  3. Keep sane while working hard (I have to play video games and I need social time, thus both are scheduled in the form of video games and Applebees trivia nights). 
 I hope that I can stick with this and that I become more productive as a result. Obviously it isn't set in stone but it is a guide and I am hoping that it will be useful. I am putting it here as a means of trying to show others what I am trying to do to better myself and maybe provide some inspiration for others to do the same.

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.

Tuesday, February 2, 2010

Game Review - Prince of Persia : Ubisoft : PS3

The latest game I recently played (skipping a few others I have played and not had time to review) is Prince of Persia for the PS3 by Ubisoft. Now this game is an older title for this generation, circa 2008, however I believe that this game still holds up compared to its big brother Assassin's Creed II (is that the right term since its newer?).

Not surprisingly the main characters move very similarly and the games hold much in common for game play styles. Prince of Persia is very much a platformer in the sense that AC and ACII are. Most of the game revolves around climbing very complicated structures and obstacles to reach very high points in each level.

The Good:
Prince of Persia does platformers like they should be done. The obstacles are not complicated to figure out what you are suppose to do, however still provide a good challenge. The game has 4 types of special "plates" that are opened up only by collecting enough "light seeds" which are scattered around the environment. These are only available once you have healed the land in an area. The plates that are opened up provide access to additional areas to heal. The plates also require you to perform some kind of feat, such as the green plates allow you to run on walls, however the slightest bump and you will be sent back to the last successful platform you managed to land on. 

Story in the game was decent, it was driven mostly by very witty humor between the two main characters. This dialog was optional which is something I have not seen very often in games, it was controlled by pressing the L2 button on the controller and could be pressed as often as you liked. Certainly there were only so many worthwhile dialog sections, but the Prince was never short of cynical one-liners to say. I was surprised at how much of the games dialog was wrapped around the Prince trying to get in the Princesses knickers. I found this quite amusing, and her retorts were even more amusing, it created a chemistry that I have seen few games pull off. 

To top off these high points, I found it interesting Ubisoft's approach to deaths in the game. It becomes quickly apparent that you can not technically die in the game. Any time that the Prince would fall or would be killed by an enemy, your companion is there to save you. This is not overly cheap or simple in my opinion when it comes to the platforming, however I found it quite unrealistic in fighting the bosses in the game. Saving you does however give enemies a chance to heal so in that regard it wasn't completely unfair. 

The Bad: 
The ending, I won't spoil it for anyone who is going to play the game after reading this, but I will say that I just was not impressed. I felt that the end of the story was predicable (for me from the beginning) and was designed in such a way to simply anger you. I feel almost as if that is Ubisoft's motives in games is to make the players so angry at the ending of games that they must play the sequels to the titles just so that they can relieve some tension towards the franchise. I have felt the same emotion at the end of BOTH Assassin's Creed games. 

I am also not a fan of how they are selling the Epilogue to the game, a two hour "extra" level as DLC for 10 bucks... an Epilogue? DLC in my opinion should never have anything to do with main plot in a game. I think it should only include additional side quests and fun multiplayer content. I payed for the game, and I would pay for a sequel, but an extra 10 bucks just to see the end of the game, and not the crappy one that they gave me but a real freaking ending???!!! That's robbery in my opinion and I am not going to put out for that. Games like Elderscrolls Oblivion, or Fallout 3, or GTA, I can see having additional plot line as these titles are not strictly tied to their predecessors in the series. The stories stand alone on their own and presumably so will their iterations. Adding main story to these games expand their worth. Granted Ubisoft has not released another Prince of Persia in the story line, and from the looks of it, the next title in the series will not be continuing this plot line, so perhaps a DLC expansion isn't inexcusable, but a 10 dollar two hour one is.

Ah fighting... so important in many games, not Prince of Persia. Combat is sparse and only moderately exciting. The combo system is nice and the use of your partner's magical abilities to link longer combos together is somewhat innovative. Her use of magic does however remove the use of the triangle button for the Prince's abilities, so really more of a gimmick to seem innovative when they could have just given the magical powers to your character instead. Also, it seemed that as the enemies got tougher, gaining the ability to shapeshift which required you to perform only certain types of attacks, it seemed that even if you used that type of attack on them at times you still could not hit them. Their ability to block attacks is legendary, making for sometimes extremely long fights. 

Finally, I hate being analog screwed. If the reader is not familiar with this term, it is the act of trying to tell your character to do one thing but he/she/it does something else because of the slight variation in camera angle vs. analog stick angle. This game (and Assassin's Creed titles) are notoriously bad about this. There were many times that I expected the character to run straight up a wall, instead I got a wall run, only there would be no place to wall run to... frustrating.

Overall: 
Prince of Persia was a good game. I would give it an 8.5/10. Platforming is key in any good platformer and I think that Ubisoft is one of the best at what they do. I really commend the voice acting work that was done on this title and I would love to see more games take a similar approach. I still don't like the price of the DLC and I don't expect it to change, I guess I will just read a synopsis online... oh well.