playMaker

Author Topic: Tank AI  (Read 2862 times)

musolo

  • Playmaker Newbie
  • *
  • Posts: 8
Tank AI
« on: February 28, 2017, 10:07:04 PM »
Hi guys! Can anybody show how to make tank ai with two axis rotating turret and barrel. So it could be possible to make opposing tank teams. Like the ones in strategy games withought advansed phisics. There isn`t a single tutorial about this :'(
Thanks.

mrminico

  • Full Member
  • ***
  • Posts: 129
Re: Tank AI
« Reply #1 on: March 02, 2017, 07:21:25 PM »
The way I'd go about making the AI would be by giving the rotating turret and barrel separate FSM's that rotate/detect players via trigger. If you could elaborate a bit more with what you want I'll see what I can do to help even more.

musolo

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Tank AI
« Reply #2 on: March 02, 2017, 07:39:20 PM »
Guess its not that big of a difference if it`s  atank or anty air vehicle or fighting infantry vehicle. Armored vehicle unit that can patrol areas,  has vision cone, can discriminate other game objects via their tags. Has attack mode, defend  mode patrol mode.
Something like that.

mrminico

  • Full Member
  • ***
  • Posts: 129
Re: Tank AI
« Reply #3 on: March 02, 2017, 11:21:50 PM »
Ok, here's what you may want to do. First off a good rule of thumb is to make different FSM pertaining to the functionality you want in your game. You should organize and name all your FSM's according to its functionality. It'll make it easier for you to manage and send events. For instance, you wouldn't want to have detection functionality in a FSM that's design to switch between attack and defense mode. (You could still do that if you please but it really is easier if you separate FSM's for the sake of management and sending events.) You wanna try and keep it all separate. example:



By having separate FSM's doing their functions you can easily make global events so each FSM's can send and receive events from each other. Example: in the player detector FSM, if the player enters the tank's trigger collider, The player detector will then fire off the attack mode transition which will enter the attack player state. The state will then send the global event of attack mode to the Attack Patrol Defense mode FSM. Global events are one of my favorite things in playmaker, you can literally connect ANYTHING with it. I suggest you take advantage and use them when needed, especially if you're going to be making complex functionality. This is the advice I can give as for a tutorial I wish I could make a vid for you but that's beyond me at the moment. I hope my advice can shed some light If there's any other questions you have I'll see how I can help. 

musolo

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Tank AI
« Reply #4 on: March 03, 2017, 07:24:27 PM »
Thanks a lot for the advice! I`ll try to use it the best way i can. For the turret and gun will i have to use external tools? or there are some integrations allready made to implement this functionality? I remember while ago one had to buy some extra stuff that did turrets and use it with playmaker. Wonder if things are still the same?

Cheers!

mrminico

  • Full Member
  • ***
  • Posts: 129
Re: Tank AI
« Reply #5 on: March 03, 2017, 09:08:59 PM »
You dont have to buy anything everything can be done in playmaker. Now if you dont want to do it in playmaker and buy assets that does the firing for you thats a different story, but literally everything you want can be done in playmaker.
« Last Edit: March 03, 2017, 09:26:27 PM by mrminico »