Making objects move on complex randomized routes
Quote from CamBen on April 3, 2015, 10:41 pmSince path_tracks can only reliably link to 2 other tracks at a time, I have been tearing my hair out trying to make a certain object visit every room in my map without using a single linear path, or multiple linear paths that originate from the same start point.
(I can upload the map vmf if it helps, minus the trashy spiderweb of path_tracks I tried.)
Here are some pics. the rooms are colorcoded, the walls are orange and the possible paths are cyan/blue.
map.pngI just want an object to be able to arbitrarily go along these paths as it pleases, without a specific order, pausing at each major room/endpoint.
Since path_tracks can only reliably link to 2 other tracks at a time, I have been tearing my hair out trying to make a certain object visit every room in my map without using a single linear path, or multiple linear paths that originate from the same start point.
(I can upload the map vmf if it helps, minus the trashy spiderweb of path_tracks I tried.)
Here are some pics. the rooms are colorcoded, the walls are orange and the possible paths are cyan/blue.
I just want an object to be able to arbitrarily go along these paths as it pleases, without a specific order, pausing at each major room/endpoint.
Aperture Science: We do our science asbestos we can!
Quote from RustyDios on April 4, 2015, 11:40 amDoes the object have to actually "move" into each room along those paths or is it okay for it to just "appear" in each room?
You could try a logic_case with the random selected input/output and a set of teleport landmarks. I haven't used much Portal2/Hammer in quite a while so I know those might not be accurate names of the entities. I'm sure you can figure out what I mean. Or try path_tracks with a logic_case with outputs that have both movetopathpoint and teleporttopathpoint. That should make it look random.
I'm not saying this idea will work, but it is an idea for you to look into maybe?
Does the object have to actually "move" into each room along those paths or is it okay for it to just "appear" in each room?
You could try a logic_case with the random selected input/output and a set of teleport landmarks. I haven't used much Portal2/Hammer in quite a while so I know those might not be accurate names of the entities. I'm sure you can figure out what I mean. Or try path_tracks with a logic_case with outputs that have both movetopathpoint and teleporttopathpoint. That should make it look random.
I'm not saying this idea will work, but it is an idea for you to look into maybe?
Quote from CamBen on April 4, 2015, 2:29 pmThe object must move rather than teleport, for gameplay and aesthetic purposes.
I did try the movetopathnode output but it didnt really work because the origin path_track must be directly connected to the target path_track in a forwards connection, which isn't possible since path_tracks can only connect to one other path_track, plus one alternate branch path.Actually I have an idea (this next part is my thoughts in real time so there may be confusion)
Maybe using a system of teleports and movetopathnode would work, but a little bit different way.
I could have the object just have an origin point that isn't too suspicious looking, maybe the black room (hallway type area) and have most of the paths lead back to it, then have the moving object teleport-switch paths to an identical point on that origin that leads to a new room of the map, and once the moving object has made a stop at those places, they would be idle there for however long I wanted.
Then, afterwards, I would build branching paths, which have origin points identical to those stop points in the rooms that the moving object will teleport to after the idle time is up, and have each path point is teleports to be randomized.
The paths could be from one room to the neighboring, without including ones that aren't nearby. For example, room light blue could lead to room light red and room puke brown. Maybe room black. But it could not lead to room purple, room white, room grey, etc.
/ideas
Ok that was a long post XD I'm going to try some more stuff out and report back.
The object must move rather than teleport, for gameplay and aesthetic purposes.
I did try the movetopathnode output but it didnt really work because the origin path_track must be directly connected to the target path_track in a forwards connection, which isn't possible since path_tracks can only connect to one other path_track, plus one alternate branch path.
Actually I have an idea (this next part is my thoughts in real time so there may be confusion)
Maybe using a system of teleports and movetopathnode would work, but a little bit different way.
I could have the object just have an origin point that isn't too suspicious looking, maybe the black room (hallway type area) and have most of the paths lead back to it, then have the moving object teleport-switch paths to an identical point on that origin that leads to a new room of the map, and once the moving object has made a stop at those places, they would be idle there for however long I wanted.
Then, afterwards, I would build branching paths, which have origin points identical to those stop points in the rooms that the moving object will teleport to after the idle time is up, and have each path point is teleports to be randomized.
The paths could be from one room to the neighboring, without including ones that aren't nearby. For example, room light blue could lead to room light red and room puke brown. Maybe room black. But it could not lead to room purple, room white, room grey, etc.
/ideas
Ok that was a long post XD I'm going to try some more stuff out and report back.
Aperture Science: We do our science asbestos we can!
Quote from Skotty on April 5, 2015, 6:10 pmYou could try to link path_tracks to any other path_track you want by changing the target.
Just fire
- Code: Select all
OnFireUser1
myPathTrackToChange
Addoutput
target NewTargetName
You could try to link path_tracks to any other path_track you want by changing the target.
Just fire
- Code: Select all
OnFireUser1
myPathTrackToChange
Addoutput
target NewTargetName
Quote from CamBen on April 5, 2015, 11:57 pmThanks, but I actually did get it working, in a slightly different manner to what you mentioned, Skotty, but thank you anyway.
Thanks, but I actually did get it working, in a slightly different manner to what you mentioned, Skotty, but thank you anyway.
Aperture Science: We do our science asbestos we can!
Quote from Skotty on April 6, 2015, 1:10 pmThe easiest would be to use the alternate route and, in case of more than two branches, you just have to add one extra path track so in the sum you got 3 branches again.
The easiest would be to use the alternate route and, in case of more than two branches, you just have to add one extra path track so in the sum you got 3 branches again.
Quote from CamBen on April 6, 2015, 2:46 pmI had each possible branching path be a different, unconnected path_track that leads to a dead end path.
That dead end is also the same location of multiple other origin path_tracks, which branch into paths to different rooms. When the train passes the dead end, it waits 3 seconds, and then tells a logic_case to pickrandomshuffle.
The logic_case then tells the train to teleporttopathnode to one of the new tracks in the same location of the dead end, and the train resumes along a random new path.
It may seem pretty complex but using visgroups for all the different tracks, it works pretty well and it isn't too confusing.
This also allows me to turn off the logic_case and instead force the train to visit a specific area, if needed.
I had each possible branching path be a different, unconnected path_track that leads to a dead end path.
That dead end is also the same location of multiple other origin path_tracks, which branch into paths to different rooms. When the train passes the dead end, it waits 3 seconds, and then tells a logic_case to pickrandomshuffle.
The logic_case then tells the train to teleporttopathnode to one of the new tracks in the same location of the dead end, and the train resumes along a random new path.
It may seem pretty complex but using visgroups for all the different tracks, it works pretty well and it isn't too confusing.
This also allows me to turn off the logic_case and instead force the train to visit a specific area, if needed.
Aperture Science: We do our science asbestos we can!