Jump to content

Recommended Posts

Posted

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.

Posted

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?

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

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.

Posted

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.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

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.

  • Upvote 1
Posted

I just get my onster to follw player when a certain distance away using GetDistance So the player controls when the following starts.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Posted

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.

content over form, game play over all.

Posted

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.

Posted

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.

Posted

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?

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Posted

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.

 

Posted (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 by nick.ace
  • Upvote 1

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...