The Daily Click ::. Forums ::. Klik Coding Help ::. Saving backdrops/Palette swapping
 

Post Reply  Post Oekaki 
 

Posted By Message

Evil-Ville



Registered
  20/12/2004
Points
  283
6th October, 2006 at 14:41:47 -

The big question is, how do I save backdrops? My current project is heavily based on modifying the terrain and I need to have a way to save it.

Secondly, how do I do palette swapping in MMF2? And I don't mean changing the colours of a sprite or two, I mean changing the colours of all tiles. (that are regular backdrops)

Thanks in advance.

 
yay

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
6th October, 2006 at 15:48:35 -

Time was, you could just use the Palette Object to change the palette-indexed colors for the entire frame. Oh, the things that could be done...

Then Microsoft decided that it wasn't worth their time to support 256-color graphic modes, so the Palette Object doesn't work anymore.
If you actually find a way to do those kinda palette tricks in MMF2, I'd SO buy it right now.

And for your saving backdrops, do you need to save the entire thing, pixel for pixel, or would it be possible to save it based on tile-based chunks?

Image Edited by the Author.

 
Go Moon!

Evil-Ville



Registered
  20/12/2004
Points
  283
6th October, 2006 at 16:06:11 -

16x16 tilebased chunks. Here's a screenshot so you get the idea. The grass pieces and gold ore are active objects.

http://img180.imageshack.us/img180/199/terrablahds3.png

 
yay

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
6th October, 2006 at 17:09:20 -

Ah, perfect!
That means there'd be no problem with storing the level data inside of an array, or some other means of storage (MMF2 doesn't have the Binary Object yet, does it?)

One way to do it would be to have it load the level from the array file at start of the frame. You'd use a couple o' loops and have it "add backdrop" based on what it finds in the array, then modify the array every time you do something that alters the background. I don't know if there'd be any drawback to using "add backdrop" so many times, though. I think I heard that it might slow things down.

Or, if you're feeling adventuresome, you could even forget about the backdrop objects altogether, and instead use Text Blitter objects to display what's in the array (the Text Blitter is practically MADE for tile-based stuff).
'Course, that method requires a lot of strange and complex coding, so I'd only recommend it if you're up to that sort of thing.

 
Go Moon!

Evil-Ville



Registered
  20/12/2004
Points
  283
6th October, 2006 at 17:34:12 -

Actually MMF2 does have binary object.

Would the array solution work without much slowdown in a 10000x5000 scrolling play area? And if so is there any tutorial/example file for doing it? I am horrible at figuring out stuff like this by myself.

 
yay
   

Post Reply



 



Advertisement

Worth A Click