How to create a more efficient grid based drag select on spawn actors?

Hi, I hope I’m submitting this correctly this is my first post here.

I was wondering what the best setup would be for a grid based selection system using click and drag?

I’ve built something functional and the system “Works” (big quotation) but I want to understand the proper methods for implementing blueprints and improve performance.

Currently I have two line traces which read the hit locations of two points and create a collision box between these.

I then Spawn that as an actor and use it for collision events such as setting the material or making the grid actors hidden.

However I’ve found it’s incredibly heavy on performance once you start dragging (from 60fps to 5fps, completely unacceptable) so I was wondering if anyone would have suggestions for better alternatives?

I’m currently using the tick event to drive the box generation and overlap events to select the grid instances so they can change material and be hidden on deselection.

The interesting thing is it’s pretty much only the point I start spawning the collision box that it tanks the performance, I disabled basically everything else and only had the collision box spawn and it still drops the fps, so I suspect it’s something to do with the dumb dumb method I used to make it.

I started learning unreal only a couple weeks ago so I’m still at a very basic level of understanding with blueprints.
I’m trying to develop a simple dungeon builder system similar to evil genius and dungeon keeper for the purposes of learning and I wanted to tackle my own approach first however stupid it may be, just so I could learn better (worked really well so far since I need to learn why something doesn’t work or what I might use to do something, but don’t want to make bad habits)

I apologise for what I can only assume is a horric blueprint setup.

I’ve been trying to find any information but there’s nothing quite covering this.
Any suggestions would be incredibly helpful.

Thank you!

I managed to partially figure out the issue. It’s due to the event tick, I’m pretty sure it’s flipping between the two line traces, so it’s updating the start and end points which makes it look smooth in the game view but so much that it’s lagging the game.

When I don’t use the tick it runs perfectly fine, with no performance drop and kind of works ok, however it’s incredibly unreliable and buggy since it’s not updating in the same way, so you get flickering and selection issues.

So It definitely seems that my setup is an issue, I’ll just tweak the question to be “what would be a better setup?”, instead of what could be the issue.
I assume I still need a beginning point that’s static and end point that updates, but I have no idea how to implement that.
I’ve tried using a few methods but nothing seems to works so far.

Ah! I managed to create a much better setup after scrapping this one today, so this post can just be ignored for future reference.

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