Advertisement

Object Layering = headache

Started by April 30, 2001 02:35 PM
1 comment, last by okmot 23 years, 9 months ago
Hi Me and 2 friends are trying to create a game using an isometric view (2D). Our first major problem is object layering. Our object sprits (barrels, people, cars, tables) can span many tiles and may have transparneces underneath them (like a sign on posts). Because of this, the usual L->R sprite outputting doesn''t work, the sprits may appear in the wrong order. The problems is getting the sprites to be drawn in the correct order, which is creating quite a migrane for us... some options we''ve thought up include: flagging tiles that have object ''collisions'', keeping a dynamic linked list that will contain the proper sprite order, and manually setting certian ''object'' layers for objects that are known to cause problems and will always be drawn on the nth layer.. any help or tips or suggestions or whatever would be welcomed! You can email us also at rt@projectcolossus.com Thx! RT
I recommend the dynamic linked list. There is a previous article that may be of help:

http://www.gamedev.net/community/forums/topic.asp?topic_id=32868

Read the last post by me. It may be useful.

Good Luck






Dino M. Gambone



Good judgement is gained through experience. Experience, however, is gained through bad judgement.

Dino M. Gambone
Good judgment is gained through experience. Experience, however, is gained through bad judgment.

Currently working on Rise of Praxis MUD: http://www.riseofpraxis.net/

Advertisement
Here''s an idea for a bodge job.

Take the "bottom" of your dest rect for each sprite being currently displayed. Sort them into a list from highest value to lowest, then blit in that order.

Or, for static sprites, such things could be presorted. Also, if the bottom of your bitmap is not the bottom of your sprite (as such) you''ll also need to include offsets.

I don''t know if such a simplistic approach is applicable to your app or not ... it''s just an idea. Also, mobile sprites can be "bubbled" into position between objects that appear to overlap, quite easily.

Yes this idea is not without overheads, but it''s something to consider.

El Duderino



This topic is closed to new replies.

Advertisement