hanklin45110126 / wot-xvm

Automatically exported from code.google.com/p/wot-xvm
0 stars 0 forks source link

Use clan emblems on tanks for clan icons #65

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
as clan logos are now included by WG on tanks could it be possible to use those 
instead of the special folder? 

Original issue reported on code.google.com by thomas.l...@gmail.com on 8 May 2012 at 2:24

GoogleCodeExporter commented 8 years ago
I don't know how to get it

Original comment by m.schedr...@gmail.com on 8 May 2012 at 8:35

GoogleCodeExporter commented 8 years ago
Well, then hopefully someone will find that out...would be easier I think ^^

Original comment by thomas.l...@gmail.com on 8 May 2012 at 8:57

GoogleCodeExporter commented 8 years ago
I'm currently trying some things, it seems that logos are handled in 
VehicleStickers.pyc in res/scripts/client (at least I found clan emblems 
variables there), but I couldn't find a way how to properly decompile a python 
2.6.* file.
Probably you can find out something more sirmax? Most .pyc-Mods come from the 
russian forum and google translator is really bad in translating russian to 
english ^^

Original comment by johannes...@gmail.com on 8 May 2012 at 9:11

GoogleCodeExporter commented 8 years ago
VehicleStickers.pyc dissassembly + infos -> VehicleStickers.pya
Python file version: 2.6.2

Original comment by johannes...@gmail.com on 8 May 2012 at 9:55

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
It is not my way, because .pyc files can contain viruses instead of .swf. If I 
will distribute mod with .pyc files and someone will add virus to it, mod can 
be banned.

Original comment by m.schedr...@gmail.com on 10 May 2012 at 9:17

GoogleCodeExporter commented 8 years ago
Ok, then another way I can think of would be to use the images stored in the 
custom_data folder. The WoT Clan Stickers tool from Dynamite86 can show the 
graphics in the files. Google translator says that this:

Структура файла. По смещению 0x00 расположен 
заголовок, предположительно содержащий 
информацию о принадлежности эмблемы к 
клану.

means something like "The information of membership to the clan is presumably 
stored at offset 0x00". He also writes something about a clan tag display 
feature it in the latest posts.
If it doesn't create too much system load the proxy could check (in an extra 
thread) each new file created in the folder first for being a valid clan emblem 
and then parsing the membership information (if it *really* contains the clan 
tag) out of the file and store it together with the file path. On match start 
the swf could send clan tags to the proxy which then returns them.
As I didn't find any clan emblem handling within the swfs this is the only way 
I can think of atm.

Original comment by johannes...@gmail.com on 10 May 2012 at 11:18

GoogleCodeExporter commented 8 years ago
Yes, it can be useful. But it will work only with wot-xvm-proxy, because swf 
have access only for relative paths.
And before use it, we need to understand how file name is encoded, to load 
right icon.

Original comment by m.schedr...@gmail.com on 10 May 2012 at 11:51

GoogleCodeExporter commented 8 years ago
And I don't see clan information in this files. It is absent or encoded.

Original comment by m.schedr...@gmail.com on 10 May 2012 at 11:56

GoogleCodeExporter commented 8 years ago
And I also don't know if the swfs could even use the file in custom_data 
because of it's encoding... exporting icons to the clanicon folder would most 
likely create much more system load, but would make it easier to use relative 
paths. We'll first need to wait for Dynamite86 to write an encoder for it and 
hopefully he'll share the source.

Just got an email about your latest post. See his forum entry:
http://forum.worldoftanks.ru/index.php?/topic/270685-wot-clan-stickers/
In the latest posts he writes about a clan tag/name display feature which he 
will "will leave for later, for a snack ...." (googleTranslate). Post was three 
days ago so probably he will release a new version soon. You'd only have to 
contact him and ask for the encoding algorithm. And AFAIK the clantag isn't 
encoded in the filename, but in the file starting at offset 0x00 until 0x11 (or 
0x14, don't know really). So we probably would have to open each file, look 
into it, check validness and read clan tag and finally export one of the pngs 
to the clanicons folder...

Original comment by johannes...@gmail.com on 10 May 2012 at 12:06

GoogleCodeExporter commented 8 years ago
I already read this thread and Russian is my native language, so I can 
understand more then giigle translate. :)
Dynamite86 wrote that header PROPABLY contain clan info, but he don't sure and 
don't explore it yet.
I look into this files before my post and it have no readable text about clan, 
so it is encoded or absent.

For this clan icons we can use our .stat directory. With help of Dokan we can 
make anything we need.

Original comment by m.schedr...@gmail.com on 10 May 2012 at 4:03

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Ok, if you find out more let me know ;)

Another approach would be just to add all clan icons to the XVM mod. I wrote a 
script to fetch all ~7280 clanicons from the EU server. Then I wrote another 
script to move all valid clanicons into another folder which accidently oversaw 
about 10 non-default clanicons because they matched the pattern. Probably I can 
improve the detection rate but 10/7280 missdetected is a good beginning I think 
;)
This left me 2117 clans with valid clanicons. Finally I wrote a script that 
creates a config out of the directory listing.
Results are 2117 clanicons with overall 2.61 MB size (optipng saved about 0.2 
MB) plus an 88.7 KB config just for the EU server. I can clean up the scripts 
and publish them if you want to do sth similar for RU. As RU has about 3 times 
more clans than EU (7280vs22690) it would most likely be a bit bigger. If you 
want me to commit all the icons I could also do that, but just wanted to get 
your review on this.

Original comment by johannes...@gmail.com on 14 May 2012 at 3:07

GoogleCodeExporter commented 8 years ago
1. You need to remember that big config will take more time to load.
2. Most users voted to include top 100 clans to default config.

I think that full clan icons can be distributed at separate package.
And we can make separate config for clan icons, so updating clan icons package 
will not overwrite other XVM settings. If we will implement this, users can 
make and share their own clan packs.

Original comment by m.schedr...@gmail.com on 14 May 2012 at 3:23

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by m.schedr...@gmail.com on 14 Jun 2012 at 8:03

GoogleCodeExporter commented 8 years ago
Hi. Well, I can see you uploaded vehiclestickers.pya

  I was trying to modify my graphic config, with a notepad file, called graphicsPresets.pya  .

   I modified it, and now, when I open game client, it automatically closes. I think that´s because I changed that notepad file.

 Could someone upload or send me the original "graphicsPresets.pya" file?.

I hope you can. If you can, upload it to this issue, or send me via e-mail.

  Thanks!

Original comment by robertit...@gmail.com on 24 Jul 2012 at 12:04

GoogleCodeExporter commented 8 years ago
I think we can close this issue, because we already have full icons packs for 
RU/EU/US servers. I think it is enough.
Please confirm closing this issue.

Original comment by m.schedr...@gmail.com on 15 Aug 2012 at 11:46

GoogleCodeExporter commented 8 years ago
Confirmed with one suggestion:
In the future we could probably start providing "full" icon packs that only 
contain clan icons that differ from the default WG icons. Some months ago I 
wrote a picture analyzation script for this that removes the default icons. It 
removed all default icons and had a false-positive rate of about 2% because the 
algorithm only checked alpha-values of the 64x64 pixels. I would have to 
improve the algorithm when I have time for it. The only "downside" is that it 
then would need the clan_color variable from the clan json we get from the 
server as AFAIK thats the color used in the emblem. I'll contact you if I 
finished it but I currently don't have a lot of time and I am also working on a 
rewrite of the WotClanInfo tool so this could take a while.

Original comment by johannes...@gmail.com on 15 Aug 2012 at 12:01

GoogleCodeExporter commented 8 years ago
Ok.

Original comment by m.schedr...@gmail.com on 15 Aug 2012 at 12:39