Skip to content

Sindre burd cpp#185

Open
sinndre wants to merge 2 commits into
mainfrom
Sindre_Burd_CPP
Open

Sindre burd cpp#185
sinndre wants to merge 2 commits into
mainfrom
Sindre_Burd_CPP

Conversation

@sinndre

@sinndre sinndre commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

28.04.2026
Bird BP and tasks conversion to C++
EnemyBird base class:
Started out by making an EnemyBird class to replace BP_Bird. Put all the variables from the BP in the header with the BlueprintReadWrite thing.
For the RestingLocation variable, I asked the UE AI assistant what vector would be appropriate, and it said FVector is the most normal and that it has doublefloat presicion which makes it fine to use for a coordinate.
For the PatrolsDone variable I used int32, not because it is necessary, but because the AI assistant said it is a good general practise to use it for UE game development, primarily because then the size of the int is fixed and that is good for many reasons.
In EnemyBird cpp file, I called the Attack_Implementation from Bossman’s EnemyBase, then made the launch towards the character using PKvectors.

EnemyBirdEnsureFlyingTask:
Made this class parented from UStateTreeTaskBlueprintBase because Bossman said so. Also, made one function, which forces the bird into MOVE_Flying and returns succeeded to the state tree.

EnemyBirdPatrolTask:
Made this class parented from UStateTreeTaskBlueprintBase because Bossman said so.
The patrol task generates a random vector, then multiplies with radius in X and Y. The uses some Abs thing to ensure it does not fly lower than it’s resting spot; I discussed this with Bossman and it is the easiest way to make it not fly straight into a floor somewhere. It then adds it new location vector to the resting spot location and sets target location.

EnemyBirdIdleTask:
Since we use tick in this task, I hade to make return type of the StateTreeRunStatus fit the parent. I made it say Failed, Running or Succeeded at every tick, depending on the ifs.

Got sad and confused and I don’t have time to do anymore, so I solved it by asking Bossman to fix everything.

sinndre added 2 commits April 28, 2026 23:09
28.04.2026
Bird BP and tasks conversion to C++

EnemyBird base class:
Started out by making an EnemyBird class to replace BP_Bird. Put all the variables from the BP in the header with the BlueprintReadWrite thing.
For the RestingLocation variable, I asked the UE AI assistant what vector would be appropriate, and it said FVector is the most normal and that it has doublefloat presicion which makes it fine to use for a coordinate.
For the PatrolsDone variable I used int32, not because it is necessary, but because the AI assistant said it is a good general practise to use it for UE game development, primarily because then the size of the int is fixed and that is good for many reasons.

In EnemyBird cpp file, I called the Attack_Implementation from Bossman’s EnemyBase, then made the launch towards the character using PKvectors.

EnemyBirdEnsureFlyingTask:
Made this class parented from UStateTreeTaskBlueprintBase because Bossman said so. Also, made one function, which forces the bird into MOVE_Flying and returns succeeded to the state tree.

EnemyBirdPatrolTask:
Made this class parented from UStateTreeTaskBlueprintBase because Bossman said so.
The patrol task generates a random vector, then multiplies with radius in X and Y.  The uses some Abs thing to ensure it does not fly lower than it’s resting spot; I discussed this with Bossman and it is the easiest way to make it not fly straight into a floor somewhere. It then adds it new location vector to the resting spot location and sets target location.

EnemyBirdIdleTask:
Since we use tick in this task, I hade to make return type of the StateTreeRunStatus fit the parent. I made it say Failed, Running or Succeeded at every tick, depending on the ifs.
EnemyBird base class:
Started out by making an EnemyBird class to replace BP_Bird. Put all the variables from the BP in the header with the BlueprintReadWrite thing.

For the RestingLocation variable, I asked the UE AI assistant what vector would be appropriate, and it said FVector is the most normal and that it has doublefloat presicion which makes it fine to use for a coordinate.

For the PatrolsDone variable I used int32, not because it is necessary, but because the AI assistant said it is a good general practise to use it for UE game development, primarily because then the size of the int is fixed and that is good for many reasons.

In EnemyBird cpp file, I called the Attack_Implementation from Bossman’s EnemyBase, then made the launch towards the character using PKvectors.

EnemyBirdEnsureFlyingTask:
Made this class parented from UStateTreeTaskBlueprintBase because Bossman said so. Also, made one function, which forces the bird into MOVE_Flying and returns succeeded to the state tree.

EnemyBirdPatrolTask:
Made this class parented from UStateTreeTaskBlueprintBase because Bossman said so.
The patrol task generates a random vector, then multiplies with radius in X and Y.  The uses some Abs thing to ensure it does not fly lower than it’s resting spot; I discussed this with Bossman and it is the easiest way to make it not fly straight into a floor somewhere. It then adds it new location vector to the resting spot location and sets target location.

EnemyBirdIdleTask:
Since we use tick in this task, I hade to make return type of the StateTreeRunStatus fit the parent. I made it say Failed, Running or Succeeded at every tick, depending on the ifs.

God sad and confused and I don’t have time to do anymore, so I solved it by asking Bossman to fix my mess.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant