-Roblox- How would I make an AI path finding bot that only moves on certain objects? - roblox

So currently I am making a game which involves guests like Coaster Tycoon 2...
I already have my AI script finished but I want to implement some more code so it only moves on parts named lets just say "Path". How would I go about doing this???

Hi there I suggest maybe making it so the guests are can collide mode then make it so that the player can't collide with anything other than solid objects. So put invisible walls along the paths and make it so the guest can't walk through them but the player can. Then do it so the guest when he hits a wall turns a different direction. Then script it so the players can walk through them walls.

In the past, I've done this by using the A* pathfinding algorithm. You can modify the algorithm a bit so that the only nodes ever used are ones that fit your need (e.g. "Path" nodes). The ROBLOX Wiki has an A* page with a good implementation of the method.

Related

VR: How to form hands around object they are holding in Unreal?

I'm working on a VR project in Unreal and I'd like my player hands to form to certain objects whenever the user grabs them. (I.e. the way our hands work) Unfortunately, I haven't really found any examples online of others doing this.
For example, I'd like when the user picks up say a hand held tool like a hammer that the hand would wrap around the handle. When the user grabs a basketball the hand shouldn't be closed but, expanded like a you would if you were to palm a basketball in real life.
I haven't done a lot of testing with this but, I'm pretty sure since the hands are based off of a Animation Blueprint that they simply ignore collisions and follow the animation.
I guess the simplest solution would probably be based off of collision where the hand plays an animation and as the fingers of the hand wrap around the object they stop at that position where they collide with the object in question. If it is even possible that is.

Unity local avoidance in user created world

I'm using Unity3D for a networked multiplayer online game where I have a very large complex 3D terrain scene like a forest, with trees, cliff, hills, mountains, bounders, etc.
Players can also build structures sort of like minecraft, and put them anywhere in the scene, or even move them around anytime.
Aside from the human controlled players, there are automated AI players and objects like animals roaming around the scene following a path.
The problem is how to make these automated AI players and animals, able to navigate around the static and dynamic player created structures, because the path they follow can easily get blocked by player created structures, or even by other players and other AI objects, cliffs etc. So they have to find away around them or get themselves back on track if they tumble down off a high cliff for example.
So I made a navMesh and used NavAgents, but that just takes care of the static, non moving objects, but how do I make the AI players navigate around each other and also the dynamic structures created by the players which can number in the hundreds?
I thought of adding a NavMeshObstacle to everything, but this would result in it being attached to hundreds of objects since the user created structures are built using little pieces like blocks or little tiles to create a larger object.
Here are my questions:
Would attaching a NavMeshObstacle to hundreds of little objects slow down the game?
Is there another way to navigate of dynamic objects other than using NavMeshObstable without slowing down the networked game?
Thanks
Based on the documentation for NavMeshObstacle, one could reasonably assume that if carving (an obstacle "carving" a piece out of the nav mesh) is disabled, obstacles will only affect agent performance when they are in the agent's way. They won't affect pathfinding. The agent will just go around them when it's close. Note that this will not work for you if there are so many dynamic obstacles that the agents need a very different path. You can also set them to re-carve a piece out of the nav mesh only when they've moved a certain amount. You should test the performance, but that sounds like it might work well for you.
http://docs.unity3d.com/ScriptReference/NavMeshObstacle.html
If you don't want to spend much time on making your own "sensor and navigation" system extending unity's navigation then I think your way is through NavMeshObstacles. If you build your obstacles with blocks like minecraft to avoid add NavMeshObstacle on each block you have a huge range of choices on how to limit/approach on your building system.
There is also good AI systems free as RAIN, for example, that implements some extensible and consistent way to do what you want, take a look on unity market if anything there fits your needs.

Path finding on a 2d plataformer game. Making enemies jump

I am working 2D Platform running game and I am stuck at this issue, i cant figure it out how to make my enemies jump through platforms as they follow the player. I used A* path finding with a Grid graph for my flying enemy and it works just fine. But with the ground troops i don't know what to do. Any recommendations where to start and what to study? Thanks in advance
Place a Trigger (Collider) attached with the Platform at the point where you want your enemy to Act (Jump in your case). and Attach a script to your Enemy to Handle its actions whenever it enters that trigger. you can make it Jump/Fly or whatever you want to. Thumb up if its helpful :)

Unity: Third Person Collision with Animated Platforms

first time posting on stack and everything looks promising so far! I had a bit of a complicated question here so I'll do my best to provide exact details of what I'd like to get accomplished. I'm working with a third person controller in unity, so far everything is going great. I've dabbled with basic up and down platforms, a little glitchy but things work. Anytime my player runs through a mesh I make sure the mesh collider is working and a 'rigid-body' is attached set to Kinematic. Here's the kicker, in my game I have turning gears which the player can jump on. This is great except for the player doesn't turn with my gear, which would make sense according to my game-play. What would be the process for getting my character to interact with this animated mesh? I imagine some sort of script which my nooby mind cannot fathom at this point in my unity career. If anyone out there knows the solution to this, I would love to have any assistance, either way I'll plugging away at a solution. Thanks again!!
This is assuming that you're using the packages that ship with Unity3D, which it sounds like you are. After importing the Character Controllers package, you'll have a bunch of scripts in the Standard Assets\Character Controllers\Sources\Scripts folder, in the project hierarchy view. There's a script in there called CharacterMotor.js, attach that to the same GameObject you're running ThirdPersonController on.
Essentially this script adds more interactivity between the character and the scene. There's several methods inside this script that automatically move the character when in contact with a moving object (as long as it has a collision mesh) basically by inheriting the object's velocity.
If your gear/cog wheel has a proper collision mesh set up, adding this script to your character should be all that you require.

Can A* Pathing in AndEngine allow a sprite to determine "incorrect" paths and make "random" choices?

I am currently developing a Tower Defense game for the Android platform using the AndEngine. My enemies (animated sprite extended class) have hard coded pathing. I'd like to switch to something better where the enemies can determine for themselves where to go. I am using TMX maps. Please refer to the following map:
The 2 hexagonal tiles are spawn locations for the enemies. I have 2 questions abou A* Pathing.
At point A is it possible to make sure the enemy doesn't turn down the path towards the other spawn location?
From what I've been told A* Pathing looks for shortest distance, so is there a way to have the enemy randomly select which way to go at point B?
If A* Pathing is sufficient for these test cases, can you supply me a link to a tutorial/example? I haven't found much help through Google.
If A* Pathing can't do this, what are my other options?
In order to use A*, you need to know where the enemy is trying to get to. If you randomize the target locations of the enemies between the two exit points at the right, they should work correctly.