Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

603 Good

About nukomod

  • Rank

Personal Information

  • Industry Role
  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I've being progressing a few random things. Generators That Don't Make Models First up I added a JSON visualiser so I can browse the output of generators that don't create 3D models. There will be plenty of these kicking about. I'm using JSONViewer by Roman Makudera to do this for now. In the future I may roll my own version though that can have knowledge about unit types. For example, in the image above "age" is in years, and the height values would be in metres. That kind of information is lost with the current viewer. Height Map I've also started playing with generating a height map. I'm not planning on doing any terrain work with height maps but I just wanted to see how easy it was to do in ThreeJS. Below is a totally random terrain with random vertex colouring. It was quite straight forward to setup - nice one ThreeJS Voxels I want to build my actual terrain using voxels so I can get more realistic results. It's a lot more complicated but it'll be worth it. Above is simply a cube space filled randomly with voxels. I'm not doing anything clever in the rendering yet for generating the mesh. Each voxel is it's own ThreeJS cube. Ultimately the terrain is going to be more like no mans sky than minecraft - that is it's represented with voxel data but the mesh generation won't render it all with just cubes. Next I'm going to continue playing with the terrain generation using voxels, so I'll likely implemented some 3D noise generators. I have a bunch of terrain generation articles bookmarked from over the years so it'll be loads of fun to finally play with making some of my own
  2. nukomod

    Debug Text

    Having decent tools to debug the generators is crucial. One of the tools I always like to have is lots of debug rendering features. Putting debug text in the world is a big part of that, so I need ThreeJS to do that for me. ThreeJS has some nice stuff built in but I don't want to add dependencies on font files. My typical workflow right now is loading my generator test bed HTML file from explorer straight into Chrome. Chrome isn't a big fan of loading stuff like fonts from local file storage unless you load chrome with a particular command line argument which is not suited to how I'm working. So to keep it simple no fonts please. So I decided to just make a simple 'font' defined as line segments and put together a helper to add debug text to the world using ThreeJS LineSegments geometry. And I kinda like the way it looks Bonus: Note that the £ is missing here. That's because of an awkward HTML character encoding issue. I need to tell Chrome about the encoding of my JS files. I'll get around to that soon!
  3. This video is showing early work on my procedural generation test bed. Everything is in javascript using ThreeJS and ThreeCSG. 0:00 - Starts with a cube generator and overriding its input parameters to change it's size. 0:12 - Showing a geometry subtraction test. This uses ThreeCSG. 0:20 - A tiled floor generator. 0:27 - A 'modular' room generator. These would be simple rooms that are made from a standard tile shape - think board games. 0:39 - A stone wall generator that follows a path to build the wall. I'll try to record progress with these every so often. It's always fun seeing how things progress
  4. I've shifted the project from C++ to JavaScript during this prototyping phase. I've done this for a few reasons: This makes the project incredibly portable, allowing me to work on it on different devices easily. Prototyping in JavaScript is easy. Threejs is cool and easy to use. I'm a C++ coder at heart and my ultimate goal is for this to be a C++ project. Pragmatically it hasn't been working for me using C++ for my home projects for the last few years. I find myself needing to upgrade projects and libraries, worry about build processes, ensure Visual Studio is installed on the device etc. Now I can now edit generation scripts almost anywhere, anytime, event on my smart phone. Those little moments of downtime can be much more productive I'll take the project to C++ once it has matured - though it will continue to support JavaScript generation scripts so hopefully with a little work I won't have to throw anything away.
  5. A good while ago I stumbled across this video on youtube about a theory that the earth grew in size and the tectonic plates 'float' on top of this expanding sphere. [media][/media] Now despite this being somewhat scientifically questionable it did get me thinking that it might be fun to model a procedurally generated world using this technique. Typical procedural generation techniques using perlin noise or similar often lead to quite random looking continents: (Apologies if these are your images and you don't like me referencing them!) This approach can get good results, but it's easy to just get noisy terrains. Leveraging the 'expanding' earth idea I'm going to build a model for fun where a verlet cloth sits on an expanding sphere. The cloth will become the terrain of the planet and I'll see if I can get it to 'rip' in nice ways as the sphere expands. One approach I'll try is to randomly assign each of the points on the cloth parameters such as mass or friction, and randomly assign the strength the links have to adjacent points. When the stress on the links reaches a critical point they can 'rip' free. The remaining cloth can be considered land and the rest sea. Another approach could be to 'inject' cloth into the stress points as the sphere grows, and allow the cloth to exist with a height on top of the sphere, allowing wrinkles as material builds up. Then a sea level can be chosen and the coast lines would be a result of that. I think it's an interesting idea, I'll post pictures of any results I may come up with. If nothing else perhaps it will give others a new idea to play with too
  6. nukomod

    Argh, bitrot.

    It's twisted enjoying another mans debugging pain but I admit I did! I guess I love a good mystery, but it's even better when it gets solved. Please let us know how the next debugging session goes!
  7. nukomod

    Brain dump: considerations for organizing code

    Have you seen code bubbles? http://www.andrewbragdon.com/codebubbles_site.asp I think their approach may be of interest to you.
  8. nukomod

    Big Procedural Game Dev

    Pictures marking the development of my 'Big Procedural Game' :)
  9. This time I'm giving an update on the status of the code itself. It's still early days but at the moment I've been working on mesh generation helper code. The first mesh generation function I have working is for geodesic spheres, a cool piece of geometry! It's built from an icosahedron as the base which then has each triangle tessellated to the level of required detail. Each new vertex is then projected back on to the surface of the sphere to complete the job. I'm not generating UV coordinates yet, just normals. There are lots of uses for these guys and they have the cool property of evenly distributing surface area across the faces. [sharedmedia=gallery:images:5534] The process of creating and rendering this mesh is proving out the renderer and scenegraph behind the scenes which is cool. It's also using my framework for generating and storing meshes. I want this process to be asynchronous in the near future. I'll go into more detail on future posts, but I don't think it's anything particularly new or exciting.
  10. nukomod

    Dynamic Narrative in The Hit

    Great overview. I'm working on something similar myself buy you've clearly taken it further. I hope you'll write more articles in the future showing some more the technical details. Hope all goes well with your project!
  11. Scripting languages can be a can of worms. I want to make sure I open that can for the right reasons! I want the code that does any heavy lifting of the generation to be in C++ for performance reasons (and debugging!). I also want the generation steps of objects to have rapid iteration in a forgiving environment, as in without hitting asserts or crashes. My game framework allows this to potentially be in C++ as it supports reloading DLLs on the fly so generation logic could be in DLLs, but it's not what I'd call 'rapid' iteration. Other approaches are runtime CPP compilation, JIT (C#) or byte code scripting language. I'm going to try to not tie myself down to one particular approach if I can help it. Easier said than done though. I'll probably start with a simple game targeted scripting language such as GameMonkey or Angel Script. Also aside from scripting the generation having a scripting language hooked up to your engine makes auto testing easier. Having good tests is going to be a life saver in the long run. I'll put down some sketches of how I imagine the generation process for objects will work and how scripting will help in the near future, with some examples.
  12. To make a universe more than just a static diorama things have to change. Time should have an effect, so planets spin and the sun can rise, but more importantly the players actions should have an effect. If the player gets their hands on a planet destroying super weapon it would be very unsatisfying if they destroy a world to find it magically reappear when they reload, or even just visit the next solar system and come back. These changes need to be saved permanently to the players save data. I'm planning for save data to be like a patch that is applied over the top of the procedurally generated data. So if you kill someone when it comes to generate their info when it's finished it will stamp 'dead' over the top of their status. It will maybe go on to generate different things off the back of this, maybe give them a grave or something. A planet will be patched with 'exploded' and perhaps an asteroid field will get generated. This approach will require that the generation algorithms be exactly the same as when the patch data was created. So save games will not survive updates to the game that change these. They will need to be bound to a release version and people should complete their adventures before upgrading, if they want. Not sure if there's an elegant way around that.
  13. Having a big universe to play in is going to require some thought into how to locate things. The Milky Way is 120kly (ish) according to Wikipedia. That's kilo-light years. That sounds big! Ok lets say I want to positiom things with millimetre accuracy. A light year is 9.4605284 x 10^18 millimetres (thanks Google!) So the milky way is approx 1.13526341 x 10^24 millimetres across. 1135263410000000000000000 mm. How many bytes are needed to store a number that big? My calculations put this at 10 bytes. That's a nice chunky number. If we want multiple galaxies or more accuracy we need more bytes too. I'd probably round this up to a lovely 12 bytes. So I have a super number which can store galaxies to mm precision, except its too big to fit in CPU registers and so all math is horribly complicated and slow. No thanks! For a game to have a chance of managing this I need to keep the coordinates in a useful form. There are a few solutions to this problem and I'll outline the one I'm going to try first. I'm going to keep rendering and physics working in lovely floating point numbers. The main reason is that everything is simple when using these, though they lose accuracy pretty quickly. To deal with this I'm going to have reference points evenly distributed across the universe, creating a classic nested coordinate system. All floating point numbers will be local to one of these reference points. These reference points will have a volume of space defined around them so they overlap the next reference point by 50%. When you move far enough from your ref point the game will switch which point you're anchored too. I need to be careful that these switches dont introduce too much error or performance penalty. An objects coordinates will be split into a local space floating point position and a reference point ID. The reference points may also need to be put within a nested coordinate space to get extra space, and that can be repeated as many times as necessary. I'm considering only allowing interactions between objects living in the same reference point, as it will simplify things. We'll see how that plays out. Finally from a gameplay point of view I'm planning to allow the scale of the generated universe be controllable. I doubt very much that a real size scale for most things will be the default setting. I don't want people dying of old age travelling. I'll aim to reduce how much boring space there is between interesting things without breaking the illusion. This applies to many things, not just the distance between planets. The distance between cities or continents or any feature of interest. Sure people can have 1:1 if they want though! I suspect that space travel will still need FTL drives, stasis pods or wormholes to get around and not die of boredom!
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!