Hey Look, I Maded Some Artifishul Intelligence

This process of building the AI for the enemy racers went at least 90% smoother than I thought it would have.  Either I’m getting good at this programming thing or I just got lucky.  Take a look at the video.

It’s rather simple, really.  For each level, I create a map of “waypoints” for each of the enemy cars to follow.  Once they hit one waypoint, they move onto the next.  To make sure that they all don’t follow the same path, I used Math.random() to add to the x and y location of the waypoints so each car’s destination is different than the others.  Maybe one lap a certain car will go into a turn perfectly but then the next lap he’ll go skidding into the dirt, who know? LOL!

Once I saw that the cars were able to navigate from point to point, I just basically copy and pasted the code from the player and whalla, they started to accelerate, brake, and turn.  Magic, really.

To Do List:

- Obviously the AI isn’t completed.  There’s that annoying depth issue where the cars just drive through eachother.  To fix this, I’m going to code in a way to figure out what car is driving over who, and to a djust the depths of the two cars so it looks like one is driving on top of the other.  This idea comes purely out of the Sega Genesis game I’m basing this whole project on, Combat Cars.

- Next, I have to get the AI  to know when to use their own unique weapon.  If there’s an open opportunity to take out an enemy vehicle, take it!

- After that I want to update/get new sounds for everything.  I want to find the perfect sound for everything.

Well, that’s it.  Whatcha think so far?

Bitmap Performance Issue Solved and a Video of Level 1

So it was the vCam that was causing the odd lag issue.  I’ve learned a valuable lesson the hard way, never use the vCam in Flash games.  So I binned the vCam and am using a much, much, much better approach to moving the screen around.

Click to see full version.

That’s all I really have to report for now.  I didn’t do any work on the game today, took a day off from all the headaches.  Instead I spent it trying to find a decent screen recorder to record a sneak peek of what I have working so far.  (Trust me, this task was more of a bitch than you can even fathom.)  So here, you better enjoy this video.

Tell me what you think!  (Audio may be a tad off sync, mostly because I had to record the video with one program and the audio with another, then try to line them up just right in the video editor.)

Level 1 Design Done

So after roughly four days of working on a part of this project I thought would take maybe part of one day, I finally have Level 1 completed.  Well, sort of.

It’s designed, yeah, but now when I add it to the game, things start to lag more than a fat kid on dial-up playing MW2.  Why?  I really don’t have an answer.

I mean, before this, I had somehow (accidentally) gotten a huge 6500×6500 bitmap into Flash (when the bitmap size limit is near 2880×2880 I believe) and added that to the game and there was not even a touch of lag.  However, when I add this drastically smaller bitmap to the stage the lagfest commences.

So yeah, now I’m in the process of fixing that.  You can take a peak of Level 1 in the image above.  No big picture, just a little teaser sort of thing.

I originally planned for the tracks to be vastly bigger, but I had overlooked Flash’s bitmap size limit.  Upon playing around with ideas to overcome this, I’ve decided to just go with smaller tracks.

So, yeah.  What’s next on my agenda?  Good question.  Tomorrow I hope to God I can get this lag thing fixed.  Once that’s done, I’m not going to be adding anything new to the game for a while.  I just plan on going through all the code and optimizing it as best as I can.

In Unrelated News…

The Jets pulled off another amazing win today to land them in the AFC Championships next week.  Dare I say they beat the Colts once again, they’re in the freakin’ Super Bowl.  Hot damn.

Alright, that’s it from me.  It’s 12:30am and I’m tired.

I Would Have Been Dead Today

That’s right.  I would have been dead.

As in, not alive.  Like, alive-alive.

See, yesterday after fumbling around with something in Flash, it started to freeze up.  I stupidly ctrl+s’d it by habit and closed out.  I realized what I’d done when I tried to open the file and I got a “corrupted” message, “file cannot be opened.”

Had I not made a backup just a day before, I would have climbed up onto the first building I saw that I felt was tall enough and jumped.  I mean, this game has been my life for the past month and a half.  I gave up WordPress and freelancing for this shit.

Honestly, I couldn’t believe everything turned out okay.  All I’d lost were a few easily-replaceable symbols that weren’t in the older backup file, but that was sorted out in just an hour or so.

What did I learn from all of this?  Backup everything like a motherfucker.  Seriously.

I now have a folder called “Backups” with dated subfolders where I backup all of the game files a few times a day (I’m all paranoid now).

The thing that really amazes me, though, is this.  Why did I randomly back up my Flash file when I did?  (Just a day before I needed it.)  It’s all thanks to Edd from Edds World.  He tweeted this just days ago:

- – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - -

My Flash file corrupted. Perfect. Just spent hours to get to where i already was.

10:50 PM Jan 9th from Echofon

- – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - – - -

When I read it, I just casually went and backed up my Flash file.  Just in case.

So I would just like to issue a big thanks to Edd.  I fucking love you.  Also, hope everything worked out with that corrupted Flash file, should’ve kept a backup, dude.  (LOL)

In Other News…

I was planning on having a picture of Level 1 in this post.  I’ve been spending the last two days working on designing it as well as building it’s structure (background display, walls for the cars to collide with, dirt for the cars to drive on, etc).  Thing is, I just scrapped the whole thing.

See, the level was about 6500 x 6500 pixels big (made in Photoshop).  Flash has a bitmap limit of 3880 x 3880 (I believe).  I didn’t realize this until it’s too late.

I began ways of working around it by cutting the these huge files (background level design, walls design, dirt design, overhead design) into quarters and then tiling them via Actionscript.  To make a long fucking story short, it worked, but it was way (Read: fuck lots of ‘way’) too much work to have to do this for every level.

What am I doing now?  I’m making smaller levels.  Vastly smaller levels (to fit into the 3880 x 3880 limit Flash has on bitmaps).  I’m also totally redoing my whole art style.  To be honest, I’m glad I’m starting over.  I’m liking this new style alot more.

So yeah, that’s it.  More updates to come!

P.S.

My good ol’ pal Rid finally got his blog off the ground the other day.  Go check it out for free* money: http://RidTheWorld.org.

* Money is not free.

Game Update and Other Things Too

“Oh look at Ralph, he’s abandoned another blog after promising to update it.”

Shut up Eternal.  No I didn’t.  I said I’m going to have a more relaxed update schedule on this blog compared to ForTheLose.org.

Anyway, I got lots of stuff to talk about today, so I guess the wait paid off (if you care, I suppose).

Progress Being Made on “Weapons on Wheels”

Yeah, in case you hadn’t figured it out yet, the game I’m working on is titled “Weapons on Wheels.”  Though the Christmas/New Years holidays definitely put a damper on my productivity, I’m back in the groove.

Click image for larger version.

I’ve spent a good chunk of the past few days smoothing over the current wall of code and adding new features.  In case you don’t know, this whole game is a tribute/remake of one of most favorite Sega Genesis games I played when I was younger (and still do today), “Combat Cars” (video).  I swear, I can waste hours playing that game.

Epic Time-Waster, “Captain Forever”

I stumbled across this amazing Flash game from the blog over at MondoManiatrics.  The game is called “Captain Forever” (link).  Basically, you start off as a small one-piece ship out in space.  Your main mission is to collect pieces of enemy ships you destroy, connect them to your ship to make it more powerful, rinse and repeat until you’re pretty much unstoppable.  I can’t tell you how many hours I’ve wasted on this game in the past week.  Go ahead and try it out.

Small Side Project(s?)

Today I decided I’m going to start creating some small files to put up for sale on the ActiveDen marketplace.  I figured if I was able to make some good money from the ThemeForest marketplace with my web design nonsense, why not try to make some money with their Flash-based counterpart?  For example, tonight I’m spending my time creating a very nice-looking and functional preloader.  I figure it’s worth a shot to see if I can get a few sales from it, and if so, I’ll probably make some more similar items.