3d actor in a 2d environment

Post your Feature Requests here...
User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

3d actor in a 2d environment

Post by federico » Sat Sep 24, 2005 11:14 am

We have the same elements and our elements are better.
We have Actors with all the visualization and animation features (alpha, shadows, animation blending). We have extreme complex moving commands. We have complex 2d effects and visualization entities and commands (including the new Nouts feature). We have a complex and rich Conversation System. We have all the elements to make a great adventure games with this engine.
The only lack is that we cannot place 3d actor over a 2d ambient (we can make the opposite).

Remember these?

ALone in the dark
ImageImage
Grim Fandango:
ImageImage
Monkey IV (really not the best game in the world... )
ImageImage
Syberia II:
ImageImage

These games aren't super technological. I always hear someone in this forum complaining about the age of the Genesis engine. I played grim fandango this summer, it's a funny game, but RF has a twice better engine. RF can really make an AAA itle in this game genre.
We only need, this is the feature request, to set the priority of the 2d/3d visualization.
Now static 2d graphic is at an upper level in respect at the 3d actor. Before the Nout's changes we don't have a valid 2d background displaying command (the ShowPicture command). Now we have a totally complete commands to use the mouse and to test the mouse/screen/actor position. So we can have point and click features.
Remember?
ImageImage

Now we have the ShowActorWindow command. This seems to be programmed by Nout explicitly to make adventure games:
Image

All we need is a command hack to tell the engine to render the actors in front of the 2d layer and to render the 3d world geometry behind.
The order will be: 3d geometry, the 2d background (ShowPicture), the 3d actors. the 3d world will create, in respect to the fixed camera, the correct bounding geometry of the 2d picture.
This is the testroom of grim fandango:
Image Image

...something like SetEntityWeight()?
Nout? QoD? wbx1? Pickles? Gekido? Pickles? etc.. etc... Have you some idea?

wxb1
RF Dev Team
Posts: 69
Joined: Thu Jul 14, 2005 8:31 pm

Post by wxb1 » Sat Sep 24, 2005 6:11 pm

All we need is a command hack to tell the engine to render the actors in front of the 2d layer and to render the 3d world geometry behind.
The order will be: 3d geometry, the 2d background (ShowPicture), the 3d actors. the 3d world will create, in respect to the fixed camera, the correct bounding geometry of the 2d picture.
This is the testroom of grim fandango:
You would definitely need something to force the 2d background to be rendered first... But you should be able to level geometry and and tag it so that it isn't rendered but still exists... I believe if you mark it as a clip brush?[/quote]

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Sat Sep 24, 2005 6:51 pm

do you mean to follow another method... Umh... :) yes! It's a better one!
Not 3d world geometry, then 2d background and then 3d actor (so the 2d background is the meat in a hot dog) but, instead: the 2d background and then all the 3d enviroments (worldgeometry+actors) with the world geometry flagged as clip brush. It could be more simple.

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post by QuestOfDreams » Sat Sep 24, 2005 7:59 pm

you may try this script command
DrawFlipBookImage(char *FlipBookName, int ImageIndex, int XPos, int YPos, float Alpha, int R, int G, int B, float ZDepth );

Draws the image with index ImageIndex of the FlipBook entity FlipBookName parallel to the screen at position (XPos, YPos), ZDepth in front of the camera.
or use the skybox combined with a fixed camera (if you have prerendered scenes you can just use the same postion/direction in rf as you used to render the images)

for collision just use clip brushes, for objects that can be in front of the player you can probably use other actors...

it's not the easiest thing to setup but I think it can be done

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Sat Sep 24, 2005 10:34 pm

the DrawFlipBookImage command works really good. However seems to be identical to the nout's ShowPicture command 'cause the zdepth parameter has no influence at all. I've tried 1 hour placing positive negative higher lower value with all the camera and alpha combinations but nothing to do: the 2d image is always in front of the 3d :cry: .

looking at the code, it's really interesting to see how QoD and Nout have reached the same results using two different ways. DrawFlipBookImage and ShowPicture.

What effect exactly the zdepth parameter should have?
The skybox entity seems to me a solution too brutal 'cause we completely lose all the "world" coordinates creating several world for every camera change. Instead the 2d comand that we already have are good enough and we can create a world "connected". I think that the problem is only (easy to for me to say...) the render priority...

User avatar
animatrix
Posts: 134
Joined: Thu Jul 07, 2005 10:51 pm

Post by animatrix » Sat Sep 24, 2005 11:42 pm

Ok, how bout this, use backdrops, transparent walls, do hollywood , thats how they did it, adjusted lighting, no scripting at all, fixed camera angles ect.
but, for 2d games, gamemaker is one of the best, I made a boxing game with skeletons that was overhead view, worked intensly good,
:)

Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

Post by Nout » Sun Sep 25, 2005 8:03 pm

As mentioned in another post, I think I know a way to draw pictures behind the actors. Give it a week and I'll post the result

User avatar
ZenBudha
Posts: 285
Joined: Wed Aug 17, 2005 6:06 am
Contact:

Post by ZenBudha » Mon Sep 26, 2005 6:09 am

Could you not perhaps attach a flipbook to a pawn in order to move it behind the actors?

However getting it all set right so the 2D background properly aligned with the 3D clip geometry might be tricky.

However it would seem getting the clip geometry to match the camera angle wouldn't be too hard.
I mean you just block out the level, then apply a basic texture to everything.

Set your camera, and run the level. Take a screenshot and waalaa! You have exactly what the camera will be seeing and can create the 3D render for the 2D background so that it easily aligns with the clip brush geometry.

The hard part like has been stated is just getting the 2D image to align properly within RF.
Fear not the textures for the almighty stylus is with thee - Book of Zen

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Mon Sep 26, 2005 9:50 am

@Zen
However getting it all set right so the 2D background properly aligned with the 3D clip geometry might be tricky.

However it would seem getting the clip geometry to match the camera angle wouldn't be too hard.
I mean you just block out the level, then apply a basic texture to everything.
In my RInvaders Demo I tried something similar (in effect there was 3d in front of a 2d background) although this method isn't stable. It's affected by screen resolution and it's really difficult to place the flipbooks at the right distance/position (in the RInvaders case the backgrounds were space photos so the predominant color was the black) and to correctly "map" the screen to interact. However the most discouraging difficult it will be the impossibility to create the 3d space where the characters can freely move (it would be possible but too difficult). The main goal is to have something like a level with fixed cameras switching to follow the main character switching in the same time the backgrounds to fit the existing geometry.
My past tries suggest me that is useless to get in through the bath window if you have your main door key (:wink: ). the problem still remains: where are my keys? ...
ah, forgot! :D nout has got it!

@ Nout
yes, then RF will become the most versatile engine! (And I can die happy...)

Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

Post by Nout » Mon Sep 26, 2005 7:12 pm

One thing is not clear yet

If you have a 3D world, and you draw a 2D picture in it, at which depth do you draw it??

Placing a 2D picture as such can be done by using the PolyArray, where you just add 1 poly (rather then an array)

You can run with your actor before and after the poly. But this does not sound to be what you want?

So in the 3D world, at what depth do you place your 2D picture? and What is behind the picture?

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Mon Sep 26, 2005 9:18 pm

I've tried to use a poly instead of a flipbook. it's more difficult than the flipbook because the poly height is influenced by the floor height. Trying to build an entire level with al the rooms connected it's simply impossible. The problem is the relation between the proportion, the prospective view, the mm of the camera objective, the height of the floor, the depth of the 3d in front of a "2d wall". Thinking to be able to align a 2d background with a 3d perspective view, the process of placing correctly the 2d background entity (up down right left depth, scale) in the 3d space will be an enormous effort (probably useless). The only chance to reach some result is to place an image over the "flat" screen using the 2d sreen coordinates, finding some way to put it behind the 3d, considering also that a 2d image highly scaled and so far in a 3d enviroment has a terrible quality. Nout, when you say that probably you will find a method, this time, what's your trump card? :wink:

wxb1
RF Dev Team
Posts: 69
Joined: Thu Jul 14, 2005 8:31 pm

Post by wxb1 » Tue Sep 27, 2005 5:25 pm

I wrote some code to do the opposite of what you want but the idea is the some what the same. The code I wrote allows you to use the 2d bitmaps but it converts them to 3d polys in the driver that are always on top(z-order). I suppose you could do the opposite rather easily... that is force them to be to always be on the bottom (z-order). Nout says he has a solution so give him some time to come up with something....

@Nout
I can post my code here if you would find it useful...

Nout
Posts: 136
Joined: Tue Jul 05, 2005 5:14 pm

Post by Nout » Tue Sep 27, 2005 6:48 pm

The more posts I read, you seem to want something different then I was thinking you want...

Placing a 2D picture as background and put an actor in front of it does not sound to do what you look for?

You mention "All we need is a command hack to tell the engine to render the actors in front of the 2d layer and to render the 3d world geometry behind. " I don't see yet how this will realize what you look for. Rendering the 2D on top of the 3D will simply make the 3D world invisible?
If you 2D background is only a part of the screen, even then it does not sound to work? There must be more behind this, or do I see this wrong?

revolutiongames2004
Posts: 75
Joined: Tue Jul 05, 2005 4:29 pm

Post by revolutiongames2004 » Wed Sep 28, 2005 3:52 am

ok there is a super simple solution to this, i mean if you like it that is and your a good enough scripter to do this anyways,

First make your box
Then put a clip in for the actor to walk on

ok?

then script the camera to stay in the same position always facing actor

put in background so that the clip is where the floor is to the game. ok?

make sure the camera cant see the floor or ceiling, only the back wall with the backdrop on it

finaly if it is a scrolling type game script the player to only move left right jump crouch so on so forth


get it basicly a 3d level with limitations

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Wed Sep 28, 2005 9:53 am

ok...
i will try to explain myself in another way, making some examples. I'll try to create some basic level with a 3d actor in a 2d enviroment, to show you what type of problems we face at the present. All we have understood the basics. They are:
1) a 3d world, in some way invisible to the camera (clip brush is an option)
2) a 3d actor moving over the 3d world.
3)some 2d background:
3a) an image over the "flat screen". ShowPicture(), DrawflipbookImage() commands.
3b) a 3d entity that render a 2d image in the 3d enviroments. (FlipBook PolyArray)

The 1) and 2) steps are ok, we are all agree. the problem is 3a) and 3b).
It's possible to use 3b but the problems are a reduced quality image and an extremely difficulty in placing correctly the background entity. The image position is affected by several conditions (resolution for example) and it's really difficult to create a level with the rooms "connected" instead of several "theatre" for every room. the ratio between the depth of the background (or the played "break" the wall) and the image scale (or the image is overscaled or too little) is the most difficult thing to set. However it can be done, I've tried in the past.
3a is more stable, the image is a flat 2d visualization at his real quality and we don't have to get an headache to put correctly the image (size or depth). the problem is that now the images are always rendered " in front of" the 3d.
If a good solution for render priority will be found - something like a ShowPictureBehind("Picture",true or false) - , using this second way all the work will be speed up (the other side: 3d geometry + artwork is so much...we don't need extra-work :P ) and using the alpha maps we could place several 2d layers (the character can hide himself behind a wall: try to correctly put a 2d wall in the 3d using a flipbook!:shock: ). My feature request was this, find a way to draw a 2d layer behind the 3d and not in front of the 3d.
3a seems to be a more logical way, although is more difficult by the programming side, because is more "natural" to apply the nout's new screen coordinate commands with a truly 2d layer instead of a "2d entity in a 3d enviroment" afterwards alligned.
This are words now I'll try you to show some fact :wink: .

p.s. ..in future i'll try to use external link images in my posts...

Post Reply