Game Development Community

AI - Idea

by Chris · in Technical Issues · 08/20/2003 (11:03 am) · 2 replies

I have though of a cool way to make a new type of AI system. This system would be unlike anyother and have its own code but I feel it would allow people to make a very smart AI without much knowledge. What I would like to do is create a class in the engine that deals with all AI compiling.
At the loading of a map, if the map has AI of anytype it will boot up multiply functions. AI would be coded like this:
[code]
datablock PlayerData(botSwordsman : LightMaleHumanArmor)
{
Type = "scout";
Name = "Jack";
Filename = "~/AIFiles/scout.ai"; (or cs, but i think it can read this what I plan)
};

From there after all AI datablocks are initialized, the game will init all AI, in order to do this the engine will run lets say, AI::define(filename) and read off the code and define what will/would happen.

code in the .ai file would be something like this:

label start
if scan foward 10 enemy
move foward 10 attack
else if scan foward 10 allie
say "hi"
goto start

It would start something really basic like that, You could use stuff with on collision and have the bot shoot out invisible projectiles that do no damage and use that to tell where it is and which is a good direction to move to.

This is all concept right now and doubt I would be able to do it as it is, but if anyone has some ideas or know of a better way to do something like this please post it!

#1
08/21/2003 (9:14 am)
Interesting idea; though you might want to write a fully fledged language, not a basic-style as drawn up.

If you wanted to make the AI easier for "n00bs" to use, I'd suggest using a hybrid state machine/goal priqueue approach and giving them a nice set of in-game graphical editors. n00bs like graphical editors; the learning curve is a lot shallower than for a programming langauge, especially if you're "just" a level designer.

A side effect of this would be that you could develop a nice graph editor for Torque, which would be useful for many, many projects. ;)
#2
08/21/2003 (5:29 pm)
My suggestion to you is this:

First make the main engine for the game. Then implement some really pathetic AI within the game. Then make sure all this works before you start working on the scripting files.

But you're idea's fine.