Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

MatuX

Lighting on ISO games

This topic is 6161 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

This is somewhat frustrating because after seeing commercial games handling lighting in such beautiful and fast ways then seeing myself using MMX assembler algorithms from articles to do a simple fade out to night and having my 50fps game get down to 6fps just because of that... I don''t really know why it''s sooo slow, maybe it''s because the game is a windowed 800x600? It eludes me... I have been thinking about some ways to succesfully handle lights in a DD isometric environment, one of these ideas were making a Texture Managment System that could edit the memory just before it''s drawn and leave it edited until you need to re-edit it again (without having to modify it every frame). I haven''t implemented it, yet, but I think it could be a solution.. The final result would be something like Jagged Alliance 2 (did you see the spot lighting effects are per-tile based and not smoothed like, say, Ultima Online?). The main problem is that 1. you lose the smooth feeling when doing a fade effect (you can''t smoothly fade the scene cause it would be hella slow), and 2. the spot light is per-tile thus not really smooth. I bought Ernest''s book and he completely skips the topic (albeit I think the book is really awesome ). I think it would be really cool to see an article talking about implementing a *real DD* (real DD != using D3D in DD) lighting system.

Share this post


Link to post
Share on other sites
Advertisement
Since you mention MMX asm algos and DD, i presume you use DirectDraw and not D3D I think your problem is the 800x600 resolution. No matter how much asm and MMX you squeeze in there, it will be too slow. My tip is to drop fading until you (if ever) convert your engine into using D3D for drawing. And i hope you put your screenbuffers in system memory..? Thats insanely important.

As for lighting, the best example i''ve seen to this date, is Diablo2. Try it, download the demo or something. The lighting in the caves are really great. Wish i knew how to do that

Share this post


Link to post
Share on other sites
Everyone talks like if D3D would be a must when doing cool blending effects on 2D games. Take a look at the response to the "What is the minimum system requirement to play Baldur''s Gate?" question (obviously, from Baldur''s Gate game ):

"A: Currently the minimum requirement is a P120 with a 2meg video card and 16 Megs of RAM. This system spec plays VERY well and is not a minimum that says "I can boot the game up" but "I can actually play" system. [...] If you have 4 meg of video card memory we plan to implement 24-bit graphics, which should improve the realism to the maximum level. We recommend a P166 with 32 meg of RAM for optimal performance."

They recommend a Pentium 166 with 32mb of RAM and a 4mb Video card for *optimal performance* and the environmental light fade outs like when it''ll rain are incredible fast and smooth!! GammaRamp? I don''t think a 2mb video card will support gamma calibration! D3D? Bleh...

I have seen other posts about this and no one was totally convincing to be worth for an implementation. I have been researching, too, I won''t complain about others solutions without having researching by myself )) But I still can''t find something that would make me think "This is how they did it!" (referring to ISO commercial games).

I still have to check out that Alpha Blending Using MMX Technology by Matthias Hofmann (http://www.gamedev.net/reference/articles/article1487.asp) where he says it would ran faster.

Although, I''m sure most solutions presented works perfectly fine for simulate spot lightings and such, but it completely eludes me the fade thing (found most in Inifinty Tech''s games).
I''ll stick with the solution I presented in my first post and see how it works, maybe I could even make an article out of it (yay!). Albeit, no fades

Finally, revisiting some ISO games like Ultima Online, Fallout, Jagged Alliance 2, Arcanum and others RPG-ishs, I noticed no one used smooth fades when simulating a day to night or viseversa effect.
Maybe defter, you''re right and I''m pretending too much for a 800x600 resolution and taking in account Infinity Tech''s games are all 640x480...

(When talking about Infinity Tech''s games I mean Interplay/Black Isle/BioWare games using the Infinity Technology (Baldur''s Gate, Planescape: Torment, Icewind Dale, etc.))

Share this post


Link to post
Share on other sites
null and void:yeah, you mentioned it... without much effort.. I can''t remember since when games are made without much effort... (or maybe that could explain why I Did like only like 5 to 10 games in the last few years while I loved half of the games I got in my hand 10 years ago...)
anyway, 800x600 is a very high resolution for software and you won''t do any good with that. 640x400 or 640z480 works MUCH better, you should make two version ie 16 and 32bpp. (or just the 16bpp - gives good visual effects and much better performace)
I don''t know what MMX functions you use, but they are pretty speedy. The bottleneck is memory transfer.
Strange thing I discovered once - copying mem from sysmem to sysmem on a c400 with 66mhz bus/mem is actually SLOWER then copying sysmem-vidmem
Anyway you should rather consider handling lighting at the time you''re drawing bitmaps/tiles rather, then first drawing them and then applying lighting - it will be much faster.
Hope it helps a bit...

With best regards,
Mirek Czerwiñski
http://kris.top.pl/~kherin/

Share this post


Link to post
Share on other sites
ohh and btw... a drop from 50fps to 6fps seems pretty huge.. I hope you''re not reading data from vidmem or something... I wouldn''t expect a bigger drop then 50%... still depends very much you draw in your graphic.
Also remember, that a part of screen is occupied by a menu/etc. - You don''t even have to send them to vidmem everyframe. Always a tiny speed booster

With best regards,
Mirek Czerwiñski
http://kris.top.pl/~kherin/

Share this post


Link to post
Share on other sites
The guys that did Baldurs Gate cheated big time! They used an
800X600 screen but filled 50% of it with menus. So they were doing effects on something smaller than a 640X480 screen.

They only had to draw a dirty rectangle around the mouse when it was over the menus and do a redraw of the menus when you pressed on one of the buttons.

As for Fallout it was 640X480 and 8 bit colour. Dead easy.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!