Jump to content

Recommended Posts

Posted

TL;DR: I want to make floating spaceships in the air and space like in Space Engineers. I think I can achieve that by rendering extra dimensions and moving around the space instead of the blocks. I'm trying to render two client worlds at the same time but when I run an extra instance of WorldRenderer, I only see particles from the original dim, and the blocks and sky from the extra dim. See the video for what that looks like. I have a GitHub repo link.

Q: How can I get two worlds to properly render at the same time without preventing the other from being seen?

I'm open to being told that I should create a different plan to achieve this.

 

I need some help from someone who is very familiar with the vanilla render pipeline in WorldRenderer and GameRenderer.

 

Here's what I'm trying to achieve:

 

What I want is grid structures that can be interacted with in the same way that the world is interacted with. I want these structures to be free from the rigid grid of the overworld chunks and be able to freely move and rotate, similar to what you might see in other blocky games with physics, like Space Engineers or StarMade. I want these structures to be able to travel far away enough into the sky that eventually any player inside them is no longer loaded in the overworld, or by some other condition. I would ideally like to make this transition seamless, so that while the player is on one of these structures approaching the overworld in a planet like sense, the world begins to load once they get close to the ground. And then if they leave the structure, they are in the overworld and can travel far enough away from the structure that it unloads while they're still in the overworld. Basically a rocket ship that preloads itself and its destination, and has proper physics.

 

My current plan for trying to implement this is to abuse dimensions as a gridspace for the structures, and load the chunks from other dimensions under certain conditions and then render those dimensions at the same time as the overworld to make it look like the structures in the extra dimension exist in the overworld. I should then be able to set the renderview entity position and other factors in order to translate the structure in view in relation to other, effectively allowing it to move.

 

The reason I am trying to render two worlds at the same time is because it's the first step in my imagined plan to achieve this functionality:

 

I expect the implementation to take me through the following stages of experimentation and development:

1. Implement being able to render a second ClientWorld at the same time without massive render impairments. <-- What I am currently working on

2. Get the server to properly track which extra dimensions and which of their chunks should rendered and loaded for players when they aren't in that dimension.

3. Add the ability to render the extra worlds in different rotations and positions.

4. Add conditions that control when extra worlds and which of their chunks should be loaded

5. Manage hot switching the client worlds so that transitioning out of the overworld while in a structure doesn't cause "change dimension" load times since the chunk data is supposedly already loaded

6, and further. Implement physics for the blocks in the bodies to detect collision between dimensions. Create a dimension space to track positions of these "structure dimensions". Add transition conditions so that extra dimensions are sometimes loaded or unloaded, not all the time or never.

 

What I have managed so far:

 

I have managed to make a setup that preserves the last ClientWorld that the player was in beyond that world's lifetime for testing purposes. I have AT'ed vanilla enough that I have a second WorldRenderer that I call updateCameraAndRender() on to try to render the preserved ClientWorld. I call the method during the event RenderWorldLastEvent which is fired right after vanilla finishes running updateCameraAndRender() on the normal WorldRenderer instance.

 

This produces some interesting results. I've manually managed the state memory during my second WorldRenderer call so that it doesn't absolutely crash and burn , and I can easily turn this effect on or off without side effects to the renderer when the modded code is off.

 

What I wanted was to render both worlds at the same time, but what I am getting is only seeing the blocks of the previous world and it's sky, but the particles that I see are rendered from the original world. There's a video of what that looks like below.

 

Because I'm seeing particles being rendered from the original natural world while looking at the blocks and sky of the fake world, I know that it isn't due to render call order. But I'm still confused what render calls are preventing this from working. I'm trying to figure out if I missed something or if I need to try to recreate my own worldrenderer that is able to draw my multiple worlds at once in a single ordered sequence rather than one call to a unique WorldRenderer for each world. If you want to look at my code here's the repo:

https://github.com/DavidTriphon/MinersSpaceProgram

 

Video:

 

Spoiler

Video of current render experiment

 

 

Always, RESEARCH before asking a question. It's likely someone has already asked your question in the past. Filter your google searches with "site:www.minecraftforge.net/forum" to have a better chance finding your problem.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.