1
\$\begingroup\$

I rebuild popular apps to get good at Godot. This game Hocus poses a challenge in terms of path finding. I have a solution, but as the illusions scale, it becomes ridiculously time-consuming to set up. I set destination, to which the cube can go, but then you have to set up possible connections for every destination, because there're supposed to be constraints. This can lead to something like 100 variations to be set up for one level, which is of course ridiculous if you want to do 100 levels like the creators. Any idea?

This is a video, where you can exactly see the pathfinding mechanism. Short description:
Whenever you're at one corner of the bars of the illusion graphic (it's just a 2D graphic), you have to set up ways, where the player can go next, because some ways are invalid in this illusion, logically. This is what I intended with setting up an array of numbers, which represent the possible next points for each point. However, this is extremely time-consuming if levels reach even slightly more complexity. I highly doubt the creators did it that way.

\$\endgroup\$
  • 2
    \$\begingroup\$ Hello, instead of adding a link to a Google search (which will be tailored to the person viewing it (this is what Google does)), could you add directly a picture to make sure everyone sees the same thing, and which illustrates exactly what you're after? \$\endgroup\$ – Alexandre Vaillancourt Mar 12 '18 at 18:06
  • 1
    \$\begingroup\$ A description of the path finding mechanic you want to duplicate will also help, for anyone who hasn't played this specific game. \$\endgroup\$ – DMGregory Mar 12 '18 at 18:07
  • 1
    \$\begingroup\$ Don't edit your post to include a new section called "edit." We already have an edit history in the event that it matters. \$\endgroup\$ – Draco18s Mar 12 '18 at 18:32
  • \$\begingroup\$ I would recommend looking into is the graph data structure. This would be a really good representation of your object. (I like this explanation of them). Each vertex on your image would also be a vertex in the graph. When the cube is at a vertex, you use the graph structure to determine where the player can go next. This would still require some more tedious work, but I think it would be simpler than what you were proposing. \$\endgroup\$ – TARDIS Maker Apr 9 '18 at 23:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.