networkableInfo's - Which vehicles & objects Need them???

Ask questions, discuss ideas, get answers
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: networkableInfo's - Which vehicles & objects Need them???

Post by freddy »

I fixed the flettner chopper a while ago for a custom map someone had made. It has been laggy and running poorly since the game was released.
What i did was to remove all unessesary networkdata, now i dont remember exactly, but as a example choppers usually have extra engines that is invisible but needed to get them to fly somewhat ok, so as they are invisible then i can cut out that networkinfo as nobody ever sees or hear them anyway.
Also to be on the sure side of the "network-lag-hell" i (secretly) removed the netinfo for the back rudder, and so far nobody has seen the difference because they are concentrated on flying and playing the game.

Now a important thing to mention, the server knows the rudder is moving as the player controls the input, so it works to fly all the same just that it doesnt send any of that movement data over the internet, meaning any other player looking at the chopper cant see the rudder moving.

The most important thing with this example is that the player and the server must have the same map when doing stuff like this, i cant take witch ever map and just cut out networkdata like that and put it in a server, if the players still has the "old map" with that netinfo still attached and i did that it would crash the game.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: networkableInfo's - Which vehicles & objects Need them???

Post by freddy »

This is how the gun ties together with the netinfo. You build a gun, add netinfo to that, and after that you add the pieces that the gun needs to work, and so those pieces becomes part of the parent objects netinfo. For example there is two different "loadsoundscript" that will be sent over the internet and play that guns sound so the other players can hear when it is moving and firing.
I hope this clear things up a bit.
fletchergun.jpg
professor_smith
Posts: 133
Joined: Thu Dec 13, 2012 7:45 am

Re: networkableInfo's - Which vehicles & objects Need them???

Post by professor_smith »

Freddy,
So are you saying that if I create a weapon, a canon, etc, and place it on a bundle or a rotational bundle, that already has a networkableInfo script, I do not have to place a networkableInfo script on the firearm itself, within the weapons.con file?

Thank You,

Joshua
Lets make war games, not war.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: networkableInfo's - Which vehicles & objects Need them???

Post by freddy »

Yeah well i actually cant remember exactly anymore, it has been some years since i modded actively, but i would recommend to take a look at other weapon-bundles and see how they did make it work. Actually ill think ill go and take a quick look at the Yamamoto cannons BRB.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: networkableInfo's - Which vehicles & objects Need them???

Post by freddy »

Im back, so just a quick glance at one piece of a Battleshipgun

In weapons.con theres a lot of stuff goin on, but none have network info

Code: Select all

rem *** YamatoMediumCannonBarrel ***
ObjectTemplate.create FireArms YamatoMediumCannon
ObjectTemplate.geometry Yamato_Medium_Cannon_m1
ObjectTemplate.aiTemplate YamatoGunAI
ObjectTemplate.loadSoundScript ../Common/Sounds/fire.ssc
rem -------------------------------------
rem ObjectTemplate.visibleBarrelTemplate e_MuzzDefGun
ObjectTemplate.addTemplate e_MuzzDefGun
ObjectTemplate.setPosition 1.7/0/7.0 0/0/0
ObjectTemplate.setRotation -180/0/0
ObjectTemplate.addTemplate e_MuzzDefGun
ObjectTemplate.setPosition 0/0/7.0 0/0/0
ObjectTemplate.setRotation -180/0/0
ObjectTemplate.addTemplate e_MuzzDefGun
ObjectTemplate.setPosition -1.7/0/7.0 0/0/0
ObjectTemplate.setRotation -180/0/0
rem -------------------------------------
ObjectTemplate.projectileTemplate YamatoMediumProjectile
ObjectTemplate.projectilePosition 0/0/-5
ObjectTemplate.magSize -1
ObjectTemplate.numOfMag 999
ObjectTemplate.velocity 160
ObjectTemplate.reloadtime 45
ObjectTemplate.roundOfFire 0.2
ObjectTemplate.fireingForce 10
ObjectTemplate.recoilSpeed 6
ObjectTemplate.recoilSize 10
ObjectTemplate.addFireArmsPosition 1.7/0/7.0 0/0/0
ObjectTemplate.addFireArmsPosition 0/0/7.0 0/0/0
ObjectTemplate.addFireArmsPosition -1.7/0/7.0 0/0/0


rem *** YamatoMediumProjectile ***
ObjectTemplate.create Projectile YamatoMediumProjectile
ObjectTemplate.createNotInGrid 1
ObjectTemplate.loadSoundScript ../../Common/Sounds/BigProjectile.ssc
ObjectTemplate.geometry Projectile_m1
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.timeToLive CRD_NONE/10/0/0
ObjectTemplate.damageType 1
ObjectTemplate.material 252
ObjectTemplate.material2 208
ObjectTemplate.radius 15
ObjectTemplate.hasCollisionEffect 1
ObjectTemplate.addTemplate e_PanzShootTrail
It is then later added to the RotationalBundle YamatoMediumCannonBase that does have networkinfo

Code: Select all

rem *** YamatoMediumCannonBase ***
ObjectTemplate.create RotationalBundle YamatoMediumCannonBase
ObjectTemplate.setNetworkableInfo YamatoCannonInfo
ObjectTemplate.loadSoundScript ../Common/Sounds/midtower.ssc
rem -------------------------------------
ObjectTemplate.addTemplate YamatoMediumCannon
rem -------------------------------------
ObjectTemplate.setMinRotation 0/-15/0
ObjectTemplate.setMaxRotation 0/1/0
ObjectTemplate.setMaxSpeed 0/35/0
ObjectTemplate.setAcceleration 0/90/0
ObjectTemplate.setInputToPitch c_PIMouseLookY
If we look in network.con there is

Code: Select all

NetworkableInfo.createNewInfo YamatoCannonInfo
NetworkableInfo.setPredictionMode PMLinear
The same networkinfo-node or whatever its called is reused in the RotationalBundle YamatoFatCannonBase

Code: Select all

rem *** YamatoFatCannonBase ***
ObjectTemplate.create RotationalBundle YamatoFatCannonBase
ObjectTemplate.setNetworkableInfo YamatoCannonInfo
ObjectTemplate.loadSoundScript ../Common/Sounds/bigtower.ssc
rem -------------------------------------
ObjectTemplate.addTemplate YamatoFatCannon
rem -------------------------------------
ObjectTemplate.setMinRotation 0/-15/0
ObjectTemplate.setMaxRotation 0/1/0
ObjectTemplate.setMaxSpeed 0/35/0
ObjectTemplate.setAcceleration 0/90/0
ObjectTemplate.setInputToPitch c_PIMouseLookY
And also in the YamatoSmall1CannonBase

Code: Select all

rem *** YamatoSmall1CannonBase ***
ObjectTemplate.create RotationalBundle YamatoSmall1CannonBase
ObjectTemplate.setNetworkableInfo YamatoCannonInfo
ObjectTemplate.loadSoundScript ../Common/Sounds/smalltower.ssc
rem -------------------------------------
ObjectTemplate.addTemplate YamatoSmall1Cannon
rem -------------------------------------
ObjectTemplate.setMinRotation 0/0/-15
ObjectTemplate.setMaxSpeed 0/0/60
ObjectTemplate.setAcceleration 0/0/75
ObjectTemplate.setInputToRoll c_PIMouseLookY
And RotationalBundle YamatoSmall2CannonBase

Code: Select all

rem *** YamatoSmall2CannonBase ***
ObjectTemplate.create RotationalBundle YamatoSmall2CannonBase
ObjectTemplate.setNetworkableInfo YamatoCannonInfo
rem -------------------------------------
ObjectTemplate.addTemplate YamatoSmall2Cannon
rem -------------------------------------
ObjectTemplate.setMinRotation 0/0/-15
ObjectTemplate.setMaxSpeed 0/0/60
ObjectTemplate.setAcceleration 0/0/75
ObjectTemplate.setInputToRoll c_PIMouseLookY
Also the RotationalBundle YamatoSmall2CannonBaseWithCamera

Code: Select all

rem *** YamatoSmall2CannonBaseWithCamera ***
ObjectTemplate.create RotationalBundle YamatoSmall2CannonBaseWithCamera
ObjectTemplate.setNetworkableInfo YamatoCannonInfo
rem -------------------------------------
ObjectTemplate.addTemplate YamatoSmall2Cannon
ObjectTemplate.addTemplate YamatoCameraBundle
ObjectTemplate.setPosition -1.693/-1.218/0.05
ObjectTemplate.setRotation 0/0/-9.999
rem -------------------------------------
ObjectTemplate.setMinRotation 0/0/-15
ObjectTemplate.setMaxSpeed 0/0/60
ObjectTemplate.setAcceleration 0/0/75
ObjectTemplate.setInputToRoll c_PIMouseLookY
I think that was all, its not that easy intuitive to grasp all of it (i dont) but i think it boils down to limit and re-use that networkinfo as much as possible.

Edit: ill add the map with the Flettner that i removed alot of "unessesary" networkinfo so you can take a look and compare with the original Flettner. i think Dice buggered up the flettner by misstake or time constrictment as it was there first try on making a working chopper. The choppers in Desert combat mod works much much better.

Sidenote, i didnt make this map (Flettner arena), i just "cloned the Flettner and made some changes to that clones (made one for allied + one for axis)
Attachments
flettner_arena.rar
This a map with the flettner i mentioned earlier
(15.16 MiB) Downloaded 346 times
professor_smith
Posts: 133
Joined: Thu Dec 13, 2012 7:45 am

Re: networkableInfo's - Which vehicles & objects Need them???

Post by professor_smith »

Thank you, I'll check it out. Maybe it'll help me with my other helli's as well.

Joshua
Professor Smith
Lets make war games, not war.
Post Reply