News:

Function Finder  Find all the functions within source code files

Main Menu

Mapping/World Newbie Question

Started by Squiffy, August 16, 2005, 10:09:07 AM

Previous topic - Next topic

Squiffy

Hi all,
can someone point me to any tutorials/info about using maps & worlds please? I'm just trying, amidst work and babies, to grasp how they all work together.

The included help implies (in my mind at least) that you can draw straight onto a "world" to make your game levels, but in the Mapping section advises you to make maps as drawing them directly wastes memory. The mapping bit makes more sense unless I've misunderstood something.

If they are both correct, then I assume a combination of the two should be used (create a world from a section of your map and use a camera to display it), but this appears to double up on effort.

Many thanks in anticipation of a flameless answer...:)

kevin

#1
Well, a world is a conceptual space, not a physical one, like say creating a massive image.  Which i think is what your getting at ?

  Think of a world as database that holds the position/size & orientation of elements placed into them.  Worlds can be as large (width.height) as you like.  Your only limited by the size of the world database (the number elements you capture into it).   In the database you can place images/maps/vector art.   Pretty much anything that can be drawn.

  but your right, the terms are no doubt getting muddled up in the doc's though.




QuoteIf they are both correct, then I assume a combination of the two should be used (create a world from a section of your map and use a camera to display it), but this appears to double up on effort.

 If you just need to create and display a tile map.  Then your absolutely  right, a world isn't necessary in this situation.   You can just use the DrawMap command to draw it at will.

 You can still use the camera system though, since the drawing commands can be re-directed to the what we call the scene buffer.  It's nothing more than a que of things to draw..  

 From here you would use the a camera to draw the items in the scene buffer from a X/Y location.

 Yep it's certainly a mouthful

Squiffy

Hi Kevin,
ok, here's my (mis?)understanding of it. This whole concept is new to me so please forgive any silly misunderstandings.

If I create a world, then capturetoworld any drawing (or, I assume, and displaying of images) I have created a block of memory big enough to hold the graphics. If the graphics are huge, then so is the memory used. When I want to display a window to this world, I grab a portion of it to the scene, draw the camera , flip the buffers and hey presto I see my window into the world.

If I create a Map, then my widow to the map "world" is really just a bunch of references to individually stored graphic tiles. I render those tiles according to the portion of the map I have decided is visible (loosely not unlike drawing sprites), flip the buffers and again, my little window into my Map or "world" is shown.

My question I suppose is for a resonably sized map or world (say it would take your character 5 mins to run from one end to the other whilst doing some "things"), which is the best method to use and why?

Phew, long one that!

kevin

Quoteok, here's my (mis?)understanding of it. This whole concept is new to me so please forgive any silly misunderstandings.

no worries.. fire away

QuoteIf I create a world, then capturetoworld any drawing (or, I assume, and displaying of images) I have created a block of memory big enough to hold the graphics. If the graphics are huge, then so is the memory used. When I want to display a window to this world, I grab a portion of it to the scene, draw the camera , flip the buffers and hey presto I see my window into the world.

 Nah,  all you've captured is the drawn elements type structure.  Which is about 50 bytes.  But this varies depending upon what you capture though.  

 So if you capture 10 images to a world.  All you've really done is added 10 image items to the worlds element que.   Each world element stores the type of element (image in this case) it's data pointer, position, size, rotation and any application parameter an element might require.  


QuoteIf I create a Map, then my widow to the map "world" is really just a bunch of references to individually stored graphic tiles. I render those tiles according to the portion of the map I have decided is visible (loosely not unlike drawing sprites), flip the buffers and again, my little window into my Map or "world" is shown.

 PB actually treats maps as sprites.  To it, their just big images.  


QuoteMy question I suppose is for a resonably sized map or world (say it would take your character 5 mins to run from one end to the other whilst doing some "things"), which is the best method to use and why?

  Most likely a world.   As you can build worlds from many Maps if your wanted.  Perhaps via building smaller map segments,  Or even so you can repeat map segments.  So even maps can be used like images really.   Of course the raw management off those material is up the programmer.   PB just tries to give you the foundation to work off,

But that's no doubt just even more confusing at this moment