Перейти в начало страницы

Здравствуйте, гость ( Авторизация | Регистрация )

Gameru.net останавливает работу в связи с вторжением армии РФ в Украину. Следите за дальнейшими анонсами.
Support Gameru!
 
Ответить в данную темуНачать новую тему
> Cossacks 1 .GP Alpha channel conversion
Zakxaev68
сообщение 15.05.2019, 19:44
Сообщение #1


Новичок
*

Репутация:   3  
Группа: Участник
Сообщений: 9
Регистрация: 15.05.2019




Вставить ник Цитировать выделенное в форуму быстрого ответа


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:
https://i.imgur.com/89HU5HB.png

Where it should look like this (original)
https://i.imgur.com/dT4Qskq.png

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.
http://cossacksworld.ucoz.co.uk/load/1-1-0-5
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
https://swordandarrow.ucoz.com/index/gsc_file_utility/0-14
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, он всегда выглядит так:
https://i.imgur.com/89HU5HB.png

Где это должно выглядеть так (оригинал)
https://i.imgur.com/dT4Qskq.png

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

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

1. Скачайте GPArch по ссылке, которую я разместил.
http://cossacksworld.ucoz.co.uk/load/1-1-0-5
2. Распакуйте его на диск C: \.
3. Откройте извлеченную папку, перейдите в раздел «ДЛЯ КАЗАКОВ» и скопируйте папки 0 и 1, поместите их в основной каталог GPArch (вам нужно заменить старые)
Сложная часть здесь:
5. Загрузите GSC File Utility 1.11.
https://swordandarrow.ucoz.com/index/gsc_file_utility/0-14
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-моды, менять текстуры и так далее.
Перейти в начало страницы
 
iOrange
сообщение 15.05.2019, 20:23
Сообщение #2
BFG9000 owner

Половина землекопа
**************

Репутация:   247  
Группа: Припаркованный аккаунт
Сообщений: 1813
Награды: 3
Регистрация: 30.03.2010




Вставить ник Цитировать выделенное в форуму быстрого ответа


Цитата(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.

Сообщение отредактировал iOrange - 15.05.2019, 20:23


--------------------
Hello worlds!
Перейти в начало страницы
 
Zakxaev68
сообщение 15.05.2019, 21:30
Сообщение #3


Новичок
*

Репутация:   3  
Группа: Участник
Сообщений: 9
Регистрация: 15.05.2019




Вставить ник Цитировать выделенное в форуму быстрого ответа


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, 21:31
Перейти в начало страницы
 
iOrange
сообщение 15.05.2019, 22:11
Сообщение #4
BFG9000 owner

Половина землекопа
**************

Репутация:   247  
Группа: Припаркованный аккаунт
Сообщений: 1813
Награды: 3
Регистрация: 30.03.2010




Вставить ник Цитировать выделенное в форуму быстрого ответа


Цитата(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


--------------------
Hello worlds!
Перейти в начало страницы
 
Egorich___
сообщение 15.05.2019, 22:41
Сообщение #5


Заслуженный Мастер Игры
*************

Репутация:   355  
Группа: Участник
Сообщений: 1550
Награды: 6
Регистрация: 19.10.2009




Вставить ник Цитировать выделенное в форуму быстрого ответа


Цитата(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


--------------------
Coming Soon...
Перейти в начало страницы
 
iOrange
сообщение 16.05.2019, 03:17
Сообщение #6
BFG9000 owner

Половина землекопа
**************

Репутация:   247  
Группа: Припаркованный аккаунт
Сообщений: 1813
Награды: 3
Регистрация: 30.03.2010




Вставить ник Цитировать выделенное в форуму быстрого ответа


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.



Сообщение отредактировал iOrange - 16.05.2019, 03:19


--------------------
Hello worlds!
Перейти в начало страницы
 
Zakxaev68
сообщение 16.05.2019, 11:52
Сообщение #7


Новичок
*

Репутация:   3  
Группа: Участник
Сообщений: 9
Регистрация: 15.05.2019




Вставить ник Цитировать выделенное в форуму быстрого ответа


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:

[BackToWar_135\addon_2_project\ADDON_2_PROJECT\IntExplorer\Bmptool.h]

CODE
#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:

https://www.dropbox.com/s/h1xlp96d1zuj20z/C...master.zip?dl=0

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, 12:02
Перейти в начало страницы
 
iOrange
сообщение 16.05.2019, 23:06
Сообщение #8
BFG9000 owner

Половина землекопа
**************

Репутация:   247  
Группа: Припаркованный аккаунт
Сообщений: 1813
Награды: 3
Регистрация: 30.03.2010




Вставить ник Цитировать выделенное в форуму быстрого ответа


Цитата(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.

Сообщение отредактировал iOrange - 16.05.2019, 23:29


--------------------
Hello worlds!
Перейти в начало страницы
 
Zakxaev68
сообщение 16.05.2019, 23:34
Сообщение #9


Новичок
*

Репутация:   3  
Группа: Участник
Сообщений: 9
Регистрация: 15.05.2019




Вставить ник Цитировать выделенное в форуму быстрого ответа


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
Перейти в начало страницы
 
iOrange
сообщение 16.05.2019, 23:47
Сообщение #10
BFG9000 owner

Половина землекопа
**************

Репутация:   247  
Группа: Припаркованный аккаунт
Сообщений: 1813
Награды: 3
Регистрация: 30.03.2010




Вставить ник Цитировать выделенное в форуму быстрого ответа


Цитата(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!


--------------------
Hello worlds!
Перейти в начало страницы
 
iOrange
сообщение 17.05.2019, 07:18
Сообщение #11
BFG9000 owner

Половина землекопа
**************

Репутация:   247  
Группа: Припаркованный аккаунт
Сообщений: 1813
Награды: 3
Регистрация: 30.03.2010




Вставить ник Цитировать выделенное в форуму быстрого ответа


Zakxaev68
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.


--------------------
Hello worlds!
Перейти в начало страницы
 
Zakxaev68
сообщение 17.05.2019, 10:55
Сообщение #12


Новичок
*

Репутация:   3  
Группа: Участник
Сообщений: 9
Регистрация: 15.05.2019




Вставить ник Цитировать выделенное в форуму быстрого ответа


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!!!

Сообщение отредактировал Zakxaev68 - 17.05.2019, 10:56
Перейти в начало страницы
 
Zakxaev68
сообщение 21.05.2019, 00:58
Сообщение #13


Новичок
*

Репутация:   3  
Группа: Участник
Сообщений: 9
Регистрация: 15.05.2019




Вставить ник Цитировать выделенное в форуму быстрого ответа


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
Перейти в начало страницы
 
iOrange
сообщение 21.05.2019, 01:05
Сообщение #14
BFG9000 owner

Половина землекопа
**************

Репутация:   247  
Группа: Припаркованный аккаунт
Сообщений: 1813
Награды: 3
Регистрация: 30.03.2010




Вставить ник Цитировать выделенное в форуму быстрого ответа


Have faith my friend, I'll try to do my best.


--------------------
Hello worlds!
Перейти в начало страницы
 
Zakxaev68
сообщение 11.08.2019, 20:11
Сообщение #15


Новичок
*

Репутация:   3  
Группа: Участник
Сообщений: 9
Регистрация: 15.05.2019




Вставить ник Цитировать выделенное в форуму быстрого ответа


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!
Перейти в начало страницы
 
iOrange
сообщение 12.08.2019, 04:47
Сообщение #16
BFG9000 owner

Половина землекопа
**************

Репутация:   247  
Группа: Припаркованный аккаунт
Сообщений: 1813
Награды: 3
Регистрация: 30.03.2010




Вставить ник Цитировать выделенное в форуму быстрого ответа


Check your Discord wink.gif


--------------------
Hello worlds!
Перейти в начало страницы
 

Ответить в данную темуНачать новую тему
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 



Текстовая версия Сейчас: 28.03.2024, 19:16