What's Wrong with Unreal ? :/

I downloaded new version that is 4.12.2 . wanted to test it, used the simple vehicle template. compiled the game everything was working fine, did build the game from visual studio everything was fine. But then i added new c++ component inheriting from the camera component. the engine throws error for “WORLD_MAX” the predefined value for max world in camera types Class.

if i start fixing that by defining a custom value for WORLD_MAX then comes like 200+ errors. I have no idea what is going on with the engine lately and as i migrated from unity to unreal i feel, it just wast so much of my time for no reason. instead doing some fun stuff by creating game ,I’m just wasting time in just setting up the game?

the 4.11 was stable i have no idea what went wrong with 4.12. man this is exhausting

it is simple to reproduce you guys can try it for yourself. I verified the installation of engine thought something might have went wrong but still the same . :frowning:

I have tried with the version 4.11.2 i get the Same problem, in WORLD_MAX i replaced it to direct value in cameratypes.h and then i followed with these errors. I have no idea what is going on. can anyone please help me ?
68fabc476fff0a3e4a134eb3226a693e13b8a442.jpeg 66cd54fcc8387d5b707f3f7f13ac05965c7133be.jpeg

if I try create the c++ component from the content browser window it is working fine, but not from the “Add Component” drop down menu in the “Details” window. This is so weird . Is there any1 else facing the same trouble or its just me ? :confused:

a5e08d6b8209bd31639ad2479ebd6d485f9095d6.jpeg

now i have to go manually delete the files form the folder and re build it from the visual studio to make it work. I’m pretty sure there is some kinda linker error not sure what it is. It would much helpful if some one could share their knowledge about this problem ?

Hello,

Can you show us the original code and the code you replaced, so we can have a better idea of what’s going on? :slight_smile:

i had issues with 4.12 as well. Froze screen for a few seconds during first init play, while subsequent plays turned out to be ok. Couldnt really make sense of the errors and there was huge memory leak which made coding impossible for my 8gb ram. Rolled back to 4.11.2 and had to redo some of the scenes as the editor was complaining about scene being made in 4.12 and those cant be used!

I will be wiser for the next version installation.

This code i just passed in the direct value of World_Max instead of passing the predefined so the compiler do not have to look for the world_max

Once I fix this it will throw multiple errors and keeps going on and on.

I believe that when something goes wrong there is higher probability that we might have done something stupid and blame the engine for instability. But these kinda of errors(the one i’m facing) got nothing to do with devs, just following the protocol and things dose not work as it suppose to be. feeling weird

It seems you are modifying an internal constant (probably a #define) is just one place, and not everywhere else it’s being used.
You might want to grab the source code on GitHub, search for WORLD_MAX definition and change it there. Still, there might be some other limits defined somewhere else.

Also, so just you know, any value defined as (for example)

#define WORLD_MAX 1000

Do not need to be looked upon at runtime, they’re replaced on compile time (So, there is zero optimization or gain in there).

Also, there’s a small/tiny chance that, that value, might be slightly different depending on the platform, with some clever preprocessor directives. Still, I wouldn’t know without digging in the code (something that, right now, I’m unable to do).

About 4.12.2, I had no problem up to now, it’s running great here :slight_smile:

Edit:
You might want to look what error C2065 means here: Compiler Error C2065 | Microsoft Docs

Oh boy, let’s not go modifying the source just yet if you can’t add components. Save that for later!

Also, don’t go trying to replace or define this WORLD_MAX value. That’s not the issue! Something else is breaking and you’re seeing that error as a red herring.

How exactly did you add this new component? Was it the only thing you did? I’ll try to reproduce this.

Yea I understand and that was just a undeclared identifier error so doing a direct value should not change anything except the compiler would stop looking for “WORLD_MAX” and ignore that error. but there are other chain of action starts happening once i do that . :confused:

yes ,
that is exactly what i’m thinking. there should be no error with the code, because when I create the component from the content browser by right clicking and create “new c++ component” things are fine.


but things crash if i go through the “Add new c++ component” from details window’s Drop down menu.What's Wrong with Unreal   - Google Chrome.jpg PrtScr capture_2.jpg and yes this is the only thing I did.
when i get the error, I can compile the project only if i manually delete the files of the component from file explorer and recompile it from visual studio.

is there any chance it is because of the target platform, so the meta file creation is bugged while adding component ? I’m using the Windows 10 pro insider preview build 14342.rs1_release. 160506-1708.

And what do you do after clicking on “New C++ Component” in that menu in the second picture? Can I see a screenshot of that next window/screen with all of the details as you’ve filled them out? I won’t be able to reproduce this until tomorrow night, so I want to make sure it’s all there when I do. Also, could you maybe upload your small reproducing project? There might be something else going funky.

The steps and pictures are in the 3rd post of this thread, sorry for the inconvenience. just try creating any kind of component not just the camera component


[/QUOTE]

hope you could reproduce the error now.

I checked with another computer with a different windows build, things seems fine

Hi Codezeero, I also encountered this problem. I’ve submitted a bug report to the Answerhub and will let you know what I hear. I’ll link it here once it gets approved.

that would be much helpful, Thanks a lot . :slight_smile:

Hi Codezeero,

It looks like you found an interesting case where an include was missing in the engine. JamesG from Epic replied with the cause, and that he’s going to fix that up for a future version of UE4.

Basically, CameraTypes.h needed to include EngineDefines.h, but didn’t. Instead of trying to modify the source (which would be a nightmare), we should add some includes to our new camera component’s header file. This way, we can make sure the above file is included BEFORE we get to the CameraTypes.h, so it still all works (and so the code in that file knows about our WORLD_MAX etc).

Your includes should look like this in your custom camera component’s header file:


#include "EngineMinimal.h"
#include "EngineDefines.h"
#include "Camera/CameraComponent.h"
#include "YourCameraComponentHeaderName.generated.h" // remember, use whatever your header name is before the '.generated.h' section.

After adding this code, I was able to compile!

Happy coding.

Awesome, yes by including those to header files to the code yes i’m able to compile code. I’m missing the basic inherited auto generated code but not a problem I could manage that .
Thanks a lot , thanks for the help. people like you make this community very responsive. :slight_smile: