Movement Grid - Highlighting possible destinations

I am trying to figure out the ‘best’ way in a tile-based game to show the possible destinations for a characters movement.

By showing the possible destinations I mean when you select a character, they are only able to move a limited number of squares total and so it creates a diamond shaped grid around them, that may shrink depending on if there are any non-walkable tiles as destinations, and the path being shortened because obstackles had to be avoided.

I could go without a grid, and have the user pick a tile, the game calculates if there is anyway to reach that tile with obstacles, and then permirs/forbids the character reach that point.

Building from that, the maxiumum set of tiles could be selected, have those which pass through the boundries taken off, plus remove those which are non-walkable, and then check the remaining set to see which are still reachable with obstacles in the way.

My concern with this is how slow it would be, especially if you have a character who can move 6 tiles in a one direction, and then the 15 tiles in between because of diagnols, and trying to check through all of those for possible paths whenever the character is selected.

One idea I had would be to check in quadrants, where the cursor happens to be relative to the character, check that 6x6 area for possible paths, but that may be confusing to a user and they could assume they’re only able to move NE since that is all that highlights.

I’ve only spent a couple days thinking about it in my spare time, so I haven’t had any breakthroughs. I’m wondering if anyone else has a good idea for this.

go to http://www.tonypa.pri.ee/tbw/index.html they have one that i think is what ur looking for called mouse to move. These have wicked tutes on tilebased games

sweet link dr warm, i have some stuff to learn!

Lol, yeah i think everyone can learn from him, he’s a nutcase for tilebased games

I’m looking at excactly the same problem as N3K0, alltho the link is nice it does not look at the problem of restricted movement, or character select.

To clarify what I mean, take a chess game, I wouldn’t mind knowing how it is possible to select a piece, then have the possible locations of movements highlighted, not highlighting those that are not on the board or squares occupied by other pieces.

I haven’t really looked into this problem yet, but it’s been in the back of mind for a while now, and I haven’t been able to come up with anything in my mind, maybe once i get down to action scripting i might get it nailed!

The link should be able to highlight possible places etc, but you would need to modify it. I don’t think you know how hard it is to make a chess game, there’s this guy on actionscript.org who’s making one for 2 years, and he’ll make quite a bit of money. For know i would stick to something a little simpler!

hehe, no worries. I’ve been there and done…tried that a long time ago :sigh:

kewl, I’ll have a closer look at the site, and post back if i run into any trouble :rabbit:

been there and done…tried that
lol, its a bit like that hey!

Bah… Two years for a hess game… in flash… the logic behind chess is pretty easy… And to make the movement algorithm… it’s not too hard either…

if you really want to make a set defined area of blocks / tiles that you move in… You will have to have a certain tile feature or map creation feature… and then you will have to kno speed and other movement issues like that… it’s actually more complicated than you originally might have thought.

this is another area :cowboy: I will touch on in the future… Until then… Keep trying… or learn other aspects of flash until then… Like classes… :wink:

Bah… Two years for a hess game… in flash… the logic behind chess is pretty easy… And to make the movement algorithm… it’s not too hard either…
Hey Marz it must be slightly harder than that if they have like supercomputers that can’t beat the best players, obviously flash couldn’t handle something this complex, but if you want a smart computer, there is a infinite amount of refining you can do, isn’t there?

Actually… technically… they could make an AI that looks 200,000 moves intot he future as long as they had enough memory… Just using a “node” system you could map out every possibility and create an AI that could dominate any player… EVery move that a player could do… Would be recorded into this node… and eah subsequent node would be handled in the same way… If they move the knight… and I moved the bishop to here… Then what would the outcoming moves be?

It’s quite interesting… If I had access to a couple of supercomputers… I’d be doing that right now… lol… I wish :wink:

Yeah i agree, BTW you could borrow a couple of my spare supercomputers if u want :wink:

Ahh Cool… Just send them to South Central Pennsylvania… I’ll rig em up and create a superLAN :smiley: