Skip to main content
GameDev.net gamedev.net
🔒 Locked

Diablo-like Walking based on Pathfinder + Level Editor (CONCEPT)

Started by marcjoel Oct 19, 2012 at 3:53 PM 5 replies 2.2k views
Original Post
marcjoel
marcjoel
First of all, I already know A* algorithm. I would like to make/test a walking hero character on a map made in a level editor(also made by me).

What I have done before is manage to walk my hero on a map with the given information:
-Texture tile size is same as A* tile size.
-The hero stands on 1 A* tile.

That's a bit straight forward isn't it? It's just applying the A* algorithm posted in the tutorials found in the internet.


My problem is..

Given:
-Texture Tiles: 100 x 100 pixels (the actual texture that will be rendered)
-A* Tiles: 25 x 25 pixels (determines whether walkable or unwalkable) (4 by 4 A* tiles in 1 texture tile)
-Hero character eats 2 by 2 A* tiles (that's 50 x 50 pixels)
-Monsters eat different amount of A* tiles like a big one stands on a 5 by 5 A* tiles while a smaller one on a 3 by 3 A* tiles.


How to go with this?

FLeBlanc
FLeBlanc
One method you could try is to implement different grids. For the hero, have him pathfind on a grid where one tile is the size of a 2x2 patch of base tiles. Similarly, for a big monster implement a grid whose tiles are the same size as 5x5 of the base tiles.
marcjoel
marcjoel
Hmmm, so basically, A* tile map 01 for HERO, A* tile map 02 for monsters with 3 by 3, A* tile map 03 for monsters with 4 by 4.

hmmmmmm. then i will update those 3 tile maps based of their summation? so that no one will be overlapping anyone?
marcjoel
marcjoel
what are the other techniques?
Mussi
Mussi
This topic might be of interest.
marcjoel
marcjoel
I got the Clearance-based Path finding. BUT the agents/units there are always square. 1x1, 2x2, 3x3.. What if I have 2x3 or 2x4 agent/unit?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.