Download

Procedural THINGS Generator

Hello all.
I was never planning on submitting anything to the marketplace at all but something happened this week. I was making a map and I got all of the structural things done. I started populating it with random items. Things you can’t “paint” in. I wanted trash in some random places. I wanted specific items in other random places that fit that room specifically. Then I wanted people in some places as well as dead bodies and some AI that moves around. I wanted some of it random and some of it fixed. So I got to work. I spent a whole day making it happen. In my heads down focused mode I forgot to hit ye’old save button. I opened up an animBP and a well known friend of mine crasheyMcgee popped up once again and the animBP was frozen and the editor crashed. I lost everything but the structure. Discouraged I walked around and played some NHL 16. Then decided that over the last few months I’d lost a ton of work and probably doubled my work time for real by redoing things. I decided to build a tool for myself to use for this instance as well as future ones. I wanted something that I could use to generate anything wherever with a broad set of actions and not have to do it manually. So I set out to make a small class that would help me do this and ended up making a pretty nifty automation tool.

I figured others would probably benefit from this, not only for populating large maps with content instantly that is randomized every run, but also for learning certain concepts of spawning items, meshes, skeletals and AI. So I decided to build it out with that in mind and labelled all variables, tooltips and functions with necessary info to understand and modify it however you want if you ever needed to. As is though, its super simple to use. Add content and fill in the fields for spawn times, locations etc… and hit play. Drag and drop.

I made a video showing many of the main things it can do posted below and here’s a list of the features:

  • a VERY easy to use single 100% blueprint for tons of functionality
  • spawn as many static meshes as you’d like in specific or random points
  • spawn as many skeletal meshes as you’d like in specific or random points with animation instance or class
  • spawn as many blueprint/classes as you’d like in specific or random points (item drops, people etc)
  • spawn as many AI blueprint/classes as you’d like in specific or random points. Specify custom behavior trees or allow default in class
  • add default bp to level to create an instance. modify the instance on the fly as you see fit
  • duplicate the default blueprint/class and edit to create reusable customized blueprints that can be dropped as much as you want anywhere
  • can generate a mixture of meshes, classes, skeletal etc
  • easily create waves of random enemies / items based on custom intervals, that continue to respawn after all in the wave are dead or items consumed, etc
  • generate random content in levels each time the level is run making for more unique game play
  • source is well labelled with complete tool tips for ease of understanding and expandability
    …many more.

Hopefully it’s accepted on the marketplace and theres a need for it. As I said I made it as a tool for myself first so if there’s not a need for it here, thats cool too. :cool:

I’ve tested it on 4.83 and 4.9.1.

7934c7313d3f69a806b9adb6039ca03137b2fac2.jpeg

Very, very impressive.

Would be great if you included the sample level shown, and have like a wave of 20-50 zombies spawn and start running right at the player.

Of course, another sample level would be as shown with just tons of random piles of stuff everywhere that you can run around and kick and punch as you showed.

These sample levels along with your Blueprint solution would certainly be very valuable.

Added a second video showing more AI spawning stuff:

https://www.youtube.com/watch?v=Kbwb2M1KlmE

Perfect. That sample level and your Blueprint looks solid. Besides the procedural object population with physics, you’ve got the crowd simulation and also basically the Left4Dead etc. mechanics.

I’m sure it will be on Trello voting accordingly. :slight_smile:

I’m glad you like it and thanks for suggestions.

Its way useful for more than just wave spawning. I’m actually using it for pretty much any and every spawning I do now. I can create a child of the parent, add all my enemy soldiers to it. Drag an instance of it out and just setit to random and 1 spawn and set the behavior tree i want it to use like Patrolling. Every time the map is launched a random enemy will spawn there rather than the same one. Since I’m using various target points in my behavior tree, I even spawn the points at random place within a range using a different child of it that contains the target points. So the patrol path is randomized every time as well. So many uses. It’s a massive time boost for me.

This looks really interesting :slight_smile:

What is the price point for this?

Wow, that’s cool that you have the patrolling spawning features too. Obviously the patrol points can be specified and random characters spawned and randomly (or sequentially) patrol through those points etc?

Yeah no worries about the suggestions, I look forward to this on the Marketplace. I don’t have a need for it right now but I imagine many people will.

Well targetpoints are just classes themselves. So using the classes section you can add single target point there and spawn it as many times in a radius as you want. Then you can also spawn x amount of AI characters as well and have them follow a simple behaviour tree that finds said target point and moves to it. Since the spawn points can be random, the character following the BT will move randomly each time. Can also have different target points spawn in order at random locations as well, so tp1, tp2, tp3 etc and use a behavior tree that searches for each one in sequence and moves to them. Behaviour trees can be as simple or complex as you want to make them, but with this you can control the amount of characters to spawn in what intervals and what behaviour trees to follow when they spawn. Lots of control. No more draggin x amount of actors into the map and setting up what they do individually or dragging target points in to the map manually to set up movement paths etc.

I chose the $19 price point on the submission page which if this is accepted to the marketplace I’ll leave at that price for the first monthish. I’ll probably raise it slightly after that. The main reason is because the more I use this in my game each day now, the more situations it fits into to make life so much easier. Initially it was to populate maps with “things” quickly and randomly. Now I’m using it for that plus AI behaviour, patrols, prop setting, items drops, populating large parking lots with cars, houses etc… I’ve been adding features as I go along as well to make things more customizable like random rotations, collision on spawn control etc. Its not just an asset to use for randomizing things at runtime, unlike a prop with a single purpose or something its more of a tool with many applications and can help make designing many aspects of your game go by much quicker.

I haven’t got into any Animation Blueprints yet. So with your Blueprint how does that integrate with a character’s existing Animation Blueprint? For example, can one use your Blueprint just by itself to drive the characters (walking, running, turning) besides the location movement (root movement?) of the character?

Really nice work! Look forward to seeing what else you come up with.

you wouldnt be able to use mine or any single blueprint by itself to make characters move around no.
a “character” consists of several different aspects the basics would be:

  • skeleton
  • skeletal mesh
  • character blueprint
  • animation blueprint

the skeleton holds the bones etc obviously and joints so that when animations are applied to it knows where and what joints to bend etc.
the skeletal mesh is the fleshy parts(visually) that you see. Same as a static mesh but with a skeleton inside it, so that when the skeleton is told to move, the mesh will move along with it.
with those two on their own, you CAN apply single animations to it now and the character will play those animations out but you can only apply one animation to it at a time this way and you’d need to manually change from one to the next which isn’t so efficient. But it can be useful for say having a large crowd of skeletal meshes watching a soccer match or something and they aren’t moving around. You can have the crowd play cheering animations on loop or something.

but if you want a character to play an idle animation when they’re standing still, then play a walk when moving forward, then a run when moving forward faster you’d need somewhere to write that logic. Thats where the animation BP comes in. you can set your various states like idle, walking, jumping…and transitions from each other etc and what needs to happen for those states and transitions to be activated (i.e. speed is greater than 0). However the animation blueprint just receives values such as “speed is greater than 0” or “isJumping”. and then applies the animations to the character(s) using that blueprint. But where do the variables like “isJumping” get populated from?

The character blueprint. Which consists of a skeletal mesh that you specify and by default the ability to move, walk speed etc… In here you can add whatever logic you want. So you can add a variable called isJumping, and you can make code that states when isJumping is true and when its false. You choose here what animation blueprint this character will use. Then you tie the isJumping from the char blueprint to the animation blue print and then when that event sets is jumping to True, the animation blueprint will get the memo and play that animation on that character.

Last bit I’ll touch on is if the character you just made has a character blueprint and an animation blue print but is NOT being controlled by a human then there wouldnt be any “input” int he character blueprint to make the character move. Thats where you’d set the character blueprint to use an AIController blueprint and there you’d specify what behavior tree it should follow. Behvior trees are just sequences of events. “find myplayer class > move to my player class” etc.

So how my thing helps in terms of characters specifically,

look at that crowd cheering scenario, if you wanted 50 characters there you’d need write code to spawn them randomly and different ones or manually drag each one out and set an animation to it like “cheering”. You can use just static meshes for this scenario since they won’t be moving around. You could drag one of my blueprints out add the static meshes you want to use in the crowd and then set the animation you want them all to play. You can vary the spawn rate so the animations will be playing at different intervals. If you had 5 different “cheering” animations. You could create a singe thing generator with all your crowd characters set up and the spawn settings, spacing etc. Then drag it out into the world and simply change the animation on it. Then duplicate that one in the world and set the second, animation… repeat til you have your 5 different cheering animations out there and let the spawn tool do the rest of the work. dupe those as many times as you want to vary the crowd.

You could also do the same above scenario with classes (instead of spawning the skeletal meshes you could just spawn the character blueprints).

For AI, youd have to have a behavior tree set up. So create one and make it do “find target point 1 > move to target point 1 > wait 5-10sec > find target point2 > move to target point 2 > wait 5-10 sec” then it would repeat. You’d specify in the AI controller to use this behavior tree and in the character blue print you specify which ai controller to use once thats set up, youd manually you’d drag your soldier(s) out into the world. Then you’d need to manually get your target points out there, two in this case, could be 50 etc. And repeat this anywhere you want patrolling AI. Once the AI is killed youd need to have code somewhere that respawns each one if you wanted them to respawn.

Otherwise you could just drag one of my things out and under the AI section add as many character blueprints here as you want (different characters) set the amount to spawn etc. if its just one, you can check mark random and it will spawn a random one of the list you added each time the game loads. You can specify here the behavior tree it should follow and if it should respanw if killed and when. On the SAME thing generator scroll up to the classes section and add the various target points to spawn as well and space them out as far as you’d like. When the level loads it will spawn a random soldier and his target points and he’ll carry out the behavior tree. If hes killed the respawn will happen automatically. With this one thing generator set up, you can then duplicate it all over your map and it’ll load a random guy from the list at each spot. They’ll each be patrolling their own area etc. You can spawn 5 different guys per thing generator or multiple target point 2’s and they’ll choose the best one to go to based on your behavior tree… etc.

The tool itself basically takes the manual work out of populating the workd with items, objects and people. You can create reusable custom generators of any kind. Like I have one that has several tree static meshes in it. I make the radius 1000 and then at load it randomly spawns 200 trees in an area… differently each time the game loads. I have another one that has various grass and i spawn that one along side it. Lots of different uses.

For the character animation stuff, I highly recommend following zak parish’s 20ish part tutorial. Follow all of them, even if it looks daunting. It really helped me better understand things when I started out with animations.

Cool, very informative.

added a third video to show foliage spawning. populates once at run time randomly within a set bounds

https://www.youtube.com/watch?v=XgS9htRUwnE

Hello all.

Not sure how long the process will be to get this on the marketplace and I’ve have a few PM’s asking for it sooner … haven’t had a chance to submit a final video to UE4 yet been too busy with other thigs

Hello,

I did manage to get around to making a video for this marketplace release. Rather than show examples, I took the base third person project example and made a mini game on video and used my Thing Generator to populate the level, AI and objects. I haven’t had time to write up everything Epic needs to post this on the marketplace yet. I’ll get around to it soon if there is still anyone looking for something like this.

In the release you’ll get the full project of everything seen in the video. So a small game as a bonus for you to build off of or learn from.

Here’s the new video, let me know what you think!

https://www.youtube.com/watch?v=--wC03FFO2U

I use spawn volumes for similar stuff, could delete oldest actors, limit cap, choose actors to spawn.
I do not get it, why this is so special?
No insult.

couldnt tell you how they diff, I dont use spawn volumes but hey if you got something that works, stick with it.

I think that your tool is very useful and cool…but since i am not a ninja at making BluePrint, it looks very complicated to me. Thanks for sharing.

I had to switch off the sound of your video :stuck_out_tongue: