Issues with your account? Bug us in the Discord!
Ship Specific Cockpits
MajorTom
Trainee
I discovered how to make ship specific cockpits and posted on this over at the I war .com forums. The main reason I'm posting here is because you guys are great moddlers and maybe you can help answer some open questions.
First the recipe: ;)
[quote]
You can simply place the cockpit as a subsim in the ships .ini file.
It does cause a slight preformance hit so I would recommend it for the SP game only. Don't use the method on nps ships or the preformance hit will be even heavier.
How?
1)make a dummy setup.lws file that's completly empty and put it in the avatars/cockpit folder replacing the one there.
(That will cause all player ships to be without a cockpit.)
2) Grab an ini file for a turret. (It has to be an type=icTurret file) Give the turret your cockpit avatar. Comment out the collision hull and the setup scene (so you have none). Change the bolt template in the turret ini to a nonexistant bolt.ini (so it won't/can't fire at anything.) The rest of the .ini contents can be left as they are and have (as far as I can tell) no effect, as it doesn't fire anyhow.
3) Place the modded turret .ini as a normal subsim on the crew null in the ships ini file. (make sure you keep the template numbers consecutive)
Thats it. You now have a cockpit, including cockpit sway and everything. You can't even tell the difference to the normal stock cockpit (except for a slight framerate hit because the cockpit is now rendered differently)
Using this method you can give every player ship a different cockpit by using a different icTurret subsim. ini file, each with it's own cockpit avatar. (once you have the different cockpit models).
I've tried it using the starfury cockpit and the original cockpit it works just fine.
Now you guys can get cracking making different cockpits if you want :rolleyes:
The above requires no pog at all, but, you can switch the cockpit using pog if you want to. In this case you simply Subsim.Destroy the current cockpit subsim. Then Subsim.Create the new one (using the turret.ini with the appropriate avatar). After calling Sim.AddSubsim you just have to Subsim.Place it at the exact coordinates of the crew null.
It happens at the bat of an eye, no delay! Suddenly the other cockpit is there.
[/quote]
To make it "fit" smaller ships you can scale the cockpit as shown below. For example to get the starfury cockpit on a little tiny Tie Fighter (inside the less than 3 meters diameter main hull Ball)
Original:
[quote]LoadObject Objects_IW2\RTO_Effects\RTCockpit\RTO\cockpit4_t.lwo
ShowObject 8 7
ObjectMotion (unnamed)
9
1
0 -0.8225 1.8823 0 0 0 1 1 1
0 0 0 0 0
EndBehavior 1
LockedChannels 43
ShadowOptions 7 [/quote]
Now:
[quote] LoadObject Objects_IW2\RTO_Effects\RTCockpit\RTO\cockpit4_t.lwo
ShowObject 8 7
ObjectMotion (unnamed)
9
1
0 -0.3225 1.0823 0 0 0 0.4 0.4 0.4
0 0 0 0 0
EndBehavior 1
LockedChannels 43
ShadowOptions 7 [/quote]
That makes the cockpit less than half the original size and moves it back towards the crew null as well as up a little higher to compensate for the perspective change of moving it back.
Then, it was just necessary to move the Crew null a bit farther to the rear and position it more in the center of the ship so the avatar of the cockpit subsim was hidden inside the models avatar.
It works well and the preformance hit is low if the cockpit is only on the Players ship. I would like to use this in the forthcoming MP mods but the preformance hit is too much with 6 or 8 players so I'm trying to track down the reason and a method to reduce it. (Which should also increase preformance on the playership in SP.)
I've confirmed by testing, it is really worse if you put the cockpit subsim on the NPS ships. That would indicate flux is rendering the cockpits as a seperate subsim on all ships (regardless of where they are??) and thus, the preformance hit?
What can you guys say/think of concerning the Preformance hit?
The other questions (that may be related to preformance)
The cockpit sway: Is the cockpit sway perhaps an integeral part of the .lws design?
Although there is stuff in flux .ini about neck stiffness ect, (in the section [icInternalCamera]), the fact that it displays the same sway as the original, even though it is a seperate subsim, seems to confirm this?
When I look at the cockpit setup.lws there are a couple of things to note:
[quote]
CameraMotion (unnamed)
9
1
0 0 -52.5035 0 0 0 1 1 1
0 0 0 0 0
EndBehavior 1
ZoomFactor 3.200000
Resolution 1
PixelAspectRatio 2
SegmentMemory 9000000
.
.snip
.
.
ViewMode 3
ViewAimpoint 0.000000 0.000000 0.000000
ViewDirection -6.864388 -0.371756 0.000000
ViewZoomFactor 34.119892
[/quote]
The camera motion coordinates seem a bit oddly one sided?
I've never seen another model with "ViewMode 3" or a ViewAimpoint at 0.0.0 ?
Does this mean anything to you guys?
First the recipe: ;)
[quote]
You can simply place the cockpit as a subsim in the ships .ini file.
It does cause a slight preformance hit so I would recommend it for the SP game only. Don't use the method on nps ships or the preformance hit will be even heavier.
How?
1)make a dummy setup.lws file that's completly empty and put it in the avatars/cockpit folder replacing the one there.
(That will cause all player ships to be without a cockpit.)
2) Grab an ini file for a turret. (It has to be an type=icTurret file) Give the turret your cockpit avatar. Comment out the collision hull and the setup scene (so you have none). Change the bolt template in the turret ini to a nonexistant bolt.ini (so it won't/can't fire at anything.) The rest of the .ini contents can be left as they are and have (as far as I can tell) no effect, as it doesn't fire anyhow.
3) Place the modded turret .ini as a normal subsim on the crew null in the ships ini file. (make sure you keep the template numbers consecutive)
Thats it. You now have a cockpit, including cockpit sway and everything. You can't even tell the difference to the normal stock cockpit (except for a slight framerate hit because the cockpit is now rendered differently)
Using this method you can give every player ship a different cockpit by using a different icTurret subsim. ini file, each with it's own cockpit avatar. (once you have the different cockpit models).
I've tried it using the starfury cockpit and the original cockpit it works just fine.
Now you guys can get cracking making different cockpits if you want :rolleyes:
The above requires no pog at all, but, you can switch the cockpit using pog if you want to. In this case you simply Subsim.Destroy the current cockpit subsim. Then Subsim.Create the new one (using the turret.ini with the appropriate avatar). After calling Sim.AddSubsim you just have to Subsim.Place it at the exact coordinates of the crew null.
It happens at the bat of an eye, no delay! Suddenly the other cockpit is there.
[/quote]
To make it "fit" smaller ships you can scale the cockpit as shown below. For example to get the starfury cockpit on a little tiny Tie Fighter (inside the less than 3 meters diameter main hull Ball)
Original:
[quote]LoadObject Objects_IW2\RTO_Effects\RTCockpit\RTO\cockpit4_t.lwo
ShowObject 8 7
ObjectMotion (unnamed)
9
1
0 -0.8225 1.8823 0 0 0 1 1 1
0 0 0 0 0
EndBehavior 1
LockedChannels 43
ShadowOptions 7 [/quote]
Now:
[quote] LoadObject Objects_IW2\RTO_Effects\RTCockpit\RTO\cockpit4_t.lwo
ShowObject 8 7
ObjectMotion (unnamed)
9
1
0 -0.3225 1.0823 0 0 0 0.4 0.4 0.4
0 0 0 0 0
EndBehavior 1
LockedChannels 43
ShadowOptions 7 [/quote]
That makes the cockpit less than half the original size and moves it back towards the crew null as well as up a little higher to compensate for the perspective change of moving it back.
Then, it was just necessary to move the Crew null a bit farther to the rear and position it more in the center of the ship so the avatar of the cockpit subsim was hidden inside the models avatar.
It works well and the preformance hit is low if the cockpit is only on the Players ship. I would like to use this in the forthcoming MP mods but the preformance hit is too much with 6 or 8 players so I'm trying to track down the reason and a method to reduce it. (Which should also increase preformance on the playership in SP.)
I've confirmed by testing, it is really worse if you put the cockpit subsim on the NPS ships. That would indicate flux is rendering the cockpits as a seperate subsim on all ships (regardless of where they are??) and thus, the preformance hit?
What can you guys say/think of concerning the Preformance hit?
The other questions (that may be related to preformance)
The cockpit sway: Is the cockpit sway perhaps an integeral part of the .lws design?
Although there is stuff in flux .ini about neck stiffness ect, (in the section [icInternalCamera]), the fact that it displays the same sway as the original, even though it is a seperate subsim, seems to confirm this?
When I look at the cockpit setup.lws there are a couple of things to note:
[quote]
CameraMotion (unnamed)
9
1
0 0 -52.5035 0 0 0 1 1 1
0 0 0 0 0
EndBehavior 1
ZoomFactor 3.200000
Resolution 1
PixelAspectRatio 2
SegmentMemory 9000000
.
.snip
.
.
ViewMode 3
ViewAimpoint 0.000000 0.000000 0.000000
ViewDirection -6.864388 -0.371756 0.000000
ViewZoomFactor 34.119892
[/quote]
The camera motion coordinates seem a bit oddly one sided?
I've never seen another model with "ViewMode 3" or a ViewAimpoint at 0.0.0 ?
Does this mean anything to you guys?
Comments
Like these kind of lines:
0 -0.3225 1.0823 0 0 0 0.4 0.4 0.4
Though these are probably x y z coordinates
ViewAimpoint 0.000000 0.000000 0.000000
ViewDirection -6.864388 -0.371756 0.000000
The performance hit is probably expected if game has to render cockpits to every ship when normally there's only one in player ship (I think, not sure). There wouldn't be much sense to have cockpit in others than player ship anyways.
Bear in mind that I haven't used pog in over 6 months so my skills are pretty rusty.
[B]......
Though these are probably x y z coordinates
ViewAimpoint 0.000000 0.000000 0.000000
ViewDirection -6.864388 -0.371756 0.000000
The performance hit is probably expected if game has to render cockpits to every ship when normally there's only one in player ship (I think, not sure). There wouldn't be much sense to have cockpit in others than player ship anyways.
...... [/B][/QUOTE]
Yes they are x y z coords but I found it odd, that no other setup scenes (ships or subsims) have exactly 0? That may not be relevant to the Preformance hit anyhow. I'm really trying to track down the cockpit sway actually, so it can be reduced at the source and hopefully that'll improve the preformance.
I've figured out a way to get it to work with multiple players in MP now. Since it is a subsim, you can remove it (from all the other player ships) on each clients instance of the game as they join.
Like you said, only the player himself needs a cockpit. So, what kind of cockpit the other players are flying around with doesn't have to bother you on your client, as long as you have your own cockpit.
Still, I would like to track down the preformance hit to minimize it as much as possible, especially for people who have weaker PCs and still want to play the game.
[B]especially for people who have weaker PCs and still want to play the game. [/B][/QUOTE]Like me currently. I'm going to buy new computer but I'll wait for next year when pci express is released. Now it's P3 1GHz, 256mb ram, Geforce 3 Ti200.
It COULD be that the cockpits as a subsim has this performance hit b/c the cockpit is rendered instantely like the cannon bolts (when I fire my canons on a weaker computer I register a remarkeable performance hit, too).
@Cockpit Sway:
Also I never worked with lws things but I don't know how the directions have an influence on the performance.
Presumptions:
ViewMode 3 = maybe that the cockpit is visible in first person (pressing one time "F1")
ViewAimpoint = The [i]centre axis[/i] of the cockpit. (another value than 0 could move the centre of the cockpit in the z-plane (x-left/right, y-up/down) and the distance of the cockpit in z-direction additional to the settings you make in the flux section "[icInternalCamera]")
ViewDirection = The direction of this [i]centre axis[/i].
Zoom is clear.
[QUOTE][i]Originally posted by MajorTom [/i]
[B]I've figured out a way to get it to work with multiple players in MP now. Since it is a subsim, you can remove it (from all the other player ships) on each clients instance of the game as they join.[/B][/QUOTE]Thats good!
But this would still require a fast server.
[B]
It COULD be that the cockpits as a subsim has this performance hit b/c the cockpit is rendered instantely like the cannon bolts (when I fire my canons on a weaker computer I register a remarkeable performance hit, too).
@Cockpit Sway:
Also I never worked with lws things but I don't know how the directions have an influence on the performance.
[/B][/QUOTE]
Could well be, simular to the bolts, yes.
Although I have discovered that a primary preformance hit with bolts is because of the bolts sound and not the bolt itself. (If you define the preformance hit in terms of a delay when the bolt is fired)
I was thinking the sway might a major contributor to the preformance hit because it is an additional, more or less constant, movement immediatly in front of the viewpoint. (like when you are close to a large object) Hopefullly less sway will mean better preformance.
[QUOTE]
[B]
Thats good!
But this would still require a fast server. [/B][/QUOTE]
If we take the other cockpit subsims off as part of the client app that should be enough, because it would include the client, that the server host is playing on.
I don't think the server app has any graphics or renders anything at all: You can run a dedicated server on a PC with a very low power graphics card and you'll see no difference.
If I'm wrong, about the server app not rendering, we still have the option to leave the subsim out of the ships ini file. We can Subsim.Create the cockpit we want specifically on each players client as his ship spawns. (that wouldn't take any more code than removing it).
To make it easier to code, we could even put the subsim.ini file (with it's path) in the ships ini as a string property.
[B]I don't think the server app has any graphics or renders anything at all [...]
If I'm wrong, about the server app not rendering, we still have the option to [...] Subsim.Create the cockpit we want specifically on each players client as his ship spawns. (that wouldn't take any more code than removing it).
To make it easier to code, we could even put the subsim.ini file (with it's path) in the ships ini as a string property. [/B][/QUOTE]Fine! :) Well, the first method regarding the server could be tested.
@Cockpit Sway: Oh, I see what you guess. That could be the reason as well: So decreasing its size by one dimension should be remarkeable regarding the performance.
Btw @"Bolts performance delay": Yes I meant this.
All in all, based on your note in the SWMP forum you'll determined how to increase the performance good enough?
[B]
All in all, based on your note in the SWMP forum you'll determined how to increase the performance good enough? [/B][/QUOTE]
I discovered that it's better to remove all of the properties, except a dummy bolt, in the icTurret ini file. (Apparently flux then defaults to the values it is most comfortable with).
I'm pretty sure, the preformance will be good enough. Unfortunatly I don't have a really low spec PC to test it on.
The oldest I have is a cheapo MB with a AMD 1600+ and a 64MB GF4Ti4200. Thats at least twice the EOC min. requirements, but that's probably pretty much below spec average nowadays?
[B]The oldest I have is a cheapo MB with a AMD 1600+ and a 64MB GF4Ti4200. Thats at least twice the EOC min. requirements, but that's probably pretty much below spec average nowadays? [/B][/QUOTE]I'm sure it hits the spec average. The vid cards is the average for sure, many ppl still uses cards like Radeon9000/9200 or GF2/3/4MX/Ti.
My oldest sys is a Athlon1000C (the K6-2 is too slow) but with a Radeon9700 what is above the average specs.
I think the cockpit design also has a lot to do with the preformance too. The less thats rendered the better the proformance. A really simple cockpit design would probably be better.
[QUOTE][i]Originally posted by Roi Danton [/i]
[B] So decreasing its size by one dimension should be remarkeable regarding the performance.
[/B][/QUOTE]
Not really. The size reduction is only relative. If you reduce the size and don't move it back towards the viewpoint, you will see the (inner) cut off ends of the cockpit struts or whatever other cockpit structures are there.
i.e. By moving the position of the cockpit back closer to the pilots viewpoint you still have the same visual size and the game still has the same amount of texture to render.
I've searched the net for other cockpit models in lw 5.6 but couldn't find any. Anyone have a cockpit model to test, or know where I could find one (some) ??
[QUOTE][i]Originally posted by MajorTom [/i]
[B]I've searched the net for other cockpit models in lw 5.6 but couldn't find any. Anyone have a cockpit model to test, or know where I could find one (some) ?? [/B][/QUOTE]Do [size=3][b]Simon[/b][/size] or [size=3][b]Logic[/b][/size] reading here?
If it is so it would be great if you could support MajTom. The StarWars Mulitplayer Mod will affect a huge improvement for Buda5, too.
I haven't done a lot on the space sim models for a while cause i wanted to do something completely different than i have done before so i am looking at trains just now for train sims. A bit different ot space ships and boats but it's nice to have a change.
I do read the forums now and then so i am still here incase you are wondering.
Hope this helps.
Simon.
DLed it.
Is that model different than the one released with the Starfury? I'll load it up and see. I've tested the released version of the Starfury cockpit extensivly. (That is currently the only Cockpit avaliable besides the stock version.)
It works just fine as a subsim and even when you switch it via pog.
I tried to take out the centerpiece of the starfury cockpit for testing to see if the lights effect preformance. Replaced it with a "black" (transparent) centerpiece but it still showed up as a white surface. Why couldn't I get it to be transparent? Was that part of the cockpit model originally designed specifically to be a textured surface?
Quite understandable that you want to do something else for a change. I just checked out your site and was impressed with your Warhammer Land Raider model.
Still, you wouldn't perhaps be just a tiny bit interested in doing a cockpit, for example one for the Thunderbolt? hint hint :rolleyes: ;) :D
I am away to work tommorow for 3 weeks so i won't be on the net as much.
Simon.