# Cashgen - (kinda) Infinite Procedural World Generator

**URL:** <https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131>\
**Category:** Game Development\
**Tags:** unreal-engine\
**Created:** [May 6, 2016, 4:37pm UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131 "2016-05-06T16:37:03Z")\
**Posts on this page:** 20\
**Page:** 13

<div class="post-metadata">

**Author:** ![AinSophAur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AinSophAur](https://forums.unrealengine.com/u/AinSophAur)\
**Post date:** [June 28, 2017, 9:03am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/248 "2017-06-28T09:03:43Z")

</div>

Playing around with this plugin.  
And already, in it’s current state, I’m having a lot of fun. 😃

 ![UE4Editor_2017-06-28_00-11-29.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/2/e2186696ceaa2e4d1dd6a8199dfae18a642b4d12.png)

---

<div class="post-metadata">

**Author:** ![mid\_gen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mid\_gen](https://forums.unrealengine.com/u/mid_gen)\
**Post date:** [June 28, 2017, 9:17am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/249 "2017-06-28T09:17:33Z")

</div>

Cool :\>

Just be careful with the number of subdivisions and limits when it’s in this very crude state!

SubDivisions = Number of times the original 20 faces are subdivided.

SubDivLimit = If the remaining number of subdivisions exceeds this limit, then the current face will spawn 4 child faces

Don’t exceed SubDivisions/SubDivlimit = 3 would be my advice 😛

20 face actors  
20 + 80 face actors  
20 + 80 + 320 face actors

---

<div class="post-metadata">

**Author:** ![AinSophAur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AinSophAur](https://forums.unrealengine.com/u/AinSophAur)\
**Post date:** [June 28, 2017, 9:26am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/250 "2017-06-28T09:26:08Z")

</div>

I’ve noticed what you mention.

The image above has these settings:  
 ![UE4Editor_2017-06-28_11-20-25.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/5/7/6572c9512bbb12fed716a064c10a47e427754516.png)

It does spawn a few more than I would like it to, but this might even be a bit too many subdivisions.  
So, a lot of testing and playing around at this point. 🙂

**EDIT:**

> [@mid\_gen;729490](#):
>
> Cool :\>

And thanks. :o

---

<div class="post-metadata">

**Author:** ![AinSophAur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AinSophAur](https://forums.unrealengine.com/u/AinSophAur)\
**Post date:** [June 28, 2017, 5:48pm UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/251 "2017-06-28T17:48:04Z")

</div>

@mid_gen

Is there a way to get the end of thread callback or whatever it’s called, after every CGWorldFace has been generated?  
In a game situation, that would be a very useful .  
Or is that a simple thing to add on my own, maybe?

**EDIT:** First off, sorry for all the double posts.  
And I figured out that I could just as well look into adding a something that gives feedback on when the thread is finished.

---

<div class="post-metadata">

**Author:** ![honaj](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@honaj](https://forums.unrealengine.com/u/honaj)\
**Post date:** [June 29, 2017, 4:20pm UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/252 "2017-06-29T16:20:13Z")

</div>

I’m getting this error when trying to run a packaged game:  
 ![2017-06-29.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/3/13a6fc0b7d93143829286e0244e301d0e1481035.png)

---

<div class="post-metadata">

**Author:** ![mid\_gen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mid\_gen](https://forums.unrealengine.com/u/mid_gen)\
**Post date:** [June 30, 2017, 7:23am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/253 "2017-06-30T07:23:21Z")

</div>

> [@AinSophAur;729709](#):
>
> @mid_gen
> 
> Is there a way to get the end of thread callback or whatever it’s called, after every CGWorldFace has been generated?  
> In a game situation, that would be a very useful .  
> Or is that a simple thing to add on my own, maybe?
> 
> **EDIT:** First off, sorry for all the double posts.  
> And I figured out that I could just as well look into adding a something that gives feedback on when the thread is finished.

Can add a blueprint event or delegate easy enough. You’re welcome to submit a PR, contributions welcome. I’m busy this weekend so it’ll be next week at least before I do any more work on it.

---

<div class="post-metadata">

**Author:** ![mid\_gen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mid\_gen](https://forums.unrealengine.com/u/mid_gen)\
**Post date:** [June 30, 2017, 7:24am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/254 "2017-06-30T07:24:01Z")

</div>

> [@honaj;730150](#):
>
> I’m getting this error when trying to run a packaged game:  
> ![2017-06-29.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/3/13a6fc0b7d93143829286e0244e301d0e1481035.png)

Included CashGen in your project’s build.cs ? That’s usually the problem with packaging

---

<div class="post-metadata">

**Author:** ![AinSophAur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AinSophAur](https://forums.unrealengine.com/u/AinSophAur)\
**Post date:** [June 30, 2017, 7:50am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/255 "2017-06-30T07:50:45Z")

</div>

C++ is not my strongest language to be honest. So, to begin with. I’ll just play around with the code and see what and where I can add code without breaking things.  
Could you give me a point in the right direction on where/what file I could add a blueprint event or delegate? :o

**EDIT:**  
So, I’ve actually managed to add a blueprint event to the plugin. Now, I need to figure out the hard part. What to use to trigger the event.

**Another EDIT:**  
Ok, that was a lot easier than I thought. Tho, I guess it’s a totally newbish way to do it. But it works at least, and I don’t think it adds any load to the current performance. :o

---

<div class="post-metadata">

**Author:** ![AinSophAur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AinSophAur](https://forums.unrealengine.com/u/AinSophAur)\
**Post date:** [July 11, 2017, 12:02pm UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/256 "2017-07-11T12:02:32Z")

</div>

@mid_gen  
I have noticed that the collisions are not being set for the sections created with CGWorld. Could you explain how I can re-enable the collisions? Or do the normals and tangents have to be calculated before collision can be enabled?

---

<div class="post-metadata">

**Author:** ![speedpacer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@speedpacer](https://forums.unrealengine.com/u/speedpacer)\
**Post date:** [July 18, 2017, 1:58am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/257 "2017-07-18T01:58:18Z")

</div>

> [@mid\_gen;705128](#):
>
> I used to include the OceanPlugin code in the demo project but it was a pain keeping the project updated as OceanPlugin isn’t maintained all that quickly and has loads of extra stuff in. I did look at generating a heightmap texture to feed into the BP\_Ocean so the waves and stuff would work on the shorelines but it was a bit of a nightmare…easier to write something custom from scratch.

I smell what you’re stepping in. I tried the same thing, tried directing the waves toward the player, etc. I can’t tell you how many times I’ve installed and uninstalled that plugin over the years. I’ve been using the ocean BP from [Tropic Islands](https://www.unrealengine.com/marketplace/tropical-island-environment) in the meantime but I just stumbled upon [Beach Wave Water](https://www.unrealengine.com/marketplace/beach-wave-water) on the marketplace. Looks promising. Thanks for the contribution btw. 🙂

---

<div class="post-metadata">

**Author:** ![mid\_gen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mid\_gen](https://forums.unrealengine.com/u/mid_gen)\
**Post date:** [July 18, 2017, 6:34am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/258 "2017-07-18T06:34:06Z")

</div>

> [@AinSophAur;735060](#):
>
> @mid_gen  
> I have noticed that the collisions are not being set for the sections created with CGWorld. Could you explain how I can re-enable the collisions? Or do the normals and tangents have to be calculated before collision can be enabled?

I’ve not exposed the setting to BPs yet.

Up to my ears on a new project learning a new engine so haven’t had time to look at this for a few weeks. Will try and fit some time in over the weekend.

---

<div class="post-metadata">

**Author:** ![AinSophAur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AinSophAur](https://forums.unrealengine.com/u/AinSophAur)\
**Post date:** [July 18, 2017, 11:17am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/259 "2017-07-18T11:17:40Z")

</div>

@mid_gen  
I see. New project and engine sounds interesting.  
Sounds good. Looking forward to the update on the plugin.

I would love to make collision work on my own. But I lack the knowledge on where an how to do that.

---

<div class="post-metadata">

**Author:** ![mid\_gen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mid\_gen](https://forums.unrealengine.com/u/mid_gen)\
**Post date:** [July 23, 2017, 11:41am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/260 "2017-07-23T11:41:36Z")

</div>

> [@AinSophAur;738261](#):
>
> @mid_gen  
> I see. New project and engine sounds interesting.  
> Sounds good. Looking forward to the update on the plugin.
> 
> I would love to make collision work on my own. But I lack the knowledge on where an how to do that.

Sorry for the delay! I’ve added a collision option to the world config, pushed to the CG\_World branch. Brain is totally maxed out absorbing other engine stuff at the moment so firing up Unreal when I get home isn’t happening for a while :\>

---

<div class="post-metadata">

**Author:** ![AinSophAur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AinSophAur](https://forums.unrealengine.com/u/AinSophAur)\
**Post date:** [July 23, 2017, 12:17pm UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/261 "2017-07-23T12:17:41Z")

</div>

> [@mid\_gen;740421](#):
>
> Sorry for the delay! I’ve added a collision option to the world config, pushed to the CG\_World branch. Brain is totally maxed out absorbing other engine stuff at the moment so firing up Unreal when I get home isn’t happening for a while :\>

Thank you very much! No need to be sorry. 😃  
I mean, you are taking the time to do work on the this awesome plugin while working on something else.

I will have a look at it in a bit. Trying to get through a C++ course to get a better understanding of this untamed beast. Well, it’s a beast to me at least. 😛

I can understand that taking in a new engine makes the brain boil.  
Mind telling what engine it is? I know it’s like a unwritten rule that says not to mention other engines on an engine forum and so on. But just out of curiosity. 🙂

---

<div class="post-metadata">

**Author:** ![AinSophAur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AinSophAur](https://forums.unrealengine.com/u/AinSophAur)\
**Post date:** [July 23, 2017, 4:10pm UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/262 "2017-07-23T16:10:00Z")

</div>

@mid_gen  
I’ve been playing around to get the collision on the CGWorld. But it seems to not be working. I’ve downloaded the branch and implemented it to a fresh project. Terrain works just fine, but the World still does not seem to have collision. 😕

---

<div class="post-metadata">

**Author:** ![Haoris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Haoris](https://forums.unrealengine.com/u/Haoris)\
**Post date:** [July 23, 2017, 11:16pm UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/263 "2017-07-23T23:16:47Z")

</div>

Hi,  
Really nice plugin.

I’m trying to add vegetation to it but how did you managed to do this in your videos? I Tryied to use the grass node in the material but it only works with layers right?

---

<div class="post-metadata">

**Author:** ![Haoris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Haoris](https://forums.unrealengine.com/u/Haoris)\
**Post date:** [July 25, 2017, 1:19am UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/264 "2017-07-25T01:19:00Z")

</div>

Oh, and I have some problems that I don’t see in your images/videos:  
[https://img4.hostingpics.net/pics/934700bug.jpg](https://img4.hostingpics.net/pics/934700bug.jpg)

---

<div class="post-metadata">

**Author:** ![AinSophAur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AinSophAur](https://forums.unrealengine.com/u/AinSophAur)\
**Post date:** [July 25, 2017, 4:04pm UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/265 "2017-07-25T16:04:41Z")

</div>

@mid_gen

Never mind. I managed to fix it.

By adding this:

```auto

MeshComponent->CookCollisionNow();

```

to CGWorldFace.cpp under UpdateMesh.

It really slows down the process, but it’s worth it!

---

<div class="post-metadata">

**Author:** ![Haoris](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Haoris](https://forums.unrealengine.com/u/Haoris)\
**Post date:** [July 26, 2017, 5:00pm UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/267 "2017-07-26T17:00:32Z")

</div>

For my foliage question, at least is there a way to know when a tile has been generated so I can’t start an event right after each tile generation, event which raytracing and spawning foliage meshes?

---

<div class="post-metadata">

**Author:** ![AinSophAur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AinSophAur](https://forums.unrealengine.com/u/AinSophAur)\
**Post date:** [July 26, 2017, 5:29pm UTC](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131/268 "2017-07-26T17:29:35Z")

</div>

@Haoris  
Hi.

Are you referring to the “flat” land from the branch, the tiles, not the spherical ?  
As far as I know, there is no event added to tell when a tile has been placed.  
With that said. I don’t think it’s too hard to add it. I’ve been playing around with the CGWorld more than the terrain part, so I can’t say it for sure.  
I would have to do more research before I could tell you how tho.

[Previous page](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131.md?page=12)

[Next page](https://forums.unrealengine.com/t/cashgen-kinda-infinite-procedural-world-generator/63131.md?page=14)
