Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: Cossacks 1 .GP Alpha channel conversion
GAMEINATOR forums > Общие разделы > Создание и модификация игр. Геймдев.
Hello, everyone. Before I dive into the details, I wanna say I'm sorry for not speaking Russian for the sake of better communication. Though I'll try to be as clear as I can be for you to understand.

This place is my last resort to ask for help, really.

I'm sure most of you around here are aware of what Cossacks is, a true-classic RTS series made by GSC Game World long before STALKER came out. While the modding scene of this franchise was dead for years now, it doesn't stop people from still doing things. I had some ideas I wanted to incorporate in the game and especially Back to War for some time now, though, what I need to do is a bit challenging in terms of modding.

Straight to the point. Its about the GP files and alpha channels I am having trouble with. Usually GPs contain a set of bitmap image in 8bit Indexed format (GP stands for Graphics Packages).

I've been trying the past few days to figure how to convert the alpha channels of the interface textures and the only thing I was able to do is the color palette only.

Let's take the BORDER.GP, it contains the in-game user interface textures like the minimap, resource bar, etc. and is located in ALL.GSC. In order for those GP files to be edited you need to use GPViewer to extract them first and MegaPack to convert them later. Those tools are found within the GPArch modding kit, available here: http://cossacksworld.ucoz.co.uk/load/1-1-0-5

My biggest issue comes with the alpha channel; its always broken, no matter what settings I choose in MegaPack, it always looks like this:

Where it should look like this (original)

Has anyone ever worked with the interface textures and knows whats the best way to convert the alpha channels (if ever possible)?

I'll provide you with a short guide of how I unpacked the GPs, its fairly easy:

1. Download GPArch from the link I posted.
2. Extract it in your C:\ drive.
3. Open the extracted folder go to "FOR COSSACKS" and copy 0 & 1 folders, put them in the main GPArch directory (you have to replace the old ones)
The tricky part is here:
5. Download GSC File Utility 1.11
6. Unpack it wherever you like.
7. Open the GSC File Utility, select "File Extraction" option then click on "Open" and select the ALL.GSC archive found within your Cossacks Back to War directory in Steam;
Steam\steamapps\common\Cossacks Back to War\bin
8. Extract the game files somewhere.
9. Open the folder where the extracted files are located and then copy "2" to your GPArch directory, so it has three numeric folders: 0, 1, 2
10. Now you are able to view any GP files with GPViewer

NOTE: If you don't copy "2", you won't be able to open the interface files. This folder has the palette settings that GPView uses to display them.

I own Back to War and the Campaign Expansion on Steam, also the retail edition. I can provide any files to whoever thinks can solve the mystery.

Would be forever thankful if anyone can help me figure this stuff so we can do HUD mods, change the textures and so on.


Here's the Google Translation of this for whoever doesn't understand well enough:

Здравствуйте все. Прежде чем углубиться в детали, я хочу извиниться за то, что не говорю по-русски ради лучшего общения. Хотя я постараюсь быть настолько ясным, насколько смогу, чтобы вы поняли.

Это мое последнее прибежище, действительно, просить помощи.

Я уверен, что большинство из присутствующих здесь знают, что такое казаки, настоящая классическая серия RTS, созданная GSC Game World задолго до выхода STALKER. Хотя сцена моддинга этой франшизы была мертва уже много лет, она не мешает людям продолжать делать что-то. У меня были некоторые идеи, которые я хотел бы включить в игру и особенно в Back to War в течение некоторого времени, хотя, что мне нужно сделать, это немного сложно с точки зрения моддинга.

Прямо к сути. Речь идет о файлах GP и альфа-каналах, с которыми у меня проблемы. Обычно GP содержат набор растровых изображений в 8-битном индексированном формате (GP обозначает графические пакеты).

Последние несколько дней я пытался понять, как преобразовать альфа-каналы текстур интерфейса, и единственное, что мне удалось сделать, - это только палитра цветов.

Давайте возьмем BORDER.GP, он содержит текстуры пользовательского интерфейса в игре, такие как миникарта, панель ресурсов и т. Д., И находится в ALL.GSC. Чтобы редактировать эти файлы GP, вам нужно сначала использовать GPViewer, чтобы извлечь их, и MegaPack, чтобы затем преобразовать их. Эти инструменты находятся в комплекте для моддинга GPArch, доступном здесь: http://cossacksworld.ucoz.co.uk/load/1-1-0-5

Моя самая большая проблема связана с альфа-каналом; он всегда сломан, независимо от того, какие настройки я выбираю в MegaPack, он всегда выглядит так:

Где это должно выглядеть так (оригинал)

Кто-нибудь работал с текстурами интерфейса и знает, как лучше конвертировать альфа-каналы (если это возможно)?

Я предоставлю вам краткое руководство о том, как я распаковал GP, это довольно просто:

1. Скачайте GPArch по ссылке, которую я разместил.
2. Распакуйте его на диск C: \.
3. Откройте извлеченную папку, перейдите в раздел «ДЛЯ КАЗАКОВ» и скопируйте папки 0 и 1, поместите их в основной каталог GPArch (вам нужно заменить старые)
Сложная часть здесь:
5. Загрузите GSC File Utility 1.11.
6. Распакуйте его где угодно.
7. Откройте GSC File Utility, выберите опцию «Извлечение файла», затем нажмите «Открыть» и выберите архив ALL.GSC, найденный в вашем каталоге Cossacks Back to War в Steam;
Steam \ steamapps \ common \ Казаки Back to War \ bin
8. Извлеките файлы игры куда-нибудь.
9. Откройте папку, в которой находятся извлеченные файлы, а затем скопируйте «2» в каталог GPArch, чтобы в нем было три цифровых папки: 0, 1, 2
10. Теперь вы можете просматривать любые файлы GP с GPViewer

ПРИМЕЧАНИЕ. Если вы не скопируете «2», вы не сможете открыть файлы интерфейса. Эта папка имеет настройки палитры, которые GPView использует для их отображения.

У меня есть Back to War и расширение кампании в Steam, а также розничная версия. Я могу предоставить любые файлы тому, кто думает, что может разгадать тайну.

Был бы всегда благодарен, если бы кто-нибудь мог помочь мне разобраться в этом, чтобы мы могли делать HUD-моды, менять текстуры и так далее.
Цитата(Zakxaev68 @ 15.05.2019, 18:44) *
whoever thinks can solve the mystery.

If noone will help you before that, I'll try to look into it this evening.
Thanks, iOrange. I can give you the required files via PM if you don't have the game. I'm afraid its the MegaPack tool that doesn't work well with alpha channels, though its the only ever made. Maybe not. I can't be sure...


Спасибо, iOrange. Я могу дать вам необходимые файлы через личку, если у вас нет игры. Боюсь, это инструмент MegaPack, который не очень хорошо работает с альфа-каналами, хотя и единственный из когда-либо созданных. Возможно, нет. Я не могу быть уверен ...
Цитата(Zakxaev68 @ 15.05.2019, 20:30) *
I can give you the required files via PM if you don't have the game

No need for that, I do own the game wink.gif
You can poke me anytime on Discord btw
Цитата(iOrange @ 15.05.2019, 22:11) *
Цитата(Zakxaev68 @ 15.05.2019, 20:30) *
I can give you the required files via PM if you don't have the game

No need for that, I do own the game wink.gif
You can poke me anytime on Discord btw

Разве обязательно использовать сторонние утилиты, а не сделать альфу в каналах фш и экспортнуть в tga? unsure.gif
Well, seems like MegaPack is the one to blame.
The alpha in my case looks better than in your screenshot, but the main palette seems off. dry.gif
I've tried palette 0, 1 and 2 (Palette 2 is on the screenshot), all of which gave me weird color palette, but alpha was same.

If there's a format spec somewhere, I might make you a proper tool in my spare time.
Tools you've pointed to are very crappy and don't even start without some rain dances.

Actually the settings I've used on the screenshots are Palette 3, Full Alpha (Rough&Fast) and Precise image (0) (e.g. best quality). Colours then look 1:1 to the original, only that the alpha doesn't.Though you're right, its MegaPack that was never intended to support this kind of thing.

Unfortunately, as the game is pretty much ancient now and all the tools made by people were done in 2001-2002-2003, everything that was available as format research for the engine is gone. Damn....

I had the GSC's Back to War source code around, if that helps?

Update: Yep I still have it. There's this part in there:


#define BMPTOOL
typedef unsigned char byte;
#pragma pack(1)
struct BMPformat{ // bmfh
        WORD    bfType;
        DWORD   bfSize;
        WORD    bfReserved1;
        WORD    bfReserved2;
        DWORD   bfOffBits;
        DWORD   biSize;
        LONG    biWidth;
        LONG    biHeight;
        WORD    biPlanes;
        WORD    biBitCount;
        DWORD   biCompression;
        DWORD   biSizeImage;
        LONG    biXPelsPerMeter;
        LONG    biYPelsPerMeter;
        DWORD   biClrUsed;
        DWORD   biClrImportant;
struct PAL3{
    byte r,g,b;
struct PAL4{
    byte b,g,r,reserved;
void SaveToBMP24(char* Name,int Lx,int Ly,byte* data);
bool ReadBMP24(char* Name,BMPformat* BM,byte** data);
bool ReadBMP8(char* Name,BMPformat* BM,byte** data);
bool ReadBMP8TOBPX(char* Name,byte** data);
void SaveToBMP8(char* Name,int Lx,int Ly,byte* data,PAL3* pal);

Also Bmptool.cpp file, which is Visual Studio project file I guess that has a lot of code (and prolly might help).

Uploaded it for you:


By the file name I could guess GSC had its own tool to manipulate the bitmaps, though it isn't contained in the source code. Odd. Now I noticed, the last bits say "PAL3", which, if I'm right, refers to Palette 3. Or maybe its just a coincidence of words.
Цитата(Zakxaev68 @ 16.05.2019, 10:52) *
There's this part in there:

That's the code for the BMP, I'm talking about *.GP format.

Added: oh, nvm, I just realized you attached the source code for the game. Will take a look at it.
True that. Although I haven't gone through the source code completely, it might contain some hints about the GP containers.

As I said, the series has been dead since forever. Only few make mods anymore, if ever. I myself haven't seen any format documentation yet - and boy, trust me, I've been collecting things about STALKER and Cossacks already 13 years and counting.

That doesn't mean someone out there doesn't have a detailed explanation of the format - lots of russian folks still play C1 and use mods (I noticed people discussing that in the GSC Server lobby many times).

From what I know, American Conquest and Heroes of Annihilated Empires used different builds of the DMCR engine, so all those games used the same formats.

Guess this is a dead end then? ohmy.gif
Цитата(Zakxaev68 @ 16.05.2019, 22:34) *
Guess this is a dead end then?

Nuh, didn't say that wink.gif I'll try to help you, don't give up yet!
Just quickly checked - those tools are incorrect.
They're doing redundant alignment for the sizes, so then you get improperly sized images with empty pixels.

Let's take that BORDER.GP file, and 5-th image (Frame 4). If you export it, you'll see that it's size will be 248x205.
But the actual size of that image is 245x205.
The tool is adding redundant pixels to align row to 4 bytes, but they're doing it wrong (it shouldn't affect the dimensions).

I can do better. Will try to make better tool in my spare time.
Oh,so then this is why it crashes and never works. I tried in the past to contact the author of GPArch, ckphan (I think his nickname). Never could talk to him. Also tried to reach other people, like Ykkrosh, the guy who made most of BANG! Engine/Genie modding tools (Age of Empires).

If you can do so and make a working tool for the GP's... then you'll be a hero.

Cossacks happens to be my favorite RTS ever (American Conquest too, for the enhancements and the environment). Back in the day, I played hell a lot C1 instead of Age of Empires 2, that was everyone's favorite type of entertainment. I still do 5-6k unit skirmishes and campaign runs, hardly can get bored of this game. I did bought the latest Cossacks 3 release full price, yep my first full price purchase in years, only to get disappointed how devs abandoned the project, so I went back to the classic.

Thanks for being the only one trying to help!!!
Well, seems surprising that no Cossacks modders lurk this forum o_O.gif . Guess I was right nobody seems interested in modding the series anymore. Unfortunately...

I still have slight hope! kozak.gif


Ну, кажется удивительным, что на этом форуме нет модеров Cossacks o_O.gif. Думаю, я был прав, к сожалению, никто больше не интересуется моддингом франшиза.

У меня все еще есть надежда! kozak.gif
Have faith my friend, I'll try to do my best.
Oof. Been 3 months since I was here. As I see the topic is pretty much dead.... moderators can lock it. If still, anyone ever reads my message, you can PM me; I have both the physical and digital copy of Back to War.

Thanks for trying to help too, iOrange!
Check your Discord wink.gif
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Форум IP.Board © 2001-2022 IPS, Inc.