|
| 04 Nov 2016 01:03 PM |
How would I make Articifial Intelligence like the game Hello Neighbor on Steam? In case you havent heard of the game here are some things the antagonist [Neighbor] will do differently:
• He is capable of cutting you off, like if you were to try to leave, he could make his way to the exit and stop you in your tracks instead of only chasing you all day like regular horror AI. • He can track where you spend your time and try to hide his secrets by propping chairs on doors and placing traps on the floor. • He can hang around the house like normal and open/close doors. • He checks doors nearby for you when you hide or are hidden after being chased. • He can break windows and doors if you appear to be on the other side. • He can lock you inside rooms and come at you from another side. • He can trigger or use objects against you.
I was wondering how I might be able to do some of these, and pathfinding clearly is not an option most likely because it may not be able to ignore doors or windows |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 01:07 PM |
| Yes, pathfinding would be used. |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 01:12 PM |
No it would not It would be nearly impossible for him to render a path in the house correctly and the doors and windows would definately create problems with the path finding as well as furniture |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 01:14 PM |
[[No it would not It would be nearly impossible for him to render a path in the house correctly and the doors and windows would definately create problems with the path finding as well as furniture]]
that's what nodes are for.. and if you under stand pathfinding you can easily toggle a node which would remove/add that path as a choice... nodes would ideally not have furniture in their path.... |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 01:18 PM |
| So what, are you suggesting a navigation mesh and also custom ai that I cant understand how to script? |
|
|
| Report Abuse |
|
|
awiton
|
  |
| Joined: 27 Apr 2012 |
| Total Posts: 2656 |
|
|
| 04 Nov 2016 01:24 PM |
• He is capable of cutting you off, like if you were to try to leave, he could make his way to the exit and stop you in your tracks instead of only chasing you all day like regular horror AI. ============= If (player.head.Position - door.position).magnitude < 10 then script.Parent.*i think .Humanoid*MoveTo(door.Position) Something like that. ============= • He can track where you spend your time and try to hide his secrets by propping chairs on doors and placing traps on the floor. ============= local pp = player.head.position wait(3) if pp = pp then HeSpendsTimeAtThatPositionOften.Value = pp MoveTo(pp)
*Ai moves to the area where u were for 3 seconds. if script.Parent.Position = pp PlantBomb() ^add a definition of "PlantBomb()" function =============
• He can hang around the house like normal and open/close doors. ============= while true do#######orry got tired cant do anymore* ============= • He checks doors nearby for you when you hide or are hidden after being chased. • He can break windows and doors if you appear to be on the other side. • He can lock you inside rooms and come at you from another side. • He can trigger or use objects against you. |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 01:26 PM |
| well none of those would work as effectively as the AI in the game Hello Neighbor sadly because I was trying to make a similar AI before i found that game |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 01:27 PM |
Path finding wouldn't really be used in close proximity. I imagine you'd track what room the person was in as opposed to making something follow. Considering this, you've got 5 types of rooms:
- Living room - Exit - Hallways - Bedroom - Bathroom
The so called "AI" has different modes. If you are in a hallway it is in roaming mode (as in it randomly selects a point on the map for the NPC to spawn and finds a way to you). Also, the NPC would just interact with the map and do things as you said. It would select a door to place a chair on, etc.
The exit room is split into two different parts. If you go into the first part of the exit room it triggers the event and so the NPC appears to be following you and stopping you. In actuality, the NPC was teleported from wherever it was to just a few studs behind you. You will need to figure out a way to make it seem realistic but it shouldn't be too hard.
Essentially, the same happens for every kind of behavior you want. I would recommend you write down a list of exactly what you want to happen when you're in each part of the house. As for the actual tracking I can think of two ways off the bat. You could have boxes / hitboxes inside each room that you record as a CFrame. The script only needs to list the player torso CFrame and check it relative to the room locations. Also you could make it so you have to left click / be teleported to swap between rooms which makes it easy because whichever door you click last is the room you're in kind of thing.
If I didn't explain this well please tell me and I'll try to explain it better. |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 02:28 PM |
well his house is planned to have over 15 rooms and a basement with 2 floors in my game:
- LEVEL -2 - •room01 •room02 •mainroom •hallway/stairs •room03 •room04 •hidden_r01
- LEVEL -1 - •room05 •bodies •bathroom01 •laundry •boiler_room •coffins •tools •hidden_r02 •hidden_r03
- LEVEL 1 (ground level) - •fencing_outside •living_room •shed •grave •kitchen •bathroom02 •bathroom03 •freezer •main_spawn
- LEVEL 2 - •bb_gun_range •hidden_r03 •bathroom04 •bedroom01 •bedroom02 •storage •room06 •room07
- LEVEL 3 - •conspiracy_room •photos_r_int •photos_r_balcony •farm_room •chemistry_room •more_bodies
- LEVEL 4 - •attic •hidden_room_fnb
layout^
|
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 04:58 PM |
| The concept you would use is the same. Different rooms make the AI behave in different patterns. Some start certain events such as the NPC appearing and stopping the player from leaving. Others allow chairs, etc to be randomly placed around the house when the player isn't watching. |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 04:59 PM |
| ############################################################################################### |
|
|
| Report Abuse |
|
|
|
| 04 Nov 2016 05:00 PM |
Just putting this in my Forums so I can play this when it's done...
Done with roblox censorship
|
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 02:07 PM |
Well ok I will try to implement whatever you guys suggested into actual code. At the moment I am still finishing the floor plans on paper so I know what to build and to conserve space |
|
|
| Report Abuse |
|
|
cars37
|
  |
| Joined: 27 Nov 2013 |
| Total Posts: 189 |
|
|
| 05 Nov 2016 02:32 PM |
| The best AI is another player |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 02:33 PM |
| Incorrect Won't be as scary and not everyone will be good at playing it or be as ##### ## the AI |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 02:46 PM |
I for one am all for AI. As I'm typing this, I'm making AI for one of my own games. What you want isn't hard to make once you think about it.
To cut somebody off, do some simple math on the player's position and move the NPC there.
To track where you spend time, I would just put a bunch of invisible parts on the map in certain locations, and use a while loop that basically makes the parts time go up. The NPC can then find the greatest time and go to the corresponding part.
To hang around the house like normal is pretty easy. I don't even think I need to describe, just make him walk around.
To check nearby doors is also easy. math.random() will be your friend.
Use magnitude to figure if they are on the other side. It's up to you to make him break them, but that won't be hard at all either.
He can lock you inside rooms is another easy part.
Making him use weapons is also easy. Just keep track of the player's position and well, fire. |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 02:48 PM |
What you are saying is incorrect though because here is a lot of issues:
The AI might go around windows instead of getting close to them and also if you are inside you can be the same distance outside Also raycasting would be needed to check for windows nearby most likely But the issue here is that roblox pathfinding is crap, and the math is not simple. |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 02:55 PM |
You make good points, but the math is simple:
local torso = player.Torso.Position local rightinfront = torso + Vector3.new(10, torso.Y, torso.Z) --This probably won't make him go in FRONT of them but you get the point. |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 02:57 PM |
Still wrong If you ever have seen any of the videos from the game itself, he can go around rooms instead of following you into them which is what yours would do regardless if i had used path finding |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 02:58 PM |
Here is a great example:
goo.gl/A3hQ19
|
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 05 Nov 2016 03:07 PM |
• He is capable of cutting you off, like if you were to try to leave, he could make his way to the exit and stop you in your tracks instead of only chasing you all day like regular horror AI. if (player.Head.Position-door.Position).magnitude<20 then --make the AI walk downstairs and have him walk to the midpoint between the player and the door. end • He can track where you spend your time and try to hide his secrets by propping chairs on doors and placing traps on the floor. --Use region3. And wait every few seconds and if the player is still there, add the amount of time to a value • He can hang around the house like normal and open/close doors. --easy • He checks doors nearby for you when you hide or are hidden after being chased. if not chasingHumanoid then for i,v in pairs(tableOfDoors)do checkDoor() -- you might want to randomize the table of doors or check ones based on the distance end • He can break windows and doors if you appear to be on the other side. if [[However you define 'appear']] then breakDoor(); chaseSubject(); end • He can lock you inside rooms and come at you from another side. closeDoor(); door.Anchored = false -- maybe become true if you have a key? O.o --Determine (based on layout) how to walk to the room. • He can trigger or use objects against you. idk |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 03:08 PM |
| Still no one but one person has provided any good ways to tackle this because the rest of you are using poor or awful scripting to accomplish something like this which is definitely incorrect for how the game is in retrospect |
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 05 Nov 2016 03:09 PM |
"poor or awful scripting"
Well dang
Just insult the people trying to help.
That always works |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 03:09 PM |
| Why don't you go figure it out on your own then? We're just trying to help. How do you know they don't work if you don't try? |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2016 03:11 PM |
Because none of you but 1 or 2 people are helping. These scripts are really poorly done and especially the ones for cutting you off because as you see in the gif it requires a lot more than that short gimmick. And because if you don't have any proper assistance besides spitting out crude scripts then you do not need to try. |
|
|
| Report Abuse |
|
|