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...
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 :)
ngl that sentence was really long
I subscribed
@@Stevenstuff yeah i agree also your vids are lit
@steven I tried unity and I didn’t know what to do
You sound like an adult
hey hes back, A+ vid
or should i say A* vid, eh?
ayyyyyyyy
yum
Sam Hogan I love your vids there lit 🔥 btw E=mc squared
@@Stevenstuff please make tutorial videos id really like to know how to code with unity
@@greencrystals9022 you should watch brackeys
Your content is so underrated
i agree
Not now
Yes I also think so. He's even funny. A bit
not now i started watching when he had 1k subs now he blew up!
No u
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 👍
I want to see an actual liquid state for the NPCs.
What
aka a gib state aka *a bloodlust state* :)
They maneuver around by wiggling
0:43 life lessons learnt
Steven definitely has future TH-cam material
called it
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.
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.
that liquid state joke was kinda funny :)
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.
good luck!
@@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.
@@arithmetic1938 nice!
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.
This is really good editing and mic and everything for a 2nd vid your really good
2:28 he do be teaching tho 😳
This man is an inspiration
im gonna go make a game now
Annnd u didn't succeed idk maybe u did
im only half way done its torture
@@TrueTortoise oof
Oh my fucking god you have no idea how glad I am I found this smh.
“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
or is it packfinding?
Its like he has a big lisp to his voice.
Your game seems super fun, please finish it please please I want pain and suffering
AND GUNS AND SEVERAL WARCRIMES
Mainly war crimes
You're so underrated
Yes
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
I don't know half the words your saying but you earned a sub
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?
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.
@@BeingBelligerent You're right, Being conditional would make it run way faster. Smart :)
Who does not remember this video but just got it recommended???
Ur voice is kinda like Craig Tucker and I like it
No one:
Not even me:
Coding: //in range, begin murder attempt
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).
Pretty simple, sort of -Steven
Nice video! Thanks for sharing!
Old nostalgia
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
by the way if I watch do I press the watch button lol
Can you please share the code, im making a dynamic platformer with lots of enemies and cant figure it out
You're vids made me want to make a game lol. So I will
Nice
your the best
Good job
Your theme for IDE is so cool! Could you please let me know the name of your theme :)
this is gooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooood contant
How’s you make it go into idle state? What type of method did you use to make it’s see the player?
cool
e Nice vid
noice
Do u know if ur gonna make this a game everyone can play? It looks really good
I SAW SQID WARD
How can you play this game? It looks awsome.
He’s not finished
@@Apathetion oh ok
in range, begin murder attempt O_O
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!
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 :)
@@Stevenstuff You're welcome! And haha, will do!
5.5k subs now
HOLY... 88 THOUSAND SUBS
will you make this available to the public?
i want to download this
when is this game coming out
@Crimson dang it it looks really good
what do you use for editing?
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!
2:41 look at the bottom left lol
Can I download this game anywhere?
When will he upload a new Dev log?
@HashmatDaBEST k
Steven sounds a bit like Michael Reeves
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
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
@@Stevenstuff yea, that would be great! Thanks!
@@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.
@@Stevenstuff K, i think i understand most of it! Thanks
@@jumi6051 no problem!
2:58 Wat?!😂👌
will you put a link to your game in the comments or in the description
is it weird that i understand every word that comes out of his mouth?
how can i play it
What is this game name
Oh
whats it called?
The game Looks A*MBHISHOUS can you let us play it?
Is you cancel the game?
that javascript?
make a game but it only says sub to startinglotus
Wher download
uggggg, HOW, did u learn c# plz plz plz tell ME
you can learn it from the internet google "c# tutorials for beginners" and you should find somthing that teaches you the langage
Algorithem=way+FPS
download?
Make a sandbox Plz
Can you download a game
make a knock off fnaf 4 with the same ai and a costume layout
Is it possible to make an android version?
if I ever get around to finishing this game I might lol
Hahaha
Yels
90th comment
Give it 90 likes
6969 views. Nice
Where can I get this game?
it's sort of permanently delayed lol
@@Stevenstuff oh, why is that?
Hi steven
You 69k views hehe
"liquid"
Bro best vid ever
I want GAME
Heh 69k views
88k in less than a year and 10 videos?lol
95k
@@31boxes76 adding to my point
Is dis dani
cant figure out how to do platform ai :((
im too dumb
nah you're not dumb, the ai system is just fairly complex and I'm bad at explaining things lol
@@Stevenstuff thx but i believe you are mistaken about my (lack of) intelligence
@@jackjacky4587 lmao
@@Stevenstuff btw when's ur next devlog coming?
@@jackjacky4587 hopefully in a day or two, im like halfway through editing
Lol
what
Bruh how old are you? XD
at least like 12
@@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?
@@Leakose not really sure lol, I haven't added enough noteworthy things yet to warrant another demo. maybe in a month or two
@@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
(Selfless Promo) XD
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🙁☹️
Me when 3 likes is a lot of likes: it’s free real estate
unhelpfull
Get more subs than Dani _or else_
this is extremely cringy
No