Jump to content
  • Advertisement

Archived

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

JohnZ

Advices on Objects bigger than one tile deep management in a 2d Flash iso engine ?

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

Hiya IsoPeoples! Im wondering what is the best method to manage Big objects (for exemple a object is covering 3 tiles on x and 4 tiles on y like a table or a car). I really have avoid to cut objects (complex & fastidious processus) becoz i allready done a online isometric world editor. What i have now is a big problem of deep (swapDepth) becoz sometimes the character have to be behind and still in front of the object and sometime the inverse (i ve tried many possibilities). For the first time im wondering if it is really possible to manage big objects or did i have to do case by case testings (if my character is in front of this big object take the deep of this object + 1) This is the only remaining problem. Any helps would be very very welcome. Thnks in advance & seeU Yves

Share this post


Link to post
Share on other sites
Advertisement
Yo dudes...

Seems that my post was not clear enough (sorry my english is uggggly)...

Well what im looking for exactly (im not sure even if that possible) is an algorytm that return me the swapdeep value to use for an object bigger than one tile so a character can relly turn around the object with a correct deep (im behind so im hide,...)

Well i hope that the only answer ll not be "slice your objects man, slice!"...

SeeU, Yves

Share this post


Link to post
Share on other sites
Change your render routine to draw first the bottom tiles then the top ones, after the terrain rendering render all your objects.

Share this post


Link to post
Share on other sites
Another method would be to use two passes to render. One for objects that have absolute grounding and another for overhead objects.

Share this post


Link to post
Share on other sites
Since I dont know how you designed your engine, its hard to say what to do, but this was how I did it when I did ISO, although I didnt really like it. (See my prefered option #2)

Option #1
If your tiles are designed such that they contain a list of objects on that tile, you could do the following:
- keep each tile's list of objects sorted by there world position (umm, think I sorted by Yaxis only).

- Rendering: you just iterate through the sorted tile objects. Then the objects will need a marker for if its been rendered the current frame or not so you dont spend extra time re-rendering overlapping tile objects.

- As an object moves, it removes itself from all tiles its listed under and re-inserts inself into another tile(s).

- With objects that are larger then 1 tile, your probably gonna have to add that object to all tiles it is within. So, using the objects size, you would then check neighboring tiles as far out as needed.

Option #2
Personally, this second idea is more inline with how 3d engines work and what I prefer as well:
- Render your tiles.
- Keep a sorted list of objects by position. (sorted from back to front)
- Iterate through the list rendering objects within view.

Hope that gives you some ideas and hope that is what you are asking about. Sorry if it wasnt.
John



[edited by - GalaxyQuest on December 6, 2002 2:24:58 PM]

Share this post


Link to post
Share on other sites


Have a look a this picture...

So the red tile are the tiles where the House stands on
if you come to tile 1 you draw the blue part, and if you come
to tile 3 you draw the yellow part. And so on... This method is very fast and ... it works.

[edited by - No on December 7, 2002 3:29:54 PM]

[edited by - No on December 7, 2002 3:35:17 PM]

Share this post


Link to post
Share on other sites

No:

Although I see your picture, I don''t understand your method. Maybe I''m a slow learner? Can you outline your method in words/pseudocode, please? Thanks!

Share this post


Link to post
Share on other sites
I think its too easy to understand :-))

on each Tile is a pointer or a byte or anythin else that shows wich object is standing on it. And a second value which part is standing o this tile. So when you have to draw part 1 you start
drawing at the beginnig of your image to one tilewidth, the complete height. If you easiliy draw tiles like that everything works corect.

The only thing you have to do is to store the object and which part of the object is standing on one tile. o.k?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!