Painting with Pins: Creating the Surveyor’s Map

Welcome back to another year with the Starry Expanse Project!

The period between late December through early January is traditionally a time for taking stock of our progress, critically examining our pipeline, and spending a little time developing R&D prototypes to prepare for the year ahead.  We’d like to share one of these with you today.

You might recognise it, despite the gaudy colour scheme (which is for clarity during testing). It’s our prototype version of the famous Survey Island pin table.  A visually striking puzzle element in the original game, the pin table consists of thousands of tiny pins that move up and down to form the contours of each island.

Our version is a little more dynamic as we can pan, scale, and rotate a height map image to get any shape we need. You can see a bit more of how it works behind the scenes in this video.

We’re happy with the visual results of our pin table, but all those pins do come with a non-trivial cost to performance (and our test map is less than half the resolution of the one in the original). Our prototypes are not always successful, and sometimes ideas don’t work out. It’s why we do these small, isolated tests in the first place!

We have a few other ideas for how this effect could be achieved, and we’ll be having a go at those sometime in the near future.

We’d like to welcome our newest team member, Tom Owen – a multi-talented programmer who is passionate about virtual reality. Good to have you with us, Tom!


9 Responses to “Painting with Pins: Creating the Surveyor’s Map”.

Team members' usernames are in red.
  • Aloys Says:

    Hmm, I had never tought about that one,
    A shader with displacement and self shadowing is quite heavy but there’s not much that can be optimized here. (maybe remove the self shadowing?) Then again, I suppose it beats having 2500 individual objects that you move around..

    But have you thought about going the old fashionned Riven way and having actual pre-rendered transparent videos that you would display in world space?..
    I haven’t thought this through but it might work because the point of view would be fixed here. Given that the player cannot move around the map, and you could only enable the video when the player is standing in that precise spot and disable it as soon as he/she moves away.

  • Phil Says:

    Oh wow, I completely forgot about this part of the game. Looks complex, I don’t envy you working on this!

  • Illuminerdi Says:

    Let’s start with some math so I can get my head around this problem:

    The “pin board” is 20x20x5x5, so a single section of the pin map is 10,000 pins. The sqrt of 10,000 is 100.

    FIrst up: if your current method involves a single heightmap for each island, that is potentially very inefficient because it means up to 96% of a given heightmap is not rendered at any one time. So the engine and/or GPU has to calculate and cull at least 50% and at most 96% of the heightmap.

    That’s potentially a LOT of wasted render operations, multiplied exponentially depending on the difference between your heightmap resolution and your worldspace.

    So if you haven’t already done so already, the first thing to do would be to subdivide the island heightmaps into individual chunks 100px x 100px. If that’s a lot of work (I don’t know how difficult generating the island heightmaps is for your team), then skip it for now and just make a test 100 x 100px heightmap to use as a performance test, then smoke test how efficient then engine is at scaling a heightmap that isn’t 1:1 to worldspace.

    Also – have you done smoke tests without using heightmaps at all? If your pin map is 10,000 individual rendered “pins” and each pin is a flat rectangle, that’s 20,000 tris per render pass times the number of visible sides. Since a 6 sided rectangular object in 3d space couldn’t have more than 3 faces rendered at once, your minimum render count is 20,000 tris and your maximum render count is 60,000 tris onscreen, but your maximum calculated tris is 120,000. That’s a decent amount of rendering for a modern GPU, assuming the engine isn’t wasting a ton of time calculating stuff for culled faces.

    If you haven’t already done so, cut the bottom face off each pin. That’ll save you 1/5 of your tri count since those faces will never be visible, and cutting them off entirely means the engine doesn’t have to bother even culling them. Next make sure your pin geometry is as simple as possible, since any increase in the pin geometry means you’re exponentially increasing the render complexity of the scene by the number of additional tris added to the face of each pin. Even a simple chamfer on the edges would double your polycount!

    I hope this helps!

    tl;dr: Check that heightmap isn’t being unnecessarily scaled by the engine, and check that you have sane polycounts on the pin map since there’s 10,000 pins and a mathematical minimum of 10 triangles per pin before culling.

    • Aloys Says:

      If we go with polygons, I’m pretty sure the limiting factor isn’t the polycount; it’s the draw calls. For an average GPU having 10K+ draw calls seems to be quite a lot…

      DirectX 12 and consoles might have an advantage here, but for PC GPUs older than 5 years that won’t work.

  • Mark Says:

    You’ve probably thought of this…
    If you took your height map, and didn’t animate the strength of it, but move it vertically through a plane. That would give the look of the original, with the higher points pushing through progressively to the lowest points.
    You could then render off the animation of the z-depth from above, to generate an animated height map.
    The new animated height map could then be used instead.

    • Robert Says:

      Yeah, you’ll likely need to set some kind of a floor limit to get that “object pushing through a plate of pins” effect as right now it’s more a gradual effect. I don’t know UE4, but I guess this is done employing an animated mask with levels applied to the height map to step out the animation layers.

      As a prototype or “proof of concept” it gets the job done. However, I’m excited about seeing phase 2 where they work to tweak the heightmap animation to perform more like the original.

  • Vincent Krebs Says:

    Interesting, doesn’t look hard to reproduce, from a total ignorant’s point of view =)

  • Averagemoe Says:

    What if you modeled out each of the height maps as a single object, (one for each square, not the whole thing) and have that rise through the flat table?

  • catalina Says:

    just push a model up from a flat one. no one will know

Leave a Reply