Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Non Euclidian Portal plssss

Gaepe
Guest
Quote
2023-08-28 03:15:03

Someone can help me making an Non Euclidian portal?


Dieter
Guest
Quote
2023-08-28 20:02:54

Hi.
The term "non-euclidian portal" can be interpreted in a very broad, non-specific way. Maybe you should describe in more detail what you're after.

But generally speaking, while I don't know anything about this subject matter, but am just reading a bit about it, I would assume by non-euclidian you refer to impossible physics, rather than to the underlaying mathematical aspect.

If so, I would proceed as follows:

Take a simple fractal code and port it to 3D, so it builds rooms and geometry based on the fractal, in which the player can walk.

When he reaches a certain point, where the fractal repeats its own structure, I would teleport him back to the structurally same place, so teleportation is unnoticed. However, I also slightly alter the parameters for the fractal, so further down his way the player will reach a different world. The fractal is also scaled dynamically, so you would not see the repetitions of structures being normally smaller and smaller.

Theoretically, the way i understand it, a game in which there is 1 room with a door in the south wall and one in the north wall, and you enter the room through the north door, walk across the room and leave at the south door, which teleports you right back to and through the north door, can be considered a non-euclidian portal. No non-euclidian math is involved, but the effect that's achieved, may be labeled so.

Which is then usually disputed, because of lack of specific math, but anyway.


count2rfeit
Registered User
Quote
2023-08-30 18:34:04

@Dieter is correct - a "non-Euclidian portal" can be interpreted in many ways. However, it was used in Minecraft mainly to change a one room small building into many rooms on the inside.

With this in mind, I made a quick demo to show this effect in CC. a small room is much larger inside than outside. (Dr. Who's Tardis comes to mind)

HOWEVER - it uses the built-in action "on proximity do something" that is buggy... it works, but sometimes it doesn't.

This is just my quick take on how it can be done (without scripting) but I am sure there are many other ways...

https://wmgwgames.itch.io/non-eu...

thanks


Dieter
Guest
Quote
2023-08-30 19:09:19

That's a good example. I recall this from weird movies, when a guy enters a 1 square yard toilet in the middle of a field and finds himself in a gigantic palace. Of course, editing two scenes together is pretty easy - it's more the surprise in the face of the actor, that makes it seamless.

RE on proximity, may I suggest this:
(although involving scripting)
after any "jump" hide the proximity trigger (maybe a box with transparent texture), when it's hidden then the proximity sensor is off. Then later unhide it, so it can be used again.

In a game I would have some kind of frequent generic service anyway, so I could use a countdown variable for a later action.

Most simple is to have a task for example every 50ms.

So on jump I'd execute this:


triggernode=ccbGetCurrentNode();
ccbSetSeneNodeProperty(triggernode, "Visible", false);
ccbSetCopperCubeVariable("portal_timeout", 100);

// And in the root task that's executed every 50ms:
p_timeout=ccbGetCopperCubeVariable("portal_timeout");
if (p_timeout>0)
{
p_timeout--;
ccbSetCopperCubeVariable("portal_timeout", p_timeout);
if(p_timeout==0)
{
triggernode=ccbGetSceneNodeFromName("portaltrigger");
ccbSetSeneNodeProperty(triggernode, "Visible", true);
}
}


That said, while this shows how a countdown can be used to turn something off later, I just have a better idea for your specific problem:

As before, make invisible the trigger node after the jump, and then have a clone of this trigger, with a "on leaving radius" proximity action that will unhide the first trigger again.

You can't use the same trigger for both, as when it's hidden, it will not detect the "leave radius".


count2rfeit
Registered User
Quote
2023-08-30 19:52:29

@Dieter,
yes... I did include the "hide" and "unhide" for the triggers. But it doesn't fix the bug with the "on proximity do something" action.

the .ccb file I have available on itch.io shows how I make the effect work so everyone can get an idea of making something similar for themselves.

so, using a JavaScript (as you show) can be a better option. But I think a lot of people like CC because they can build games without having to script. That is why I try to do demos without any scripting added.

maybe someone will be willing to make a script that will do the "on proximity" so the built-in action doesn't need to be used...or maybe Niko will look into it for his next release.

Anyway, thank's for your good inputs. We all can help each other and make CC the best!


Dieter
Guest
Quote
2023-08-31 21:12:12

I downloaded the file, but haven't had time to look into it yet. The fact that the trigger works inconsistently, or not always the same, may be due to the fact that CC and CL executes tasks according to a timeline schedule in a nonlinear way. So it may happen that after a jump, despite your next action or line of code is to turn off the trigger, by hiding it, the proximity sensor in the background threw an "intrusion" event right between your two lines of code, and thus the turning off of the trigger seems to be ignored.

Certainly you can make your own proximity sensor, it's simple, but I would need to do tests and see which runs faster.

You would need a task that frequently checks a couple of things.
Usually games have such a task anyway. At least mine.

You can do a pytagoras in 3D, to a list of triggers, and if this distance is smaller than N than do something.
dist=Math.sqrt((dx**2)+(dy**2)+(dz**2));
dx etc are the distances on the x y and z plane between player and trigger. So this tests for spherical proximity

As it involves square root, it is relatively slow. In the past we used a "Manhatten" instead of Pytagoras, which isn't precise, but often good enough for a trigger:
manh=(dx+dy+dz)/3;
But here these must be positive values, so use Math.abs(dx) etc.

I agree, one thing that CC advertises is: no need to code. It's true in a way,and I believe when you are familar with the built in no-code toolset, and combine them in a clever way, great games can be made.

I however love to code and I was actually just on a search for a decent webGL renderer that's scriptable and offers a minimal set of features, required for proper games.

CC does that, and from all the engines I tested it is by far the best engine for webGl, except for UE4/5 and the various Unity renderers, which I cannot compare here because regardless their quality, they come with some showstoppers that forbid any judgement on graphics output only.

I was a Blitz3D (a BASIC with directx 3D renderer) guy for 2 decades+ - what a delight it is for me, having the sourcecode in Blitz3D to create Meshes and save them as B3D, and then import them perfectly in CC with one click, is hard to describe, but you may sense it when you play my little webGl game that's based of the output of my procedural terrain generator, that puts that whole island together and saves it as a number of B3Ds, that then load in CC without any coughs.

That may show some people why coding can be fascinating. I call it the thing between chess and lego ^^
.


Dieter
Guest
Quote
2023-08-31 21:16:35

Uh sorry, I mention this game:
https://jfkeo1010etc.itch.io/the-ouchee-island-ramification


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact