[gameprogrammer] Re: storing side scrolling 2d maps?

So you mean representation of sparse maps constrained in a 2d playfield?


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
   =20
    XXXYXX
    XXXXXX
    XXXXXX                YYYYYYY           UU
                          YYYYYYY           UU
                                            UU
                                            UU
                                            UU
                                            UU



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D


A bit like that (assuming the ascii art works out right), yeah? Where =
only
the non-whitespace stuff is stored? Or do you mean where the playfield
scrolls in both x and y dependant on position in the map (a bit like =
going
through a corridor that bends through 90 degrees every so often)?

If it's the former, then just maintain a list of rects with pointers to =
the
map data, preferably sorted in scroll coord order (i.e. if scrolling lr =
then
sort in x) to optimize the data extraction.=20

If it's the latter, then you can encode with sub-maps; each submap =
having a
direction flag (UD or LR). Give each submap a width/height and you have =
a
reasonably flexible representation.=20

        Hope this helps,=20


         Dave

p.s. I assume you meant a dodecagon, not a dodecahedron ;)



-----Original Message-----
From: gameprogrammer-bounce@xxxxxxxxxxxxx
[mailto:gameprogrammer-bounce@xxxxxxxxxxxxx] On Behalf Of Alan Wolfe
Sent: February 2, 2005 5:37 PM
To: gameprogrammer@xxxxxxxxxxxxx
Subject: [gameprogrammer] Re: storing side scrolling 2d maps?

dodecahedron

haha jk...

what i was thinking was many rectangles of diff shapes and sizes =
connected
together

----- Original Message -----=20
From: "Dave Mariner" <dave@xxxxxxxxxxxxxxx>
To: <gameprogrammer@xxxxxxxxxxxxx>
Sent: Wednesday, February 02, 2005 9:08 AM
Subject: [gameprogrammer] Re: storing side scrolling 2d maps?


> You might want to think about building your maps one abstraction away =
- =3D
> for
> example define a map to be, say, 20 screens wide. You can then =
compress =3D
> each
> screen and decode em on the fly when you transition to a new screen =
=3D
> without
> toooo much overhead. RLE would get rid of most of the dead space =
you're
> concerned about, and is quick to expand. YMMV depending on map =3D
> complexity.
>
> BTW, what shape other than a rectangle can you have for a =
side-scroller?
>
>
> HTH,
>
> Dave Mariner
>
>
> -----Original Message-----
> From: gameprogrammer-bounce@xxxxxxxxxxxxx
> [mailto:gameprogrammer-bounce@xxxxxxxxxxxxx] On Behalf Of Alan Wolfe
> Sent: February 2, 2005 6:43 AM
> To: gameprogrammer@xxxxxxxxxxxxx
> Subject: [gameprogrammer] storing side scrolling 2d maps?
>
> Hey everyone,
> I was wondering, does anyone have any experience storing 2d maps for =
=3D
> side
> scrolling games?
>
> ive done maps w/ overhead tiled games before where you have a =
rectangle =3D
> of
> data in a file and you just load that into a map array.  That would =
work
> pretty good for a side scroller as long as the level was shaped like a
> rectangle, but what if it wasnt a rectangle? plus is that alot of =
wasted
> space to just store it as a giant rectangle of data?
>
> thanks for any input, never done this kind of game before :P
>
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
>
>
>
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html






---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: