Author Topic: BC coding parameters and reference ?  (Read 1413 times)

Offline dbw001bcc

  • Posts: 3
  • Cookies: 1
BC coding parameters and reference ?
« on: March 23, 2011, 10:33:09 PM »
I'm brand new to the Bridge Commander system and find it curious that while a great deal of time and ingenuity is used to modify the game using python scripting, I have yet to find a single thread documenting the parameters, their meanings, value ranges, interactions and their general effects on gameplay. Example: I'm looking at a .py file describing the hard point attributes for a particular ship. I cannot find a single explanation as to the significance of the following:

#################################################
Torpedoes = App.TorpedoSystemProperty_Create("Torpedoes")

Torpedoes.SetMaxCondition(1000.000000)
Torpedoes.SetCritical(0)
Torpedoes.SetTargetable(0)
Torpedoes.SetPrimary(1)
Torpedoes.SetPosition(0.000000, 1.000000, -0.100000)
Torpedoes.SetPosition2D(64.000000, 60.000000)
Torpedoes.SetRepairComplexity(3.000000)
Torpedoes.SetDisabledPercentage(0.750000)
Torpedoes.SetRadius(0.100000)
Torpedoes.SetNormalPowerPerSecond(150.000000)
Torpedoes.SetWeaponSystemType(Torpedoes.WST_TORPEDO)
Torpedoes.SetSingleFire(1)
Torpedoes.SetAimedWeapon(1)
kFiringChainString = App.TGString()
kFiringChainString.SetString("")
Torpedoes.SetFiringChainString(kFiringChainString)
Torpedoes.SetMaxTorpedoes(0, 400)
Torpedoes.SetTorpedoScript(0, "Tactical.Projectiles.KvortTorpedo")
Torpedoes.SetNumAmmoTypes(1)
App.g_kModelPropertyManager.RegisterLocalTemplate(Torpedoes)
#################################################
DisruptorCannons = App.WeaponSystemProperty_Create("Disruptor Cannons")

DisruptorCannons.SetMaxCondition(2400.000000)
DisruptorCannons.SetCritical(0)
DisruptorCannons.SetTargetable(0)
DisruptorCannons.SetPrimary(1)
DisruptorCannons.SetPosition(0.000000, -0.300000, 0.100000)
DisruptorCannons.SetPosition2D(73.000000, 65.000000)
DisruptorCannons.SetRepairComplexity(9.000000)
DisruptorCannons.SetDisabledPercentage(0.750000)
DisruptorCannons.SetRadius(0.100000)
DisruptorCannons.SetNormalPowerPerSecond(150.000000)
DisruptorCannons.SetWeaponSystemType(DisruptorCannons.WST_PULSE)
DisruptorCannons.SetSingleFire(0)
DisruptorCannons.SetAimedWeapon(1)
kFiringChainString = App.TGString()
kFiringChainString.SetString("")
DisruptorCannons.SetFiringChainString(kFiringChainString)
App.g_kModelPropertyManager.RegisterLocalTemplate(DisruptorCannons)
#################################################

While I can infer that some parameters improve the ships advantage by lowering or increasing their values, I cannot determine how these changes interact with other systems or the extent by which their altered values actually have on the desired results. For instance, if I want to modify a ship so that while its overall power output is not altered, I want this ship to have more power diverted to maintaing shield strenght at the cost of weapon potency and other subsystems. So, what I am looking for is a complete reference to every paramter recognize by the game.
*.SetMaxCondition() -> ...
*.SetCritical() -> ...
*.SetRepairComplexity() -> ... etc.

Any response will be greatly appreciated. I am intrigued by the extraordinary results from a game that was developed ten years ago and would like to see if I am able to extend its potential even further.

Offline ACES_HIGH

  • BCC Roleplay Game Narrator
  • Moderator
  • Posts: 1678
  • Cookies: 54
  • while(!(succeed=try()));
    • BCC Roleplay Games
Re: BC coding parameters and reference ?
« Reply #1 on: March 24, 2011, 03:02:44 AM »
these values are a little better explained in the Model Property Editor included in the SDK, which is a tool for modifying and creating these files.

in a nutshell, these two code blocks that you posted are the control systems for the ship's Torpedo and Disruptor systems respectively, meaning that they would have to be paired with the actual launcher system.

The parameters are actually pretty self explanatory.
forgive me if I get something wrong, it's been a while since I've manually coded a hardpoint

#################################################
Torpedoes = App.TorpedoSystemProperty_Create("Torpedoes") sets up the system and names it

Torpedoes.SetMaxCondition(1000.000000) sets maximum damage hit points the system can take before it is destroyed
Torpedoes.SetCritical(0) sets whether or not the ship explodes if this system is destroyed, the value is a binary yes or no
Torpedoes.SetTargetable(0) sets whether or not the system can be targetted in game, the value is a binary yes or no
Torpedoes.SetPrimary(1) If there are more than one of this system, this sets which to use first, the value is a binary yes or no
Torpedoes.SetPosition(0.000000, 1.000000, -0.100000) 3d position in the ship model, only really matters if the Targetable value is 1
Torpedoes.SetPosition2D(64.000000, 60.000000) 2d position on the tactical/shield icon in pixels
Torpedoes.SetRepairComplexity(3.000000) How long/how much energy does it take to repair damage, IIRC, the value is on a scale of 0 to 10, and the actual repair time is based on the power levels of the repair system and the difficulty level of the system.
Torpedoes.SetDisabledPercentage(0.750000) Damage level at which this system is disabled, value is a decimal between 0 and 1
Torpedoes.SetRadius(0.100000) size of the system on the model, in Bridge Commander native units
Torpedoes.SetNormalPowerPerSecond(150.000000) Power fed off the power conduits per second
Torpedoes.SetWeaponSystemType(Torpedoes.WST_TORPEDO) sets the weapon type, you don't need to mess with this
Torpedoes.SetSingleFire(1) IIRC, this is mainly for beams and pulses, setting whether or not you can fire more than one at a time, the value is a binary yes or no
Torpedoes.SetAimedWeapon(1) IIRC,this sets if this weapon needs to be targetted to be fired, the value is a binary yes or no
kFiringChainString = App.TGString() ignore this, initializes the next line
kFiringChainString.SetString("0;Single;2;Saucer;3;Pod;1234;Full;4;Lateral") here I've subsituted the value for another ship because this one doesn't have one, the numbers are the weapon group numbers assigned to fire with each spread, 0 is for each of them to fire one at a time, 2 commands all "2" group tubes that are aimed at the target to fire at once, 1234 calls for all tubes in groups 1-4 that can see the target to fire in one volley, etc.  Groups can be assigned single tubes, or more than one.  The words are the name you want to use for the spread.
Torpedoes.SetFiringChainString(kFiringChainString)ignore this, calls function kFiringChainString for system
Torpedoes.SetMaxTorpedoes(0, 400) sets amount of torpedoes (400) of type (0)
Torpedoes.SetTorpedoScript(0, "Tactical.Projectiles.KvortTorpedo") calls torpedo script for type (0), to add different torpedoes, repeat these two lines, increasing the type number by 1 for each
Torpedoes.SetNumAmmoTypes(1) sets number of torpedo types in the ship
App.g_kModelPropertyManager.RegisterLocalTemplate(Torpedoes) end line, calls back to system index at bottom of file
#################################################

This particular system is analogous to a modern warship's fire control system and magazine, and it is not directly linked to the torpedo tubes themselves, other than setting the torpedo types and such.  So it's power values and such do not directly effect the weapons (unless it is set as targetable and is disabled, then it will effectively disable all the torpedo tubes as well.)  If you want to change the weapon's performance, you'll have to mess around with the actual tube/emitter systems, but most of the variables on those will be similar.

Offline dbw001bcc

  • Posts: 3
  • Cookies: 1
Re: BC coding parameters and reference ?
« Reply #2 on: March 24, 2011, 01:13:09 PM »
Excellent ... thanks for the data. From what source did you acquire this knowledge? I've looked at the SDK and the documentation is rather sparse. Did the developer of the game document the parameters in an accessible repository? This is a great start. I spent 30 years designing and coding various systems with IBM and I would like to put my imagination to work on developing this game further. It is rare to see a commercial application that is this open-ended. The work I've seen thus far is outstanding. I am especially impressed by the "Koboashi Maru 1.0" extension developed for this game. Their are some stability issues that may be addressed by coding a trap that would allow game play to continue and reinitializing while the game is in progress. Thanks again and any further information will be greatly appreciated.

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: BC coding parameters and reference ?
« Reply #3 on: March 24, 2011, 01:39:05 PM »
alot of the information is by trial and error and from being around the BC scene for many years and information being passed from one person to the next...
before this forum was BCU (Bridge Commander Universe) which existed from just before BC was released (2002) until just recently, before the forum died; and there are a handful of us left who were around since way back then...  BCU had a great deal of info on that forum, and just about every question ever asked about BC was raised there and answered there...  unfortunately, it wasnt possible to rescue all that info before BCU died; and with the death of BCU, a great deal of info was lost...

however, always feel free to ask any questions you may have, even if you think the question is slight or silly...  99% of the time, thats how we all learned everything...

as far as the SDK - did you take a look at the modelpropertyeditor.html that was included?  it contains alot of info regarding hardpoints and their values and explanations...
ive enclosed it in a zip file just in case maybe you hadnt come across it...  granted, not everything is covered, but any other things youd like to know please feel free to ask :)
also - this forum at Gamefront has alot of questions about ship hardpoints and such that have been brought up; you may find some info that you are curious about there as well...
http://forums.filefront.com/st-bc-sdk-mpe-learning-center-108/

Offline Lurok91

  • Posts: 1309
  • Cookies: 2062
  • SPMod Developer (Retired)
    • Lurok91 Mods
Re: BC coding parameters and reference ?
« Reply #4 on: March 24, 2011, 01:45:41 PM »
Hi dbw and nice to welcome a potential new coder  :yay:

As Jimmy explained,  all the basic 'knowledge'  is in the SDK if you plough through it:   all the uncompiled .py game files (in Build folder),  Tools such as AI Editor as well as all the background info on how game designed and coded (from characters to missions) in series of htm and doc files.  For example, all the Model Property Editor info is in modelpropertyeditor.html.

Best sources for further info on coding in BC would be:   search any posts by MLeo (he's no longer active here, I believe),  USSSovereign (who can be also be found at Bridge Commander Scripters) and Defiant, who handles KM. 

Offline ACES_HIGH

  • BCC Roleplay Game Narrator
  • Moderator
  • Posts: 1678
  • Cookies: 54
  • while(!(succeed=try()));
    • BCC Roleplay Games
Re: BC coding parameters and reference ?
« Reply #5 on: March 24, 2011, 03:07:33 PM »
Their are some stability issues that may be addressed by coding a trap that would allow game play to continue and reinitializing while the game is in progress. Thanks again and any further information will be greatly appreciated.

if you can find Mleo, he's been working on a series of scripts that are designed to work along those lines, namely, he recently released a script that temporarily replaces missing projectile scripts and calls them out in the console report to prevent a common crash that can happen with improperly installed mods.

I think he's still around, he's just not as active as he used to be.

Offline King Class Scout

  • Posts: 1775
  • Cookies: 893
  • the other half of SFRD
Re: BC coding parameters and reference ?
« Reply #6 on: March 24, 2011, 03:16:53 PM »
thirty years coding for IBM?  *whistles*

with that much experience, mabey you could figure out how to patch the engine's memory leak without touching the EXE (the engine is sure not open scource), finishing up some of the older addon bits like NanoFX, etc.  the two master coders from the previous post are at the "burned out" level, I believe, and want to move on.

you've been greeted by the Shop Manager, the new body man (literally), and the old hand.

as for me, I'm just the head grease-monkey around here, or at least the oldest.  i'm better at tuning the ships for performance and spraying them with flames and pinstripes :P  basically, a hotrodder for starships  :funny

sorry for the auto-shop metaphores, but that's what I feel is the closest approximation to how the community (especially here) works.


OS novel fan

Coming Soon: King's Mod Tuning Shop

best line I've ever read
Me: mine [my bridges] would probably be simple to get the characters to use.  the only person that sits is the captian.
Baz: space is vast there[sic] legs will be tired by the time they get to the next planet

Offline dbw001bcc

  • Posts: 3
  • Cookies: 1
Re: BC coding parameters and reference ?
« Reply #7 on: March 24, 2011, 04:59:33 PM »
To all who replied; my appreciation for your time. Yes, I missed the MPE html documentation. That will help conciderably. I'm also looking to allow dynamic modifications to hard point attributes and test them in game with ships that can also be modified to behave in a test mode (shields up without attack), and the like. Just from what I've seen so far, this has more potential than anything I've come across. In addition, it looks promising as a way of introducing programming skills and creative thinking to those who would be otherwise bored by the often laborious task of coding. An interactive process to programming. Again, my thanks for the great responses. The collaborative process is what makes the seemingly impossible both possible and rewarding. I'll start my first lessons this weekend and document a few ideas and long-range goals for this project. I need a new hobby and a good excuse for ignoring the wife.

Offline Defiant

  • Posts: 398
  • Cookies: 1105
    • BC: Kobayashi Maru
Re: BC coding parameters and reference ?
« Reply #8 on: March 25, 2011, 03:44:48 PM »
Hi,

About KM 1.0 You should try update to 2010.02. It should be more stable ;)
-
Yes, documentation was always a weak spot. Since BC is lots of learning by trying you are happy when you got it working - Not much time and power left for the rest aka QA.
I tried to get a number of people to write some documentation once (Long time ago at BCU times), but could not motivate any.
And because of the pure size of that project I did not want to start that alone.

However the KM-Wiki could easily carry some documentation.

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2197
  • Cookies: 1706
  • Life is life
Re: BC coding parameters and reference ?
« Reply #9 on: March 25, 2011, 04:17:11 PM »
Quote
I'm brand new to the Bridge Commander system and find it curious that while a great deal of time and ingenuity is used to modify the game using python scripting, I have yet to find a single thread documenting the parameters, their meanings, value ranges, interactions and their general effects on gameplay.

In all honesty I doubt you'll find a thread which describes the API and all its functions in full detail. The developers didn't do a good job in documenting it and it was up to the community to "discover" most of it.

Quote
Their are some stability issues that may be addressed by coding a trap that would allow game play to continue and reinitializing while the game is in progress.

In general terms over the years many "solutions" have been explored with very little success. Bridge Commander uses NetImmerse engine written in C++ which in turn uses SWIG to connect it with python.

Quote
with that much experience, mabey you could figure out how to patch the engine's memory leak without touching the EXE (the engine is sure not open scource), finishing up some of the older addon bits like NanoFX, etc.  the two master coders from the previous post are at the "burned out" level, I believe, and want to move on.

I'm not burned out. I'm just busy with other things in my life, namely my job for a start. Also memory leak issue has been discussed lots of times now.

@ dbw001bcc
I would be more than happy to answer any questions you may have however. Although it's safest to PM me, I might... no I will probably forget about this thread. Also welcome to the BC scripting division lol
Acta, non verba.
aka USS Sovereign