UE4 Crashes Every Time I Open it

My project crashes every time I open it. I have tried to replace autosave files with suspected problem files but that hasn’t worked. It all happened when I compiled some new code in VS and it compiled successfully, so I go to compile from the UE4 editor and a minute later the engine crashes. When I attempt to launch my project the engine crash again.

Here is the message I get:

You do not have any debugging symbols required to display the callstack for this crash.

That doesn't really help I guess.
This is the message in the log file.


Log file open, 06/28/16 22:50:41
LogInit:Display: Running engine for game: DrunkSimulator
LogPlatformFile: Not using cached  wrapper
LogInit:Display: RandInit(1066774679) SRandInit(1066774694).
LogTaskGraph: Started task graph with 4 named threads and 7 total threads with 1 sets of task threads.
LogStats: Stats thread started at 0.070785
LogInit: Version: 4.12.4-3028348+++UE4+Release-4.12
LogInit: API Version: 2992821
LogInit: Net Version: 3028348
LogDevObjectVersion: Number of dev versions registered: 13
LogDevObjectVersion:   Dev-Blueprints (B0D832E4-1F89-4F0D-ACCF-7EB736FD4AA2): 3
LogDevObjectVersion:   Dev-Build (E1C64328-A22C-4D53-A36C-8E866417BD8C): 0
LogDevObjectVersion:   Dev-Core (375EC13C-06E4-48FB-B500-84F0262A717E): 1
LogDevObjectVersion:   Dev-Editor (E4B068ED-F494-42E9-A231-DA0B2E46BB41): 2
LogDevObjectVersion:   Dev-Framework (CFFC743F-43B0-4480-9391-14DF171D2073): 6
LogDevObjectVersion:   Dev-Mobile (B02B49B5-BB20-44E9-A304-32B752E40360): 0
LogDevObjectVersion:   Dev-Networking (A4E4105C-59A1-49B5-A7C5-40C4547EDFEE): 0
LogDevObjectVersion:   Dev-Online (39C831C9-5AE6-47DC-9A44-9C173E1C8E7C): 0
LogDevObjectVersion:   Dev-Physics (78F01B33-EBEA-4F98-B9B4-84EACCB95AA2): 0
LogDevObjectVersion:   Dev-Platform (6631380F-2D4D-43E0-8009-CF276956A95A): 0
LogDevObjectVersion:   Dev-Rendering (12F88B9F-8875-4AFC-A67C-D90C383ABD29): 2
LogDevObjectVersion:   Dev-Sequencer (7B5AE74C-D270-4C10-A958-57980B212A5A): 0
LogDevObjectVersion:   Dev-VR (D7296918-1DD6-4BDD-9DE2-64A83CC13884): 0
LogInit: Compiled (64-bit): Jun 27 2016 09:29:04
LogInit: Compiled with Visual C++: 19.00.23026.00
LogInit: Build Configuration: Development
LogInit: Branch Name: ++UE4+Release-4.12
LogInit: Command line:  
LogInit: Base directory: C:/Program Files (x86)/Epic Games/4.12/Engine/Binaries/Win64/
LogInit: Installed Engine Build: 1
LogInit: Using libcurl 7.41.0
LogInit:  - built for x86_64-pc-win32
LogInit:  - supports SSL with WinSSL
LogInit:  - other features:
LogInit:      CURL_VERSION_SSL
LogInit:      CURL_VERSION_IPV6
LogInit:      CURL_VERSION_ASYNCHDNS
LogInit:      CURL_VERSION_LARGEFILE
LogInit:      CURL_VERSION_IDN
LogInit:  CurlRequestOptions (configurable via config and command line):
LogInit:  - bVerifyPeer = true  - Libcurl will verify peer certificate
LogInit:  - bUseHttpProxy = false  - Libcurl will NOT use HTTP proxy
LogInit:  - bDontReuseConnections = false  - Libcurl will reuse connections
LogInit:  - CertBundlePath = nullptr  - Libcurl will use whatever was configured at build time.
LogInit: Presizing for max 8388607 objects, including 0 objects not considered by GC, pre-allocating 0 bytes for permanent pool.
LogInit: Object subsystem initialized
[2016.06.29-02.50.41:555][  0]LogInit: Selected Device Profile: [Windows]
[2016.06.29-02.50.41:555][  0]LogInit: Applying CVar settings loaded from the selected device profile: [Windows]
[2016.06.29-02.50.41:565][  0]LogInit: Computer: -DESKTOP
[2016.06.29-02.50.41:565][  0]LogInit: User: 
[2016.06.29-02.50.41:565][  0]LogInit: CPU Page size=65536, Cores=4
[2016.06.29-02.50.41:565][  0]LogInit: High frequency timer resolution =14.318180 MHz
[2016.06.29-02.50.41:565][  0]LogMemory: Memory total: Physical=8.0GB (8GB approx)
[2016.06.29-02.50.41:565][  0]LogMemory: Platform Memory Stats for Windows
[2016.06.29-02.50.41:565][  0]LogMemory: Process Physical Memory: 190.01 MB used, 190.01 MB peak
[2016.06.29-02.50.41:565][  0]LogMemory: Process Virtual Memory: 195.05 MB used, 195.05 MB peak
[2016.06.29-02.50.41:565][  0]LogMemory: Physical Memory: 4040.30 MB used, 8145.54 MB total
[2016.06.29-02.50.41:565][  0]LogMemory: Virtual Memory: 553.63 MB used, 134217728.00 MB total
[2016.06.29-02.50.41:589][  0]LogTextLocalizationManager: No specific translations for ('en-US') exist, so ('en') translations will be used.
[2016.06.29-02.50.41:906][  0]LogD3D11RHI: D3D11 adapters:
[2016.06.29-02.50.41:936][  0]LogD3D11RHI:    0. 'NVIDIA GeForce GTX 760' (Feature Level 11_0)
[2016.06.29-02.50.41:936][  0]LogD3D11RHI:       1989/0/4072 MB DedicatedVideo/DedicatedSystem/SharedSystem, Outputs:2, VendorId:0x10de
[2016.06.29-02.50.41:937][  0]LogD3D11RHI:    1. 'Microsoft Basic Render Driver' (Feature Level 11_0)
[2016.06.29-02.50.41:937][  0]LogD3D11RHI:       0/0/4072 MB DedicatedVideo/DedicatedSystem/SharedSystem, Outputs:0, VendorId:0x1414
[2016.06.29-02.50.41:937][  0]LogD3D11RHI: Chosen D3D11 Adapter: 0
[2016.06.29-02.50.41:941][  0]LogD3D11RHI: Creating new Direct3DDevice
[2016.06.29-02.50.41:941][  0]LogD3D11RHI:     GPU DeviceId: 0x1187 (for the marketing name, search the web for "GPU Device Id")
[2016.06.29-02.50.41:941][  0]LogWindows: EnumDisplayDevices:
[2016.06.29-02.50.41:941][  0]LogWindows:    0. 'NVIDIA GeForce GTX 760' (P:1 D:1)
[2016.06.29-02.50.41:941][  0]LogWindows:    1. 'NVIDIA GeForce GTX 760' (P:0 D:1)
[2016.06.29-02.50.41:942][  0]LogWindows:    2. 'NVIDIA GeForce GTX 760' (P:0 D:0)
[2016.06.29-02.50.41:942][  0]LogWindows:    3. 'NVIDIA GeForce GTX 760' (P:0 D:0)
[2016.06.29-02.50.41:942][  0]LogWindows: DebugString: FoundDriverCount:4 
[2016.06.29-02.50.41:942][  0]LogD3D11RHI:     Adapter Name: NVIDIA GeForce GTX 760
[2016.06.29-02.50.41:942][  0]LogD3D11RHI:   Driver Version: 361.43 (internal:10.18.13.6143, unified:361.43)
[2016.06.29-02.50.41:942][  0]LogD3D11RHI:      Driver Date: 12-16-2015
[2016.06.29-02.50.41:942][  0]LogRHI: Texture pool is 1361 MB (70% of 1945 MB)
[2016.06.29-02.50.41:955][  0]LogD3D11RHI: Async texture creation enabled
[2016.06.29-02.50.41:970][  0]LogD3D11RHI: GPU Timing Frequency: 1000.000000 (Debug: 2 2)
[2016.06.29-02.50.41:970][  0]LogShaderCompilers: Guid format shader working directory is -24 characters bigger than the processId version (../../../../../../Users//Documents/Unreal Projects/DrunkSimulator/Intermediate/Shaders/WorkingDirectory/7944/).
[2016.06.29-02.50.41:970][  0]LogShaderCompilers: Cleaned the shader compiler working directory 'C:/Users//AppData/Local/Temp/UnrealShaderWorkingDir/65E5172C42F6F9AE5863BA889FD28917/'.
[2016.06.29-02.50.41:970][  0]LogShaderCompilers:Display: Using Local Shader Compiler.
[2016.06.29-02.50.42:807][  0]LogTemp:Display: Loaded TP AllDesktopTargetPlatform
[2016.06.29-02.50.42:815][  0]LogTemp:Display: Loaded TP WindowsClientTargetPlatform
[2016.06.29-02.50.42:822][  0]LogTemp:Display: Loaded TP WindowsNoEditorTargetPlatform
[2016.06.29-02.50.42:830][  0]LogTemp:Display: Loaded TP WindowsServerTargetPlatform
[2016.06.29-02.50.42:838][  0]LogTemp:Display: Loaded TP WindowsTargetPlatform
[2016.06.29-02.50.42:845][  0]LogTemp:Display: Loaded TP AndroidTargetPlatform
[2016.06.29-02.50.42:852][  0]LogTemp:Display: Loaded TP Android_ASTCTargetPlatform
[2016.06.29-02.50.42:859][  0]LogTemp:Display: Loaded TP Android_ATCTargetPlatform
[2016.06.29-02.50.42:866][  0]LogTemp:Display: Loaded TP Android_DXTTargetPlatform
[2016.06.29-02.50.42:872][  0]LogTemp:Display: Loaded TP Android_ETC1TargetPlatform
[2016.06.29-02.50.42:879][  0]LogTemp:Display: Loaded TP Android_ETC2TargetPlatform
[2016.06.29-02.50.42:894][  0]LogTemp:Display: Loaded TP Android_MultiTargetPlatform
[2016.06.29-02.50.42:894][  0]LogTemp:Display: Loaded TP Android_PVRTCTargetPlatform
[2016.06.29-02.50.42:895][  0]LogTemp:Display: Loaded TP HTML5TargetPlatform
[2016.06.29-02.50.42:915][  0]LogTemp:Display: Loaded TP IOSTargetPlatform
[2016.06.29-02.50.42:921][  0]LogTemp:Display: Loaded TP TVOSTargetPlatform
[2016.06.29-02.50.42:928][  0]LogTemp:Display: Loaded TP LinuxNoEditorTargetPlatform
[2016.06.29-02.50.42:934][  0]LogTemp:Display: Loaded TP LinuxServerTargetPlatform
[2016.06.29-02.50.42:941][  0]LogTemp:Display: Loaded TP LinuxTargetPlatform
[2016.06.29-02.50.42:941][  0]LogTargetPlatformManager:Display: Building Assets For Windows
[2016.06.29-02.50.43:014][  0]LogDerivedDataCache:Display: Max Cache Size: 512 MB
[2016.06.29-02.50.43:057][  0]LogDerivedDataCache: Loaded boot cache 0.04s 49MB C:/Users//AppData/Local/UnrealEngine/4.12/DerivedDataCache/Boot.ddc.
[2016.06.29-02.50.43:057][  0]LogDerivedDataCache:Display: Loaded Boot cache: C:/Users//AppData/Local/UnrealEngine/4.12/DerivedDataCache/Boot.ddc
[2016.06.29-02.50.43:057][  0]LogDerivedDataCache: FDerivedDataBackendGraph:  Pak pak cache file ../../../../../../Users//Documents/Unreal Projects/DrunkSimulator/DerivedDataCache/DDC.ddp not found, will not use a pak cache.
[2016.06.29-02.50.43:057][  0]LogDerivedDataCache: Unable to find inner node Pak for hierarchical cache Hierarchy.
[2016.06.29-02.50.43:057][  0]LogDerivedDataCache: FDerivedDataBackendGraph:  CompressedPak pak cache file ../../../../../../Users//Documents/Unreal Projects/DrunkSimulator/DerivedDataCache/Compressed.ddp not found, will not use a pak cache.
[2016.06.29-02.50.43:057][  0]LogDerivedDataCache: Unable to find inner node CompressedPak for hierarchical cache Hierarchy.
[2016.06.29-02.50.43:071][  0]LogDerivedDataCache:Display: Pak cache opened for reading ../../../Engine/DerivedDataCache/Compressed.ddp.
[2016.06.29-02.50.43:083][  0]LogDerivedDataCache: Using Local data cache path C:/Users//AppData/Local/UnrealEngine/Common/DerivedDataCache: Writable
[2016.06.29-02.50.43:252][  0]LogInit: Selected Device Profile: [Windows]
[2016.06.29-02.50.43:253][  0]LogContentStreaming: Texture pool size is 0.00 MB
[2016.06.29-02.50.43:399][  0]LogMeshUtilities: No automatic mesh reduction module available
[2016.06.29-02.50.43:399][  0]LogMeshUtilities: No automatic mesh merging module available
[2016.06.29-02.50.43:399][  0]LogMeshUtilities: No distributed automatic mesh merging module available
[2016.06.29-02.50.43:624][  0]LogAssetRegistry: FAssetRegistry took 0.0215 seconds to start up
[2016.06.29-02.50.43:646][  0]LogPackageLocalizationCache: Processed 3 localized package path(s) for 2 prioritized culture(s) in 0.020002 seconds
[2016.06.29-02.50.43:651][  0]LogUObjectArray: 28739 objects as part of root set at end of initial load.
[2016.06.29-02.50.43:651][  0]LogUObjectAllocator: 5855632 out of 0 bytes used by permanent object pool.
[2016.06.29-02.50.43:651][  0]LogUObjectArray: CloseDisregardForGC: 0/0 objects in disregard for GC pool
[2016.06.29-02.50.43:656][  0]LogInit: WinSock: version 1.1 (2.2), MaxSocks=32767, MaxUdp=65467
[2016.06.29-02.50.43:803][  0]LogSlate: SlateFontCache - WITH_FREETYPE: 1, WITH_HARFBUZZ: 1
[2016.06.29-02.50.43:803][  0]LogSlate: SlateFontCache - WITH_FREETYPE: 1, WITH_HARFBUZZ: 1
[2016.06.29-02.50.44:348][  0]LogUdpMessaging: Initializing bridge on interface 0.0.0.0:0 to multicast group 230.0.0.1:6666.
[2016.06.29-02.50.44:584][  0]LogWindows: Windows GetLastError: The operation completed successfully. (0)
[2016.06.29-02.50.44:730][  0]LogWindows:Error: === Critical error: ===
Fatal error: [File:D:\Build\++UE4+Release-4.12+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Obj.cpp] [Line: 85] 
Using incorrect object initializer.




[2016.06.29-02.50.44:751][  0]LogExit: Executing StaticShutdownAfterError
[2016.06.29-02.50.44:753][  0]LogWindows: FPlatformMisc::RequestExit(1)
[2016.06.29-02.50.44:753][  0]Log file closed, 06/28/16 22:50:44

Hey -

The error says that the incorrect object initializer is being used which leads me to believe there may be an issue with a constructor somewhere. Can you try commenting out the code that was added prior to the crash and then compile from inside Visual Studio. If you are still unable to open the project please provide the code that was added, it is possible that though the code compiled correctly it is interacting with the editor in a strange way.

I tried commenting the code and it didn’t fix anything. So I then uncommented everything thing and start to us Visual Studios debugger to solve the problem. Now I get a completely new error. VS keeps saying the problem comes from code I wrote a long time a ago.

This is the code.

//Creating Mesh component
	MeshComp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MeshComp"));

Are you still attempting to open the project or are you trying to package the project? The new log file below mentions cooked data, which is why I ask. Is this the code that you added recently or the code that Visual Studio is now saying is causing the compile error? Can you provide the exact error that Visual Studio is giving you?

I get no error when I compile, I only get an error when I attempt to build using the Start Debug Option in Visual Studio and when I launch the project. The error below is from the UE Log file for the project, It is the new error I am getting.

Sorry I am not explaining what is going on very well.

Okay then. That leads me back to believe that there is an issue with your constructor that, while it compiles successfully, is causing issues with the editor. Can you post the full constructor for the class(es) you were working in prior to the project failing to open.

Hey -

Can you add the ADrunkSimulatorCharacter::ADrunkSimulatorCharacter() and AItem::AItem() functions as well.

I am attempting to have the player raycast once they have entered a trigger. This is the code for that.

DrunkSimulatorCharacter.cpp

void ADrunkSimulatorCharacter::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
	 if (bInTrigger)
	{
		DoRaycast();
	}
}




void ADrunkSimulatorCharacter::DoRaycast()
{

	FHitResult* HitResult = new FHitResult();
	FVector StartTrace = FirstPersonCameraComponent->GetComponentLocation();
	FVector ForwardVector = FirstPersonCameraComponent->GetForwardVector();
	FVector EndTrace = ((ForwardVector * 500.f) + StartTrace);
	FCollisionQueryParams* TraceParams = new FCollisionQueryParams();

	if (GetWorld()->LineTraceSingleByChannel(*HitResult, StartTrace, EndTrace, ECC_Visibility, *TraceParams))
	{
		DrawDebugLine(GetWorld(), StartTrace, EndTrace, FColor(255, 0, 0), true);

		if (HitResult->Actor->ActorHasTag(TEXT("Item")))
		{
			bTargeted = true;
		}
	}
}

Item.cpp

  //Create Actor Tag
    	MeshComponent->ComponentTags.Add(FName("Item"));

    //trigger enter function
    void AItem::TriggerEnter(class UPrimitiveComponent* HitComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult)
    {
    	bPlayerInRange = true;
    	GEngine->AddOnScreenDebugMessage(1, 5.f, FColor::Red, TEXT("Press e To pick up"));
    	GetPlayer(OtherActor);
    	DrunkPlayerController->bInTrigger = true;
    }
    
    //trigger exit function
    void AItem::TriggerExit(class UPrimitiveComponent* HitComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
    {
    	bPlayerInRange = false;
    	DrunkPlayerController->bInTrigger = false;
    }


    // Called every frame
    void AItem::Tick( float DeltaTime )
    {
    	Super::Tick( DeltaTime );
    
    	if (DrunkPlayerController->bTargeted)
    	{
    
    	}
    	
    	 if (DrunkPlayerController != NULL)
    		
    	{
    		if (DrunkPlayerController->bIsPickingUp && bPlayerInRange && DrunkPlayerController->bTargeted)
    		{
    			PickUp();
    		}
    		
    	}
    	
    }


void AItem::PickUp()
{
	
	GEngine->AddOnScreenDebugMessage(1, 5.f, FColor::Red, TEXT("Item Picked Up"));
	DrunkPlayerController->BloodLevel += AlcoholLevel;


	DrunkPlayerController->bTargeted = false;
	Destroy();
}

Item.cpp

// Sets default values
AItem::AItem()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	//declaring TriggerComponent
	TriggerComponent = CreateDefaultSubobject<USphereComponent>(TEXT("SphereTrigger"));
	TriggerComponent->bGenerateOverlapEvents = true;
	TriggerComponent->OnComponentBeginOverlap.AddDynamic(this, &AItem::TriggerEnter);
	TriggerComponent->OnComponentEndOverlap.AddDynamic(this, &AItem::TriggerExit);
	TriggerComponent->SetSphereRadius(100.f);
	RootComponent = TriggerComponent;

	//delcaring MeshComponent
	MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MeshComponent"));
	MeshComponent->SetupAttachment(RootComponent);
	//Create Actor Tag
	MeshComponent->ComponentTags.Add(FName("Item"));

	//static ConstructorHelpers::FObjectFinder<USoundBase> DrinkSound(TEXT("/Game/DrunkSimulator/Audio/Drink_1.Drink_1"));
	//DrinkSound = CreateDefaultSubobject<USoundWave>(TEXT("DrinkSound"));
	//DrinkSound->SetupAttachment(RootComponent);


}


void AItem::GetPlayer(AActor* Player)
{
	DrunkPlayerController = Cast<ADrunkSimulatorCharacter>(Player);
}

DrunkSimulatorCharacter.cpp

ADrunkSimulatorCharacter::ADrunkSimulatorCharacter()
{
	// Set size for collision capsule
	GetCapsuleComponent()->InitCapsuleSize(55.f, 96.0f);

	// set our turn rates for input
	BaseTurnRate = 45.f;
	BaseLookUpRate = 45.f;

	//Set up variables
	Health = 100.0f;
	BloodLevel = 0.0f;
	//TimeLeft = 0;

	// Create a CameraComponent	
	FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));
	FirstPersonCameraComponent->SetupAttachment(GetCapsuleComponent());
	FirstPersonCameraComponent->RelativeLocation = FVector(-39.56f, 1.75f, 64.f); // Position the camera
	FirstPersonCameraComponent->bUsePawnControlRotation = true;

	
	Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P"));
	Mesh1P->SetOnlyOwnerSee(true);
	Mesh1P->SetupAttachment(FirstPersonCameraComponent);
	Mesh1P->bCastDynamicShadow = false;
	Mesh1P->CastShadow = false;
	Mesh1P->RelativeRotation = FRotator(1.9f, -19.19f, 5.2f);
	Mesh1P->RelativeLocation = FVector(-0.5f, -4.4f, -155.7f);

	//Character Movement Components
	GetCharacterMovement()->MaxWalkSpeed = 300.0f;
	
	DrunkVision = CreateDefaultSubobject<UPostProcessComponent>(TEXT("DrunkVision"));
	DrunkVision->SetupAttachment(Mesh1P);
	DrunkVision->BlendWeight = 0;
	

	

}

Looking at the header files provided, I cannot see a definite cause of the “Using incorrect object initializer.” error you’re getting. If these are the only classes you worked on prior to the project failing to open I’m not sure what could be causing this without looking at the code directly. If possible, could you provide a copy of the project to test? This can be done privately by uploading the project to google drive / dropbox and then sending me a PM on the forums with a download link.

Hey -

After looking at the code for the project, I found that in IntObject.cpp at line 22 you have MeshComponent->CreateDefaultSubobject. If you edit this line to MeshComponent = CreateDefaultSubobject with the equal rather than arrow operator, the project will compile and open successfully. In this case you are creating the StaticMeshComponent and then assigning it to the MeshComponent variable.

Cheers

Thank you so much can’t believe I didn’t see that before. I still have one problem thought… The project still crashes with the same error when I try and launch it. I should be using Build->Build Solution to build the project correct?

Build Solution should build everything that has not been built before or has changed since the last build. Another option you can use would be to select the project itself in the Solution Explorer and select Build from the right-click menu. This will build only the project module and its required files. This is the option I used when building the project on my end and was able to open it after the compile completed.

Even deleting IntObject.cpp and IntObject.h in both VS and the source folder doesn’t fix the issue. I don’t understand why you can launch successfully but I cannot. There must an issue some where else too. But I have been looking for hours and I can’t find anything.

It still doesn’t work. I tried replacing all the project files for the heck of it but still nothing. Well I’ll keep trying to figure it out. Thanks for the help

If you’ve deleted files from the source folder, you will need to right click the .uproject and select “Generate Visual Studio project files” to ensure that the .sln is updated with the removed files. If you still have a copy of the removed files, the only other change I can think of would be to move the public: line in IntObject.h above the UPROPERTY() line for your MeshComponent.