Wiki Code Tutorials

[=;77812]
I will do a tutorial when I have enough time, but the core code to spawn constraint at runtime looks like !


//set up the constraint instance with all the desired values
FConstraintInstance ConstraintInstance;
//set values here

ConstraintComp = NewObject<UPhysicsConstraintComponent>(RootSMA);
if(!ConstraintComp) return;
//~~~~~~~~~~~~~~~~~~~~~~~~
//Update Vibes!
ConstraintComp->ConstraintInstance = ConstraintInstance;
//~~~~~~~~~~~~~~~~~~~~~~~~
		
//Set World Location
ConstraintComp->SetWorldLocation(RootSMA->GetActorLocation());
			
//Attach to Root!
ConstraintComp->AttachTo(RootSMA->GetRootComponent(), NAME_None, EAttachLocation::KeepWorldPosition);
		
//~~~ Init Constraint ~~~
ConstraintComp->SetConstrainedComponents(RootSMA->StaticMeshComponent, NAME_None, TargetSMA->StaticMeshComponent,NAME_None);

EDIT never mind it didn’t take that long

I am even sharing my physics constraint library functions with you!


**New Wiki Tutorial

[COLOR="#000000"]Creating Dynamic Physics Constraints During Runtime

My Physics Library Functions Included!**[/COLOR]

https://wiki.unrealengine./Physics_Constraints,_Create_New_Constraints_Dynamically_During_Runtime


[/]


Pffft... show off. Haha, i'm kidding. Great work and thanks for the new tutorial!

I love it. Thank you so much!

[= Kyp;78694]
Pffft… show off. Haha, i’m kidding. Great work and thanks for the new tutorial!
[/]

You’re welcome!

[=BlackRang666;79087]
I love it. Thank you so much!
[/]

Yaay!

:o

Wow your the best (and really seem to be saving the Epic team quiete some work)!

[=;80439]
Wow your the best (and really seem to be saving the Epic team quiete some work)!
[/]

Haha thanks !

Great to hear from you!

:heart:

New Tutorial!

Packaged Game Paths, Obtain Directories Based on Executable Location

https://wiki.unrealengine./Packaged_Game_Paths,_Obtain_Directories_Based_on_Executable_Location

Enjoy!

**New Tutorial!
**
Wiki Tutorial on Global Data Storage
https://wiki.unrealengine./Global_Data_Access,_Data_Storage_Class_Accessible_From_Any_CPP_or_BP_Class_During_Runtime!

[FONT=Comic Sans MS]New Tutorial!

File Management, Create Folders, Delete Files, and More!

https://wiki.unrealengine./File_Management,_Create_Folders,_Delete_Files,_and_More!

[FONT=Comic Sans MS]Entry Level Guide to UE4 C++

wiki page is devoted to reducing the intensity of the C++ entry point for new coders!

https://wiki.unrealengine./Entry_Level_Guide_to_UE4_C%2B%2B

Enjoy!

Heheh you are such an extraordinary good person!
you have helped me out soo much and I bet lots of other people too,
it comes a bit late, but just wanted to finally thank you for all the amasing stuff you have put out there :heart:

[=real;101961]
Heheh you are such an extraordinary good person!
you have helped me out soo much and I bet lots of other people too,
it comes a bit late, but just wanted to finally thank you for all the amasing stuff you have put out there :heart:
[/]

Hee hee!

It’s never too late!

Thanks Real!

Lovely to hear from you!

:heart:

[=;103526]
Hee hee!

It’s never too late!

[/]

I want to take opportunity to thank you as well.
Your tutorials help me out a lot of times, I don’t know what I would do without them :smiley:
So… thank you so much for your efforts, dude! :wink:

[=Rakantor;103581]
I want to take opportunity to thank you as well.
Your tutorials help me out a lot of times, I don’t know what I would do without them :smiley:
So… thank you so much for your efforts, dude! :wink:
[/]

Thanks Rakantor, great to hear from you!

:slight_smile:

[FONT=Comic Sans MS]Featured Tutorial

File Management, Create Folders, Delete Files, and More!

https://wiki.unrealengine./File_Management,_Create_Folders,_Delete_Files,_and_More

[FONT=Comic Sans MS] AI Blows Stuff Up

https://youtube./watch?v=gjCDA_FiVxk

Everything you see in the video is completely dynamically calculated by me in the C++!

Nothing is pre-scripted!

I do not even tell the AI units what to target when they are spawned!

Everything you see is my own AI system at work

  1. all the pathing is my own pathing system, from scratch

  2. I set up an Alignment system so the AI units know who is friendly and which structures to attack

  3. The AI is told by me to spread out, and keep track of which structures other friendly units are attacking.

maximizes their usefulness to each other, as they cover maximum building surface area!

Meaning, if a new AI unit is trying to pick a target, my AI will try to pick a target that no other friendly in the area is attacking yet.

  1. Each AI unit is keeping track of all nearby friendly units during runtime, dynamically updating its personal list of friendlies every few moments.

means each AI unit is aware of all friendlies at all times, as well as all nearby structures

  1. When a structure is destroyed, each AI unit tries to find a new target

  2. Apex destructibles block the AI pathing, so they try to get around using my dynamic physics pathing system.

  3. Each AI unit is consciously deciding how far to position itself away from the target building for ideal melee range.

  4. Each AI unit is deciding when it is close enough to the surface area of its target structure and then stops moving and begins attacking.

  5. As I said, nothing is pre-arranged, as you saw I ran multiple tests! The AI is spreading and and performing to all my specifications listed above!

  6. Yay! Victory!!!

:slight_smile:

PS: the sparks are created at the precise point in the animation sequence that I specify, using an anim notify.

anim notify then calls my C++ AI function for doing damage.

So the visual appearance of doing damage is indeed triggering my C++ AI system !

The visual appearance and the C++ are linked together completely!

[=;116795]
[FONT=Comic Sans MS] AI Blows Stuff Up

[/]

That is amazing. Any thoughts on posting some code snippets? If not, curious what you’ve put together for your custom pathing. Vector grids, some A* flavor, or just some forward looking system? Curious to hear how it might handle changes in elevation or dead ends.

[=;118274]
That is amazing. Any thoughts on posting some code snippets? If not, curious what you’ve put together for your custom pathing. Vector grids, some A* flavor, or just some forward looking system? Curious to hear how it might handle changes in elevation or dead ends.
[/]

Haha someone else asked that!

I write all my algorithms myself without any references, ever :slight_smile:

I always create purely from my own logic and imagination, and so everything you see me do is my own original work.

Sooo, my system does not have any algorithm names that I can reference to you, its all my own Code :slight_smile:

The same is true of my code on my wiki tutorials, except where I specifically reference other people!

See my Code in action in video!

https://youtube./watch?v=gjCDA_FiVxk

PS: I am still deep in development so I dont want to share any code yet because it is subject to change right now, but the only interface I have with UE4 character movement is right here:


CharacterMovement->Velocity += Mycode Takes Over Here

All the rest of my code base is my own calculations for when and what kind of velocities to apply to the character movement component :slight_smile:

Fortunately, thanks to Epic, just by doing my AI system way, my AI system is already replicated perfectly , since UE4 replicates CharacterMovement so well!

Well, in that case, I’ll just call that nav system “impressive.” Well done. Your code comment actually lead me to your tutorial on custom character movement component on the wiki. Something that I might give a try, thank you for putting that together!

[=;120626]
Well, in that case, I’ll just call that nav system “impressive.” Well done.
[/]

Hee hee thanks!

Hello.
Is your C++ based GUI/HUD system (as shown in your tutorials) platform independent?
I.e. will they work the same on PC, XBox, PS4, etc?

I need an in-game list/combo box and, like you, may have to implement it myself. I’m currently looking through Slate/Widget resources to see if they can do what I need without having to start from scratch.