[plugin] rex_graph

  • See this demo first. ( Capx )

    • click light-blue tile to move on it.

    Plugins

    rex_graph: Graph with vertices and edges.

    rex_graph_movement: Get moveable or moving path on the graph.

    More demos -

    Moving on a random-generated graph

  • Looks great. I assume you will have a "nearest" option as you do in Board? And the other things in SLG movement (like the filter functions).

    Also, Sometimes it is nice to be able to get a list of all the nodes that comprise a closed loop around a point--if such a simple closed loop exists.

    yours

    winkr7

  • winkr7

    I though "filter" function might not be useful while getting move-able area. So I abandon this feature, I will add it back.

    Edit

    Add "filter" function back.

  • If you are making a galactic star game for instance with your graph, you still want to know the "cost" of the 3 worm hole jumps and where is the "nearest enemy system that does not have a star base" filter type question.

    Also, it would be very useful to identify where graph links cross eachother. Your example has no crossing links.

    A builder of the graph might want to avoid crossing links since it will interfere with the user-interface and presentation--or at least know the location where they cross.

    yours

    Winkr7

  • winkr7

    What is "crossing links"? Do you mean that two edges are overlapped (condition: is overlap) physically?

  • rexrainbow

    In your example demo, none of the brown lines cross. If I wanted to add another node to your demo I want to be sure that when I create links to the other nodes the brown lines don't cross, or if they do cross--where do they cross (the layout x,y coord of the crossing point).

    As an example, connect the node in the upper left corner of the layout to the lower right corner. It will generate a long brown link that corsses 5 or 6 other brown links. THe programmer wants to be able to detect this condition (true--yes it crosses at least one other node link). Later on you may want to add where it crosses.

    I am calling node link what you are calling edge. So yes, if the edge is a line do they cross.

    yours

    Winkr7

  • Update

    rex_graph: add "Condition:In closed loop" to test if a vertex is in a closed loop.

  • winkr7

    "crossing links" might be detected by "condition: is overlapped" of edge sprite, since the "crossing" is a physically result.

  • rexrainbow

    I like the random graph demo. Yes you could check for crossing links with the condition: overlapped.

    Are you going to make a layout editor for this addin?

    Does the least path calculation have an option for one-way edges?. I know you did this for the Board addin,

    yours

    Winkr7

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • winkr7

    1. Nodes and links could be placed at layout editor already, it used links with overlapping test to get the two connected nodes. See the basic capx. Designer also could put the UID of two connected nodes on private variables of links at layout editor.

    2. Yes, each link could have 3 connection types

    1) Node A -> Node B

    2) Node A <- Node B

    3) Node A <-> Node B

    I use 3) in my sample capx. See the "action: add edge".

  • rexrainbow

    You have "pick all edges" twice in the event editor for graph under SOL -edges.

    yours

    winkr7

  • winkr7

    Yes, I made another "pick all edges" condition to add edges into an instance group, the other one is put edges into SOL directly. ( But I forgot uploaded these files, these new conditions are not available, I will update them next Monday. )

  • rexrainbow;

    I can't load your capx because it was built by a later (beta) version of C2. I think I can set the version back some kind of way, but unless you are using new features in the beta it might be helpful to do a capx build with a release version of c2.

    thanks for your time

    yours

    winkr7

  • Is it possible to use this plugin along with the associated (instgroup and graph movement) to create a 'non physical' graph? By this I mean the graph I would like to create and navigate is abstract, and not made with sprites consisting of vertices and edges on the layout itself.

    For example:

    I have two situations where I would like to create graphs and find the shortest path,

    The first is to find a path using elevators which move between floors, so each elevator car essentially covers several vertices,(i've accomplished this through other means but now i'd prefer to build a graph of elevator cars, which each contain their own range of floors, and find the shortest path using that data instead of sprite vertices

    The second case is further abstracted from sprites on the layout, I would like to use this plugin to find a path from a list of actions with different costs in a Goal Oriented Action Planner system, to generate a 'plan' of actions which are accessed via an NPC's stack. https://gamedevelopment.tutsplus.com/tutorials/goal-oriented-action-planning-for-a-smarter-ai--cms-20793

    So my question is, can I build a graph using these plugins without having to actually make the path on a layout using vertices and edges, and if so, how?

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