andrewscheidecker / brickgame Goto Github PK
View Code? Open in Web Editor NEWA demo of Minecraft-style voxel rendering in UE4
A demo of Minecraft-style voxel rendering in UE4
Hi,
What about porting BrickGrid to later versions of the UE4 engine ? :)
Any word on this?
"Adapted GetStaticBatchElementVisibility to allow component-level backface culling in voxel rendering"
https://github.com/EpicGames/UnrealEngine/pull/1279
It looked like Mr. Penwarden was willing to accept the change, but seemingly nothing has happened. It would be great to have the performance improvements without needing to modify the Engine source ourselves. Can we send them a reminder?
Thanks for the awesome code!
I was having stability issues around the GetScene() calls in the FFunctionGraphTask::CreateAndDispatchWhenReady lambda in the BrickRenderComponent.cpp code (lines 496 and 502). I asserted the GetScene() and it was occasionally returning nullptr there. I moved the GetScene()->GetFeatureLevel() call to before the CreateAndDispatchWhenReady block and saved the result to a variable and used that in the CreateAndDispatchWhenReady block instead. This apparently fixed the issue. Thanks!
Changing BrickGame.Build.cs to this:
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class BrickGame : ModuleRules
{
public BrickGame(TargetInfo Target)
{
MinFilesUsingPrecompiledHeaderOverride = 1;
bFasterWithoutUnity = true;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
}
}
Improves compile time, like, for realsies. From minutes to 20 seconds tops.
Hi, is it the case that the project needs to be recompiled for every change made to the BrickGame plugin?
Or is it in any way possible to just have the source files modified and compile them through the editor?
Because all this time I have been recompiling the plugin trough Visual Studio to see the changes, and after working a bit on a project that does not use plugins I got used to the idea of just seeing the changes inmediately reflected on the game just by compiling through the editor.
As always, big time fan of the project, will be making a few PR's soon, and they will be made even sooner if I get to know how to avoid project recompiling. :)
Big time fan, Miguel
When I tried building this on OS X I get the following error:
LogLinker:Warning: Can't find file '/Script/BrickTerrainGeneration'
LogLinker:Warning: Can't find file for asset '/Script/BrickTerrainGeneration' while loading ../../../../../../Projects/BrickGame/Content/Blueprints/BrickGrid.uasset.
LoadErrors:Error: Error /Game/Blueprints/BrickGrid : Can't find file for asset. /Script/BrickTerrainGeneration
When I run a find from the project root I can see:
./Plugins/BrickTerrainGeneration
./Plugins/BrickTerrainGeneration/Source/BrickTerrainGeneration
but no folder "Script". Maybe this is a mac issue?
I was experiencing an "Stack cookie instrumentation code detected a stack-based buffer overrun." exception on large maps and it seems the following line is responsible for this:
BrickTerrainGenerationLibrary.cpp:134 CavernProbabilitySamples[LocalZ + 4] = NextCavernProbabilitySample;
On rare occasions CavernProbabilitySamples is being addressed at index 128 there but the maximum is 127.
A simple workaround for this is to increase the array size (Line 123) by +1.
Please consider changing this if there will be a future update. Took me a couple of hours to figure this out.
I cant find this in c++ code neither in blueprint or default values
where and when did you add thoses differents bricks materials in the gridparameters structure ?
Thanks for help
This one specifically:
https://github.com/UE4-OceanProject/OceanProject
https://forums.unrealengine.com/showthread.php?42092-Community-Project-WIP-Weather-amp-Ocean-Water-Shader
Once its added with a hardcoded material index, a really cool change could be done to the Render Component where if a block is adjacent to water then the ambient occlusion is smaller. That way the conduction of light through water could be simulated.
Hi , I get the following:
when trying to open brickgame project in ue 4.5.1 (it fails to rebuild) , I tried building in visual studio and opening that way too. Any way to use this with latest vanilla engine without using the modified one stated in readme ?
is it because I need to have installed those plugins before opening the project ?
please help , many thanks :)
I don't see a make file. Project needs to supply build instructions. This is a bit of an issue for building.
If this is *NIX compatible, please supply MAKE file
Hi!
I have a question about optimization. Does it make sense to make the cubes share a bigger face instead of having each one small face? The cost of calculating what cubes could share faces could surpass the benefits of sharing them.
Does it makes sense or is it a bad idea?
I try to launch the project, Unreal Engine says that I need to rebuild all the plugins, but when it tries to rebuild, it crashes.
Hello !
Recently, I started to work on a Voxel Engine, and your project helped me a lot !
I would like to add support for complexe shape, not only draw brick/voxel.
I understand how the Brick Render Component works but I have few questions concerning:
Thank you in advance :)
Cordially, Jackblue
I have built the custom 4.5.1 and I am using the master BrickGame branch. I registered the custom UE4.5.1 and created project files using it. PIE works fine, but simply double clicking the BrickGrid Blueprint crashes the editor. I read in the forums that this was an issue before you updated the code to 4.5. Is the master not updated? I am not exactly a GitHub master. I donwloaded a Zip from the master branch page, could that be the problem? If not what was the code change required to fix this originally?
Okay, lets get to a real hot topic. Water simulation? How would I proceed? And, how do I generate just a simple ocean? I think I need to drop my project because this is all stuff I'm not aware of ๐ข
Hi, I found out what some values do by modifying them, but I still have some questions relating to the different values. Could you please explain what some of the values like Uneroded Height do, and what Lacunarity and the period does? I want to modify the values so a big beautiful meadow comes out, but it seems like I'm not getting the values right. Could you help me? :)
Thanks ๐
I have added some classes to the BrickGame plugin and modified them so that the project builds properly. I ran into a problem when trying to include my classes in the UBrickGridComponent class. Visual Studio throws an error saying that it cannot find my class.
So my question is, how do I properly add classes to the plugin?
I can't seem to figure out how to get this to work with NavMeshes for AI controlled actors.
It crashes when I launch the game, and here's the log:
LoginId:2cb65646f14b423c73521780803f17ea
EpicAccountId:9450efd4cdac4f64987a484e169cb58a
#0 at 0x7fff98f40f06
__pthread_kill Address = 0x7fff98f40f06 (filename not found) [in libsystem_kernel.dylib]
abort Address = 0x7fff9fd966df (filename not found) [in libsystem_c.dylib]
basename Address = 0x7fff9fd5ddd8 (filename not found) [in libsystem_c.dylib]
MTLReportFailure Address = 0x7fff9767d7ad (filename not found) [in Metal]
validateVertexAttribute(MTLVertexBufferLayoutDescriptorInternal const&, int, MTLVertexAttributeDescriptorInternal const&) Address = 0x7fff97684754 (filename not found) [in Metal]
-[MTLVertexDescriptorInternal validateWithVertexFunction:error:] Address = 0x7fff97684bb1 (filename not found) [in Metal]
-[MTLRenderPipelineDescriptorInternal newSerializedVertexDataWithFlags:error:] Address = 0x7fff9767cfe7 (filename not found) [in Metal]
-[MTLCompiler newRenderPipelineStateWithDescriptor:options:reflection:error:completionHandler:] Address = 0x7fff97670d5e (filename not found) [in Metal]
-[_MTLDevice newRenderPipelineStateWithDescriptor:error:] Address = 0x7fff9765e9fd (filename not found) [in Metal]
FMetalRenderPipelineDesc::CreatePipelineStateForBoundShaderState(FMetalBoundShaderState*, FMetalHashedVertexDescriptor const&) const Address = 0x144bae2c3 (filename not found) [in UE4Editor-MetalRHI.dylib]
FMetalBoundShaderState::PrepareToDraw(FMetalHashedVertexDescriptor const&, FMetalRenderPipelineDesc const&) Address = 0x144b93890 (filename not found) [in UE4Editor-MetalRHI.dylib]
FMetalContext::PrepareToDraw(unsigned int, EMetalIndexType) Address = 0x144b8dbf1 (filename not found) [in UE4Editor-MetalRHI.dylib]
FMetalRHICommandContext::RHIDrawIndexedPrimitive(FRHIIndexBuffer*, unsigned int, int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) Address = 0x144b74a36 (filename not found) [in UE4Editor-MetalRHI.dylib]
FMeshDrawingPolicy::DrawMesh(FRHICommandList&, FMeshBatch const&, int, bool) const Address = 0x11d3bb7b3 (filename not found) [in UE4Editor-Renderer.dylib]
int TStaticMeshDrawList<TBasePassDrawingPolicy >::DrawElement<(InstancedStereoPolicy)2>(FRHICommandList&, FViewInfo const&, FMeshDrawingPolicy::ContextDataType, FDrawingPolicyRenderState&, TStaticMeshDrawList<TBasePassDrawingPolicy >::FElement const&, unsigned long long, TStaticMeshDrawList<TBasePassDrawingPolicy >::FDrawingPolicyLink*, bool&) Address = 0x11d293d88 (filename not found) [in UE4Editor-Renderer.dylib]
bool TStaticMeshDrawList<TBasePassDrawingPolicy >::DrawVisibleInner<(InstancedStereoPolicy)2>(FRHICommandList&, FViewInfo const&, FMeshDrawingPolicy::ContextDataType, FDrawingPolicyRenderState&, TBitArray const*, TArray<unsigned long long, SceneRenderingAllocator> const*, StereoPair const*, int, int, bool) Address = 0x11d293113 (filename not found) [in UE4Editor-Renderer.dylib]
FDeferredShadingSceneRenderer::RenderBasePassStaticDataType(FRHICommandList&, FViewInfo&, FDrawingPolicyRenderState const&, EBasePassDrawListType) Address = 0x11d1fca77 (filename not found) [in UE4Editor-Renderer.dylib]
FDeferredShadingSceneRenderer::RenderBasePassStaticData(FRHICommandList&, FViewInfo&, FDrawingPolicyRenderState const&) Address = 0x11d1ffbc5 (filename not found) [in UE4Editor-Renderer.dylib]
FDeferredShadingSceneRenderer::RenderBasePassView(FRHICommandListImmediate&, FViewInfo&) Address = 0x11d1fc7a3 (filename not found) [in UE4Editor-Renderer.dylib]
FDeferredShadingSceneRenderer::RenderBasePass(FRHICommandListImmediate&) Address = 0x11d1fbd2e (filename not found) [in UE4Editor-Renderer.dylib]
FDeferredShadingSceneRenderer::Render(FRHICommandListImmediate&) Address = 0x11d2e353c (filename not found) [in UE4Editor-Renderer.dylib]
FRendererModule::BeginRenderingViewFamily(FCanvas*, FSceneViewFamily*)::EURCMacro_FDrawSceneCommand::DoTask(ENamedThreads::Type, TRefCountPtr const&) Address = 0x11d88cd10 (filename not found) [in UE4Editor-Renderer.dylib]
TGraphTask<FRendererModule::BeginRenderingViewFamily(FCanvas*, FSceneViewFamily*)::EURCMacro_FDrawSceneCommand>::ExecuteTask(TArray<FBaseGraphTask*, FDefaultAllocator>&, ENamedThreads::Type) Address = 0x11d8ff3eb (filename not found) [in UE4Editor-Renderer.dylib]
FNamedTaskThread::ProcessTasksNamedThread(int, bool) Address = 0x10d4c2571 (filename not found) [in UE4Editor-Core.dylib]
FNamedTaskThread::ProcessTasksUntilQuit(int) Address = 0x10d4be015 (filename not found) [in UE4Editor-Core.dylib]
FTaskGraphImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type) Address = 0x10d4ba891 (filename not found) [in UE4Editor-Core.dylib]
RenderingThreadMain(FEvent*) Address = 0x1133d83d4 (filename not found) [in UE4Editor-RenderCore.dylib]
FRenderingThread::Run() Address = 0x1133ebb97 (filename not found) [in UE4Editor-RenderCore.dylib]
FRunnableThreadPThread::Run() Address = 0x10d51acb3 (filename not found) [in UE4Editor-Core.dylib]
FRunnableThreadPThread::_ThreadProc(void*) Address = 0x10d4dcee1 (filename not found) [in UE4Editor-Core.dylib]
_pthread_body Address = 0x7fff92eff99d (filename not found) [in libsystem_pthread.dylib]
_pthread_body Address = 0x7fff92eff91a (filename not found) [in libsystem_pthread.dylib]
thread_start Address = 0x7fff92efd351 (filename not found) [in libsystem_pthread.dylib]
Hello Everybody,
This is less of an issue and more of a question.
I am trying to use the struct FBrickGridData from BrickGridComponent, but I am having no luck. What are the appropriate includes to use this struct in a class like BrickGameCharacter?
This leads to partial / incomplete shadows when using "GetStaticBatchElementVisibility()"
for the chunk backface culling (based on ViewPosition and FaceIndex)
(shadows incomplete due to culled faces not affecting lighting).
We can disable "bRequiresPerElementVisibility" to get the complete shadows,
but then we lose the large performance benefit of the culling.
Any recommendations?
commit reference:
https://github.com/EpicGames/UnrealEngine/commit/81ef7a206b58eb8204c9da4315aecd14cabde9c7#diff-0b08829a2ac94007500056981f30f153
Hi,
whats the right Unreal Engine branch/tag for the most recent BrickGame version?
I tried compiling Tag:BrickGame-4.14 but it seems that ShadowRendering.cpp has a HUGE merging issue from line 462.
https://github.com/AndrewScheidecker/UnrealEngine/blob/BrickGame-4.14/Engine/Source/Runtime/Renderer/Private/ShadowRendering.cpp
I read that it's possible to compile and run native UE4 binaries on linux. But I think there's something missing here to do it.
It would be much appreciated if someone adds the support.
Thanks!
Right now this can be done by adding a couple lines at BrickCollisionComponent.cpp, setting a Max Collision Distance of 10000 and of course, creating a big NavMeshBoundsVolume with location (0,0,0).
Being the plutonium green looking parts the one where you can order a Pawn to run to.
Main problem is that for the creation of the navigation the collision boxes need to be created, so in order to create a complete navigation mesh, one where you can tell a Pawn to run as far as you can see, you would need a 1/1 relation between the rendered blocks and the collision boxes. By default the relation is 50/1 being 50 the rendered blocks and 1 the collision boxes created. So I suppose thats for a reason. Edit* tested the performance change myself using 50000 as MaxCollisionDistance, can confirm: It kills the computer. (It took 5 more minutes than the usual 0 minutes to be ready to play).
Title says it all, I tried out to place the emissive blocks under the surface, and it is lit, but it doesn't light up the environment and all the blocks. The shadows / lighting of the block is supplied with AO values as I can remember.. Any chance to get this working? Thank you :3
I do not understand how to call the Update method in the BrickGridComponent class. I understand all the input variables except the last one defined as "FBrickGrid_InitRegion InitRegion".
Would someone please give an example of how to properly call this Update method from code using a BrickGridComponent variable.
Hey, I thought how Multiplayer support works with the BrickGrid. I mean, what parts need to be replicated in order to get a multiplayer result, where both server and client can place / destroy blocks, use flashlight, sky updates, etc.?
Hey, your work is awesome, but I have some errors compiling the plugins. The plugins "ConsoleAPI", "SimplexNosie" and "SuperLoopLibrary" compile fine, while "BrickGrid" and "BrickTerrainGeneration" fail. The errors come from BrickCollisionComponent.cpp. A list of all errors which I get:
I'm not very familiar with C++ so I can't fix this myself, thanks for help.
After developing a branch that supports complex shapes like half blocks or stairs, the cooked ambient occlusion is lost because the old FBrickVertex that contained three uint8 Coordinates and one extra uint8 called AmbientOcclusionFactor has been replaced by FDynamicMeshVertex, following the Cubiquity UE4 port lead.
The question is how exactly did that struct appear on the material as a Vertex Color input?
If you remember it would help integrating your AO work into the complex shapes branch.
BTW
Any other cool ideas you would like to be made in BrickGame?
Some cool ones:
Adding procedural meshes like grass on top of the grass blocks
Replacing deleted blocks by destructibles and adding force to them so that they go flying
On the same note, TNT blocks
error C3668: 'FBrickChunkSceneProxy::DrawDynamicElements' : method with override specifier 'override' did not override any base class methods F:\UnrealEngine Marketplace\BrickGame-master\Plugins\BrickGrid\Source\BrickGrid\Private\BrickRenderComponent.cpp 193 1 BrickGame
error : Failed to produce item: F:\UnrealEngine Marketplace\BrickGame-master\Plugins\BrickGrid\Binaries\Win64\UE4Editor-BrickGrid.dll f:\UnrealEngine Marketplace\BrickGame-master\Intermediate\ProjectFiles\ERROR BrickGame
What's going on? I have 90FPS, but my graphics card is getting louder and louder ๐ซ What's going on?
I am trying to use UBrickGridComponent in my BrickGrid class which is based off of the BrickGrid blueprint.
In my header:
TSubobjectPtr<class UBrickGridComponent> BrickGridComp;
In the constructor of my source file:
BrickGridComp = ObjectInitializer.CreateDefaultSubobject<UBrickGridComponent>(this, TEXT("BrickGridComp"));
The project builds the header properly, but throws an error when trying to run the source file. I have other components in my project which compile fine, when using similar syntax. What do you think is the problem? Is there another way to initialize this component?
Error Message:
error LNK2019: unresolved external symbol "private: static class UClass * __cdecl UBrickGridComponent::GetPrivateStaticClass(wchar_t const *)" (?GetPrivateStaticClass@UBrickGridComponent@@CAPEAVUClass@@PEB_W@Z) referenced in function "private: __cdecl ABrickGrid::ABrickGrid(class FObjectInitializer const &)" (??0ABrickGrid@@Aeaa@AEBVFObjectInitializer@@@z) C:\Users\Ben\Desktop\BrickGame-master\BrickGame-master\Intermediate\ProjectFiles\BrickGrid.cpp.obj
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.