Adding AI and Pathfinding to a Platformer

Поделиться
HTML-код
  • Опубликовано: 13 апр 2020
  • 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.redblobgames.com/pathfind...

Комментарии • 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 3 года назад +1

      I subscribed

    • @3F1VE
      @3F1VE 3 года назад +2

      @@Stevenstuff yeah i agree also your vids are lit

    • @VapingWithJay
      @VapingWithJay 3 года назад

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

    • @strangepoison830official2
      @strangepoison830official2 3 года назад +1

      You sound like an adult

  • @SamHogan
    @SamHogan 4 года назад +182

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

    • @Stevenstuff
      @Stevenstuff  4 года назад +38

      ayyyyyyyy

    • @clara4738
      @clara4738 3 года назад +1

      yum

    • @VapingWithJay
      @VapingWithJay 3 года назад

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

    • @greencrystals9022
      @greencrystals9022 3 года назад

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

    • @freindly5686
      @freindly5686 3 года назад

      @@greencrystals9022 you should watch brackeys

  • @NO-pf2gp
    @NO-pf2gp 3 года назад +66

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

  • @cringedmossy5260
    @cringedmossy5260 3 года назад +25

    0:43 life lessons learnt

  • @slope1169
    @slope1169 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 3 года назад +7

    that liquid state joke was kinda funny :)

  • @reedhasproblems
    @reedhasproblems 3 года назад +68

    Your content is so underrated

  • @sentoo3120
    @sentoo3120 3 года назад +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 👍

  • @ricosquirts3420
    @ricosquirts3420 3 года назад +17

    Steven definitely has future RUclips material

  • @arithmetic1938
    @arithmetic1938 3 года назад +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  3 года назад

      good luck!

    • @arithmetic1938
      @arithmetic1938 3 года назад

      @@Stevenstuff ruclips.net/video/9W7LI4AIn98/видео.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  3 года назад

      @@arithmetic1938 nice!

  • @hasnaindev
    @hasnaindev 3 года назад

    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.

  • @infrequent2718
    @infrequent2718 3 года назад +1

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

  • @raynaindahood
    @raynaindahood 3 года назад +5

    2:28 he do be teaching tho 😳

  • @staddr9884
    @staddr9884 3 года назад +2

    This man is an inspiration

  • @Shadow-bc5nr
    @Shadow-bc5nr 2 года назад

    Nice video! Thanks for sharing!

  • @TrueTortoise
    @TrueTortoise 3 года назад +17

    im gonna go make a game now

    • @AdamMady
      @AdamMady 3 года назад +3

      Annnd u didn't succeed idk maybe u did

    • @TrueTortoise
      @TrueTortoise 3 года назад +4

      im only half way done its torture

    • @eth47turbo
      @eth47turbo 3 года назад +2

      @@TrueTortoise oof

  • @randomplayer469
    @randomplayer469 3 года назад

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

  • @elijah7835
    @elijah7835 3 года назад +1

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

  • @blitzmlcom2939
    @blitzmlcom2939 3 года назад +1

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

  • @odain2810
    @odain2810 3 года назад

    Good job

  • @treyfr3811
    @treyfr3811 3 года назад +2

    You're so underrated

  • @glitched0007
    @glitched0007 3 года назад

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

  • @Eclipsegamedev
    @Eclipsegamedev 2 года назад

    Old nostalgia

  • @Jellyjam14blas
    @Jellyjam14blas 3 года назад +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 3 года назад +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 3 года назад +1

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

  • @BasicallyNotNedFlanders
    @BasicallyNotNedFlanders 3 года назад

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

  • @Gold-db1ne
    @Gold-db1ne 2 года назад

    Nice

  • @erethum5342
    @erethum5342 2 года назад

    Pretty simple, sort of -Steven

  • @maush9490
    @maush9490 3 года назад +2

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

  • @QiraTane
    @QiraTane 3 года назад

    Ur voice is kinda like Craig Tucker and I like it

  • @MetaPikachu
    @MetaPikachu 3 года назад +1

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

  • @cr4ftsman791
    @cr4ftsman791 3 года назад +1

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

  • @xiledeggs1280
    @xiledeggs1280 3 года назад

    your the best

  • @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

  • @CodeConnor
    @CodeConnor 2 года назад

    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_ 3 года назад

    cool

  • @zhongzhengge5296
    @zhongzhengge5296 Год назад

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

  • @faz_rock
    @faz_rock 3 года назад

    noice

  • @brrrread
    @brrrread 3 года назад +1

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

  • @user-ti8fj1fg8o
    @user-ti8fj1fg8o 3 года назад

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

  • @pedror1439
    @pedror1439 3 года назад +1

    e Nice vid

  • @skinnyboyhan
    @skinnyboyhan 3 года назад

    i want to download this

  • @user-jv9gx9gv5o
    @user-jv9gx9gv5o 3 года назад

    this is gooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooood contant

  • @genghiskhan6688
    @genghiskhan6688 2 года назад

    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).

  • @RGBA
    @RGBA 2 года назад

    what do you use for editing?

  • @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!

  • @skeptic3654
    @skeptic3654 3 года назад

    will you make this available to the public?

  • @ramblecastofficial
    @ramblecastofficial 3 года назад +1

    How can you play this game? It looks awsome.

  • @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 3 года назад

      5.5k subs now

    • @31boxes76
      @31boxes76 3 года назад

      HOLY... 88 THOUSAND SUBS

  • @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

  • @MoonShadow_Atreides2675
    @MoonShadow_Atreides2675 3 года назад

    Steven sounds a bit like Michael Reeves

  • @Jeckmuck
    @Jeckmuck 3 года назад +1

    when is this game coming out

    • @Jeckmuck
      @Jeckmuck 3 года назад

      @Crimson dang it it looks really good

  • @ClukysAdventures
    @ClukysAdventures 3 года назад

    I SAW SQID WARD

  • @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?

  • @rishei4748
    @rishei4748 3 года назад

    whats it called?

  • @bebop8329
    @bebop8329 3 года назад

    how can i play it

  • @imtotallynotblaze
    @imtotallynotblaze 3 года назад

    2:58 Wat?!😂👌

  • @amritadavid1962
    @amritadavid1962 3 года назад

    Oh

  • @PeacePreacher
    @PeacePreacher 2 года назад

    What is this game name

  • @M4ssExtinction
    @M4ssExtinction 2 года назад

    in range, begin murder attempt O_O

  • @glplaays5
    @glplaays5 3 года назад

    download?

  • @-Calli.e-
    @-Calli.e- Год назад

    Wher download

  • @adsarebbbest2594
    @adsarebbbest2594 3 года назад

    that javascript?

  • @apropickaxe9713
    @apropickaxe9713 3 года назад

    2:41 look at the bottom left lol

  • @wannazifahusnawanazaham137
    @wannazifahusnawanazaham137 3 года назад

    Is you cancel the game?

  • @lanzjypol
    @lanzjypol 3 года назад

    Is it possible to make an android version?

    • @Stevenstuff
      @Stevenstuff  3 года назад +2

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

    • @lanzjypol
      @lanzjypol 3 года назад

      Hahaha

  • @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!

  • @damienfinnegan8272
    @damienfinnegan8272 3 года назад

    Where can I get this game?

  • @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

  • @gamesb.a.n.d.
    @gamesb.a.n.d. 3 года назад

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

  • @JamY25
    @JamY25 3 года назад

    Can you download a game

  • @htbl8494
    @htbl8494 3 года назад

    Yels

  • @yummybeeftaco
    @yummybeeftaco 3 года назад +3

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

  • @disguisedostrich
    @disguisedostrich 3 года назад

    90th comment
    Give it 90 likes

  • @simonkadlec718
    @simonkadlec718 3 года назад

    6969 views. Nice

  • @startinglotus
    @startinglotus 3 года назад

    make a game but it only says sub to startinglotus

  • @sleepypenguin3586
    @sleepypenguin3586 3 года назад

    Make a sandbox Plz

  • @bidaliao3804
    @bidaliao3804 3 года назад

    "liquid"

  • @MarGuAng
    @MarGuAng 3 года назад

    Hi steven

  • @Randymagnum16
    @Randymagnum16 2 года назад

    Heh 69k views

  • @jackjacky4587
    @jackjacky4587 3 года назад

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

    • @Stevenstuff
      @Stevenstuff  3 года назад

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

    • @jackjacky4587
      @jackjacky4587 3 года назад

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

    • @Stevenstuff
      @Stevenstuff  3 года назад

      @@jackjacky4587 lmao

    • @jackjacky4587
      @jackjacky4587 3 года назад

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

    • @Stevenstuff
      @Stevenstuff  3 года назад

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

  • @hiramrussell71
    @hiramrussell71 2 года назад

    You 69k views hehe

  • @iprg8406
    @iprg8406 3 года назад

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

    • @31boxes76
      @31boxes76 3 года назад

      95k

    • @iprg8406
      @iprg8406 3 года назад

      @@31boxes76 adding to my point

  • @MrGatesfamily
    @MrGatesfamily 3 года назад

    I want GAME

  • @themapletree2310
    @themapletree2310 3 года назад

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

  • @dogani1g
    @dogani1g 3 года назад

    Algorithem=way+FPS

  • @31boxes76
    @31boxes76 3 года назад

    Lol

  • @gulawula8519
    @gulawula8519 3 года назад

    Is dis dani

  • @lincolnsnewaccount41
    @lincolnsnewaccount41 3 года назад

    what

  • @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🙁☹️

  • @Leakose
    @Leakose 3 года назад

    Bruh how old are you? XD

    • @Stevenstuff
      @Stevenstuff  3 года назад +1

      at least like 12

    • @Leakose
      @Leakose 3 года назад

      @@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  3 года назад

      @@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 3 года назад

      @@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 3 года назад

      (Selfless Promo) XD

  • @FuriousDarkness
    @FuriousDarkness 3 года назад +1

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

  • @MRJakeyBro
    @MRJakeyBro Месяц назад

    unhelpfull

  • @Brahvim
    @Brahvim 3 года назад

    Get more subs than Dani _or else_

  • @oldleaf3755
    @oldleaf3755 3 года назад

    this is extremely cringy