Sign in to follow this  

My Isometric Engine

This topic is 3062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just created a little web site detailing the state of the isometric engine I'm currently at work on. Since these types of games/engines seem to be a dying breed I'd appreciate any feedback or advice.

Share this post


Link to post
Share on other sites
Wow, looks great!. Somehow reminds me of an old game called Nox. It must be the dynamically calculated shadows, and the nice penumbras (which I'd also like to know how you are calculating and rendering). I think your's is the only 2D game, other than Nox, that has these.

Share this post


Link to post
Share on other sites
Quote:
Original post by O-san
Wow, very nice! But how come you are using low resolution graphics for the backgrounds when the character and objects are in high resolution? It’d also be interesting to hear about how you calculate and render your penumbras.


Thanks. For the most part the higher res stuff is my own art, the rest I downloaded and scaled for the sake of getting something up and running quickly(e.g. the columns), part of it may be because I'm currently lighting subdivided quads individually and not on a per-vertex basis. This makes the shadows and light falloff appear pixelated.

As far as the shadows and penumbras, I subdivide each tile and sprite into many smaller ones. Then to calculate a subdivided quad's light attenuation, I first check to see if it's within the radius of any of the scene's light's, if so I use a typical light interpolation routine to calculate the quad's light attenuation. Then I trace a ray from each influential light to that particular quad. If the ray hits something I know to shade it, if not I render it with the previously calculated light attenuation.

So far this alone will give me hard shadows, to calculate the penumbras one more step is needed, I got the idea of how to do it from this article. Instead of treating the light as a single point, this point needs to be enlarged and given an actual radius(I think I use something like 8-16 pixels). When the initial raytrace from the center of the light to the quad fails because it hits something, I create two more rays, each beginning on opposite sides along the light's center radius(perpendicular to the original ray) and ending on the quad. Then I divide the previously calculated attenuation value for the quad by the number of rays which fail(collide with something). And I use a gaussian blur to further soften the edges. Alternatively to produce higher quality penumbras(3 shadow fins) I can do this third step for every single sub divided quad even if the initial raytrace is successful- this is more costly though.

BTW O-san, I took a look at your journal and it's very impressive. I especially love the hand drawn art. Keep up the good work!

Quote:
Original post by celestis_genesis
Wow, looks great!. Somehow reminds me of an old game called Nox. It must be the dynamically calculated shadows, and the nice penumbras (which I'd also like to know how you are calculating and rendering). I think your's is the only 2D game, other than Nox, that has these.


Thanks. Actually Diablo II used dynamic 2d shadows to a limited extent. Thanks for bringing to my attention Nox, I had never heard of it until now though I don't believe it has penumbras, just softened shadow edges.

Share this post


Link to post
Share on other sites
I commented on your video the other day but forgot to come back here and talk about it as well :) (oh noes everyone knows my name now :<)

I absolutely love what you've done :) Big fan of isometric rendering here, and yours looks especially pretty.

I'm curious though as to how you're calculating the shadows (I know you just answered this above, but my question is more about the world geometry). Are you treating your 2D isometric world as a 3D world and simply projecting all your textures onto the geometry (like O-san does with his engine) or is there another secret to the way your engine works?

I'd be very interested in hearing about it all :)

Share this post


Link to post
Share on other sites
Quote:
Original post by _Sauce_
I commented on your video the other day but forgot to come back here and talk about it as well :) (oh noes everyone knows my name now :<)

I absolutely love what you've done :) Big fan of isometric rendering here, and yours looks especially pretty.

I'm curious though as to how you're calculating the shadows (I know you just answered this above, but my question is more about the world geometry). Are you treating your 2D isometric world as a 3D world and simply projecting all your textures onto the geometry (like O-san does with his engine) or is there another secret to the way your engine works?

I'd be very interested in hearing about it all :)



Thanks a lot, I really appreciate the positive feedback. I'll probably post another update video fairly soon, as I've really done quite a lot since the last one, including nearly eliminating the huge amount pixelation.

I'm not really sure that I totally understand your question about shadows(perhaps you could be more specific), but I'll try an answer to the extent that I understand what you're asking about geometry. My game world exists solely in two dimensions, there's not a z coordinate to be found anywhere thought my code. I use 2d textured quads(opengl) with textures such as these.

The world itself is constructed of two primary elements, tiles and entities, both of which end up being rendered as 2d textured quads. The tiles are laid out in the same exact way as nearly any other 2d staggered isometric map layout- tiles basically have no real geometric representation, aside from being able to test the base diamond tile on which they sit for collisions. Entities(npcs, objects, items, etc...) are basically just circles(sometimes oblong). And everything is done on the cpu, no shaders.

Hope I answered the right question, if not please let me know.





Share this post


Link to post
Share on other sites
It looks as though you are using 2D shadow casting (or recursive shadow mapping) and utilizing the Y distance of the tile as the "height" to determine how far past the shadow should be cast. If the Y is > the light source Y then the cast is infinite.

If so, that's one hell of a good twist of an old technique. If not, it may be faster LOL.

IE: Similar to http://eonclash.com/ViewProduct.php?ProductID=27 only instead of ascii your using graphics and the graphic height to determine how long a shadow lives.

- Jeremy

EDIT: You would also be using the light position to determine how much of the actual tile its hitting to light up. Thus giving you a very realistic looking light response on each tile.

Share this post


Link to post
Share on other sites
Quote:
Original post by jdarling
It looks as though you are using 2D shadow casting (or recursive shadow mapping) and utilizing the Y distance of the tile as the "height" to determine how far past the shadow should be cast. If the Y is > the light source Y then the cast is infinite.

If so, that's one hell of a good twist of an old technique. If not, it may be faster LOL.

IE: Similar to http://eonclash.com/ViewProduct.php?ProductID=27 only instead of ascii your using graphics and the graphic height to determine how long a shadow lives.

- Jeremy

EDIT: You would also be using the light position to determine how much of the actual tile its hitting to light up. Thus giving you a very realistic looking light response on each tile.



No that's not the method I am using, but thanks for brining it to my attention. I skimmed over a few articles on "recursive shadow casting"(or whatever it is, there seems to be no clearly defined name for it)and it would appear that this method is quite a bit faster(or at least should be) than the method I'm using.

Though for a number of reason I don't think I would be able to implement it into my game. The main reason being that I don't store lists of subdivided tiles. When drawing a single diamond shape ground tile quad(64x32 pixels seen in the above pic), I will sub divide it into either 128 or 512(depending on my LOD setting) smaller quads and light + ray trace each individually as needed(though many get thrown out and some don't get ray traced). During this subdivision process, I have access to the parent tile, and to the subdivided children tiles, but not to any other parent tile(or any other parent tile's subdivided children). After I'm done rendering all of the sub divided tiles, I throw them all away(but of course the parent itself is stored in a map array structure).

That being said I'm still going to look further into this method you've introduced me to, thanks.


Share this post


Link to post
Share on other sites

This topic is 3062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this