The Correct Way to Chase the Player | Pathfinding - RPG Maker MZ Horror Tutorial (Intermediate)

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.ย. 2024

ความคิดเห็น • 125

  • @furryfr0g
    @furryfr0g 10 หลายเดือนก่อน +5

    I actually really enjoy when creators leave in the "errors". It helps my learning process a tremendous amount by seeing what NOT to do and encourages me to pay attention and understand the WHY and the HOW instead of just copy/pasting everything. Keep up the great work. :) -Davey

  • @Zer0Morph
    @Zer0Morph ปีที่แล้ว +7

    This is hands down the best RPGMaker tutorial I have ever seen, and the most helpful!! I was stuck forever on pathfinding and this easy solution works brilliantly!! Your way of explaining things, your sound quality, etc... is top notch, and you're pleasant to listen too as well as having a wonderful personality. I really hope Caster's Trap is successful. God bless you friend!

    • @TheOdie
      @TheOdie  ปีที่แล้ว

      You are so kind! Thank you so much!

  • @StevenIIX
    @StevenIIX 7 หลายเดือนก่อน +1

    This is great! Thank you very much! I was having trouble with Pathfinding plugins because of incompabilities, but I didn't know there was such a simple solution without the need of any plugin. You saved my day :)

  • @richardcesber
    @richardcesber 3 ปีที่แล้ว +6

    Oooooohhh... Boy, this is going to be Fun :3 Killer persuit 😍

  • @banyalaplace
    @banyalaplace 2 ปีที่แล้ว +4

    This is a life saver, I can't thank you enough!!!

  • @alitatripp9822
    @alitatripp9822 ปีที่แล้ว +3

    Love your videos. I'm more into making dungeon crawlers, but you have some excellent advice for boss chases! keep making videos, they're beneficial!

  • @drageonmusic6421
    @drageonmusic6421 3 ปีที่แล้ว +4

    thanks for this man, just getting started with MZ but you just made what i thought would be super difficult really approachable. definetly getting a sub and video binge from me !

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว +1

      Nice! And welcome!

  • @zweg9400
    @zweg9400 3 ปีที่แล้ว +6

    I love your tutorial videos, really helped me a lot.

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว

      Awesome! Let me know if there's anything you're interested in learning 😀

    • @zweg9400
      @zweg9400 3 ปีที่แล้ว

      @@TheOdie Well for now i'm still planning all mechanics/story for my project so I don't know what problems i'll specifically need to learn yet, but actually about the chaser stuff I'd like to know if it could be improved like this:
      The chaser keeps walking at normal pace randomly in a determined region, if the player approaches a certain distance to the chaser he would start this proccess of pathfinding and start the chase, but not chase around all the map like set up a region where he cannot reach you anymore (like a place that's supposed to be a hiding spot), then he would go back to his initial position.
      Idk if im making sense, Im still new to rpgmaker

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว

      Yeah I think I get what you're getting. That one is a bit more advanced. I'll tackle it in a future vid for sure!

    • @zweg9400
      @zweg9400 3 ปีที่แล้ว

      Thanks, I'll look foward to that and keep watching the next videos coming too. I'm still using RMMV instead of MZ but I guess I can still apply that knowledge to it.

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว

      Yup! They share all the core mechanics. The primary difference is the additional plugins options in mz

  • @dairyfreelemonstreams9493
    @dairyfreelemonstreams9493 11 หลายเดือนก่อน

    You saved me 5$ so I don't need to buy a plugin off Itch to do this! Many thanks :)

  • @BzNii
    @BzNii 4 หลายเดือนก่อน

    No more bad enemies Ai , Thank to you!

  • @one-nilteamstudios2430
    @one-nilteamstudios2430 3 ปีที่แล้ว +3

    Haha, funny and informative tutorial! Great stuff! :D

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว

      Glad to hear!

  • @DuLuanVien4.0
    @DuLuanVien4.0 3 ปีที่แล้ว +2

    wonderful. The most helpful video I have ever seen. thank you very much.

  • @minty111
    @minty111 2 ปีที่แล้ว +3

    that script doesn't appear to be in the spreadsheet anymore.

  • @megamanx913
    @megamanx913 3 ปีที่แล้ว

    I've been waiting for this!
    Alright!

  • @devinlupei5071
    @devinlupei5071 2 หลายเดือนก่อน

    This is EXACTLY what I was looking for! Google was no help! Why this isn't a standard function of RPG Maker's movement system I will never understand. Thank you!
    You wouldn't happen to know how to make an enemy not get stuck when moving away from the player, would you?

    • @TheOdie
      @TheOdie  2 หลายเดือนก่อน +2

      You can place it in set movement route. Just change the x, y destination from the player's coordinates to a location on the map

    • @devinlupei5071
      @devinlupei5071 2 หลายเดือนก่อน

      @@TheOdie Actually, upon testing this in game, I don't see much of a difference between what the regular approach player route does and both versions of those scripts. Perhaps asking the AI to find its way around a big fence is just too complex.

    • @TheOdie
      @TheOdie  2 หลายเดือนก่อน

      @devinlupei5071 the pathfinder does have a limit. If the map is too big, it won't work. In this case, I would suggest looking into a plugin. Visustella might be worth looking into as they provide a lot of quality of life items

  • @ot2nie
    @ot2nie 2 ปีที่แล้ว

    This is really helpful, thanks a lot!

  • @MichaelaThisten
    @MichaelaThisten ปีที่แล้ว

    You are a lifesaver

  • @cabanasbeats6141
    @cabanasbeats6141 3 ปีที่แล้ว

    you just fixed my pathfinding woes!

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว +1

      Ive got your back! 👍😁

    • @cabanasbeats6141
      @cabanasbeats6141 3 ปีที่แล้ว

      @@TheOdie you have yourself a new subscriber! it's great you're on MZ. I need all the help I can get!

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว

      Welcome :D !

  • @user-lp2yy3pf4o
    @user-lp2yy3pf4o 6 หลายเดือนก่อน

    I'm basically completely new, Player Touch isn't working for triggering a "fail" it will only trigger if I initiate contact with the event. How can I make the event initiate a fail?

  • @TheLastLivinGameCube
    @TheLastLivinGameCube 3 หลายเดือนก่อน

    Hey, I'm starting to program a battle in RPG Maker MV. Now I just created some new skills, but for some reason the "Magic" option is showing up twice in my battle menu for one of my characters but not the other. Why is that and how can I fix it?

  • @typeable101
    @typeable101 8 หลายเดือนก่อน +1

    Hello, thank you so much for the tutorial! I'm a beginner RPG Maker user, do I need to put credits if I use this script in my game? Thanks!

    • @TheOdie
      @TheOdie  8 หลายเดือนก่อน +2

      Nope! I share this one completely for free :)

    • @typeable101
      @typeable101 8 หลายเดือนก่อน +1

      @@TheOdie I see, again, thank you so much!! It's very helpful :D

    • @TheOdie
      @TheOdie  8 หลายเดือนก่อน +1

      @_typeable glad to hear it! If you feel the need to credit me in someway, a special thanks to TheOdie is good enough 🙂. But really, no need!

  • @adakrai1097
    @adakrai1097 3 ปีที่แล้ว

    It works omg 😎👍

  • @jesusm3744
    @jesusm3744 2 ปีที่แล้ว

    Hello! Thank you for the tutorial. I tried this in RPG Maker MV and when I tested it, the gameplay did't run smoothly, it lagged. Do you know how to fix this? Thanks again

  • @myplaylist7007
    @myplaylist7007 ปีที่แล้ว

    I thought i would need for the event to pick from 3 different set paths to find me.

  • @zxczxc9336
    @zxczxc9336 ปีที่แล้ว

    it work on MZ3D just a little lag
    thx!

  • @lykovideos9595
    @lykovideos9595 หลายเดือนก่อน

    I was wandering, can i mix a script call and a regular square comand?
    Say for example do an if() with a script call, using blocks to describe what is done in the if, close the } with another script call

    • @TheOdie
      @TheOdie  หลายเดือนก่อน +1

      @lykovideos9595 not entirely certain what you mean, but everything inside a script call is independent to itself. So you can't do a script call, hit OK, then do another script call and continue from the previous one. If that's something you're trying to do, you'll need to save values in switches/variables and proceed from there.

    • @lykovideos9595
      @lykovideos9595 หลายเดือนก่อน

      @@TheOdie That does answer my question. Thank you

  • @nicolasadjignon1336
    @nicolasadjignon1336 หลายเดือนก่อน

    I tested it and there is a little problem. If the enemy is on the other side of the map and i keep moving right and left, it will just stupidly move right and left too and not go up.

    • @TheOdie
      @TheOdie  หลายเดือนก่อน +1

      Is it a large map? Unfortunately, the pathfinder breaks with larger maps. In this case, I suggest finding a plugin that does it better

    • @nicolasadjignon1336
      @nicolasadjignon1336 หลายเดือนก่อน

      @@TheOdie Ah, that figures. It's not that big of a map but it's not working. It was my last attempt before moving my project to gdevelop hahaha. Thank you very much !

  • @mangomilky4526
    @mangomilky4526 2 ปีที่แล้ว

    i had test it. The enemy stuck in block path. The Enemy need Image recognition of the level algorithm.

  • @TheLastLivinGameCube
    @TheLastLivinGameCube 4 หลายเดือนก่อน

    How do you make it so that an enemy can only chase you once? I've tried Erase event, End event processing, and Control self switches, but nothing worked.

    • @TheOdie
      @TheOdie  4 หลายเดือนก่อน

      I made a playlist that tackles the basics to make an RPG Maker Horror Game. The basics go up to part 5 and can be lengthy, but most who've seen it didn't need tutorials after that ^.^
      th-cam.com/play/PLmqD_CN4-c_t5LJJp8bvpIZNlflrXBCIu.html

    • @TheLastLivinGameCube
      @TheLastLivinGameCube 4 หลายเดือนก่อน

      @@TheOdie Okay, the email link to the shared G drive folder has been sent to you

  • @beary-boo3223
    @beary-boo3223 2 หลายเดือนก่อน

    Dunno if you still reply. but is there a simple way to also get this killer to chase at a speed between 4 and 5? Like 4.5? I've tried separate scripts but I think it's getting overwritten somehow

    • @TheOdie
      @TheOdie  2 หลายเดือนก่อน +1

      Is the event changing pages? Or is a switch is triggering it on/ off? If so, this may cause the change in speed to be rewritten. The event speed will initialize when that page/event becomes active. Then your command to change its speed will have to come after

    • @beary-boo3223
      @beary-boo3223 2 หลายเดือนก่อน +1

      @@TheOdie Yes, a switch was turning it on. Thank you!

  • @DragonSkorn666
    @DragonSkorn666 5 หลายเดือนก่อน

    How can you make this work with vector based movement? I've tried using a plugin for this to work but the chaser just starts spinning in circles when it has to make a choice in direction.

    • @TheOdie
      @TheOdie  5 หลายเดือนก่อน +1

      I wouldn't recommend vector based movement. The engine was designed for tile- based movement only. In the case of vectors, you'll have to create your own pathfinder that supports vectors

    • @DragonSkorn666
      @DragonSkorn666 5 หลายเดือนก่อน

      @@TheOdie Thanks! I didn't know if it would work or not, I appreciate the reply!

  • @Actidle
    @Actidle 3 ปีที่แล้ว +1

    can you make tutorial how to make flashlight?

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว

      It's better to do with plugins (one I know of the top of my head is community lighting) than to create one ourselves. I'll do a showcase in the next week or two 🙂

  • @skatefilter5
    @skatefilter5 ปีที่แล้ว

    I made a bigger map just for a AI chasing but it's lagging so hard. Did anyone has the same problem on bigger maps such as interiors?

    • @TheOdie
      @TheOdie  ปีที่แล้ว +1

      Pathfinder has a harder time with larger maps. If you plan to pathfind on larger maps, it is recommended to use a plugin so you can adjust the range

    • @skatefilter5
      @skatefilter5 ปีที่แล้ว

      @@TheOdie Okay so what's the name of the plugin?

    • @TheOdie
      @TheOdie  ปีที่แล้ว +1

      @@skatefilter5 any pathfinder should do. A lot also tends to be built into core plugins like visustella's. A Google search for pathfinder plugins should bring up several results

  • @swag-sn7ze
    @swag-sn7ze 3 ปีที่แล้ว

    thank

  • @robin.8868
    @robin.8868 2 ปีที่แล้ว

    Is there a way to make this work with followers? My characters are two kids and I have one of them set as a follower, but the chaser doesn't attack them if he hits the follower.

    • @TheOdie
      @TheOdie  2 ปีที่แล้ว +1

      Unfortunately no. It's far more complex when it's not the player. You may want to look into visustella as I feel as though they may have created a paid plugin for it

  • @ozgarner9939
    @ozgarner9939 ปีที่แล้ว

    Hey Man! I tried this just now and it works fine until my chaser has to turn, then the sprite will glitch out and show the gap in between two sprites on the sprite sheet then the frame rate will go waaaay down. Any thoughts on how to fix that?

    • @TheOdie
      @TheOdie  ปีที่แล้ว

      Can't say that's happened to me. Feel free to send me a video and screenshot of your code at theopolisgaming@gmail.com

  • @theegg8780
    @theegg8780 3 ปีที่แล้ว

    “TypeError
    Cannot read property ‘moveStraight’ of undefined”
    (RPG Maker MZ).

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว

      Make sure you're copying the game map portion and event ID portion as written and placing it properly into the move route with the correct destination

    • @theegg8780
      @theegg8780 3 ปีที่แล้ว

      @@TheOdie Thanks my guy

  • @MultiFreaky123
    @MultiFreaky123 3 ปีที่แล้ว

    Hi there! I really liked your tutorial but I'm having trouble recreating this in RPG maker XP because the script calls seem to be different. I can't for the life of me figure out where I would find the relevant script calls for XP. When people write scripts where they reference game_map, for instance, how do they know the usage of that class? I can't find it anywhere!
    Any help is greatly appreciated!

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว

      Ahh XP. Sorry but it's been over a decade since I've used XP, which was also the engine I started with. Scripting in VX Ace and before was very different. While I do recall script calls possible in VX Ace, I cannot say the same with XP. Scripting in XP primarily used what was in the Scripts menu while the 'script call event' was to write small snippets of code instead. I believe it would have calls reference, but likely a library much smaller to the point that I do not believe one exists for pathfinding. You'd likely have to write the script yourself or find an existing one to copy/paste into the scripts menu.
      Be a much older engine, you're more likely to find answers off rm forums than anywhere else. Best of luck and I hope this helps to some degree!

    • @MultiFreaky123
      @MultiFreaky123 3 ปีที่แล้ว

      @@TheOdie Thanks for the quick reply! That was really nice of you.
      I'm okay with having to write the script myself as I'm quite familiar with scripting in general. But I still need to know how I actually reference and/or edit anything that I have not defined myself, and it is beyond baffling to me that there doesn't seem to be a collection of those syntaxes anywhere on the internet. Like, how do I know the names of functions that are included in a certain class? How do I even know the names of those classes? People just seem to magically know on the forums but they never explain where they gathered the information to begin with. Is there really no guide for this anywhere?

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว

      I wasn't able to find anything either from a quick search ago. Have you tried the help menu? I recall using it often in vx Ace so xp may have it too. Otherwise and sad to say, you may have to drive into the core script and disect it that way

    • @MultiFreaky123
      @MultiFreaky123 3 ปีที่แล้ว

      @@TheOdie Well, thanks for the advice nonetheless. I'll try looking a little deeper into the help menu.

  • @TheLastLivinGameCube
    @TheLastLivinGameCube 4 หลายเดือนก่อน

    I've linked a chase to an event for picking up an item. The item does not reappear, but the chase does. How can I make it so that the chase does not reappear?

    • @TheOdie
      @TheOdie  4 หลายเดือนก่อน

      Similar to how you made the item disappear, use switches and the conditions on the event page

    • @TheLastLivinGameCube
      @TheLastLivinGameCube 4 หลายเดือนก่อน

      @@TheOdie Actually, I had to make the event disappear in a different room. I just have to use a different switch for different chases. Thanks for reminding me.

    • @TheLastLivinGameCube
      @TheLastLivinGameCube 4 หลายเดือนก่อน

      @@TheOdie okay, I just tried doing this in a different room than before and it doesn't do anything. I've tried conditions, switches, erasing the event. Nothing prevents the repetition.

    • @TheOdie
      @TheOdie  4 หลายเดือนก่อน

      @TheLastLivinGameCube if your map is too large, pathfinder stops working. Unfortunately, this is a limitation with the engine. If it is something else, feel free to send me videos/screenshots to my email in the descriptions of this vid

    • @TheLastLivinGameCube
      @TheLastLivinGameCube 4 หลายเดือนก่อน

      @@TheOdie How big are you talking about?

  • @greenoak2205
    @greenoak2205 2 ปีที่แล้ว

    Thank you can this be used to make him chase over multiple maps?

    • @TheOdie
      @TheOdie  2 ปีที่แล้ว +1

      Nope, just the current map, but combine this with my "chase like in ao oni" video and it will!

    • @greenoak2205
      @greenoak2205 2 ปีที่แล้ว

      @@TheOdie thank you

  • @nangaku_
    @nangaku_ 2 ปีที่แล้ว

    so sad that this script doesn't work with galv's diagonal movement :(

    • @nangaku_
      @nangaku_ 2 ปีที่แล้ว

      Oh, i solved this problem. This script incorrect working with enabled diagonal movement on mouse, i just turned it off.

  • @averaystuffs2489
    @averaystuffs2489 2 ปีที่แล้ว

    Which algorithm do you use ? A* or Dynamic Pathfinding ?

    • @TheOdie
      @TheOdie  2 ปีที่แล้ว

      This tutorial uses the internal pathfinding system built into rm which I believe is A*

    • @averaystuffs2489
      @averaystuffs2489 2 ปีที่แล้ว

      @@TheOdie oh okey nice info

  • @Solbast
    @Solbast ปีที่แล้ว

    Is there a way to make pathfinding diagonal?

    • @TheOdie
      @TheOdie  ปีที่แล้ว

      Not by RM's internally built pathfinder. You will need to see if the script you discovered diagonal movement from has one.

  • @ivebeincheesy239
    @ivebeincheesy239 ปีที่แล้ว

    is there anyway for RPG Maker XP?

    • @TheOdie
      @TheOdie  ปีที่แล้ว

      I don't believe it has a built in pathfinder, but there should be plenty of scripts you can try. A simple Google search for rmxp pathfinder should yield several results. Best of luck!

  • @Mio_Takahashi_
    @Mio_Takahashi_ 3 ปีที่แล้ว

    Is there a way you could get the event to chase you from map to map?

    • @TheOdie
      @TheOdie  3 ปีที่แล้ว +3

      Sorta. It won't be the same event but a clone of the event (using a plugin). Otherwise, you'd have to make a new event on every map you want them to appear. I plan to make a tutorial on this in the future :)

    • @Mio_Takahashi_
      @Mio_Takahashi_ 3 ปีที่แล้ว

      @@TheOdie
      Can’t wait ^\^ You’re always very thorough, and I really appreciate the effort you put in.
      Until then, I’ll try and see what I can do with other sources and my own efforts ^_^

  • @Tovar7w7
    @Tovar7w7 2 ปีที่แล้ว

    Does work to Mv?

  • @DANDLERR
    @DANDLERR 3 ปีที่แล้ว

    I need this for vx ace

  • @mangomilky4526
    @mangomilky4526 2 ปีที่แล้ว

    So this thing doesn't need a plugin ?

    • @TheOdie
      @TheOdie  2 ปีที่แล้ว +1

      Correct. It's just one (long) line of code :P

    • @mangomilky4526
      @mangomilky4526 2 ปีที่แล้ว

      @@TheOdie Oh okey btw, i wanna make enemy move random but somehow when the player get close to enemy's range they will chase us with the pathfinding algorithm. Can you make it ?

    • @TheOdie
      @TheOdie  2 ปีที่แล้ว

      @@mangomilky4526 it's a bit difficult but I made a "line of sight" video which is the aura that you mentioned. There are three videos but you only need to watch part 1 and 2. The third is just an advanced optional method. Best of luck!

    • @mangomilky4526
      @mangomilky4526 2 ปีที่แล้ว

      @@TheOdie dude, i have been trying your code line but the enemy stuck on blockpath and not automatically chase the player where they are

    • @TheOdie
      @TheOdie  2 ปีที่แล้ว

      @@mangomilky4526 so the line of code uses the internal pathfinder which sadly means that it does have a limit. Is your map big? If it is then you will require a plugin

  • @jrosrenegamesarte6078
    @jrosrenegamesarte6078 2 ปีที่แล้ว

    I hate to be that guy...but i need MV or MZ =( sorry man

    • @TheOdie
      @TheOdie  2 ปีที่แล้ว +1

      Get it while the sale is going!

    • @jrosrenegamesarte6078
      @jrosrenegamesarte6078 2 ปีที่แล้ว

      @@TheOdie I'm so bad at this
      i meant which one are you using in this video X) Also what are your thoughts on "RPG Paper Maker" ?

    • @TheOdie
      @TheOdie  2 ปีที่แล้ว +1

      @@jrosrenegamesarte6078 MZ. As for paper maker, I haven't tried it before but the 2.5 perspective seems neat

  • @B-F3x
    @B-F3x 3 หลายเดือนก่อน

    jdshjdsfjdsfjkdjf