Author Topic: How to edit Creeper World custom map (.cwm) files by hand  (Read 19441 times)

UpperKEES

  • Hero Member
  • *****
  • Posts: 5525
  • The Creeper is getting deeper.... into me.
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #15 on: November 12, 2010, 06:35:03 pm »
Just used some of the above info to create a new map. I like the ability to use 2 additional elevation levels, but unfortunately I can't set their tint value. It seems like the level 0 tint is fixed at 0.2 or something close to that and the level 6 tint at about 1.6.

It would have been great when these 2 extra levels could be used in the map editor as well, including setting their tint.

Edit: adjusted level 6 tint value.
« Last Edit: November 15, 2010, 12:06:54 pm by UpperKEES »
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

UpperKEES

  • Hero Member
  • *****
  • Posts: 5525
  • The Creeper is getting deeper.... into me.
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #16 on: November 14, 2010, 06:44:01 pm »
Custom background (if any) is base64-encoded image data (the game and editor are ok with .jpg or .png data of any size initially; if you set the image using the editor it converts it to a 700x480 jpg @ 85% quality)

I really hope Virgil remembers what he said earlier about custom background compression (hint hint ;)). I know there will be a final patch of the map editor (i.e. with Chronom type map generation), so I hope this will be improved as well, because the graphics I created after a lot of work currently get reduced a lot in quality....
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

mopa42

  • Full Member
  • ***
  • Posts: 158
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #17 on: December 12, 2010, 06:09:24 pm »
the graphics I created after a lot of work currently get reduced a lot in quality....
I think I can help.

Here are some more details on custom backgrounds.
You can manually edit the files to avoid the 85% quality restriction on custom backgrounds. First base64-encode your image (in whatever jpeg quality you desire). Make sure that the data isn't broken up into multiple lines, then add it in the XML file like this: <custombackground>/9j/4AAQSkZJRgABAQE....</custombackground>, and finally convert back to .cwm format. Alternately, my cwm_edit.pl program can do this step automatically.

The only caveat is that the map editor will reconvert the custom background to 85% quality whenever you save. So, for a high-quality custom background image, set it manually as the last step in creating your game. (I haven't actually tested submitting a map using this method, but it certainly would work for maps on one's own computer).

UpperKEES

  • Hero Member
  • *****
  • Posts: 5525
  • The Creeper is getting deeper.... into me.
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #18 on: December 12, 2010, 08:08:59 pm »
Oh, great! That's very useful, thanks! :)

I won't be able to run the PERL-script, but won't have a problem doing it manually I guess.
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

Echo51

  • Sr. Member
  • ****
  • Posts: 1139
  • Always lurking in chat, just not always aware
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #19 on: December 14, 2010, 03:49:09 am »
Notepad and other loose tools ftw, eh? ;)
Join the chat! :D
- The only echo present here...

UpperKEES

  • Hero Member
  • *****
  • Posts: 5525
  • The Creeper is getting deeper.... into me.
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #20 on: December 14, 2010, 09:26:09 am »
First base64-encode your image (in whatever jpeg quality you desire). Make sure that the data isn't broken up into multiple lines, then add it in the XML file like this: <custombackground>/9j/4AAQSkZJRgABAQE....</custombackground>, and finally convert back to .cwm format.

I just tried it with a 1.3 MB PNG-file (zero compression). The online base64 encoder froze my browser, just like another online version I tried, but after installing a Firefox base64 encoder as Add-On it worked like a charm.

Notepad and other loose tools ftw, eh? ;)

I actually tried Notepad, but it seems to have some problems with large file sizes, so I used WordPad instead. I replaced the custom image string with the new one and converted the XML file back to CWM format. After copying the map to my customgames folder it loaded without any problems and looks great! 8)

The resulting CWM-file is now 336 KB instead of 104 KB, so nothing to worry about.

Thanks mopa42! :)
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

UpperKEES

  • Hero Member
  • *****
  • Posts: 5525
  • The Creeper is getting deeper.... into me.
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #21 on: December 16, 2010, 03:44:58 am »

Ways to use this knowledge about the custom map format:

  • Easily delete all collectors/mines/totems/...
  • Edit spore waves by hand
  • Set emitter settings to precalculated values (such as stacked emitters whose intensity doubles each minute)
  • Automatically generate a custom background based on the terrain, or vice versa.
  • Create a map with randomly-generated terrain
  • Someone very ambitious with too much extra time could even write their own map editor program, with whatever desired features (circle terrain brush, undo, etc) that the current map editor doesn't yet have.

About the only things I found I could do only by editing the XML by hand:

  • Set the terrain to 0 or 6 (which the game still displays, giving two additional elevations to work with).
  • Set walls to other values than 0, 1, or 1000000 (a 2-value wall survives about twice as long as a 1-value wall; the editor doesn't display it even though the game does).
  • Tweak timing values in smaller increments than tenths of a second.
  • Bypass the 85% custom background compression.


Your latest addition about tweaking timing values can be very useful, especially when you like to use an emitter with a frequency of for instance 6 frames, so only blasters with the fire rate upgrade can synchronize with it, or multiples of 7 to allow blasters without the fire rate upgrade to synchronize.

A few more additions (only possible by hand):

  • Lower or higher entire terrain levels by using find & replace.
  • Shift the entire map a certain amount of blocks up, down, left or right, which can save you quite some time when the terrain is already finished. I wrote a little program to do this for me; just let me know if you need it.
  • The use of intensities higher than 1000 for both spores and emitters.
  • The use of more than 1 decimal for specifying intensities (only useful for very precise tweaking on for instance puzzle maps).
  • The use of negative values for spore intensities which will result in 'soaking sponges'. (This does not work for emitters, because negative creeper doesn't spread.)
  • The use of delays larger than 9999 seconds.

Happy map making! 8)
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

thepenguin

  • Hero Member
  • *****
  • Posts: 3038
  • "What if ..."
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #22 on: December 28, 2010, 09:56:50 am »
XML editing could be a solution to this
We have become the creeper...

Kingo

  • Full Member
  • ***
  • Posts: 460
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #23 on: February 03, 2013, 11:18:07 pm »
I know this thread is old, but this is amazing...
Upperkees told me about it in chat and I believe i'll have to try this sometime :)

Kingo

  • Full Member
  • ***
  • Posts: 460
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #24 on: February 05, 2013, 08:58:09 pm »
I have tried both programs (packzip and offzip) and have tried to use the Command prompt but the system is not taking it.
Is there a program that will work for windows?

UpperKEES

  • Hero Member
  • *****
  • Posts: 5525
  • The Creeper is getting deeper.... into me.
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #25 on: February 05, 2013, 09:29:48 pm »
You have to use offzip from the command line to decompress the CWM-file:

offzip.exe my_map.cwm my_map.xml 0

What version of Windows do you use and what is the error message you get?
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

mopa42

  • Full Member
  • ***
  • Posts: 158
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #26 on: February 06, 2013, 02:24:58 am »
Here's one of the images in the demo screens zip, showing the two commands in action. This might clarify things if you're still having problems.

Kingo

  • Full Member
  • ***
  • Posts: 460
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #27 on: February 06, 2013, 10:21:38 am »
I downloaded both the offzip and packzip, but they don't have those files.
And if I  try to run either .exe, it just runs a line of code through the command prompt and exits before I can see anything. And it does nothing.
I am using windows 7 and I got the "'offzip.exe'" is not a recognized file" type error message from the command prompt.

UpperKEES

  • Hero Member
  • *****
  • Posts: 5525
  • The Creeper is getting deeper.... into me.
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #28 on: February 06, 2013, 10:53:24 am »
I downloaded both the offzip and packzip, but they don't have those files.

Of course you have to replace the file names of the maps with the file names of your maps.

And if I  try to run either .exe, it just runs a line of code through the command prompt and exits before I can see anything. And it does nothing.
I am using windows 7 and I got the "'offzip.exe'" is not a recognized file" type error message from the command prompt.

That's because they are not included in the search path. I recommend you copy those files to the same folder as your CWM files.
Then use the CD (change directory) command at the command prompt to change folders before you execute offzip (or open the command prompt in that folder from the Windows Explorer).
If you don't know how to use CD, you should consider not to mess with your CWM-files anyway.... :P
My CW1 maps: downloads - overview
My CW2 maps: downloads - overview

Kingo

  • Full Member
  • ***
  • Posts: 460
Re: How to edit Creeper World custom map (.cwm) files by hand
« Reply #29 on: February 06, 2013, 06:34:31 pm »
I give up...