Adding AI and Pathfinding to a Platformer

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2024
  • A sort of devlog on how I added things like A* pathfinding to my platformer indie game thing.
    Here's a website with some nice animations if you wanna learn more about the A* algorithm:
    www.redblobgam...

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

  • @Stevenstuff
    @Stevenstuff  4 ปีที่แล้ว +148

    sorry for randomly disappearing for like 4 months, ive just been a bit busy with school and stuff.
    however, in light of recent events ive found myself with a lot more free time, so ive been working on a very very exciting new video (or at least, I think its exciting) which, if everything goes as planned, should be out in a week or so :)

    • @Stevenstuff
      @Stevenstuff  4 ปีที่แล้ว +18

      ngl that sentence was really long

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

      I subscribed

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

      @@Stevenstuff yeah i agree also your vids are lit

    • @VapingWithJay
      @VapingWithJay 4 ปีที่แล้ว

      @steven I tried unity and I didn’t know what to do

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

      You sound like an adult

  • @SamHogan
    @SamHogan 4 ปีที่แล้ว +181

    hey hes back, A+ vid
    or should i say A* vid, eh?

    • @Stevenstuff
      @Stevenstuff  4 ปีที่แล้ว +38

      ayyyyyyyy

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

      yum

    • @VapingWithJay
      @VapingWithJay 4 ปีที่แล้ว

      Sam Hogan I love your vids there lit 🔥 btw E=mc squared

    • @greencrystals9022
      @greencrystals9022 4 ปีที่แล้ว

      @@Stevenstuff please make tutorial videos id really like to know how to code with unity

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

      @@greencrystals9022 you should watch brackeys

  • @reedhasproblems
    @reedhasproblems 4 ปีที่แล้ว +68

    Your content is so underrated

  • @sentoo3120
    @sentoo3120 4 ปีที่แล้ว +12

    I’ve recently gotten into coding and really love it, and I also really love your videos. So I’ll be staying in touch with your channel.
    Great video 👍

  • @NO-pf2gp
    @NO-pf2gp 4 ปีที่แล้ว +66

    I want to see an actual liquid state for the NPCs.

  • @cringedmossy5260
    @cringedmossy5260 4 ปีที่แล้ว +25

    0:43 life lessons learnt

  • @ricosquirts3420
    @ricosquirts3420 4 ปีที่แล้ว +17

    Steven definitely has future TH-cam material

  • @damitboy187
    @damitboy187 4 ปีที่แล้ว +38

    Love it man. I really like the art style you use.
    And question: Is there going to multiplayer and if so will there be gamemodes.

    • @Stevenstuff
      @Stevenstuff  4 ปีที่แล้ว +14

      thanks :)
      and about the gamemodes, its probably going to have procedurally generated levels and be a roguelike or something. I might also add multiplayer, but netcode is kinda spooky, so we'll see.

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

    that liquid state joke was kinda funny :)

  • @arithmetic1938
    @arithmetic1938 4 ปีที่แล้ว +5

    Oh my word, thanks so much, I was stuck on how to add pathfinding to a platformer, and I feel like this'll give me a good place to start. I'll let you know when I finally get it up and running, and will probably make a video about it.

    • @Stevenstuff
      @Stevenstuff  4 ปีที่แล้ว

      good luck!

    • @arithmetic1938
      @arithmetic1938 4 ปีที่แล้ว

      @@Stevenstuff th-cam.com/video/9W7LI4AIn98/w-d-xo.html I did it, I created a pathfinding system that should work for any type of tilemap I draw. I had a bit of issue making it, mainly because I couldn't find any good tutorials on it, so the next thing I do it probably going to be, make a tutorial oh how I did it, just in case anyone else decides they wanna do it.

    • @Stevenstuff
      @Stevenstuff  4 ปีที่แล้ว

      @@arithmetic1938 nice!

  • @hasnaindev
    @hasnaindev 4 ปีที่แล้ว

    I love these videos because they aren't your usual video game development vlogs but are complete lessons in case you want to create something similar.

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

    This is really good editing and mic and everything for a 2nd vid your really good

  • @raynaindahood
    @raynaindahood 4 ปีที่แล้ว +5

    2:28 he do be teaching tho 😳

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

    This man is an inspiration

  • @TrueTortoise
    @TrueTortoise 4 ปีที่แล้ว +17

    im gonna go make a game now

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

      Annnd u didn't succeed idk maybe u did

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

      im only half way done its torture

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

      @@TrueTortoise oof

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

    Oh my fucking god you have no idea how glad I am I found this smh.

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

    “Passfinding”
    1:09
    1:24
    1:35
    2:03
    2:07
    2:20
    2:35
    2:41
    2:56
    3:04
    3:06
    3:09

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

      or is it packfinding?

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

      Its like he has a big lisp to his voice.

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

    Your game seems super fun, please finish it please please I want pain and suffering
    AND GUNS AND SEVERAL WARCRIMES

    • @Apathetion
      @Apathetion 4 ปีที่แล้ว

      Mainly war crimes

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

    You're so underrated

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

    Great video bro and the game is also great
    And question: how did you get famous so quickly on TH-cam ??? Please tell me your secret

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

    I don't know half the words your saying but you earned a sub

  • @Jellyjam14blas
    @Jellyjam14blas 4 ปีที่แล้ว +5

    What would happen if the level changed so that the last enemy movement graph was no longer viable, would a new graph be needed every time a barrel exploded or a platform on a track moved? What about their capability to actively avoid level hazards like spikes or lava?

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

      The way i would attempt to solve this is create the AI path going through these hazards but write a bit of script into the AI that continuously checks for them using if than statements. if hazard equals true turn around.

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

      @@BeingBelligerent You're right, Being conditional would make it run way faster. Smart :)

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

    Who does not remember this video but just got it recommended???

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

    Ur voice is kinda like Craig Tucker and I like it

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

    No one:
    Not even me:
    Coding: //in range, begin murder attempt

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

    Man, the NPC seizure animation for some reason made me almost cry laughing. Such a small and stupid thing, and yet it's so funny (to me at least).

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

    Pretty simple, sort of -Steven

  • @Shadow-bc5nr
    @Shadow-bc5nr 2 ปีที่แล้ว

    Nice video! Thanks for sharing!

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

    Old nostalgia

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

    you might want to add a lil bit of code to reduce the randomness of the characters attack, remember when we played video games as a kid we watched the pattern and tactfully jump in the pattern to hit the characters, maybe code it for end bosses if you have them

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

      by the way if I watch do I press the watch button lol

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

    Can you please share the code, im making a dynamic platformer with lots of enemies and cant figure it out

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

    You're vids made me want to make a game lol. So I will

  • @Gold-db1ne
    @Gold-db1ne 3 ปีที่แล้ว

    Nice

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

    your the best

  • @odain2810
    @odain2810 4 ปีที่แล้ว

    Good job

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

    Your theme for IDE is so cool! Could you please let me know the name of your theme :)

  • @user-jv9gx9gv5o
    @user-jv9gx9gv5o 3 ปีที่แล้ว

    this is gooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooood contant

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

    How’s you make it go into idle state? What type of method did you use to make it’s see the player?

  • @Skello_
    @Skello_ 4 ปีที่แล้ว

    cool

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

    e Nice vid

  • @faz_rock
    @faz_rock 4 ปีที่แล้ว

    noice

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

    Do u know if ur gonna make this a game everyone can play? It looks really good

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

    I SAW SQID WARD

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

    How can you play this game? It looks awsome.

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

    in range, begin murder attempt O_O

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

    92 SUBS!? Bro. You make better content that I ever could..
    One suggestion for video side of things: steer cleer of making jokes about seizures or disabilites. I know you didn't intend for it to be portrayed badly but it may not be perceived thst way for everyone. Just be careful!
    And damn, those enemies really wanna slap you with a fish huh?
    I think they turned out really great! Good job!
    Thanks for the entertainment at 4am (yes, I should sleep, I know...). Keep doing what you're doing!

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

      thanks dude! and yeah, good suggestion about the seizures joke.
      keep doing what you're doing and don't stop watching youtube at 4 in the morning :)

    • @MattBull
      @MattBull 4 ปีที่แล้ว

      @@Stevenstuff You're welcome! And haha, will do!

    • @31boxes76
      @31boxes76 4 ปีที่แล้ว

      5.5k subs now

    • @31boxes76
      @31boxes76 4 ปีที่แล้ว

      HOLY... 88 THOUSAND SUBS

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

    will you make this available to the public?

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

    i want to download this

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

    when is this game coming out

    • @Jeckmuck
      @Jeckmuck 4 ปีที่แล้ว

      @Crimson dang it it looks really good

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

    what do you use for editing?

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

    If I've already hit subscribe, then how ca I it it again? Unless I unsubscribe and hit it again. That could work.
    Except that I'm defiant!

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

    2:41 look at the bottom left lol

  • @mari-with-a-gun
    @mari-with-a-gun 3 ปีที่แล้ว

    Can I download this game anywhere?

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

    When will he upload a new Dev log?

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

      @HashmatDaBEST k

  • @MoonShadow_Atreides2675
    @MoonShadow_Atreides2675 4 ปีที่แล้ว

    Steven sounds a bit like Michael Reeves

  • @jumi6051
    @jumi6051 4 ปีที่แล้ว

    can u do an detailed tutorial on your ai (pathfinding/states) etc.? It looks really nice and ai is always something i and probably also other people dont really understand

    • @Stevenstuff
      @Stevenstuff  4 ปีที่แล้ว

      i probably won't be able to make a video on it, as these usually take a ton of time to record and edit and i'm currently working on a couple other projects, but i could definitely write a more detailed and technical explanation and give you some resources if you want

    • @jumi6051
      @jumi6051 4 ปีที่แล้ว

      @@Stevenstuff yea, that would be great! Thanks!

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

      @@jumi6051 ok, so this is basically the logic for my game currently:
      When the game starts, it loops through all of the platforms in the game and then does a collision check above each platform to test if its walkable.
      Then it stores the positions of all the walkable platforms in a list.
      Next, a map that stores all the reachable platforms for each platform is created. (in java the data structure is a HashMap, or a map that maps platforms to lists of platforms). This allows me to easily get a list of platforms reachable from a certain platform.
      Then, all the walkable platforms in the list are compared to each other using a for loop in a for loop, and if two platforms are within a certain range of each other, they are added to the list in the map value of the opposite platform, which builds up the map.
      Afterwards, whenever an enemy needs to pathfind, which is when their state (which is just a variable, in my game its an enum but it can be an int or string or whatever) is set to attacking and they are not close to the player, i run the a* algorithm (this website explains it pretty well: www.redblobgames.com/pathfinding/a-star/introduction.html) on the map and get the path using this technique: www.geeksforgeeks.org/printing-paths-dijkstras-shortest-path-algorithm/ (the website talks about djikstras, but the same technique still applies). Then, its just if statements and moving the enemy for navigating the paths from there.

    • @jumi6051
      @jumi6051 4 ปีที่แล้ว

      @@Stevenstuff K, i think i understand most of it! Thanks

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

      @@jumi6051 no problem!

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

    2:58 Wat?!😂👌

  • @user-ti8fj1fg8o
    @user-ti8fj1fg8o 4 ปีที่แล้ว

    will you put a link to your game in the comments or in the description

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

    is it weird that i understand every word that comes out of his mouth?

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

    how can i play it

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

    What is this game name

  • @amritadavid1962
    @amritadavid1962 4 ปีที่แล้ว

    Oh

  • @rishei4748
    @rishei4748 4 ปีที่แล้ว

    whats it called?

  • @gamesb.a.n.d.
    @gamesb.a.n.d. 4 ปีที่แล้ว

    The game Looks A*MBHISHOUS can you let us play it?

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

    Is you cancel the game?

  • @adsarebbbest2594
    @adsarebbbest2594 4 ปีที่แล้ว

    that javascript?

  • @startinglotus
    @startinglotus 4 ปีที่แล้ว

    make a game but it only says sub to startinglotus

  • @-Calli.e-
    @-Calli.e- 2 ปีที่แล้ว

    Wher download

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

    uggggg, HOW, did u learn c# plz plz plz tell ME

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

      you can learn it from the internet google "c# tutorials for beginners" and you should find somthing that teaches you the langage

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

    Algorithem=way+FPS

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

    download?

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

    Make a sandbox Plz

  • @JamY25
    @JamY25 4 ปีที่แล้ว

    Can you download a game

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

    make a knock off fnaf 4 with the same ai and a costume layout

  • @lanzjypol
    @lanzjypol 4 ปีที่แล้ว

    Is it possible to make an android version?

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

      if I ever get around to finishing this game I might lol

    • @lanzjypol
      @lanzjypol 4 ปีที่แล้ว

      Hahaha

  • @htbl8494
    @htbl8494 4 ปีที่แล้ว

    Yels

  • @disguisedostrich
    @disguisedostrich 4 ปีที่แล้ว

    90th comment
    Give it 90 likes

  • @simonkadlec718
    @simonkadlec718 4 ปีที่แล้ว

    6969 views. Nice

  • @damienfinnegan8272
    @damienfinnegan8272 4 ปีที่แล้ว

    Where can I get this game?

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

      it's sort of permanently delayed lol

    • @damienfinnegan8272
      @damienfinnegan8272 4 ปีที่แล้ว

      @@Stevenstuff oh, why is that?

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

    Hi steven

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

    You 69k views hehe

  • @bidaliao3804
    @bidaliao3804 4 ปีที่แล้ว

    "liquid"

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

    I want GAME

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

    Heh 69k views

  • @iprg8406
    @iprg8406 4 ปีที่แล้ว

    88k in less than a year and 10 videos?lol

    • @31boxes76
      @31boxes76 4 ปีที่แล้ว

      95k

    • @iprg8406
      @iprg8406 4 ปีที่แล้ว

      @@31boxes76 adding to my point

  • @gulawula8519
    @gulawula8519 4 ปีที่แล้ว

    Is dis dani

  • @jackjacky4587
    @jackjacky4587 4 ปีที่แล้ว

    cant figure out how to do platform ai :((
    im too dumb

    • @Stevenstuff
      @Stevenstuff  4 ปีที่แล้ว

      nah you're not dumb, the ai system is just fairly complex and I'm bad at explaining things lol

    • @jackjacky4587
      @jackjacky4587 4 ปีที่แล้ว

      @@Stevenstuff thx but i believe you are mistaken about my (lack of) intelligence

    • @Stevenstuff
      @Stevenstuff  4 ปีที่แล้ว

      @@jackjacky4587 lmao

    • @jackjacky4587
      @jackjacky4587 4 ปีที่แล้ว

      @@Stevenstuff btw when's ur next devlog coming?

    • @Stevenstuff
      @Stevenstuff  4 ปีที่แล้ว

      @@jackjacky4587 hopefully in a day or two, im like halfway through editing

  • @31boxes76
    @31boxes76 4 ปีที่แล้ว

    Lol

  • @lincolnsnewaccount41
    @lincolnsnewaccount41 4 ปีที่แล้ว

    what

  • @Leakose
    @Leakose 4 ปีที่แล้ว

    Bruh how old are you? XD

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

      at least like 12

    • @Leakose
      @Leakose 4 ปีที่แล้ว

      @@Stevenstuff I just played the other game you're working on and it's amazing. I love the feel and its very smooth. When do you plan and releasing the next demo?

    • @Stevenstuff
      @Stevenstuff  4 ปีที่แล้ว

      @@Leakose not really sure lol, I haven't added enough noteworthy things yet to warrant another demo. maybe in a month or two

    • @Leakose
      @Leakose 4 ปีที่แล้ว

      @@Stevenstuff I get it man, it's hard making something that people will enjoy. I mean, I only get an average of like a 100 views on my songs and some of them take weeks to make

    • @Leakose
      @Leakose 4 ปีที่แล้ว

      (Selfless Promo) XD

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

    I don’t wanna know what that even means I don’t even wanna say it I just I’m just going to drink some milk #Milkkkkkkkkk🙁☹️

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

    Me when 3 likes is a lot of likes: it’s free real estate

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

    unhelpfull

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

    Get more subs than Dani _or else_

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

    this is extremely cringy