r/ClaudeGameDev • • 2d ago

Alpha Claude Code graphics programming - an Earth-sized fully procedural planet in Unity, from orbit to grass level

The goal of the project: One Earth-sized planet, all procedural, rendered live in Unity 6 (URP).

After a short intro of other places, the video is one continuous flight from 4,600km in orbit down to a few metres over a meadow and back out.

This is my procedural island generator's sister project: a whole planet instead of an island, and it borrows some of the components from it.

It's a personal R&D project that may become the base for a game.

How Claude Code is used on this project

  • It drives the Unity Editor itself through an MCP server (CoplayDev's, and I'm developing my own for specific purposes). It recompiles, reads the console, starts and stops Play Mode, and runs C# snippets inside the running editor to move the camera, switch features on and off, and take captures.
  • It judges by renders, not just numbers. Early on, the project drifted for a while by passing numeric checks while never looking right. Now every change is followed by a capture round: fixed viewpoints, my saved views, and before/after sheets with difference images. Claude looks at them, and numbers only back up what the pictures show.
  • The repository is its memory. CLAUDE markdown holds the defined standing rules. A handoff document says where the work stopped and what's next, so a new session, or one that ran out of context, picks up from there without any special instructions. There's also a development log, decision records, a tech note per subsystem, and a dead-ends file listing every failed approach, what happened, and what it might still be good for, so nothing gets tried twice by accident.
  • Screenshots carry a location line with the position, view and time of day. When I say something looks wrong, Claude goes to that exact view, reproduces it and measures it.
  • It works from papers and documents I keep in the project, and notes where it departs from them: in this case Ulrich's chunked LOD for picking tiles, Bruneton, Neyret and Holzschuch 2010 for the sea, and the RPV model for how deserts reflect the sun.
  • It writes its own measuring tools: frame times logged in motion, a hunt that flies a six-minute route counting one-frame flashes, push-in sequences that count what pops in, sheets comparing rounds, tests for motion and region seam artifacts etc.
  • Outside Unity, it scripts Blender through another MCP server for tree parts and other objects. Textures come from Codex's image model, cut and processed by scripts Claude wrote.
  • Even the video: Claude wrote the route recorder, it found the song's tempo, cut the intro on its beats, and sped up the descent with a ramp. And then the video post-processing, watermarking and compression is also handled automatically by Claude.

Who does what

I've done 3D environment art, shaders and tech art for a long time. I set the direction and the look, bring the references and papers, and judge every change by eye. Claude Code writes most of the code and all the tools. Codex did the first tests, and now makes textures and reviews subtle changes. That's about 270 commits since late July.

My judgement is still needed, as Claude will happily finish something technically right that looks wrong, so references and my eye decide. Unity's traps also had to be learned once and written into the rules.

The renderer specs

  • A cube-sphere quadtree. Every tile is the same 32×32 grid, generated on the GPU as you fly, from 25 octaves of 3D noise between 16,000km and about 1m. At the finest level, vertices are about 1.5m apart.
  • The camera stays at the origin, with its position kept in doubles. URP's TAA never sees the camera travel, so the travel is fed into it.
  • Hillaire's atmosphere and volumetric clouds from a global weather map.
  • A climate model carries rain inland on the winds and decides where clouds, snow, forests and grass go.
  • The sea is currently the terrain clamped to sea level. Trees are grown after Palubicki et al. in the tree lab from my previous project, with impostors past about 100m. About 100,000 GPU grass blades a frame reach 250m.
  • It runs at 9-13 ms a frame at 1080p in the Editor on an RTX 3090.

Music made with Suno.

301 Upvotes

65 comments sorted by

13

u/kylef5993 2d ago

Where did you get the tree and water assets? I’m using unity and it can’t make trees at all lol

Can you share the GitHub?

5

u/imlo2 2d ago

I built the tree system for earlier project which is going on; it has a Python-based tree generator, which follows Palubicki's paper quite closely, with some added fine-tunes/adjustements, and a few mistakes I'm pretty sure. Water is built for this project, it makes illusion of depth and sub surface, but is currently in reality solid. I've planned a few ideas how a near-field realistic water could be added to this, so that it would LOD properly.

1

u/kylef5993 2d ago

Gotcha. Interesting. I've made water that flows but it's still looking geometric around the edges and waterfalls are meh. I'll take your approach with trees and see what claude can do. Thanks!

2

u/Much_Highlight_1309 2d ago

I like everything except the clouds. Those look really cheap.

2

u/imlo2 2d ago

I don't have time for everything, I will improve those later.

2

u/Oliver_the_chimp 1d ago

Bad god. No biscuit.

Jk, this is rad. Keep going!

4

u/dominofallsgame 2d ago

woooah! too cool!

1

u/Honkey85 1d ago

I have so.many questions. I am currently working at an underwatergame and would really like to know how to approach that complex creature procedural.

2

u/imlo2 1d ago

There's some research on this topic, and also good write-ups and videos made in last 10 years or so.

Check Lenia - Biology of Artificial Life if you want to jump to the deep end of the biological-style simulation.

But I would perhaps start with more traditional procedural character or creature generation, like how Spore was done, etc.

1

u/Honkey85 1d ago

Oh, sorry that was a misunderstanding. Maybe because of my bad English. I was talking about procedural created graphics.

1

u/imlo2 1d ago

No worries; I'd just ask Claude or ChatGPT to get started - and google for seminal papers in procedural world/terrain creation topics.

1

u/EconomySerious 1d ago

the final size of the map file after 10 minutes ?

1

u/imlo2 1d ago

The size does not change, it's procedural for the most part. You can fly around or have a script fly around for hours and it does not make any difference. Object placement is procedural and deterministic (trees, rocks, grass) so no positions are cached for later use, as there is no need.

2

u/EconomySerious 1d ago

why there is no need? if you go back you need to find the same place , not another one

2

u/imlo2 1d ago

Well when you go to the same place, you get the same trees? :)
They are based on the current tile/location, so they generate to the same spots. Just like some GPU random noise for an example, which is derived from seed + uv or such, if you know the concept.

1

u/EconomySerious 1d ago

so this world is non destructable, it redraws itself each time it regenerates.
basically its for show only

1

u/imlo2 1d ago

Is GTA V "show only" or any other game which respawns environment objects after a while, or when you return to same location?

And you could implement some system which records where items have been culled away, and so on.

But I hope you do realize this is an ongoing, in development R&D project. It's not yet a be all, end all thing. Far from it.

1

u/EconomySerious 1d ago

thats why i asked the file size, any game need permanent storage the results of procedural generation + the modifications done by the user.
thats why a minecraft save is bigger each time you play it

1

u/imlo2 1d ago

Yes, but my design goals don't most likely align anywhere near Minecraft - if it's a game about fighter jets, etc. the filler environment would be mostly visual texture and interaction would be with 99% of the areas just collision avoidance. Just as one example. Not every game design has to go to a sandbox playground direction.

1

u/Fresh-Daikon-9408 1d ago

This is impressive, I am building a very similar project. Chose Unity at first then leave it to make a custom engine.
But sticking with Unity definitly gives some advantages. Well done!
Did you handled erosion (rivers, lakes and so on)? Or not yet?
How fast does the LOD calculatuion goes. In real time is there any speed travel limitation due to LOD?

2

u/imlo2 1d ago

Thanks. Your project is that space sim type of thing with oval control panel on the ship, I think I saw your name in some recent posts a few days ago - or am I mixing this to something else?

Erosion is applied only to mountainous areas; there's no "real" process yet for the whole planet. I'm mainly wanting to see rivers and related water-carving type of things in limited and controllable fashion, so that there would be watershed areas and then rivers to lakes and seas.

There is some travel limitation, LOD preparation can get as an obstance, but it's so fast that no normal game situation (movement on ground, flying, etc.) would be an issue, and if it would eventually be, I don't at least personally make such vehicles. But there's still a lot to optimize and improve, and those failures can also be handled more gracefully so that they look visually decent.

2

u/Fresh-Daikon-9408 1d ago

Ok cool.

Yes, one of my demos ship has an oval control panel ;-)

1

u/Objective-Cell226 1d ago
  1. All of this is claude?
  2. How much time did it take?

1

u/imlo2 1d ago
  1. Mostly Claude, and Codex early on for cube-sphere, CDLOD-style surfaces, mesh creation etc., and also few other things, and for review of components etc. Codex has been also the go-to tool to create textures and other data, called via plugin. And some of the tools/features are borrowed from my earlier project.
  2. Over a month of work days, during 3 months or so.

3

u/Latent_Space_Cadet 2d ago

If the terrain is 3d noise, why does 100% of the terrain in the tech demo look like 2d brownian?

3

u/mabec 1d ago

No man, No sky. If you could fix the 2d plane clouds it could have been a National geographic video

2

u/Vo_Mimbre 2d ago

It really … is … Genesis!

2

u/Ok-Arachnid-460 1d ago

We had a CRYENGINE build that did this 9 years ago. Vlad could work wonders.

Oh what could have been.

2

u/AlbinoGrimby 1d ago

That's impressive. I'm gonna have to look up some of the papers you mentioned in the comments and run them through Claude for my project.

2

u/Lemonbicycle 1d ago

Flat earthers would say it's fake

0

u/joachim_s 2d ago

Looks great. I just don’t understand how you can tell a meaningful and consistent story through procedural gen? Asking honestly.

5

u/imlo2 2d ago

Well I think it's quite basic game design - it could have authored locations, and actually that's implemented already (not just shown in the video). So you could make huge areas (square kilometres) which are artist-crafted, hand-sculpted and those exist on the surface of the planet.

-3

u/Latent_Space_Cadet 2d ago

Wow, great idea, you could make an even less inspired Starfield using the tech NMS botched its initial launch with.

1

u/watisgoinon_ 2d ago

You can with making cells that track the contents and contents that track their properties and states. but just look at star citizen, its not easy at this scale, you can do it the opposite way around like NMS but then everythings just a bunch of layered lists and locations and only with special exceptions do things exist without you being there. these types of world/space scale proc gens have been around since the 80s. It's always a crowd pleaser as a teaser, peoples imaginations run wild. But in reality they're pretty consistently boring.

1

u/Honkey85 1d ago

You need the same "seed" for probability.

1

u/kirmm3la 1d ago

This is nuts. Starcitzen should start developing with claude so we can finally get a release

1

u/Rorque_Cocoon 1d ago

better than starfield

1

u/Tony009 1d ago

clouds not good

1

u/mikecrash 1d ago

i always see shit like this while i have one 100mx100m scene for my squad tactics game that runs like fucking shit no matter how much optimzaiton i have

1

u/llm_dev 1d ago

Open source? 👀

1

u/Large-Oil4920 10h ago

my guy just used up 50% of earth water to create a duplicate version of earth

-2

u/OverratedMacaron 2d ago

Why use Unity ? I think you lose a lot of FPS for no benefit. If everything is procedural, you just need a good rendering engine without all the bloat

3

u/imlo2 2d ago

Well because I wanted to do it in Unity. Using Unity doesn't mean anything like "lose a lot of FPS"? Compared to rendering and its frame setup for the planet, the other things are miniscule in compute. And Unity has a lot of facilities and tooling for rendering, which you or AI would need to build. It would take for sure weeks if not months to get anything comparable.

1

u/Latent_Space_Cadet 1d ago

This isn’t true at all. You could stand this up in a custom engine likely at lower difficulty than setting it up in Unity. Unity helps with exactly nothing here.

1

u/OverratedMacaron 1d ago

Yes but you will spend weeks or months later on when you hit a wall. Its closed sources so you cant get around its limitations unless the devs decide your need is worth implementing

I mean even UE would be a better choice here

2

u/Aranthos-Faroth 2d ago

You lose fps for no benefit, what?

1

u/OverratedMacaron 2d ago

It's not the best rendering engine, so if you are going procedural I would def not chose it as a base for my game, you will struggle on details later on that will be impossible to bypass

4

u/Living_Cell7304 1d ago

You have no idea what you’re talking about.

The real bottleneck are the 32 bit floats in the coordinate system.

1

u/OverratedMacaron 1d ago

You wont use float for coordinates, what the hell ?

2

u/Living_Cell7304 1d ago

That’s not what I said weirdo

1

u/OverratedMacaron 1d ago

> The real bottleneck are the 32 bit floats in the coordinate system.

Okay

0

u/Living_Cell7304 1d ago

You understand that with 32 bit floats you only get like 5k meters from origin until things start jittering bad right?

Are you a noob vibecoder? Any real engineer would instantly have known what I was talking about

1

u/OverratedMacaron 1d ago

Any real engineer would not use floats for coordinates what the hell you are on about

0

u/Living_Cell7304 1d ago edited 1d ago

Unity uses floats for their xyz coordinate system. It’s been like this for 20 years and there’s no other way to use unity.

Goofy weirdo vibecoder

→ More replies

0

u/[deleted] 1d ago

[deleted] — view deleted comment

1

u/Living_Cell7304 1d ago

Ok now play a character with animations at the 15k mark.

1

u/House13Games 1d ago

Try using a floating origin, you'll get there in the end, keep at it

1

u/Living_Cell7304 1d ago

Floating origin doesn’t work with server authoritative multiplayer at massive scales

Try again genius

1

u/House13Games 18h ago

Sure it does. you're just not able to.
big incel star citizen vibes from you. I'm out.

0

u/Aranthos-Faroth 2d ago

I dunno man rust runs pretty well

1

u/OverratedMacaron 1d ago

For the quality of graphics the performances are horrible
They tried to get away from Unity but they gave up as it was too much work