Johxz Posted April 5, 2015 Share Posted April 5, 2015 Hi! I want to start with AI on Torque3D, how can I start? yesterday I play a little with t3d 3.7rc walkabout but I see is not for AI. So, with what resource/addons/products can I start? I only know guidebot but is outdated... BTW someone kind to share an AI guide/tutorial? focusing on torque3d and in general, I'm new on this.thank you!regards,John Quote Link to comment Share on other sites More sharing options...
J0linar Posted April 5, 2015 Share Posted April 5, 2015 There are a couple of things,However the most suitable one would be BadBehavior by GuyAllardhttp://www.garagegames.com/community/resources/view/22947https://github.com/BadBehavior/BadBehavior_T3DI quote:The system is currently based on T3D 3.6.2, I will be porting to T3D 3.7 when it is released. The scripts are only included with the FULL template as I got tired trying to keep both FULL and EMPTY updated.I have released it under the MIT license, so you are free to use and abuse it in any way you like. bd3NeocArRQ Quote Link to comment Share on other sites More sharing options...
Steve_Yorkshire Posted April 6, 2015 Share Posted April 6, 2015 If you log into GG and then TDN (through the documentation page, TDN section) there's some old but still useful basic information on using AI. http://tdn.garagegames.com/wiki/Torque/Script/Tutorials/Using_Basic_AI_CommandsThere's also a load of old tutorials and game examples (by yours truly) in the GG resources section.Simple SInglePlayer FPS http://www.garagegames.com/community/resources/view/208293rd Person Tactics-Action http://www.garagegames.com/community/resources/view/20995Singleplayer Deathmatch using Chinatown http://www.garagegames.com/community/resources/view/21604These are all from previous versions of T3D so some of the $typemasks may need updating and stuff like Recast is already in the engine. Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted April 6, 2015 Share Posted April 6, 2015 @Steve_Yorkshire or you could use the actual wiki instead of TDN :P http://wiki.torque3d.org/scripter:how-do-i-get-started-with-aiEdit: Which, btw, has been updated so it's valid for newest version of T3D. Quote Link to comment Share on other sites More sharing options...
Steve_Yorkshire Posted April 7, 2015 Share Posted April 7, 2015 @LukasPJ Hurray for the wiki! :mrgreen: :P Quote Link to comment Share on other sites More sharing options...
rlranft Posted April 7, 2015 Share Posted April 7, 2015 https://github.com/RichardRanft/AITutorialScript-only (one optimization I want to make in source, but I didn't) and works pretty well with the RTS Prototype (which needs updating because of a few broken spots). And I've almost got this dusted off so it only uses MIT resources (or you can just replace boombot with soldier and orc hovel with station). Quote Link to comment Share on other sites More sharing options...
buckmaster Posted April 7, 2015 Share Posted April 7, 2015 UAISK is also a popular AI product which should be mentioned for completeness' sake. But I'd see if BadBehaviour fits your needs before going to that, if you're into tinkering and making stuff from scratch (AFAICT UAISK's strength is its library of pre-made behaviours). Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 7, 2015 Author Share Posted April 7, 2015 thanks you guys! I will check it in a few days I almost finish learning to create my own particles and attach to objects ;)Reading a bit this seems good https://github.com/logicking/GuideBot outdated (t3d 1.2) I know but nevertheless open source. Is a waste of time if I update it?thanks daniel I will check BadBehaviour a little more, the last time give me a few errors. Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 11, 2015 Author Share Posted April 11, 2015 @Steve_Yorkshire or you could use the actual wiki instead of TDN :P http://wiki.torque3d.org/scripter:how-do-i-get-started-with-aiEdit: Which, btw, has been updated so it's valid for newest version of T3D. Ok, I'm reading this, but this part of the tutorial don't work for me:You should see Bob automatically turn to follow Dirk's movements (even up and down hills).Time to shoot at Dirk!Bob.setImageTrigger(0,1);This command tells the weapon/image in slot 0 that it is being "triggered" (same as when you push the mouse button). This causes the Lurker to start rapid firing.Only shoot once, if I want to do rapid fired, how can I do it? Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 12, 2015 Author Share Posted April 12, 2015 Some other weird thing, when I use this "setMoveDestination" Bob.setMoveDestination(LocalClientConnection.camera.getTransform()); // This work fine Bob.setMoveDestination(Dirk); //This not... "bob" go to the edge corner of the terrain.If I echo the dirk position and passed to bob, like this: bob.setMoveDestination(123 123 123);bob go to the position.This was a test on t3d 3.7rc. If I do this tutorial on t3d 3.6.3 works fine (rapid fire not just once) even has sound when you load ammo or shoot. With 3.7rc don't have this sound.Maybe is a update going on related to this? Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted April 12, 2015 Share Posted April 12, 2015 Some other weird thing, when I use this "setMoveDestination" Bob.setMoveDestination(LocalClientConnection.camera.getTransform()); // This work fine Bob.setMoveDestination(Dirk); //This not... "bob" go to the edge corner of the terrain.If I echo the dirk position and passed to bob, like this: bob.setMoveDestination(123 123 123);bob go to the position.This was a test on t3d 3.7rc. If I do this tutorial on t3d 3.6.3 works fine (rapid fire not just once) even has sound when you load ammo or shoot. With 3.7rc don't have this sound.Maybe is a update going on related to this?The issue here is that:Bob.setMoveDestination(Dirk);Tells Bob to move to coordinate "Dirk" which will probably be parsed as: "Dirk 0 0" which is wrong. You have to use:Bob.setMoveDestination(Dirk.getTransform());--I don't know what's going on with the trigger image. Are you sure you gave him enough ammo? Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 12, 2015 Author Share Posted April 12, 2015 Thanks Lukas, Ok I do a more controlled test.hahaha this is funny when I set MoveDestination(NAME) go to a random point in 3.7 to a corner of the terrain (very far) but in 3.6.3 go to a random point more centric and casually my other bot was there, so when setMoveDestination always reach my other bot Dirk :lol: To summarize 3.7rc don't have the sound and the rapid fire don't work, only shoot once. // 3.7rc Bob.setMoveDestination(Dirk); // don't work Bob.setMoveDestination(Dirk.getPosition()); // fine Bob.setMoveDestination(Dirk.getTransform()); // fine Bob.mountImage(LurkerWeaponImage, 0); // Ok (No sound) Bob.incInventory(LurkerAmmo, 50); // give him 30 ammo it's ok. (No sound) Bob.setImageTrigger(0,1); // shoot once (if I shoot four time and then give him ammo fill four bullet). (No sound) // 3.6.3 Bob.setMoveDestination(Dirk); // don't work Bob.setMoveDestination(Dirk.getPosition()); // fine Bob.setMoveDestination(Dirk.getTransform()); // fine Bob.mountImage(LurkerWeaponImage, 0); // Ok (With sound) Bob.incInventory(LurkerAmmo, 50); // give him 30 ammo it's ok. (With sound) Bob.setImageTrigger(0,1); // fine - Rapid fire (With sound) Bob.setImageTrigger(0,0); // fine - Stop fire Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 13, 2015 Author Share Posted April 13, 2015 Hi,I'm doing this tutorial https://www.garagegames.com/community/resources/view/21604I already do the second part, but I have a doubt, this: Now we need a "navPath" to use "theNavMesh" and for or Ai to run down. Again this is under (library -> level -> navigation) and you want to call this object "navPath1". In it's "mesh" field enter "theNavMesh" so it's linked to our navMesh.the navPath that refer the tutorial is this, right? BTW, I don't see a error in the console, but the Bot1 go to the corner far in the terrain, see my reply above. :o What this mean? I copy and paste the script from Steve. :? Quote Link to comment Share on other sites More sharing options...
buckmaster Posted April 13, 2015 Share Posted April 13, 2015 Bob.setMoveDestination(Dirk);Should beBob.setMoveDestination(Dirk.getPosition());I think. EDIT: oops, didn't see page 2.But that other stuff sounds worrying. This is the first thing that comes to mind. Will investigate.As for the Chinatown deathmatch code, it uses an old version of the Recast/navPath code. The new version works differently, so you'll have to modify his code. The old code looked something like this:for(%i = 0; %i < %path.getCount(); %i++) { %obj = %path.getObject(%i); %pos = %obj.getPosition(); }You now use:for(%i = 0; %i < %path.size(); %i++) { %pos = %path.getNode(%i); } Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 14, 2015 Author Share Posted April 14, 2015 Thanks Daniel @buckmaster I will go check it out... btw I want to clarify I'm using 3.7rc with a blank level, a terrain and a couple of convex boxes for doing the tutorial from steve. Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 19, 2015 Author Share Posted April 19, 2015 Thanks for help, I have some progress in ai with torque 3dCan I use AIPlayer with walkabout? I want my bot evade the objects. How can do that?Thanks Quote Link to comment Share on other sites More sharing options...
buckmaster Posted April 19, 2015 Share Posted April 19, 2015 Of course you can! What are you trying to do? Have you opened up the nav editor and had a play with it yet? I just threw this wiki page together with the Walkabout documentation. Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 19, 2015 Author Share Posted April 19, 2015 Hi Daniel, I saw the tutorial videos from walkabout a few weeks back, but don't know how to mix AIPlayer with walkabout...I will go to read the documentation, thanks I miss this link "WalkaboutDocumentation.html". What are you trying to do? Become familiar with AI on T3D. If you have some relevant info about this I really appreciate it.Right now I want my "Bob.Bot" go from A to B without collide with walls. :) Quote Link to comment Share on other sites More sharing options...
buckmaster Posted April 20, 2015 Share Posted April 20, 2015 You didn't see the documentation before because it wasn't online anywhere ;). This section shows you how to use the script interface, so it's probably where you should be looking. Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 22, 2015 Author Share Posted April 22, 2015 Thanks that was looking for... I have another question sorry. I already read thishttps://eightyeight.github.io/walkabout/Documentation/WalkaboutUserManual.html#scripting-navpathFrom the Steve tutorialNow we need a "navPath" to use "theNavMesh" and for or Ai to run down. Again this is under (library -> level -> navigation) and you want to call this object "navPath1". In it's "mesh" field enter "theNavMesh" so it's linked to our navMesh. But in navigation folder only have Cover Point. How I can create a NavPath? :? the question is: walkabout have a object "graphically" for add a path? like cover point? :?: :?: :?: :?: Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 24, 2015 Author Share Posted April 24, 2015 @buckmaster sorry to ask again :roll: navPath object don't exist on 3.7rc, I already have an AI Player going to a waypoint to another using specific position, but how can I use navPath?how can I use it? I trying using script but don't work for me.I use this example %path = new NavPath() { mesh = "Nav"; from = "0 1 0"; to = "0 10 0"; }; // Path now goes from (0, 1, 0) to (0, 10, 0) // Change the destination! %path.to = "10 0 0"; // And replan %path.plan(); Quote Link to comment Share on other sites More sharing options...
buckmaster Posted April 24, 2015 Share Posted April 24, 2015 Oh dear. That should work. Sorry for not getting back to you about the editor. I think at some point I removed the nav-specific object classes from the editor, though it appears cover point is back. Though I should probably stick navpath back as well.That script breaking is concerning. Any errors in the console at all? Quote Link to comment Share on other sites More sharing options...
Johxz Posted April 24, 2015 Author Share Posted April 24, 2015 Sorry for not getting back to you about the editor. Don't worry mate... Well sorry I was a little confused because some tutorials around walkabout always says add from gui. No error on the console. I will do more test with navPath, maybe it's me, not using it the way it should.by the way, I already have a bot running around walls from a waypoint to other :lol: so thank you for all the help. (setPathDestination)EDIT:I'm doing all wrong? I do this... ==>new NavPath(myPath) { mesh = "MissionGroup\theNavMesh"; from = "94.79 156.83 512.75"; to = "119.9 115.4 512.9"; }; 5724==>myPath.from 94.79 156.83 512.75==>myPath.to 119.9 115.4 512.9==>myPath.plan(); 0 ==>new AIPlayer(Bob) { datablock = "DefaultPlayerData"; position = LocalClientConnection.camera.getPosition(); }; 5725 Here nothing...==>Bob.followNavPath("myPath"); ==>5725.followNavPath("myPath"); ==>Bob.followNavPath(myPath); ==>5725.followNavPath(myPath); ==>myPath.size(); 0 ==>myPath.getNode(0); 0 0 0 ==>myPath.getNode(1); 0 0 0 ==>myPath.getLength(); 0 Quote Link to comment Share on other sites More sharing options...
buckmaster Posted April 25, 2015 Share Posted April 25, 2015 plan() returning 0 means it failed for some reason - could be anything. Damn, I thought there should be some console logs when that happened. I might see if I can add some helpful error messages for you to retrieve if a plan fails. You're using it right, though! Quote Link to comment Share on other sites More sharing options...
Duion Posted August 14, 2016 Share Posted August 14, 2016 I just noticed that there exist no multiplayer AI tutorials and I also have never seen anyone having multiplayer bots working. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.