background preloader

Doc

Facebook Twitter

Spherical worlds

Features - A Real-Time Procedural Universe, Part One: Generating. There have been quite a few articles, web sites, and books published in the past few years that talk about generating game worlds procedurally. As game worlds have become larger and more complex, it has become less practical for game designers to generate every detail by hand. Mathematical procedures of all sorts have been around for quite a while to generate different types of texture maps, terrain, and 3D objects. If you want an excellent example of procedural modeling and texturing in action, take a look at Terragen. For a good example of procedural textures being generated real-time in a game engine, check out the manual for the animated textures used in Unreal. If you've been interested in procedural texturing and modeling for even half the amount of time I have, you've probably read many of the same articles and web sites I've read.

You may have even bought a book or two and written some code. Planetary Bodies: Static vs. My First Attempt: The Plasma Algorithm. Features - A Real-Time Procedural Universe, Part Two: Rendering. In Part One of this series I explained how to use a function based on Perlin noise and fractal Brownian motion (fBm) to dynamically generate any point on a planetary body from a set of coordinates.

This article will focus on how to render those planetary bodies at real-time speeds using my own spherical version of the ROAMing (Real-time Optimally Adapting Mesh) terrain algorithm. For those of you who read Part One and downloaded the demo I provided, make sure you download the latest source code and Win32 executable files. I've made some significant performance improvements since then, and they are explained in this article.

There have been a number of articles published in the past few years on adaptive mesh algorithms, which are also called dynamic or continuous LOD (Level-Of-Detail) algorithms. Some good examples are "Real-Time Dynamic Level of Detail Terrain Rendering with ROAM" and "Continuous LOD Terrain Meshing Using Adaptive Quadtrees". The Traditional ROAM Algorithm. Features - A Real-Time Procedural Universe, Part Three: Matters. N Parts One and Two of this series, I explained how to dynamically generate and render planetary bodies at real-time speeds using a function based on fractal Brownian motion (fBm) paired with a spherical ROAM algorithm. This article will concentrate on how to scale that up to a star system or even an entire galaxy.

It will also discuss some of the problems you will run into with scale and frame of reference, and different ways to solve them. Problems of Scale: One Planet The main problem with trying to model and render a really large game world is precision. A 32-bit float has a maximum of 6 significant digits of accuracy, and a 64-bit double has a maximum of 15. Given the fact that the Earth's radius is close to 6,378 km, a 32-bit float isn't even enough to model and render one Earth-sized planet accurately.

When I first rendered my planet centered at the origin of my 3D map, I noticed two problems right away. Is it time to resort to doubles yet? Is it time to resort to doubles yet? Feature - "A Real-Time Procedural Universe, Part Four: Dynamic G. The following is a selected excerpt of Chapter 4 from Patterns in Game Design (ISBN 1-53450-354-8) published by Charles River Media, Inc. Game design patterns, either those in this book or patterns made by you or others, can be used in many different ways. This chapter illustrates a number of uses of patterns. Explicit methods or instructions are not included, because the methods would vary considerably between different game types, and no single method is best for all uses.

All methods for examining or creating games need to be modified for their specific context. There are several books and papers that more explicitly describe game design methods (see for example [Costikyan94], [Church99], [Falstein02], [Adams03], [Fullerton04]) that can be strengthened by using game design patterns but game design patterns are not limited to these methods. However, a common set of concepts, such as game design patterns, offers valuable support for making such modifications of methods. Play Testing. Generation of random buildings | Umbrarum Regnum: The Codex of E. Random world generation with fractal terrain. Programming for fun: Spiral Galaxy Hack. As a sidetrack from my sidetrack I've been reading about galaxy formation (among other things). Galaxies look like a drain swirling, but when you think about it that can't be how they move or else the arms would wind tighter and tighter until they disappeared.

Likewise they can't move like a pinwheel since that would require the outer tips to move much, much faster than the inner core, in direct opposition to how gravitational orbits work. On the Wikipedia page about density wave theory I found this diagram: The idea is that star orbits are elliptical but they are not oriented in all directions with equal probability. Instead, the orbit's direction correlates with its size. At this point I took the ball and ran my own direction with it, so abandon all hope of physical plausibility, ye who read below. If stars were influenced primarily by the massive black hole at the center of the galaxy, and not so much by their neighbors, then they'd follow roughly elliptical orbits.

Research : Rapidly-Exploring Random Trees (RRTs) Algorithm. A Bidirectional, Holonomic RRT Path Planner Algorithm Description The fundamental operation used in growing an RRT is the operation depicted in the animation below. Given a target configuration (randomly selected or not), a distance metric defined on the configuration space is used to calculate the node in the existing tree that is nearest to a target configuration . If the distance to the target configuration is less than the parameter (the RRT step size), then the algorithm attempts to grow a new branch connecting directly to . Otherwise, an intermediate node is generated at a distance of along the straight line between and . If the new branch is collision-free, then it is added to the tree. Planning queries are solved by incrementally building two Rapidly-Exploring Random Trees (RRTs) of free configurations rooted at the start and the goal.

When a new branch is successfully added to one of the trees, the branch terminal node becomes the target configuration for the other tree. Polygon map generation, part 3. In the previous blog posts (part 1 and part 2), I described generating random polygonal maps with elevation, moisture, biomes, and rivers. For some games, those maps are sufficient. However, in other games I want to hide the polygon structure.

In this blog post I'll describe how to render the polygons into a game map that doesn't look polygonal, and conclude with the demo and source code. The full article is here. There's also a demo and source code. Noisy Edges Recall from earlier that there are two graphs: one for Voronoi corners (1, 2 in the diagram below) and edges (blue lines), and one for polycon centers (A, B) and Delaunay edges (red lines) between them: I wanted to add some “noise” to the the straight lines. I realized that points A, 1, B, and 2 form a quadrilateral, and I could constrain the wanderings of the line segment to that quadrilateral: I further divided the quadrilateral into four quadrilaterals.

I can use any noisy line algorithm that fits within these constraints. Demo.