Available, Counseling, Steam/Multiplayer Code, UI, C++ Game Mechanics

Hi!

I was 's client and asked him for this socket receiver. I was a bit stuck with C++ and the engine but knew if I could just get a line in from the outside i’d be able to get all of my game logic working really well in an external python script. My project is actually a realtime graphic system which displays graphs and stats for a quiz type game. I’ve got the graphics all running nicely in UE and all of the control logic running in Python, and i’m controlling that using TouchOSC on the iPad. Python sends strings, variables and other triggers to UE through 's socket BP plugin.

I contacted because he obviously knows a lot about the engine. Although, like he said, he knew nothing about sockets etc he totally nailed the plugin and gave me exactly what I asked for. It works brilliantly and never drops data, he also made it work nicely with 4.4 recently.

If you need something like this , I’d have no hesitation in recommending , as long as you like hearts and the word VICTORY! dotted all over the emails and screenshots (and massive yellow text). I’ll certainly be calling on him again shortly.

.

Hi , just wanted to tell you that your tutorials have been an invaluable resource for learning ue4. Any chance you’re available for phone/skype counceling? I just sent a pm. Thanks,

I am glad you’ve been enjoying my tutorials, yay!

:slight_smile:

Victory BP Library Nodes Spotlight

Just last night I used two of my own Victory BP Library nodes to help a client! Recall that my Victory BP Library nodes are a set of nodes I am giving to the community for free!

You can download them :


**Get OS Time 
Get Hours/Minutes/Seconds Since Last Record Time**

I used these two nodes with a client just last night to help them make a game where they could record the amount of real world time that has passed since someone last played their game!

So their goal was to know exactly how many hours minutes and seconds have passed since  a player logged of their game last!

It was really easy actually thanks to my Get OS Time nodes!

** are the steps:**

1. make a new save object with a simple String variable

2. when saving the object, use my Get OS Time node and use the return value

3. When loading, use my Get Time Passed Since Last Recorded Time node!

That was it!

's a picture for reference!

![OSUpdate.jpg|1280x960](upload://b5ScGykuHpKI4gWMZuhiUcM40db.jpeg)

Enjoy!

New AI Video, Ranged Units

Dear Community,

I have just released a new video!

This is a very sophisticated high tech demo of ranged AI units using a very special mesh provided to me by forum member Jacky!

After the first round of Sheer Intensity, you will see Jacky’s animation skills at work to animate the co…I mean ranged unit!

Many thanks to Jacky for the ranged unit model, you can find a download link to it earlier in this thread!

Thanks Jacky!


**Gameplay Balance**


**Please be aware, I've carefully balanced this unit, though it may require a bit more testing.**


Team Based Area of Effect Explosions

This video also is a demonstration of Team-based AOE damage, where the melee allies of the ranged unit dont take damage, but opposing units are sent flying in all directions if they are not out right returned to their natural Tree-dom.

Enjoy!

=EHBs5GMxxN8

Procedural Animation, 3ds Max Rigging, AI

A Replicating Procedurely-Animated Flying Character With AI

I wanted to walk you through one way you can do procedural animation in combination with AI in UE4!

See my video below for a demonstration of what I mean!

The entire animation and movement of the flying creature is procedural / AI !

There are no animations for this creature at all, other than 9 still poses!

Yet see how I can completely animate the flying creature by blending the aim offsets from my C++ AI code!

And as you can see in the video, my procedural animation system replicates to the client smoothly!

I use interploation to smoothly update the client creature’s rotations to match the rotations being sent from the server!


**'s Procedurally Animated Flying AI Creature**
://.youtube.com/=ApvYCqSuHTc


Background

I was given a static mesh of a flying creature looking straight ahead, and did everything you see in the video myself!

Which included the following:

  1. Rigged the creature in 3ds max, doing all the manual bone weighting myself
  2. Made 9 poses to serve as aim offsets for a blendspace
  3. Brought the creature into UE4, setting up the blend space, the custom C++ anim instance, and imported all the animations
  4. Wrote all the C++ to utilize the aim offsets in code and give the creature AI to move around to adjust itself to be able to always look at its target.

One of the key things to note is that I am updating the Animation Blueprint from C++ using a custom AnimInstance class!


**Rigging in 3ds Max**

If you'd like to do something like this for your own project, I can explain the 3ds max steps!

I used a simple bone chain, refined the bone weighting myself after using envelopes, and then made 9 poses!

As I made each pose and improved the vertex weighting, I reverted the bone chain to straight to update the neutral pose with the most recent vertex weighting info.

**Bone Chain 1**
![64cfd3a0d8da53b189ccbd256c64079dd8d1c9ed.jpeg|965x764](upload://enP0Qqq6muTvgPWbF0FNYGwXIo5.jpeg)

**Bone Weights**
![143ef8de67fc2f764b6ace96a725e6f0877b977e.jpeg|1280x960](upload://2T6sVCV8tbK5sIy96PQpyoLNoMm.jpeg)

**Blend Space**
![5bfa961cb34d4b93f8cd43a1fb0e5fc14f429f87.jpeg|1280x960](upload://d7Gknj6Hbxy2tLhrILtSfc95uuz.jpeg)

C++ Code Sample

Below I have included my main engine that controls how my AI procedurally animated creature works

It goes like this basically

  1. if the target is too far away, the AI unit should move closer
  2. if the target location is below the AI unit, AI unit should back up
  3. if 1 and 2 work, check and see if the AI unit needs to change rotation to face target
  4. if 1-3 work, then update the AI unit’s aim offsets via custom C++ anim instance!
  5. when #4 happens, send the updates over the network to all clients and have the clients smoothly interplate to the new net am offset rotations.


void AShip::TrackPlayerUnit()
{
	**//Tracked Location! This is the Player Unit's location!**
	FVector TrackedLocation = Tracking_GetTrackedLocation();
	
	**//Is the location too far?**
	const FVector EyeLocation = Mesh->GetSocketLocation("Tip"); **//EYE SOCKET**
	
	**//Using Square Dist checks as they are more cpu efficient 
	//	and these checks run every tick that the unit is doing tracking**
	if( FVector::DistSquared(
			FVector(TrackedLocation.X,TrackedLocation.Y,0),		**//discount Z**
			FVector(EyeLocation.X,EyeLocation.Y,0)				
		)  > MovePosition_TargetIsTooFarDistance * MovePosition_TargetIsTooFarDistance)
	{ 
		Tracking_TargetTooFar = true;
	}
	else
	{
		Tracking_TargetTooFar = false;
	}
	
	**/*
		Location Under Ship?
	*/**
	FRotator AngleToShipCenter = UVictoryCore::StandardizeRotator((GetActorLocation() - TrackedLocation).Rotation());
	
	**//Is the pitch angle from ship center to tracked unit too big?**
	const float PitchToShip = FMath::Abs(AngleToShipCenter.Pitch);
	if( PitchToShip >= MovePosition_AngleToShipMaxAllowedPitchBeforeMove)
	{
		Tracking_NeedToMove = true;
	}

	**//Using a bone further from head for better interp stability**
	FVector StableBonePos = Mesh->GetSocketLocation("Bone011");
	
	FRotator AngleTo = UVictoryCore::StandardizeRotator(
		(TrackedLocation - StableBonePos).Rotation()
	);
	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
	
	
	**//~~~ Get Local Space Rot of New Proposed Angle ~~~**
	FVector AngleToDir 		= AngleTo.Vector();
	AngleToDir 				= ActorToWorld().InverseTransformVectorNoScale(AngleToDir);
	FRotator ActorSpaceRot 	= AngleToDir.Rotation();
	
	**//Creature should adjust position!
	//		unit is too close or too far!**
	if(FMath::Abs(ActorSpaceRot.Pitch) > 80)
	{  
		Tracking_NeedToMove = true;
		return;
	} 
	   
	if(FMath::Abs(ActorSpaceRot.Yaw) > 80 )
	{  
		**//Dont update if yaw is too big!
		//		Turn to face the player's unit!**
		Tracking_NeedToTurn = true;
		return;
	} 

	Tracking_NeedToMove = false;
	 
	**//Pass the new rotation to all clients!
	//		and update aim offsets!**
	SERVER_UpdateSpiritRotationGoal(AngleTo);
	
	if(DrawUnitTrackingTrace)
	{
		UVictoryCore::DrawLine(TrackedLocation,GetEyeLocation());
	}
}


Enjoy!

Took me a few minutes to get to this reply thread.

SWEETEST THING EVER for me!!! Amazing does it again :smiley:

It is so creepy and cool how their heads follow the player. Awesome job yet again, !

Hee hee great to hear from you Jacky!

UMG Implementation of Steam/OnlineSubsystem Friends List

I just finished making a UMG implementation of my Steam’s Friends List!

Enjoy!

Some features:

  1. Simply click on friends name to join their game if they are playing same game as you and are hosting

  2. The color of the name indicates if they are online or not!

  3. Tooltip when hovered also tells you if they are online ornot

  4. The list dynamically updates while it is visible, I used ScrollBox -> Clear Children to do this

  5. Actual online interface is completely generic, I am just showing Steam cause that’s what I have :slight_smile:

:heart:

's BP Pull Requests Accepted in 4.5

Dear Community,

I’ve put together a pic with most of my BP-related pull requests that Epic accepted that are now in the Engine as of 4.5!

I made these pull requests for your benefit, and wanted you to know these new tools that are available to you!


*(download or right click -> open in new tab to easily zoom in!)*
![0c0e2f7ab5f7f8d9a6080be22203cae400611afc.jpeg|1280x960](upload://1IE7ysc9X9NUdKPDRaO5YKly2oA.jpeg)

**Random Point in Bounds** 

You can now easily obtain random points within the total bounds of an array of actors, or within the bounds of a single component!

For example, you can use this **to play random sparkle emitters** with the bounds of a group of level actors, or a single volume, or even just a single component!


**Line Trace Component Returns Bone Name now** 

You can now easily find out what bone was hit when you do a Line Trace Component!


**Color Interp** 

You can now interpolate between two linear colors!

Please note the first input should be your current value that is carried over from tick to tick :)

**Vector - Rotator**

You can now drag from a rotator pin directly to a vector pin, and vice versa, and the correct conversion node is created for you!


**CoPlanarity Test** 

Please recall from 4.4 that my submitted CoPlanarity Test BP node was accepted and is available for your use! Any time you need to know if 4+ points are coplanar you can use this node! There is a tolerance value that you can control! **The tolerance is in World Space**

Improvements Made to Get Actors in Selection Box

In 4.5 you can now specify whether to only check against colliding components when checking if an actor is within your selection marquee / selection rectangle!

HUD BP

Enjoy!

:heart:

Fun With Beams!

This video shows the Ship Creature’s charge up affect as it prepares to blast the ground to create new structures or deal with unauthorized base visitors!

In this video I am using several kinds of beams in several different ways!

=oGPCi0Gyiow


**Beam Types**

1. straight beam, with source in local space, target in world space. Target is set in C++ to match position of the unit.

2. arced beam, with a tangent that is getting set in code, source in local, target in world/absolute space

3. straight beam with a source point in world space that is set in code, and a target that is in world space, also set in c++.

The Hardest Part

The hardest part of what you see in the video was making the tangents for the arced beams stay consistent no matter which way the ship is looking in order to point directly at its target!

I had to use an odd hybrid of world and local space to accomplish this :slight_smile:

's what the code ended up looking like!



//World Space Location of Target
NewBeamLoc = FMath::VInterpTo(
	NewBeamLoc,
	(VISVALID(Tracking_Actor)) ? Tracking_Actor->GetActorLocation() : Tracking_Location,
	GDELTATIME,
	12
);

 
//Half way between Eye of Creature and Target Location
const FVector MidPoint = (NewBeamLoc + GetEyeLocation())/2;
	
int32 Index = 0;
for(UParticleSystemComponent* Comp : BeamArcs)
{
	if(VISVALID(Comp))
	{
		//TEMP SHOULD REALLY BE HGIHER UP
		Comp->SetVectorParameter(FName("Target"),MidPoint);
		
		//Set the particle tangent position!
		if(ArcTangents.IsValidIndex(Index))
		{
			//Local Space settings set by Designers in Editor
			// 	as this controls the overall appearance of the arc.
			// 		not modified during runtime.
			FVector BPTangent = ArcTangents[Index];
			
			//World Dir
			FVector DirToTarget = (NewBeamLoc - GetEyeLocation()).SafeNormal();
			
			//World Right Vector
			FRotator WorldRight 	= FRotator(0,DirToTarget.Rotation().Yaw,0);
			WorldRight.Yaw 			+= 90;
			 
			//Oddly enough, Tangent has to start at 0!  Strange but true!
			//		(would have thought it would be be the beam anchor location)
			FVector Tangent 			= ZEROVECTOR;
			 
			//Forward
			Tangent = DirToTarget * BPTangent.X;
			
			//Right
			Tangent = WorldRight.Vector() * BPTangent.Y;
			
			//Up
			Tangent.Z = BPTangent.Z; 
			  
			//Tangent Beam Particle Parameter
			Comp->SetVectorParameter("Arc",Tangent);
		}
		Index++;
	}
}




Things to Note In My Code

1. The Designers can control the actual arcs of the beams in local space using a dynamic array of Vectors that I exposed to BP Defaults for the creature.

2. I am having to obtain the world direction and the world right direction between the eye of the Creature its current target, and then convert the local space coordinates set in BP into world positions. These world positions are the locations for the beam tangents that I set via beam particle parameter in Cascade.

3. **The end result is that the beam arcs stay consistent no matter how the creature rotates,** but, the beams are still tracking a world space location and the arched beams end at the midpoint betwen ship and its world space target!

Enjoy the Video!

♥

**New UMG Node

Get All Widgets of Class

Ideal for UMG Level Transitions**

I needed this node for Solus and so I am now sharing it with you!

The issue was that I could not save a reference to my new widget because it is loaded and then a level change occurs which resets all my HUD variables.

So I needed to access the widget after it was created dynamically, not relying on stored references within the HUD class.

I also did not want to have to store a reference to it in my Game Instance class cause then that leads to garbage collection issues.

I had to make the node for my own use and I have tested it as working in Solus!

**Now you can retrieve an array of any type of user-made UMG widget that is currently in your game at any time!
**


**Download**

https://wiki.unrealengine.com/File:VictoryPlugin.zip

C++ Code

's what the C++ for this node looks like!



void UVictoryBPFunctionLibrary::GetAllWidgetsOfClass(UObject* WorldContextObject, TSubclassOf<UUserWidget> WidgetClass, TArray<UUserWidget*>& FoundWidgets)
{
	//Prevent possibility of an ever-growing array if user uses this in a loop
	FoundWidgets.Empty();
	//~~~~~~~~~~~~
	 
	if(!WidgetClass) return;
	if(!WorldContextObject) return;
	 
	UWorld* const World = GEngine->GetWorldFromContextObject(WorldContextObject);
	if(!World) return;
	//~~~~~~~~~~~
	
	for(TObjectIterator<UUserWidget> Itr; Itr; ++Itr)
	{
		if(Itr->GetWorld() != World) continue;
		//~~~~~~~~~~~~~~~~~~~~~
		
		if(Itr->IsA(WidgetClass))
		{
			FoundWidgets.Add(*Itr);
		}
	}
}



**Pic**

(right click -&gt; open in new tab to see it better)
![GetAllWidgetsOfClass.jpg|1280x960](upload://k3rJSJemWVjAQ9p7eXZQVNYeJAl.jpeg)

Enjoy!

's a challenge for you xD
I can’t hire someone for it, but something like that in Marketplace I would pay whatever were to be charged… 100, 200, 500$… I would buy:
https://forums.unrealengine.com/showthread.php?3396-PAID-Dynamic-Mesh-Slicing-System

**'s Multiplayer Game Mode Solution

Find Player Start

Choose Player Start

Can Player Restart

These Core Multiplayer Functions are Fully Implementable/Overridable in Blueprints!**

I have found a solution for the issue of implementing FindPlayerStart, ChoosePlayerStart, and CanPlayerRestart in Blueprints!

And I’ve tested it as working!

**You can now implement core network coding of choosing player starts entirely in Blueprints!
**


**How To Use**

In my picture below I show how to use my Game Mode overrides!

1. **First make a new BP and select my VictoryGameMode class** which comes with my Victory BP Library (make sure you have the latest download https://wiki.unrealengine.com/File:VictoryPlugin.zip)

2. Setup the Victory Game Mode BP the same as my picture below!

3. Celebrate! You can now implement core multiplayer logic in Blueprints!

![VictoryGameMode.jpg|1280x960](upload://9IpVbBoysg8W1JaL94JHYMxDeVQ.jpeg)

CPP Override and CPP Override Var

Please note the notation I am using, any variable that has CPPOverride Var in its name is used only with the corresponding event. This is how I enabled you to override core Game Mode functions via my Victory BP plugin!


**Simple Data Types**

Please note that for the function that is designed to return a boolean value, CanPlayerRestart, you must pass the boolean and also a special variable, **CPPOverride SelfReference**, this is how you tell the CPP that you are implementing a BP override

Non Destructive Solution

My solution is entirely optional and if you do not implement the event in Blueprints, and your programmer does it in C++, my solution will not interfere at all with your existing code base!


**Log Message**

If you do implement my solution in BP, I am printing log information to indicate this, so you/your programmer knows you are using a BP override and any C++ code will not be run.

C++ Code

is my C++ code for FindPlayerStart which shows how I worked around the issue of overriding FindPlayerStart via Blueprints!

Again I’ve tested this as entirely working in PIE and commandline games!

.h



//Find Player Start
:
	/** Use this var inside the body of CPP Override ~ Find Player Start event to override the C++ functionality! */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Victory Game Mode")
	AActor* CPPOverrideVar_FindPlayerStart;
	
	/** 
	 * Use CPPOverrideVar_FindPlayerStart inside of this event to implement FindPlayerStart in BP ! <3 
	 *
	 * Return the 'best' player start for this player to start from.
	 * @param Player - is the AController for whom we are choosing a playerstart
	 * @param IncomingName - specifies the tag of a Playerstart to use
	 * @returns Actor chosen as player start (usually a PlayerStart)
	 */
	UFUNCTION(BlueprintImplementableEvent, meta=(FriendlyName = "CPP Override ~ Find Player Start"))
	virtual void CPPOverride_FindPlayerStart();

	virtual class AActor* FindPlayerStart( AController* Player, const FString& IncomingName = TEXT("") ) override;


.cpp



//Find
AActor* AVictoryGameMode::FindPlayerStart( AController* Player, const FString& IncomingName )
{
	//Clear any previous to indicate whether BP did an override
	CPPOverrideVar_FindPlayerStart = NULL;
	
	//=======================
	//BP Hook by 
	this->CPPOverride_FindPlayerStart();
	//=======================
	
	if(CPPOverrideVar_FindPlayerStart) //Did BP user set the var?
	{ 
		//Indicate that the BP override was found and is being used.
		UE_LOG(VictoryGameModeLog, Log, TEXT("

"));
		UE_LOG(VictoryGameModeLog, Log, TEXT("FindPlayerStart: CPP override found in %s and used instead of C++ implementation"), *GetName());
		UE_LOG(VictoryGameModeLog, Log, TEXT("

"));
		return CPPOverrideVar_FindPlayerStart;
	} 
	 
	//Default C++ Implementation
	return Super::FindPlayerStart(Player,IncomingName);
}



**Enjoy!**

BP Node to Get Your Computer’s IP Address!

Dear Community,

I’ve finally succeeded at implementing a node that many have been trying to implement since the Beta!

This is a BP node that gets the IP address of your computer!

My node relies on http://api.ipify.org, a free and easy way to get your current IP address.

Because this node involves an HTTP request I can’t make it a static library node, so I instead made a VictoryPC class that contains only this functionality.

You can easily re-parent your current player controller blueprint to use my plugin VictoryPC class!

File->Reparent

and if you are not using a PC already, make sure to go to World Settings and use my VictoryPC as your player controller!

As long as my Victory BP Library is an active plugin for you, then this VictoryPC class will show up!

Download:


**Celebration!**

Yay!

Now we can all get the IP address of the local computer for use with multiplayer games or webserver activities!

Enjoy!



Pic

's the setup you should create in your Blueprinted version of my VictoryPC!


**C++ Source Code For You**

 is the C++ source code I wrote just earlier today!



```


bool AVictoryPC::VictoryPC_GetMyIP_SendRequest()
{
	FHttpModule* Http = &FHttpModule::Get();
	
	if(!Http)
	{
		return false;
	}
	 
	if(!Http->IsHttpEnabled()) 
	{
		return false;
	} 
	//~~~~~~~~~~~~~~~~~~~
	
	FString TargetHost = "http://api.ipify.org";
	TSharedRef < IHttpRequest > Request = Http->CreateRequest(); 
	Request->SetVerb("GET");
	Request->SetURL(TargetHost);
	Request->SetHeader("User-Agent", "VictoryBPLibrary/1.0");
	Request->SetHeader("Content-Type" ,"text/html");
 
	Request->OnProcessRequestComplete().BindUObject(this, &AVictoryPC::HTTPOnResponseReceived);
	if (!Request->ProcessRequest())
	{
		return false;
	}
	  
	return true;
}
	
void AVictoryPC::HTTPOnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
{
	this->VictoryPC_GetMyIP_DataReceived(Response->GetContentAsString());
}
 


```



♥

Creating BP-Only AI Systems

Dear Community,

I really enjoy helping people create BP-only AI systems! I have my own special method that does not involve Behavior Trees, but gives me all the power and convenience of Blueprints.

I can help you add AI to your project without needing your whole project on my computer, using remote access IT tools or Skype!

I recently wrote this post explaining more about how you can do BP-only AI systems!


**AI in Blueprints Without Behavior Trees**

I routinely counsel people in BP-only AI systems that do not use Behavior trees, but rather a very simple system that I designed myself (no C++ or plugins required).


**For anyone who is interested:**

"AI movement and detection"

The real core of AI movement is  via the UE4 Navigation system, you can utilize its wonderful functionality without needing BTs.

Detection can be  easily in BP, especially now that we have **Vector Length Squared** in BP, so that more efficient distance checks are now possible.

Core of BP-Only AI Systems

To implement your own AI logic you really just need a tick function, or a short looping timer like 0.01 seconds, and then you can use all the power of BP to create your own AI logic flow :slight_smile:

Blueprint Inheritance becomes very important when you want to design AI systems that can be used by many different subclasses, like for many different types of characters. So you’ll want to make sure you always call the parent function on your core AI Events! Right click on any Event, and select “Add Call To Parent Function” to see what I mean! This is absolutely mandatory for BP Inheritance!

Send me a pm if you would like further assistance related to using BP-only AI systems!

Have fun today!

has been a huge help to me with game optimization and steam integration. I highly reccomend his services. He is very knowledgable, a nice guy, and easy to work with!

I’ll ditto that statement, . has been helping me with two different projects at the same time and has made my life much easier in both instances. Not only can he work wonders in C++, he also understands how to bring his work into Blueprints in a meaningful way for those who don’t want (or don’t have the ability) to touch code.

Hi , sent you a msg, would love to hook up with you to engage you in a consulting role to help us out. Please check your inbox!