REFERENCE: Snap point flags

(ARK Dev Kit version 224.5)

As near as I can tell, the structure you are currently placing checks the Structure Snap Type Flags of nearby structures against the To Snap Point Type Flags and To Snap Point Type Exclude Flags of each of its snap points. The Snap Point Match Groups do not seem to (completely?) prevent matches between snap points with different groups (for example, the top snap point of fence foundations is Match Group 8; walls and railings, despite not having any Match Group 8 snap points, can still snap to fence foundations); however, it does seem to prevent them in some cases (such as how foundations and ceilings have different snap groups for front/back and left/right connections)… perhaps it is only considered if there is at least one matching snap point?

By flag:
2: Foundations, spiked walls, pillars, elevator tracks
4: Walls (+doorframe, +windowed), railings
8: Ceilings (+trapdoorframe), catwalks, ramps, sloped roofs
16: Catwalks, ramps, sloped roofs, fence foundations, gateways
32: Doors
64: Ramps, sloped roofs
128: Trapdoors
256: Pillars, elevator tracks
512: Windows
1,024: (Unused, so far as I can find)
2,048: Basic water pipes, water pipe intersections, water taps, water tanks
4,096: Intake water pipes
8,192: Sloped water pipes
16,384: (Unused, so far as I can find)
32,768: (Unused, so far as I can find)
65,536: (Unused, so far as I can find)
131,072: Electrical cables
262,144: (Unused, so far as I can find)
524,288: (Unused, so far as I can find)
1,048,576: (Unused, so far as I can find)
2,097,152: Gates
4,194,304: Ladders, fence foundations, gateways
8,388,608: Fence foundations, gateways
16,777,216: (Unused, so far as I can find)
33,554,432: (Unused, so far as I can find)
67,108,864: (Unused, so far as I can find)
134,217,728: (Unused, so far as I can find)
268,435,456: Generators, elevator tracks
536,870,912: Elevator platforms

By structure type:
Structure: Flag sum [Individual flags]

Foundations: 2 [2]
Spiked walls: 2 [2]
Walls (all varieties): 4 [4]
Railings: 4 [4]
Ceilings (all varieties): 8 [8]
Catwalks: 24 [8, 16]
Doors: 32 [32]
Ramps, sloped roofs: 88 [8, 16, 64]
Trapdoors: 128 [128]
Pillars: 258 [2, 256]
Windows: 512 [512]
Basic water structures: 2,048: [2048]
Intake pipes: 4,096 [4096]
Sloped pipes: 8,192 [8192]
Electrical cables: 131,072 [131072]
Gates: 2,097,152 [2097152]
Ladders: 4,194,304 [4194304]
Fence foundations: 12,582,928 [16, 4194304, 8388608]
Gateways: 12,582,928 [16, 4194304, 8388608]
Generators: 268,435,456 [268435456]
Elevator tracks: 268,435,714 [2, 256, 268435456]
Elevator platforms: 536,870,912 [536870912]

Snap point match groups:
(Note: For purposes of this list, “Wall” will refer to Walls, Doorframes, Windowframes, Railings, and Sloped Walls. “Ceiling” will refer to Ceilings, Hatchframes, and Thatch Roofs. “Ramp” will refer to both ramps and sloped roofs. “Gateway” will refer to both Dinosaur Gateways and Behemoth Gateways. “Pillars+” will refer to both Pillars and Elevator Tracks. “Non-sloped water pipes” refers to straight, vertical, intersection, tap, and intake pipes, plus water tanks.)

Group 2:

  • Foundations –> Foundations/Walls/Ceilings/Ramps (front/back)
  • Foundations –> Ladders/Pillars
  • Ceiling –> Walls/Ceilings/Catwalks (front/back)
  • Ceiling –> Ladders
  • Pillars –> Pillars+ (adjacent front/back)
  • Doorframes –> Doors
  • Doors –> Doorframes
  • Windowframes –> Windows
  • Windows –> Windowframes
  • Ladder –> Ladder (bottom)
  • Generators –> Cables

Group 4:

  • Foundations –> Foundations/Walls/Ceilings/Ramps (left/right)
  • Ceilings –> Walls/Ceilings (left/right)
  • Hatchframes –> Ladders
  • Pillars –> Pillars+ (adjacent left/right)
  • Elevator tracks –> Foundations/Pillars+/Generators (left)

Group 6:

  • Walls –> Walls/Ceilings/Catwalks
  • Fence foundations –> Foundations/Walls
  • Ladder –> Ladder (top)
  • Non-sloped water pipes –> Non-sloped water pipes
  • Sloped water pipes –> Non-sloped water pipes (bottom)
  • Non-sloped cables –> Non-sloped cables/generators

Group 8:

  • Fence foundations –> Walls
  • Sloped water pipes –> Sloped water pipes (top)

Group 14:

  • Walls –> Foundations/Walls

Group 16:

  • Pillars –> Pillars+ (top)
  • Ceilings <– Pillar+

Group 18:

  • Pillars –> Pillars+

Group 22:

  • Sloped water pipes –> Non-sloped water pipes (top)
  • Sloped water cables –> Non-sloped water cables (top)

Group 24:

  • Sloped water pipes –> Sloped water pipes (bottom)
  • Sloped water cables –> Sloped water cables (bottom)

Group 32:

  • Pillars –> Pillars+ (“PillarToCeilingBottom”)
  • Ceilings –> Pillars+

Group 128:

  • Elevator tracks –> Elevator platforms
  • Elevator platforms –> Elevator tracks

Group 512:

  • Pillars –> Pillars+

Group 1,026:

  • Elevator tracks –> Foundations/Pillars+/Generators (front/back)

Group 1,028:

  • Elevator tracks –> Foundations/Pillars+/Generators (right)

Group 8,192:

  • Elevator tracks –> Ceilings/Catwalks/Ramps/Pillars+

Group 9,218:

  • Elevator tracks –> Elevator tracks

Group 262,144:

  • Elevator tracks –> Pillars+

Group 2,097,152:

  • Gateway –> Gate
  • Gate –> Gateway

Group 4,194,304:

  • Pillars+ –> Ladders
  • Ladders –> Ladders (center?)

Group 8,388,608:

  • Gateway –> Fence foundation
  • Fence foundation –> Fence foundation

Thank you!!!

A bunch of stuff still does not make sense. Why do I get 3 snap points for 1 entry? How come I cannot seem to get point rot offset to do anything?

what exactly is to point snap type flags used for? I have put multiple things there with no change.
Snap point match group is the only thing I can seem to make any changes to that actually get it to snap to what i want it to, but still cannot get what I want when it has 3 points to snap to and changing the x,y, z effects all 3 of those points.

what are the differences for attach to point and attach from point

Dealing with elevator tracks here for reference.

Yeah, I’m still trying to figure it all out myself. I’ve just been going through all of the structures and keeping notes of what the flags are, in hopes that it would help make some sense of it all, and figured I’d share what I’ve found so far. I’ve actually had better luck working with the To Snap Point Type Flags than I have with the Snap Point Match Groups, but so far I’ve mostly been working with floors, ceilings, and the like.

As far as I can tell, Attach From Point will be the one used from an existing structure, while Attach To Point will be the one used for a new structure you are placing. So, for example, if you’re attaching a door to a doorframe, it would be taking an Attach To Point from the door and an Attach From Point from the doorframe.

Just off the top of my head (Dev Kit is closed at the moment), have you tried checking the elevator tracks and the elevator platform (or whatever other pair of structures you are working with)? It could be that one or the other has duplicated snap points with different orientations.

yes, these are copied over originals, and even the originals the rotation aspect of the snap point does not work.

every aspect of these elevators has been a royal pain. lol

This is one subject that could really use Dev input… :slight_smile: Drake?

thank you so much, bookmarked and subscribed to both :slight_smile:

God bless you for this list!!

I was playing around with this the other day, trying to get it so that ramps could be placed with multiple orientations. I eventually got it to work by checking an option on the ramp structure to allow it to be rotated; doing so made the snaps all orient correctly using the rot offset value, without letting them be freely rotated by the player.

Hey this is awsome, but still trying to make sense of how to use it. I created new prefabs and am using the in game item that has its BP as close to what I made to dup and edit.
Something that I noticed first off, is you do not have a “To Snap Point Type Flags” 14
this value is on quite a few objects.
The metal floor is the one I am looking at now.
Aslo I noticed all your numbers seem to be the double value of the previous. So I am not sure if this is for some mathematical reason in the code or something.

It appears only the ones that are named
Front
Back
Right
Left
With no other text added are the ones with a 14. All the other entrys like
Back Ladder Reverse, Right Ramp, ect…
Have the To Snap Point Type Flag values in your list.

Any idea on what this 14 is?
Thanks

OK I am going to give an example of a set of objects and their flags that is confusing the hell out of me based on the above referenced understanding of how these things work.

Metal Piping
ITEM…Structure Snap Type Flags…To Point Snap Type Flags…To Point Snap Type Exclude Flags…Match Group

Metal Straight Pipe…2048…6144…0…6
Metal Inclined Pipe…10240…6144…8192…6
…8192…0…24
…6144…8192…22
…8192…0…8
Metal Vertical Pipe…2048…6144…0…6
…6144…0…6
Metal Intake…4096…2048…0…6
Metal Reservoir…2048…0…0…6
…2048…0…6
Metal Tap…2048…0…0…6

OK so as you describe above If the structure you are placing is looking at the Structure Snap Type Flags of the other structure and comparing them to its own To Point Snap Type Flags then none of this stuff would snap together except the Intake which has a 2048 to snap. **** near all of these objects would snap to the structure with 6144 but that isn’t one of these objects (so what would it be?).

Plus each of these snap points has the ability to be a “to” or a “from” so the “To Point Snap Type Flag” seems wrongly named.

In my opinion it is essentially just a Snap Point Flag. This object has a snap at this position and rotation and it is numbered X. Another object with a snap point also numbered X would be able to connect to it IF the proper from or to option is checked. But then you have the reservoir which has no flag number (0) yet connects to all of the pipes and the intake. The only thing I can gather from this is that a zero might mean it can snap to anything in the match group? What breaks this is that it does not appear to snap to the Tap.

I am so confused at this system. It is really surprising that there is not SOME sort of documentation describing this. Or for that matter any of the many people who actually do understand it and use it in their mods not offering any help and leaving up to a huge guessing game.

The reality is very few people understand this system even remotely, the few that do have created their own system for the most part due to the lack of documentation and confusion with the examples we can see. The majority of people never have to worry about how it actually works because they are either simply reskinning the existing structures,or altering a single value. I plan to do a full write up once I finish my work involving snap points. But that may be a few weeks.

Got any bits you can share like the primary relationship?

How flags work - First, the individual flags. Each number 2^n is a flag because of how it’s represented in binary - 2, 4, 8, 16, 32, etc up to 536870912. In binary, the numbers start at 000000000000000000000000000010 (2) and go up to 100000000000000000000000000000 (536870912). This is the first list from the OP, it’s the list of 29 unique flags that structures can have checked as their types. Note: the last flag is always 0, this is why there are only odd numbers.

Structures can have any number of flags checked (i.e. they fit into multiple categories). This is done by simply adding the flags together - for example Fence Foundations fit into 3 categories, 16, 4194304, and 8388608. In total they add up to 12582928 which is a number representing all 3 flags. In binary, this number is 00000110000000000000000010000 - 3 flags checked. This is the second list from the OP.

The snap point match groups similarly use flags. If there is ANY flag match between the two groups it is considered a match, so for example a hypothetical match group 58 (2+56) would match with things from either group 56 or group 2; this would include an object marked as match group 10 (2+8) for example.

In the editor, snap points are marked as either to points (the object that already exists in the world), the from point (the object that you’re adding onto the existing structure), or both. If a single point is marked as to and from, it can only be used as one or the other, so it is often better to ‘overload’ them that way, but you need to ensure the offsets and rotations and such will align properly if it is both types of point.

When determining if it can make a snap connection, first it looks to see if there is a snap group match between the two structures. If there is a match, it checks the “to point snap type flags” from the structure marked as ‘attach to point’ and compares it against the “structure snap type flags” of the structure marked as ‘attach from point’ and looks for a match there. A match here is determined by ANY flag match, not all flag matches! So if you put 258 (2+256, two flags) for the ‘to point snap type flags’, it would match with any structure that matches either 2 or 256, or both. A 0 means it will snap to anything in its match group. If this is causing it to snap to something it shouldn’t, that is where the “to point snap type exclude flags” comes into play, which excludes only structures that match ALL the flags (so 258 would exclude just pillars, not foundations, spiked walls, or elevator tracks), and a 0 means nothing is excluded.

One thing I don’t know is if the flags actually have a tangible game effect, or if they are purely used in the snap matches. It’s possible that, say, changing walls to have the first flag (foundations) might cause them to actually DO something else.

So to directly answer your questions, 6114 as the “to point snap type flags” means it will connect with objects in either the 2048 or 4096 group, so anything related to irrigation basically. They are marked as ‘to’ and ‘from’ in a single point so that you can’t use that snap point twice, you can’t snap it onto an existing pipe and then use that same connection to make a new pipe from that same socket (you could go in the other direction but that’s another snap point). You cannot snap a reservoir onto a tap because taps only have a ‘from’ snap point (can only put them onto existing water structures). You can actually snap a tap onto/into a reservoir, but it doesn’t irrigate so it’s pointless (this would be fixed by making reservoir have only a single snap point that functions as to and from).

I have fought with snap points and I honestly don’t think they actually all work. I would t be suprised if there is stuff in there that isn’t even used. Either that or the system is so counter intuitive that it just appears to not work. I have added new items and new snap points. Usually with a bit of ******** around I can get it to work but basically all I do is look at the snap points and values are on a foundation If I’m doing a foundation dating style item and then alter the locations and rotations of the nodes. This process can take hours and even when they work as expected there is always glitchy half snaps with points that shouldn’t snap together. I don’t think they fully finished the snap system and just cobbled it together enough to get vanilla items to work and moved on.

My lighthouses for instance had the snap points built manually but I used the flags on foundations and walls to get the two to snap together at one point. Then the door the same thing. Copy wall to door flags and that worked.

The worst thing is if you have 2 snap points close together that are supposed to be totally different groups and it catches the wrong group first and easiest that your rotations and positions can appear wrong but in reality it’s just the wrong points grabbing each other. Like my dock stairs. Uses ramp points but the ramp points werect grabbing each other first causing stairs to build backwards to each other. The big thing is to type debugstructures and watch what points are stuck to each other and figure out what has gone on.

Ok, I have read as much on Snap points as my brain can handle… I am having an issue and I was hoping someone in here who has perhaps more experience could explain why I cannot get this to work. I have two sloped wall pieces, one is inverted and one is not. For the life of me I cannot get the inverted piece to snap to the non inverted piece in the place that I want it to. I have tried changing almost every aspect of the snap points in question but they do not function in what I would call a sensible manner. Is there some setting that will not look at snap points when they are too close together? If so where is that modified from?
I have attached 2 Images

The first shows the two pieces in proximity I would like the bottom snap pt to snap to the top on existing sloped wall and it just wont go, it always prefers to snap to the lower one, even though that one is already used. As Show in Image 2 I would like the two points circled in Red to Snap to each other. I have tried having all the points with the same snap settings as a regular wall with the pieces with Snap type flags of 4 , and I have tried having the Mid Slope points using to pt snap type of 8 and snap pt match group of 12 with Snap Type flag of 8 and they just ignore that match… Just when I think I understand snap pts I hit a situation like this and I’m stumped. Any Suggestions?

Something I’ve noticed with snap points is they like to snap to the closest point, and snapping things at a distance is difficult. You may not be close enough to that top snap point to actually snap to it.

I copied a tek doorframe/door over, renamed it, linked it up like i would any other structure, and the door just will not snap, even though they are both using vanilla settings. Can someone please help im so frustrated :confused:

Pekimo, I have discovered one thing for sure. If the Snap Point is Oriented Within 10 Units (x,y or z) of the Origin then sometimes (Not always) but sometimes it just will not see that snap point. So if The snap point you are trying to get to snap is in that range 0,0,0 to 10,10,10 or -10,-10,-10 Then try and move the snap point out a bit you may suddenly see it start to work.