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?
 
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.
 
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.
 
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.
 
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
 
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
 
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
 
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.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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