Contributing in 3D?

Discuss the future of Warzone 2100 with us.
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: Contributing in 3D?

Post by kage »

the original writer of the pie scripts decided to divide all coord values by 128 on import, and multiply by 128 on export. i don't know why -- may have been completely legitimate reasons, but it doesn't really matter to me: when i started working on that codebase, i kept it that way (by default) to stay backwards compatible (and possibly avoid angering the various blender vm gods).  you can, however, change the scale to whatever you want -- increase it past 1.0 to make the imported objects larger, but make sure you use the exact same scale value on export, or it'll be the wrong size in warzone.

if the exporter gives you errors (yours probably wasn't an error, but more of a "i've got nothing to work with" warning), it should provide you with an error log that you can save somewhere (if everything was set up correctly).

with regards to the exporter, i set it up to only try to export objects that have names starting with "PIE_" -- everything after that underscore is what the exporter will try to use as the export filename.  also, the PIE_* objects need to have at least one LEVEL_* object as children.  the shortest way to demonstrate all this is to import a valid pie and look at the object names -- duplicate that naming scheme (the '.001', '.005' type stuff at the end is silently ignored -- don't worry about it).

btw, with regards to export, can a developer tell me if pie2 is still the only supported pie format in warzone?
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: Contributing in 3D?

Post by DevUrandom »

If something's missing here, please ask and add: http://wiki.wz2100.net/PIE_models
User avatar
cathuria
Art contributor
Posts: 48
Joined: 08 Nov 2007, 00:15

Re: Contributing in 3D?

Post by cathuria »

oookay... there's places where I know what I'm doing... than there's places where I feel like a goof.

I've taken some time to learn a little about Blender, but I'm a newbie to both Blender and Linux.  I've dissected some of the PIE models that came with the game, and I think I've got my model set up right, parented to an empty with the right names.  (Although it's starting to look like it should actually be in two pieces, one for the "turret" and one for the "gun".)  But as far as I've gotten with the exporter plugin is to the last step where it tells me "Script error - check the console."  I have no idea what that's about because I can't see a trace of an error report anywhere... but lo + behold, in searching for that I find the resulting .pie file in my home directory.  So I seem to have a pie model -- although from what I've seen from the original pie's, this one will have to be split up or at least have the UVs redone, but it may serve as proof of concept.

Of course, I haven't the vaguest notion of what to do with it next... ???

EDIT: aha... additional clue: when I try to export to pie2, I get an empty file, but exporting to pie5 gives me a complete model file, albeit with the same error message in Blender.  This might have something to do with the relatively higher poly count... ?
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: Contributing in 3D?

Post by kage »

cathuria wrote: oookay... there's places where I know what I'm doing... than there's places where I feel like a goof.

I've taken some time to learn a little about Blender, but I'm a newbie to both Blender and Linux.  I've dissected some of the PIE models that came with the game, and I think I've got my model set up right, parented to an empty with the right names.  (Although it's starting to look like it should actually be in two pieces, one for the "turret" and one for the "gun".)  But as far as I've gotten with the exporter plugin is to the last step where it tells me "Script error - check the console."  I have no idea what that's about because I can't see a trace of an error report anywhere... but lo + behold, in searching for that I find the resulting .pie file in my home directory.  So I seem to have a pie model -- although from what I've seen from the original pie's, this one will have to be split up or at least have the UVs redone, but it may serve as proof of concept.

Of course, I haven't the vaguest notion of what to do with it next... ???

EDIT: aha... additional clue: when I try to export to pie2, I get an empty file, but exporting to pie5 gives me a complete model file, albeit with the same error message in Blender.  This might have something to do with the relatively higher poly count... ?
you can keep the turret and weapon as one pie, but there's no way to have it visibly aim up and down in the game that way.  the blender pie tools won't ever intentionally just error out -- if they're in control of what's happening, they'll report it in the makeshift logging gui i pieced together -- if it says check console, you're out of luck if you're running it from some kind of gui menu or "shortcut" (in any operating system) -- if you're in linux, just open up a "terminal" (xterm, terminal, kterm, whatever), type 'blender', press enter, and it'll load: then, if you can replicate the error, it'll be printed to the terminal from which you launched blender.

i don't recall how the plugins handle poly and vertex counts, but no matter what, at worst, they'd warn and let you continue the desired operation.
User avatar
cathuria
Art contributor
Posts: 48
Joined: 08 Nov 2007, 00:15

Re: Contributing in 3D?

Post by cathuria »

heigh ho -- back at it again.  The good thing is I'm finally learning a bit more about Blender.  Anyhow, I've double checked the construction of my Blender file and it appears (at least as far as my knowledge of Blender extends) to be set up identically with some samples from the WZ resources.
The error I keep getting is as follows:

Traceback (most recent call last):
  File "/home/.blender/scripts/pie_common.py", line 173, in _evt
    retval = self._process()
  File "/home/.blender/scripts/pie_common.py", line 153, in _process
    return func(self)
  File "", line 268, in export_process
  File "", line 92, in fs_callback
ValueError: layer name does not exist
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: Contributing in 3D?

Post by kage »

oh... one of those bugs a developer doesn't find until they actually have a user  :o

essentially, i'm looking for a uv layer called "teamcolor_meta", which fully supports wz-style teamcolor data in a kind of rigged up way, and i need to write another plugin to actually handle that stuff (since it's unlikely to be usable directly by humans).  anyways, to get passed all that, you need to make sure that each of your LEVEL_* objects have, when viewed in the editing panel (f9, or that button showing a box), two items under "UV Texture": one called "base" and the other called "teamcolor_meta". you shouldn't have to do anything beyond that to fix this problem, and i need to add checks for that.

a good way to make sure the plugins are working properly (at least from my perspective) on your system is to open blender, import a valid pie, then immediately export it, and if it's still valid (loads in warzone, or pie slicer, or pie toaster, or whatever), then at least the plugins work as well as they did for me.
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Contributing in 3D?

Post by Buginator »

cathuria wrote: heigh ho -- back at it again.  The good thing is I'm finally learning a bit more about Blender. 
Cathuria, if you want, you can attach your model so that kage or others can look at it, and then when they fix whatever, they could attach it again.  Or if you don't want to release the model yet, you can PM the people that know, or perhaps get on IRC  and they can help that way.
and it ends here.
User avatar
cathuria
Art contributor
Posts: 48
Joined: 08 Nov 2007, 00:15

Re: Contributing in 3D?

Post by cathuria »

Okay, kage, that seems to have got it.  I exported what appears to be a proper pie2 model file and png texture.  Of course, I still have no idea what to do with it... and it probably needs real team color data and maybe should be split into two parts... but at least the performance of a higher poly turret can be tested.

I have no idea how to get it into the game at this point however, never having done any WZ modding.  Is there a tutorial on that somewhere?  And I'm perfectly happy to upload it somewhere for you & others to fiddle with, too.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Contributing in 3D?

Post by Per »

Try attaching it to a forum post. I'll look into integrating it into the game, if nobody else beats me to it.

I am not sure if there is any documentation that covers this.
"Make a man a fire, you keep him warm for a day. Set a man on fire, you keep him warm for the rest of his life."
User avatar
lav_coyote25
Professional
Professional
Posts: 3434
Joined: 08 Aug 2006, 23:18

Re: Contributing in 3D?

Post by lav_coyote25 »

there is ... old information though which mentions the  .WDG 


http://docs.wz2100.net/readme-PIE%20Sli ... guide.html


the tutorial was put together by Dancing Moogle.
‎"to prepare for disaster is to invite it, to not prepare for disaster is a fools choice" -me (kim-lav_coyote25-metcalfe) - it used to be attributed to unknown - but adding the last bit , it now makes sense.
User avatar
cathuria
Art contributor
Posts: 48
Joined: 08 Nov 2007, 00:15

Re: Contributing in 3D?

Post by cathuria »

Thanks for the link... but it may be a little bit before I can start tinkering -- people keep piling things on my plate.

Anyhow, for those who want to mess around with it...
http://www.cathuria.com/improbable/ecmv2.zip

If anyone gets it up & running, let me know what needs doing on it.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Contributing in 3D?

Post by Per »

I could not get it working. It seems that the PIE is corrupt. The animation flag is set, even though there are no animations? Even if I remove it, it fails. Kage, any ideas?
"Make a man a fire, you keep him warm for a day. Set a man on fire, you keep him warm for the rest of his life."
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Contributing in 3D?

Post by Buginator »

I could get it to show up in pie toaster, but not pieslicer or work in the game.  AFAIK, if it don't work in pieslicer, it will not work in game.

Someone needs to make a tutorial on how to do all this stuff.

Or maybe better error checking with the conversion scripts?  But, since I have no idea what the issue is (pieslicer didn't give details), and the crash (assert) in the pie loading code is :
ASSERT( tWidth > 0, "_imd_load_polys: texture width = %i", tWidth );
ASSERT( tHeight > 0, "_imd_load_polys: texture height = %i", tHeight );

So it looks like it has something to do with the texture coords.  I even used the default texture from the radar unit, and it still didn't like that.

I tried changing the 4200 3 0 2 1 0 -5 0 0 26 152 26 177 33 164 into 200 3 0 2 1 0 -5 0 0 26 152 26 177 33 164, but that didn't help.
and it ends here.
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: Contributing in 3D?

Post by kage »

it'll be a while before i can manage to work on this (possibly this weekend).  it may be a blender interperetation issue -- i forget how blender assigns uv coords to polys, but it may well be my previous advice of adding another uv texture forced blender to assign that texture to every poly (thus having every poly exported as an anim).

buginator: changing the pie poly type from 4200 to 200 must be accomanied with a reduction in the number of following fields.

4200 3 0 2 1 0 -5 0 0 26 152 26 177 33 164

the bold, red fields represent animated data. thus the following is correct:

200 3 0 2 1 26 152 26 177 33 164

http://members.shaw.ca/kgmetcalfe/readm ... cture.html is a perfect resource for this.
User avatar
Deathguise
Trained
Trained
Posts: 85
Joined: 06 Jul 2007, 20:08
Location: UK

Re: Contributing in 3D?

Post by Deathguise »

Got it working in game :

http://i192.photobucket.com/albums/z147 ... 8/ECM2.jpg

The problem was the team color settings, specifcally the amount of frames, width and height settings for a hand full of poly's.

What i did to fix the team color stuff was open the .pie file in a very early version of pieslicer (im guessing it does not have the same error checking as the version of pieslicer others have used) and remove all the team color stuff and that was it.

When ive got a bit more spare time ill try importing the fixed model into blender and then re exporting to check it's still valid.

Cathuria: It's quite an impressive model and if it's ok with you ill attach the fixed .pie file.
"Abandon All Hope" - Chiggy von Richthofen