(Reposted from http://www.twcenter.net/forums/showt...08#post8747908)
Attached is a zip file containing stupid.exe. Stupid is a windows console application for editing total war supertextures. It supports the formats used in Empire: Total War, Napoleon: Total War and Total War: Shogun 2.
Usage:
stupid preview <path to supertexture> <path to extracted preview bitmaps>
(i.e. stupid preview "C:\Program Files\Steam\SteamApps\common\empire total war\data\supertexture.pack\world_" empire_preview)
Empire & Napoleon: Writes two bitmaps - a colour map (filename.bmp) and an alpha map (filename.alpha.bmp) which provide a minified view of the supertexture. Also writes some basic information about the supertexture to the console. The alpha map defines where water is.
Shogun 2: Writes two bitmaps - a colour map (filename.bmp) and a normal map (filename.normal.bmp) which provide a minified view of the supertexture. Also writes some basic information about the supertexture to the console.
stupid extract <path to supertexture> <path to extracted bitmaps> <x position of first tile to extract> <y position of first tile to extract> <width in tiles of the extracted section> <height in tiles of the extracted section>
(i.e. stupid extract "C:\Program Files\Steam\SteamApps\common\napoleon total war\data\campaign_maps\nap_europe\display\Supertexture\supertexture" nap_europe_tile 8 8 16 16)
Empire & Napoleon: Writes two bitmaps - a colour bitmap (filename.bmp) and an alpha map (filename.alpha.bmp) which contain a subsection of the full resolution supertexture. The alpha map defines where water is. You could use this to extract the entire supertexture at once, but be aware that for the Empire supertexture this would be a 6GB colour map and 2GB alpha map!
Shogun 2: Writes two bitmaps - a colour bitmap (filename.bmp) and a normal map (filename.normal.bmp) which contain a subsection of the full resolution supertexture.
stupid pack <path to source supertexture> <path to replacement section bitmaps> <path to destination supertexture> <x position of first tile to replace> <y position of first tile to replace>
(i.e. stupid pack "C:\Program Files\Steam\SteamApps\common\empire total war\data\supertexture.pack\world_" empire_tile new_supertexture.pack/world_ 58 8)
All: Creates a new supertexture (either in a packfile or as a .stpi plus a .stpd file) by combining the source supertexture with the replacment bitmaps. This can take a long time (during testing I packed with a 8k by 8k replacement block and packing took 20-30 minutes)! Do not assume the tool has failed unless the progress bar has not ticked for at least ten minutes.
stupid create-empire <width> <height> <path to destination supertexture>
(i.e. stupid create-empire 32768 16384 "C:\Program Files\Steam\SteamApps\common\empire total war\data\world_")
Creates a new blank supertexture of the specified size in the Empire: Total War format. Width and height must be powers of 2 no less than 512. This functionality is completely untested.
stupid create-napoleon <width> <height> <path to destination supertexture>
(i.e. stupid create-napoleon 32768 16384 "C:\Program Files\Steam\SteamApps\common\napoleon total war\data\new_supertexture.pack\campaign_maps\nap_europe\display\Supertexture\supertexture")
Creates a new blank supertexture of the specified size in the Napoleon: Total War format. Width and height must be powers of 2 no less than 512. This functionality is completely untested.
stupid create-shogun-2 <width> <height> <path to source palette bitmap> <path to destination supertexture>
(i.e. stupid create-shogun-2 32768 16384 palette.bmp "C:\Program Files\Steam\SteamApps\common\total war shogun 2\data\new_supertexture.pack\campaign_maps\sho_japan\display\supertexture\supertexture")
Creates a new blank supertexture of the specified size in the Total War: Shogun 2 format. Width and height must be powers of 2 no less than 512. The palette bitmap must be a 24-bit bitmap with width of 1 pixel and height of 256 pixels containing the palette of colours to be used for the parchment map. Due to the nature of the compression used in the supertexture the palette should form as smooth a gradient as possible.
Empire & Napoleon: All extracted and replaced bitmaps must have length and width which is a multiple of 512. All colour maps must be 24 bit bmp files. All alpha maps must be uncompressed 8 bit bmp files. Alpha maps use the palette index as the opacity value, not the palette colour, so the palette must not be reordered.
Shogun 2: All extracted and replaced bitmaps must have length and width which is a multiple of 512. All colour maps must be 8 bit bmp files with palette sorted so similar colours are adjacent.
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/; or, (b) send a letter to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA.
Uses Boost.Array, Copyright (C) 2001-2004 Nicolai M. Josuttis
Uses Boost.LexicalCast, Copyright Kevlin Henney, 2000-2005. Copyright Alexander Nasonov, 2006-2007.
Uses Boost.Filesystem, (C) Copyright Beman Dawes, 2002-2005
Uses Boost.Integer, Copyright (C) 2001 -2009 Beman Dawes, Daryle Walker, Gennaro Prota, John Maddock
Uses Boost.Ref, Copyright (C) 1999, 2000 Jaakko Järvi, Copyright (C) 2001, 2002 Peter Dimov, Copyright (C) 2002 David Abrahams
Uses Boost.SmartPointers, Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler.
Uses Boost.Thread, Copyright (C) 2007 -8 Anthony Williams
Uses Boost.Noncopyable, (C) Copyright Beman Dawes 1999-2003.
Uses Boost.Unordered, Copyright (C) 2003, 2004 Jeremy B. Maitin-Shepard Copyright (C) 2005-2008 Daniel James
(all http://www.boost.org/)
Uses libsquish, Copyright (C) 2006 Simon Brown
(http://code.google.com/p/libsquish/)
Uses zlib, Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
(http://www.zlib.net/)
Attached are the colour map and alpha map produced by previewing the empire supertexture, plus an example of a modifed supertexture in-game. Excuse the poor quality of the example - I am not an artist!