4DService - A way to simulate what it would a 4D object would look like in a 3D space

I have a part of Project Sand Cat, PSS: 4DService!
WHAT IS IT?
PSS: 4D Engine is a way to think about how 4D would exist in our 3D universe. With 3D in 2D, a shape would get bigger, bigger, then it gets smaller and smaller until it disapears. Since in ROBLOX I can’t make a shape disapear it will hit the smallest point then if it was meant to decrease more it increases that amount.

HOW TO USE
module:Start(number) - A way to set the maximum shape increases/decrease.

module.addObject(instance) - Adds the instance to the system to function with the 4D system.

module.isObject4D(instance) - Checks if the instance has been registered to function.

module.get4dObjectProfile(instance) - Returns the internal profile that stores the position on the fourth dimension and the normal size.

module.change4D(instance, boolean, number) - It either adds or removes from the position on the fourth dimension of the specified instance. If the change goes beyond or below the number you set in module:Start it will put the rest of the argument 3 into the opposite direction than what argument 2 sets. For argument 2 you set true to add to the position and false to remove from the position.

HOW TO ADD
Add the following code to a script. The 4DService automatically adds itself to _G.4DService (needs to be referenced as _G[“4DService”] )

local MaximumSizePoint = 15 --[[How much the shape can decrease/increase in size 
from the original]]
require(8027741533):Start(MaximumSizePoint)
engine = _G["4DService"]
13 Likes

I can’t figure out how to render a 4D object, I’ve tried this:

local max = 15 

require(8027741533):Start(max)

local engine = _G["4DService"]

engine.addObject(Instance.new("Part"))

And it didn’t work.

Code is in a server script inside of ServerScriptService.

That would make sense, as all this seems to do when you add a part is this:

table.insert(_G.objects4d, object.Name)
_G.objects4d[object.Name] = {object, object.Size, 0}
1 Like

The part needs to be parented to workspace. The addObject just assigns an existing part the 4D variables. It adds the part to the 4D engine.

I tried setting the part of the part to workspace, but it looked normal. I guess I just didn’t move the part.

EDIT: It doesn’t work. The part isn’t doing anything weird at all.

It would be impossible to truly have 4 dimensions. I just made it do something similar to when you put a 3D object in a 2D space but more limited so you can’t loose your parts easily by setting the position too far away. In a 2D space when moving a 3D part through it the 3D objects gets bigger and bigger then gets smaller and smaller so this mimics it.

1 Like

A 3D object can’t move on a 4th dimension so it can’t push it in that direction. The changes are invoked through a script.

1 Like

But nothing happened though, it looked and felt exactly like normal 3D. I know how a 4D object looks going through a 3D world, just nothing happened like that.

If you don’t utilize moving it on the fourth dimension it would seem normal because our 3 dimensional universe can only see and interact with the 3 dimensions visible without forcing the 4D object to move through our dimension.

I have no idea how this works, how to use it, or what I would use it for. But it sounds really cool! Can you upload a video so we can see what it looks like?

1 Like

Why are you using _G for this? Why does the code example use _G, when it can just use the thing that the module returned?

You can but the module will set itself to that address in _G so it doesn’t need to require itself for every time you need to call a function.

The code of a module runs once, and what difference would there be if you did

local module = require(script.module)

vs

local module = _G["4DService"]

?
I’d prefer the first option because the second one removes intellisense.

There is no difference. The only this is that you need to start the module using the start function so it specifies a required parameter.

Could you make a showcase of this?

I’ve been working on trying it gets another thing working but I will try to get one done.

Service4D = require(game.ServerStorage.MainModule)

Service4D:Start(10)
Service4D.addObject(workspace.Part)

local bool = false
while wait() do
	bool = not bool
	for i = 1, 60 do
		Service4D.change4D(workspace.Part, bool, 1)
		task.wait(1/60)
	end
end

It’s pretty interesting.

ᵐᵃʸᵇᵉ ᶠᵒʳ ᵍʰᵒˢᵗˢ

1 Like

This doesn’t seem very accurate, because if you had any 4d square object, it would simply appear, and then instantly disappear. The same way if you moved a cube through a 2d plane, that cube would appear instantaneously, then disappear. Instantaneously.

sorry for the bump

3 Likes

Instead, create some kind of remote control to control what 4d (or w) value you’re looking at. Just like in a flat world, you can go up and down and up.