Navigating fixed room structure

Get help using Construct 2

Post » Wed Aug 13, 2014 4:42 am

Please see the mockup below.

map_navigate.png


So in words.. I have a fixed building with an unchanging room structure. The map is larger than the viewing window, and the user can scroll around the map by clicking on a room (the room then scrolls to the centres of the window). At the same time, there are 5 little guys that can be directed around the building by the player, not directly but by clicking on the target room. At first I just used pathfinding, but you can't find a path to something that's not onscreen. In the real map there are about 60 rooms.

So I need to roll my own room navigation/pathfinding. Each room/passage is numbered uniquely, and has a 'placemarker' sprite (not shown). I could come up with something, but I was wondering if there was any nice way that somebody has already come up with :)

tl;dr: auto navigating in fixed room structure, not with Pathfinding behaviour

PS: What I would like is if the Pathfinding behaviour let you access all nodes it calculated before it got dead-ended.. I could then pathfind to the last node. Not sure if that's possible with the algorithm.
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Wed Aug 13, 2014 3:19 pm

You could have a scaled down version of the level that fits into the screen behind the actual level (or is set invisible) but always stays in frame. The pathfinding behavior could work on a single pixel representing a character. Then, calculate the position of the characters according to the position of the pixel. It would be something like a mini map where you calculate the position of a symbol off of the position of the character but in reverse.
B
38
S
12
G
11
Posts: 331
Reputation: 7,712

Post » Wed Aug 13, 2014 9:41 pm

FragFather wrote:You could have a scaled down version of the level that fits into the screen behind the actual level (or is set invisible) but always stays in frame. The pathfinding behavior could work on a single pixel representing a character. Then, calculate the position of the characters according to the position of the pixel. It would be something like a mini map where you calculate the position of a symbol off of the position of the character but in reverse.


Great minds think alike 8-) While waiting for a response, I created a minimap with pathfinding! However I created it as an actual visible minimap. Problem is the pathfinding behaviour seems to break down on such a small scale.

My mini dudes are 3x3 (down from 17x17) and I've toyed with cell size of 1, 2, 3.. (down from 16) and with cell border also, but that's back to -1. The space to move is about 7-8 pixels. They just don't seem to go to the centre of my room sprites properly, and sometimes get stuck or whatever. I might make them 1 pixel as you suggest and see if that works.

However.. I could still make an invisible map, as big as my window, and use that. Great idea thanks.

And I will either scale the movement up to my full size map as you suggest, or use some scheme that when the mini guys hit a room sprite, I can use that to trigger something. We'll see.

I'd still be interested in a simple means to "auto navigate a map of numbered rooms using the room number".
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to How do I....?

Who is online

Users browsing this forum: digitalsoapbox, staltux, Yahoo [Bot] and 3 guests