# Placing many Items for Grocery Store Performantly + Quickly

**URL:** <https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774>\
**Category:** World Creation\
**Tags:** unreal-engine, question\
**Created:** [December 3, 2023, 1:35am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774 "2023-12-03T01:35:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 3, 2023, 1:35am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/1 "2023-12-03T01:35:32Z")

</div>

I’m new to building a scene and I was wondering if I’m missing something about placing many items.

I want to place many groceries on shelves, and it’s taking a long time to make things look natural e.g. spaced unevenly + rotated randomly. I have gotten pretty fast at doing it manually but I was wondering if there’s a better way.

I was wondering if procedural generation made sense, but is that overkill for my use case (a small grocery store level) and will it even be less performant than individually placed static meshes?

Thanks!

 ![Screenshot 2023-12-02 at 5.34.51 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/2/1028cd82818bc24d3aee298311647c52295152d5.jpeg)

---

<div class="post-metadata">

**Author:** ![jwatte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jwatte/32/744941_2.png) [@jwatte](https://forums.unrealengine.com/u/jwatte)\
**Post date:** [December 3, 2023, 2:18am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/2 "2023-12-03T02:18:10Z")

</div>

Procedurally placed meshes shouldn’t be any different from manually placed meshes of the same kind.  
If the meshes are not going to move, you’re going to want to use instance static meshes anyway, which is pretty easy to set up procedurally.

What I would do, would be to define some blueprint that can spawn arrays of some mesh in an X/Y grid, with adjustable center-to-center offset, and adjustable amount of random variation in X and Y location and adjustable random rotation. For very fancy, I might even run collision detection such that I made sure no two meshes overlapped after position permutation.

Make the actor have an instance static mesh component. In the actor construction script, delete all previous instances, and re-spawn the meshes based on the seed and permutation parameters of the blueprint.

You could make the area be some editing widget, or just use a plane widget that’s scaled to whatever the coverage area is, and grab its position/size in the construction script.

Another common feature in these kinds of systems is to allow randomly selecting between a few meshes, with different percentage chance. And/or, use something like a material instance parameter to make some of the meshes a little dinged/dented/scruffed.

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [December 3, 2023, 2:48am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/3 "2023-12-03T02:48:51Z")

</div>

Hi nworb999,

I’ve got a fast c++ randomized placement system on the market that works really well for this kind of thing, rdBPtools - I’ve got a tutorial on how to stack shelves like that here:

> **[rdBPtools Tutorial 3 - Recourse Design ltd.](https://recourse.nz/index.php/rdBPtools-tutorial-3/)**
>
> rdBPtools Tutorial 3 – Adding Random Transforms and Reliance Last Updated: 25th October 2022 This tutorial uses the second Blueprint type included with the plugin. Using this Blueprint allows you to randomize every asset included in it – from it’s...

---

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 3, 2023, 7:55am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/4 "2023-12-03T07:55:20Z")

</div>

Thank you so much for the detailed reply! If I wanted some of these items to be interactable e.g. a character can pick them up, can I use this method? Or would I use this method for the 90% of items that won’t be interactable and then place them manually like normal for the ones that would be interactable?

---

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 3, 2023, 7:56am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/5 "2023-12-03T07:56:11Z")

</div>

Dang – this looks perfect except that I am on a Mac ! 🫠

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [December 3, 2023, 8:24am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/6 "2023-12-03T08:24:52Z")

</div>

In theory, all my products should compile OK on Mac - they work on linux, I just don’t have access to any Mac hardware (would just need to add Mac in the .uplugin file).

If you were interested, and you’ve got XCode installed, I could give you a free copy to try - if it build’s you’re welcome to use it - just email me at rd@recourse.nz if you want.

---

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 3, 2023, 8:32am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/7 "2023-12-03T08:32:39Z")

</div>

I do have Xcode installed! Thank you so much for the offer. I just emailed you.

---

<div class="post-metadata">

**Author:** ![jwatte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jwatte/32/744941_2.png) [@jwatte](https://forums.unrealengine.com/u/jwatte)\
**Post date:** [December 3, 2023, 5:41pm UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/8 "2023-12-03T17:41:15Z")

</div>

It is totally possible to build code that allows interacting with static mesh instances.  
I built a “wood cutting” system like that before.  
The trick is to do interaction detection against the instances of the static mesh, and then suppress those instances and replace them with a real static mesh if you want to “break free” from the static meshes.  
If you simulate physics, you could even “merge back” the instance once it reaches physics idle, depending on what specific gameplay you’re interested in.

> **[Instanced Static Mesh](https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Components/InstancedStaticMesh/)**
>
> Instanced Static Mesh

The main trick is looking up the instance index (“id”) within the instanced static mesh component as part of whatever line trace you’re using to detect interactable objects, so you know which instance to operate on.

One way to “suppress” an instance is to scale it by zero/zero/zero, btw. You don’t need to delete it. And a zero size instance will still have some transform cost, but it has no pixel/screen cost.

---

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 5, 2023, 7:29am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/9 "2023-12-05T07:29:22Z")

</div>

Thank you so much for taking the time to respond! That makes sense. Thank you for the documentation link as well.

I also did not know about that instance suppression trick! Or that there are separate transform and pixel/screen costs (I am new to graphics and only have experience with software engineering) but that is good to have in mind.

🤠

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [December 5, 2023, 7:57am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/10 "2023-12-05T07:57:11Z")

</div>

Hi nworb999,

Did you get a chance to try compiling rdBPtools on the Mac?

---

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 5, 2023, 10:22pm UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/11 "2023-12-05T22:22:02Z")

</div>

Hi there! I just got around to trying. I dragged the unzipped plugin folder into a newly created `Plugins` folder in the root of my project directory (`TransLab_NPCRedux 5.3`), and tried to open the project in Unreal and am getting the following. For reference, I am on 5.3.2 right now, so maybe that is too recent? I will try building manually now (let me know if you have a go-to strategy for that).

![Screenshot 2023-12-05 at 2.21.29 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/c/27cae0dcfd62362a6a11784de223f11cb0e66136.png)

---

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 6, 2023, 12:23am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/12 "2023-12-06T00:23:39Z")

</div>

Update – I followed [these](https://forums.unrealengine.com/t/how-to-manually-build-plugins/352910) instructions (with a clean C++ project) and still no luck, I will look for another guide but in the meantime, I might try using one of the university’s computers.

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [December 6, 2023, 1:00am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/13 "2023-12-06T01:00:13Z")

</div>

It sounds like there are errors during compilation so there must be some difference in code needed between Mac and Windows/Linux - I really need to save up and get a Mac to test on!

Thanks for trying!

---

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 6, 2023, 1:08am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/14 "2023-12-06T01:08:36Z")

</div>

Actually, I was just able to get a project to open with the instructions below!

> [@How to compile a plugin project with XCode](https://forums.unrealengine.com/t/how-to-compile-a-plugin-project-with-xcode/3275/10):
>
> For everyone who needs to compile plugins on a Mac you need: Mac with UE installed. Blank C++ project. Create a folder named “plugins” inside your project. Inside “plugins” folder create your actual plugin folder with Source and uplugin files. Delete Intermediate and Build folder from your plugin. Inside your .uplugin file add “OSX” to the whitelist. Generate XCode files by right clicking your uproject file. Double click the uproject file to open UE4. Compile. After that you should have Binar…

I will see if I can use it properly, but it built!

---

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 6, 2023, 1:21am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/15 "2023-12-06T01:21:49Z")

</div>

Update, so the plugin is visible:

 ![Screenshot 2023-12-05 at 5.12.50 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/8/6/18693be6f4e826a911b91b796dab7b5e9d424f58.png)

But I don’t see anything new in the dropdown menu when I try to select multiple actors and create a container:

 ![Screenshot 2023-12-05 at 5.20.51 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/e/2/8e274cca2fe5c6b5874610f81a4e3796a5764ff9.png)

---

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 6, 2023, 1:25am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/16 "2023-12-06T01:25:48Z")

</div>

In the meantime, is it possible to set up a scene with this plugin on a Windows machine, and have the actors persist somehow if I were to transfer the project back to a Mac machine?

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [December 6, 2023, 3:44am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/17 "2023-12-06T03:44:24Z")

</div>

That’s good progress! Are there any mentions in the output log about it?

If you copy the “rdBP” folder along with the actors you’ve created it should work fine.

---

<div class="post-metadata">

**Author:** ![nworb999](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nworb999/32/813426_2.png) [@nworb999](https://forums.unrealengine.com/u/nworb999)\
**Post date:** [December 6, 2023, 7:14am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/18 "2023-12-06T07:14:55Z")

</div>

Here’s all I see in the output log:

 ![Screenshot 2023-12-05 at 10.16.00 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/8/2a855ca96b6ca8307474db84c09aa9d8492b3588.png)

Good to know re. the transfer – is there a way to convert blueprints back out of the system your package uses to manage them in case that wouldn’t work?

In the meantime, I will try it on the Windows machine and then try importing it back to my Mac.

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [December 6, 2023, 8:32am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/19 "2023-12-06T08:32:32Z")

</div>

Thanks, I’ll have to try and work out why the menus aren’t showing.

Yes, in the plugin zip you’ll find a folder called "Content\Blueprints" that has those files - you can copy them into a rdBP folder in your project.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [January 5, 2024, 8:33am UTC](https://forums.unrealengine.com/t/placing-many-items-for-grocery-store-performantly-quickly/1454774/20 "2024-01-05T08:33:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
