Navigating fixed room structure

0 favourites
  • 3 posts
From the Asset Store
Add calm and a lounge vibe to your games with these 8 tracks
  • Please see the mockup below.

    [attachment=0:2ccicwzn][/attachment:2ccicwzn]

    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 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 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".

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)