Day and Night Cycle over Palan

Really not a lot to say about this. This is what I’ve been doing over the past three days.

This scene is build with the Terrain3D plugin for large outdoor maps, the Sky3D plugin for the sky colors, clouds, sun, and moon, and the Cogito template to move around it as a player.

The rings and the space station cube are all mine. The geometrically correct shadow on the ring at midnight is particularly cool.

The only thing that’s not yet quite perfect about it is that the clouds appear behind the rings. Which is something I have not figured out how to set in the sky shader, but since the moon is behind the clouds where it’s supposed to be, I expect this to be relatively easy once I have some understanding of shader code.

Here comes the Sun!

I noticed some weird shadow colorations on the ceiling of my Oligarch Palace elements when importing them into Godot. And on my search to fix it and make the shadows at the top of vaults look more natural, I discovered the Global Illumination feature.

A difference like Day and Night!

This obviously looks nothing like the way 3D games were lit in 1999, or even in 2003. This took me four clicks and is much more advanced than anything that they had back then.

But one of the very first decisions that I made when I had the idea to make a game two and a half years ago was that I want it to have retro-styled models and textures but with nice modern lighting and shadows. So this is still entirely according to plan.

This might actually be a bit too realistic though. But I think once I really get into the entire lighting thing, adjusting the settings to make things less realistic probably shouldn’t that much of an obstacle.

“And he looked upon all that he had made, and he saw that it was good.”

Another big day for Iridium Moons.

I have finally fixed all the little issues I had with making buildings in Blender that can be directly imported into Godot and requiring very little final touches. And the results look amazing. With the procedures I am using, I can now very easily make buildings in this style of whatever dimensions I want, with multiple floors, and doors and windows I can move around as I wish in a few minutes. All that’s left after dragging and dropping the Blender editor file into Godot is to assign the materials I want to the material slots. And that’s it. All the textures will go where they are supposed to go, all the collision will work.

The textures used here aren’t final, but the process by which I make textures that match the specific parameters of my chosen graphics style are now also completely worked out.

It’s crazy how long it took and how difficult it was to get everything close to the way I wanted back in May, and how I now can replicate everything I made over the course of a month of 10 hour days in just one hour, or maybe even just half, and it’s at a higher quality. Learning all of this has not always been fun, thought it mostly was. And now that I actually know what I am doing with environment assets, I am expecting to see incredible advanced happening over the winter.

Some first views from Sarhat

Huge Progress with Iridium Moons this week.

The practice with tree models two weeks ago had gone very well and taught me quite a lot about how much detail you actually have to have on screen to create a scene that is visually rich and expressive and evocative to the viewers. Other than animated creatures of course, I think plants, and trees in particular, are probably the visual assets that need the most detail to look like the thing they need to represent. Buildings and machines can look very blocky, as that’s how they generally really are, but plants are overall very round and irregular. Which is why I choose to do trees first. A density of polygons and texture resolution that looks good enough on trees will looks good enough on everything. And it turns out that level of detail is much less than I had thought. When you manage to get the idea of a thing across, the brain does a lot of the heavy lifting to create the sensation of a much more complete environment and detailed world.

With that experience, I am now feeling very confident of going with a visual style that is more typical of what 3D games looked around 1997 than around 2002. A style that to me personally does feel a good deal more interesting and captivating and I expect to be much more fun to work with. Each assets requiring a shorter amount of work time is of course already nice when you are making every single object all by yourself from scratch. But a visual style with a lower amount of detail on each object also allows you to decorate a space with fewer objects without it feeling empty and deserted. And given that I expect many of the areas to be crammed and complex interiors of starships and factories, and the outdoors of Kion is mostly dense forests, this will be a big timesaver as well. All those things on the shelves and tables in Morrowind must have taken someone weeks if not months to arrange.

Because I have repeatedly greatly overestimated how much detail is actually needed to create a look that I am happy with so far, I have changed my approach to creating an asset library for Iridium Moons. Starting with a list of assets that I think I am going to need and working my way down until I have everything to start creating levels did sound smart originally, but it’s now very apparent that I would probably make way more stuff than I actually need to get the look that I want. So instead, my new approach is to make one small prototype map for each level that has small mockups of all the kinds of locations I want to have in the game. Starting with the most bare-bones, crude placeholders, and then adding detail to whatever things stand out to me as needing more work before they look right. This should help avoid making anything that I don’t actually need, or more variations of a thing than I need. I also think being able to place a work in progress into the environment and among other objects it is most likely to appear next to in the game will help a lot with getting the look right and consistent across the whole asset library.

For this purpose, I started working with Terrain3D this week, and it is just a joy. It’s not just a plugin for Godot that lets you sculpt a mesh for the ground, but also a full package to use absolutely gigantic maps in an actual game without blowing up the computer from trying handle all that data at once. I am now very determined to have loading screens between locations replaced with two or three minute hoverbike drives across the deserts of Sarhat or the open plains of Meruna. Even when there isn’t any real content to be discovered by exploration, I think it’s still very worthwhile just for the pacing of the game, like in Shadows of the Colossus.

Starting with Sarhat as the first planet to create assets for seemed like the natural choice, as it’s probably the easiest. The volcanic plains of Palan have an even more simpler landscape with nothing but rubble fields and a few shrubs, but it also has the two big cities which I am probably saving (or avoiding) for last.

First attempts with Terrain3D have been very promising. While it was a big struggle to find a good way to create sand and rock textures that can cover very large areas without repeating every two meters, the actual solution I have now is very simple, and I think the ground textures look really good.

As much fun as I had with the house models I made back in May while learning Blender and as good as they came out, I am now completely remaking them from scratch to fit with the new visual style I have settled for. So they still look rather flat. But I think the ground textures work amazing at 64 pixels per meter at 1920×1080 screen resolution.

But much more impressive is that I have rivers on Sarhat! Which I made completely by myself too. And you don’t see it on this screenshot, but it’s actually flowing downhill. And changing direction as the river winds through the landscape.

I thought getting to this stage would have been much, much harder, but it’s actually been stunningly easy. Given how many basic game mechanics I have already available by using the Cogito template for Godot, the only real technical challenge that I see in the future is coding NPC combat behavior. But given how absolutely everything about making a game with Godot and Blender has been so much easier than I would ever have thought so far, I am sure even that is only going to be an obstacle, but surely won’t be a barrier.

Making “huge” environment textures for Raw 3D graphics

In theory, “tileable textures” can be repeated over and over without any visible seams in them. Which does work well for very uniform textures like bathroom tiles, but once you get a bit of variation in color from just the roughness of a concrete wall and especially natural rock or grave, regular repeating patterns start to stand out very noticeably once you get beyond even just four or five repetitions. And on a castle or bunker wall, or the side of a grass covered hill or sand dune, it just looks really bad.

There are some fancy ways to break up the repeating patterns of tiling textures with shaders in Blender, but as it turns out those shaders aren’t easily imported over into Godot like meshes, UV maps, and textures. Of course, all the shader magic can be done inside Godot as well, but I really like to keep things as simple and straightforward as I can to help me keep some kind of grasp of what I’ve actually done and let me repeat it in a consistent way if I need it again in the future.

So instead of shaders that might break or cause some kinds of other problems I can’t even anticipate it, I decided to solve this repeating pattern directly in a single plain .png texture file with Gimp.

Step 1: Pick a Base Texture

50% dimensions of the original file.

Since I’m crunching down everything into jagged pixels anyway, I get all my texture files in 1024×1024. Anything bigger would be a waste of download time and storage space.

Step 2: Scale and Tile the Layer

I scale the layer down to 128×128 pixels with Interpolation set to none! to get the nice retro pixel look and then duplicate the layer to fill out the whole canvas, and then merge all the layers down into a single layer. This makes the repeating pattern very noticeable already, but the rest of the process is all about getting rid of that.

Step 3: Duplicate and Rotate the Layer

Duplicate the layer and rotate it by 45 degrees. This doesn’t cover the corners of the canvas, but those areas will be sufficiently covered up later anyway.

Step 4: Add a Layer Mask

Right click on the rotated layer and click “Add Layer Masks…” and select “Full White”. In the layers tab, there is now a white box next to the regular layer preview box. This is like a second layer that determines whether a pixel on the main layer is visible or transparent. Pixels in the white areas will be visible, pixels in black areas will be transparent.

Step 5: Add Noise to the Mask

With the layer mask selected in the layers tab, go “Filters > Render > Noise > Solid Noise”. (Or whichever noise of your choice.) For my 1024×1024 pixels texture, I like setting the scale to 16. Checking the “Tilable” box might help reducing visible seams on the edges of the texture, but with how pixelated it will be I’m not sure if it really matters.

Step 6: Adjust Levels

The default noise will have very few areas that are fully white or fully black, resulting in everything on the layer being at some level of semi-transparent.

With the Layer Mask still selected, go “Colors > Levels”. I never fully learned how everything in this dialog window works, but moving the black triangle and the white triangle sliders under the curve towards the center lets you turn dark grey areas fully black and light grey areas fully white. The values can also be typed into Low Input and High Input fields right below the sliders. I like setting black to 63 and white to 159.

This turns the layer into a pattern of colored splotches and empty spaces, with smooth gradients between them.

Overlaid over the original texture, it’s now still clearly the same texture, but the repeating patterns are gone. This texture will still repeat. But it will repeat every 1024 pixels instead of every 128 pixels and basically unnoticeable.

Step 7 (optional): Add another texture layer and repeat the process

For a forest floor, it looks nice to have some patches of grass or moss among the leaves and branches. So I added a grass texture on top of the other layers and did all the steps above again.Step 8: Set image to Indexed Colors

This isn’t directly about breaking up repeating patterns, but I have found that a very important final step to getting the classic 90s pixelation look is to change the image from RGB colors to indexed colors by going “Image > Mode > Indexed…”. For textures with relatively uniform colors like all wood furniture or concrete walls, I like going with 16 colors, but for more complex things like this forest floor this might not be enough and 32 colors work much better.

And here we see the result in action. There is still that triangle shape that’s in the original texture file, but now it’s no longer repeating in a regular pattern.

The downside of making ground and wall textures like this instead of using shaders is that the file size for the texture increased by 64 times! And probably would have been a problem for the PlayStation’s memory to handle 30 years ago. But when the default texture size is only 128×128 pixels to begin with, 64 times bigger is still only 1024×1024 pixels, which by today’s standards is still quite small. Even when you’re making a game to run on a 20 year old potato, using three or four of such mega textures really won’t make any difference.

It’s barely half of a megabyte. I think we can afford it.

First image from the surface of Kion

This is a quick mockup of two tree models I made with a hastily thrown together forest ground and some shrubs. It’s not much, but I could throw this into Godot and run around in it. And plenty of games do actually get released and even sold looking more basic than this.

If Jedi Knight had attempted to have a forest in the game 29 years ago, it probably wouldn’t even have looked as good as this.

Really looking forward of how Kion will look a year or two from now. And three and four.