Flone-dnb/FWorldGenerator

Generate World + Chunks?

PoPoWanObi opened this issue · 20 comments

Apologize as there probably isn't an issue here, but rather confusion on setting this up.

I've created a new project and imported and installed the plugin; and it appears to be functioning properly as I can generate a single chunk.

Screenshot at 22-11-03

I'm able move around on the chunk but; it does not generate new ones. I have the world size set to -1 and viewdistance set to 3. As I approach the end of the chunk nothing new is generated, and I am able to simply walk off. Any suggestions, or have I made a mistake?

Edit: By chance do you have a example project file with defaults?

Hi! Set the world size to 0 as from readme:

World Size (valid values range: [-1, ...]) - when set to 0 the world will be infinite, when set to -1 the world will be 1 chunk size, when set to 1 the world will be 1 ViewDistance size, when set to 2 the world will be 2 ViewDistance sizes (for example if ViewDistance is 1, then the world will be 5x5). And so on...

World size == '-1' will have only 1 chunk. For some reason one part of the readme was saying to set World Size to '-1', fixed that:
07b4d58

Hello, thanks for the response.

I have also tried setting the world size from 0 all the way through to 10 so far, and each time I attempt to PIE or Standalone it causes a crash in both UE4 4.25.3 and 4.26.1

Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\Build\++UE4\Sync\Engine\Source\Runtime\Core\Public\Containers/Array.h] [Line: 674] Array index out of bounds: 16 from an array of size 16

Hm, I haven't used Unreal since 4.24 and I don't even have installed it anymore :D. Let's see:

  1. Have you tried moving your logic from begin play to some button press?
  2. Is the character located in the place where the center chunk will be generated?

P.S. Is there a full call stack for this crash? If there's nothing related to the tool it might be an incompatibility of the engine version. I've used this tool on 4.23 or 4.24 (don't remember).

P.P.S. I'm not on my main PC right now but can help you debug this issue after 1-2 days (I will be on my main PC very soon).

There was nothing relevant to the tool itself in the crash stack; so possibly an engine update issue.

  1. On the attempt of moving logic to a button press: same result.
  2. The character is placed in the default third person arena (above the chunk -- with walls removed) directly in the center.

There's no rush; so whenever you happen to get a chance to investigate I'd appreciate it. If you have any other suggestions you'd like me to try however, do let me know.

Well, right now I can only suggest you try this on 4.24 version. Tomorrow or the day after tomorrow I will be able to try this on 4.24 and 4.26 and see if there is an actual issue.

So, I've checked the 4.24.3 and the 4.26.1 versions. All works fine out of the box. I've created a third-person template, added a Plugins folder with the plugin, reopened the project (UE compiled the plugin), added FWGen class in the world, added logic on BeginPlay (just like on your screenshot) - all works fine, no crashes. Chunks load correctly.

P.S. Try again (like I did). I've only changed the chunk size (to 10.0f) and row/column count (to 100) all other settings were default.

Hello, thanks for taking the time to check it out.

I just tried again doing exactly what you said, and it didn't crash immediately this time, but does crash after beginning to move. I've uploaded a video to show you (approximately 1 minute)
YouTube

Edit:

Just removed the arena walls to see and this is what happened when I hit PIE:
Screenshot at 05-37-42

Haha. So, after I was spawned I was going to the right (all working), you are going forward (and getting the issue). The issue is that the character is not in the central chunk (but I should be teleported by the tool in GenerateWorld()) and so the tool thinks you are in the central chunk (but you are not) and you are going forward and entering central chunk this causes the issue.

It teleports you to the central chunk only if:
if (iCentralChunkX != 0 || iCentralChunkY != 0)

which is wrong.

Just pushed a fix for this. Please, recreate the project with the new version (clone master brunch) and tell if the issue still persists.

Hiya; still having the same issue/error when updating to the latest.

It just freezes/or crashes when attempting to PIE/Standalone. :/

Lol, you mention I am not in the central chunk, how are you sending the character there? I see the latest commit is supposed to do that; but I don't think it has enough time to do that before it's freezing.

I set everything to 0,0,0 in this trial.

It also just crashes immediately whenever enabling "Complex Preview". The only time I was able get terrain to render was with the original changes posted, and it would build one chunk and all the settings worked; but it wouldn't generate more chunks.

"The only time I was able get terrain to render was with the original changes posted".
You might be under the terrain (this is why you don't see it), modify the Z-coord of the FWGen object and GenerationMaxZFromActorZ (FWGen object has a visible volume box that you can use as a reference).

How did you update the plugin? Copied the updated files into the Plugins/FWorldGenerator folder? Because you need to recompile the plugin (by updating the files it's not gonna recompile). I created a fresh new project and added the latest version, UE asked to compile the plugin, compiled and all is working as expected.

I updated the plugin by rebuilding it in source manually.

I was able to walk around on the terrain originally; I had set myself up above the terrain and fell onto it.

For the sake of verification I'll remove the plugin and all relevant files, compile, start up editor, shut down, replace and compile again.

I've uploaded a new video.

YouTube

Can you share this project? Because I can't reproduce this issue.

Of course;
Project

Naturally I've tried both 4.24.3 and 4.26.1 from Epic Launcher and it produces the same result.

This project however was built in a freshly pulled 4.26.1 and compiled engine.

Yep. It crashes but there is nothing related to the plugin in the call stack so I don't know where to start. Can you make a project in 4.26.1 (from the launcher), include the Plugins folder, and share it here?

Working on it now. Will update shortly.

Here's the project file: Project

From 4.26.1 from Epic Launcher, plugin was compiled on startup of the project after adding it to the plugin folder.

Only changing World Size to -1 in this project allows the client to load and it will generate the first chunk, but won't load anymore. (I did have to move the third person actor above FWGen though.

Just finished loading all symbols... :D Working on it.

I don't see anything related to the plugin in the call stack but I've noticed that this issue appears not regularly. Sometimes all working fine but it crashes later. Maybe this is related to the third person template because I've used blank project all the time with the flying actor.

So, there is definitely something wrong somewhere but I can't figure out where because there is nothing in the call stack... It looks like I'm powerless here. Sad news but seems like it. I don't know how the engine is working so I can't tell more. Uh, sorry for that, and thanks for the attention.

All good friend, no need to apologize. I appreciate you taking the time to help investigate.

Perhaps a solution will present itself in the future. I've sent the crash reports to Epic, and perhaps they will find a solution where we could not. :)