Wercator: a BfW map renderer

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

Post Reply
Quensul
Art Contributor
Posts: 303
Joined: January 2nd, 2005, 1:06 am
Location: Pittsburgh, PA

Wercator: a BfW map renderer

Post by Quensul »

EDIT: I will be maintaining the latest version and examples as attachments to this post so no one will accidentally download an outdated copy. The current Wercator version is 0.4. Due to the limits on attachment size, I have uploaded a fully functional version without the new textures. See the downloads section of the Wercator website for a complete tarball, as well as just the texture images. The textures speed up Wercator and allow for much niftier parchments. The website also includes WWWercator, a web interface to the latest version of Wercator for those without Gimp or Gimp-Perl. Discussion of the latest version is further down the thread; what follows is my original post.

I've been working on a campaign for a while now, and found that a high level map of "my" corner of the world would be quite useful, similar to the map used between scenarios in HttT and other campaigns. Unfortunately, my artistic skills hover between "horrible" and "abysmal", so I whipped up a Gimp plugin to convert standard Battle for Wesnoth maps into line drawings usable for campaign graphics, letting me use the map editor to generate these. It took a bit longer than I expected, but here it is - it still needs a bit of work, but I would appreciate any feedback. Hopefully this may be of use to other campaign developers out there. I've attached the tarball and a couple example images (these haven't been touched up at all) - one of a test map I was using, and one of Blackwater Port from HttT.

Requirements:
Gimp, the Gimp Perl module, and Perl. Wercator is known to work with Gimp 2.0.6 and Perl 5.8.4 (a.k.a. Debian Testing), as well as Gimp 2.2.2 and Perl 5.8.6 (Fedora Core 3). In its current state it will not work with Gimp 1.2. Please let me know if it does/doesn't work on your system.

Installation:
1. Move the archive to your plugins directory (default: ~/gimp-2.0/plug-ins/ or ~/gimp-2.2/plug-ins).
2. Untar it.
3. Start Gimp - the plugin is in Xtns->Script Fu->Utils->Wercator (from the tool palette window's menu).
4. Be sure the paintbrush tool is selected before running Wercator; I haven't been able to change the tool from the plugin script (despite painting with an explicit paintbrush call), so roads and waterways will render incorrectly if a drawing tool other than the paintbrush is selected.

Known limitations are listed in the help for the plugin; most notably, chokepoints in waterways aren't always painted correctly yet. I'm working on this, and should have it fixed in a week or so. I could also use some advice on how to create a better aged parchment effect, if anyone with stronger Gimp fu than I has any ideas.

If Wercator does something funny, please let me know (and provide the mapfile that is causing trouble) so I can fix it. :-)

Finally, the brushes I use for much of the "static" terrain (mountains, hills, forest, cities, etc.) started life as part of the HttT map, but I don't know who drew it - can anyone clue me in so I can ask permission and properly give credit?

Hope this is helpful!

EDIT: I wasn't sure if this belonged here or in Art Development; moderators, please go ahead and move it if you think it should be elsewhere. :-)
Attachments
wercator-0.4-no-textures.tar.gz
Wercator itself Untar this within your Gimp plugins directory.
(127.04 KiB) Downloaded 554 times
Rendered version of On The Road Again, from an unpublished campaign by Quensul.
Rendered version of On The Road Again, from an unpublished campaign by Quensul.
On_The_Road_Again.jpg (150.29 KiB) Viewed 26422 times
The Ultra Official Wercator Logo (tm). ;-)
The Ultra Official Wercator Logo (tm). ;-)
werc.jpg (48.89 KiB) Viewed 26417 times
Last edited by Quensul on March 21st, 2005, 12:41 am, edited 5 times in total.
Author of Wercator
ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Post by ott »

Very nice. Good work!
Shade
Posts: 1111
Joined: April 18th, 2004, 11:17 pm

Wow, this is neat

Post by Shade »

Wow, this is neat... Cool...
Note to forum users: You are in a maze of twisty little passages
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

A fantastic tool! Maybe you should run it on the Saving Elensefar map of the Wesnoth coast, and compare that result to the standard campaign maps...

One thing I notice on the blackwater map is that for some reason, the two nonplayer castles are represented by a small castle icon, while the encampment where the player starts is represented by a heap of seven castle icons. That doesn't seem quite right. Maybe you could have three differently scaled castle brushes and use them depending on the number of castle hexes. Probably encampments don't need to be represented on the map at all....

Also I'm not quite sure but some mountains look like their peak has been cut off.

Great work! I will download it and try it with Gimp 1.2 which is what I have, and report back.
Rhuvaen
Inactive Developer
Posts: 1272
Joined: August 27th, 2004, 8:05 am
Location: Berlin, Germany

Post by Rhuvaen »

Rhuvaen wrote:I will download it and try it with Gimp 1.2 which is what I have, and report back.
Hrm, tried to install the Perl module, but the scripted configure doesn't work on my system. Sorry, I'm not going to try again before I install gimp 2.x sometime...
freim
Retired Terrain Art Director
Posts: 1113
Joined: November 29th, 2003, 11:40 pm
Location: Norway

Post by freim »

This was really cool. I have the same comment as Rhuvaen about the mountains and castle/encampment. I think encampments should be indicated though.

Rhuvaen: I recommend updating to gimp 2.x if you can, it's vastly superior in every way to gimp 1.2 imo.
Quensul
Art Contributor
Posts: 303
Joined: January 2nd, 2005, 1:06 am
Location: Pittsburgh, PA

Post by Quensul »

Rhuvaen wrote: Hrm, tried to install the Perl module, but the scripted configure doesn't work on my system. Sorry, I'm not going to try again before I install gimp 2.x sometime...
Hmm... not sure what you mean by the scripted configure; all you need to do is put the files from the tarball in your plugins directory and restart Gimp. Of course, it could just not work with Gimp 1.2. :-)

Yeah, I spent most of my time getting the river/road painting working right, and missed a couple tiling issues. I'll fix the mountain tile - I know which one you're thinking of. As for encampments, that was a silly bug - the intention was to paint the keep, and ignore the rest of the castle/encampment tiles. I'll take a look at counting attached castle hexes and scaling the size of the city icon, but that may end up looking funny.
aelius
Posts: 497
Joined: August 30th, 2004, 8:07 pm
Location: Virginia, USA

Post by aelius »

I'd love to be able to use this, as my art skills are completely non-existent. I'm running Mac OS X.3.7. I downloaded X11, which is the windowing environment that allowes GIMP to run. I downloaded Gimp 2.2. I downloaded Wercator. I put Wercator in my GIMP plug-ins folder.

No Wercator shows up in GIMP. Clearly, I've missed a crucial step somewhere. Anybody have an idea what it might be?

- b.
Quensul
Art Contributor
Posts: 303
Joined: January 2nd, 2005, 1:06 am
Location: Pittsburgh, PA

Post by Quensul »

aelius wrote: No Wercator shows up in GIMP. Clearly, I've missed a crucial step somewhere. Anybody have an idea what it might be?
Hmm. It should pick it up automatically on startup. One thing: are you looking in the Xtns->Script Fu->Utils menu attached to the tool palette window (the "main" window)? It doesn't show up in the menus for a particular image's window because it generates images, rather than modifying an existing image. It's a little weird, but it's how Gimp organizes things...

My wife has OS X.3.something; I'll give this a spin tonight and see if I can duplicate the problem.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Does it work with 0.2.2? Installed it as listed, but its not in the utils list...


more specificically, this is the error output from console:

Code: Select all

Can't locate Gimp.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /home/joe/.gimp-2.2/plug-ins/wercator.pl line 18.
BEGIN failed--compilation aborted at /home/joe/.gimp-2.2/plug-ins/wercator.pl line 18.

(gimp-2.2:9590): LibGimpBase-WARNING **: gimp-2.2: wire_read(): error
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

I'm not sure what anyone can say to this but cool! :shock: Great work :)

Now I just have to see if I can get it working on my version of Gimp :)

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
Quensul
Art Contributor
Posts: 303
Joined: January 2nd, 2005, 1:06 am
Location: Pittsburgh, PA

Post by Quensul »

turin wrote:Does it work with 0.2.2? Installed it as listed, but its not in the utils list...

more specificically, this is the error output from console:

Code: Select all

Can't locate Gimp.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /home/joe/.gimp-2.2/plug-ins/wercator.pl line 18.
BEGIN failed--compilation aborted at /home/joe/.gimp-2.2/plug-ins/wercator.pl line 18.

(gimp-2.2:9590): LibGimpBase-WARNING **: gimp-2.2: wire_read(): error
I assume you mean Gimp 2.2.2... It's failing to find the Gimp perl module - this is separate from Gimp itself. In Debian, it's the libgimp-perl package (doesn't look like it's been packaged in Fink yet, as far as I can tell). It's available on CPAN at: http://search.cpan.org/~sjburges/Gimp-2.0/ . CPAN directions are at http://www.cpan.org/modules/INSTALL.html. If you have the CPAN module installed on Linux (and maybe OS X), I highly recommend it - 'perl -MCPAN -e shell', then 'install Gimp-2.0' (might be 'install Gimp', I'm not positive).

aelius, perhaps you're having the same problem - could you run Gimp from an xterm and let us know if anything odd is printed out?
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

Any possibility of this becoming standalone for people (like myself) who don't have GIMP?
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
Quensul
Art Contributor
Posts: 303
Joined: January 2nd, 2005, 1:06 am
Location: Pittsburgh, PA

Post by Quensul »

MadMax wrote:Any possibility of this becoming standalone for people (like myself) who don't have GIMP?
I'm afraid it's unlikely, unless someone is feeling the urge to convert the 1720 lines of Perl to use some other graphics engine - all the graphics operations are calls into the Gimp procedural database. I originally was using ImageMagick, but I really needed paths to do rivers and roads right (plus adding each tile via a separate 'convert' call was reaaaaalllly slow!). I may try to convert this to a Photoshop plugin at some point, but realistically the probability of that is very low, I'm afraid.

If anyone is interested in converting this, I'd be more than happy to answer any questions.

Alternatively, binary builds of the Gimp are available for many platforms (http://www.gimp.org/downloads/).
aelius
Posts: 497
Joined: August 30th, 2004, 8:07 pm
Location: Virginia, USA

Post by aelius »

My console says this (which I'm helpless to decipher):

Code: Select all

The domain/default pair of (.GlobalPreferences, AppleCollationOrder) does not exist
Can't locate Gimp.pm in @INC (@INC contains: /System/Library/Perl/5.8.1/darwin-thread-multi-2level /System/Library/Perl/5.8.1 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1 /Library/Perl /Network/Library/Perl/5.8.1/darwin-thread-multi-2level /Network/Library/Perl/5.8.1 /Network/Library/Perl .) at /Users/wcarey/.gimp-2.2/plug-ins/wercator.pl line 18.
BEGIN failed--compilation aborted at /Users/wcarey/.gimp-2.2/plug-ins/wercator.pl line 18.
Post Reply