PDA

View Full Version : COD2 Prop Flag Model to COD1 Via Blender



Tally
12th October 2014, 15:02
Hello

I asked serthy to do this for me but he is busy right now with college work, so he suggested I ask someone else:

I have been commissioned to port my demon mod COD2 to COD1. In particular, CTF gametype. I am having problems exporting the prop_flags to COD1 using Blender. The exporter plugins by CODEMANX are so outdated they no longer work (error - Mesh faces have no attributes). So, I am asking if anyone can get the exporter to work?

Also, my main problem is with the differences between the COD1 engine and COD2 - in COD2, the waving flag is done with materials. In COD1, using the Quake 3 engine, it is done by manipulating the skin. This is done with something called "tcmod". The problem is, as the COD2 prop_flags use 1 texture for both flag pole and flag itself, the whole thing waves. So, I am wanting the UV map to be separated into 2 - 1 for the pole and 1 for the flag itself.

Third problem - the COD2 prop_flag model has too many vertices on the flag itself. When you use the Quake 3 "tcmod" to flag, the flag ripples quite dramatically. I would want the number of vertices reduced to about 4. The flag model from United Offensive uses 4 vertices for the whole face of the flag, creating a nice ripple effect.

If someone could do these things for me I would be eternally grateful. Given enough time I could probably get Blender to start exporting again, but I simply don't have the time. I only need 1 prop_flag and 1 prop_flag_carry model done. Also, I need to use XMODEL_EXPORT v5 as v6 is very different from COD1, as Infinity Ward used 3D Studio Max, and the format of the export file is very different. I can do a lot of it by editing the file by hand, but the primary information must be in v5 format.

As I say, I will be eternally grateful to anyone doing this for me.

this is as far as I have gotten so far:

782

I did this about a year or so ago, when the Blender plugin was working. But as I say, it don't work now! So, I am stuffed.

EDIT -

If anyone is wondering why I don't just use the UO flag models the answer is two-fold:

1. There are no carry models in UO.
2. The flag models are not so much flag poles as telegraph poles! They are huge! And if I try to sink them into the ground, so as to show as much as I want, on some maps the model is rendered invisible. This is due to the shader manipulation settings for some textures on some maps - they use a clip definition which stops models sinking into them.

kung foo man
12th October 2014, 18:53
Can't you just use an old Blender version?

http://download.blender.org/release/

(personally I never worked with CoD1/Blender)

Tally
12th October 2014, 19:11
Can't you just use an old Blender version?

http://download.blender.org/release/

(personally I never worked with CoD1/Blender)

I think you've misunderstood me. I am not talking about issues of Blender from 2006. I am talking about the most uptodate versions. Currently, I have tried 2.62, 2.63, and the most recent one 2.72. The plugin that CodeManX created for Blender works on all COD games - including Version 5. But the plugins just don't work anymore for some reason.

I was given to believe by serthy that you know how to use Blender. Is that not the case?

vanfreddy
12th October 2014, 19:33
hi all
here i hope its what u need http://www74.zippyshare.com/v/2999046/file.html
its the texture and export files i have no modtools to test
i reduced the face count to 39 the flag use 4, i splitted into 2 object and made new uv map for both so u can use now 2 materials (both share the same at the moment).if all works i can uplaod u my blender version with plugins too

kung foo man
12th October 2014, 19:35
Chatted a bit with php, since he is too lazy to write directly (he approved that I could paste it):



php: i would help him
php: but 2muchwork
php: and its UO
php: btw
php: blender works ifne
php: fine*
php: for one material/group iirc
php: so
php: #REKT
php: 2 other options
php: a) MS3d
php: b) http://killtube.org/showthread.php?1946-COD1-Export-any-playermodel-COD2-4-5-6-BO-BO2-GHOSTS
php: use the tweaked maya tools
php: i made
php: i wish him very gl on trying to do more than 1 group'd/material
php: in blender-cod
php: addon
php: LEL
kung foo man: i would use maya also
php: no but i mean
php: ive used blender
php: a lot to try
php: to export models/anims
php: before those maya tools
php: (some guy made in cod5)
php: i ported to cod1
php: it was a pain in the arse
php: ms3d = fucked up rotations
php: blender = cant have more than 1 group
php: it'll merge all groups
php: into 1
php: when export
php: AKA = 1 material max
kung foo man: ah
php: blender for anims
php: is eeeeeeh
php: sux
php: maya is best
php: i would then use ms3d
php: over blender
kung foo man: its static model lol
php: Yes
php: but still for static
php: ms3d = 90 degree rotations messed up
php: if u export
php: blender = 1 max mat/group
php: maya = perfect with
php: new tools
kung foo man: > realizing living in year 2014 and ms3d is too stupid to be rewritten easily
php: i made one
php: i dont know if i told u
php: i made a dll for ms3d
php: which fixed the 90 degree
php: it worked for static models
php: :p
php: also i had a obj > xmodel_export
php: but files lost
php: i think
kung foo man: ah



Well TL;DR: even if the Blender plugin is working, it might not support multiple materials, hence suggested to use Maya. I don't know though if the Personal Learning Edition supports plugins: http://extras.springer.com/2005/978-0-387-00176-0/Maya6PLE

I just worked with Maya (since the Blender UI is the worst interface I've ever seen, lol).

Tally
12th October 2014, 20:43
hi all
here i hope its what u need http://www74.zippyshare.com/v/2999046/file.html
its the texture and export files i have no modtools to test
i reduced the face count to 39 the flag use 4, i splitted into 2 object and made new uv map for both so u can use now 2 materials (both share the same at the moment).if all works i can uplaod u my blender version with plugins too

Thank you very much vanFreddy for trying that. I will tell you the results:

1. The low poly flag is quite good, only it deforms when up close. Perhaps you went too far in reducing it?
2. The model is still using 1 UV map and when I make the flag wave, the pole does as well. It needs to be 2 materials with different names.
3. The prop flag from COD2 does not stand up in Blender. You have to orientate its axis 90% to make it stand up. When I spawn your model, it is laying on its side. I can adjust the angle manually, but it is easier if the model already has the right angles.

We are nearly there, but not quite!

vanfreddy
12th October 2014, 21:45
ok i tried to fix the things i rotated hopefully in the right direction ;), made a copy of the texture with new tag "_pole" at the end now it should be 2 materials with different name and doubled the face count of the flag.

http://www21.zippyshare.com/v/8551448/file.html

Tally
12th October 2014, 22:28
ok i tried to fix the things i rotated hopefully in the right direction ;), made a copy of the texture with new tag "_pole" at the end now it should be 2 materials with different name and doubled the face count of the flag.

http://www21.zippyshare.com/v/8551448/file.html


Excellent! The flag is still not upright (it is upside down - I have to spin it 180%), I can now make the flag wave without the pole being affected.

Now, the carry flag is round the wrong way. Here is a picture to show you:

783

It is pointing from front to back, whereas it should be from the back of the character model to the front - being attached from the shoulder blade to the front pelvis. Now, if you could please spin it round so that is like the one in the russian picture above, that would be fantastic.

vanfreddy
12th October 2014, 22:56
ok first 90 was wrong now its 180 then -180 should do the job :D
http://www39.zippyshare.com/v/45710920/file.html

Tally
12th October 2014, 23:35
Perfect! I can't thank you enough. I had you running round, I know, and I'm sorry for that. But the end result was really worth it.

When I'm all done, I will post a video showing it all in action.

Thank You!

vanfreddy
12th October 2014, 23:52
thank you , nice that I could help , I'm looking forward to see the result :)
here then for all other flags :) http://www60.zippyshare.com/v/80324050/file.html

Tally
13th October 2014, 12:23
Revisting this again - After trying many, many different deformVertexes (which is a Q3 texture mod), I have found the flags now have too few vertices. It looks like a piece of flapping cardboard. I would say the vertices need to be double what they are now (it looks like 3 or 4). So, 6 or 7 for the flags themselves.

this is of course, all assuming you have the time and patience to redo them for me.

BTW - I only need 1 of each. I can always hex edit the names of the flags myself.

php
13th October 2014, 12:27
Did you also experiment with the tessSize?

Tally
13th October 2014, 12:38
Did you also experiment with the tessSize?

I have no idea what tessSize is. So, obviously, no I didn't.

php
13th October 2014, 13:45
Is this something you're looking for?
You can play around with the shader if you want.

http://cod1.eu/gif/flaggy.gif

shader


{
surfaceparm cloth
cull none
tessSize 512
deformVertexes flap s 256 sin 16 16 0 .25
{
map $texturename
rgbGen lightingDiffuse
}
}

vanfreddy
13th October 2014, 13:54
hi ok here is a version with more faces http://www27.zippyshare.com/v/41550713/file.html
and for other flags u dont need hex editing just rename the export file open with text editor and change the 2 texture lines at the bottom

Tally
13th October 2014, 14:41
hi ok here is a version with more faces http://www27.zippyshare.com/v/41550713/file.html
and for other flags u dont need hex editing just rename the export file open with text editor and change the 2 texture lines at the bottom

Thanks for that freddy. I appreciate your hard work.

As for using a Hex editor vs renaming the EXPORT file, when you run the compiler, the xmodelparts and xmodelsurfs file output is named 0. Hence, when you run a renamed EXPORT file, it too produces files named 0, and the tools give an error that there is a conflict between 1 set of files, and another. The only way around this is to either delete the first entry, or rename the xmodelparts and xmodelsurfs to match the name of the xmodel file, with a 0 on the end.

In all, it is quicker and simpler to Hex edit all the files.

Tally
13th October 2014, 14:42
Is this something you're looking for?
You can play around with the shader if you want.

http://cod1.eu/gif/flaggy.gif

shader




{
surfaceparm cloth
cull none
tessSize 512
deformVertexes flap s 256 sin 16 16 0 .25
{
map $texturename
rgbGen lightingDiffuse
}
}


that's exactly what I am looking for. I didn't know about the tessSize attribute. I googled it when you first mentioned it but didn't see any relevant returns.

Thanks for the info!

Tally
13th October 2014, 17:21
For those of you who are interested - the following is from the Q3 Shader Manual on deformVertexes wave function:


3.3.1 deformVertexes wave <div> <func> <base> <amplitude> <phase> <freq>
Designed for water surfaces, modifying the values differently at each point. It accepts the standard wave functions of the type sin, triangle, square, sawtooth or inversesawtooth. The "div" parameter is used to control the wave "spread" - a value equal to the tessSize of the surface is a good default value (tessSize is subdivision size, in game units, used for the shader when seen in the game world) .


http://www.heppler.com/shader/

In the COD1 engine, which is in fact the heavily modified Return to Castle Wolfenstein engine, "wave" is replaced with "flap" (just like they replaced "ClampMap" for "map clamp"/"map clampy"/map clampx").

Tally
13th October 2014, 18:12
Well, I hate the new XFire. What on earth did they do to it? It used to be so much easier to use. And now, you cannot locate your video files online unless you first launch the program.

Anyways, here is a video of me testing CTF gametype with the new flags (warning - you need good bandwidth to watch this):

http://social.xfire.com/video/62d9e9

(sorry for the poor quailty - I need to make adjustments to get it looking better)

The flags wave beautifully now. They have a real liquid flow to them, whereas before they were like cardboard - not very realistic at all.

I've only been working on this mod for a week and already I have run into a number of hurdles. Making the spinning FX took 2 days as I got to grips with the differences in the engine. The COD1 Quake 3 engine is very different from COD2. You cannot manipulate particles in COD1 like you can in COD2. For example, there is only 1 color for light - yellow. You cannot color it like you can in COD2. And forget the RGB functions - they are useless! In COD2 you can manipulate a particle with 6 parameters; in COD1 you have 2.

Then there is the scripting. You cannot remove something from an array after you've destroyed it - it returns an error that "the dead entity is not a valid entity". You have to remove it from the array before you destroy it, making it difficult to locate the entity you want to remove from the array once you've done so.

Other than that, all is going well. I pretty much have the heart of the mod done now - everything is broken down in universal files, so I only have to make changes to one thing in order to affect all gametypes. This is the most time consuming and least fun, but once it's out of the way, I can crack on with the fun stuff.

Anyways, to all who read this, thank you for indulging me.

guiismiti
14th October 2014, 00:41
Well, I hate the new XFire. What on earth did they do to it?

http://classic.xfire.com/download/

The new xfire reminds me of those websites crowded with moving ads. It took me like 3x longer to find something, compared to the classic version. Sometimes I even forgot what I was trying to do

serthy
14th October 2014, 16:56
Give Raptr (http://raptr.com/) a try: it handles xFire Steam & co. in 1 client similar to xf

Tally
14th October 2014, 18:49
Damn! The COD1 engine is hard to work with. I added some weapon models to each team - about 4 - and I've already run out of gamestate (which is 16k)! Jesus! I am going to have to re-think this whole project now. Maybe, just work with 2 teams - Germans and US Airborne? That would keep the asset numbers down.