Game Development Community

Hand Placing AI?

by Djekko Spurgin · in Torque 3D Beginner · 05/08/2016 (1:41 am) · 5 replies

For my game I'm implementing some AI. I have already got it all working with spawners where the enemies spawn, chase and attack the player.

BUT!

I want to know if i can hand place AI around my level in the editor and instead of spawning the AI when entering a trigger, Start attacking the player straight away. I feel like its something simple I'm missing, I cant find anything useful at the moment.

Any Suggestions?

#1
05/08/2016 (7:35 am)
You could spawn the bot upon start of the mission, instead of spawning the bot with a trigger.

You should also be able to copy such spawnpoints and change the databloc to another kind if you need other enemy types.

Around/below this:

Quote:Now, let's see if it works in-game. Boot up Torque3D and load up your Tutorial level. Go into camera mode (CTRL C) and find the second rock along our path (left, and then at the first right corner). Open up the World Editor (F11) and place a new spawnSphere just to the left of the rock.

In this:
http://www.garagegames.com/community/resources/view/20839

You can read about how to place spawn spheres. Sadly all the pictures are now gone. Nonetheless it is a fine tutorial.


#2
05/08/2016 (8:12 am)
I thought about having separate spawns for each of the AI but I was trying to avoid that if possible. I just wanted to be able to place some AI in editor mode and then if I save, exit and start up again the AI will stil be there. I just think that spawning all the AI all at once when the level starts might make the game abit laggy
#3
05/08/2016 (8:51 am)
Actually the spawning as the level starts is less laggy than letting triggers do the job. You see when the triggers spawn the AI upon entering the trigger you will see some lag as it happens.

I have had the best results with spawning AI bots as the level starts. Of course it all depends on how many bots we are talking about here. 10? 20? 100+?

If the amount of bots are huge then triggers would be best. However no matter what you place your spawnsphere where you want the bot to spawn and then you decide whether it should spawn when a trigger is hit or on level start.

On a personal level I used markers from the UAISK instead of spawnsphere, but the idea is the same in the long run :O)

Read the resources from Steve I linked to(all 12 parts). Those are gold.
#4
05/08/2016 (11:34 am)
You could write a function that picks random points in your mission bounds, does a ray cast to find the terrain, then spawns a unit at that spot + 2m (just to keep them from falling into the depths of neverland). But unless you're talking about a lot of units, or your mission area contains areas where a unit would be trapped if spawned in randomly, it is better to place spawn spheres.
#5
05/09/2016 (12:51 am)
Thanks I might Implement a bit of both methods in to the level I think we are talking about around 50 AI but there are some bigger areas I might hide some spawn points as to have waves of enemies. But on loading the level Spawn some clusters of enemies (around 2 or 3) around the map. I don't think it will be too laggy from what I've found and what you guys are saying. Ill let you know if I hit any problems. Thanks for the help