DarkholmeTenk / TardisModIssues

Contains the issues tracker for the private TardisMod
25 stars 8 forks source link

[ENHANCE] Linked TARDIS doorways actually distort physics. #550

Open shadowbolt79 opened 8 years ago

shadowbolt79 commented 8 years ago

This is something that I might actually be able to help out with if you want it, and if I have time, and it stems based of a recent unity project I started doing.

The link function of the screwdriver could be changed so that it creates a type of portal that can be seen through. Around the edge you would have linked tardis blocks, so when you change the color on one side, it changes the color on the other. At the bottom center would be one of the room control blocks, so the two can be delinked.

The portal space would be 2 deep, and completely passable by air. The moment the player (or entity) position > the plane that is the exact center of the first block, it teleports them to the other side. The reason it would be 2 deep, would be to allow larger creatures brought through the TARDIS to pass through the doors that may not otherwise.

Behind that, would be a layer of solid blocks. Why solid? Because I recently got a Vive and that uses a teleportation system that needs something to collide with before I leap out into the void. Best to have compatability.

Technical explanation follows:

I don't know how much of this is plausible in minecrafts rendering system, it's been ages since I looked at the code, (LookingGlass is derived from my dimensional rendering code I made for mystcraft... and was really the only thing I've done with java before) but my project uses depth shaders to keep an area from being rendered to the current frame, thus letting previous renders show through.

You then have code that checks if a portal is visible, then moves to render it. Before it renders, it finds other portals to render. To prevent infinite recursion, a value is kept to make sure that it doesn't render past 3 portals in. Of course, your other cameras would be limited to a rectangle on the screen where the doorways would end up being.

This keeps native resolution, and prevents artifacts from RTT methods at a minimal cost comparative to the other room actually being present at that location.

What you'd end up with is a back-to-front rendering chain without using extra texture memory, and only a very slight hit to framerate.

Portals would be depth-blocked on the backside of the first layer of the portal blocks. Because of the teleportation, you can easily avoid artifacts with clipping through.

I can provide code for my current program - would make a good starting point to see how I have done things. Or, if it doesn't get done before I have time to actually sit down and program for things again, I could take a crack at it myself, if it's something that you'd like to include.

FoxPotato commented 8 years ago

Well, it sounds quite amazing. We would love it if it were possible. But right now Dark is really busy with other things and this is just a bit too far out of my league. But the good news is; TM went open source a week or 2 ago (link). So if you would like to have a crack at it, go ahead. :+1:

shadowbolt79 commented 8 years ago

I've been really busy as well - with work, school, and a few obligations to IRL friends. But if my schedule opens up - definitely. I've also been invited by Xcomp to help out with LookingGlass, which I partially want to revamp. I am kind of wanting this kind of functionality in those dimensional portals as well. (Which could feed back to this mod as well if I finish that.)

This would give me good practice to get back into minecraft modding - It's been a few years. ^^

AlienXtream commented 8 years ago

wait? Xcomp invited you to help with looking glass?! Dude, welcome to the TM dev team- open source branch :P

shadowbolt79 commented 8 years ago

I helped MAKE LookingGlass. It was a mod called Dynamic Linking Panels. AKA LG v0.7. It just wasn't an API. I was the one who figured out cross dimensional rendering when people in the modding IRC told me it was impossible to do. XComp took my code and cleaned it up and turned it into an API.

shadowbolt79 commented 8 years ago

But yes - life's been busy with college and personal obligations, so coding projects have hit the backburner temporarily.

AlienXtream commented 8 years ago

yeh, i figured that out a couple hours after my comment :P but yeh, it seems like a lot of people have this thing called "a life". dark has one, Fox has one... seriously? was there a sale on these things reacently? i need one too ya know :P i'm joking of course. the "advantage" of having no long term obligations....

shadowbolt79 commented 8 years ago

Lol. Well, I'd actually kind of want to work on this mod first. Mostly to figure out seamless portals in minecraft. THEN I'd like to get to work on LookingGlass again. So I can get seamless portals across dimensions. I know it's possible, but it'll be easier to figure it out one step at a time. :P

AND THEN I'd like to integrate LookingGlass into the TARDIS doors. Because why stop there.

You know, when I have time to mod again.

PrincessOfEvil commented 8 years ago

Mostly to figure out seamless portals in minecraft Ichun's Portal mod?

AlienXtream commented 8 years ago

I think the biggest hurdle with seamless cross dimensional travel is that ....well.... ITS IMPOSSIBLE.... Well, using the vanilla system anyway. You would need to rewrite a fair bit of the chunkloading code for true, tardis like, seamless transport. I would suggest you ensure that portals can work seamlessly over very long distances (500-1000 blocks) to get the loading method right before tackling cross dim stuff. Thats my 2 cents worth on the matter anyway. Its a rather big deal if you can actually find a suitable way of transitioning smoothly across dimensions as it will eliminate the vanilla method (and hopefully the huge time you are stuck when changing dims in heavily modded games. I have to wait like 2 mins for my tps to catch up at times if i haven't left the tardis in a while.. Its a real bottle neck when you need to keep popping all over the place)

shadowbolt79 commented 8 years ago

That's exactly what I was told when I was on the IRC for forge before creating the predecessor to LookingGlass. HOWEVER, everything in minecraft's rendering code revolves around a single variable known as - theWorld. I'm sure you've heard of it. :p

You're actually able to hotswap that during the rendering process and call a re-render - it's how my cross dimensional rendering code for LookingGlass worked to begin with. You just have to load a fake player at the location of the other side of the portal and capture and resend packets to the real player in order to then also send packet data. That's going to be the most difficult part - ensuring all mod data transfers that's relevant.

So once you figure out seamless portals within the same world - as I've seen other mods do - it's really not that hard to get them working cross-dimensions either.

AlienXtream commented 8 years ago

So, in a manner of speaking, you found a way to "preload" chunks at a given location?

shadowbolt79 commented 8 years ago

Yes. A separate copy of the world that's only swapped into place when you're using it isn't touched by the world unloading code caused by the player. You can call whatever loading, whatever rendering you want, You just have to make sure the original theWorld is back in place when you're done with that event block. My plan on server-side is to have the chunk tickets set to the fake players - but I haven't tried it yet. Either way, is it should be fine because they'd only be chunk loaders while a player is standing close enough to the other side of the portal.

You do have to write your own chunk unloading code, however...

In the case of LookingGlass, my plan is to have a dimensional hashmap, and load/unload information to each dimension as I need it.

A funny thing is, I had written chunk loading code that operated ~10x faster than vanillas for the other world specifically. Since you couldn't dig down or see through solid blocks, I created a scanner that made it only send relevant/visible information to these second worlds. Parts of chunks, not the whole thing.

This way, it's not wasting more data/memory than it needs. Of course, the moment you can swap over there, you'll need to invalidate the chunk so the server loads the rest of it for the client, but not really much of an issue. Even if the immediately start digging down; the server should be able to get that chunk downloaded onto the client within a few seconds, and will keep them from suffocating.

shadowbolt79 commented 8 years ago

These separate copies of theWorld is client side only, by the way. The server doesn't need them - they just need a chunkloading ticket.

AlienXtream commented 8 years ago

Wow. Something that looks out of reach is so much closer than people think. I applauded you good sir on your unwillingness to give up on an idea despite the apparent impossibility of the goal. Too bad more people in the world arnt like that (my self included :p) i bid you good luck in both life and with this project :)

shadowbolt79 commented 8 years ago

I have severe ADHD. Sometimes, like this, it helps me. (Mostly not) Before DynamicLinkingPanels (predecessor to LookingGlass), I had barely touched minecraft's code. Part of the reason DLP is the only thing I've made for minecraft to date. I can just get in and understand pathways easily. I also built my first working version in a week, so.... didn't really take me long to find the solution.

AlienXtream commented 8 years ago

Ah... Attention Deficit Hyperactive Disorder. Cant stick with a project too long without getting distracted i take it :p. I (among other things) struggle with its sister disorder of ADD so to some extent i understand your challenge there, but everyone is different. You know.... People say that like its this amazingly crazy thing but it would be FAR more interesting finding two people who are identical down to the fingerprints. Also...the fact i have now migrated to this topic just proves the point of my inability to stick with one thing. Sorry for the inbox spam Dark :P

shadowbolt79 commented 8 years ago

Indeed. It's both a blessing and a curse. I tend to lock onto what I consider challenges, and wont let go until it's solved. The only reason I probably completed DLP as fast as I did was because big-name modders in the IRC said it was impossible, and my mind wanted to interject its own reality. But after somethings solved I have issues staying on the project without another issue to solve, and it looses wind rapidly. Slowly learning how to counteract that...

But yes, I should have the source to DLP lying around somewhere, if you wanted to look at it and figure out what I did to get everything running. It shouldn't be too much more work to get it to work here.

AlienXtream commented 8 years ago

If dark or fox are interested but i wouldnt understand it. I often use the statement "i couldn't code my way out of a cardboard box" in these kind of situations.

shadowbolt79 commented 8 years ago

Mostly to figure out seamless portals in minecraft Ichun's Portal mod?

It's been a while since I played with that mod, but those portals weren't exactly 'seamless'. With seamless portals, you can walk through an archway without being able to tell that you were teleported at all. The doors mod is more like it, but even then there was some slight reactions.

If dark or fox are interested but i wouldnt understand it. I often use the statement "i couldn't code my way out of a cardboard box" in these kind of situations.

Fair enough. But I'm still willing to help out when I can.

cleverca22 commented 7 years ago

related improvement, allow opening the door of the tardis, without going out, and allow mining the blocks that are covering the door up

FoxPotato commented 7 years ago

opening the doors has been something that we've wanted for some time but never got around to. And i guess being able to break just the 2 blocks in front of the door won't be toooo hard since you just have to check if the player hit the top part of the door or the bottom part (but it's been quite a while since i've actually worked on this mod so idrk tbh ^^")

cleverca22 commented 7 years ago

i was thinking create a phantom copy of the block outside the door, in the tardis dimension, just outside the door (maybe copy ~3x3x3 cube over), probably using some facade-like code, so you only get the textures, and attempts to break them

then if the player breaks the phantom inside the tardis dim, also break the original outside the door

AlienXtream commented 7 years ago

what about fluids?

shadowbolt79 commented 7 years ago

If I can ever get around to my suggestion and actually coding it, the phantom copy would be a mute point. :P Cross dimensional travel like that would mean people could just walk into and out of the tardis seamlessly, and potentially mine cross dimensions too.

As for fluids... that would be the simplest part - leave them be. It's easy enough with all the TARDIS's abilities to suggest it can have a force field to keep fluids out. It already can create air pockets in the vacuum of space...