|
Mode 7 / SoM's Flammie style perspective map Displaying 1-20 of 22 total.
12
next
Code
|
Just wondering if anyone has made a demo of a Mode 7 type of image loop and distortion. I looked briefly through the downloads section, but didn't find anything. I only ask because I was poking around on ika's site and THEY have one. ;)
Secret of Mana is the only game I can think of off the top of my head that had one, but you know what I'm talking about, right?
Posted on 2005-08-11 22:51:23
|
Omni
|
Yeah, ika doesn't _have_ one so much as 'they imported OpenGL libraries' :)
Tons of people here have attempted a Mode7 demo -- Blue Zodiakos, Technetium...those are the ones I can think of off the top of my head.
Of those, Technetium has a nice post with screenshots and info regarding code in the Verge Help forum for his Mode7, somewhere...he hasn't released it as a demo yet.
One or two other people are suredly working on them, too...
Also, if you'd like information on it yourself, ...
Sin and Cos: The Programmer's Pals!
Note that their code is in C, but they do a great job of explaining how this stuff is supposed to work.
Posted on 2005-08-11 22:55:33
|
Code
|
Hmm, well, I'm definitely in over my head with this kind of stuff.
And actually, I was messing around with your image distortion library, thinking I could just use GrabRegion() to grab a square out of a larger 'world map' image and then distort that region to give it some perspective. Then change the region being grabbed based on arrow key inputs. Not quite how Mode7 is done, I take it. :)
I think maybe these were some of the threads you were talking about. Man, you guys have some history in here. That screenshot from Technetium sure looks amazing.
http://www.verge-rpg.com/boards/display_thread.php?id=25439&PHPSESSID=bfcb20ff030014be00660d0605c10496
http://www.verge-rpg.com/boards/display_thread.php?id=9374&PHPSESSID=bfcb20ff030014be00660d0605c10496
Posted on 2005-08-11 23:22:10
|
anonymous
|
Ah! The Image Distortion library! That was actually a pretty good idea.
And your plan would have worked perfectly, except for me :) The image distort used in the library is what I believe is technically called a 'affine distortion', which is to say that when you distort the image so that it disappears into the distance, you're not really distorting the image in 3D space, but just arranging two warped triangles. (this causes something I believe is similar to the 'texture warp' I see on earlier consoles). Does that make sense?
I believe 3D engines actually have a remedy to this, called 'perspective correct texture mapping', where the texture data is sampled using 3D coordinates and not simply strected to two screen triangles.
Also! I am actually tossing around in my head an idea for how to accomplish this with the Image Distortion, but I didn't get around to it with the last release, and I won't have time for it anytime soon. Okay, in fact, I think I've pretty much figured out how I'm going to do it, as well as make it faster, but anyway. I could be wrong.
Also! Actually if I was to use the library, rather than using GrabRegion to take a rect and then Distort it, I would actually use ImageDistortLine and actually take a distorted shape from the texture itself, then Distort it to a rectangle. It's basically the reverse of what you would have done, that is to say, Distorted Data-->Rect instead of Rect-->Distort. But you had a good idea, there. Sorry I messed it up :)
Keep experimenting with stuff, though. If you ever run across gamedev.net or like to look at old development instructions for old consoles, like the Sega Saturn (www.segaxtreme.net) you'll see information on how they do things like set up a Mode7 screen. (Granted, most of it, like loading palette data, is kinda worthless to us, but you might find some useful math stuff and things like that...if you're still vaguely interested, try searching for the manual for the Sega Saturn's VDP2 Scroll graphics chip).
Also, still take the time to learn Sin and Cos, if you can. That article does a really, really good job of it -- it's how I learned. Also search for a 3D tutorial or two. The math is nowhere near impossible. Just because you might not be able to visualize a matrix multiplying itself, doesn't mean you can't figure out how to use a matrix to do cool stuff :) Just read around, pick a few beginner's tutorials at first. (try searching for the 3D Coding Blackhole if you're interested in 3D math and stuff). You probably won't figure out how to do awesome Mode7 anytime soon (heck, a lot of us still can't...) but they're getting better, and you might find something you can use.
Posted on 2005-08-12 11:50:33
|
anonymous
|
Ahem. That was myself. --Omni
Posted on 2005-08-12 11:53:24
|
Code
|
Ok, yeah. I understand how those triangles work now. I did notice a definite difference in shapes along the line where the two triangles meet. Unfortunately, the distinction is especially conspicuous when the shape is moving.
Still, this thing doesn't look all that bad when you blit a nice sunset behind it...!
Actually, at certain points, the distorted image seems to 'light up,' in green, in this case. (The color of the land masses in the image I'm using) What causes this?
Thanks for the tips! I'll definitely read through Sin and Cos. I think this'll have to go on the back burner, though. I still have plenty of maps, sprites and scripts to make in the meantime. :)
Posted on 2005-08-12 14:17:20
|
anonymous
|
I am actually not sure. Are you saying that the whole distortion seems to turn green, or that there's green where normally there's just transparency?
I am aware that there are features in the distortion to allow for lucency, and to automatically guess a background color to cover the whole distortion from the source texture itself. But I don't think they should affect each other, especially if one or the other has been turned off. Can I have a screenshot by any chance? (you can find free image hosts around the web, like, for example, searching for 'Photobucket', after which you could link to the image here).
--Omni
Posted on 2005-08-12 16:19:42
|
Code
|
Sure thing, here they are.
Most of the map looks like this:
But a few spots look more like this:
And I went ahead and uploaded the whole thing while I was at it.
Posted on 2005-08-12 21:57:26
|
Omni
|
You've got the bg_color flag set to 1. That means it automatically guesses a backcolor color to lay under the distortion, using the upperleftmost color in the source texture. Since you're grabbing a new texture triangle a lot, every once in a while it probably lands on the color for your landmass, which tints it green.
To remedy this, set bg_color (which is to say, the third from last argument in the function) to either 0 (no background color at all) or something watery, like RGB(0, 0, 255) -- full color blue.
Ah, well, the image distortion does have flaws...but I'm fond of it :)
Posted on 2005-08-12 23:39:26
|
anonymous
|
That is mad sexy.
Posted on 2005-08-15 00:45:04
|
zaril
|
i've always wanted to make my own mode7, because i think i'll use it in Grand Magic, so i've been coding a little yesterday and today to produce this:
Posted on 2005-08-27 11:13:38
|
zaril
|
since this worked rather well i thought, hey, trying to just use the map as the source should work. simple! but no.
so back to the drawing board, with a few changes and atleast it's starting to look like a mode7 for maps. however, in this shot it's pretty close to the ground so it doesn't look all that mode7:ish more than just rotated.
Posted on 2005-08-27 20:18:05
|
zaril
|
since editting doesn't work, i'll put my progress in a new post. i took the freedom of shamelessly stealing the sky texture:
the fact that they are two images next to eachother is just to show that the entity behind the fence actually moves. not that overworlds you fly above have moving entities, but all map-animation occurs on the map.
Posted on 2005-08-28 13:54:59
|
Omni
|
Zaril, that's beautiful.
Is it fast? Do you use per-pixel or another method of own devising?
Posted on 2005-08-28 17:56:40
|
Rysen
|
Wow, zarilman. That looks really, really good.
Posted on 2005-08-28 21:18:26
|
Omni
|
True awesomeness: creating a rotation matrix for the Mode7 transform, and applying to to the Sprites, allowing them to be real 'scaling' sprites rather than just blitted onto the map image.
Posted on 2005-08-28 22:13:16
|
zaril
|
Runs at about 14 FPS so fast? no. However, I am thinking of tweaking the code a lot, perhaps blit it polygon-wise or so. I'm going to add scaling billboards, is that what you meant Omni? I figure it could be used for towns and other points of interests that should pop up in the overworld.
Anyway, thanks for the feedback!
Posted on 2005-08-29 11:41:00
|
Omni
|
Yes! Billboards was exactly what I meant. Also, what do you mean by 'polygon-wise'? Did you make your own mapper, or is it something else?
Posted on 2005-08-29 15:20:26
|
zaril
|
well say, distort a 16x16 pixel area/polygon at a time. own mapper? it's running on RenderMap(x,y,img).
Posted on 2005-08-29 15:42:00
|
Omni
|
Aha! Cool.
Posted on 2005-08-29 22:22:11
|
Displaying 1-20 of 22 total.
12
next
|
|