Unreal Engine Side Project: Pt0
-
- Posts: 148
- Joined: Mon Jan 20, 2020 9:01 am
Re: Unreal Engine Side Project: Pt0
Array of Vectors: Vector gridx,y, z (indexed in parallel to hism)
SpawnRegister:-> Array of custom Struct: 1. Vector gridxyz, 2. spawnState
Flow:
1. Initial anchor build, spawning the hism anchors
2. In parallel intialize SpawnRegister, with transforms for each hism anchor, each spawnstate true
3. Inparallel build also array with vectors
4. After 1000m distance moved: Get nearest hism
wip
SpawnRegister:-> Array of custom Struct: 1. Vector gridxyz, 2. spawnState
Flow:
1. Initial anchor build, spawning the hism anchors
2. In parallel intialize SpawnRegister, with transforms for each hism anchor, each spawnstate true
3. Inparallel build also array with vectors
4. After 1000m distance moved: Get nearest hism
wip
Re: Unreal Engine Side Project: Pt0
Have you needed to write any code snippets yet or is it all using visual code blocks? The videos are great and very helpful to see how things are working out and progressing. Keep them coming.
-
- Posts: 148
- Joined: Mon Jan 20, 2020 9:01 am
Re: Unreal Engine Side Project: Pt0
Thank you, Jer . So, far it's all done with the blueprint visual style of coding. It has proven quite comfortable, but depending on how fast the project needs to run or how far I have to dive into the engine, real coding is likely upcoming. Good thing is that c++ code can work alongside using the visual style.
New video here (really happy with how the the proc worldgen is developing, but the elephant in the room - the streaming - needs still to be tackled):
https://youtu.be/MZsLYPv0Qqk
New video here (really happy with how the the proc worldgen is developing, but the elephant in the room - the streaming - needs still to be tackled):
https://youtu.be/MZsLYPv0Qqk
-
- Posts: 148
- Joined: Mon Jan 20, 2020 9:01 am
Re: Unreal Engine Side Project: Pt0
A bit of brainstorming:
- Compare OLD nearest SubLevelAnchor x,y,z with NEW SubLevelAnchor x,y,z (<,>,==)
- 26 results possible (27 is no move, irrelevant in this context)
- these determine a) where to exchange HISM with Actor (moing towareds thsi diretcion) and a) where to exchange Actor with HISM (moving awaya from this direction)
- result will decide a) around which SLA to destroy all actor (clear sublevel) and b) what to spawn anew around these SLA (Actor or HISM, by setting the SpawnContentState proptery of the SLA to true and then the SpawnAsActors property of the resulting HISM Spawner to eitehr to true or false).
- maybe use this technique for the movment of outer rim of the HSIM cube, too, to optimize respawning of HISM
- Compare OLD nearest SubLevelAnchor x,y,z with NEW SubLevelAnchor x,y,z (<,>,==)
- 26 results possible (27 is no move, irrelevant in this context)
- these determine a) where to exchange HISM with Actor (moing towareds thsi diretcion) and a) where to exchange Actor with HISM (moving awaya from this direction)
- result will decide a) around which SLA to destroy all actor (clear sublevel) and b) what to spawn anew around these SLA (Actor or HISM, by setting the SpawnContentState proptery of the SLA to true and then the SpawnAsActors property of the resulting HISM Spawner to eitehr to true or false).
- maybe use this technique for the movment of outer rim of the HSIM cube, too, to optimize respawning of HISM
-
- Posts: 148
- Joined: Mon Jan 20, 2020 9:01 am
Re: Unreal Engine Side Project: Pt0
Simpler:
Check around new center grid x,y,z with distance condition (maybe 1800 meter). All SLA found that are (stil)l set to spawn HISM have the actros/HISM spawned 500 Meters aorund them remoived and are set spawn (new, real) actors.
SEcodn check aroudn new centerBetween 1800 und 3000 Meter. Any All SLA found that are (stil) set to spawn (real) actors have the actros spawned 500 Meters arund them remoived and are set spawn HISM instead.
Seeding: Each SLA (and its HISM Spawner) have a unique seed to use for its stream of random numbers (used during proc gen for this sublevel)Seed is computed from teh gridx,y,z coordinates of SLa/HISM spawner. Problem: negative coordintes, hash building.
Check around new center grid x,y,z with distance condition (maybe 1800 meter). All SLA found that are (stil)l set to spawn HISM have the actros/HISM spawned 500 Meters aorund them remoived and are set spawn (new, real) actors.
SEcodn check aroudn new centerBetween 1800 und 3000 Meter. Any All SLA found that are (stil) set to spawn (real) actors have the actros spawned 500 Meters arund them remoived and are set spawn HISM instead.
Seeding: Each SLA (and its HISM Spawner) have a unique seed to use for its stream of random numbers (used during proc gen for this sublevel)Seed is computed from teh gridx,y,z coordinates of SLa/HISM spawner. Problem: negative coordintes, hash building.
-
- Posts: 148
- Joined: Mon Jan 20, 2020 9:01 am
Re: Unreal Engine Side Project: Pt0
Running into stall problems with this approach for streaming. It is odd as loading the much larger whole grid works great at game start.
Ideas:
- limit destroy and respawn operations per tick, spread them out across several ticks
- use alternative to get all objects of class, like adding to separate array on creation
- implement actor pool solution
- switch to world composition or streaming levels, problem: generate the level procedurally prior streaming it in, theoretically each cube can a level/layer but I doubt this will be more efficient
Ideas:
- limit destroy and respawn operations per tick, spread them out across several ticks
- use alternative to get all objects of class, like adding to separate array on creation
- implement actor pool solution
- switch to world composition or streaming levels, problem: generate the level procedurally prior streaming it in, theoretically each cube can a level/layer but I doubt this will be more efficient
-
- Posts: 148
- Joined: Mon Jan 20, 2020 9:01 am
Re: Unreal Engine Side Project: Pt0
Another one to try: place the destruction logic into actor itself, measuring its distance to centrr and sekf destruct (if that is possible at all) based on distance
Crazy thought: What if actors would procdurally spawn their neighbours? A running cascade of self replicating actors reading spawn instruction from central spawner.
Adjust frequency of tick event (details).
Spwaner might caary an array of structs (transform, mesh, material).
Same for HISM actors.
Crazy thought: What if actors would procdurally spawn their neighbours? A running cascade of self replicating actors reading spawn instruction from central spawner.
Adjust frequency of tick event (details).
Spwaner might caary an array of structs (transform, mesh, material).
Same for HISM actors.
-
- Posts: 148
- Joined: Mon Jan 20, 2020 9:01 am
Re: Unreal Engine Side Project: Pt0
Note to self:
Each HISMSpawner (72 in worst case for field with radius 4) will spawn its content (HISM or true actor) one piece per tickevent of the correspondent HISMSpawner. An index on the HISMSpawner will remember the position reached last tick (construction progress index). With 5 meter/s max speed of player and 1.000 meter stream triggers interval, we have 200 seconds (memo: kill falling player after certain drop distance, even withotu touch dwon). For saftey lets use 180 seconds. With target frame rate of 60fps, we would 180x60 ticks = 10.800 objects per HISMSapwner. As frame rate will fluctuate lets work with 45 frames on average, will bring this down to 8.100 objects. With these high numbers I think the limit will not be the streaming speed but rendering power per frame. For fun, with such approach I could try a 20x20x20 generation matrix (will be too slow, but still).
This apporach might allwo for background streaming - oh,well, or more backgroud hitching .
Each HISMSpawner (72 in worst case for field with radius 4) will spawn its content (HISM or true actor) one piece per tickevent of the correspondent HISMSpawner. An index on the HISMSpawner will remember the position reached last tick (construction progress index). With 5 meter/s max speed of player and 1.000 meter stream triggers interval, we have 200 seconds (memo: kill falling player after certain drop distance, even withotu touch dwon). For saftey lets use 180 seconds. With target frame rate of 60fps, we would 180x60 ticks = 10.800 objects per HISMSapwner. As frame rate will fluctuate lets work with 45 frames on average, will bring this down to 8.100 objects. With these high numbers I think the limit will not be the streaming speed but rendering power per frame. For fun, with such approach I could try a 20x20x20 generation matrix (will be too slow, but still).
This apporach might allwo for background streaming - oh,well, or more backgroud hitching .
-
- Posts: 148
- Joined: Mon Jan 20, 2020 9:01 am
Re: Unreal Engine Side Project: Pt0
Do "set TickEnabled" to false on the HISMSpawenr in question after construcion index has reached its limit to save overhead.
-
- Posts: 148
- Joined: Mon Jan 20, 2020 9:01 am
Re: Unreal Engine Side Project: Pt0
I am giving up on smooth streaming for now, there will be a 10 to 20 sec loading pause once in a while while streamig in a new part of the world.
Still, lots of progress made on world generation :
https://youtu.be/ZNjtcsCU_Us
Still, lots of progress made on world generation :
https://youtu.be/ZNjtcsCU_Us