Procedurally placed objects

I’m making an Actor to procedurally place objects around the camera at runtime. It’s mostly as an exercise to see if I can make it work.

I made a base class that places a tiled grid centered around the camera. The tiles then overlap when you move in such a way that the players always stays at the center.
Currently I’m focusing on an actor that then places instance meshes in each tile when they are updated.

The code is on GitHub: GitHub - hallatore/TileActor: Actors for dynamically spawning objects in the Unreal Engine

#1 test - Spawning instance meshes around the player with smooth lod transitions.

#2 test - Adding Perlin Noise and use min/max noise values to select where to spawn

#3 test - Added two grass actors, one with higher grass around the bushes.

#4 test - Added trees and adjusted the scene.
About 350 000 - 400 000 objects in this scene I think.

#5 test - Demo of the different actors

I made it so you can select the size of the perlin noise. Having two actors with the same noise size and inverted min/max for spawning makes for interesting effects.

Around 350 000 - 400 000 objects in this scene I think. Got 80 fps without much tweaking.

Fully dynamic lighting and shadows with everything generated at runtime. :slight_smile:

Manage to make the actor work in the editor and added a noise seed.

Also made this nice little demo of the different actors in action.

Niceeee!

Do you plan on making it into fully blown biome generator ?

Would it work with Dungeon Architect / Landscape Architect ?

I’m just toying around learning about the editor. I’m not planning on releasing this, at least not for now. :slight_smile:
It’s on github so anyone can play with the code and copy it.

I like 3D, large environments and I suck as a designer. :stuck_out_tongue:
So I’m trying to make something that would look like it was designed/natural, but generated dynamically.

I see… That’d be quite unfortunate if this project won’t develop into a proper plugin or BP system :frowning: Populating open worlds (or even not-so-open worlds) is a royal pita and I’ve been searching for such system for a while. Would be an insta-buy for me on the Marketplace :wink:

It’s not that hard to copy the code from GitHub - hallatore/TileActor: Actors for dynamically spawning objects in the Unreal Engine
You need TileActor, FoliageTileActor and SimplexNoise.

You can download Visual Studio Community for free.

I am not a programmer. I do BP stuff and art/animation.

https://www.guerrilla-games.com/read/gpu-based-procedural-placement-in-horizon-zero-dawn

Reminds me of Horizon’s procedural placement system.

Awesome game! Wish it was available for PC… Been getting inspired a lot for Ghost Recon: Wildlands lately, it looks absolutely amazing.

Here is another demo I did. Testing out how easy it is to get ok results. Having the ability to layer multiple noise layers opens up a lot of possibilities.

  1. Added an actor with 80 % spawn chance.
  2. Added a small noise layer with min/max 0.2/1.0
  3. Added a larger noise layer with min/max 0.3/1.0
  4. Added a huge noise layer with min/max 0.2/1.0
  5. Added another actor with the huge noise layer min/max 0.0/0.2 and another with 0.3/1.0 to thin it out.

Hi hallatore,

I’m all about using procedural and user-mediated content generation. Grabbed myself a copy of Terra Nova Dynamic in-game environment builder w/ GUI editor. I can see potential here. What is your ultimate goal with this system? To add Architecture, Roads, Bodies of Water, etc. Perhaps even an GUI?

That is a really cool project! :slight_smile:

So far I’m going for 100 % run time generated logic. I don’t really have a ultimate goal here, just playing around and see what I can make.
It means you can’t remove one and one tree. But the goal is for it to be good enough that you don’t feel the need to manually paint/remove.

I am however adding a blocking volume that you can use to exclude areas. Just need to figure out how I can find all my blocking volumes in the world. The API Documentation is hard sometimes. :stuck_out_tongue:

I would encourage adding a GUI and Multiplayer support which would instantly transform this system into Application. This is what I’m doing with my own in-game multiuser Constructions applications: GOLEMCraft, GLAMOUR, GLAIVERave, WIZMO, EyeManga3D, Labyrinth. When its all said done, I will a MAKE GAME Button. Keep the good work!

Looks pretty neat - can’t wait to see how far you take it :slight_smile:

There are a lot of seemingly trivial stuff I find quite hard to do. Managed to make it possible to show the result in editor (default off), and the ability to add a volume to exclude stuff.

Added blocking volumes which can contain multiple layer types. Each foliage actor can have a given layer name.

e2b011a310036bdf607e9880ec5d85c97a4711de.jpeg

Added ability to run the code while in the editor. Loading, unloading and reloading was quiet a challenge to get right. Here you can also see the blocking volumes in effect.

Thats looking really sweet. I know this may be a premature question, have you tested navigation?

Excellent work!

Thanks! :slight_smile:

Here is a demo of my latest improvements.
You can toggle the actor to render in the viewport. And it now loads the closest tiles first, and only one tile per tick.
It loads smooth and super fast. :slight_smile: