PDA

View Full Version : MapTweaker Utility Beta release


DrAlimentado
01-01-2004, 20:44
[edit 18/1/04 : version 0.9b added]
[edit 3/1/04 : updated readme]

Here is a beta version of my map tweaking app.

New version 0.9b:icon_paperclip.gif MapTweaker0.9b.zip (http://www.civ3duelzone.com/forum/uploaded/DrAlimentado/200411814740_MapTweaker0.9b.zip)
197.87*KB



Old version: icon_paperclip.gif MapTweaker0.8b.zip (http://www.civ3duelzone.com/forum/uploaded/DrAlimentado/200413142751_MapTweaker0.8b.zip)
171.39*KB



It needs this DLL (in the same folder as the exe) to function properley:

Download Attachment: /forum/icon_paperclip.gif FreeImageDLL.zip (http://www.danwilliamson.net/forum/uploaded/DrAlimentado/200311303014_FreeImageDLL.zip)



And you need the .NET 1.1b runtimes as well (get it from microwhore here;)

.NET 1.1b Runtimes (http://www.microsoft.com/downloads/details.aspx?FamilyID=262d25e3-f589-4842-8157-034d1e7cf3a3&displaylang=en)


Here's the readme:
-----------------------------------------------



Overview:
-------------------
This is a 'very beta' release of my MapMaking tool. It is a MDI (multiple document interface) application that can load and display uncompressed bic/bix/biq files, perform various operations and save the changed data to a bic/bix/biq again. As it dosen't actually do real 'map-making' yet this beta version is more appropriately called MapTweaker. :)

Current features are copy and paste functionality, map resizing and nudging, resizeable minimap, painting terrain/resources, and analysis stats dialog.


What you need to run MapTweaker:
--------------------------------------------------------
This utility was made with .NET and as such requires the .NET 1.1 runtime. You can download it from microsoft at this url: http://www.microsoft.com/downloads/details.aspx?FamilyID=262d25e3-f589-4842-8157-034d1e7cf3a3&displaylang=en

In order to read pcx files (only used for resources.pcx in this current form) I have used a dll called FreeImage.dll, it is a 'free source' dll released under a GNU General Public Licence. The documentation for this can be found in it's zip. It needs to be placed in the same directory as the MapMaker.exe. At some point I will eliminate the need for a 600k dll by writing a couple of k of code to do the pcx reading manually... call me lazy for the moment. [Dianthus from CFC has kindly given me his C++ source for reading pcx files, I have a crack team converting it to vb.net... watch this space!]



Installation:
---------------------
Just unzip the MapMaker.exe and FreeImage.dll into your main Civilisation III folder. You can optionally unzip them into another folder anywhere you like and the first time you run the app you will be prompted to manually set the location of the Civilisation III folder.
MapMaker makes no registry entries on your computer and can be uninstalled by simply deleting the exe.



Limitations and workarounds:
-----------------------------------------------
The Map gfx are just a simple representation of the actual tiles, this keeps the loading and displaying of gfx fast. I may yet add an in-game gfx window that will display the map as it would be seen in civ3 when I get the directx sdk going... but I have a ton of other features I want to add first!

The utility in it's current state does little to nothing with the image data in each tile. This means that when you perform operations that move tiles around the map the edges of the changed areas will appear pretty screwy when you load the bix in civ3edit - however the underlying data is correct. To get the correct image data again reload the changed bix into civ3XEdit and paint (change) a tile where it is screwed up and civ3edit will readjust the image(s) appropriately. Eventually I'll get round to figuring out the patterns for this too.
It is important to reload a changed bix into civ3XEdit to allow it to readjust the resource and continent counts also.

You should only use basic maps with this version of MapTweaker - if you have cities or units placed on the map and change the tiles they are sitting on it will cause unpredictable behaviour. You can export and import the basic map data from civ3XEdit for this purpose.

The Selection Tool is a little clumsy around the edges of a selection, you can however modify the selection (or just toggle individual tiles to be selected) by holding down CTRL and clicking.

Note that for the moment MapTweaker can only load uncompressed bix files - To save an uncompressed bix file in civ3XEdit goto View-Options and uncheck the 'Compress BIC File' box. I'll add decompression functionality soon enough :)

Due to the way in which pcx files are currently read non-standard transparent colours will display incorrectly. This means that mods that use pcx files with transparent colours which are different from the colours in the standard pcx files will have problems displaying resources correctly. This will be fixed when I actually write some code to read the pcx files. Custom graphics that use the same transparent colours as the equivalent PTW file should load and display with no problems.

The continent data is not yet updated in anyway by MapMaker. As long as you load the changed bix into civ3XEdit all will be well but it means that the analysis tool will attribute resources to the wrong continents after moving tiles around the map. This will be fixed in a future version.



Known bugs:
----------------------
Start Locs added in maptweaker (including by copying a tile with a start loc) may crash the bix (drat!), a workaround is to remove the start loc in civ3XEdit before loading the bix in MapTweaker or after using MapTweaker in civ3XEdit remove it in tile properties, using the r-click -> Delete -> Start Loc will crash it though. I think I know what is causing this, a fix shouldn't be too hard. [still not fixed... for the moment I advise working on maps with no start positions, or at least not altering start locs in maptweaker.]


Bug Reports:
-----------------------
This is an early beta version and there are no doubt plenty of bugs I haven't caught yet! Every time the application runs it creates a debugLog.txt file, if you would like to make a bug report try and recreate the bug (with debug logging set to verbose preferably) then send a description of the error plus the debugLog.txt file and bix file generated during that operation to this email address:

MapTweakDebug@craven-griffiths.net.


You are welcome to send questions comments or ideas to this email address:

MapMaker@craven-griffiths.net


Alternatively just post your bugs and/or comments in the forum thread where you got this from :)




credits:
-------------
Gramphos and others for the incredibly helpful file format threads at Poly. No file format threads = no MapTweaker, nuff said.
ideas, encouragement (ie. listening to me ranting), alpha testing and web space: All the Civ3DuelZone.com MapMaking staff and Admins (and special mention to Melifluous for some early code :D)
Dianthus for providing his source code for pcx reading.
All who give feedback and bug reports in the various forums.





Version History
-------------------------

changes from 0.8b to 0.9b

Features and functionality:
- added C3C (BIQ) support. [Added new terrain types, note: Marsh and Volcano will be visible but unpickable in the brush picker when using non-C3C maps, if pasted from a C3C map into a non-C3C map they will revert to: marsh-> grassland ; volc-> mountains.]
- added change tile bonuses functionality to Tile properties dialog, changed the layout and interface of dialog.
- added selection tools and new menu; analyse selection, deselect tiles of type/terrain, select all/none
- made resources gfx slighlty oversized on map to enhance visibility, added resource gfx toggle in Options-Map gfx

Bug Fixes:
- fixed the reset code in the Resize and Nudge Dialogs so that they reset properly after applying the tool - should fix fatal errors after using the 'apply' button :O
- fixed error with pasting tiles containing modded resources into non-modded map - If you paste tiles with resources that don't exist in the target map (the resourceID number is > max No.of resources) the resource will now be deleted.
- fixed minimap scrolling 'sticking' with very small maps

Misc:
- added BIC Mode indicator in map properties dialog. Useful because C3C editor can save files with .bic/.bix extensions - but actually saves them in BIQ file format! MapTweaker will detect that these files are actually BIQ files and save them as such. Added a pop-up to notify user when such a map is loaded too.
- improved the paint terrain and paint resource functions to better detect whether they should paint or not.
- overhauled the InfoPanel code, messages outputted to user should be more meaningful... (removed some useless messages, added some useful ones, increased the default no of retained messages to 50, added a max no of messages and purge messages options to Options-General)



-----------------------------------------

All feedback welcome :)

Lt. Killer M
01-01-2004, 21:00
neat, now if I understood anything about the [nerd] and [geek] talk above I'd probably try it out right now ;)

Beam
01-01-2004, 21:11
[coool] Certainly will have some playtime tomorrow DrA!

Aggie
01-01-2004, 21:52
Great! I'll try it on the killer - sky map [party]

DrAlimentado
01-01-2004, 21:53
In short, you can use the app with bix files to do copy/paste between maps, resize maps, 'nudge' maps and so on. You need to reload a tweaked map with civ3XEdit to fix some tile-image and continent data issues... So it's a little rough round the edges but with a little care you should be able to get some very useful functionality out of it.

Apologies for making it in .NET and so requiring a chunky d/l from m$... but .NET rocks for developing, so err.. I'm not that sorry ;)

Aggie
03-01-2004, 09:53
My first impression: [jump][dance2][kiss]

I did the following with the map tweaker utility while creating the Killer - Skyfish map:

- I created a map in the PTW editor
- Tried to open the bix in the map tweaker utility but got a very clear error message [thumbsup]
- Executed the action as described in that error message
- Opened the bix in the map tweaker utility
- Selected a number of tiles
- Copied the tiles them somewhere else on the map
- Saved this file

I like the presentation of the map very much. It made the only action that I did very easy :D It was also very easy to perform the copy/paste action.

I had to get used to the fact that the screen wouldn't scroll with the mouse, but when using the arrow keys on the keybord it all worked out perfectly well!

One thing I noticed though: there appears to be a problem with the starting location copy/paste. I copied one and it was clearly shown in the scenario editors of Conquests. However, I could NOT delete the starting location (the editor crashed!!) and it also wasn't noticed while setting up the game (in Conquests). It offered me a different starting location all the time, a couple of tiles from where it was supposed to be.

Skyfish
03-01-2004, 10:54
[eek]
So you managed to create a BIQ file for a C3C game ???????
I thought that was impossible !

Aggie
03-01-2004, 10:57
No, I created a bix file for PTW and loaded it into the C3C editor ;)

Skyfish
03-01-2004, 11:04
Ok so i think thats why the Editor crashed when you were trying to perform an action in it.
Well done anyway ! Great simple idea !

DrAlimentado
03-01-2004, 14:36
Thx Aggie for the feedback :)

glad you like the error message ;) that particular one will dissappear once I add a decompresssion routine (or anarres writes me one :D)

hmm... I think I know what is causing the start loc bug, I need to update the start loc section in the bix rather than relying on civ3XEdit to do it automatically. I hadn't spotted it because my testing consists of loading the tweaked bix in civ3XEdit, if it loads then it passes [tongue]

Moved start loc updating to the top of my fix list :) for the moment I have added a note in the readme to warn people.

Aggie
03-01-2004, 14:39
quote:Originally posted by Skyfish

Ok so i think thats why the Editor crashed when you were trying to perform an action in it.
Well done anyway ! Great simple idea !


That's not it Sky! I performed other actions that worked out fine. DrA already found a reason within his own progrma though ;)

DrAlimentado
03-01-2004, 15:40
quote:Originally posted by Skyfish

[eek]
So you managed to create a BIQ file for a C3C game ???????
I thought that was impossible !


Not nearly impossible, just not done yet :D

They do appear to have broken the format of the bix(.biq) with the new FLAV section... but I have written a workaround for that bit already ;)

I need to add all the default settings for the new terrain and resources, add some more logic to the file detection/reading/writing bits and then debug what I've added! eta: er... realistically a couple of weeks maybe.

Aggie
03-01-2004, 15:55
quote:Originally posted by DrAlimentado

quote:Originally posted by Skyfish

[eek]
So you managed to create a BIQ file for a C3C game ???????
I thought that was impossible !


Not nearly impossible, just not done yet :D

They do appear to have broken the format of the bix(.biq) with the new FLAV section... but I have written a workaround for that bit already ;)


How could I create a save for C3C in the PTW editor using C3C resources? Well:

-I created a bix in the PTW editor
-Then I used DrA's tool to tweak (it can't handle C3C big's yet, that's why)
-Then I opened the bix in the C3C editor and placed the C3C resources
-And saved it as a bix (PTW file)

smalltalk
03-01-2004, 16:19
quote:Originally posted by DrAlimentado
... call me lazy for the moment.
[coool]

quote:MapMaker makes no registry entries on your computer ...
Well, I guess .NET will make enough of those. [hammer]

DrAlimentado
05-01-2004, 20:43
too true smalltalk! the next generation of m$ os' will have .net in the kernal though [:O]

Aggie
05-01-2004, 20:44
A little suggestion: it would be nice to be able to rate the copied tiles (180 degrees)...

DrAlimentado
07-01-2004, 10:59
Thx Aggie :)

current suggestions/ideas for new features;

mirroring a selection of tiles (flipping in x or y axis)
rotate a selection - probably in 90degree increments only (90/180/270)
stretch/shrink a map (this could be tricky... but might work ok for x2 /2 operations anyway)

The first two are relatively 'easy' and might make the next release.
BIQ support is getting there, Dianthus from CFC has generously given me the use of his source code for pcx reading so that might well get added (eliminating the need for the DLL and adding support for resources.pcx files with different transparency colours), as might support for compressed bix/biq's. I am working on getting resources and continents to update properly too (fixing the bug Aggie caught hopefully and making the stats analyser work after you change a map about.)

Longer term I want to add fancy map generation functions, heat and humidity overlay tools, improve the minimap 'refresh map' method to be much quicker, and add new map functionality.

Even longer term I want to add an in-game gfx preview window, display overlay gfx (rivers, mines etc.) and implement unit and city support. Other additions might be fancy resistribute item(s) tools, replace and clone tools, multiple object clipboard.


Any more?

Aggie
07-01-2004, 11:45
[love] not for the moment

Skyfish
08-01-2004, 09:12
I've installed and am playing around with it right now :)

Skyfish
08-01-2004, 11:16
One question :
Is there a possibility to have the Analyzer run on just a SELECTED area ?
It would be awesome if possible at all :D

Skyfish
08-01-2004, 11:26
An "Undo" function in the Edit menu would be great :)

Skyfish
08-01-2004, 11:36
[:p]

DrAlimentado
08-01-2004, 13:53
Analyser on a selected area only = doable, and pretty straightforward as I already just pass an array of tiles to the analyse function.

Undo = doable, but a lot of work... I need to think about the how-to with this a bit more...

DrAlimentado
14-01-2004, 23:19
I intend to release a 0.9b version at the week-end.

progress report:

C3C support is 90% done
Analyse selected area is done
various selection tools have been added; SelectAll, SelectNone, DeselectTiles by Land/Water, DeselectTiles by Terrain

Found an interesting thing that I think was causing a bug in write2file; bic and bix's saved in the c3c editor are actually biq files with the wrong file extension(!)
So how to correctly detect C3C maps... (the fileindicator is also broken in c3c files, they use the bix indicator too...) - for the moment I am using the fileindicator plus a check against major version number...
Fixed a reported bug in the resize dialog.
A few other minor bits and bobs; revamped the tile properties dialog, improved some under the hood stuff to speed the selection tool up, made paint terrain/resource correctly detect if they need to paint or not, fiddled with the infoPanel output.

I might even get the 'flip selection' and 'rotate selection' tools done :)

Skyfish
15-01-2004, 08:57
Wow! great progress !
Thanks a lot for the "selected area analyze tool" !

What about the "Undo" feature :D

DrAlimentado
18-01-2004, 14:09
New version (0.9b) in first post

Main change is C3C support (sounds like a small thing but really was a PITA!), but I made a few other additions too. Most notable feature wise is Sky's suggestion of analyse-by-section, and the new selection tools which allow you to filter out tiles of a certain type. Flip and Rotate didn't make it unfortunatly (couldn't get them debugged in time) but will definitly be in the next one.


changes from 0.8b to 0.9b

Features and functionality:
- added C3C (BIQ) support. [Added new terrain types, note: Marsh and Volcano will be visible but unpickable in the brush picker when using non-C3C maps, if pasted from a C3C map into a non-C3C map they will revert to: marsh-> grassland ; volc-> mountains.]
- added change tile bonuses functionality to Tile properties dialog, changed the layout and interface of dialog.
- added selection tools and new menu; analyse selection, deselect tiles of type/terrain, select all/none
- made resources gfx slighlty oversized on map to enhance visibility, added resource gfx toggle in Options-Map gfx

Bug Fixes:
- fixed the reset code in the Resize and Nudge Dialogs so that they reset properly after applying the tool - should fix fatal errors after using the 'apply' button :O
- fixed error with pasting tiles containing modded resources into non-modded map - If you paste tiles with resources that don't exist in the target map (the resourceID number is > max No.of resources) the resource will now be deleted.
- fixed minimap scrolling 'sticking' with very small maps

Misc:
- added BIC Mode indicator in map properties dialog. Useful because C3C editor can save files with .bic/.bix extensions - but actually saves them in BIQ file format! MapTweaker will detect that these files are actually BIQ files and save them as such. Added a pop-up to notify user when such a map is loaded too.
- improved the paint terrain and paint resource functions to better detect whether they should paint or not.
- overhauled the InfoPanel code, messages outputted to user should be more meaningful... (removed some useless messages, added some useful ones, increased the default no of retained messages to 50, added a max no of messages and purge messages options to Options-General)


NOTE: This is still a beta and you should be wary of making 'critical' maps (eg. ladder maps) without testing them extensively! I have a slight suspicion that copying or placing Start Locations *might* fuck things up... use at your own risk :)

Skyfish
18-01-2004, 17:38
I think I have a work -around for the Start Location issue (or more likely I dont understand it right...) :

For a Pelago map for example :
-> create a nice island with all resources needed in the Editor
-> EDIT and then ERASE the start location (but remember where you want it ;))
-> Export to MapTweaker
-> Copy /paste the island (tip: where you want the copied island fill it first with ocean tiles)
-> Once both islands are nicely set, save and go back to the Editor.
-> SET both Start Locations, save as Biq and do the Player Data tweaks.

Clear enough ?

DrAlimentado
18-01-2004, 18:39
correct Skyfish, I think that is the best way :)

quote:from the readme
...for the moment I advise working on maps with no start positions, or at least not altering start locs in maptweaker.

As you say working on a plain map with no start locations on it is the safest procedure at the moment.

DrAlimentado
18-01-2004, 18:44
Here's a very provisional list of what gets added next in some sort of rough order.



things todo next list:

update the start loc data in the bix
update resources and continent counts
implement changing BIC mode (for non-modded maps only), this will allow maps to be downgraded (or upgraded) between .bic .bix and .biq files.

flip selection, rotate selection.
stretch/shrink maps

compressed files support
inline pcx reading (removing the need for the DLL)

new map function (mainly for pasting a section as a new map)
cut functionality

clone brush, replace brush

improve the minimap refresh method to only redraw the changed area (currently it redraws the entire map, hence the slow speed on large maps)




slightly longer term:

overlay information and gfx (mines/roads etc.)

fancy map generation - with a ton of parameters!
inc. heat/humidity maps for generating into

unit and city support (?)
generate map from image (?)
multiple object clipboard (?)

Skyfish
18-01-2004, 19:17
....and of course an "Undo" function in the Edit menu :D

DrAlimentado
18-01-2004, 23:10
LOL, actually you are right, insert it after 'flip selection, rotate selection' and before 'stretch/shrink maps' for a very rough guess of when it might get done.

You will be pleased to know I have already laid some of the groundwork for it in revamping the messaging system :D

Skyfish
07-02-2004, 23:33
So where are we on teh Flip/Rotate selection ? I do feel it is now priority number one : I use the app extensively and no bugs
apart from the one we talked about :D
Great piece o'work bro' :D

Skyfish
14-02-2004, 18:37
Still eagerly waiting the rotate flip functions :D
Sorry to push you but I use this app *every day* man, its great : I'm having a blast creating new maps and cant wait for the players reactions....

One IMPORTANT TIP for other users : I toggle between C3CEditor and MapTweaker because making map modifs is easier in the Editor (remember to never have startign locs when doing the editing! they should be added at the last second in C3C before the .sav is made).
But when you do that be careful to always *close* the biq in C3C and then reopen the tweaked biq. Do not just reload from the actual biq, it crashes C3CEditor but can also create problems with the map.

Hope this explanation is clear enough [dunno] and maybe you can take a look why this happens DrA (after you finish the flip function) :)

smellymummy
29-03-2004, 14:55
sorry to wake up a somewhat dead thread, although like skyfish ive been using this program constantly since i found it on apolyton.

before this, my mapmaking would rely on BMP2BiC, which I suggested on another forum that its features be mimicked in maptweaker.

you can get bmp2bic here: http://www.inethighway.com/sm/bmp2bic.zip

it's a simple program. based on a multi color pallete, each pixel represents a tile, and depending on its color, what kind of terrain. this program makes map producing so much easier (its simple to convert real/fantasy maps to the color palette).

thanks again for this great program, and I'll be looking forward to the next update [thumbsup]

Arghis
11-06-2004, 10:56
Great tool. With C3C support, this is what i was needed.

Thx

Aggie
11-06-2004, 11:10
I hope there WILL be a new update :(

anarres
11-06-2004, 12:18
I am meeting with DrA this weekend, I will obtain the code for this then. I am happy to take over it's development.

Aggie
11-06-2004, 12:23
That would be great :)

Arghis
27-06-2004, 11:16
hi

does anyone know how to export, from editor or third party soft, the map as an image. (some kind of "printscreen" function in fact but which do not limit to screen resolution but to map size - am i clear enough ?)

And for Maptweaker, bravo, it's a good app !

anarres
27-06-2004, 14:50
Hmm. IIRC Matrix knows how to do this, why not PM him?