Code Ugly

Name: Greg Tedder

I am a Christian, a family man, a college student, a full time worker, a contract developer, and a musician who is currently trying to break in to the indie gaming market. I like games, mainly turn based RPGs, but my interests do wander when a good creative title comes along.

Wednesday, February 27, 2008

A Happy Mac-er

Today I received the MacBook I ordered this weekend, and I have two I need to thank. First off, God has blessed me so much lately I can't go off on a tear about someone else until I mention him. Secondly, I have to thank Apple for their generosity.  


When I placed my order with Apple Sunday, I bought the middle of the road 2.2Ghz with 1GB of ram and a 120GB hard drive. It hit a road block Monday when my credit card hit a daily limit and I had to pay it in chunks each day for a while. A little disappointing because I was expecting it sooner. 


When I woke up this morning, I got up to look at things and noticed that Mac had updated their lineup and I could have gotten a better computer with twice the memory for the same price. I couldn't believe it and thought, just my luck. When I got home from work I found it waiting for me on the bar. I opened it up, and low and behold it was the newer MacBook. I was shocked needless to say.


This computer is very fast, and has a lot of useful functionality. Right now I am modifying Aeges Road trying to get all of it to work on Mac. I have found a few OpenGL gliches in the level editor and the console with the Intel graphics, but none of them are show-stoppers, just visual oddities. I am also having a few other problems, but I am unsure whether this has to do with the Mac difference, or the fact that I upgraded to 1.7 in the process. I am about to download the old version and find out. I am also trying to get used to Jedit again. Besides text mate, any Mac torque scripters know of a better script editor?


Sunday, February 24, 2008

Aeges Road Weekly Update is Hear


And no, this is not a typo, and yes, I am aware sentences should not begin and. Aeges Road now has sound in many places such as combat and most gui elements. While many of the sounds are just fill in, I plan on having the rest done before beta testing begins. What kills me is that I was more worried about sound effects than music, and I have done better with sound effects than I have music.


So far all sound is generated through audacity. It got me a little ways, but about mid-week should see a boost in sound production when I receive an apple laptop with a built in microphone. I have all kinds of little pieces of noisy trash just waiting for their chance at stardom in Aeges Road.


Another exciting development is that I now have dungeon walls. They aren't complete, and I am not totally satisfied with the art, but the format is satisfactory. I tried a dozen different techniques these last few weeks and I finally got happy with one of them.


So here is a quick run down on where Aeges Road is and isn't.


  1. Core Combat System: 100%

  2. Core Path Finding: 100%

  3. Core Range Finding: 75%

    • Still needs line of site!

  4. Core Exploration System: 75%

  5. Core Stats: 100%

  6. Core Skills: 50%

  7. Combat abilities: 10%

  8. Exploration abilities: 20%

  9. Music: Two partial tracks which equals ?%

  10. Gui Sound: 50%

  11. Combat Sound: 20%

  12. Ground Tile Art for Demo: possibly 100%

  13. Ground Tile Art for Full Game: about 30%

  14. Wall Tile Art for Demo: about 50%

  15. Wall Tile Art for Full Game: about 10%

  16. Object art (trees, rocks, etc) for Demo: about 30%

  17. Object art ('' '') for Full Game: about 3%

  18. Character art for Demo: ????? Not Good (only one fully animated and colored monster)

  19. Character art for full game: ?????? Not Good

  20. Scrolling backgrounds: 0%

  21. Main Screen Artwork: 0%

  22. Save Game: 95 – 100%

    • Trying to decide


All I can say is that I would be a crazy man to abandon this much work. As my art skills continue improving Characters should start coming out of the woodwork. Oddly enough, I have found it easier to model in 3d, than draw in 2d, but that could just be showing my complete lack of talent in the art department. I also found my various musical styles very incompatible with cinematic-ish music. I also keep writing stuff and realizing I have a Final Fantasy tune stuck in my head. So hopefully soon I can expand my musical creativity and get the rest of these tracks pushed out.

Friday, February 22, 2008

Ugly Coders Word of the Day: Refactoring

If anyone was wondering why I would call my site code ugly, it is for a good reason. I write ugly code. At least the first go around. So I thought I might write a semi educational look on ugly coding and refactoring. It's what I do, maybe you should try it. OK, here goes.


(Disclaimer: This is general, so I statedclasses instead of torque data blocks)


It takes me a while to really get comfortable with a language. For a while I am nose in the manual on every line, then I slowly move into writing my own errors without the help of a manual. I just keep stubbornly hammering away knowing that on some far off sunny day things are going to make sense. And that, is precisely when things get nasty. :-)


It is at this point that I start going over old code looking for functions and frameworks that I set up and I realize how poorly implemented they are. One thing I, and surely many others, fall into is implementing quick code to get something working. Especially when working with a new element of the language. So as this piece of code gains more functionality it becomes much harder to maintain. There was a point where I would try to avoid doing this at all costs, and wound up wasting more time than I saved. So now I embrace the ugly code as a productive tool, which brings us to refactoring.


When I implemented a combat system in my game, I originally just stuck a few functions with lots of logical sorting to decide what stats determine what sort of attacks and so forth. It worked great while I was just using damage options. It even worked a little smooth when I added the ability to heal. Things, however, got really tricky when I started trying to add stuff like status effects and other odds and ends of a fairly standard RPG. Rather than nesting the function, I shrunk the function down to making one external function call to the specified attacks class method.


On a flip side, there is a bit more code work to do with this structure. However, maintaining and extending the code is much simpler. What I usually do is try to part out the code to functions that I know will be used in multiple classes. Sometimes it takes a few runs to make sure I am passing enough data into the functions for all the work that needs to take place. Finally, before I know it, my code is not as ugly as it used to be, and when I decide at the 11th hour that monks should be able to meditate in the middle of combat, all I have to do is create a class and over ride a method call.


Hopefully this has lifted the self esteem of other ugly coders out there. Yes we write ugly code, yes our functions are in excess of 1000 lines long, and yes, we skipped our own prom to go fishing. But we are coders too saying, fewer function calls equals more optimal performance ... er ... I mean ... our code can refactor into something a little more ... yeah ... more. :-)

Sunday, February 17, 2008

Aeges Road Weekly Update


I have that feeling right now. Like I am about to cross a narrow bridge with an oncoming truck. The deadline is getting closer, and it seems like more needs keep piling up. However, the check list is getting smaller right now. So, here is a small list of things, and I think I will start with the negatives and end on a positive note.


Just as I feared, I am going to be going into this competition with cheap art, and possibly an incomplete title screen. There are also a few skills I was wanting in the game that are not implemented yet. Most skills were easy, since they directly effected the existing systems. The hard skills are the skills that add to the existing system. Regardless of whether or not they are in the demo for the competition, they will be there for the final release. I may be loosing points for making this confession, but oh well.


One addition I really want is the ability to hide and sneak around in combat. Just to be clear, I don't have plans for making sneaking around and hiding beyond combat, it just doesn't fit this game well. Also, I wanted a locks and traps system, but my art skills just haven't been able to capture my vision, and the behaviors I wrote for it are a little more than buggy. Now, time to build toward the positive.


Dialog works! I don't have level one completed, but it is getting closer now that dialog is present. I mainly just need to get switches and doors working before the level will be complete. I decided to use level one as my check list, because a lot of what will happen sets the pace for the rest of the game.


Persistent data works now! Treasure chests and other static item containers now work. They offer treasure, and their state persists throughout the game. Static enemy encounter persistence has been improved, and seems to be a solid fix. Revisiting an old area will now render different, possibly even zero combat situations. Also, if an item will not fit into inventory, you can come back for it later.


Save games now save everything! I finally worked past my odd inventory handling code and got it to save to file properly. This was probably my biggest concern, so I can breath easy for about a day now. I can say with a lot of certainty that my inventory management is going to end up in my post mortem. :-)


Combat is a bit more fun. I am constantly tweaking combat. It is one of the more prominent elements of the game, and I want it to be challenging and fun. I have recently tweaked the way combat handles movement range finding that surprisingly seemed to bring more out of combat. At least, I was surprised. It opens up a bit more of an option, while at the same time making AI a bit more challenging. This also helps with the ranged weapon balance.


So what is left. A lot, but not too much. Since I am accepting my shortage of artwork and plowing through, I hope to have a lot of fun elements available for testing. I still need to finish my manipulation system. I have the attacks available, but as far and management in the inventory it is non-existent. I also need to put experience points in action. I have left this alone for testing purposes, but I think this week I will implement the restrictions and get class and skill increments working within the bounds of experience and actual level ups.


Finally, the website is up! The community pages work, though there are a few style issues. So feel free to register and volunteer for alpha testing, coming up in March. It should prove interesting. :-)

Friday, February 8, 2008

Things Might Go Bad This Weekend

At least on this site. I am still polishing up the website and forum right now, but will be launching the site in waves thanks to the miracle of svn. Hopefully by Sunday I will have a fully functional website and community. After launch there will still be some style issues to work out, so if your browser is showing an error feel free to let me know about it.

Site Will Be Down For Maintenance Off And On This Weekend
I will try and make downtime as minimal as possible.

Sunday, February 3, 2008

Aeges Road Weekly Update

It has certainly been busy here. I appologize for not posting sooner, I am working on the same mix that caused me to miss some posts last time. A lot of homework, and I am learning rails to finish this website.


I decided to go ahead and chance taking two weeks off Aeges Road to attempt to get this website off the ground. It was really slow at the first of the week, easy languages usually have about 300 naming conventions that will drive you crazy before figuring them out. Now that I am actually calling a few functions without consulting the manual I am seeing some progress.


I looked through several pieces of forum software, and none of them felt like a good fit for integrating into the website. So hopefully the one in construction right now won't need a migration within a month to fix a serious database crunch that will suck up my monthly cpu usage. :-) Next weekend should mark the launch of the site, and hopefully the community page as well. For blogging, I am very happy with what I have. There are lots of people with google accounts, making it easy for them to reply in passing.