|
|
|
|
|
July 20th, 2008, 05:17 AM
|
National Security Advisor
|
|
Join Date: Nov 2006
Location: Oxford, UK
Posts: 5,921
Thanks: 194
Thanked 855 Times in 291 Posts
|
|
Re: Creating a fake map image file
Ha, that is a very cool idea Ballbarian! I may very well end up using that.
|
July 20th, 2008, 04:29 PM
|
|
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: Creating a fake map image file
Hmmmm I was working on a command-line to the fantastic ImageMagick tools to do that. Or maybe a ghost-script to GIMP.
The purpose was actually to turn a map into one with just borders and pixels that could be used as an online view to have the national colors automatically filled into the provinces to show game progression. But I can see a use here also.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
|
July 20th, 2008, 04:48 PM
|
National Security Advisor
|
|
Join Date: Nov 2006
Location: Oxford, UK
Posts: 5,921
Thanks: 194
Thanked 855 Times in 291 Posts
|
|
Re: Creating a fake map image file
Oh wow Gandalf, if you could whip that up for me that would be really amazing. I was thinking about how to carry out Ballbarian's suggestion but had just about decided to give up because I couldn't face learning the necessary skills to modify the map.
|
July 21st, 2008, 01:58 PM
|
|
General
|
|
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
|
|
Re: Creating a fake map image file
I'm really surprised to hear that putting random white pixels into a map image doesn't work. What exactly is going haywire with that approach? Anybody care to give me an example?
Quote:
Ballbarian said:
Try this llamabeast:
Create a cross-platform program that your users can download (or run from a browser) that will change every pixel to black except for the pure white province markers. Then have them upload the resulting image.
|
Another possibility would be to do this on the client side when they want to upload the image. Here are links to open source file upload applets in Java which you might be able to vandalize to add the desired functionality:
http://sourceforge.net/project/showf...group_id=59144
http://www.aasted.org/ (don't let the name "Coppermine java image uploader" scare you away, it's probably easier to get it working even without a Coppermine gallery installed than to implement an image uploading applet from scratch)
Quote:
Gandalf Parker said:
Hmmmm I was working on a command-line to the fantastic ImageMagick tools to do that. Or maybe a ghost-script to GIMP.
|
I certainly don't want to curb your enthusiasm, but while it's very powerful in terms of functions that it offers, I've found out that ImageMagick or at least its bindings through PythonMagick is an awful sluggish piece of *bleep*.
I could give you something in Python which does this in PIL, that would be about 5 lines of code. Somebody actually even asked exactly for this a couple of weeks ago on the image-sig mailing list. You could even chose to build binaries for any platforms you'd wish to support with that. But speaking from experience, if the process is too complicated, like this sounds, I'd say that people wouldn't bother to use it.
|
July 21st, 2008, 02:26 PM
|
National Security Advisor
|
|
Join Date: Nov 2006
Location: Oxford, UK
Posts: 5,921
Thanks: 194
Thanked 855 Times in 291 Posts
|
|
Re: Creating a fake map image file
Quote:
I'm really surprised to hear that putting random white pixels into a map image doesn't work. What exactly is going haywire with that approach? Anybody care to give me an example?
|
I was surprised too. The server seems to include the province positions in the trn file, oddly. So all the provinces end up cluster together in one corner of the map once you look at the trn file at the client end.
Quote:
Another possibility would be to do this on the client side when they want to upload the image.
|
Okay, web stuff is very far from being my forte. What's the idea here? The computer at the client end runs the program contained within the web page to alter the map image before it's uploaded, so that the actual data uploaded is already altered and hence small? Or something different?
|
July 21st, 2008, 02:32 PM
|
|
General
|
|
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
|
|
Re: Creating a fake map image file
Quote:
llamabeast said:
The server seems to include the province positions in the trn file, oddly. So all the provinces end up cluster together in one corner of the map once you look at the trn file at the client end.
|
Wow, that's really odd.
Quote:
llamabeast said:
Okay, web stuff is very far from being my forte. What's the idea here? The computer at the client end runs the program contained within the web page to alter the map image before it's uploaded, so that the actual data uploaded is already altered and hence small? Or something different?
|
Yes, exactly that. If you use a Java applet the idea would be to do the white-pixel-filtering on the client side. You could do it in ActiveX for MSIE, but Java is more portable. And while Java applets were bringing browsers to a grinding halt about 10 years ago, they're quite fast and usable now.
|
July 21st, 2008, 02:36 PM
|
National Security Advisor
|
|
Join Date: Nov 2006
Location: Oxford, UK
Posts: 5,921
Thanks: 194
Thanked 855 Times in 291 Posts
|
|
Re: Creating a fake map image file
Okay lovely. I think what I will do is see how much demand there is for it, and if there's much I'll look into it. Do you think it would take me long to figure out? Given zero knowledge of javascript but lots of general programming experience.
I'm about to make the game creation process on my server fully automated, so that I don't have to get involved any more - I've been coding like crazy for the last week and a half or so. I'm going to provide as big a choice of ready-made maps as I can, and also I've included the option for people to upload their own .map files for map images the server already has. But I'm not sure how desperate they'd be to be able to provide new images.
The plan is to make it so I can just not think about the server for months at a time without anyone having problems. What with my PhD writeup coming up soon, I think that would definitely be a good thing.
|
July 21st, 2008, 02:36 PM
|
|
Colonel
|
|
Join Date: May 2005
Location: Kansas, USA
Posts: 1,538
Thanks: 289
Thanked 194 Times in 94 Posts
|
|
Re: Creating a fake map image file
Quote:
The computer at the client end runs the program contained within the web page to alter the map image before it's uploaded, so that the actual data uploaded is already altered and hence small?
|
That is what I initially envisioned when I suggested something that could run from a browser. Not much point in running it on the server since the whole point is to keep a small bandwidth footprint.
Web development is not my forte either. I could slap together a VB program to generate the basic map, but that would only work for windows users and a few others who are set up to run it in a shell (or however they have been managing it). The conversion is pretty simple. I wish that I could just "record a macro" in Gimp. That would be the simplest, but if it is possible, I have no idea how. I only glanced at script-fu, but I just don't have time or energy to devote to figuring that out right now.
|
July 21st, 2008, 02:47 PM
|
|
General
|
|
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
|
|
Re: Creating a fake map image file
Quote:
llamabeast said:
Okay lovely. I think what I will do is see how much demand there is for it, and if there's much I'll look into it. Do you think it would take me long to figure out? Given zero knowledge of javascript but lots of general programming experience.
|
Java and JavaScript have nothing in common except for the name, which was picked for marketing reasons. Java is a full-blown programming language which is quite often taught in school and college when it comes to object-oriented programming. You'll have to get your hands dirty with imaging in Java, but if you're experienced in OOP and you use the links that I provided before as a base, you might come up with something in a reasonable time. I'd have to start at about the same as you would, so I'm not much help.
Quote:
llamabeast said:
I'm about to make the game creation process on my server fully automated, so that I don't have to get involved any more - I've been coding like crazy for the last week and a half or so. I'm going to provide as big a choice of ready-made maps as I can, and also I've included the option for people to upload their own .map files for map images the server already has. But I'm not sure how desperate they'd be to be able to provide new images.
|
As I've said many times before, that's about my oldest dream that I want to realize too, a fully web-customizable automated Dom3 server. Hasn't happened yet, though. Would be interesting to see what you come up with as a reference.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|