Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "pathfinding"
-
As a developer, sometimes you hammer away on some useless solo side project for a few weeks. Maybe a small game, a web interface for your home-built storage server, or an app to turn your living room lights on an off.
I often see these posts and graphs here about motivation, about a desire to conceive perfection. You want to create a self-hosted Spotify clone "but better", or you set out to make the best todo app for iOS ever written.
These rants and memes often highlight how you start with this incredible drive, how your code is perfectly clean when you begin. Then it all oscillates between states of panic and surprise, sweat, tears and euphoria, an end in a disillusioned stare at the tangled mess you created, to gather dust forever in some private repository.
Writing a physics engine from scratch was harder than you expected. You needed a lot of ugly code to get your admin panel working in Safari. Some other shiny idea came along, and you decided to bite, even though you feel a burning guilt about the ever growing pile of unfinished failures.
All I want to say is:
No time was lost.
This is how senior developers are born. You strengthen your brain, the calluses on your mind provide you with perseverance to solve problems. Even if (no, *especially* if) you gave up on your project.
Eventually, giving up is good, it's a sign of wisdom an flexibility to focus on the broader domain again.
One of the things I love about failures is how varied they tend to be, how they force you to start seeing overarching patterns.
You don't notice the things you take back from your failures, they slip back sticking to you, undetected.
You get intuitions for strengths and weaknesses in patterns. Whenever you're matching two sparse ordered indexed lists, there's this corner of your brain lighting up on how to do it efficiently. You realize it's not the ORMs which suck, it's the fundamental object-relational impedance mismatch existing in all languages which causes problems, and you feel your fingers tingling whenever you encounter its effects in the future, ready to dive in ever so slightly deeper.
You notice you can suddenly solve completely abstract data problems using the pathfinding logic from your failed game. You realize you can use vector calculations from your physics engine to compare similarities in psychological behavior. You never understood trigonometry in high school, but while building a a deficient robotic Arduino abomination it suddenly started making sense.
You're building intuitions, continuously. These intuitions are grooves which become deeper each time you encounter fundamental patterns. The more variation in environments and topics you expose yourself to, the more permanent these associations become.
Failure is inconsequential, failure even deserves respect, failure builds intuition about patterns. Every single epiphany about similarity in patterns is an incredible victory.
Please, for the love of code...
Start and fail as many projects as you can.30 -
Graduation day:
A guy presents a modified pathfinding algorithm based on a*, in Java.
Jumping to the conclusions, he says he tested the algorithm on a 128x128 graph based maze, but not larger because the program saturates his 4 GB ram pc.
One teacher (algorithms and data structures) literally jumps from the chair "you saturate 4gb of ram with a* on 128x128 graph?!"
Best graduation day ever lol9 -
Just implemented A* and Dijkstra to get into pathfinding with graphs. Really hyped about this! TIL that Dijkstra is perfect to find the quickest subway route in my city 😏2
-
Started with some inspiration for making a 2d MMORPG.
These are how i make the world generator:
Decide you want to generate paths/roads.
Realize you need pathfinding function.
Realize you totally forgot how astar pathfinding works.
Search for implementation.
End up getting bored and implement other cool feature instead.
I literally made a bunch of stuff before writing a 20 or so lines long astar cause its boring. -
participating at an coding challenge.
the mission is to write an game solver for an game engine - in java. based on astar, pathfinding should be made possible by cloning objects.
never seen a so hardly misconcepted challenge, where character instances and their variables are static and contain uncloneable data😂 oh god what a waste of time realizing this bs1 -
Hey Devrant fam!, well i'm basically trying to see if i can change up this A* algo we need to implement for an assessment, and from what i know basically most people have copy and pasted it, but not me!, so there is this one called Easy A* (star) Pathfinding By Nicholas Swift and my goal is such that i would like to make it input friendly!, here is the code in my main function
def main():
start1,start2 = input('Enter co-ordinates').split(',')
end1,end2 = input('Enter co-ordinates').split(',')
drive_mount()
open_map()
# test1 = (start1, start2)
# test2 = (end1, end2)
start = (start1, start2)
end = (end1, end2)
print(f'start co-ordinates:{start} \n end co-ordinates:{end}')
our_path = astar(our_maze, start, end)
print(f'starting co-ordinates:{start} \n ending co-ordinates:{end} \n Your shortest-path:{our_path}')
if __name__ == '__main__':
main()
however i am then greeted by this error, on line 62 specifically it says "TypeError: must be str, not int" and my original thought was to put str() around all of them, but that does not seem to work :-) any advice? thank you!3