• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Alex3k

Isometric Staggered - Drawing objects bigger than 1 tile - Depth Error

5 posts in this topic

Hi Guys,

 

So I am new here, I have often used GameDev.net to find answers to problems I have had previously but never really come to the stage of registering to ask a question... however a bug that I have been stuck on for 18 hour straight has brought here. Apologies if this is in the incorrect section.

 

I am developing an Isometric map for a game that I plan to develop in the near future. I based my implementation on the tutorials found here

 

My issue is the following, when I try to draw objects that require more than one tile (for example a building), it seems as though my depth handling goes out of the window. When I place the building, I set all tiles below it to be unwalkable. This was tested by initially setting those tiles to be another tile to check I have the correct ones (which I do), I then took this further by drawing the building to test if it worked and I noticed that the building was being drawn on top of the player.

 

My tiles are split into three types, base, overlay and height. The base type is used for the ground (grass), the overlay type is used for things such as bushes, water, trees ect, the height type is used for mountains and hills. I set my building to be an overlay type. 

 

Obviously the building needs an "origin" cell. This is the cell that holds the actual overlay texture. 

 

To view images that will help explain the issue more go here.

 

In these images, the origin tile is the highlighted (slighty) red tile.

 

As you can see, in the incorrect image the building is drawn on top of the player. Hence my reasoning for thinking that it is a depth issue.

 

How I have tried to fix so far:

  • Set the depth of the cell to be the same as the origin cell 
  • Draw a transparent cell on top of each cell with the correct depth that tile should have

 

I have searched high and low for someone who has the same issue as this yet no one seems to have it! I have also looked for resources explaining it but with no avail. My only theory on how to solve this is cut the image up into tile images and then place them on the map tile by tile.. however I would rather not do that as it is absurd. 

 

Just to make it clear, my depth handling does work for all other scenarios such as walking behind hills/mountains/trees.

 

Has anyone heard or seen this before? Any help will be greatly appreciated.. I have been working on this bug for a good 18 hours straight now and I am feeling slightly disheartened by it.

 

If you need to see the code, I can send you a copy.

 

Cheers,

 

Alex

 

PS If I have missed something crucial just let me know and I will try and provide the details.

 

0

Share this post


Link to post
Share on other sites

These sorts of problems were common in the days before people had access to modern 3D hardware. They occur when you try to fake 3D using 2D overlay techniques. Some configurations are difficult, if not impossible, to represent as simple stacked 2D representations without breaking them up into smaller pieces. However, most people these days tend to use 3D techniques if on a platform that supports them, even if it is only as far as mapping their 2D tiles onto 3D impostor geometry in order to take advantage of the depth buffer for proper drawing. If your tiles have an actual 3D presence that at least roughly conforms to the shape that it could be, it solves a lot of sticky overlap problems. 

 

gamedev.net used to have an Isometric and Tile-based Games sub-forum, but it is now defunct, given that a lot of these older techniques are basically obsolete now. All of the old Isometric posts were folded into the game programming forum. Additionally, some time back I talked more about using a 3D basis [url=http://www.gamedev.net/topic/629496-dynamic-objects-in-isometric-map-drawing-algorythms/]here[/url].

2

Share this post


Link to post
Share on other sites

Aaa I see. So would you recommend branching off into using 3D techniques? Your explanation does bring some closure! I felt like a mad man just sitting in front of my white board going over and over it.

0

Share this post


Link to post
Share on other sites

I do recommend branching off into using 3D, yes. If you were on a platform where 3D support is extremely limited (some weaker mobiles, perhaps) or non-existent, then it might be okay to continue trying to use the old fashioned 2D techniques. But given that you are using XNA, [i]not[/i] using the available 3D stuff would be gimping yourself unnecessarily. In a 3D abstraction, an isometric projection boils down to using an orthographic camera rotated 30 degrees above the horizon (for a 2:1 tile ratio) and 45 degrees around the vertical. That's it. No mouse-maps for picking, no complicated layer stacking, no weird overlap bugs. Project your tile graphics onto appropriately shaped impostor geometry, place them in the map and render. Use standard reverse-projection and geometry-intersection math to perform mouse picking. There has been so much effort and advancement poured into these types of techniques, that the old techniques are completely obsolete by now. In fact, you can usually get significantly better rendering performance by using 3D techniques, given that you can take advantage of things such as batching.

 

Here is a simple scene rendered as an isometric scene mapped with pre-rendered wall and floor textures and rendered again as the underlying geometry with no texturing:

 

sdrElOq.png

 

You can see that the underlying geometry is very basic. It just needs to provide a rough approximation of the geometry it is supposed to represent. When that geometry is rendered, it populates the depth buffer with the information needed so that subsequent objects to be drawn (characters, props, etc...) are correctly clipped against the shape of the geometry. No worrying about sorting. However, you do have to sort any partially-transparent objects (particles, flames, ghosts, etc...) and draw them in a pass after the solid geometry is drawn; that is standard for a forward rendering engine.

1

Share this post


Link to post
Share on other sites

Okay, this is a great deal of help I really appreciate it! I haven't done any 3D programming before so I will do some research into that first. So from my understanding it is a 3D world but just shown in an isometric view point? 

 

By any chance, do you happen to know of any tutorials that can point me in the correct direction? I will obviously do my own search however it is great to have a starting point.

0

Share this post


Link to post
Share on other sites

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  
Followers 0