Bomberman Posted November 11, 2014 Share Posted November 11, 2014 Was just wondering if anyone could help me out with this. I just need the monster to free roam then when it sees the player, It runs after player. However after loosing sight he just goes back to roaming. Quote Link to comment Share on other sites More sharing options...
Josh Posted November 11, 2014 Share Posted November 11, 2014 Well, you have to decide what "free roaming" means. Where does he go to? Are there any points of interest in the map the monster would want to visit? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Bomberman Posted November 11, 2014 Author Share Posted November 11, 2014 Yes, I would like the monster to visit one specific area more then the other specific areas. However I still would like him to just walk around the map randomly, until the monster feels he needs to go to that specific area. (He might hear a noise and want to check it out) Or he might catch the player off guard and randomly walk into that specific area. Example: Specific location (Time visited) 65% of the time. Randomly wandering: 35% of the time. Quote Link to comment Share on other sites More sharing options...
Josh Posted November 11, 2014 Share Posted November 11, 2014 At this point, you'll need to program that behavior. I recommend copying the monster script into a new one and making your changes in that. It sounds like you have a good idea of how the logic should work. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted November 11, 2014 Share Posted November 11, 2014 Random wandering can be tricky to get right and make it look good/real. You can either place waypoints around your map and have the monster walk to a waypoint in which you randomly picked which waypoint for him to go to. Or you can randomly pick a point above the world and raycast downward until it hits something that is reachable by the monster and then have him walk there. The first method you know will work without issues. The second method has more checks to make sure you are picking places the monster can actually get to and while less setup work (no need to define waypoints (pivots)) could lead to unknown bugs. 1 Quote Link to comment Share on other sites More sharing options...
cassius Posted November 11, 2014 Share Posted November 11, 2014 I just get my onster to follw player when a certain distance away using GetDistance So the player controls when the following starts. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Bomberman Posted November 12, 2014 Author Share Posted November 12, 2014 I just have the problem of adding multiple waypoints for him to patrol around. Always get some error. Quote Link to comment Share on other sites More sharing options...
randomkeyhits Posted November 12, 2014 Share Posted November 12, 2014 I just have the problem of adding multiple waypoints for him to patrol around. Always get some error. What kind of errors? Are the way-points saved as part of the scene or added later? In the latter case I'd expect the only issue would be if the way-point was out of bounds for the nav-mesh. In the former it may be that you are not finding the way-point entities in the scene properly. Quote content over form, game play over all. Link to comment Share on other sites More sharing options...
Bomberman Posted November 16, 2014 Author Share Posted November 16, 2014 Other then waypoints is there a possible way to get him to just wander around in his navmesh If not can you tell me a simple way to get these waypoints working. I couldn't find any tutorial on this. Quote Link to comment Share on other sites More sharing options...
nick.ace Posted November 16, 2014 Share Posted November 16, 2014 I actually have done this in my game. The way I did this was that I parented pivots to the entity that I attached the script to. Then, I renamed those pivots to something like Pivot0, Pivot1, Pivot2, etc. In my code, I got the global position of all of those points, and then I stored their position values in a Lua table. Finally, I iterated through the points (so I would make the character head towards one Pivot0, and then once he came in a certain radius of Pivot0, he goes to Pivot1, and this continues). I would post my code, but it's a rather large and complex file, so I think it would confuse you more than it would help. Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 16, 2014 Share Posted November 16, 2014 If not can you tell me a simple way to get these waypoints working. I couldn't find any tutorial on this. I have not really looked at it but isn't there a video tutorial associated with the AI and Events map that goes over this? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Thirsty Panther Posted November 16, 2014 Share Posted November 16, 2014 I have not really looked at it but isn't there a video tutorial associated with the AI and Events map that goes over this? Here http://www.leadwerks.com/werkspace/topic/9882-ai-pathfinding-and-events/ Quote Link to comment Share on other sites More sharing options...
Bomberman Posted November 16, 2014 Author Share Posted November 16, 2014 What I meant was actually, getting an ai to patrol around multiple waypoints until he sees the player. Not just one waypoint. Quote Link to comment Share on other sites More sharing options...
Bomberman Posted November 16, 2014 Author Share Posted November 16, 2014 For example: Alien Isolations Alien ai. I need something like that. If he hears a noise he checks it out. If he senses someone nearby he'll check it out. If he sees the player he will run like a madman at him and kill him, unless player hides, or the monster gets distracted by another noise. Quote Link to comment Share on other sites More sharing options...
shadmar Posted November 16, 2014 Share Posted November 16, 2014 Maybe this : http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitygotopoint-r700 point would then be patrol waypoints or position of strange sound or just the catering table or toilet depending on what event. 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
gamecreator Posted November 16, 2014 Share Posted November 16, 2014 I'd suggest implementing one of Rick's suggestions using the command shadmar linked. That's what I'd do. Quote Link to comment Share on other sites More sharing options...
Bomberman Posted November 17, 2014 Author Share Posted November 17, 2014 So where exactly would I put this? I'm very new to leadwerks and lua. So sorry if I'm a trouble. Quote Link to comment Share on other sites More sharing options...
nick.ace Posted November 17, 2014 Share Posted November 17, 2014 (edited) So where exactly would I put this? I'm very new to leadwerks and lua. So sorry if I'm a trouble. Lol, your not a trouble! This is what forums are for! Alright, here's a tutorial I created, anyone let me know what other information you want. I can't upload my whole code files because there are a lot of interdependencies that make the files not work in most situations. http://www.leadwerks.com/werkspace/page/tutorials/_/script/waypoints-and-reactionary-ai-r120 Edited November 17, 2014 by nick.ace 1 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.
Note: Your post will require moderator approval before it will be visible.