Monday, September 16, 2013

Elastic Fill tool

I did a new tool that opens some new interesting possibilities. It allows you to quickly fill a gap. You need to point to two opposing faces. The start and end faces could be almost anywhere in your building, and they could be pointing at different angles. Even if the start and end faces are aligned with the grid, the connection between these two goes off-grid very often. Also note ramps are one special case of this.

The new tool allowed me to build this cabin, which has a lot of odd angles:








When approaching a new tool design my main concern is to make it simple and fun to use. Voxels are very flexible and very often I feel tempted to add new tools just because I see what they could do. The real problem  is how to find a suitable UI. In this particular case it turned out quite simple to use so this one is a keeper.

This is how it works: You point to the start place, hold a key down, and then point to the end place. You see some sort of elastic box showing you where the voxels will appear. Once you release the key, the program will fill the space you have highlighted.

The elastic box changes color depending on how aligned is the box with the absolute grid. If you get perfect alignment is shows in white. If you get alignment over one plane, it shows green. If there is no alignment it shows yellow. As a novice builder you can ignore these changes of color, but they help a lot if you are ready to take notice.



Here is a time-lapse video showing how the entire structure was built. Only three different tools were used here: add/remove voxels, fill and smooth.


Don't ask me why the compression in the video is so bad. YouTube does not like me anymore. I have spent many hours trying many different settings, codecs, anything short of voodoo.

26 comments:

  1. Looks great as usual!

    Would you consider another tool that will join two locations with the point in front of you? ie turn a L shaped structure into a rectangle.

    ReplyDelete
  2. The control scheme sounds good enough, but I would suggest you change it to the following for all tools in fact:
    Numbers 1-9 used to switch 'tools' (Because you don't have a clickable GUI).
    Eg number 2 switches to the Elastic Fill Tool.
    Now the player is freed up of having to both know the magical key to hold down and the need to hold it down in the first place.

    I would then utilize key-holding of common keys (Shift, Ctrl, Alt) for tool modifiers within each tool. For example the Elastic Fill Tool would benefit from being able to hold down a key to enable a point-in-space selection rather than auto-snapping to the pointed-to solid voxel. That way the player will be able to make point-to-point structures without first having to build a framework to snap the points to.

    ReplyDelete
  3. Two things:
    1.) Every video and image of the game/engine I see, I want to play with it more!!! Can't we have atleast a demo or something? XD.

    2.) You mentioned a long while ago about LOD for complex structures like buildings, does this work on your cabin? If so, could you show us that cabin from close range in several LOD states, and then an image of the cabin at the actual distances those LOD states would be at? (Doesn't necessarily have to be a cabin, any user-generated content which shows it nicely would be appreciated =P)

    Then a bonus 3rd thing: This is awesome!

    ReplyDelete
    Replies
    1. In the video there are several LOD changes. I will cover the LOD topic in the following months.

      Delete
    2. Okay, didn't notice =P (Which is a good thing in LOD!) Looking forward to it!

      Delete
  4. Perhaps upload to Vimeo as well? Post the vimeo video here so it's nice and high quality, but you could still upload to youtube so you don't lose any subscribers attention :)

    ReplyDelete
  5. Looks great! I'm also a developer working on a voxel editor (for the Xbox360), and it's very interesting to see how we came up with similar solutions independently, although your voxel engine is slightly different to the usual ones, with your non-axis aligned faces.

    As for YouTube pre-upload encoding, I'm using the Linux 'mencoder' command line with these parameters : -ovc x264 -x264encopts bitrate=12000:threads=auto -oac mp3lame. It's not perfect, but already very good.

    Good luck, bye

    ReplyDelete
  6. This looks very simple and easy to use - great job Miguel. Can I echo the comment above from Kamica - the more I see of your engine, the more I want to get stuck in and start terraforming virtual worlds!

    One question (I don't know if you've touched on this in the past with regard to brushes etc) Do you have plans such that people can export entire structures/buildings, with various textures, so others can import them and place them where they like in their own worlds? This would be a great way of sharing custom content. Although I imagine it could be tricky specifying the voxel boundaries of the complete structure for export.

    ReplyDelete
  7. I noticed there were a few times when you had to retry the operation, is this user error or something that still needs to be fixed/optimized with the tool?

    ReplyDelete
  8. I notice in the video that when you delete a procedurally-generated voxel from the ground, you still have the problem of the nearby grasses moving to different positions.

    Is this issue curable? It seems odd to have the undergrowth dance about whilst digging the ground.

    ReplyDelete
    Replies
    1. Maybe generate the undergrowth with a pseudorandom seeded by the coordinates instead of a continuous random generator. When the grass updates, it still follows the same rules for where it can and can't go (disappears from where you dig out the earth from under it) but still picks the same positions for where each piece should try to place itself.

      Delete
    2. Yes, what @TTFractal said. The undergrowth re-pop at each edit would be fixed if that growth's placement was deterministic so even if it was replacing it each time, at least the grass tufts and flowers land back in the same position each time.

      This was pretty disconcerting at times during the video.

      Delete
    3. Yes, what @TTFractal said. The undergrowth re-pop at each edit would be fixed if that growth's placement was deterministic so even if it was replacing it each time, at least the grass tufts and flowers land back in the same position each time.

      This was pretty disconcerting at times during the video.

      Delete
    4. Yes this is workable, I know it looks odd, but not too worried about that right now.

      Delete
  9. It's way too awesome! :) I'm looking forward to play it someday. When I just imagine this shelter with some lights, stars in the sky, the sound of cicadas and birds, some water nearby... aaahh ^.^

    Miguel, I really like your work and maybe later (because I'm young) I would like to make some donation for you :)

    ReplyDelete
  10. I found the tool to be quite cool, but I have just a comment on the recording itself: The video appears to be massively sped up. I understand this is just to make it the video shorter while still showing the same content, but this made the video very jerky and my eyes had trouble following along when the orientation kept changing so rapidly (quick 180 degree turns, going from on top of the building and looking down to the bottom and looking up in a just a few frames, etc.). If you could try to minimize this jerkiness in the future that would be great.

    Thanks.

    ReplyDelete
  11. Hi Miguel,
    Nice update! The tool seems to work very well.
    Being a professional CAD user, may I suggest an alternative mode for this tool (right clocking or similar). Instead of creating a linear volume that goes from surface A to surface B, It would be useful to create a volume that would follow a spline going perpendicular from surface A to a perpendicular on surface B.
    If you try to connect two horizontal surfaces positioned next to each other on the same elevation, then the current tool would fail by generating a zero thickness volume. Right-clocking to change mode into the suggested mode would result in an arch being created, with the two input surfaces as bottom ends.
    The required math would be a bit more complex than the current math, but I have faith in your abilities, and I believe that it would be a powerful tool for creating more organic shapes.

    ReplyDelete
    Replies
    1. Ooh, arches, sounds cool =D.
      If it's not too much trouble for you Miguel =P.

      Delete
  12. There you go, in one fell swoop, boosting the capabilities of what we can do with the engine... shame on you sir! ;)

    I particularly liked the off axis angles you added to the simple vertical posts making them appear wider on the bottom, definitely had me thinking "flying buttress for the win!" Easy Ramps, and even Easy Stairs... at one point it had me thinking of Frank Lloyd Wright.

    Well done.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. Now that you have the bounding box display worked out (it is awesome, BTW), I think you may want to try enabling it for regular placement as well.

      The red highlight is ok, but displaying the bounding area for what will be placed, even when not spanning faces, would help precision placement during content creation.

      I definitely don't want it doing that while just walking around a world (so editing should probably be another mode or something). For that matter, I really don't want the red highlight when I'm just exploring either, but during editing/placement mode it would be very helpful.

      I think it's needed because you can have many differently shaped, brushes.

      @16:00 you can see what I mean, placing 1 wide, 2 tall short walls when spanning a gap -- with the wire-frame you know exactly what you'll get when you place it -- But during this process you also placed a couple of free posts to use as anchor points... for those you could only intuit the result from the red highlight, rather than the clarity the fill tool wire-frame was just a moment ago providing.

      I'm seeing that, when you aren't filling and just placing, you could use the brush's current dimensions, pipe that in as a "Green" perpendicularly aligned wire-frame of the brush's size starting at the red highlight, just like the fill does... but with a fixed end anchor.

      I REALLY feel this would provide much better consistency and accuracy during building/edits! I don't think you'll regret it, if you go this route, or something similar.

      Anyway love this, and liked all the other touches you showed off too; rounding the turf roof, smoothing artifact faces and ramp edges. Great stuff.

      Delete
  13. This is a huge addition.
    I bet slanted walls used to be a real pain using only smoothing.
    It's tools like these that really seperate the project from Minecraft.
    I'm thinking the next step would be to allow the user to smooth just the beam he's created, to turn it into a "rod".
    Unfortunately I can't think of a good way to allow the user to reselect previous beams for smoothing. Hopefully you can!

    ReplyDelete
    Replies
    1. I'd reckon if you want to smooth the elastic tool into a cylinder, you'd do it at creation, if you want to add another tool for it, basically have a modifier for the existing tool which instead of having parallel squares, gives circles.

      One thing though, the more Miguel works on fancy tools, the less time he has to work on the other interesting features, like new procedurally generated content! =P (I'm still waiting anxiously for procedurally generated cities =P)

      Delete
    2. Hi David, I'm pretty sure the smoothing tool would do that now. As Kamica said, you'd do it during creation. The smoothing tool looks to be additive so if you just kept spamming it on a square pillar I think you'd get to a round one. It also seems to adhere to the size of the brush, so it's pretty fine tunable.

      Also, we know that Miguel can do round pillars via a brush, so I don't think we need to worry much, there will be round pillars both in procedural content and in our user created content, yay! :)

      I agree with Kamica, I also can't wait till Miguel is able to put his formidable resources back into cities.

      But I do think the recent efforts that add tools like this is very critical... this kind of toolset drastically impacts the usability of the Engine and will pay off later in adoption and user content. One of the reasons I want to see user edits be able to be precise, because a non-frustrated content creator is a prolific content creator :)

      Delete
  14. Still waiting for you to tell me if you are going to lisc this again. I am an indie developer and we have had issues trying to get DC working. I would be willing to pay for the engine so we could what we are missing just need a price tag!

    ReplyDelete
  15. Hi Miguel - I had similar problems with Youtube compression (it may be because of the timelapse/fast camera jumps that prevents good temporal compression). I went with Vimeo ($10/month for pro, I think $100/mo if you get a lot of traffic - they used to have restrictions on video game footage, but as long as you are the developer they won't shut you down). You can see a sample of vimeo's quality here (this was a 1gb video if I remember correctly): https://vimeo.com/74247230

    Anyway, everything looks good as usual!

    ReplyDelete