World of Tanks Map format.

Post questions about game models here, or help out others!
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

BTW....
In opengl.. GLSL... when you try to use a texture that has nothing bound to it, it will return unexpected results.

Do this also...
you must create a dummy texture the same size as the layer textures.
If there is NO layer for say... number 4.. use this dummy and bind it to that texture position.
This is why I have a variable I save called layer_count.
When I do the reading of the layer files.. I update this variable.
You can also use this variable in the shader if you need it for some reason.
I found adding an empty texture had no effect on the overall mix as long as RGBA = 0 0 0 0

Also.. your mix texture should be set to RGBA = 0 0 0 0 when you first create it.
I use Devil and it works well for creating empty textures. I dont know if you can use it
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

SkaceKachna wrote:So just scale the texture to the chunk size? But how to use the color_tex then ... I can't scale i to chunk size, color_tex must cover entire map.
Do I need to treat the color_tex differently than rest of the textures? If so, is there any other way to identify color_tex other than it being the first layer?
Currently I just use the color_tex as background and then apply the other layers, which works and looks nice, but somehow I feel this isn't the right way :(
See.. This is a huge issue I had.. The color_Tex can wind up in layer 1 to 4.
The only way to know is to check the string and see if it matches.
The thing is... It doesn't seem to matter as far as the final mix.

To deal with the size( 4096 x 4096) you can scale the UV coords for the other textures
If the map is say... 12 x 12 chunks...
pass the map location in X,Y to the shader along with the size.. in this case 12.
Now... to scale it take U and divide it by the map size (12) and add (1.0/12.0) * location X
You would do the same for V.
Use these new UV coords in the shader to look up the color_tex RGBA
Last edited by Coffee on Tue Feb 02, 2016 12:11 am, edited 1 time in total.
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

What I actually did was to cut up the color_tex in to a bunch of smaller textures.
It works but is slow and scaling a UV for it is a better solution.
I'd love to change the world but I can't get my hands on the code.
SkaceKachna
advanced
Posts: 66
Joined: Thu Jan 14, 2016 11:32 am
Has thanked: 9 times
Been thanked: 19 times

Re: World of Tanks Map format.

Post by SkaceKachna »

I actually use one big texture, containing all chunks in one image, composed using image operations only (no 3D, GL etc) (it's better solution if you're loading images using browser, loading 144 images would take much more time)

Thanks for providing more insight :)
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

no problem...

Actually...
there are usually 4 images per chunk so for a 12 x 12 map that's 144 *4 plus the low rez map and its normal data.
Loading the texture is by far the slowest part of my app.
Even loading the models is a pain.
But.. I reuse any textures already loaded.. so this saves a lot.
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

SkaceKachna wrote: Currently I just use the color_tex as background and then apply the other layers, which works and looks nice, but somehow I feel this isn't the right way :(
There is nothing wrong with this...
As long as you are actually using the mix values. If not.. it wont even be close to the game's terrain.
Also.. there are the UV transforms that need to be done.. This could be done before applying them to the main texture.
I'd love to change the world but I can't get my hands on the code.
Mr.Mouse
Site Admin
Posts: 4059
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 439 times
Been thanked: 642 times
Contact:

Re: World of Tanks Map format.

Post by Mr.Mouse »

I get an error with Terra though. Clean full HD install of WoT.
I want to select the map Abby and then:
error_terra.png

Code: Select all

Zie het einde van dit bericht voor meer informatie over het aanroepen 
van JIT-foutopsporing (Just In Time) in plaats van dit dialoogvenster.

************** Tekst van uitzondering **************
System.IO.DirectoryNotFoundException: Kan een gedeelte van het pad C:\!!_ENSK\BWSG_DUMP\Chunk_00_0000.bin niet vinden.
   bij System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   bij System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   bij System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   bij System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost)
   bij System.IO.File.WriteAllBytes(String path, Byte[] bytes)
   bij Terra.Mod_Space_Bin_Functions.get_BWSG_data(Int32 t_cnt)
   bij Terra.Mod_space_bin.get_spaceBin_data(Byte[] spaceBindata)
   bij Terra.modZlib.open_pkg(String name)
   bij Terra.frmMain.pb1_MouseDown(Object sender, MouseEventArgs e)
   bij System.Windows.Forms.Control.OnMouseDown(MouseEventArgs e)
   bij System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   bij System.Windows.Forms.Control.WndProc(Message& m)
   bij System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   bij System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladen assembly's **************
mscorlib
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1063.1 built by: NETFXREL3STAGE
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Terra
    Assembly-versie: 0.1.0.3
    Win32-versie: 0.1.0.3
    CodeBase: file:///H:/Tools/Coffee_/Terra!/Terra.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly-versie: 10.0.0.0
    Win32-versie: 14.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
Tao.Platform.Windows
    Assembly-versie: 1.0.0.5
    Win32-versie: 1.0.0.5
    CodeBase: file:///H:/Tools/Coffee_/Terra!/Tao.Platform.Windows.DLL
----------------------------------------
System.Configuration
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Tao.FreeGlut
    Assembly-versie: 2.4.0.2
    Win32-versie: 2.4.0.2
    CodeBase: file:///H:/Tools/Coffee_/Terra!/Tao.FreeGlut.DLL
----------------------------------------
Tao.OpenGl
    Assembly-versie: 2.1.0.12
    Win32-versie: 2.1.0.12
    CodeBase: file:///H:/Tools/Coffee_/Terra!/Tao.OpenGl.DLL
----------------------------------------
Tao.DevIl
    Assembly-versie: 1.6.8.3
    Win32-versie: 1.6.8.3
    CodeBase: file:///H:/Tools/Coffee_/Terra!/Tao.DevIl.DLL
----------------------------------------
System.Data
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Data.DataSetExtensions
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
----------------------------------------
System.Numerics
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
PresentationCore
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1063.1 built by: NETFXREL3STAGE
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
WindowsBase
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1063.1 built by: NETFXREL3STAGE
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
Ionic.Zip
    Assembly-versie: 1.9.1.8
    Win32-versie: 1.9.1.8
    CodeBase: file:///H:/Tools/Coffee_/Terra!/Ionic.Zip.DLL
----------------------------------------
mscorlib.resources
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_nl_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Windows.Forms.resources
    Assembly-versie: 4.0.0.0
    Win32-versie: 4.6.1038.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_nl_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** JIT-foutopsporing **************
Als u JIT-foutopsporing wilt inschakelen, moet in het configuratiebestand voor deze
toepassing of computer (machine.config) de waarde
jitDebugging in het gedeelte system.windows.forms zijn ingesteld.
De toepassing moet ook zijn gecompileerd terwijl foutopsporing
was ingeschakeld.

Bijvoorbeeld:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Wanneer JIT-foutopsporing is ingeschakeld, worden onverwerkte uitzonderingen
naar het JIT-foutopsporingsprogramma gestuurd dat op de computer is geregistreerd
en worden niet door dit dialoogvenster verwerkt.
You do not have the required permissions to view the files attached to this post.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

Probably because it cant find the lighting settings file..

I'll be updating a new version soon.
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

Well....
It took for god damn ever but I managed to figure out how to project the decal textures.

I'm doing it with the CPU so its not real fast creating the meshes. I may look in to finding a way to do it using a shader or I might even save the meshes and export them..


In this Image you can see the decals mesh deformed to fit the terrain. Its made of a 32 x 32 cell mesh.
Image

In this image, I have turned on solid fill, blend and added the decal texture.
Image

Now The terrain is rendered as usual along with the new decals.
Image

Buildings and trees turn on.
Image

I had already wrote a function to find the Y point anywhere on the terrain's mesh..
I found out that it had a very BAD bug and it took me the better part of a day to find it.
Integers cant hold floating real numbers.. DUH!!!!

I have not verified the textures are not flipped..
I was so excited to share this I didn't take the time.. LOL!!!

EDIT: Yep.. Textures were flipped on V... All fixed now :)
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

Mr.Mouse wrote:I get an error with Terra though. Clean full HD install of WoT.
I want to select the map Abby and then:
I found the problem..
I left a write to the hard drive in the app.. It was for debugging and never took it out..
Sorry :(
I'd love to change the world but I can't get my hands on the code.
SkaceKachna
advanced
Posts: 66
Joined: Thu Jan 14, 2016 11:32 am
Has thanked: 9 times
Been thanked: 19 times

Re: World of Tanks Map format.

Post by SkaceKachna »

Wow, really good job. It looks like ingame now!
Mr.Mouse
Site Admin
Posts: 4059
Joined: Wed Jan 15, 2003 6:45 pm
Location: Dungeons of Doom
Has thanked: 439 times
Been thanked: 642 times
Contact:

Re: World of Tanks Map format.

Post by Mr.Mouse »

Coffee wrote:
Mr.Mouse wrote:I get an error with Terra though. Clean full HD install of WoT.
I want to select the map Abby and then:
I found the problem..
I left a write to the hard drive in the app.. It was for debugging and never took it out..
Sorry :(
Yeah, I figured it was a hard-coded path left somewhere. ;)
Is the new version up for download? I'll host it at Xentax as well if you like.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

I will update in a bit..
I have some clean up to do first.

A temp work around is to create these folders.
"C:\!!_ENSK\BWSG_DUMP\"

It was used to export all the vertex chunks when I was sorting that out.
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

SkaceKachna wrote:Wow, really good job. It looks like ingame now!
Thanks :)

Now I need the shadows. :?
I'd love to change the world but I can't get my hands on the code.
User avatar
Coffee
ultra-veteran
ultra-veteran
Posts: 518
Joined: Thu Aug 06, 2015 5:57 pm
Has thanked: 74 times
Been thanked: 205 times

Re: World of Tanks Map format.

Post by Coffee »

I am having real issues with the decals that over lap fighting the Z-buffer..

Does anyone an idea how to solve this?

I tried turning off depth testing but that causes more problems.

EDIT: I'm working on a shader for the decals... They need a lot more bump mapping!
I'd love to change the world but I can't get my hands on the code.
Post Reply