Jump to content


Photo

Paperlock Dynamic 2.5d Engine


  • Please log in to reply
26 replies to this topic

#1 Digi

Digi

    Who else

  • New Member
  • 757 posts

Posted 09 May 2009 - 04:36 PM

Forgive me for any mistakes I make, I don't usually make examples or engines.

Basic Info: gm7, registered

General Description:
A 2.5d game essentially means that while the graphics are 3d, the gameplay is not: the character and many other things move around on a 2-dimensional plane surrounded by 3d scenery. These are usually platformers. Good examples of this are probably Klonoa: Door to Phantomile, Kirby 64, and SSBB's Subspace Emissary.

The main difference between the first two and the third, however, is that the 2d plane in Kirby and Klonoa twists and bends, while Subspace Emissary's plane is fixed and doesn't turn at all. I'm going to refer to the twisting version as dynamic 2.5d.

The Paperlock engine uses paths to control how the 2d plane turns. A quick visual:
Posted Image
The first image shows the 2d plane as a sheet of paper with a blue object on it. The middle image is a path, and the third image is the "paper" twisted in the shape of the path. The object is still "locked" to the plane, and can move along it but not away from it. Objects can also move along the path from a distance (such as a camera) or be completely separate from the paper.

You can use a basic 2d room for the actual gameplay, but it will be drawn along the path. The example uses a simple platforming engine and a basic room to demonstrate. The room width is used to determine where objects are placed along the path.

Other Information:
-I used several amateurish techniques in this (and completely avoided trigonometry in favor of lengthdir). Feel free to replace them.
-obj_graphics contains the drawing code for all visible objects. I always use a system like this when designing 3d games. I don't know why. It's not an essential part of the engine.
-The engine doesn't demonstrate any objects separate from the paper, but it's fully possible.
-I don't make a lot of engines, and don't have much experience in them either. So if you want to improve this, contact me with your idea of how to improve it and I'll let you go ahead and possibly change the version here.
-All variable names start with an underscore to avoid overlapping with other variables.

Reccomendations:
-A major issue with this engine is gaps and 2d objects not aligning with their 3d counterparts. 2 scripts are included to fix this, one shrinks the path and another gives a ratio for how much to scale the 2d objects. The path-shrinking one is better graphically.
-Remember that all actual gameplay takes place in the 2d room. Room-wrapping issues may arise, among other things.
-I reccomend using curving paths. Sharp angles are awkward.
-If you don't want the path to loop, then make sure that the focus of the camera stays away from the ends of the path. fixed
-Use a different engine for gameplay. The included platforming engine is pretty crappy and just used as an example.
-Credit would be nice.

Oh yeah, the link. Almost forgot that.

Edited by Digiboy, 18 May 2009 - 12:53 AM.

  • 3

#2 bombshell

bombshell

    GMC Member

  • GMC Member
  • 1607 posts

Posted 09 May 2009 - 05:14 PM

amazing I love it
  • 0

#3 nicoulas

nicoulas

    GMC Member

  • New Member
  • 53 posts

Posted 09 May 2009 - 08:16 PM

Yeah, awesome job !

Keep up the good work :wacko:
  • 0

#4 Glen

Glen

    GMC Member

  • GMC Member
  • 840 posts
  • Version:GM:Studio

Posted 10 May 2009 - 12:01 AM

Wow, this will be useful. Nicely done.
  • 0

#5 Poris

Poris

    GMC Member

  • New Member
  • 533 posts

Posted 10 May 2009 - 01:40 AM

This is great. Nice job man. Love it.
  • 0

#6 Digi

Digi

    Who else

  • New Member
  • 757 posts

Posted 10 May 2009 - 03:26 PM

This went over nicely.

Would it help if I changed the engine to work better with nonlooping paths?
  • 0

#7 bombshell

bombshell

    GMC Member

  • GMC Member
  • 1607 posts

Posted 11 May 2009 - 10:18 PM

is it updated yet I'd love to see the nonlooped fix
  • 0

#8 Digi

Digi

    Who else

  • New Member
  • 757 posts

Posted 12 May 2009 - 12:40 AM

Yeah, I got around to that. I also extended the level because the current one seemed pretty small.
  • 0

#9 dadio

dadio

    I miss my cupcake

  • GMC Member
  • 1845 posts
  • Version:GM:Studio

Posted 12 May 2009 - 01:27 AM

Nice effect - thanks for sharing!
I was wondering how to go about something very like this myself a while back -
could be used to make an interesting game I think!
Good stuff. :blink:
Goodluck!
  • 0

#10 Digi

Digi

    Who else

  • New Member
  • 757 posts

Posted 18 May 2009 - 12:52 AM

Just found a bug, surprising this hasn't turned up yet for anyone else.

If you don't feel like redownloading, go into pl_find_cam_x and pl_find_cam_y and change
_dir=pl_find_direction(path_trail,argument1,argume
nt3)
to
_dir=pl_find_direction(argument0,argument1,argumen
t3)
  • 0

#11 lewa

lewa

    GMC Member

  • New Member
  • 587 posts

Posted 21 May 2009 - 08:34 PM

O.O
Awesome!

Now we'll be able to have more Kirby64 clones than we can tolerate <_<.
  • 0

#12 infinitygames

infinitygames

    GMC Member

  • New Member
  • 254 posts

Posted 01 June 2009 - 04:35 AM

Although the graphics suck... lol i think their ment to be like that.

this is by far one of the best examples i've ever seen posted in the 3d forum! you or someone else could make something realy cool out of this :) great work Digi
  • 0

#13 8-BitTonberry

8-BitTonberry

    GMC Member

  • GMC Member
  • 557 posts
  • Version:GM8.1

Posted 03 June 2009 - 02:28 AM

Very nice! Great job!
  • 0

#14 Digi

Digi

    Who else

  • New Member
  • 757 posts

Posted 03 June 2009 - 11:35 PM

Thanks for all the compliments, this was actually pretty simple. If anyone has any suggestions, I'll hear them.

The graphics are meant to be simple and replaceable. The character... I have a strange sense of humor.

Edited by Digi, 03 June 2009 - 11:36 PM.

  • 0

#15 zachman

zachman

    MagicMan Productions

  • New Member
  • 212 posts

Posted 10 June 2009 - 05:23 PM

A 2.5d game essentially means that while the graphics are 3d, the gameplay is not: the character and many other things move around on a 2-dimensional plane surrounded by 3d scenery.

you have 2.5d defined wrong :D your example is still 3d.
http://en.wikipedia.org/wiki/2.5D
2.5d is 2d graphics that look 3d. most older rpg games use this technique. It's also rightly named pseudo-3d.

This is still very very good though! :rolleyes:
9/10!
  • 0

#16 BK-TN

BK-TN

    GMC Member

  • New Member
  • 5 posts

Posted 21 June 2009 - 02:20 PM

Please add so that the cam can get higher/lower that the default position (z axis i think)
  • 0

#17 Digi

Digi

    Who else

  • New Member
  • 757 posts

Posted 21 June 2009 - 03:24 PM

In any case I can't lengthen the title any more because it's pretty long as it is.


All you have to do to make the camera move vertically is change its zfrom and zto. If you wanted it to follow the character, you could change part of the 2nd code event in obj_graphics from:
d3d_set_projection_ext(_x,_y,120,_xx,_yy,60,0,0,1,45,4/3,1,9001)
to
d3d_set_projection_ext(_x,_y,room_height-obj_player.y+60,_xx,_yy,room_height-obj_player.y,0,0,1,45,4/3,1,9001)

  • 0

#18 Qon

Qon

    GMC Member

  • GMC Member
  • 85 posts

Posted 27 June 2009 - 07:35 AM

This looks sooo cool!! When I first read about it I didn't have a clue that it was like this. This will definitely come to good use :D
  • 0

#19 infinitygames

infinitygames

    GMC Member

  • New Member
  • 254 posts

Posted 05 July 2009 - 04:49 AM

Thanks for all the compliments, this was actually pretty simple. If anyone has any suggestions, I'll hear them.

The graphics are meant to be simple and replaceable. The character... I have a strange sense of humor.


My dad and I were talking the other day about how somthing so simple can be so big eg. bananas in pijamas... how simple how big? (i used the example becuase they were performing in the market the other day -.- thats when the conversation started)
  • 0

#20 tablekorner

tablekorner

    GMC Member

  • GMC Member
  • 118 posts

Posted 13 July 2009 - 07:32 AM

ok this is awsome but how would u get the camera moving with the path and player to move up and down when he jumps???
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users