Jump to content

The arcane art of flag-planting


Recommended Posts

Something that's always bugged me is the fact that flags always end up pointing in a bizarre, seemingly arbitrary direction that seems almost completely unrelated to the direction the Kerbal was facing before planting the flag.

I remember there was a thread trying to figure out flag placement a while ago, but the only conclusion I remember that they reached was that the logic of flag placement was weird and confusing.

Anyways, my suggestion is simple: rework the arcane logic of flag placement so that the flag is pointing in the direction the Kerbal is facing when he (or she) plants the flag.

Link to comment
Share on other sites

I always thought it was kind of funny, and almost in the Kerbal fashion- I remember one of my proudest moments was captured with my first manned Munar lander, and everything was positioned perfectly except that the flag was backwards in the screenshot! It was hilarious XD

Link to comment
Share on other sites

I agree with Vaporo. Either make the flag planting work in a consistent manner (have the flag point away from the kerbal), or explain to us how the flag orientation logic works so that we can figure out how to get the result we want. Or...ad a Rotate Flag function.

Link to comment
Share on other sites

Well, I've done some testing of this and I have to say.. it's interesting.

On the launchpad, Bob would consistently place it roughly north or south facing(off a few degrees though), sorta regardless of what direction he's facing or the camera is facing. On the sloped corners though, he'd place it facing one of two directions, both of which were at right angles to the slope (ie, across it, not up or down it. Also again off a few degrees). Reloading and replanting seemed to suggest that camera angle or distance played a role.

I'd definitely like an explanation, or a change to something that makes sense...

Link to comment
Share on other sites

Well, I've done some testing of this and I have to say.. it's interesting.

On the launchpad, Bob would consistently place it roughly north or south facing(off a few degrees though), sorta regardless of what direction he's facing or the camera is facing. On the sloped corners though, he'd place it facing one of two directions, both of which were at right angles to the slope (ie, across it, not up or down it. Also again off a few degrees). Reloading and replanting seemed to suggest that camera angle or distance played a role.

I'd definitely like an explanation, or a change to something that makes sense...

Maybe behaviour on the launch pad has to do with it being tilted a bit?

Link to comment
Share on other sites

Maybe behaviour on the launch pad has to do with it being tilted a bit?

Actually that's a good point - it's not perfectly level, but does tilt towards the west slightly (or more precisely, all of KSC is flat, but Kerbin is a (lumpy) sphere, so the edges are effectively tilted). So the north/south alignment on the pad does make sense. I'm off to do more tests on the runway next to the SPH, which should then be east/west flags since that should be slightly south-tilted effectively..

In case anybody is wondering what we're talking about, I made a diagram to explain this a ways back:

BTSM-Launchpad.png

Link to comment
Share on other sites

Did some testing - around the SPH, the flags did indeed orient themselves east-west. Northwest of the VAB (near the flagpole), where it's presumably sloped northwest/southeast, the flags were again at right angles to that slope (northeast or southwest).... testing on the Mun also confirms a similar affair.

Link to comment
Share on other sites

Yeah, the game computes a multidimensional array whenever you plant a flag to find the best possible orientation to ruin your screenshot. :P

This needs to be worked out. Just put the thing in front of your Kerbal and that's that.

"Why's it placed like that?" Amelia Kerman asked.

"Like what?" The Scientist replied.

Amelia: "You've got a flag placed in a very ugly way."

The Scientist: "Well it's not really a flagpole, which, by the way, is a special type of flag that Kerbanauts used to use."

Amelia turned around, still in shock. "There's a beacon on top, do you need to replace the radio??"

The Scientist: "Amelia, stop, breath."

Amelia took a breath. Photosynthesis turning her thoughts to the sun.

Amelia: "Why doesn't the flag get bleached by the sun? It's made of paper. You've got a paper space ship-- do you feel stupid?"

The Scientist: "What?"

Amelia: "Sorry back on the goggles."

The Scientist: "it's camouflage. It's disguised as an Extend-o-matic Flagpole from 1963. Every time the Spacey-Wacey-Wibbly-Wobbly-Ship is placed in a new location, within the first NANOFRAMESECOND of placing it analyzes its surroundings calculates a 12-dimensional data map of everything within a 2.5km radius and determines which placement orientation would look most aesthetic within the environment."

Amelia chuckled a bit.

The scientist: "And then it disguises itself as a wonky-placed flagpole from 1963."

Amelia: "Oh, why?"

The Scientist: "It's actually a bit of a fault actually, I've been meaning to check."

Amelia: "What, it's a bad sun-unlit orientation every time?"

The Scientist: "Well, yeah, I suppose now that you mention."

Amelia: "Well, how long's it been doing that?"

The Scientist: "Oh not long. Only since 0.20."

Link to comment
Share on other sites

To illustrate my findings, the stock flag code seems to like to place flags at right angles to the current terrain slope (I guess it's to prevent the flag from clipping into terrain on really steep slopes? not sure why though, as it would be impossible to stand on such a slope to begin with~)

Stock-FlagSlope.png

The flag will orient itself along the line defined by the green arrows. The slope goes up/down along the line defined by the red arrow (in case the 'piece of cheese' thing wasn't clear enough).

ALL BOW BEFORE MY TERRIFYING* MSPAINT SKILLS, AND DESPAIR!

(* - this is my special way of saying 'terrible' btw)

A long time ago, I wrote a mod (that never made it to the release forum) that does this. Maltesh asked me to release it so I dusted it off, fixed some old bugs and here it is :)

http://i.imgur.com/8LKvwt7.png

Sweet, and thanks!

Link to comment
Share on other sites

I was a pretty big part of that original thread and I did a lot of testing.

If you do the *exact* same thing, the flag will point in the exact same way. However if you do anything different the flag will point a different way. Even just picking up the flag and replanting counts as doing something different.

EDIT: Sweet mod!

Link to comment
Share on other sites

So I delved in and figured out the arcane magic which drives the flag placement system.

Here's what happens, in simplified, comical form:

  • The kerbal looks at the ground in front of him, taking note of how steep the ground is in that direction. Kerbal flag placing guidelines mandate that in order to prevent injury, flags may only be placed on ground the same height as that on which they are standing.
  • The kerbal looks exactly 40 degrees to the left, taking note again of the ground height. Kerbal flag placing guidelines are very specific about this. Failure to do so may result in spontaneous combustion and/or death.
  • The kerbal repeats the last step another 8 times, in order to properly survey his surroundings (it is not explained how said kerbal is able to do so without actually turning all the way around, though our leading theorists on the topic believe their large helmet secretly disguises a number of rear mounted cameras at 40 degree intervals)
  • The kerbal then looks over his notes, and chooses which of the 9 directions he surveyed based on how flat the ground is in that direction.
  • The kerbal turns towards that direction, and places the flag, ensuring that the extension of the flag is away from him. Kerbal flag placing guidelines mandate that flags only be allowed to extend when pointing away from helmets, to prevent injury from being knocked in the head.

Note that the 40 degree intervals will sometimes result in the kerbal choosing a point which you may not think is the closest counterclockwise-turn point, as it is possible that it will sample a direction which is slightly high, slightly low, and then continue on and sample a closer to flat direction about 180 degrees from there. This is likely what causes the seemingly random behavior of placement. It is also worth noting that this is also why the flag placement is always off by a few degrees from being perfectly perpendicular to the slope.

Edited by Xaiier
Link to comment
Share on other sites

Hehe cute :)

Was that from the actual code itself, btw? I'm surprised it's so involved (but it does explain my observations). O.o

Yes. What surprised me is that it is such a complex system in there to try and avoid clipping into the terrain and probably also to help with the animation. It's arbitrarily random and rather annoying if you want to place a flag in a particular direction, as even with my explanation you still can't really control which way it goes.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...