Sillysoft
Steam users, please help Greenlight Lux Delux!
Sillysoft Forums
Forums Of Universal Domination 
Games
About - FAQ
Download - Buy
Lux Delux
Maps - Rankings
Download - Buy
Castle Vox
Maps - Rankings
Download - Buy
Forums
Join the Forums
Log in - Memberlist
  RSS feeds  
Art - Wiki
News - Search
Getting my feet wet

 
Post new topic   Reply to topic    Sillysoft Games Forum Index -> Lux Maps
View previous topic :: View next topic  
Author Message
cyanshade
Lux Newbie


Joined: 03 Aug 2004
Posts: 106
Location: Finland

PostPosted: Tue Aug 03, 2004 8:48 am    Post subject: Getting my feet wet Reply with quote

Greetings fellow luxers,

I've recently registered my copy of Lux and some of you may remember me from the few dozen games I've played. *waves*

Browsing through this section of the forum, it's obvious that making a valid, let alone successful, map is not an easy task. That's why I decided to try my hand at it. Yes, I like a challenge.

Since I have access to Photoshop and ImageReady, I plan to use them for the initial stages. I've prepared a 5737 by 4736 pixel image representing the southern parts of Finland as seen in the year 1898.

Cropped and scaled down to a manageable size, the final map is expected to take up about 1000x735 pixels of screen real estate. These figures are subject to change, and feedback on the recommended size is appreciated.

Using the aforementioned image as a background, I'll draw superimposed layers of desired country/continent borders on top. Once finished, I'll hide the background layer and open the project in ImageReady.

Now, using ImageReady's magic wand and imagemap creation tools, I'll be able to convert the countries into polygons and ultimately export the whole lot as a HTML file.

Finally, a Perl script will process the HTML and spit out valid XML <country>...</country> blocks with <name> and <polygon> tags inside, complete with optional Y-axis flipping (to remove the need to flip the image in the first place) and coordinate scaling (for fine tuning).

If the project comes to fruition, I'm planning to release the Perl script, so everybody may use it to convert imagemaps to Lux XML.

Comments?
Back to top
View user's profile Send private message Visit poster's website View cyanshade's ranking
dustin
Lux Admin
Lux Admin


Joined: 15 May 2003
Posts: 9124
Location: Vancouver

PostPosted: Tue Aug 03, 2004 9:39 am    Post subject: Reply with quote

Sounds like a good plan.

You should be aware that most people (like me) have no connection to Finland. This means that a map of it will not get any 'emotional bonus points' from people. That's not to say that it won't be cool, just that I have no idea what it is going to look like.

Also, you might want to consider going through your process with a simple map to start with just to try it out.
Back to top
View user's profile Send private message Send e-mail Visit poster's website View dustin's ranking
Kef
Lux Translator


Joined: 24 Feb 2004
Posts: 4480
Location: in j0r f0rumz, Tr0||in j0r t0pixzz

PostPosted: Tue Aug 03, 2004 3:50 pm    Post subject: Reply with quote

perl is a pretty cool way to do it, and I'm sure that that app will be cool. You could find someone that makes cocoa out of it
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger View Kef's ranking
cyanshade
Lux Newbie


Joined: 03 Aug 2004
Posts: 106
Location: Finland

PostPosted: Tue Aug 03, 2004 7:38 pm    Post subject: Making progress Reply with quote

It's official: ImageReady's auto-polygon tool sucks rotten whale meat through a straw. I had to resort to clickety-clicking the vertices by hand, but fortunately that's about the only laborious part of the project.

The Perl script is working satisfactorily. Feeding it the HTML from ImageReady yields the following XML tags:

    - <width> and <height> derived from the image size
    - each imagemap polygon becomes a <country> with:

      - <id> from the href attribute in ImageReady
      - <name> from the alt attribute
      - <polygon> from the imagemap vertices, flipped automatically
      - <armylocation> centred on the polygon (using bounding box, so not perfect, but usable)


For obvious reasons, all countries go in a single <continent> block, so the continents have to be established by editing the XML further. The same goes with the <adjoining> tags.

Now that the script works, I'll try to create something more elaborate than test maps. Stay tuned.
Back to top
View user's profile Send private message Visit poster's website View cyanshade's ranking
rob
Lux Addict


Joined: 01 Apr 2004
Posts: 593

PostPosted: Thu Aug 05, 2004 1:31 am    Post subject: Reply with quote

Finland matters.

go to the Upper Peninsula of Michigan.
or check out Oulu and Waino Wisconsin

sisu
Back to top
View user's profile Send private message View rob's ranking
cyanshade
Lux Newbie


Joined: 03 Aug 2004
Posts: 106
Location: Finland

PostPosted: Thu Aug 05, 2004 12:09 pm    Post subject: html2lux -- initial public release Reply with quote

The Perl script responsible for the <country> tags in my first map, GodStorm, is ready for public release for all the map makers out there. The script automagically converts Adobe ImageReady XHTML output to a Lux XML map.

html2lux v0.3 can be downloaded from http://leela.homelinux.net/lux/

Since it's Perl, you'll need perl to run it. Fortunately, Mac OS X comes with perl, so you're good to go. Other platforms able to run perl may work, but you'll need the POSIX libraries. AFAIK windoze ain't POSIX compatible.

There are some instructions included in the opening comments, i.e. how to configure Adobe ImageReady for correct output, the command line switches available, and so forth.

To try it out, create a simple test map in ImageReady, export it as XHTML, and run html2lux like this:

perl html2lux your_test_map.html > test_map.luxb


Last edited by dustin on Fri Nov 24, 2006 4:16 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website View cyanshade's ranking
dustin
Lux Admin
Lux Admin


Joined: 15 May 2003
Posts: 9124
Location: Vancouver

PostPosted: Thu Aug 05, 2004 12:16 pm    Post subject: Reply with quote

Cool tool.

Is that a stable webserver (i.e. always on)? If so I will put a link to that script from the map-making page. If not I can put a copy of it hosted here on sillysoft.
Back to top
View user's profile Send private message Send e-mail Visit poster's website View dustin's ranking
cyanshade
Lux Newbie


Joined: 03 Aug 2004
Posts: 106
Location: Finland

PostPosted: Thu Aug 05, 2004 12:24 pm    Post subject: New URL Reply with quote

I've relocated html2lux at http://leela.homelinux.net/lux/

The earlier address is my OS X box, so it may not be always on. Use the above URL for future releases. There may be new features on the line...
Back to top
View user's profile Send private message Visit poster's website View cyanshade's ranking
cyanshade
Lux Newbie


Joined: 03 Aug 2004
Posts: 106
Location: Finland

PostPosted: Fri Aug 06, 2004 7:29 am    Post subject: New & Improved Reply with quote

Was bored at work, so I improved html2lux a bit. Because the bounding box method for finding the centre point of each land didn't work very well, I've replaced the function with a much better one.

Now the centroid (centre of mass) of each polygon is calculated and used as <armylocation>. It's surprisingly robust, to the point that you seldom have to tweak the placement by hand.

I've updated the copy at http://leela.homelinux.net/lux/
Back to top
View user's profile Send private message Visit poster's website View cyanshade's ranking
rip
Lux Newbie


Joined: 31 Mar 2004
Posts: 353
Location: Vienna Austria

PostPosted: Fri Aug 06, 2004 7:46 am    Post subject: Re: New & Improved Reply with quote

cyanshade wrote:
Was bored at work, so I improved html2lux a bit. Because the bounding box method for finding the centre point of each land didn't work very well, I've replaced the function with a much better one.

Now the centroid (centre of mass) of each polygon is calculated and used as <armylocation>. It's surprisingly robust, to the point that you seldom have to tweak the placement by hand.

I've updated the copy at http://leela.homelinux.net/lux/


Do you mind if I snarf your area/centre subs? Gemisys.pl (random map generator, available in the plugins) has that same issue...and sounds like your method is much more generic than what I ended up using (since my polys are 'well formed' in the general case (they are all four or five point polygons and don't generally double back or cross-over themselves), I simply compute the average x, average y and use that.

rip
Back to top
View user's profile Send private message Visit poster's website View rip's ranking
cyanshade
Lux Newbie


Joined: 03 Aug 2004
Posts: 106
Location: Finland

PostPosted: Fri Aug 06, 2004 8:26 am    Post subject: Re: New & Improved Reply with quote

Quote:
Do you mind if I snarf your area/centre subs? Gemisys.pl (random map generator, available in the plugins) has that same issue...and sounds like your method is much more generic than what I ended up using (since my polys are 'well formed' in the general case (they are all four or five point polygons and don't generally double back or cross-over themselves), I simply compute the average x, average y and use that.


I don't mind. I found the algorithm on some visual basic site and recreated it in Perl, so can't really take credit for it in the first place. I hope you'll find it useful.
Back to top
View user's profile Send private message Visit poster's website View cyanshade's ranking
yi3artist
Lux Newbie


Joined: 01 Mar 2005
Posts: 68
Location: Texas

PostPosted: Fri May 25, 2007 10:56 am    Post subject: Could someone upload the perl script again? Reply with quote

I have begun working on a large map in Illustrator and the pdf to excel to xml process, but I keep botching it up.

Is it possible for someone to re-upload this mythical perl script I read about on so many threads?


Last edited by yi3artist on Fri May 25, 2007 11:00 am; edited 1 time in total
Back to top
View user's profile Send private message View yi3artist's ranking
dustin
Lux Admin
Lux Admin


Joined: 15 May 2003
Posts: 9124
Location: Vancouver

PostPosted: Fri May 25, 2007 3:59 pm    Post subject: Reply with quote

Here's a link to the perl script:

http://leela.homelinux.net/lux/html2lux
Back to top
View user's profile Send private message Send e-mail Visit poster's website View dustin's ranking
blackj3sus
Lux Messiah


Joined: 05 May 2006
Posts: 3206
Location: sillysoft.net/roman-battles

PostPosted: Fri May 25, 2007 4:47 pm    Post subject: Reply with quote

u guys are makin my head hurt... Confused
Back to top
View user's profile Send private message Visit poster's website View blackj3sus's ranking
yi3artist
Lux Newbie


Joined: 01 Mar 2005
Posts: 68
Location: Texas

PostPosted: Sat May 26, 2007 5:56 am    Post subject: Wacky Chinese Internet Reply with quote

Ah! So that link is still working. Crap. I'll explain: My being in China prevents certain sites from loading for absolutely unexplainable reasons. And homelinux.net happens to be one of them. I checked and I can't access any site under that server Sad

Is it possible for the file to be hosted on sillysoft.net itself, or perhaps for someone to email it to me?


Last edited by yi3artist on Sat May 26, 2007 6:15 am; edited 3 times in total
Back to top
View user's profile Send private message View yi3artist's ranking
Preacherman
Semi-Holy Priest


Joined: 24 Feb 2004
Posts: 4513
Location: Sweden (capital of Denmark, an island in Norway, southern Europe)

PostPosted: Sat May 26, 2007 10:09 am    Post subject: Reply with quote

I've emailed the .pl file to you.
Back to top
View user's profile Send private message Send e-mail Visit poster's website View Preacherman's ranking
yi3artist
Lux Newbie


Joined: 01 Mar 2005
Posts: 68
Location: Texas

PostPosted: Sat May 26, 2007 8:36 pm    Post subject: :) Reply with quote

You are a good man. Thank you.
Back to top
View user's profile Send private message View yi3artist's ranking
Sylocat
Lux Veteran


Joined: 11 Sep 2006
Posts: 1404
Location: Wisconsin

PostPosted: Sat May 26, 2007 9:48 pm    Post subject: Reply with quote

yi3artist, where have you been for 2 years? Your profile shows you joined up in March of 2005, made one post on your first day and haven't been on the forums since until this thread began. Shocked Shocked Shocked Shocked

Last edited by Sylocat on Sat May 26, 2007 9:48 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger View Sylocat's ranking
yi3artist
Lux Newbie


Joined: 01 Mar 2005
Posts: 68
Location: Texas

PostPosted: Sun May 27, 2007 7:50 pm    Post subject: PHP Script in the Works Reply with quote

Sylocat, I've been away from home in a foreign country for two years travelling and studying. I've recently started playing Lux again, and finally have the patience to make a map. I appreciate your concern.

I did receive the file, only to realize I don't have ImageReady. No matter. From my first post on this thread, I had began to build my map with Illustrator and wrote a PHP file to convert an exported uncompressed PDF into XML data (in case the Perl script wasn't what I need). Well, the PHP file works (on my PDFs at least) and I'll share it once I make it more user-friendly, so that I can get some feedback and find bugs.
Back to top
View user's profile Send private message View yi3artist's ranking
Display posts from previous:   
Post new topic   Reply to topic    Sillysoft Games Forum Index -> Lux Maps All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Meowzers Action Cats is our newest feline fun mobile game. Romp with cute cats on your phone and tablet.

Castle Vox is a simultaneous-turns team strategy boardgame. Diplomacy meets Axis & Allies game.

Lux Delux is an advanced Risk world domination game with over 800 maps, hard AI, and online multi-player.

American History Lux takes you through the wars of USA history. — Ancient Empires Lux spans Babylon to the Roman Empire.

Lux Touch, Lux USA and Lux DLX let you conquer the world on your iPhone, iPod, and iPad.

Sillysoft makes games for Mac OS X, Windows XP/Vista/7 and Linux. Also mobile games for iPhones, iPads, and iPod Touch.

Macintosh users may be interested to see our favorite Mac OS X games. For the full Sillysoft empire check out the sitemap.

Because taking over the world is fun.
                                 - Lux