Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (769)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (855)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Storing tile data for large structures on isometric grids  (Read 429 times)
0 Members and 1 Guest are viewing this topic.
Offline ohyeahx10

Junior Newbie





« Posted 2018-05-13 12:56:53 »

I'm rendering a grid of isometric tiles with each tile being 64x32 in size. Some of the structures I'm rendering span over multiple tiles graphically and I'm wondering how these would be stored in a data structure, or even which data structure I should use. Currently I've got a 2D array where all tiles are floor-level, although I'm now trying to render a building and it's presented a few questions:
1. Are larger structures stored on multiple or single tiles?
2. If they're stored on single tiles how would collision detection work, as you could collide with a tile that's not represented in the tile data for the collided tile?
3. If they're stored on multiple tiles and each tile just renders it's piece of the structure, how would you render the upper parts of the structure (e.g. the upper floors of a building)?
If every floor also has to be represented in the tile data, wouldn't this make a really tall impassible column on your level, when in reality you should be able to walk behind the building once the character is above the base level?

Any guidance would be helpful. Smiley Thanks
Offline KaiHH

JGO Kernel


Medals: 622



« Reply #1 - Posted 2018-05-13 19:37:08 »

Disclaimer: I never implemented any tile-based game, but:
I would store the building in all the tiles that visually contain the building. As for how to do collision detection then in order for a very tall building not making a whole column of the terrain impassible for a player walking at ground level: Store with a tile the level/floor where that part of the building resides.
Then only do collision detection between your player and surrounding tiles at the same floor/level.
Offline ohyeahx10

Junior Newbie





« Reply #2 - Posted 2018-05-13 19:43:46 »

Thanks for the reply. Smiley That definitely makes the most sense, but there's the caveat that if you do have a tall building that occupies all visible tiles for an entire column, if there are any tiles behind it that the player could potentially interact with, this would prevent that tile from being set because the most visible tiles take precedence.
Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (1607 views)
2018-06-10 19:43:48

EgonOlsen (1700 views)
2018-06-10 19:43:44

EgonOlsen (1154 views)
2018-06-10 19:43:20

DesertCoockie (1582 views)
2018-05-13 18:23:11

nelsongames (1182 views)
2018-04-24 18:15:36

nelsongames (1705 views)
2018-04-24 18:14:32

ivj94 (2481 views)
2018-03-24 14:47:39

ivj94 (1698 views)
2018-03-24 14:46:31

ivj94 (2779 views)
2018-03-24 14:43:53

Solater (919 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!