How would I make an AI player for a TD?

LurkerAspect

Now officially a Super Lurker
Reaction score
118
Hi there :D the title pretty much covers my question. I want to make an AI controlled player for a TD, and I'm looking for advice on tower placement. So far, I've created regions around all the areas where I want the AI to build towers, now I want to know how I can get them to build according to the grid. Along those same lines, is it possible with triggers to make all tiles with (eg) grass trim terrain count as one region? So then I could just say "pick random point in region(all grass-trim terrain)" to save on tedious rect placement?

Any suggestions/tips/tutorials/guidelines?
 

Inflicted

Currently inactive
Reaction score
63
Set the AI builder to a variable and make it build stuff?

I dont see what the problem is?

If the building idea is to advanced, i suppose you could just "create" the buildings and make the builder walk near the point etc etc.
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
If I didn't know how to make the computer build a structure I wouldn't be on this forum. Please read the post correctly, I asked how to make an AI player build according to the grid, as in use space effectivley. Tower placement involves where and when to place what tower, which is the second thing I want to know.
 

Tamisrah

Active Member
Reaction score
16
Try some geometry?
p = Position of tower A
offset = Size of one Tower
(p.x+offset,p.y)
(p.x-offset,p.y)
(p.x,p.y+offset)
(p.x,p.y-offset)
and you have all for spots to build tower B

Then check whether the terrain is buildable and check for distance to the creep path to decide whether you can build your tower there.
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
making robots think is the leading problem of robotics today, even with systems that are not as limited as wc3 engine.... I don't know jack about making AI, but i can tell you that making one for a 'smart' space usage and "labyrinth" type building will be...well next to impossible
 

vonDarkmoor

New Member
Reaction score
9
I would suggest setting up several regions along the path the creeps will be running then make a unit_group_array, then periodically through out the game create 1 unit type of random unit from unit_group_array[current level] at random spot in region_array[Random integer between 1 and (however many regions you have)] each unit_group_array would be made at map init, and would consist of a couple different towers that are compatible with the level you want them played at.

you could also alter it by doing a Unit_Group_array_easy/medium/hard and put better towers in the hard version, this way a player could decide how good the comp will do
 

Tamisrah

Active Member
Reaction score
16
Different idea:
Preplace a maze in the editor
remove it on mapinit while storing the posititions of the towers
in game refill the positions with towers build by the ai player

or you could pregenerate multiple layouts and chose a random one on game start
 

vonDarkmoor

New Member
Reaction score
9
Different idea:
Preplace a maze in the editor
remove it on mapinit while storing the posititions of the towers
in game refill the positions with towers build by the ai player

or you could pregenerate multiple layouts and chose a random one on game start

very nice idea, im gonna remember that one!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top