Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Graal Mode 7 (https://forums.graalonline.com/forums/showthread.php?t=76204)

xXziroXx 08-11-2007 12:11 AM

Graal Mode 7
 
Stefan, would this be possible to program into the Graal engine? The technique was made for SNES, and would be quite.. awesome to see on Graal.

http://en.wikipedia.org/wiki/Mode_7

Moderator; this link is very much related to what I'm asking for, please dont remove it.

theHAWKER 08-11-2007 12:17 AM

that would be a realy good idea

Bell 08-11-2007 12:38 AM

I can see where that would open up a whole new way of having the overworlds work when it comes to distance fighting etc. Not as complicated as 3D but has a similar effect.

Crono 08-11-2007 01:30 AM

Chrono Trigger also used this for the minirace. :P

Crow 08-11-2007 01:56 AM

Secret of Mana used it <3

xXziroXx 08-11-2007 02:23 AM

I want to be able to do Final Fantasy 6 overworlds ^^

zokemon 08-11-2007 07:36 AM

I love how Terranigma for the SNES used this effect on both their Overworld and their Underworld.

Em 08-11-2007 07:42 AM

An excellent idea. One of the best i've read on the forums in recent months.

Cloven 08-11-2007 08:09 AM

Yeah, I'm certainly in favor of this in principle, though I'd like to know what its affects on the client and computer may be.

Chompy 08-11-2007 06:13 PM

I would just love to see that by implented!! :D
Very nice idea Ziro! :p

DustyPorViva 08-11-2007 06:19 PM

I'm in the middle of scripting something along these lines right now :)
Maybe I'll post a screenshot when I'm done.
But ya, would be a nice addition.

DustyPorViva 08-11-2007 07:47 PM

http://img520.imageshack.us/img520/9779/newmap1rc2.jpg

:)

Chompy 08-11-2007 09:08 PM

Awesome!!

Crono 08-11-2007 10:29 PM

Quote:

Originally Posted by xXziroXx (Post 1338916)
I want to be able to do Final Fantasy 6 overworlds ^^

Chrono Trigger overworlds > you

Inverness 08-12-2007 05:13 PM

We await Stefan's input on the subject.
THIS IS A CUE<- THAT IS A CUE

zokemon 08-12-2007 05:26 PM

Quote:

Originally Posted by Inverness (Post 1339291)
We await Stefan's input on the subject.
THIS IS A CUE<- THAT IS A CUE

^ THAT WAS A CUE ^

IT WAS A CUE

I agree.

Googi 08-12-2007 05:59 PM

Quote:

Originally Posted by xXziroXx (Post 1338880)
Stefan, would this be possible to program into the Graal engine?

"Program into"? I don't think the Mode 7 source code is just floating around on the internet.

xXziroXx 08-12-2007 06:50 PM

Quote:

Originally Posted by Googi (Post 1339313)
"Program into"? I don't think the Mode 7 source code is just floating around on the internet.

Of course not. I meant if it was possible to program a similar system in Graal, with the same functions.

Inverness 08-12-2007 06:54 PM

You don't need source code, there is already an explanation of what Mode 7 does. You have your end result right there, now you just need to figure out how to get to it.

I'm sure you already know this Googi.

Tyhm 08-12-2007 09:46 PM

Mode 7:
Take the image.
Put it on a polygon (skin).
Skew the polygon.
Done.

The interesting math is for moving diagonally, and having the map keep track of where you are...that's matrix math, that is. "For every step you take back, move one bit closer to the center. For every step you take forward, move one bit further from the center."

Angel_Light 08-13-2007 01:10 AM

Dusty that is so cool. Just like z3 map ^^ oh please tell me how you did it? Like how did you get the players head to move properly with that perspective, I'm completely clueless with scripting with matrices. XD

Inverness 08-13-2007 01:18 AM

Uh you don't really need matrices. Here is example of drawing a tilted polygon.
PHP Code:

with (findimg(200)) {
  
layer 4;
  
dimension 3;
  
polygon = {
    
50500,
    
600500,
    
600600200,
    
50600200
  
};
  
image "map.png";
  
mode 0;
  
alpha 0.75;
  
red 1;
  
green 1;
  
blue 1;



Angel_Light 08-13-2007 01:30 AM

right right I know how to do that but what I need to know is how he got the players head to move accordingly with the tilted polygon. :P

DustyPorViva 08-13-2007 01:33 AM

Actually I used 2 dimensions. Doing what you did won't skew the image properly.
You have to alter the x dimensions accordingly. Here is what I used in my script, though it's probably embarrassing math-wise.

PHP Code:

  this.mapsize=screenheight*.75;
  
this.mappos={(screenwidth-screenheight*.75)/2,(screenheight-screenheight*.75)/2};

  
with (findimg(200)) {
    
dimension=2;
    
polygon={
      
thiso.mappos[0]+25,thiso.mappos[1],
      
thiso.mappos[0]+thiso.mapsize-25,thiso.mappos[1],
      
thiso.mappos[0]+thiso.mapsize+150,thiso.mappos[1]+thiso.mapsize,
      
thiso.mappos[0]-150,thiso.mappos[1]+thiso.mapsize
    
};
    
image="map.png";
    
layer=4;
    
mode=1;
    
alpha=.9;
  } 

EDIT: Oh... as far as player detection... I don't advise doing what I did. I suggest learning some trig and scripting a fully 3D polygon and learn how to 'place' something on it. It would be much more versitile.
When doing stuff like putting the player's horizontal position on the map, I use the basic formula (player.x/gmap.width)*mapwidth. What I did for this map is determine the mapwidth depending on the player's position vertically. I use a base mapwidth of the widest part of the map(in this case, the bottom) and subtract ((player.y/gmap.height)*mapheight)*(widestmapwidth-skinniestmapwidth).

If that makes sense. Either way, I don't advise doing it that way. Also, it seems the script doesn't work exactly the way I wanted. The position seems off, but I think it's because of the way Graal maps the image onto the polygon(as you can see in the screenshot, the bottom right is stretched horizontally a lot more than the top-right).

I wanted to do this script using eulerrotation... but it doesn't seem to work and I can't find anyone who knows how to use it.

Angel_Light 08-13-2007 01:39 AM

sexy :cool:

Inverness 08-13-2007 02:38 AM

How would doing what I did not skew the image properly? Its showing in 3 dimensions with a tilt so you see the image at an angle. I'm confused.

DustyPorViva 08-13-2007 02:44 AM

Because all it does is alter z on a graal-relative scale. Meaning it just raises the bottom of image. It doesn't change the image like you think it would in a 3D environment. Anyways, I tested what you posted and it just made the image shrink vertically. That's why I wanted eulerrotation... so things like this would be simple.

Inverness 08-13-2007 03:01 AM

I still don't understand you, it changes the image exactly how I would expect in a 3D environment.

Angel_Light 08-13-2007 03:03 AM

But the Graal Enviorment isnt truly 3d

Inverness 08-13-2007 03:08 AM

Quote:

Originally Posted by Angel_Light (Post 1339483)
But the Graal Enviorment isnt truly 3d

Neither is your monitor for your computer. And how does that make a difference?

Angel_Light 08-13-2007 03:11 AM

perspective, yeah 3D games arn't true 3d but the with the graal Camera currently you only have an aerial view. With traditional 3d games you can change the camera positions giving the effect of 3d. Simply, you can't change Graal's camera position so therefore we always have an aerial view. if we could we would be able to use you method simply.

Inverness 08-13-2007 03:27 AM

1 Attachment(s)
Heres what happened to mine when I did it using 3 dimensions.
PHP Code:

  with (findimg(200)) {
  
layer 4;
  
dimension 3;
  
polygon = {
    
50+100500,
    
800-100500,
    
800800300,
    
50800300
  
};
  
image "map.png";
  
mode 0;
  
alpha 1;
  
red 1;
  
green 1;
  
blue 1

Graal is not placing the image on the polygon correctly. Perhaps using a simpler rendering algorithm for the image so it doesn't take lots of processing time.

Angel_Light 08-13-2007 03:31 AM

with making any 2d image and tilting it, there is always going to be distortion. Example : a flat map of the Earth no matter what type it has distortions. you can't make a 3d img 2d and vice versa

Inverness 08-13-2007 03:34 AM

Quote:

Originally Posted by Angel_Light (Post 1339492)
with making any 2d image and tilting it, there is always going to be distortion. Example : a flat map of the Earth no matter what type it has distortions. you can't make a 3d img 2d and vice versa

Uh, duh? We're talking about using a 2 dimension versus 3 dimensional polygon to get the same effect.

DustyPorViva 08-13-2007 03:42 AM

Well, you did exactly what I did in mines in your new post. You altered the horizontal aspect manually. What I was saying is specifying a z did not 'tilt' the polygon, only change it's vertical position. Z in Graal is more like another Y axis, it doesn't really add any depth. You can achieve the same thing without ever using Z.

Inverness 08-13-2007 03:34 PM

4 Attachment(s)
Quote:

Originally Posted by DustyPorViva (Post 1339497)
Well, you did exactly what I did in mines in your new post. You altered the horizontal aspect manually. What I was saying is specifying a z did not 'tilt' the polygon, only change it's vertical position. Z in Graal is more like another Y axis, it doesn't really add any depth. You can achieve the same thing without ever using Z.

You have no idea what you're talking about. Each vertex on the polygon can have its own z variable, so if I increase the z of the bottom two vertexes its going to damn well tilt the polygon.

Which one of us has been scripting longer? You're starting to irritate me.

Heres the examples:
1st Picture: Square Polygon w/ all vertices z=0
PHP Code:

  polygon = {
    
50+0500,
    
800-0500,
    
8008000,
    
508000
  
}; 

2nd Picture: Square Polygon w/ bottom vertices z=300
PHP Code:

  polygon = {
    
50+0500,
    
800-0500,
    
800800300,
    
50800300
  
}; 

3rd Picture: Trapezoidal Polygon w/ all vertices z=0
PHP Code:

  polygon = {
    
50+100500,
    
800-100500,
    
8008000,
    
508000
  
}; 

4th Picture: Trapezoidal Polygon w/ bottom vertices z=300
PHP Code:

  polygon = {
    
50+100500,
    
800-100500,
    
800800300,
    
50800300
  
}; 

You're obviously not understanding the fact that the image's Z as a whole is separate from the Z of each vertex. The image's Z as a whole wouldn't even apply in this case since its a polygon.

DustyPorViva 08-13-2007 04:53 PM

Applying a Z to each vertex does not 'tilt' it in the sense that it gives it perspective. You're giving it perspective by modifying the x of each vertex. Your very first script, which I mentioned about the z thing, did not change the x values accordingly, so all it appeared as was a crushed image. You have to apply your own 'tilt perspective' via stretching the width of the image yourself, changing the z will not do that. Which was my original point.
Either way, I did the same exact thing you did, without ever using a z dimension. Like I said in my first post, the z-axis in Graal is nothing more than an additional y-axis. It doesn't add another dimension, just another way to change the position on the y-axis. If you take one polygon and make it 100x100px, then take another polygon and it make it 100x150x50, it will look the same. This all started with your original script which did not replicate my screenshot, which was the whole point in me correcting it.
And I don't know what the hell who's been scripting longer has anything to do with it, and why you're getting irritated.

Crono 08-13-2007 05:00 PM

Yeah Inver, you have to apply your own 'tilt perspective' via stretching the width of the image yourself, changing the z will not do that.

YES IM DOING IT FOR THE SAKE OF ARGUMENT, BRING IT >:( I B MASTR SCRIPTUR OF GRAAL

Inverness 08-13-2007 05:08 PM

Quote:

Originally Posted by DustyPorViva (Post 1339586)
<snip>

When you put it like that, yea you're right. I thought you were implying that the same effect couldn't be done with 3rd dimension.

By the way, my original script was not supposed to replicate your screenshot at all.

Hm, I think I'll make a function to calculate depth without manually adjusting the x.
Quote:

Originally Posted by Gerami
Yeah Inver, you have to apply your own 'tilt perspective' via stretching the width of the image yourself, changing the z will not do that.

YES IM DOING IT FOR THE SAKE OF ARGUMENT, BRING IT >:( I B MASTR SCRIPTUR OF GRAAL

http://www.threadbombing.com/data/me...80px-O_RLY.jpg

Crono 08-13-2007 05:32 PM

Quote:

Originally Posted by Inverness (Post 1339593)

http://www.listek.si/yarly.jpg


All times are GMT +2. The time now is 02:00 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.