Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
7.0 KiB

  1. # An interview with STB about stb_voxel_render.h
  2. **Q:**
  3. I suppose you really like Minecraft?
  4. **A:**
  5. Not really. I mean, I do own it and play it some, and
  6. I do watch YouTube videos of other people playing it
  7. once in a while, but I'm not saying it's that great.
  8. But I do love voxels. I've been playing with voxel rendering
  9. since the mid-late 90's when we were still doing software
  10. rendering and thinking maybe polygons weren't the answer.
  11. Once GPUs came along that kind of died off, at least until
  12. Minecraft brought it back to attention.
  13. **Q:**
  14. Do you expect people will make a lot of Minecraft clones
  15. with this?
  16. **A:**
  17. I hope not!
  18. For one thing, it's a terrible idea for the
  19. developer. Remember before Minecraft was on the Xbox 360,
  20. there were a ton of "indie" clones (some maybe making
  21. decent money even), but then the real Minecraft came out
  22. and just crushed them (as far as I know). It's just not
  23. something you really want to compete with.
  24. The reason I made this library is because I'd like
  25. to see more games with Minecraft's *art style*, not
  26. necessary its *gameplay*.
  27. I can understand the urge to clone the gameplay. When
  28. you have a world made of voxels/blocks, there are a
  29. few things that become incredibly easy to do that would
  30. otherwise be very hard (at least for an indie) to do in 3D.
  31. One thing is that procedural generation becomes much easier.
  32. Another is that destructible environments are easy. Another
  33. is that you have a world where your average user can build
  34. stuff that they find satisfactory.
  35. Minecraft is at a sort of local maximum, a sweet spot, where
  36. it leverages all of those easy-to-dos. And so I'm sure it's
  37. hard to look at the space of 'games using voxels' and move
  38. away from that local maximum, to give up some of that.
  39. But I think that's what people should do.
  40. **Q:**
  41. So what else can people do with stb_voxel_render?
  42. **A:**
  43. All of those benefits I mentioned above are still valid even
  44. if you stay away from the sweet spot. You can make a 3D roguelike
  45. without player-creation/destruction that uses procedural generation.
  46. You could make a shooter with pre-designed maps but destructible
  47. environments.
  48. And I'm sure there are other possible benefits to using voxels/blocks.
  49. Hopefully this will make it easier for people to explore the space.
  50. The library has a pretty wide range of features to allow
  51. people to come up with some distinctive looks. For example,
  52. the art style of Continue?9876543210 was one of the inspirations
  53. for trying to make the multitexturing capabilities flexible.
  54. I'm terrible at art, so this isn't really something I can
  55. come up with myself, but I tried to put in flexible
  56. technology that could be used multiple ways.
  57. One thing I did intentionally was try to make it possible to
  58. make nicer looking ground terrain, using the half-height
  59. slopes and "weird slopes". There are Minecraft mods with
  60. drivable cars and they just go up these blocky slopes and,
  61. like, what? So I wanted you to be able to make smoother
  62. terrain, either just for the look, or for vehicles etc.
  63. Also, you can spatially cross-fade between two ground textures for
  64. that classic bad dirt/grass transition that has shipped
  65. in plenty of professional games. Of course, you could
  66. just use a separate non-voxel ground renderer for all of
  67. this. But this way, you can seamlessly integrate everything
  68. else with it. E.g. in your authoring tool (or procedural
  69. generation) you can make smooth ground and then cut a
  70. sharp-edged hole in it for a building's basement or whatever.
  71. Another thing you can do is work at a very different scale.
  72. In Minecraft, a person is just under 2 blocks tall. In
  73. Ace of Spades, a person is just under 3 blocks tall. Why
  74. not 4 or 6? Well, partly because you just need a lot more
  75. voxels; if a meter is 2 voxels in Mineraft and 4 voxels in
  76. your game, and you draw the same number of voxels due to
  77. hardware limits, then your game has half the view distance
  78. of Minecraft. Since stb_voxel_render is designed to keep
  79. the meshes small and render efficiently, you can push the
  80. view distance out further than Minecraft--or use a similar
  81. view distance and a higher voxel resolution. You could also
  82. stop making infinite worlds and work at entirely different
  83. scales; where Minecraft is 1 voxel per meter, you could
  84. have 20 voxels per meter and make a small arena that's
  85. 50 meters wide and 5 meters tall.
  86. Back when the voxel game Voxatron was announced, the weekend
  87. after the trailer came out I wrote my own little GPU-accelerated
  88. version of the engine and thought that was pretty cool. I've
  89. been tempted many times to extract that and release it
  90. as a library, but
  91. I don't want to steal Voxatron's thunder so I've avoided
  92. it. You could use this engine to do the same kind of thing,
  93. although it won't be as efficient as an engine dedicated to
  94. that style of thing would be.
  95. **Q:**
  96. What one thing would you really like to see somebody do?
  97. **A:**
  98. Before Unity, 3D has seemed deeply problematic in the indie
  99. space. Software like GameMaker has tried to support 3D but
  100. it seems like little of note has been done with it.
  101. Minecraft has shown that people can build worlds with the
  102. Minecraft toolset far more easily than we've ever seen from those
  103. other tools. Obviously people have done great things with
  104. Unity, but those people are much closer to professional
  105. developers; typically they still need real 3D modelling
  106. and all of that stuff.
  107. So what I'd really like to see is someone build some kind
  108. of voxel-game-construction-set. Start with stb_voxel_render,
  109. maybe expose all the flexibility of stb_voxel_render (so
  110. people can do different things). Thrown in lua or something
  111. else for scripting, make some kind of editor that feels
  112. at least as good as Minecraft and Infinifactory, and see
  113. where that gets you.
  114. **Q:**
  115. Why'd you make this library?
  116. **A:**
  117. Mainly as a way of releasing this technology I've been working
  118. on since 2011 and seemed unlikely to ever ship myself. In 2011
  119. I was playing the voxel shooter Ace of Spades. One of the maps
  120. that we played on was a partial port of Broville (which is the
  121. first Minecraft map in stb_voxel_render release trailer). I'd
  122. made a bunch of procedural level generators for the game, and
  123. I started trying to make a city generator inspired by Broville.
  124. But I realized it would be a lot of work, and of very little
  125. value (most of my maps didn't get much play because people
  126. preferred to play on maps where they could charge straight
  127. at the enemies and shoot them as fast as possible). So I
  128. wrote my own voxel engine and started working on a procedural
  129. city game. But I got bogged down after I finally got the road
  130. generator working and never got anywhere with building
  131. generation or gameplay.
  132. stb_voxel_render is actually a complete rewrite from scratch,
  133. but it's based a lot on what I learned from that previous work.
  134. **Q:**
  135. About the release video... how long did that take to edit?
  136. **A:**
  137. About seven or eight hours. I had the first version done in
  138. maybe six or seven hours, but then I realized I'd left out
  139. one clip, and when I went back to add it I also gussied up
  140. a couple other moments in the video. But there was something
  141. basically identical to it that was done in around six.
  142. **Q:**
  143. Ok, that's it. Thanks, me.
  144. **A:**
  145. Thanks *me!*