Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

878499 Posts in 32925 Topics- by 24336 Members - Latest Member: BeefJack

May 22, 2013, 03:05:48 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)4D Presented in 2 Dimensions
Pages: [1]
Print
Author Topic: 4D Presented in 2 Dimensions  (Read 940 times)
LazyWaffle
Guest
« on: May 14, 2011, 08:14:17 PM »

So, a while back I had the idea to create a 4 dimensional game presented in 2 dimensions. I let the idea float around in my head for a few weeks, until I finally decided to prototype it with Game Maker 8. Here's the result!

http://dl.dropbox.com/u/3372891/4d.exe (2.2MB)
http://dl.dropbox.com/u/3372891/4d.gmk (10.6KB Source .gmk)

Essentially, it's just two superimposed 2D planes that technically add up to 4 dimensions. I made this prototype to test 4 dimensional collision. I'll attempt to explain it the best I can.


Each 4 dimensional entity is composed of two individual objects. The blue dot represents the 4D entity's X and Y position, or length and width. The purple dot represents the 4D entity's Z and W position, or height and the 4th dimension. Both dots are capable of moving in the same directions at the same speed, they're just on separate planes. The purple dot behaves exactly like the blue, it just represents Z and W. Ignore the "Colliding" text, it doesn't matter if the two dots collide with each other.


Two entities: The "player" entity, which can be controlled via moving each dot individually with WASD and IJKL, and the "enemy" entity, whose dots move randomly in their individual directions. If just a red and blue dot collide (or just a purple and orange, or any combination), then the 4D entity itself doesn't collide, because all of the points need to be meeting for the 4D object as a whole to collide.


The entities are only colliding if the blue and red dots meet, as well as the orange and purple dots. So on an actual fourth dimension, and not just a 2D representation, their X, Y, Z and W points are all meeting.


Not colliding, even though two pairs of dots are meeting. The orange and purple dot are on a separate 2 dimensional plane, so they can't collide with the blue and red dots. The red dot's X and Y are meeting with the purple dot's Z and W. So basically, length and width wise it's in the same position, but height and fourth-dimension wise, they're not meeting. It only collides if the two dots on their proper plane collide.



Still hopelessly confused? Let me try to explain the same concept, but with 3 dimensions represented in 2. This will show how the way each dot can move contributes its respective dimensions.


The blue and purple dot make up a 3D entity. This is because the blue dot can move in 2 dimensions (left, right, up, down, diagonals), and the purple dot can only move in 1 (up and down). 2+1=3. 3 dimensions. The blue dot represents length and width (x and y), while the orange dot represents height (z).


Now there's another 3D entity, represented by the red and orange dots. Just like the other one, the orange dot can only move up and down (in 1 dimension) while the red dot can move in 2 dimensions. For a proper collision, the orange and purple dots have to meet up, as well as the blue and red dots.


These 3D objects are colliding. The orange and purple dots are meeting up (Meaning the 3D objects have the same height position). Just as well, the blue and red dots are meeting up as well (Meaning the 3D objects have the same length and width position). Voila! 3D collision represented in 2 dimensions!


Not a proper collision. As this is only a 3 dimensional realm, there is only one 2 dimensional plane and one 1 dimensional surface. The collision only counts if the two objects on the 1D surface collide (Purple and orange) and the two objects on the 2D plane collide (Red and blue). They only seem to be colliding because the planes are superimposed, when in reality the two sets of dots are on completely different surfaces.

Anyway, that's the best I can explain it. I toyed around with other visual cues (like having one 2D object with Z and W represented by hue and value, so each 4D entity would only be one object), but this seems to be the least awkward. This whole concept is based on the way dots can move accounting for respective dimensions, so it's also possible for there to just be 4 objects moving in 1 dimension accounting for one 4D entity. Feel free to toy around, give input, etc. Just a neat little experiment I decided to share, but I think it has potential, especially as an open-source community project.
« Last Edit: May 15, 2011, 08:45:55 AM by Skyshark » Logged
paste
Level 6
*


BARF!

HeyIAintEddie
View Profile WWW
« Reply #1 on: May 14, 2011, 08:32:41 PM »

I am looking forward to how you will deal with more complex shapes  Smiley
Logged

Christian Knudsen
Level 10
*****



View Profile WWW Email
« Reply #2 on: May 15, 2011, 01:22:16 AM »

So you're basically just controlling two separate 2D entities that are linked to two other 2D NPC entities for collision purposes? Can't help but feel that it's cheating a bit by calling it 4D, even though I suppose you could technically call it that. I mean, you could just add a third entity and call it 6D or a fourth and call it 8D. But you're still just controlling a number of 2D entities. I'm still interested in seeing what you can make from this gameplay wise, though. If you can avoid it feeling like you're just a single player controlling both entities of a two-player game?

There's this 4D shooter from 2005 that might be inspirational. Instead of controlling both 2D entities at once, it makes you first line up one, then line up the other.
Logged

Laserbrain Studios
Currently working on Hostile Takeover (TIGSource DevLog)
bateleur
Level 10
*****



View Profile
« Reply #3 on: May 15, 2011, 02:00:11 AM »

I don't think this scheme actually works, does it?

Consider (x,y,z,w) pairs (0,0,0,0) and (1,1,1,1). Two hyperspheres of radius sqrt(2)/2 centred on each of these points appear to touch one another using your visualisation but do not touch in 4-space, where they are 2-sqrt(2) apart.
Logged

LazyWaffle
Guest
« Reply #4 on: May 15, 2011, 07:21:33 AM »

So you're basically just controlling two separate 2D entities that are linked to two other 2D NPC entities for collision purposes? Can't help but feel that it's cheating a bit by calling it 4D, even though I suppose you could technically call it that. I mean, you could just add a third entity and call it 6D or a fourth and call it 8D. But you're still just controlling a number of 2D entities. I'm still interested in seeing what you can make from this gameplay wise, though. If you can avoid it feeling like you're just a single player controlling both entities of a two-player game?

There's this 4D shooter from 2005 that might be inspirational. Instead of controlling both 2D entities at once, it makes you first line up one, then line up the other.
The 4D "NPC" entity doesn't raise the dimensions, it's just another 4D entity that interacts with the player's 4D entity. But yes, if you make more dots per entity, you are creating more 2-dimensional planes that represent more dimensions. I guess you could call it cheating since all the dimensions are just represented by superimposed 2D planes, but in theory there can technically be infinite euclidian dimensions done this way.

Bateleur: Collision is really simple at this point, it just checks if every pair of locations is meeting up [(x,y) and (z,w)]. While they technically do collide in 4-space, it's only by an extension. I'll probably fine-tune the collision later. I should mention that the dots have actual hitboxes, it's not just checking if their central points meet up completely.
« Last Edit: May 15, 2011, 08:23:50 AM by Skyshark » Logged
mcc
Level 10
*****


glitch


View Profile WWW Email
« Reply #5 on: May 15, 2011, 11:00:57 AM »

So you're basically just controlling two separate 2D entities that are linked to two other 2D NPC entities for collision purposes? Can't help but feel that it's cheating a bit by calling it 4D, even though I suppose you could technically call it that. I mean, you could just add a third entity and call it 6D or a fourth and call it 8D. But you're still just controlling a number of 2D entities. I'm still interested in seeing what you can make from this gameplay wise, though. If you can avoid it feeling like you're just a single player controlling both entities of a two-player game?

There's this 4D shooter from 2005 that might be inspirational. Instead of controlling both 2D entities at once, it makes you first line up one, then line up the other.

Well... actually this is valid! A dimension is just a degree of freedom. It may be though that this is not an incredibly interesting use of higher dimensions though, yet.

It seems like there are some things you could use to make 4D actually "meaningful" while still keeping the split-representation concept. One that comes to mind as pretty easy while still staying within the limited bounds of GM is if there were some way for "rotations" to occur, i.e., for some reason the "camera" moves in 4D space. Another thing I'd wonder about is what if this weren't just two players floating in space, what if there were were sort of "structures" in the 4D space with you. Would it be possible to represent, say, a 4D tube that you can go in and out of to shield yourself from attacks? What would that look like?
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #6 on: May 15, 2011, 01:31:40 PM »

I don't think this scheme actually works, does it?
It works if you consider the objects as hyper-cylinders rather than hyper-spheres, which is consistent with the picture.
Logged
LazyWaffle
Guest
« Reply #7 on: May 15, 2011, 03:07:06 PM »

I don't think this scheme actually works, does it?
It works if you consider the objects as hyper-cylinders rather than hyper-spheres, which is consistent with the picture.
Wouldn't it be a hypersphere? The height and 4th dimension dot (purple) is circular, so I think it would be a sphere rather than a cylinder. I could be wrong though.
Logged
bateleur
Level 10
*****



View Profile
« Reply #8 on: May 16, 2011, 05:40:05 AM »

It's certainly not a hypersphere, no. (The maths I posted explains why.)

Boris is right that it works as a representation of a hypercylinder, provided that my "hypercylinder" you mean the set of points in 4D space defined by the intersection between the two infinite-height 3D cylinders (x^2+y^2 <= 1) and (z^2+w^2 <= 1).

The usual definition of a hypercylinder is what you get when you drag a sphere along a path in 4D space. This isn't one of those. (Reason: that has one unique axis and three symmetric axes, whereas our shape has two pairs of two symmetric axes.)
Logged

paste
Level 6
*


BARF!

HeyIAintEddie
View Profile WWW
« Reply #9 on: May 16, 2011, 06:13:04 AM »

Another way to think about it is if you reduce the second 2D to just a 1D line, then the object becomes a cylinder, since it's a circle that is extended in the third dimension a constant length (the length of the line).  If you then add the 4th dimension, you are just making an infinite (in theory) number of 3D cylinders of varying lengths, each of individually constant length.

It seems like your game allows the object to vary between the first and second dimension and the third and fourth dimension but not between, say, (first and second) and third, so you can't really represent something like a ball in a cup.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic