Question about texpages

Improving the artwork in Warzone2100 - not for mod discussions
Puhdoo
Trained
Trained
Posts: 45
Joined: 20 Sep 2009, 17:54

Question about texpages

Post by Puhdoo »

hello hello,

A few days ago I started creating a mod. It should finally include some new stuff, e.g. a Body for units.
But before modelling more detailed objects I wanted to know the process.
So I already installed Blender and made my first Body. I didnt want to use the default cube directly, still
my model isnt much more than that :D

I also installed WMIT and was able to view some existing models, e.g. the viper body.
So I baked the AO from my model, gave it a green color in GIMP, nothing complex, and was able to
view my model in WMIT correctly.

To check it ingame I made a little mod.wz including a 'drlbod01.pie' (which is my own model.pie, going to replace viper)
and a 'page-14-droid-hubs.png' with the green AO-based texture I made. Those are in the respective folders of course
(/components/bodies, /texpages).

Now the viper is successfully replaced with my model.
Only the texture isn't applied as desired. I tried different colorings, but it seems to take just the color
of the left top pixel in my 'page-14-droid-hubs.png'-file and applies this color to the whole body.

Now I'm not sure where the information is stated, which part of the texpage it should use for a specific model.
In the .pie's I couldn't find such information. (btw I just copied the connectors from the standard viper-body into my
own .pie so that at least the turrets show up)
When I look at the original 'page-14-droid-hubs.png' there are all bodies within just one file, so
somehow it must know which parts from that belong to viper, which belong to retaliation etc...

So how does it know that?
And how do I need to order my texpage-content to apply my "texture" correctly?
Attachments
mod.wz
(1.86 KiB) Downloaded 417 times
IngamePic.png
IngamePic.png (64.97 KiB) Viewed 9129 times
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Question about texpages

Post by Jorzi »

You need to UV-unwrap your model over the texture image, check youtube for UV-unwrapping tutorials ;)
ImageImage
-insert deep philosophical statement here-
Puhdoo
Trained
Trained
Posts: 45
Joined: 20 Sep 2009, 17:54

Re: Question about texpages

Post by Puhdoo »

Hiho, thanks for the quick reply.

I watched some Youtube-Tutorials about UV unwrapping and in fact I've already got one :)
(see attachment, I hope thats what you mean, created in blender with the 'Smart UV-Project'-function)

So do I need to color this one?
I guess those lines need to remain for orientation inside the texpage then (for .pie to interpret)?

Regards
Attachments
It's not the original one, I had to resize it for upload. The original one is 1024x1024.
It's not the original one, I had to resize it for upload. The original one is 1024x1024.
UVraw.png (13.07 KiB) Viewed 9122 times
Puhdoo
Trained
Trained
Posts: 45
Joined: 20 Sep 2009, 17:54

Re: Question about texpages

Post by Puhdoo »

ok bad try XD

I colored it in GIMP, see screenshots, and packed it into the mod.wz, replacing that page-14...-file.
Still the same ingame.
Completely wrong way?
Attachments
GIMPcolored.PNG
GIMPcolored.PNG (46.41 KiB) Viewed 9120 times
GIMPbefore.PNG
GIMPbefore.PNG (59.09 KiB) Viewed 9120 times
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Question about texpages

Post by Jorzi »

The lines are just help lines and should not be part of the texture. You can also try texture paint mode in blender if you want to paint the texture in 3d straight onto the model.
ImageImage
-insert deep philosophical statement here-
Puhdoo
Trained
Trained
Posts: 45
Joined: 20 Sep 2009, 17:54

Re: Question about texpages

Post by Puhdoo »

Hmm that doesn't work...

I tried the following:
- Painting in 3D and then unwrapping to UV, taking a png from that.
- Unwrapping to UV first, then painting texture on it in GIMP and export as png.
- As the above didn't work I thought that my UV (created with Smart UV-Project) might be incorrect, so
I unwrapped it manually face after face, but it didn't work and can't be the way for bigger models I think.
- I also tried it with exporting my UV without a texture, then texturing it in GIMP, importing this as a texture in Blender again,
then applying the texture in accordance to the same UV again, baking this with 'FullBake' and taking a png from that. Didn't work too, and is a bit like walking in a circle O_o

So the UV is basically just to have the correct 2D-Projection of all the objects faces,
to paint the texture onto the right area, did I get that right so far?
Jorzi
Regular
Regular
Posts: 2063
Joined: 11 Apr 2010, 00:14

Re: Question about texpages

Post by Jorzi »

Yes, it is only there to define which parts of the image get mapped where on the model.
To actually display the texture in blender's renderer you need to set up a material with a texture. In the material's texture you load the image and set the mapping to UV.
ImageImage
-insert deep philosophical statement here-
Puhdoo
Trained
Trained
Posts: 45
Joined: 20 Sep 2009, 17:54

Re: Question about texpages

Post by Puhdoo »

So I did :)

Yesterday I also tried the way described in that tutorial: http://developer.wz2100.net/wiki/Creating3DContent
except that I made the .pie out of WMIT.
So I'll probably try with another model again, it looks like the UV of the current one is somehow wrong, even if it looks accurate.

Thanks for the help so far.
Puhdoo
Trained
Trained
Posts: 45
Joined: 20 Sep 2009, 17:54

Re: Question about texpages

Post by Puhdoo »

Still haven't got it :stressed:

At least the mod setup seems to be correct... yey success.min()
Attachments
Viperchange.png
Viperchange.png (225.71 KiB) Viewed 9083 times
Puhdoo
Trained
Trained
Posts: 45
Joined: 20 Sep 2009, 17:54

Re: Question about texpages

Post by Puhdoo »

Hello again,


I tried it today with another simple model.
Somehow it still doesn't work :|

I uploaded all the blender files I used this time, and the mod.wz which includes the textured AObake
and the slightly modified .pie-file.
Before making AObake I UV unwrapped the model and ordered the faces a bit, so that they are not directly at the border, and that
the different faces dont have connections, I'm not sure whether this was the problem with my last model.

The .pie-file was created with WMIT again, after exporting .obj from blender, and scaling it up a bit in WMIT.


Maybe someone can check this, thanks in advance.
Attachments
blenderfiles.zip
(75.34 KiB) Downloaded 413 times
mod.wz
(4.16 KiB) Downloaded 412 times
Puhdoo
Trained
Trained
Posts: 45
Joined: 20 Sep 2009, 17:54

Re: Question about texpages

Post by Puhdoo »

This information might be useful for anyone who wants to help me...

- I play version 2.3.9 on Windows 7 64bit, and my mod is for warzone-version 2.3.9
- Blender version 2.63
- GIMP 2.8.0

Thanks and Regards,
Puhdoo
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: Question about texpages

Post by Berg »

Puhdoo wrote: I play version 2.3.9 on Windows 7 64bit, and my mod is for warzone-version 2.3.9
This version of warzone does not support PIE3 format you should be using PIE2 format.
I think the version of wmit you using only exports PIE3.
I opened your files you uploaded and noted that the pie files has errors.

Code: Select all

PIE 3 <---2.3.9 dont like this format try running your models in 3.1
TYPE 0 <----this is not a correct flag type
TEXTURE 0 page-14-droid-hubs.png 0 0
LEVELS 1
LEVEL 1
POINTS 8
	-11.1198 19.4325 -58.1179
	-18.3852 25.9256 21.2812
	-31.0214 5.60723 18.401
	-28.0316 6.09768 -37.9804
	29.5767 6.09768 -38.7599
	13.3203 19.399 -58.6242
	35.8163 6.09768 18.1905
	21.6596 26.5153 20.8164
POLYGONS 12
	200 3 0 1 2 0.16878 0.963757 0.108133 0.368423 0.0125 0.403865
	200 3 0 2 3 0.16878 0.963757 0.0125 0.403865 0.039681 0.823525
	200 3 3 4 5 0.548432 0.404152 0.979393 0.399411 0.858548 0.250065
	200 3 3 5 0 0.548432 0.404152 0.858548 0.250065 0.675712 0.253389
	200 3 4 6 7 0.476903 0.812292 0.518743 0.387352 0.413993 0.355852
	200 3 4 7 5 0.476903 0.812292 0.413993 0.355852 0.357882 0.953125
	200 3 1 7 6 0.826316 0.051119 0.526724 0.047841 0.421155 0.202056
	200 3 1 6 2 0.826316 0.051119 0.421155 0.202056 0.921156 0.204432
	200 3 1 0 5 0.10784 0.064346 0.168487 0.65968 0.351339 0.661548
	200 3 1 5 7 0.10784 0.064346 0.351339 0.661548 0.407451 0.064275
	200 3 6 4 3 0.983269 0.946008 0.96986 0.517644 0.539765 0.489939
	200 3 6 3 2 0.983269 0.946008 0.539765 0.489939 0.484655 0.908706
the TYPE flag on your pie model should be either 200 or 10200 read the pie format define in the wiki ..2.3.9 does not support 10200 flag
I tried converting your obj 2 pie2 format but points positions are so small its hard to upscale from -0.121756 0.171693 0.140935 floats to a reasonable points size.
Note about wazone scale a tile in the map is 128 pixels by 128 pixels.
Also you do not have and connectors defined at the end of your pie files I dont know if you omitted them on purpose just something for you to look into. http://developer.wz2100.net/wiki/PIE_format
good luck
Puhdoo
Trained
Trained
Posts: 45
Joined: 20 Sep 2009, 17:54

Re: Question about texpages

Post by Puhdoo »

Hello Berg,

actually the Type 0 is just a fault in the uploaded file, I had this set to 200 in the mod-files :)

Thank you for the link to study the pie format... 10200 was already planned for making teammasks later on...
not anymore XD

The strange thing is that I was always able to see the bodies shape ingame, but the texture was taken from the first top-left
pixel of my texpage and applied to the whole body... thats why I suspected the UV mapping to be incorrect O_o

Leaving out the connectors was just lazyness while trying...
I tried it once with copying the connectors from the normal viper-body and that worked, so I didn't pay attention to
connectors for the moment.

Regarding the scaling I need to check this in blender again, thats probably the same reason why my model
was so small in WMIT. (After loading a new obj the model was inside the axis first)
I created the same blender-grid described in http://developer.wz2100.net/wiki/Creating3DContent,
as a basis for modelling.

Many thanks, I'll definitely take a look at the pie format definitions from your link as a next step.


btw can I just change the first line to PIE 2?
I tried that already because I saw PIE 2 in my original warzone-files (e.g. 'drlbod01.pie')...
So I would change this still in the future, have to edit the file anyway
User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: Question about texpages

Post by Berg »

Just some random notes on pie scale

If you look in your pie files you will see points set out with co-ords of 0 - 128 for example

if you are using a one tile wide model that will be -64 to 64 as this in total will be 128 as 0 is the centre point of your model.

If you wish to make a model that covers 3 tiles the co-ords will be up too -64x3 to 64x3.
The Heights Of structures General guide.

Walls outside points that join to other walls = Y 78
Do note that the outmost edge of a wall must be exactly 64 and -64 receptively to make it match the wall next to it and or hardpoint

Harbpoints centre Turret height = Y 120

HQ highest point where radar turret sits = Y 235 to 245

Power Gen central spire = Y 164

Factory highest point = Y 125

Research centre highest point = Y 97

Note: This is not all the structures just the main ones as a general guide.

Droid Dimensions


Buggy Body = front z 26, back z -26, left/right x 15 -15, height y 0 22

light tank = front z 28, back z -34, left/right x 14 -14, height y 9 22

Medium tank = front z 41, back z -38, left/right x 17 -17, height y 9 30

Heavy Tank = front z 47, back z -47, left/right x 19 -19, height y 9 35

super Tank = front z 58, back z -68, left/right x 50 -50, height y 14 57
Puhdoo
Trained
Trained
Posts: 45
Joined: 20 Sep 2009, 17:54

Re: Question about texpages

Post by Puhdoo »

Ok I made a new setup-file in blender with accurate sizes.
So I can easily see how big the model will be ingame and dont have to resize it in WMIT anymore.

The problem is still the same though...
it doesn't apply the texture :| , the body is there - I can see the edges of the shape^^

thanks for the standard model sizes, helped me already to configure blender :)

So probably I still make a mistake in UV mapping/baking/texturing.
Maybe you can try if it is visible ingame for you,
or doublecheck the pie-file etc if you like - see attachment :wink: - but should be correct now,
I added the connectors from viper again, and the constructiondroid-turret shows up correctly ingame.
PIE 2 and TYPE 200 is set.

Thanks and Regards
Attachments
mod.wz
(27.46 KiB) Downloaded 394 times
Post Reply