Auto search an object in layout?

This forum is currently in read-only mode.
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • How would an object with custom movement as its behavior be able to auto search an object that is found in the same layout? Like if an NPC would automatically know where the bathroom is if it needed to have its poo poo time. Or maybe it will randomly circle the layout until it finds the object its looking for.

    I'm guessing Line of Sight might help with this....

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, that is a more complex topic, I am afraid. Depends on what you want to achieve, but you'll have to implement basic routines such as go-to.

    Simplest solution would be to use a waypoint system, create one waypoint in each room and corridor, visit each and remember the visited until the bathroom is found, then remember the waypoint (and quickly calculate the shortest path and use that in the future).

    Have fun!

  • I see. Well, I have not mingled with waypoints before. Guess this is a start. Anyway, what values are placed in waypoints? X and Y? I'm not in my PC right now so I can't check it out for myself. And can waypoint be included in a hash table?

    I mean what if an NPC goes to remember a waypoint, and the player saves the game and quits. Will the waypoint still be there when the player plays again?

    Oh wait, I have a follow up question. What will be better?

    1. Make a huge map(4000x2000?) in errr mspaint and import it in Construct and just put colission boxes in places where its suppose to be solid.

    2. Make the same map in mspaint but break it down into small objects and import it one by one in Construct and then rebuild the map there.

    So which one? I have been doing number 1 by the way.

  • Waypoints should act as nodes, you'd have to store coordinates as well as names of waypoints it is directly connected to. So when you look for a path, you can solve through each waypoint's neighbours, iterate until you find the goal, then use the shortest path.

    As for your question, multiple map pieces are better than one large map. The 4000x2000 would use up 4096x4096 pixels in video memory, which is 16 MB. If you break it down into 1024x1024 pieces, you can use eight of them, each is a megabyte, thus you save 8 MB memory. Moreover, only one of them would be rendered at a time (if you use 1024x768 resolution), so it would be faster to load and render.

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