Some modding questions

Making or wanting help making your own asset? Check in here
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Some modding questions

Post by MaxP »

[R-CON]Fastjack wrote: You ever tried to give the claymores a collisionmesh from another object and armorcomp, doesn't matter if fits or not, only to test if you can hit the mine?
Of course :) Started from the tank mesh.
The collision mesh will works, I think, if the GenericProjectile doesn't have the DefaultDetonationComp.
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Some modding questions

Post by MaxP »

A texturing question. Is the normal map textures need to be saved with alpha?
I've saved the kit normal map in DXT1 w/o alpha (to decrease size), and the drop geometry looks shiny, although many bundlemeshes looks fine with such normal maps.
What is the difference? Where I have to save the NM with the alpha, and what format is better?
rPoXoTauJIo
PR:BF2 Developer
Posts: 1979
Joined: 2011-07-20 10:02

Re: Some modding questions

Post by rPoXoTauJIo »

MaxP wrote:A texturing question. Is the normal map textures need to be saved with alpha?
It may be, but not required.

F.e., by default, you have large 2048 DXT5 texture for diffuse, and 2048 DXT1 for normal map.
However, incase(most cases) you could have used both normal map, and alpha channel with lower quality, which leads to smaller texture sizes. While you can just resize normal map to 1024 or 512, your alpha channel still remains in diffuse texture, and you have a choice of either decrease resolutuion(and quality) of your whole diffuse texture just for sake of alpha resize, or keep alpha channel as is, having unnecessary quality wasting space.

So the solution we've came up with, is to store alpha channel in normal map while decreasing it's resolution to 1024\512, while keeping diffuse texture at it's max size of 2048, in DTX1 now. Keep in mind that to make it work - you have to delete ColorMapGloss technique from your mesh.
Image

assetruler69: I've seen things you smurfs wouldn't believe. Apaches on the Kashan. I watched burned down tank hulls after the launch of the single TOW. All those moments will be lost in time, like tears in rain.

Time to give up and respawn.
Harmonikater
PR:BF2 Contributor
Posts: 44
Joined: 2017-06-11 20:23

Re: Some modding questions

Post by Harmonikater »

MaxP wrote:A texturing question. Is the normal map textures need to be saved with alpha?
I've saved the kit normal map
Note that if you're referring to a soldier kit (i.e. a SkinnedMesh and not a BundledMesh), there is no ColorMapGloss technique, so the glossiness almost always goes into the normal map alpha channel.

For BundledMeshes there also some (rarer) cases where you might even have alpha channels in both textures, for example when both transparency and glossiness information is required.
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Some modding questions

Post by MaxP »

Thanks for quick responce.
The good thing is that I always make backups :)
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Some modding questions

Post by MaxP »

I have the projectiles with BasicInfo mask, and the tracers doesn't show.
But - the trails shows correctly. Is it possible to make the tracer-like effect, but without the tracer itself?
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: Some modding questions

Post by Arab »

MaxP wrote:I have the projectiles with BasicInfo mask, and the tracers doesn't show.
But - the trails shows correctly. Is it possible to make the tracer-like effect, but without the tracer itself?
You can remove the tracer code and instead add the tracer object as a child.

1. Open up the projectile you are trying to modify, usually it would be the stuff that's ObjectTemplate.addTemplate to the projectile type.

Code: Select all

projectiles_tank_tracer_r.tweak
projectiles_tracer_big_g.tweak
projectiles_tracer_big_r.tweak
projectiles_tracer_g.tweak
projectiles_tracer_r.tweak
riflegrenade_at_projectile.con
riflegrenade_he_projectile.con
riflegrenade_smoke_projectile.con
projectiles_common.tweak
projectiles_common_big.tweak
projectiles_common_small.tweak
projectiles_spotting_tracer_r.tweak
projectiles_tank_tracer_big_g.tweak
projectiles_tank_tracer_big_r.tweak
projectiles_tank_tracer_g.tweak
2. Remove or disable (Either beginrem or rem) the tracer code and instead, add the tracer you want.
Tracers are in effects folder:

Code: Select all

ObjectTemplate.addTemplate p_tracer_tank_g
beginrem
rem ObjectTemplate.tracerScaler 8
rem ObjectTemplate.maxTracerScaler 12
rem ObjectTemplate.minTracerScaler 1
rem ObjectTemplate.tracerSizeModifier 1.8
rem ObjectTemplate.tracerTemplate p_tracer_tank_g
rem ObjectTemplate.tracerConvergeDistance -1
rem ObjectTemplate.tracerInterval 0
endrem
Only issue is that the BF2 server does an optimization which makes them look like they disappear about 200m away from view. When I'll get around to it (Currently got a lot on my plate), I'll try to find out the solution for the issue.
Image
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Some modding questions

Post by MaxP »

[R-DEV]Arab wrote:You can remove the tracer code and instead add the tracer object as a child.
Shit, I should try this simple solution :)
Thank you. It works not so good, but it's much better than nothing.

P.S. Ah, no, not good. Adding the tracer to networked projectile will stable crash the game after some time.

Do you know something about the difference between BasicInfo and ProjectileInfo masks?
On maps with >70 bots (especially infantry fighting) the game engine lags a lot with "networkabled" bullet projectiles, while running good without it.
Are there any sense to use the ProjectileInfo mask instead of BasicInfo?
Last edited by MaxP on 2018-02-25 18:00, edited 1 time in total.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: Some modding questions

Post by Arab »

MaxP wrote:Shit, I should try this simple solution :)
Thank you. It works not so good, but it's much better than nothing.

P.S. Ah, no, not good. Adding the tracer to networked projectile will stable crash the game after some time.

Do you know something about the difference between BasicInfo and ProjectileInfo masks?
On maps with >70 bots (especially infantry fighting) the game engine lags a lot with "networkabled" bullet projectiles, while running good without it.
Are there any sense to use the ProjectileInfo mask instead of BasicInfo?
According to Networkables.con, they are both the same as they use the Linear Prediction Mode.

ProjectileInfo is used on the zipline afaik.
Last edited by Arab on 2018-02-27 03:41, edited 2 times in total.
Image
AlonTavor
PR:BF2 Developer
Posts: 2991
Joined: 2009-08-10 18:58

Re: Some modding questions

Post by AlonTavor »

You really shouldn't enable networking for every bullet. More networked objects means lower priority for everything else.
User avatar
Mats391
PR:BF2 Lead Developer
Posts: 7643
Joined: 2010-08-06 18:06

Re: Some modding questions

Post by Mats391 »

[R-DEV]AlonTavor wrote:You really shouldn't enable networking for every bullet. More networked objects means lower priority for everything else.
Plus there is hard limit of 1024 networkables active at same time, isnt it?
Image

Mineral: TIL that Wire-guided missiles actually use wire
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Some modding questions

Post by MaxP »

[R-DEV]AlonTavor wrote:You really shouldn't enable networking for every bullet. More networked objects means lower priority for everything else.
Maybe, but I've played many times on a small maps (like Tunis from FH2) and haven't seen any problems. On the contrary, the bullet collision works really great, especially for automatic firearms.
I had a lags on my home dedicated server (Celeron 1820) on maps with 40+ active firing bots and stationary mgs.
The difference is so noticable, that I've decided to significally cut the number of bots and vehicles on the maps (~40 from ~90 bots), just to let it work without glitches.
Last edited by MaxP on 2018-02-26 23:46, edited 2 times in total.
Arab
PR:BF2 Developer
Posts: 2898
Joined: 2012-05-18 03:37

Re: Some modding questions

Post by Arab »

MaxP wrote:Shit, I should try this simple solution :)
Thank you. It works not so good, but it's much better than nothing.

P.S. Ah, no, not good. Adding the tracer to networked projectile will stable crash the game after some time.
Forgot to mention that with the tracers added as a child to networked projectiles, the tracers will cull from around 150 - 200m away.

The solution is to add this line to the tracer's .tweak effect.
Example:

Code: Select all

ObjectTemplate.activeSafe Particle e_tracer_tank_r
ObjectTemplate.nearCullingEnable 0
For the lag issue, I have a theory.

Replace the BasicInfo used in projectiles with ProjectileInfo, and test.
The theory is that having different networkableInfo names can make the networking run more organized and therefore run more efficient.

Haven't implemented this to the mod due to the level of test required to make sure there's no glitches, but it's worth a try.
Last edited by Arab on 2018-02-27 03:46, edited 5 times in total.
Image
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Some modding questions

Post by MaxP »

[R-DEV]Arab wrote: For the lag issue, I have a theory.

Replace the BasicInfo used in projectiles with ProjectileInfo, and test.
The theory is that having different networkableInfo names can make the networking run more organized and therefore run more efficient.

Haven't implemented this to the mod due to the level of test required to make sure there's no glitches, but it's worth a try.
No significant changes in speed, but also absolutely no any significant changes in collisions of an other non-networked projectiles.
Anyway, I'll have to test it more.

Thanks for answers, and another question: is there're any kind of tutorial explaining the using of forces?
I.e., I want to add some forces for ArmorComp, linked to HP.
I need the result in a plane start to roll left or right while being critically damaged.
Here's my example:

Code: Select all

ObjectTemplate.armor.addArmorEffect 30 e_jet_spin

Code: Select all

ObjectTemplate.activeSafe EffectBundle e_jet_spin
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
rem -------------------------------------
ObjectTemplate.addTemplate e_jet_spin_Force
ObjectTemplate.setPosition 0/20/0
ObjectTemplate.setRotation 90/0/0
rem -------------------------------------
ObjectTemplate.setStartOnEffects 0
ObjectTemplate.setStopOnEffects 0
ObjectTemplate.timeToLive CRD_NONE/-1/0/0
ObjectTemplate.randomAgeFactor CRD_NONE/1/0/0
ObjectTemplate.startAtCreation 1
ObjectTemplate.speedFromPhysics 0

ObjectTemplate.create ForceObject e_jet_spin_Force
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.force 1000
ObjectTemplate.constantForce 1000
ObjectTemplate.onlyWhenOccupied 0

I've planned to set the rolling force some meters away from the horizontal axis and turn it 90 degrees around vertical, so it would be a pure rotational force.

And I've got a strange result - the plane just shakes like an old washing machine, from the rotational force.
What I'm doing wrong?
Fastjack
PR:BF2 Contributor
Posts: 525
Joined: 2011-09-04 19:47

Re: Some modding questions

Post by Fastjack »

Project Reality has this damagestates already.
Check effects/damagestates folder
ObjectTemplate.armor.addArmorEffect 30 e_dstate_jet_spin

It need also positiondatas in the armorcomp.
Excample : huey

ObjectTemplate.armor.addArmorEffect 60 e_dstate_heli_tailspinf005 0.666751/1.10109/-20.2373 90/0/0
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Some modding questions

Post by MaxP »

'[R-CON wrote:Fastjack;2183689']Project Reality has this damagestates already.
Check effects/damagestates folder
ObjectTemplate.armor.addArmorEffect 30 e_dstate_jet_spin
0.666751/1.10109/-20.2373 90/0/0
No, there is no e_dstate_jet_spin effects in PR.
I saw the heli_spin, but it works the same - the plane with the player (or bot, I suppose) starts to shake, not turn. Maybe it conflicts with the drag from the wings...
If I reworked it right to make it roll over the horizontal axis:

Code: Select all

ObjectTemplate.armor.addArmorEffect 30 e_dstate_jet_spin [b]0.25/-20.0/0 90/0/0[/b]

Code: Select all

ObjectTemplate.create ForceObject e_dstate_jet_spin_Force
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.rotationalForce [b]0/0/1000[/b]
ObjectTemplate.force 1000
ObjectTemplate.constantForce 1000
ObjectTemplate.onlyWhenOccupied 0
One more question: can the unmanned PCO (driven by forceobject) spawn something?
I.e.: Flying unmanned plane (like flyover objects in FH2) spawns the bomb after some time (spawndelayatstart).
Fastjack
PR:BF2 Contributor
Posts: 525
Joined: 2011-09-04 19:47

Re: Some modding questions

Post by Fastjack »

No, there is no e_dstate_jet_spin effects in PR.
I didn't mean there is a jetspin. I meant you have it todo like this. That was the reason why i took the huey as excample.

Forgot to mention;
ObjectTemplate.onlyWhenOccupied 1
Last edited by Fastjack on 2018-02-27 15:52, edited 1 time in total.
Fastjack
PR:BF2 Contributor
Posts: 525
Joined: 2011-09-04 19:47

Re: Some modding questions

Post by Fastjack »

One more question: can the unmanned PCO (driven by forceobject) spawn something?
I.e.: Flying unmanned plane (like flyover objects in FH2) spawns the bomb after some time (spawndelayatstart).
Yes. Adding a objectspawner to the object. The object that get spawned isn't a bomb like the bombs from a jet. Its a simple destructable object that has an armorcomp with the right explosion effects (material etc.) when it hit the ground.
Dont use HOLDOBJECT for the objectspawner.
MaxP
Posts: 117
Joined: 2008-09-08 19:18

Re: Some modding questions

Post by MaxP »

'[R-CON wrote:Fastjack;2183701']I didn't mean there is a jetspin. I meant you have it todo like this. That was the reason why i took the huey as excample.

Forgot to mention;
ObjectTemplate.onlyWhenOccupied 1
https://youtu.be/Ag5elWD2OoI
Dont use HOLDOBJECT for the objectspawner.
Yeah, already came across this, at causes random CTD ))
Its a simple destructable object that has an armorcomp with the right explosion effects (material etc.) when it hit the ground.
And if it an another PCO? :)
Last edited by MaxP on 2018-02-27 16:31, edited 1 time in total.
Fastjack
PR:BF2 Contributor
Posts: 525
Joined: 2011-09-04 19:47

Re: Some modding questions

Post by Fastjack »

And if it an another PCO?
You mean something like an vehicle drop? Yes that is possible but than you have to use HoldObject but ...... bots dont like it. The titan in BF2142 have this for the gunship and trooptransporter. If the titan moves, the unoccupied vehicles will move with the objectspawner till the extra pco's engine get an input. BF1942 also used this feature on the ships.

There exist already some experiments by the team with additional spawnable pco's but there are still some problems.

You could add a spawnpoint to the spawnable object and when you spawn on it it get released.
Maybe you can bypass by tweaking the PCO ID's that when you enter your spawnable PCO you not directly sitting in the PCO who trigger the engine of your object.

Best is to ask Arab. He is really good in this out of the box thinking and already helped me with fake pco's.

I'm not sure about but can you test to set the rotation different:

Excample :

ObjectTemplate.armor.addArmorEffect 30 e_dstate_jet_spin 0.25/-20.0/0 0/90/0
Post Reply

Return to “PR:BF2 Community Modding”