The One-Block Solution to NPC Pathing

    How do you feel about this solution?


    • Total voters
      8

    winggar

    That One Nerd
    Joined
    Jun 30, 2013
    Messages
    22
    Reaction score
    9
    The One-Block Solution to NPC Pathing


    So I’m not going to make a big intro, because I’m lazy and want to actually go play video games, so here it is.


    The Node.


    The node is an intangible block that (much like the pick-up rails) can only be seen in build mode. A node can be connected (C -> V) to other nodes to form a one way, direct route between the two. If two nodes are linked together both ways, it will be a two-way passage. NPCs will take move in a straight line between nodes, and will not path around obstructions. A node can be connected to any logic block. A node will send a HIGH signal to any connected logic blocks when an NPC is standing on the node. If the node is slaved to any logic blocks, the NPC standing on the node will wait until a HIGH signal is sent to the node before moving to the next node.


    Examples: (Sorry in advance for the random periods, spacing wasn't working for some reason :l )


    A → B → C
    .........| --> D


    The NPC will move from A to B, and then move to either C or D, depending on where the NPC needs to go. The NPC can not move from D or C to B, or from B to A


    A → |WALL| → B


    The NPC will get stuck by the wall, and will not path around it.


    A <-> B <-> C
    ...........|<-> D

    This example is like the first, except the NPC can move from D or C to B, and from B to A, as well as A to B, and B to C or D.

    Elevator Example:


    A → | Elevator |
    ........|B C D |
    ........| 1 2 3 |

    Logic:

    Node A is connected to nodes B, C, and D, which are all inside the elevator. Node B, C, and D are part of the main entity, not the elevator entity. Nodes B, C, and D are connected to their respective floor buttons below them, and to their respective node on each floor. A signal is connected to nodes B, C, and D. When the elevator is at the selected floor, the signal is HIGH.

    Pathing:

    The NPC wants to go to floor 2, and starts at node A. The NPC moves from node A to node C. When the NPC steps on node C, a HIGH signal is sent to button 2. The elevator then moves to floor two, while the NPC stays on node C. Once the elevator reaches floor two, a HIGH signal is sent to node C, and the NPC exits the elevator.


    End note:


    Please tell me how I can improve on this system, and how you feel about this suggestion. I will provide more examples if needed, and if you have any questions, please ask. I will try to answer as soon as I can, and you can expect an answer within two days.
     
    Joined
    Sep 9, 2013
    Messages
    68
    Reaction score
    10
    • Legacy Citizen 3
    It's... A solution.

    I feel like it's the worst-case solution, for when they give up on pathing.

    Part of what i'm looking forward to with NPC's is to watch them try and navigate the ships I make. - I'm actually hoping they include some purposefully bad pathing, and make it feel like they slowly learn to navigate the ship.

    Pathing without elevators or rail-doors is rather trivial from a computer-science point of view (I've written one myself actually). - I'm not sure how difficult it would be to try and write something that detects and navigates through/with other entities, - but I'd love for them to visit that as a solution first.

    - But that's just my opinion. - Your solution is sound, - it's just a bit lifeless, and I know that's not their goal. - But it may be an inevitability.
     

    winggar

    That One Nerd
    Joined
    Jun 30, 2013
    Messages
    22
    Reaction score
    9
    Pathing without elevators or rail-doors is rather trivial from a computer-science point of view (I've written one myself actually). - I'm not sure how difficult it would be to try and write something that detects and navigates through/with other entities, - but I'd love for them to visit that as a solution first.
    Yeah, I was trying to go for something similar to the rail system, that could be customized by the players, rather then being automatic. It would be preferable to have true pathing, but some ships would be much harder to path. This was mostly made to accommodate logic creations as well.
     

    nightrune

    Wizard/Developer/Project Manager
    Joined
    May 11, 2015
    Messages
    1,324
    Reaction score
    577
    • Schine
    • Top Forum Contributor
    • Thinking Positive
    Keep in mind that quarters will likely act similar to this with other functions.
     

    Lone_Puppy

    Me, myself and I.
    Joined
    Mar 12, 2015
    Messages
    1,274
    Reaction score
    529
    • Purchased!
    • Community Content - Bronze 2
    • Legacy Citizen 8
    This reminds me of crowed controls in first person shooters.
     

    winggar

    That One Nerd
    Joined
    Jun 30, 2013
    Messages
    22
    Reaction score
    9
    Keep in mind that quarters will likely act similar to this with other functions.
    I would intend for nodes to be connected to either the main block of the quarter or a node inside the quarter.
     

    nightrune

    Wizard/Developer/Project Manager
    Joined
    May 11, 2015
    Messages
    1,324
    Reaction score
    577
    • Schine
    • Top Forum Contributor
    • Thinking Positive
    I would intend for nodes to be connected to either the main block of the quarter or a node inside the quarter.
    I understand that but Quarters are likely to be the only thing you have and pathing will be done with just those. Adding a quarter for elevators might be the quickest solution to most of the problems since they could then teleport worst case scenario. I don't see the need for actual nodes with that in mind.
     

    winggar

    That One Nerd
    Joined
    Jun 30, 2013
    Messages
    22
    Reaction score
    9
    I understand that but Quarters are likely to be the only thing you have and pathing will be done with just those. Adding a quarter for elevators might be the quickest solution to most of the problems since they could then teleport worst case scenario. I don't see the need for actual nodes with that in mind.
    That would work well too.
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    When crew was mentioned, I think the devs mentioned crew being able to use elevators and such. So in addition to waypoints like this suggestion, there may be "activation hint" blocks or something to allow NPCs to "use" navigation machinery like elevators.
     
    Joined
    Dec 8, 2014
    Messages
    226
    Reaction score
    52
    • Purchased!
    • Legacy Citizen 4
    What about atmosphere?

    The NPC's know where to go, because they would die a horrible space death in other places. This would prevent me from making the crew quarters on the outside of the ship.

    It also adds a nasty level to the combat. Suddenly the piercing effect and the punch through effect modules are more desirable for missiles than the explosive effect.

    suddenly we need to have air tight integrity and blast doors for our ships.
     

    Lukwan

    Human
    Joined
    Oct 30, 2015
    Messages
    691
    Reaction score
    254
    I like the node idea.

    Further to...

    Make each node a random, intangible vending machine... water cooler, coffee maker :coffee:, line-up at the virtual `head`, video-news monitor, (crap-game if you are a pirate ship) etc. :sneaky: Then there will be a RP-friendly 'motive' for all this NPC activity instead of pointless milling-about.
     
    Last edited:
    • Like
    Reactions: jayman38