this post was submitted on 08 Jul 2023
11 points (100.0% liked)

GameDev

2777 readers
1 users here now

A community about game development.

Rules:

More rules might follow if they become necessary; general rule is don't be a pain in the butt. Have fun! ♥

GameDev Telegram chat.

founded 2 years ago
MODERATORS
 

Hoping for some advice on AI pathfinding terminology

Basically I have a town made of individual hex shaped tiles with buildings on them. Each tile will have footpaths too, and my little people will hopefully wander around the paths, travelling to other tiles via their path connections.

I'm fine with learning this stuff but just not sure exactly what terms to search for to get started!

Should I be looking up specific #Godot features for finding routes? Algorithms? Help!

@gamedev #GameDev

top 10 comments
sorted by: hot top controversial new old
[–] Foxysen@mastodon.gamedev.place 4 points 1 year ago* (last edited 1 year ago) (1 children)

@teahands @gamedev I think the term you are looking for is 'A-star'.

Godot has build-in A-star algorithm for use which is best for tile-based (or just a lot of pre-defined points like in 2000s FPS) pathfinding, somewhere in scripts.

And it has more fancy navigation which is more for free-flow polygonal world. That is something far more complex than A-star, like 'just use library we have'

@Foxysen @gamedev That is definitely a term I've heard thrown around before and never had cause to investigate what it actually is. Sounds like now's the time, thank you! 😅

[–] loregret@mastodon.gamedev.place 4 points 1 year ago* (last edited 1 year ago) (1 children)

@loregret @gamedev Appreciate the homework, thank you :D

[–] TeaHands@lemmy.world 2 points 1 year ago

Posted this from Mastodon basically just to see if it would work, which it does. But also gives me a very small character limit so if the question makes no sense and you need more info, let me know. Expertise very much appreciated!

[–] dev_ric@fosstodon.org 2 points 1 year ago

@teahands @gamedev you probably want to start by looking up A* pathfinding. Essentially it's just a way of calculating the shortest route between two places by scoring each adjacent tile from every other, based on how many hops it took to get there. Same maths however many adjacents you have so it should work for hex quite nicely. I'm 99.9% certain a YouTube search will explain better than I can...

[–] bluestarultor@tech.lgbt 1 points 1 year ago* (last edited 1 year ago) (1 children)

@teahands @gamedev A* ("A star") might be a friendly starting point. It's generally intended for square grids, but a little algebra to get the right distance for the angles might make it possible to extend to hexagons. Even if you don't end up using any part of it, just understanding it might help for fundamentals.

@bluestarultor @gamedev Fundamentals is absolutely what I'm missing here so thank you very much. Baby steps, and all that!

load more comments
view more: next ›