# Best way to store data for a 3d map

**URL:** <https://forum.kirupa.com/t/best-way-to-store-data-for-a-3d-map/261539>\
**Category:** Uncategorized\
**Created:** [May 28, 2008, 4:52pm UTC](https://forum.kirupa.com/t/best-way-to-store-data-for-a-3d-map/261539 "2008-05-28T16:52:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![8bitninja](https://avatars.discourse-cdn.com/v4/letter/8/e9c0ed/32.png) [@8bitninja](https://forum.kirupa.com/u/8bitninja)\
**Post date:** [May 28, 2008, 4:52pm UTC](https://forum.kirupa.com/t/best-way-to-store-data-for-a-3d-map/261539/1 "2008-05-28T16:52:09Z")

</div>

i wrote a fairly simple 3d engine in as3 and was considering making a game where you fly through a trench or cave, etc. (star wars style).

what in your opinion is the best way to store data for 3 dimensional levels?

for 2d and 2.5d i usually use a 2d array for different tiles, etc. but the 3d thing adds a lot of complexity.

if i used a 3d array, it’d basically be blocky square tubes (which may be ok at first, idk).

are there any other established methods of storing more complex shaped maps?

i can’t really think of the best way to store such information. it’d probably be done with face and vertex info, but idk…

ideas?

---

<div class="post-metadata">

**Author:** ![Jerryscript](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jerryscript/32/451_2.png) [@Jerryscript](https://forum.kirupa.com/u/Jerryscript)\
**Post date:** [May 30, 2008, 2:02pm UTC](https://forum.kirupa.com/t/best-way-to-store-data-for-a-3d-map/261539/2 "2008-05-30T14:02:20Z")

</div>

Collada is a good way to go.

Another method that can work well for caverns, tunnels, etc is a heightmap. You can store the height offsets in each pixel in a single color channel, and that leaves you with 3 other color channels to store additional data in (shading normals, objects, etc).
