Saturday, September 18, 2010

HTML5 is nifty

I've been coding primarily in AS3 for a few years now, but I was tasked to do some research into HTML5.

While I'm still in the exploration stage, it's pretty nifty. I can see adopting this technology heavily once all browsers are on board. I'd love to be elitist about it and just say be damned to IE, but that's not my call. I know thee are workarounds for the IE shortcomings, but I kinda have to wait for actual support for the things I do.

Either way it's a very interesting technology that I'll be giving mindshare to so that I'm ready for the full shift when all browsers get with the program.

Thursday, August 26, 2010

Algorithms are fun

I've been working on a persnickety (yes, I actually just used that word) little algorithmic issue for a new game I'm working on. The game is kind like Phlinx and Bubble Town, so there is a little projectile that flies up toward the board and, upon matching three or more, causes the pieces to explode and disappear.

That matching bit was fun in and of itself, but I got that one sorted out. The challenge now is the line-of-sight check for spotting where the projectile is allowed to land.

The problem is a little tougher because the board is staggered (Row 0 starts at pixel 45 and Row 1 starts at pixel 90...for example), so you can't just simply check on an array basis. You use the array, of course, but you have to kind of treat it a bit differently.

For example, consider:

[ ][ ][O][ ]
[ ][ ][X][ ]

[P]

Since the row offsets match, we can immediately see that the projectile (P) can not get to the open position (O) because there is a piece (X) in the way.

But, if we stagger the board:

[ ][ ][O][ ]
[ ][ ][X][ ]

[P]

...and if we imagine an line drawn from P to O, then the piece CAN hit that spot.

But how far can it go?

[ ][ ][ ][O]
[ ][ ][ ][O]
[ ][ ][O][ ]
[ ][ ][X][ ]

[P]

...looking at this board, an imagining that line draw up, the projectile can find its way all the way to the top of the board here.

Those are just a couple of the issues associated with this. Either way, it's a fun challenge (so far), but I'm certainly finding myself brooding more than coding at times. :)

Wednesday, August 4, 2010

Flash Debugging

So as I (and seemingly tons of other Flash devs) continue to struggle with memory and CPU issues, I searched for ways to help pinpoint issues. I found two items that I'm planning to try out today to help:

1 - De MonsterDebugger -- an AIR app that allows you to realtime debug on many fronts.

2 - EventController Lib - a library that manages events to make sure you don't end up with lingering event managers in your code.

With any luck I'll have good news on these two items soon. Either way, I'll post up how things are turning now.

**UPDATE:

Wow. The two items listed above are AWESOME. I highly recommend this to anyone serious about developing Flash apps/games. The bug I've been hunting forever has been found and (hopefully) squashed. And, yes, it was my fault.

I fell into the trap of expecting Flash's garbage collector to be more intelligent the larger system gc's because it is smaller world. Unfortunately, it's not. So, just like C's new and delete, so it goes heavily with Flash. If you want more details, check out this great article by Tom at Gabob.

It was in the comments of that article that I found the EventController Lib and from that I found the Monster Debugger.

Even though I was removing the event listeners from everything, I wasn't nulling things properly. I *thought* I was, but with the Monster Debugger I was able to see a lot more than I was getting from the Flash debugger. What I saw with Monster was how I was missing quite a few of nulls, and a couple of deletes too. Oops.

Anyway, now CPU usage is now quite nice (when the GC decides to kick off) and memory is staying low too.

I will likely integrate the EventController Lib too since it seems to be really intelligent in how it works. First, though, I want to see how things go now that I'm nulling/deleting in (again, hopefully) all the right places.

With my luck I'm probably still not 100% solved on this issue, but it's GOT to be better!

** Update Part 2:

Integrated EventController Lib. Nice. It was simple to integrate and it gives a simple interface for controlling events. Plus it can be easily set to log information over to Monster Debugger, so that's sweet.

So far I'm liking these new toys!

Wednesday, July 28, 2010

One year anniversary

I can't believe it, but yesterday was the one year anniversary of when I stopped drinking sodas. After downing 4-6 sodas a day (on a slow day) I decide that it was time to stop.

So, I did. And...it sucked, but I ended up dropping lots of weight and my mood evened out. It took thirty days or so before I could stand being in a room with soda and not wanting to imbibe. Even now I long for an ice-cold can of Mt. Dew.

Point is that I stuck with it for a year. I'm glad I did it and I'm not going to go back to sodas, but...but...but damn do I want that Mt. Dew.

Friday, July 23, 2010

Ice Breakers: Penguin Pirates

Finally released Penguin Pirates on games.com. It's in beta right now, so I'm sure there are still a few bugs to contend with, but it's looking pretty good.

Check it out at http://www.games.com/game/ice-breakers-penguin-pirates/

Tuesday, July 20, 2010

Moved stuff around

In order to take the writing life more seriously, I've decided to go with the recommendations of a few industry folks I've talked to.

One of the bigger dealios for this is that I had to set up a separate blog specifically for my writing adventure. That blog will have nothing but stuff about writing. This blog will still go on for the other crap that I do, which seems to be dwindling slowly to a crawl. :-)

Anyway, by the time I'm done I'll have three total blogs going:

1 - This one, which is for games, coding, and general nerdery.

2 - The writing blog

3 - The music blog

Yeah, I know that's nutty, but separation of church and state seems to be needed these days.

Monday, July 12, 2010

"Book" to roots

I have been a developer since the early 80's and have coded on a VIC-20, C-64, C-128, TRS-80 (I, III, and IV), PC (DOS, 95, 98, XP, and now 7...skipped Vista), Mac (OS/X only), iPod Touch/iPhone (thoroughly hated coding on these), and now the Droid. I have used Assembler, BASIC, COBOL, Pascal, Prolog, C, C++, C#, Objective C, Java, JavaScript, PHP, PERL, HTML, ActionScript (3.0)...and likely more. I've also written numerous game development articles and had two books published on 2D game development as well.

Well, after all of this I had finally gotten to the point (about 5 years ago) where coding started losing the same level of excitement that it used to have. I still love coding games, but just plain coding, tinkering, and hacking is not all that thrilling anymore.

Fortunately, I picked up the book "Code", by Charles Petzold last week and I have suddenly realized the problem. I miss the days of the VIC-20, C-64, and all the other nerdy machines made! There is so much abstraction now that the tinkering and hacking just doesn't have that same draw. At least not for me. Mr. Petzold really brought me back to my roots with his excellent book.

I'm planning to order a NerdKit (http://www.nerdkits.com) later this week, and will eventually like snag a Tower System (http://www.towergeeks.org/page/the-tower-system) before I finally join up for the Game Institute class on creating your own video game console and game (http://www.gameinstitute.com/Video_Game_Console_Design.html).

I've never been much into electronics, so it will also be an exciting new jump into a technological area. Building stuff and the coding to it just sounds so cool that I must give myself a +2500 geek points immediately upon completion of my first project. Sadly this stuff is not cheap and in this economy there is a lot of penny-pinching going on. So it's going to take some time to get things going, but that's cool. There are loads of FREE sites out there and plenty of cheap used books to read at nights and on the weekends when there is time.

I loved tinkering with the old Commodore's and TI's back in the day and I'm already excited about the potentialities of these little kits. But (those of you who know me) this is not a take-over-the-world situation for me. I'm going to treat this as nothing but a hobby. No deadlines, no next-biggest-thing projects...just nerdy learning and geeky fun. That's it.

It's like a technological breath of fresh air to go back to a point where abstraction is minimal. Many of these kits offer C as the connection point, and I'll likely utilize that on tougher projects, but wherever possible I'm using Assembler (or ML, if at all possible!). I can already imagine spending hours and hours fiddling with a project whereby I toil and toil using Assembler and various schematics to satisfy a project that simply makes an LED blink once. Yes, it's essentially pointless, but damn if it ain't cool!

So, if you're looking to get that old-skool interest again, check out Petzold's book. It's an interesting read and it may serve re-spark your nerdiness too.