[?] Help Exporting a Rocket / Missile Projectile

Making or wanting help making your own asset? Check in here
Post Reply
Tim270
PR:BF2 Developer
Posts: 5166
Joined: 2009-02-28 20:05

Re: Questions about exporting

Post by Tim270 »

Grober wrote:Well im trying to export a rocket for PR and its my first bundle mesh that i export there for i have a few questions.
A rocket/projectile to be shot/used on a aircraft or vehicle or a weapon launcher?
Do i have to specify where is specular map?
No, the specular map either goes in the Alpha channel of the Normal map _b.dds or the diffuse _c.dds Remember, only use Alpha channels where you need them, typically you only use the alpha channel in one map, use both if you are working with a object with transparency as well as a specular map.
Is shadow map at materials a specular map?
No. Leave it blank.
Or its allways at alpha channel of Color map?
It can be in the Normal or Diffuse/Colour map. I Could be wrong, it has been a while. Most likely best to stick with it in the colour channel, save as DTX5 (alpha channel) then save your normal map as DTX1 (no Alpha) to save on memory.

Is there a way to scale objects after they are exported?[/QUOTE]

No. It has to all be done in 3ds max first.
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: Questions about exporting

Post by Rhino »

Grober wrote:But how can i select where is alpha?
Tim is correct on it can be either in the _c or _b texture's alpha channel and its controlled by what Shader Technique you apply to the material inside 3DsMax.

"ColorMapGloss" will use the alpha channel from the colours/_c alpha channel and leaving the material name blank will use it from the normals/_b alpha channel.

If there are going to be multiple colours of this missile on the same map, ie, multiple versions using different diffuse/colour/_c textures, then its best to have the spec in the normal map as saving the texture in DXT1, without an alpha channel, costs 1/2 as much memory as saving the same texture in DXT5, with an alpha channel. As such if your having multiple colours of the same object on the same map, its a good idea to have them all sharing the exact same normal and spec map from the normal/_b texture sheet, and then just having each one with its own unique colour texture saved in DXT1, like what I've done for the different Arige A-4s for the next PR:F update, and you get lots of diffrent colour versions at only a little extra cost, but if each version/colour was saved in DXT5 with its own spec map, you would be taking a massive memory cost: https://www.realitymod.com/forum/f196-p ... -15-a.html
Image
Image
Image
Image
(note the DXT formats and the texture memory usage in the bottom right, in current mip and all mips)

But if your not going to have different colours of the same object, then its best to save the colour in DXT5 with the spec map in its alpha channel as DXT5 saves in a bit higher quality than DXT1 and you don't get as much DDS compression errors in it, but tbh its hardly notable between the two.
Grober wrote:could u explaim me then what is it for?
Its mainly used for wreck texture overlays, so wrecks look like they are burnt out:
Image
Image
Image
Image
Tim270
PR:BF2 Developer
Posts: 5166
Joined: 2009-02-28 20:05

Re: Questions about exporting

Post by Tim270 »

Grober wrote:Well now i will sound like a morron but where can in 3ds Shader Technique

and s-24 should be exported as boundle mesh or static mesh?
Image

So for example you would put "ColorMapGloss" in where the red arrow is pointing, and that defines the shader technique for that material. (obviously using the Bf2 material plugins)

Bundlemesh.
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: Questions about exporting

Post by Rhino »

Grober wrote:Well now i will sound like a morron but where can in 3ds Shader Technique
As per this tut in "Step 7: BF2 Materials": https://www.realitymod.com/forum/f189-m ... apons.html

[quote=""'[R-DEV"]Rhino;1786913']Step 7: BF2 Materials

Now we know that our textures are always looking nice and working well we need to setup our 3p models to use the correct BF2 materials so when they are exported they all are working well in BF2.

All in all for our 3p models we need 3 different materials.
Normal Colour, spec and normal material
Alpha material applied to the bits with transparent parts.
ENV Map material applied to reflective parts like scope lenses etc.

All are going to be using the same textures but just in slightly different ways.

First select an empty material (or even better yet, the material already used by all your 3p models (and no others)) and select "BF2 BundledMesh" material type for it.
Image

Then crate the following materials, first one called something along the lines of "3p_l85a2" (with no || bit after it, no need with this material setup, but in others you need ||Colormapgloss etc, but not here) and browse the correct colour and normal textures. The 2nd called "3p_l85a2||Alpha" which we will use on our transparent faces and the 3rd called "3p_l85a2||Envmap" which we will use on our scope lenses :)
Image Image Image

First fully apply the normal "3p_l85a2" material to all your 3p models, and then go ahead and apply all the "3p_l85a2||Envmap" material to all the scope lenses:
Image Image

And then apply the "3p_l85a2||Alpha" material to all the faces with transparent bits on them :)
Image Image Image
Image Image

Now when you export it should all be good, but keep in mind the little bits (ie, shader techniques) after your material name all depend on your texture setup and what you want it to do. Not having any bit after our main material etc is because our spec is in our normal map which the default shader technique uses, "ColorMapGloss" uses the spec map out of the diffuse / _c texture's alpha for example so just keep this stuff in mind and any questions just ask :) [/quote]

And while that tut is for Handheld weapons and isn't totally about exporting and is more about crating 3rd person weapon models, baking and working with components, it has lots of useful information about exporting in it you wont find in most other tuts.

This tutorial here is also well worth a read, especially if your working with complicated vehicle or handheld weapon series exports: https://www.realitymod.com/forum/f189-m ... rials.html

[quote="Grober""]and s-24 should be exported as boundle mesh or static mesh?[/quote]

It should be a BundleMesh, StaticMeshes are pretty much just for statics and overgrowth.
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: Questions about exporting

Post by Rhino »

Grober wrote:http://i.imgur.com/wh6hKJu.png

so now it will take spec from color right?

if yes then awsome
Yes that should work fine
Grober wrote:another questions i should create 2 "objects"
main object that is going to be active rocket
and _dommy that is going to be only for visual under wings right?
well first its "_dummy", but the big question is, is there any (major) visual differences in the model before and after launch (not including the rocket motor effect, since that's an effect added on and triggered by the code)?

For example, for the new LGBs I made, there is quite a big visual difference between the "_dummy", which is attached to the bottom of the aircraft, and the actual projectile, which is mainly that on the projectile after the bomb is dropped, the rear thins are deployed: Laser-guided, state-of-the-art! - Project Reality Forums
Image
Image

As such I had to export two different meshes of the model, the "_dummy" mesh with its thins closed:
Image

And then the projectile version with the thins open:
Image

But if there is no change between the two, like the new Tigercat Missile for PR:F Lucky has made: https://www.realitymod.com/forum/f388-p ... f-wip.html
Image

Then the "_dummy" version should use the same mesh as the projectile dose, which if you look in the .tweak file you will see:

Code: Select all

rem *** Generated with Bf2Editor.exe [created: 2011/8/17 16:27]
GeometryTemplate.setSubGeometryLodDistance 0 0 25
GeometryTemplate.setSubGeometryLodDistance 0 1 50
GeometryTemplate.setSubGeometryLodDistance 0 2 200
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.castsDynamicShadow 1
ObjectTemplate.activeSafe SimpleObject seacat_missile_dummy
ObjectTemplate.creator EDMUNDFOVARGUE:Edmund_Fovargue
ObjectTemplate.modifiedByUser "Edmund Fovargue"
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.cullRadiusScale 20
[b]ObjectTemplate.geometry seacat_missile
ObjectTemplate.setCollisionMesh seacat_missile_dummy[/b]
ObjectTemplate.mapMaterial 0 col_metal 146
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
But what you will also note is that I have exported its own unique collision mesh for the dummy version, since that is very different between the two as players can shoot and climb on it etc while its on its launcher, where the col mesh for the projectile is just used to detect if it hits an object, so it can and should be very simple:

Projectiles Col:
Image

Dummies Col:
Image
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [?] Help Exporting a Rocket / Missile Projectile

Post by Rhino »

Grober wrote:Image
How many tris is it out of interest and can we see an edged frame pic from a few angles? Also what rez are the textures saved at etc?
Grober wrote:if your could take a look at .con and .tweak that i have created i give me some feadback and check it
Ye, first of all the projectile shouldn't be a "SimpleObject" (which is what the dummy should be), it instead should be a "GenericProjectile", which you can set inside 3DsMax to stop it overwriting that kinda setting every time you export the object if you where to set it by hand in the code, by suffixing the name of each LOD with "__GenericProjectile", then the .con will create the object as a "GenericProjectile", but you will need to manually edit the .tweak file.
Image


Edits in Red, also made some notes here and there and some things to check/redo are in Orange:

s24.con

Code: Select all

GeometryTemplate.create BundledMesh s24
CollisionManager.createTemplate s24

ObjectTemplate.create [color=Red]GenericProjectile [/color]s24
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.creator DANIEL-PC :D aniel
ObjectTemplate.collisionMesh s24
ObjectTemplate.mapMaterial 0 metal 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.geometry s24

include s24.tweak
s24.tweak

Code: Select all

rem *** Generated with Bf2Editor.exe [created: 2014/5/28 23:34]
[color=DarkOrange]GeometryTemplate.setSubGeometryLodDistance 1 0 80
GeometryTemplate.setSubGeometryLodDistance 1 1 150 - These need to be setup correctly, check this tut here:[/color] [url=https://www.realitymod.com/forum/f189-modding-tutorials/92072-cull-lod-switching-distances.html]https://www.realitymod.com/forum/f189-modding-tutorials/92072-cull-lod-switching-distances.html[/url]
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.activeSafe [color=Red]GenericProjectile[/color] s24
ObjectTemplate.creator DANIEL-PC :D aniel
ObjectTemplate.modifiedByUser "Daniel"
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.saveInSeparateFile 1
[color=DarkOrange]ObjectTemplate.cullRadiusScale 9 - Same as tut above[/color]
[color=Red]rem ---BeginComp:Armor --- Been Removed[/color]
rem ---EndComp ---
rem ---BeginComp :D efaultCollisionComp ---
ObjectTemplate.createComponent DefaultCollisionComp
ObjectTemplate.collision.hasCollisionEffect 1
rem ---EndComp ---
rem ---BeginComp :D efaultDetonationComp ---
ObjectTemplate.createComponent DefaultDetonationComp
[color=DarkOrange]ObjectTemplate.detonation.explosionMaterial 70 - Have you checked though this mat, Explosion_blastwave (70), to ensure it has the kinda settings you want? Our Rockets tend to use Material 179 - PR_HYDRA_AIRTOGROUND for their exp material[/color]
ObjectTemplate.detonation.explosionRadius 80
ObjectTemplate.detonation.explosionForce 30
ObjectTemplate.detonation.explosionDamage 115
[color=DarkOrange]ObjectTemplate.detonation.endEffectTemplate e_exp_bomb - Have you checked this effect to ensure its correct? This is used by 500lb bombs, and this has a warhead of just 271lbs so might be a bit OTT? Might want to ask Bruno if he thinks its worth making a new effect and if so, if he can?[/color]
ObjectTemplate.detonation.useMMOnEndEffect 1
ObjectTemplate.detonation.detectionRadius [color=Red]0[/color]
ObjectTemplate.detonation.maxDepthForExplosion 2
rem ---EndComp ---
rem ---BeginComp :D efaultProjSoundComp ---
ObjectTemplate.createComponent DefaultProjSoundComp
rem ---EndComp ---
rem ---BeginComp:SeekClosestTargetComp ---
ObjectTemplate.createComponent SeekClosestTargetComp
ObjectTemplate.seek.targetType TTUnique
ObjectTemplate.seek.trackingDelay 0
ObjectTemplate.seek.maxAngleLock 180
ObjectTemplate.seek.maxDistLock 3000
ObjectTemplate.seek.reLockTime 0
rem ---EndComp ---
rem ---BeginComp :D efaultFollowComp ---
ObjectTemplate.createComponent DefaultFollowComp
ObjectTemplate.follow.maxYaw 0
ObjectTemplate.follow.maxPitch 0
ObjectTemplate.follow.changePitch 0
ObjectTemplate.follow.changeYaw 0
ObjectTemplate.follow.minDist 0
rem ---EndComp ---
rem ---BeginComp :D efaultPenetrateComp ---
ObjectTemplate.createComponent DefaultPenetrateComp
ObjectTemplate.penetrate.allowSolidPenetration 0
ObjectTemplate.penetrate.allowLiquidPenetration 0
rem ---EndComp ---
ObjectTemplate.geometry s24
ObjectTemplate.setCollisionMesh s24
ObjectTemplate.mapMaterial 0 metal 32
ObjectTemplate.mass [color=Red]235[/color]
ObjectTemplate.gravityModifier 0.66
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Point
ObjectTemplate.collisionGroups 8
[color=Red]rem -------------------------------------
ObjectTemplate.addTemplate e_missile_trail - Might want a different trail effect
ObjectTemplate.setPosition 0/0/-0.7 - you will need to place yours correctly.
rem -------------------------------------[/color]
[color=DarkOrange]ObjectTemplate.material 56 - This mat is used by Anti-Tank ATG missiles such as the hellfire to control direct contact with a vehicle/object damage, but this rocket is pretty large so dose sound about right[/color]
[color=Red]ObjectTemplate.damage *** - you will need to work out the correct amount of contact damage from the above material for this rocket.
ObjectTemplate.hasOnTimeEffect 1
ObjectTemplate.tracerSizeModifier 0
ObjectTemplate.acceleration 792.2 - You will need to work this out
ObjectTemplate.maxSpeed 740 - And this.[/color]
s24_dummy.con

Code: Select all

[color=Red]GeometryTemplate.create BundledMesh s24_dummy
CollisionManager.createTemplate s24_dummy[/color]

ObjectTemplate.create SimpleObject s24_dummy
[color=Red]ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.collisionMesh [COLOR="DarkOrange"]s24_dummy - You will need to make one as per my above post[/color]
ObjectTemplate.mapMaterial 0 col_metal 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType 3
ObjectTemplate.geometry s24

include s24_dummy.tweak[/COLOR]

s24_dummy.tweak

Code: Select all

[color=Red]GeometryTemplate.setSubGeometryLodDistance 0 0 *** - Need distances as per above tut
GeometryTemplate.setSubGeometryLodDistance 0 1 ***
GeometryTemplate.setSubGeometryLodDistance 0 2 ***
GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.castsDynamicShadow 1
ObjectTemplate.activeSafe SimpleObject s24_dummy[/color]
ObjectTemplate.saveInSeparateFile 1
[color=Red]ObjectTemplate.cullRadiusScale *** - Needs cull distance as per above tut[/color]
ObjectTemplate.geometry s24
ObjectTemplate.setCollisionMesh s24[color=Red]_dummy - Needs making[/color]
[color=Red]ObjectTemplate.hasMobilePhysics 0[/color]
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
ObjectTemplate.mapMaterial 0 metal 32
Image
DogACTUAL
Posts: 879
Joined: 2016-05-21 01:13

Re: [?] Help Exporting a Rocket / Missile Projectile

Post by DogACTUAL »

Any update on this project? Was this model of the rocket abandoned?
Post Reply

Return to “PR:BF2 Community Modding”