Sindre burd cpp#185
Open
sinndre wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.