![]() |
Creating a fake map image file
Calling all technical types.
I would like people to be able to upload their own maps to the LlamaServer. However, I'd rather they didn't have to upload the images as well, since they are often large. It occurred to me that the images are surely fairly pointless - the server doesn't have to see the prettiness of the map. So I was hoping to set it up so that only the .map file need be uploaded. However, you can't actually start a game without the map image present (it gets angry). So, I decided to write a program to create a fake image file, containing only a row of white pixels with as many pixels as there are provinces listed in the .map file. Ingenious, I thought. Unfortunately, it turns out that Dominions isn't happy with such an image file. On trying to create a test game, it said: N�got gick fel! can't find a valid starting province N�got gick fel! can't find a valid starting province Aborted So, my question is: what other features of the image file do we think Dominions needs? Do I need to space out the white pixels somehow? I'm at a bit of a loss, being as I don't know what Dominions actually does with the image file. Hope someone has some ideas! Thanks, llama |
Re: Creating a fake map image file
well no idea but just try to space them with a green pixel http://forum.shrapnelgames.com/images/smilies/laugh.gif
|
Re: Creating a fake map image file
Okay, I think I may have fixed it. I created a file like this:
RRRRRRRRRRRRR RWRWRWRWRWRWR RRRRRRRRRRRRR where W is white and R is dark red, and it didn't complain. I'll do a bit of testing to see if there are any side effects, but if not this is going to be super awesome. |
Re: Creating a fake map image file
This is also quite exciting because trying to work out the .tga file format was the first ever time I've had a go at hex editing. Turned out, unsurprisingly I guess, to be quite easy.
|
Re: Creating a fake map image file
Love the concept but I dont think its going to work.
I tried copying a random maps RGB over another random map of the same size and starting a server game. My machine had the map that the .map said was being used so no transmitting was done. But the result the old map, with very strange placements of flags. I didnt think that the host needed the graphic file either but apparently it does use it for something. |
Re: Creating a fake map image file
Bugger. Looks like you're right Gandalf.
Hmm, I think that's game over for that plan. What a shame. |
Re: Creating a fake map image file
/me gives llama a hug and an A for effort
|
Re: Creating a fake map image file
You might offer a number of different well-chosen maps from the various map generators, and support players creating their own .map files to go with them. Thats the only thing I can think of.
|
Re: Creating a fake map image file
http://forum.shrapnelgames.com/images/smilies/happy.gif Thanks Aezeal!
Gandalf - yeah, I think that's the best plan really. Maybe down the line I could allow upload of whole map images, but there's the potential for problems there. Not least is the fact that the LlamaServer's web server is provided by a volunteer student group, so I want to leave as small a bandwidth footprint on it as possible. |
Re: Creating a fake map image file
1 Attachment(s)
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. I have attached a "minimized" version of the silent seas map image. The file size goes from 2787 KB to 50 KB. If you are able to automate zip file decompression as well, have the user or your distributed application zip the resulting "minimized" image and it will squeeze down to 2 KB. I have not tested the map image in game yet, but I see no reason why it should not work. I have attached it to this post for anyone who wants to try it out. Hope this helps! |
Re: Creating a fake map image file
Ha, that is a very cool idea Ballbarian! I may very well end up using that.
|
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. |
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.
|
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:
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:
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. |
Re: Creating a fake map image file
Quote:
Quote:
|
Re: Creating a fake map image file
Quote:
Quote:
|
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. |
Re: Creating a fake map image file
Quote:
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. http://forum.shrapnelgames.com/images/smilies/frown.gif |
Re: Creating a fake map image file
Quote:
Quote:
|
All times are GMT -4. The time now is 09:51 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.