MrBinny
This is a thread on getting set up properly with the workflow and environment. I am working through a few issues with the "Unreal Engine 4 Demo Video Tutorial" and "Unreal Engine 4 Example." These are, perhaps, simple fixes for intermediate developers but if you're relatively new then please join the discussion. I will be posting here within the next few days as I get these issues resolved.
0 0
MrBinny
First issue at the moment has to do with Visual Studio 2015 and update 3, this is entirely on the UE4 side. The example and demo projects will not build (And you will start to have a very bad time) if you have Visual Studio 2015 and update 3, and you're using Unreal Engine 4.12.*; this issue is just a day or so old at the time of this post.


From the Unreal Forum:
--------------------------------------------------------------------------------------------

Hi everyone,

I just wanted to pop in here real quick to let you know that we do not yet officially support Update 3 for Visual Studio. Our goal is to have support for new VS updates by the time they are officially released (Release Candidate versions are not official final release versions). Sometimes we are able to get that support into the Engine early, but as of right now it is not in place.

I brought this up with the individual who will be responsible for making sure support for Update 3 is added to the Engine. He has not done any testing on this yet, but he believes it should be possible to correct this issue by opening the WindowsPlatformCompilerSetup.h file in source code (this won't correct it for the binary version of the Engine, unfortunately), and remove 4599 from the table of warnings at the top. Then add #pragma warning(disable : 4599) below the list. It is possible that this may not work since the warning is coming from command line arguments instead of source, but it's the first thing he is going to try when he starts working on support for Update 3. He also said that he does not believe this edit will have any adverse affect on your game code generation, but stressed again that he has not done any testing yet.

For now we recommend sticking with Visual Studio 2015 Update 2.

Tim

https://answers.unrealengine.com/questions/435600/build-failed-with-vs-2015-update-3.html

---------------------------------------------------------------------------------------------
0 0
Atonnis
I'm currently running VS2015 with Update 1, and it seems to be particuarly difficult to get hold of Update 2 now that Update 3 is released.  Will this cause a problem?
0 0
MrBinny
Running Example project with UE4 (solved) - Unreal Engine 4.12.x Visual Studio 2015 Update 1 only          July/3rd/2016

Issue: 

There is an issue currently with VoxelFarmCommon.h that prevents the Demo.UnrealVoxelFarm 4.12 from compiling and running.

Officially Visual Studio 2015 Update 3 is not supported by UE4, but that is "officially." I haven't tested how the Example Projects would compile, it ~may~ not be a problem as I first thought.


Location: 

The problem is on line 35 of VoxelFarmCommon.h of the Demo.UnrealVoxelFarm 4.12 folder.


Solution: 

"template<typename ItemType, EQueueMode::Type Mode = EQueueMode::Spsc>"

should be replaced with

"template<typename ItemType, EQueueMode Mode = EQueueMode::Spsc>"

Save and hit launch. It should be up and running fine; UE4 will automatically open, hit the "play" button in UE4 and whatever project you exported will manifest in UE4 (I chose the SnowyMountain Example, but you could do this with any example from VoxelFarm. Maybe I am the only one that has had this problem having recently as UE4 had an update.)

0 0
Atonnis
Wonderful.  Just one teensy issue...which I know I'll get a roll of the eyes for [smile]

I have the EvalKit for VF3. Now what do I do with it?  So far, nothing I've tried from previous knowledge (where I got VF2's demo to work) has worked.

0 0
MrBinny
I don't know Atonnis, I am not on the VoxelFarm team (I'm just a developer like you.)
0 0
MrBinny
Error when building the Demo Solution (Solved)  Unreal Engine 4.12.x Visual Studio 2015 Update 1 only, Windows 10, VF_SDK_2.0.3.106_MD     July/5th/2016

CS0619: 'UnrealBuildTool.RulesCompiler.GetModuleFilename(string)' is obsolete: 'GetModuleFilename is deprecated, use the ModuleDirectory property on any ModuleRules instead to get a path to your module.

Issue: 
When you right click on the Demo project UnrealVoxelFarm.uproject to "Generate Visual Studio Project Files" then the  'GetModuleFilename is deprecated' error pops up and the project fails to build.

Location:

UnrealVoxelFarm\UnrealVoxelFarm.Build.cs   Line 21

 


Solution: 

Change the following from:

 

    private string ModulePath

    {

        get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }

    }

 

To:

    private string ModulePath

    {

        get { return ModuleDirectory; }

    }


Now  Visual Studio Project Files can be generated from UnrealVoxelFarm.uproject
1 0
voxelfarmtorres
Atonnis, after decompressing the ZIP you can right click on the UE4 project found in the Demo.UnrealPlugin folder. This will show a menu with the following UE4 options:

bbpcmlkmdllhcalc.png 

After this, you can load the solution in VS2015 and press run (F5). It will build with no errors and warnings and once finished building will run UE4.

This is what you should see in UE4:

fjdlblhembeaihlf.png 

0 0
MrBinny
Building from a new UE4 C++ project (Part 1) - This brief tutorial will allow you to create a project from scratch with the INDIE License with UE4 (step by step, if you're struggling) The first part, covered here, involves building the project from Visual Studio 2015 but starting with a running UE4 project. You could probably take a project that you have been working on and integrate VoxelFarm in this manner as well (although I haven't tested this.)  I am using UE 4.11.2 and voxel studio SDK 2.03.106


Overview:

You will NOT be Linking Libraries. You will NOT be moving header files. You will NOT be compiling DLLs; the Build.cs and Target.cs files are designed to handle this. However you will be doing some minor editing of files that exist, some of them are header files, some of them are c# files, some are cpp files.




Steps:

Step #1. Open UE4 and create a C++ based project;(New Project --> C++) save the project on your hard drive in the desired location. UE4 will automatically open up your project and visual studio 2015. Save the project (save all) and close UE4. The purpose of this is simply to generate a C++ based project out of UE4.

Step #2. In visual studio save the project. Click the "Local Windows Debugger" button, to build and execute the project. The UE4 will open up with your project. Simple? Simple. This verifies everything on the UE4 end is working.

Step #3. Locate Demo.UnrealVoxelFarm from the VF_SDK_2.03.106_MD folder, go into Source -> UnrealVoxelFarm and COPY the folder "VoxelFarm" then paste this into your project (maintain the same file structure) so in your folder -->Source-->yourProject There will be a *.Build.cs file there so you know you're in the right folder. Hint: you can open up 2 file explorer windows. This is a fully functioning VoxelFarm wrapper; it is simply being copied to your C++ UE4 project (which doesn't originally have a VoxelFarm wrapper)

Step #4. From ..\Demo.UnrealVoxelFarm\Source\UnrealVoxelFarm (the folder you were just in from the Demo project) copy VoxelFarmActor.cpp, VoxemFarmActor.h, ... and the rest of the files that start with "VoxelFarm", both source (cpp) and header (h) files. There are 6 of these files. These are instances of UE4 actors with VoxelFarm implementation which have already been designed by the VoxelFarm team (useful if you don't know the API insideout.)

Step #5. In each *.cpp file at the top of the file there is an include statement "#include "UnrealVoxelFarm.h"" change this to the name of your project.
#include yourProjectname.h   do this for all the *.cpp files in the entire VoxelFarm folder also. (Yes, its a little work.) The VoxelFarm files that you moved over need to pull in information from the header file your project generated.

Step #6. Go to the UnrealVoxelFarm.Build.cs and open it up, also open up your project.Build.cs file (whatever you named your project.) You should notice a lot of code missing from your Build.cs file. At the top of this file add "using System.IO;"   for some reason the builder isn't recognizing the Path class.

Everything below the public YourProject(TargetInfo Target) needs to be replaced with what is in the UnrealVoxelFarm.Build.cs, you are maintaining  your constructor name and replacing everything else, this pulls in dependency modules (so we don't have to add header files and link everything manually.) The private method "ModulePath" should be as follows, (so change it if its not):

private string ModulePath
{
       get { return ModuleDirectory; }
}


Pay attention to get { return Path.GetFullPath(Path.Combine(ModulePath, "../../../lib/")); }, for fun go to your top level project directory, in the file explorer bar add those lines; this is where the building process is going to look for your lib file in the future. If you are worried you can always write "Console.WriteLine( Path.Combine(ModulePath, "../../../lib/") [wink]" just above the "get" line and it will spit out the location it expects the library to be in the console window. Notice further down in this file it will also be looking for the Engine.CPP folder, just keep this in mind. 


Step #7. In the VoxelFarmCharacter.h file of your project (yes, the one you copied to your project.) Open it up and change 


class UNREALVOXELFARM_API AVoxelFarmCharacter : public ACharacter

to...

YOURPROJECT_API AVoxelFarmCharacter : public ACharacter

Yes in capital letters.

Step #8. Go to your project .. yourProject.uproject and right click on it. Then click on "Generate Visual Studio project Files" Unreal Engine will generate project files, there shouldn't be any errors from the UE4 project generation tool.

Step #9. You need 2 folders before you can build anything. The "Engine.CPP" and "lib" folders must be copied back to the same top level directory that your project is sitting in (so not inside your project.) Copy these folders over. Otherwise the project is going to be looking for dependencies it can't find.

Step#10. Clean and Build, then press the run button.

You will get the following error messages however the solution will be running (the error is due to not having added material to the actor in the project in UE4 yet, this is something I will cover in part 2.) "Default Property warnings and errors: Error: DCO Constructor (VoxelFarmActor): Failed to find Material'/Game/CellMaterial/VoxelFarmCellMaterial.VoxelFarmCellMaterial'  "... this isn't loaded into the assets in your project yet or attributed any objects in the scene yet. Click ok.


Step #11. In UE4, in the content Browser click on C++ Classes, yourProjectName ... there is a VoxelFarmCharacter, VoxelFarmActor, yourProjectGameMode, an Atlas folder with a VoxelTexture. 


Caveat: Earlier in this thread I had advocated editing VoxelFarmCommon.h

from

template<typename ItemType, EQueueMode::Type Mode = EQueueMode::Spsc>

to..

template<typename ItemType, EQueueMode Mode = EQueueMode::Spsc>

However, this compilation did not require that. I don't know why.


This is as far as I am taking part 1. Part 2 will cover updating the voxel terrain through player controller movement. I don't know when I will be getting to Part 2 but possibly within this week.


0 0
MrBinny
Building from a new UE4 C++ project (Part 2) - This brief tutorial is a continuation on how to create a project from scratch with the INDIE License with UE4 (step by step, if you're struggling) This second part involves placing an actor correctly in UE4 so that it will be interfaced with the VoxelFarm Engine. I am using UE 4.11.2 and voxel studio SDK 2.03.106, Windows 10.


1. Create a "Paks" folder in your project and bake an exported VoxelFarm bundle.pak to this folder for your project. (This is outlined in the tutorial documentation.) This will be the map that is rendered at runtime.

2. Create a CellMaterial folder in your project and copy the CellMaterial files from the Demo.UnrealVoxelFarm project into this one. This will be in the Content folder of the Demo.UnrealVoxelFarm

3. In the content browser of UE4 (bottom of screen where your files and assets are) go to C++ Classes --> YourProject, you should see VoxelFarmCharacter, VoxelFarmActor, NewProjectGameMode
and a VoxelFarm folder. Drag VoxelFarmActor into the scene, place it somewhere in the scene.

4. Click on the VoxelFarmActor that appears in the World Outliner (right hand side of UE4.) They Type should say "Open VoxelFarmActor.h"
In the details tab (bottom right) go to VoxelFarmActor and for the Vf Material assign it VoxelFarmCellMaterial. There is no green bar underneath the material at this point, indicating an error. Double click on the material to open up the blueprint view. You will see in the box "shade" there is an ERROR! in red on the box itself. Assets are missing and must be loaded. The error is "Missing Material Function"

5. Copy all the assets from Demo.UnrealVoxelFarm to the Content folder in yourProject. (Just the *.asset) files. Click on Compile and Build, don't click on Play yet.

6. The next part is a little detailed and involves the blueprint editor in UE4 (diagram coding.) In the world outliner click on your VoxelFarmActor, in the details tab, double click on the Vf Material to open the blueprint. Double Click the shade box that has ERROR!, double click sample3MaterialsLOD that has ERROR!, double click sampleMaterialLOD that has ERROR!, double click getMaterialProperty that has ERROR! Go up to the unconnected "Unspecified Function" and click that. In the details panel under "material Funct" select MaterialPropertiesHalfTexelNew from the dropdown. Then click save. In the blueprint editor there are tabs that have been opened during this step and you will notice the errors have been resolved. Going back to the main screen the VF Material for VoxelFarmActor should be green underneath, a green bar in the picture indicating there are no errors.

7. Save the project. Click Run/Play, it should be working nicely. When you reload the project later don't forget the VoxelFarmActor that was placed will only be on that specific map (so if you have multiple Map files you will need to place an actor for each scene.) The project can also be loaded and run from Visual Studio 2015.


This concludes "Building from a new UE4 C++ project" and "getting set up properly with the workflow and environment." This information is also found on the Unreal Engine 4 Example at http://voxelfarm.com/doc.html?unreal-engine-4-example  

0 0
Atonnis
MrBinny - you are THE most awesome creature this side of the Orion Nebula.

0 0
Atonnis
Cool stuff.  Although during part 1 Section 10 I get:

Error C1083 Cannot open include file: 'VoxelFarm/VoxelFarmCommon.h': No such file or directory VoxelGod e:\unreal\unreal projects\voxelgod\source\voxelgod\VoxelFarmPhysMesh.h 5

Error C1083 Cannot open include file: 'VoxelFarm/VoxelFarmMain.h': No such file or directory VoxelGod E:\Unreal\Unreal Projects\VoxelGod\Source\VoxelGod\VoxelFarmCharacter.cpp 7

Error C1083 Cannot open include file: 'VoxelFarm/VoxelFarmMain.h': No such file or directory VoxelGod E:\Unreal\Unreal Projects\VoxelGod\Source\VoxelGod\VoxelFarmActor.h 7

Error C1083 Cannot open include file: 'VoxelFarm/VoxelFarmMain.h': No such file or directory VoxelGod e:\unreal\unreal projects\voxelgod\source\voxelgod\VoxelFarmActor.h 7

Error Failed to produce item: E:\Unreal\Unreal Projects\VoxelGod\Binaries\Win64\UE4Editor-VoxelGod.dll VoxelGod E:\Unreal\Unreal Projects\VoxelGod\Intermediate\ProjectFiles\ERROR 1

Error MSB3075 The command ""C:\Program Files (x86)\Epic Games\4.12\Engine\Build\BatchFiles\Build.bat" VoxelGodEditor Win64 Development "E:\Unreal\Unreal Projects\VoxelGod\VoxelGod.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command. VoxelGod C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37

Any ideas?

0 0
MrBinny
The compiler is trying to find the source and header files but it can't. In the yourProject.Build.cs (where "yourProject" is the name of your project) where is it looking for for files? This will be the VoxelFarmLibPath

private string VoxelFarmLibPath
{
     get { return Path.GetFullPath(Path.Combine(ModulePath, "../../../lib/")); }
}

So you should have the lib directory there and Engine.CPP there also (I am using Voxel Farm build 2.02.106).

So how do you know where to place these folders? Open up windows explorer, go to the directory that yourProject.Build.cs is in.
Inside the explorer path bar For example...


C:\Users\me\Desktop\Projects\UnrealProjects\myProjet\Source\myProject


then type the module path (im just adding the dots and slashes, this is console stuff.)

C:\Users\me\Desktop\Projects\UnrealProjects\myProjet\Source\myProject\..\..\..\

So the builder is looking for lib and Engine.CCP folders there. Either that or copy your project to the folder where the demos are and try to build it.
1 0
Atonnis
Excellent stuff.  I'm starting to get a grip back on my old coding days - blueprints have made me sloppy [smile]

One last problem...

Error MSB3075 The command ""C:\Program Files (x86)\Epic Games\4.12\Engine\Build\BatchFiles\Build.bat" VoxelGodEditor Win64 Development "E:\Unreal\Unreal Projects\VoxelGod\VoxelGod.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command. VoxelGod C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37

I explicitly started VS2015 as Administrator.


0 0
MrBinny
Are you trying to build with UE 4.12 and Visual Studio 2015 update 3, also is this for Voxel Farm 2? I can vaguely recall having a similar problem 2 weeks ago before going to UE 4.11 and VS 2015 vanilla. UE has issued a hotfix for this recently, it might help.
Try to changing the build (from Debug to <inherit> there should be an option for that in the dropdown, in the drop down next to the run button.) Also be sure you're targeting the right machine x64 for most processors these days. Another solution I saw was "Solution Explorer ->[YourProject]->Properties->Linker ->General->Per-user Redirection "TRUE" " .. 
0 0