Previous Blog Next Blog
Prev/Next Blog
by date

Gotta love scripts...

Gotta love scripts...
Name:Scott Coursey 
Date Posted:Dec 17, 2006
Rating:Not Rated
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Scott Coursey

Blog post
I'm working on the AI components of my game right now. It's in the early phases, so there's plenty of work to be done. I've made a few false starts on it and decided to take a step back and model the AI's behavior so I could visualize it better.

Since I'm a Mac user, the most logical choice (for me) was to use OmniGraffle. I already had the tool and was familiar with it. So, off I went to design the thought process.

The diagram soon became quite large and the idea of turning it back into code was daunting, to say the least. I looked at the data file from Graffle and saw that it was XML. Cool.

So, after a while of putting some script together, I was able to translate this:



into skeletal TorqueScript. Very cool indeed. It not only writes the main if/then/else blocks, but includes the function stubs so I can fill those out later. Like I said, there's LOTS to do, but this is a great start.

Now, if I just change a part of the model, I can re-extract the code from it and have the TScript re-written.

Recent Blog Posts
List:01/24/07 - Claude gets a makeover
12/30/06 - Finally, I can beat my game!
12/24/06 - My AI is so frustrating
12/22/06 - Progress on strategy AI...
12/17/06 - Gotta love scripts...
12/12/06 - My brain hurts...
11/29/06 - Raiders of Leeros pre-beta DEMO
11/26/06 - Filtered Movement Maps Done

Submit ResourceSubmit your own resources!

Richard_H   (Dec 17, 2006 at 17:10 GMT)
Sounds awesome! What kind of AI will it be?

Tom Eastman (Eastbeast314)   (Dec 17, 2006 at 17:40 GMT)
That's pretty cool! Sounds like a fun path from design to implementation.

Scott Coursey   (Dec 17, 2006 at 17:47 GMT)
The AI will be turn-based strategy. I already have some group checking (assigning various units depending on distance from each other into groups) and plan on monitoring and remembering the players' actions and preferences.

Everything I have is extremely fast, so there's tons of features I can add. And, I have yet to move away from Torque Script. So far, everything runs with the stock TGB binaries with no problems at all.

Don Hogan   (Dec 17, 2006 at 18:14 GMT)
I love it when there turns out to be nice path between applications - and this sounds really cool!

Scott Coursey   (Dec 17, 2006 at 19:57 GMT)
If anyone would like my script, I'd be more than happy to email it. It only works with OmniGraffle (Mac), so I don't know if anyone else would be interested in it.

So far, the script (written in TCL) is 337 lines, and there's several more features I need to add.

Bob   (Dec 18, 2006 at 06:39 GMT)
Hey Scott, I'd love to check out your script.
My email address is in my profile page.

Allyn "Mr_Bloodworth" Mcelrath   (Dec 18, 2006 at 16:25 GMT)
ya know, i would really like to help you re skin your game =)

Scott Coursey   (Dec 18, 2006 at 16:53 GMT)
@Allyn: Which part are you referring to? Do you mean in-game (units, environment) or out-of-game (GUI elements)? I know my units and environment need some work, but most of the game meets my goals perfectly. The version I have in-house (newer than the previous demo) has some significant changes on the appearance of the in-game GUI elements.

You must be a member and be logged in to either append comments or rate this resource.