|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: Creating maps for scrolling............
Great explanation of it, but I just wanted to add that you should
probably store it in a matrix, or array, or whatever you want to call it.
For example, if your map is 100x100 units (squares, inches, whatever).
Then, you'd probably want to store this in a 100x100 array of something (you
could use bytes, for example, if you only had 256 different tile, or you
could use ints for 65,000 different tiles). When it comes time to render
all of these, you simply determine which tiles are visible, via bounding
boxes or whatever, and then render those tiles. Pretty simple, huh? You
could also use this for collision detection. You could flag each tile with
a clip, or no-clip flag, and then use those bounding boxes...
>From: Kevin Wolfskill <kevin.wolfskill@jadesolutions.com>
>Reply-To: gameprogrammer@gameprogrammer.com
>To: "'gameprogrammer@gameprogrammer.com'"
><gameprogrammer@gameprogrammer.com>
>Subject: RE: Creating maps for scrolling............
>Date: Wed, 21 Jun 2000 11:28:55 -0600
>
>Not sure what you are creating a map for, but let's assume you are creating
>an orthagonal view map for something like a Real Time Strategy game (RTS).
>Typically, what these games do is to create their world with tiles (like a
>custom character set). That way you can create a small set of bitmaps (the
>tiles) which when used together (placed side-by-side), look like a much
>bigger bitmap. The key here, is that the tiles have to be of something
>that
>is generic enough (like the water in the middle of a lake), that they can
>be
>used repeatedly together to make the bigger bitmap. With the water
>example,
>you could create 1 or 2 tiles with waves for water away from shore, and
>then
>some number of tiles that are the shoreline (don't forget that each one of
>these might be able to be rotated 90 degrees and used as the shore on the
>top, bottom, left, and right sides). Then, you keep placing the same tile
>over and over to create a larger bitmap. To pan the display, you just
>scroll the display for the stuff you will still see, and place the new
>tiles
>at the leading edge in the direction you are panning.
>
>OK, what does this gain you? Two things: 1. Huge memory savings because
>of the small bitmaps being used over and over. 2. Much less effort
>creating a few small bitmaps instead of a set of large bitmaps.
>
>Hope this helps!
>
>Kevin Wolfskill
>JADE Solutions
>Office US (303) 448-1019 ext. 23
>Fax US (303) 449-1548
>Kevin.Wolfskill@jadesolutions.com
>______________________________________
>WARNING - THIS E-MAIL TRANSMISSION IS CONFIDENTIAL.
>This e-mail transmission (including any accompanying attachments)
>contains confidential information which is intended for the named addressee
>only. If you are not the intended recipient, you are hereby notified that
>any use, dissemination, distribution or reproduction of this e-mail is
>prohibited. If you have received this e-mail in error please contact
>me immediately. Thank you.
>_______________________________________
>
>
>
>
>
>-----Original Message-----
>From: Josiah Avery [mailto:josiahavery@hotmail.com]
>Sent: Wednesday, June 21, 2000 10:48 AM
>To: gameprogrammer@gameprogrammer.com
>Subject: Creating maps for scrolling............
>
>
>Hello,
>
>I am trying to write a routine which combines all the images data of x
>amount of images, and combines them into one large image. That way, I can
>create another function which pans over the large image. Here is a bit of
>code:
>
>byte *
>LoadMap(image * padtMapList , byte * pfcDestinationMap , magnitude_var
>iNumberOfMaps)
>{
> byte * video = (byte *)0xA0000000L;
>
> try
> {
> pfcDestinationMap = new byte[RESOLUTION * iNumberOfMaps];
> }
>
> catch(xalloc error)
> {
> TerminateGraphics();
> printf("Unable to load map!!\n");
> exit(1);
> }
>
>for(long_var iTotalIndex = 0,iMapNumber = 0;iMapNumber < iNumberOfMaps;
>iMapNumber++)
>{
>
>for(long_var iIndex = 0;iIndex < RESOLUTION;iIndex++,iTotalIndex++)
>{
>pfcDestinationMap[iTotalIndex] =
>(byte)padtMapList[iMapNumber].buffer[iIndex];
>}
>}
>
>return pfcDestinationMap; // <- this points to the beggining of the newly
>initalized map
>}
>
>If anyone sees anything that I may have missed, please let me know...
>
> Josiah
>
>________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>=================================================================
>The GameProgrammer.Com mailing list is for the open discussion
>of any topic related to the art, science, and business of
>programming games. This list is especially tolerant of beginners.
>We were all beginners once
>
>To SUBSCRIBE or UNSUBSCRIBE please visit:
>http://gameprogrammer.com/mailinglist.html
>=================================================================
>The GameProgrammer.Com mailing list is for the open discussion
>of any topic related to the art, science, and business of
>programming games. This list is especially tolerant of beginners.
>We were all beginners once
>
>To SUBSCRIBE or UNSUBSCRIBE please visit:
>http://gameprogrammer.com/mailinglist.html
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once
To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html
|
|