Notices
Results 1 to 10 of 10

Thread: 4d Snake

  1. #1 4d Snake 
    Forum Freshman
    Join Date
    Jun 2011
    Posts
    12
    Hi everybody,

    here I try to present a little game I have programmed in python, is a 4d snake...
    Same rules as the nokia(r) snake but in 4 spatial dimensions.

    http://www.youtube.com/embed/8IUnqm8j4BE

    This is a preview of the game.
    The game is still in beta version and I think it will remain like that forever
    I think that trying to program it gave me a better insight in the 4 dimensions...
    I don't know if maybe by playing it you will have the same feeling...

    if you want to help me, do you know any good books that explain 4d rotations and 4d quaternions?

    it will be really useful to try to insert a perspective view from the "head" of he snake

    I'm looking forward for suggestions and comment...

    have a nice day
    Pella86


    Reply With Quote  
     

  2.  
     

  3. #2 Re: 4d Snake 
    Forum Sophomore somfooleishfool's Avatar
    Join Date
    May 2011
    Location
    New Zealand
    Posts
    196
    Quote Originally Posted by Pella86
    Hi everybody,

    here I try to present a little game I have programmed in python, is a 4d snake...
    Same rules as the nokia(r) snake but in 4 spatial dimensions.

    http://www.youtube.com/embed/8IUnqm8j4BE

    This is a preview of the game.
    The game is still in beta version and I think it will remain like that forever
    I think that trying to program it gave me a better insight in the 4 dimensions...
    I don't know if maybe by playing it you will have the same feeling...

    if you want to help me, do you know any good books that explain 4d rotations and 4d quaternions?

    it will be really useful to try to insert a perspective view from the "head" of he snake

    I'm looking forward for suggestions and comment...

    have a nice day
    Pella86
    This is SOOOOOOOOOOOOOOO cool. This must be developed lol.


    Reply With Quote  
     

  4. #3  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    Fun idea, but it'll be hard to make it play well.
    Reply With Quote  
     

  5. #4  
    Forum Freshman
    Join Date
    Jun 2011
    Posts
    12
    Quote Originally Posted by MagiMaster
    Fun idea, but it'll be hard to make it play well.
    hehe, yes... but...
    citing Urticator:
    http://www.urticator.net/
    the guy created a 4dimensional maze which is really really better than what I tried to program

    Can You See It?
    When I had the idea for the game, I got all excited I'd always wanted to be able to visualize four-dimensional objects, and I figured that at last I'd found the key. I'd play the game, and get used to seeing and moving around in a real four-dimensional world, and then one day, all of a sudden, I'd really see it.

    That hasn't happened yet, unfortunately.[b] I can move around pretty well, and reorient myself when I get disoriented, and I understand many aspects of the maze world in an abstract way, but I still can't put it all together in my head[\b].
    Reply With Quote  
     

  6. #5  
    Forum Freshman
    Join Date
    Jul 2010
    Posts
    65
    I didn't even know there was a fourth dimension, but for 3d is a great idea! I wanted to start a 3D game but im not a good enough coder with my vb6 & basic

    but what i was going to do was use an xyz map like an xy table in 2d but then what i would do is split my z axis so that a white line would split up into red/blue where the line would break down in to red & blue, moving farther apart as it goes down the Z axis; following something like:
    linepos(blue) = linepos(white) - depth(z)
    linepos(red ) = linepos(white + depth(z)


    (red blue; ie using R/B 3d glasses from the 80"s)
    Reply With Quote  
     

  7. #6  
    New Member
    Join Date
    Jun 2011
    Posts
    1
    Reply With Quote  
     

  8. #7  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    Quote Originally Posted by Pella86
    Quote Originally Posted by MagiMaster
    Fun idea, but it'll be hard to make it play well.
    hehe, yes... but...
    citing Urticator:
    http://www.urticator.net/
    the guy created a 4dimensional maze which is really really better than what I tried to program

    Can You See It?
    When I had the idea for the game, I got all excited I'd always wanted to be able to visualize four-dimensional objects, and I figured that at last I'd found the key. I'd play the game, and get used to seeing and moving around in a real four-dimensional world, and then one day, all of a sudden, I'd really see it.

    That hasn't happened yet, unfortunately.[b] I can move around pretty well, and reorient myself when I get disoriented, and I understand many aspects of the maze world in an abstract way, but I still can't put it all together in my head[\b].
    One thing that makes the maze an easier task is that it's turn-based. Timing and other real-time considerations get harder with more to keep track of.
    Reply With Quote  
     

  9. #8  
    Forum Freshman
    Join Date
    Jun 2011
    Posts
    12
    Finally I compiled the code...
    The code is open source

    here are the links to download the game:

    -----------For Mac OSx users:-------------
    -Snake4d:
    https://rapidshare.com/files/3482306...d_game.app.zip

    -Snake 4d Stereoscopic:
    https://rapidshare.com/files/3235475...stereo.app.zip

    -Snake 4d youtube version:
    https://rapidshare.com/files/2220774...mplete.app.zip

    -----------For Windows users:-------------
    -Snake4d:
    https://rapidshare.com/files/1379955980/Snake_4d.zip

    -Snake4d Stereoscopic:
    https://rapidshare.com/files/1435657...e4d_Stereo.zip

    -Snake4d youtube version:
    https://rapidshare.com/files/1338251...d_complete.zip

    -----------For Unix users:-------------
    -Snake4d:
    https://rapidshare.com/files/2938032...ke_4d_game.zip

    -Snake4d Stereoscopic:
    https://rapidshare.com/files/1277997...tereoscope.zip

    -Snake4d youtube version:
    https://rapidshare.com/files/1282695...d_complete.zip


    and here is my highscore:
    -----GAME OVER-----
    score: 854.739
    cube taken: 20
    fake check: 6b8

    ps: @MagiMaster, try the game you'll see is pretty easy (and in my opinion pretty boring)
    Reply With Quote  
     

  10. #9  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    The Windows version is a bit buggy, but yeah, it's fairly easy if you concentrate on the two 2d views.
    Reply With Quote  
     

  11. #10  
    Forum Freshman
    Join Date
    Jun 2011
    Posts
    12
    I'm trying to learn OpenGL to make a "faster" playable version...
    and I'm trying to put the camera in the snake head, so that it will be played in 1st person...
    but I have problems with the 4d rotations...
    I'm using now, this

    Code:
    def rot_to_coord4(p_coord):
    	r = p_coord[0]
    	theta1 = p_coord[1]
    	theta2 = p_coord[2]
    
    	phi = p_coord[3]
    	x = r*cos(theta1)
    	y = r*sin(theta1)*cos(theta2)
    	z = r*sin(theta1)*sin(theta2)*cos(phi)
    	w = r*sin(theta1)*sin(theta2)*sin(phi)
    	return V4(x,y,z,w)
    	
    def coord_to_rot4(v):
    	x = v.c[0]
    	if x == 0:
    		x = 0.00000001
    	y = v.c[1]
    	if y == 0:
    		y = 0.00000001
    
    	z = v.c[2]
    	if z == 0:
    		z = 0.00000001
    
    	w = v.c[3]
    	if abs(w) < 1*pow(10,-5):
    		w = 0.00000001
    
    	r = v.module()
    	theta1 = atan(1/(x/sqrt(w**2+z**2+y**2)))
    	print "theta1",degrees(theta1)
    	theta2 = atan(1/(y/sqrt(w**2+z**2)))
    	print "theta2",degrees(theta2)
    	d = ((sqrt(w**2+z**2)+z)/w)
    	if d == 0:
    		d = 0.000001
    	phi =  2*atan(1/d)
    	print "phi", degrees(phi)
    	return [r,theta1,theta2,phi]
    but doesn't work really good...

    do anyone knows how 4d quaternion could look like?
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •