How to protect the game from bad optimization and yourself? How to protect yourself from a useless waste of time

/Yo, hello, before we started i very sorry for my language, english is not my native language./

For a month I decided that I wanted to make my own indie game using blueprints. It’s all in the planning stage right now. I really want the game to be with a minimum of bugs and with good optimization. The game will be a simple but complete project, that’s my goal.

Actually, I have a question how to optimize something. I have a slightly unusual camera and I need help. Below I will tell my plan with screenshots and video.

  1. There will be corridor locations for the main story, with dead ends for side quests or secrets. The player observes the character from points in space prepared by me. That is, the player does not control the camera. An example is Resident Evil 2, but adjusted for the fact that the camera rotates towards the player. An example is Dino Crisis.
  2. As the player moves around the location, the camera continues to change rotation, watching the player’s character, but also changes its position in space, according to pre-prepared points. In RE2, the camera jumped sharply, and I want it to smoothly move from place to place (I want to prepare a camera route in advance).
  3. How I implemented it:
    There is a camera blueprint, it has two custom events (both are on EventTick):
  • Move the camera if its current location does not match the one I send to it.
  • Constantly rotate the camera so that it follows the player.

There is a level blueprint, it has a function, with an input parameter of type “Actor”. When I need to change the location of the camera, I call this function, overwriting the actor that is currently in it. The function takes the location of this actor and overwrites the “new coordinates” variable of the camera blueprint. When the variable “new coordinates” get another value, the camera starts moving to the new location.
A function that sends new coordinates to the camera through an actor (which I send to this function):

At the moment, this is all implemented in a crutch (poorly optimized): when the player passes the trigger box, EventBeginOverlap calls a function, that writes a empty actor and passes its coordinates(location) to the camera blueprint. After this camera starts moving to new location (the same location as that new empty object):

  1. What kind of help I’m asking for: I’m ready to set all emptyes in order to choose in advance from what angles the player will observe his character. But now this is implemented through trigger boxes, and for each change in the camera location, I need to create an event in the level blueprint that calls a function that changes the camera coordinates. In total in finished game there will be some insane amount of emptyes (i need then send their location to camera) and triggerboxes needed just to change camera coordinates. Can this be optimized somehow? I’m new to UE, and don’t know what tricks can be made with blueprints.
    Is it possible to make the camera idontknow do get all actors of class (Empty), find out by itself which of the Empty is closest to it, and take its location? Or, for example, can I make a vector array, fill it with the coordinates of the observation points, so that the camera would take this array, compare the values ​​​​in it with the current camera location, and move to the nearest point found in this array?
    Of all the games I’ve played, the best camera implementation was in The Last Campfire. I really want to do something similar, without resorting to an insane amount of trigger boxes and emptyes if possible.

Below I am attaching links to a small piece of Last Campfire gameplay. and a link of video of my implementation.

The Last Campfire:

My progress:

I would be grateful for any ideas how to optimize this whole process. Please help the newbie make a good, playable game, not a buggy crutch craft (we all started with this, right?)

Thank you!

It looks really lovely :slight_smile:

You can make a blueprint which holds a collision box ( which you can tweak ) and a camera position ( which you can also tweak ). You place these BPs around the level.

When the player overlaps one, the BP itself tells the camera to move to its viewpoint.

You can either make the collision box adjustable as a BP parameter or the BP can have a reference to a box in the level. Same with the viewpoint. You can have a viewpoint in the BP, and make it’s position moveable by a vector widget, or again, you can have a very simple BP that just marks a position, and refer to it from you main BP. Sometimes its just easier to move objects around, then set vector 3D widgets.

1 Like

Cant understand how i have idea about function in level blueprint, but didnt have idea about BP, which have a box and coordinates inside. Thats really great idea, big thank you, really simple, but really cool!
I think it almost can answer my question. Maybe someone else can suggest some other ideas. Will be great, if i have a lot of versions how to solve camera problem. But right now your idea looks so sеxy, big thank to you!


No worries. Tell me if you have any problems.

1 Like

Well, looks like no more ideas. Okay, we found a solution. :slight_smile: Danke

1 Like