Pathfinding and Optimization Issues in a Doujinshi Convention Simulation Game

0 favourites
  • 4 posts
From the Asset Store
20 high quality click sounds, ready to improve your game's UI instantly
  • Hello everyone,

    I'm currently developing a simulation game based on a doujinshi convention using Construct 3. Players can arrange the location of stalls, and characters will automatically spawn and move around the venue, aiming to create the bustling atmosphere of attending a convention.

    Subscribe to Construct videos now
    Subscribe to Construct videos now

    I've designed two behavior patterns for the characters:

    1.Characters will move to a random stall (represented by a yellow dot), linger there for a few seconds, and then move on to another stall.

    2.Characters will pick a random point within the venue and move towards it.

    However, I've encountered an issue. Due to the auto-pathfinding settings, many characters end up following similar paths, often overlapping each other.

    This makes it challenging to create the impression of a crowded convention.

    Additionally, when characters use the auto-pathfinding, their routes are sometimes simplified in a way that they walk over the tables, rather than avoiding them. I don't want to increase the obstacle range as I fear it might completely block some paths. Any suggestions on how to address this?

    I hope to achieve two main objectives:

    1.Reduce the performance consumption of individual characters to increase the number of characters on the scene.

    2.Spread characters out within the venue as much as possible, avoiding overlaps, making the scene look busy even if there aren't many characters.

    Would any experts here be able to offer some advice or direction on how I might better optimize this aspect of my design? I'm especially interested in insights regarding auto-pathfinding and overall game performance optimization.

    Thank you in advance!

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your best bet is probably Ashleys little sideproject. He talks about and solves your exact issue in this blog post: construct.net/en/blogs/ashleys-blog-2/rts-devlog-extreme-pathfinding-1608

    With the code for the project being available here, I think it's specifically inside the gameServer.js: github.com/AshleyScirra/CommandAndConstruct

    Only caveat is that Ashley uses almost exclusively javascript so unless you're fit in javascript this is not gonna be easy to extract. But perhaps you can get the concept outlined in the blogpost working with events too.

  • You could switch to EasyStar pathfinding which uses a tilemap. It has the benefit of being able to limit the directions on which an object can enter a tile, so you could set it up so people can only approach a stall from the front.

    Also you could code a push out system so when a person overlaps another they get pushed out. Theres code for this on the forum somewhere if you can figure it out on your own.

    Finally you could ditch pathfinding altogether an make your own system based on line of sight.

    Look cool so far. I get a kairosoft vibe.

  • I also recommend checking out EasyStarJS, we are using it in our game for spirits pathfinding on large tilemaps with lots of obstacles.

    Here is an example with lots of instances moving without overlapping:

    howtoconstructdemos.com/prevent-multiple-enemies-with-pathfinding-from-overlapping-easystarjs

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