Perforce client inconsistencies with Blueprint extended from C++ class

Hello,
After extending a Blueprint off my C++ Player Controller class, none of the other clients in my perforce server “see” the new changes (their games are still using the C++ Player Controller in their Game Mode instead of the Blueprint one). I run with P4V and UE4 Perforce integration so I know all of the appropriate files are checked out.

The Blueprint was simply to utilize UserWidgets for a test “main menu” which works brilliantly on my PC. I extended the C++ Player Controller class with a Blueprint, compiled it with no errors and saved it. I then went to the C++ Game Mode class I wrote and set the new PlayerController class to the new Player Controller Blueprint as follows:

.c
// MyGameMode.cpp
	static ConstructorHelpers::FClassFinder<APlayerController> PlayerControllerClassFinder(TEXT("/Game/GameLogicBP/MyPlayerController_BP"));
	PlayerControllerClass = PlayerControllerClassFinder.Class;

After that, closed editor, recompiled (Rebuild in VS), no compile errors, re-launch editor and looked at the Game Mode’s Player Controller class which is now happily set to MyPlayerController_BP and the main menu is summoned when the appropriate key is pressed in the game… on my PC only.

After that I submitted my changes (including compiled binaries, the new BP script for the Player Controller, the DefaultInput.ini for the key binding to summon the menu, etc.) I had two team members pull down the latest build and was surprised to discover their menu key wouldn’t summon the main menu in the game. Upon further inspection I discovered their Editor’s World->Game Mode didn’t have the MyPlayerController_BP class set for the Player Controller setting but the old C++ PlayerController class. I’m baffled as to why this is and any suggestions are welcome. I thought it was just a simple case of checking out the binaries, recompiling again and submitting but after several attempts at that (and watching the file version numbers increment in Perforce): No joy.

After each of these steps I had the team pull the latest build after I submitted so I’ll omit saying that after each step. Also I should note before submitting I always do a Rebuild in VS to clean the junk temp files so they don’t make their way into the repo (UE4Editor-YourGame-XXXX.pdb, dll, etc.)

Below is a list of things I’ve tried:

Check out binaries, Rebuild in Visual Studio, resubmit (several times, each time the version number would go up in Perforce).
Check out binaries, Clean then Rebuild in Visual Studio, resubmit (again several tries).
Reboot my PC and try the above again.
Reboot the Perforce server and try the above again.
Open MyPlayerController_BP, delete a node and re-add it, recompile; Trying to trigger a BP recompile.
Remove the project from another team members’ workspace, re-pull the complete build from the server.
Create a new test Game Mode C++ class (which was basically a copy-paste of my original Game Mode C++ class with a different name), Rebuild, resubmit and it doesn’t even show up in the dropdown for Game Mode on the other clients!!! The source files are there though which is strange.

Again I am at a complete loss so any suggestions would be welcome.

Cheers,
-Nate

Hello Naters4lad,

I’ll look into this problem but in the meantime, I would suggest using to set the game mode inside the editor in a separate variable if you wish to use a blueprint for it. The workflow for C++ and Blueprints is meant to be one way, from C++ to Blueprint and not vice-versa. While it is definitely possible, it can result in some limitations and issues.

I’ll test this method out though and see if I can get the same thing to occur.

Hi Matthew,

If I’m understanding you correctly I believe I’ve already done this. The game mode and all the classes specified in it are C++ except the Player Controller which is a Blueprint extended from my C++ Player Controller class. Again, the puzzling bit is it works flawlessly on my PC but not on anyone else’s. If what I’ve done shown above isn’t valid then the pawn wouldn’t function either as it is a Blueprint extended from the base pawn class C++ (which was generated by the first person shooter template). Either it’s a strange bug with 4.9 and my code or a perforce issue.

I’ll see if I can try some other things today and will post back here again after I get home.

Cheers,

  • Nate

It is definitely valid but isn’t the usual workflow. I tried reproducing the same problem with another support member on our Perforce server without any luck. It seems to update everytime. Have you tried having your other clients generate project files / compile the project after receiving it instead of just sending the binaries? It could be something related to that, as that is how we were testing it.

Hi Matthew,
That’s one thing on my list to test. The alternative is me backing up what I’ve got on my pc, destroying what is in the depot and recreating the repository. I’ll let you know how having the individual clients compile the project goes.

Ok today we had a new person join the team. On a completely new pc it exhibits the exact same problem listed above. At this point I’m thinking this us a perforce issue. I’ll be going with the nuclear option which is to day I’ll blow away the repo, recreate it and commit what is on my local machine because I know it works.

Fixed it.
Though I checked out the UPROJECT file it was missing several modules specified in the my project.Build.cs file. Manually adding these followed by rebuilding the project in Developer Editor configuration resolved my issue.