Bridge Commander Central
BC Forums => BC Scripting => Topic started by: Nighthawk on June 15, 2008, 03:24:21 AM
-
this might sound n00bish, but, is it really necessary to define
Multiplayer.SpeciesToTorp.PHOTON
in a torpedo file, no matter the torpedo?
I mean, is it used for something vital like processing shield impacts or such?
if not, can I comment those lines out and still use them in multiplayer?
-
I think that's there to define the projectile just like the speciestoship uses the species
number to define the ship in multiplayer. The only way to know for sure is to play multi
with a partner ensuring both parties have the same scripts.
-
that's almost the main reason why I'm asking that.
I'll be packing a set of scripts for a multiplayer mod, and plan to include everything necessary to put on top of a 1.1 install, so I ask to decide if I pack those scripts or not.
also, the less scripts the engine loads when starting (or in battle), the faster it will go.
(also, offtopic for this, but don't want to make another thread: what's the script you use to have allies and enemies facing each other? the original one had the player facing both allies and enemies...)
-
When you fire a projectile in multiplayer (any projectile) it will send over the NetType (or species in case of ships or icon number in case of an icon, etc, etc) and then, all the other players will know what to fire on their sides. So, if you leave it as a Photon, then all the other ships in MP will fire a Photon Torpedo.
-
When you fire a projectile in multiplayer (any projectile) it will send over the NetType (or species in case of ships or icon number in case of an icon, etc, etc) and then, all the other players will know what to fire on their sides. So, if you leave it as a Photon, then all the other ships in MP will fire a Photon Torpedo.
you mean, everyone on their end will "see" me fire a photon
-
Yeah, and to them (the clients in this case, so BC) you will have fired a torpedo.
-
Aha.
So in short: If you put the line Multiplayer.SpeciesToTorp.PHOTON into (for example) a quantum torpedo script, you fire a quantum torped in mp but all others reconise a photon one instead.
-
Yeah, and to them (the clients in this case, so BC) you will have fired a torpedo.
Aha.
So in short: If you put the line Multiplayer.SpeciesToTorp.PHOTON into (for example) a quantum torpedo script, you fire a quantum torped in mp but all others reconise a photon one instead.
yeah, but, what do they take damage of?
-
Now, Nighthawk has said it.
That's the entire reason for requiring the same scripts across all players in an MP game.
For the ship firing it will fire a quantum, and will do according damage when it hits.
But for the client, it's a photon, and will do according damage when it hits.
And now, say, for example (remember, this is all if scripts didn't need to match), that the ship hit would have been destroyed when hit by a quantum, but not with a photon.
Big, big Problem. Mostlikely resulting in kicking everyone off the game, at best.
-
well, with all said, sux to be the one in charge of the scripts.... :(
now, something I still can't figure:
when I put several "phaser" ships like 10 galaxys battling, there's not much lag besides the normal loading time. neither in battle, even with most of them firing photons to each other.
now, when I add several "disruptor" ships (defiants, or BOPs) there is a major drop when they start firing on each other.
even setting the pulses to fire a torpedo instead of a disruptor.
I commented the multiplayer stuff out of the scripts since they're custom-made, thus don't have specific definition
it has to be a scripting issue because the polycount of the ships is not enough to cause a slowdown to the engine (under 10000 polies counting all the ships together, plus torpedoes and phasers)
I made a custom install with only the necessary stuff over a 1.1 game. no extra mods, and no extra plugins, yet the lag still exists >.<
it's driving me nuts....
is there an event that fires when a disruptor-type projectile hits the shields? (it's the only thing I can think about :?)
-
It's the projectiles (regardless if they are pulse weapons or torpedoes, since both are the same thing, or rather, they both shoot the same thing) themselves.
Limit the lifetime and you should get better results.
This was actually a problem with various StarWars mods, where a single volley from a Star Destroyer (or was that a Super Star Destroyer?) brought down BC to it's knees for some time (on an somewhat older computer).
And that was in QB.
-
indeed, I started doing that.
it worked fine for torpedo ships and even more in large battles. but for disruptor ships, it's still the same.
it's more heavy when a shoot hits a ship, rather than when its fired. that's why I thought of the shield thing.
-
Well, theoreticly, a disruptor is "heavier", as in, it has more polygons than a torpedo.
I don't know how many a pulse has, but a torpedo has 2 for the core, 2 for the glow, and 2 for each flare. In other words, not a lot.
-
Well, theoreticly, a disruptor is "heavier", as in, it has more polygons than a torpedo.
I don't know how many a pulse has, but a torpedo has 2 for the core, 2 for the glow, and 2 for each flare. In other words, not a lot.
I changed all to torpedoes. and removed most of the flares, except when needed. although, I think I can resume all in a single plane and get rid of flares and glows too.
just a quick texture work.
-
That's a bit heavy optimization, isn't it?
-
That's a bit heavy optimization, isn't it?
not quite, there's just 10 torpedo/pulse types for about 35 ships :D
most of them call a single B/W texture, and the color is done by code.
also, in the middle of a fight, who's gonna stay looking at the shot you just fired to see if it's a torpedo or a disruptor? from the player's POV, they're all sphere-ish.
having just 4 races to mod, it's not that hard anyways
EDIT: well, I'm surprised it worked.
cutting the hell out of them except a single texture for each torpedo. that's up to 4 textures to create some 15 torpedoes and bolts for all the races.
in the test field, with the same amount of ships and battle frenzy, there's noticeably less lag. so, I think I'm done :D
another Q: I get the "No module named PhotonTorpedo" error at the console.
that's ok, because I actually removed PhotonTorpedo.py from the folder. the problem comes when I try to change
kSpeciesTuple = ---
---
(PHOTON, "PhotonTorpedo"),
to
kSpeciesTuple = ---
---
(PHOTON, "whatevertorpedo"),
being it my modded torpedo.
it just freezes QB at start
-
alright, trial and error gave me the answer to the last question.
anyways, that seems to have lead me to another one ?.?
the sentence
..., App.SPECIES_GALAXY, ...
that is in several scripts, does it specify an integer?
because, in the KM script SpeciesToShip and ShipIcons, every new ship specifies an integer instead of SPECIES_ANYTHING, except the stock ships, that do call App.SPECIES_ship
this far, I could make my own ships work in multiplayer, however icons and TGL names are messed up. but they load the ship they're supposed to load :P
-
Well, considering everything else in KMs speciesTo defines it as an integer, then, yes, they define an integer. ;)
(And yes, they really do that, based on experiments, like printing out the value and the type of the value)
-
Well, considering everything else in KMs speciesTo defines it as an integer, then, yes, they define an integer. ;)
(And yes, they really do that, based on experiments, like printing out the value and the type of the value)
indeed, I just found out.
I'll have to make a new species table for each race. but, I got to prove my point. putting 100 in the first ShipIconDef instead of App.SPECIES_GALAXY and also 100 in the first SpeciesToShip entry, it actually loaded its icon and ship
now, do I really need TGLs or is there a way to print the ship name in the button by just calling its LongName from the ship file?
-
If you mean the plugin, then you will need to actually load the plugin.
As for races, what exactly are you trying to do? You can just append extra information in the tuple.
For the TGLs, not without surgery to the UI code, it's possible though.
-
If you mean the plugin, then you will need to actually load the plugin.
I think I can use __import__ and the same name I use to define the icon.
As for races, what exactly are you trying to do? You can just append extra information in the tuple.
I mean, remaking the definitions to use new integers instead of "App.SPECIES_"
I'm attaching the first working, non-finished, screenies
although, it still loads the old Akira icon in the interface, and the new one in the menu, and the ship was not even a SPECIES_AKIRA. it was a SPECIES_FREIGHTER :S
-
It's the speciesToShips that defines the icon.
-
(Sorry I don't intend to thread hijack!)
MLeo, is it possible that this could be the problem that I am having with my install? (http://bc-central.net/forums/index.php?topic=3299.0)
-
Potentially, but I really can't think of anything (there) that could cause it.
But MP doesn't work through that system.
-
It's the speciesToShips that defines the icon.
that's why I'm lost. I first defined it as SPECIES_FREIGHTER, never as SPECIES_AKIRA.
at most, outside the freighter, it was a SPECIES_AMBASSADOR.
but I can assure you, never an Akira.
-
kSpeciesTuple = (
(None, 0, "Neutral", 0),
("Akira", App.SPECIES_AKIRA, "Federation", 1),
("Ambassador", App.SPECIES_AMBASSADOR, "Federation", 1),
The first part defines the ship file (scripts/Ships), the second the icon number, the third the "race", the fourth the "class" of ship (I think, judging from the scripts, it's for things like "Ok, this ship is size 1, the next is size 2, size 2 is bigger/heavier than size 1, think Fighter and Destroyer classes).
-
working on it, but still, keeps loading the akira. even with these settings.
kSpeciesTuple = (
(None, 0, "Neutral", 0),
("------Curry", 100, "Federation", 1),
("------Prometheus", App.SPECIES_AKIRA, "Federation", 1),
("------Galaxy", App.SPECIES_GALAXY, "Federation", 1),
def LoadShipIcons(ShipIcons = None):
if ShipIcons is None:
ShipIcons = App.g_kIconManager.CreateIconGroup("ShipIcons")
App.g_kIconManager.AddIconGroup(ShipIcons)
TextureHandle = ShipIcons.LoadIconTexture('Data/Icons/Bridge/Background/ScreenBlock.tga')
ShipIcons.SetIconLocation(App.SPECIES_UNKNOWN, TextureHandle, 0, 0, 8, 8)
ShipIconDef('------Curry', { 'species': 100 } )
ShipIconDef('------Prometheus', { 'species': 102 } )
ShipIconDef('------Galaxy', { 'species': 103 } )
the Custom\ships\plugin read App.SPECIES_AMBASSADOR. changed it to "100", but still nothing
-
The ShipIconDef will attempt to load a texture called data/Icons/Ships/------Curry.tga
That won't work, I think.
Just make sure the numbers in the kSpeciesTuple match the numbers you use with LoadShipIcons.
-
The ShipIconDef will attempt to load a texture called data/Icons/Ships/------Curry.tga
That won't work, I think.
Just make sure the numbers in the kSpeciesTuple match the numbers you use with LoadShipIcons.
forget that, it's just a mod-cover thing.
both names point to the same file actually.
it's funny that that file loads an Akira, and the Galaxy one loads the FedStarbase icon. now, the curry pointer calls the sabre's icon file.
meh....
the ships load and work in the game, it's just this thing what doesn't
and also QB freezes and I can't open the console.
EDIT: just solved it. console tracker roxx! :D
-
So what was it?
-
it was calling Multiplayer.SpeciesToShip.Galaxy, and I removed it from the SpeciesToShip replacing it with my galaxy.
strange thing is, it was calling it from c:\utopia\current\build\
-
it was calling Multiplayer.SpeciesToShip.Galaxy, and I removed it from the SpeciesToShip replacing it with my galaxy.
strange thing is, it was calling it from c:\utopia\current\build\
That's either from one of the original pyc files, or from inside the engine.
-
something I just found out and couldn't figure:
all those torpedoes I was talking about, I actually either re-named or removed them. I changed some definitions in SpeciesToTorp so they point to my modded torpedoes, but also commented out the species line in some scripts, to test what might happen.
the point is, in multiplayer, commented out or not, pointed to the right file or not, they still load the torpedo they're supposed to load. and before that, it crashed when it couldn't find PhotonTorpedo.py.
I just don't get it...
-
Well, if a projectile launcher (be it a torpedo launcher or a pulse weapon) can't find the projectile script (doesn't matter if it's QB, SP or MP), BC will crash.
-
gOT n LIITLE question here. The Torpedotypes, in Originaly it was this
# Multiplayer specific stuff. Please, if you create a new torp
# type. modify the SpeciesToTorp.py file to add the new type.
import Multiplayer.SpeciesToTorp
pTorp.SetNetType (Multiplayer.SpeciesToTorp.PHOTON)
The Changed THing is This
# Multiplayer specific stuff. Please, if you create a new torp
# type. modify the SpeciesToTorp.py file to add the new type.
import Multiplayer.SpeciesToTorp
pTorp.SetNetType (Multiplayer.SpeciesToTorp.AURORATORPEDO)
Is this right so?
-
Assuming that AURORATORPEDO is the constant you wish to identify that particular torpedo with, then yes.
Also assuming that AURORATORPEDO is an unique constant in SpeciesToTorp.py
Please note that this constant has the same implications as with ships, so it needs to correspond to the index in the kSpeciesTuple of SpeciesToTorp.py
-
Ok i guess, there are no more Probs with this, but i will move now to an special new Topic, about my Mods and upcoming ships, and the MP-Probs i currently have see in MP-Ships-Problems
Thnx in Anyway
;)