ajh1138

Posts Tagged ‘Development’

Flex Quirks I Learned About Today

In Uncategorized on August 15, 2009 at 11:20 pm

1) Class names in Flex “css” cannot have underscores.
2) backgroundSize is percentage-based, and is based on the size of the container, not the image. Handy! Inconsistent and weird, but handy.

Building yet another game…Hauler!

In Uncategorized on July 9, 2009 at 6:00 am

I’ve been working on a Flex/Flash-based space commerce game for the past few weeks. I’m taking an extended hiatus from WoW, so I have quite a bit more time to dedicate to living an actual life, and building my own games is part of that.

I’m keeping this one pretty simple. The concept is a tribute to classic commerce games like Dope Wars, Solar Wars, etc. – travel from place to place, buying and selling commodities. Make money, upgrade your vehicle, haul more cargo. Rinse and repeat. Every now and then an incident occurs at one of the locations that affects the prices of one or more commodities. There will also be occasional turn-based combat using extremely simplified stats and dice-rolls.

I had Solar Wars on my Palm Pilot years ago, and literally wore down a few spots on the screen from playing it so much. I hope to make Hauler visually appealing and just as addictive.

Once I finish it, I plan to port it to several different platforms including Silverlight, iPhone, and Android. Maybe I’ll even make a Palm Pre version…who can say? It would even be nice on a dumbphone like the one I carry.

I don’t have anything playable to show yet (it’s uuuuuugggleeeeee right now), but at this point I’m further along on this game than I have been on any game since I was a kid banging away at my TI-99/4A or C-64.

Flex 3 – Errors in the Problem Pane May Not Actually Be Where They Appear To Be

In Uncategorized on June 13, 2009 at 5:05 am

I just ran into a pretty weird problem during some Flex development that had me cursing and throwing things around the office…ok, not really, but it was still frustrating.

After getting the latest code from our source repository, I kept getting compile errors in Flex Builder but the line that had the error *didn’t even exist* in the file that was causing it to break.

Long story short: our designer had built various doodads in Flash to use as style components, then referred to those doodads in a stylesheet.  Any item in my Flex code that used those styles was breaking because Flex couldn’t find the object that the style was referring to.  But it gets even more interesting!

As you may be aware, when Flex Builder does a compile, it turns your nice, pretty declarative MXML tags into plain ‘ol nasty ActionScript before it does the actual compilation.  The *true* place in the code that was killing the compile was in fact in the generated ActionScript files.  And every place in those generated files where the Flash components were referenced was causing an error.

During the course of figuring this out, I checked the “save generated code” checkbox (it’s in the Project properties) which gave me a nice folder full of ActionScript files (generatedCode, i think it was called).  Guess what was in there?  The lines with errors.  Through those files I was able to figure out that the style stuff was causing the problem.

But if I got latest code, why wasn’t the CSS finding the nifty Flash doodads?  Great question.  It’s because I needed to add the SWF (or SWC, or whatever you use) as a library reference in my project.

Seriously, Oracle…?

In Uncategorized on October 22, 2008 at 9:46 pm

OK, so it looks like Oracle databases don’t have a quick, easy, non-triggery way to do an autoincrement the same way MS SQL, MySQL, postgres, and every other database on the planet have.  You have to create a “sequence” and then create a trigger to run use that sequence whenever data is inserted into the table.

Seriously?  Wow.

One page I came across in my search for a non-shitheaded way to do this describes this as being a more flexible way than having an auto-increment.  Go to that page and check out the code for MSSQL’s way vs. Oracle’s way.   One line of code versus about 20, plus you have to do it in 3 separate steps.  Using that page’s definition of “more flexible”, I guess a gnawed piece of bone is more flexible than a backhoe.

I imagine Oracle DBAs and developers probably have some quick scripts to let them add incremented keys more easily.  I’ll have to dig around and see.  Considering how much effort Oracle puts into their products as far as scalability and performance, I’m really surprised to see this kind of glaring omission.

Excellent indy game dev post – Asterope by Niklas Wahrman

In Uncategorized on October 16, 2008 at 10:12 pm

http://www.gamedev.net/reference/articles/article2570.asp

This guy hits the nail on the head so many times in this article.  He refers to a lot of development ideas that I tend to agree with, such as the “Ready, Fire, Aim” approach…just build it and stop overthinking!

ActiveX weirdness will make you pull your hair out.

In Uncategorized on October 13, 2008 at 3:18 pm

Note: Non-developers can skip this post completely.

If you’ve ever had to make an ActiveX application run within a web page, then you know how frustrating it can be to get it working, much less try to debug the $!&@# thing. If you’re building it with .Net, it’s even more of a pain.

What do you do in this situation: You’ve read through the available online tutorials (which I will not list, since they’re all somewhat incorrect in one aspect or another) and have had the app working at one time or another, you may still have the “missing/broken” section appearing on your web page instead of your nice new application after you’ve made a change. You’ve cleared your IE cache, restarted IE and may have even rebooted your computer trying to get your app to re-appear. You’ve done just about everything and it’s still broken.

Well, the simple answer is that there’s an error in the app itself. Apparently everything has to run super-smooth in order for IE to even display the app. Comment-out the stuff you’ve changed or throw some try-catch blocks in there. Rebuild the app, clear your IE cache, restart IE, and see if your app appears.

Some steps forward

In Uncategorized on June 13, 2008 at 3:34 pm

Last night I decided that my Silverlight game wasn’t heading in the direction it should, so I went back to a previous iteration with some insights from my recent effort. I’ve had a problem getting the vision of the game solid in my head.

At first I had built a top-down, ship-centric shooter but I decided to try a map-driven, simpler game where you click on planets and then do your trading. I had the map part working nicely, but man it would have been a pretty dull game.

So mow I’m going for a model that’s much closer to Escape Velocity…top-down, player-in-the-center pew-pew game with a galactic map, commerce and weapon/ship upgrades. Last night I was able to (with the assistance of my older boy, Max) get a starfield moving under the ship, and move the ship around using velocity, etc. I still need to do the physics for thrust/velocity/turning, but for a guy that’s used to doing event-driven programming all the time, seeing this real-time action is pretty exciting.

One of the aspects of the game that I’m apprehensive about is building the AI for non-player ships (NPS? hehe). They’ll need to turn, thrust, fire weapons, target the player, etc. etc. Sometimes I think I’m getting a little too ambitious, but that’s what I need to do so I don’t get bored.

Where I am Now:

  • The game universe is 30000×30000 pixels. I generate a background starfield using about 7,000 randomly-placed white circles.
  • player ship in the center; a target reticle is moved by the mouse, which causes the ship to rotate to point at it.
  • ship fires lasers when the left mouse button is clicked. no sound yet.
  • ship increases velocity when the W key is pressed. the starfield moves in relation to the ships velocity/direction.
  • Map currently represents one solar system. You can click on a planet and your ship ( a totally different ship ) appears there.

Next steps:

  • Create the background more efficiently. The stars take too long to generate, IMHO, and maybe take up too much memory. I’m thinking a tiled bitmap would be better. Requires investigation.
  • Get the thrust/maneuvering to be fluid. Add some graphics for thrust, sound too.
  • Create a new data hierarchy to have star systems with planets/moons/stations. Each system should have a security rating, description, etc.
  • Refactor the map to show star systems and enable jumping between those systems.