Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: TrashMan on January 03, 2007, 06:15:16 pm

Title: What happened to the Power Output thingie?
Post by: TrashMan on January 03, 2007, 06:15:16 pm
If I recall correctly that field is useless.

Some coders wanted to give it real mening, but to preserve backward compabiltiy tehy made another entry names similary...or something like that.

 I cna't remeber.

Anyway, I wanted to know whats the deal with this.
Does it have any real purpose? Is that other field implemented in 3.6.9.?
Title: Re: What happened to the Power Output thingie?
Post by: Trivial Psychic on January 03, 2007, 09:15:37 pm
While there's nothing about it in the wiki, the logical place to put such a feature would be part of the ai_profiles.tbl.
Title: Re: What happened to the Power Output thingie?
Post by: TrashMan on January 04, 2007, 05:13:29 am
What does ai_profiles have to do with the power output of individual ships?

I want a line in the ships tbl that actually makes power output meaningless.
It can be a new line like $Reactor Power: or something to keep it backwards compatible.

A way to diversify fighters trough more than just armor/shields/speed. If hte ship description sez "new powerfull reactor" then I want to feel it in-game dammit!
Title: Re: What happened to the Power Output thingie?
Post by: TrashMan on January 04, 2007, 04:47:06 pm
On an unrelated note - when is the limit of 130 ship classes going to be lifted?
It's KILLING me!
Title: Re: What happened to the Power Output thingie?
Post by: Trivial Psychic on January 04, 2007, 09:19:25 pm
What does ai_profiles have to do with the power output of individual ships?

I want a line in the ships tbl that actually makes power output meaningless.
It can be a new line like $Reactor Power: or something to keep it backwards compatible.

A way to diversify fighters trough more than just armor/shields/speed. If hte ship description sez "new powerfull reactor" then I want to feel it in-game dammit!
AI_profiles has campaign options that affect the player as well as the AI.  Smart Shields for example, is enabled in the AI_Profiles table, and was previously a command line option.  It affects both the shields on AI ships, and on the player ship.  A simple $Use Reactor Power: yes/no would suffice to enable it.  It would use the existing entry in the ships table to base its data on, but the question then becomes HOW should it be used.  Would the reactor figure be applied to the ETS system?
Title: Re: What happened to the Power Output thingie?
Post by: TrashMan on January 05, 2007, 08:33:03 am
So it DOES work! :D

Brilliant! I'll have to check it out :D

ERM..what, you mean that it SHOULD be there or that it IS there? I've been waiting for ages for adjustable power output for each ship (and they AI would use it like it uses it normally - applied to ETS, everything re-chanrges faster.)
Title: Re: What happened to the Power Output thingie?
Post by: Trivial Psychic on January 05, 2007, 11:43:30 am
In the AI_profiles?  I didn't see it in the WiKi.
Title: Re: What happened to the Power Output thingie?
Post by: Bobboau on January 05, 2007, 02:57:15 pm
...but the question then becomes HOW should it be used.  Would the reactor figure be applied to the ETS system?

if you do a search in the code for the word new_energy I think the answer should become clear.
Title: Re: What happened to the Power Output thingie?
Post by: TrashMan on January 05, 2007, 03:28:29 pm
Secrecy...gah..how I LUV it...not.

Can I get a straight answer over here?

Is there a option/flag/part of the code/table entry/whatever that does that (adjusts power output for each ship)?

If there is, what is it and how does it work?
Title: Re: What happened to the Power Output thingie?
Post by: Bobboau on January 06, 2007, 12:05:50 pm
no, but there should be
Title: Re: What happened to the Power Output thingie?
Post by: TrashMan on January 06, 2007, 03:37:38 pm
WEll F***!

Will this be implemented in the future? I was counting with that feature for years now, since I wanted to make differences between various ships even more apparent.
It would be very usefull and can easily be made backward compatible (simple +UsePowerValue addition to hte ships tbl. The ships that have that added will use whatever number is in hte Power Output field, other will sue the default.. simple)
Title: Re: What happened to the Power Output thingie?
Post by: Bobboau on January 08, 2007, 10:30:26 pm
ok, I tell you what, I'll do it right now, how's that?
Title: Re: What happened to the Power Output thingie?
Post by: Bobboau on January 08, 2007, 10:44:50 pm
http://freespace.volitionwatch.com/blackwater/fs2_open_Bobboau_1-8-07.zip

now as payment, I want you to test the following conditions for me,
all other ships act exactly the same as they used to,
if you add an underscore between the power and output ($Power_Output:) you can now actualy set it to something that it will use.

that the new shield effect I was testing works, as it is hardwired on at the moment, if you get any crashes in the middle of any fights, this would probly be what it's from.
Title: Re: What happened to the Power Output thingie?
Post by: Axem on January 08, 2007, 10:54:12 pm
Upon running the build without any mods I get this error...

Code: [Select]
Error: ships.tbl(line 188:
Error: Required token = [#End], [$Subsystem:] or [$Name], found [2.0].

File:I:\FSO\fs2_open\code\Parse\PARSELO.CPP
Line: 659
[This filename points to the location of a file on the computer that built this executable]

Call stack:
------------------------------------------------------------------
    required_string_3()    parse_ship()    parse_shiptbl()    ship_init()    game_init()    game_main()    WinMain()    WinMainCRTStartup()    KERNEL32.dll 7c4e87f5()
------------------------------------------------------------------
Title: Re: What happened to the Power Output thingie?
Post by: Bobboau on January 08, 2007, 11:29:01 pm
ah, the joy of uploading a build without haveing first run it, yes, that error does indeed make perfict sence, just a sec.
Title: Re: What happened to the Power Output thingie?
Post by: Bobboau on January 08, 2007, 11:37:21 pm
there, I'm an idiot, sorry bout that.
Title: Re: What happened to the Power Output thingie?
Post by: TrashMan on January 09, 2007, 07:56:37 am
Bob, you are my hero!

Fianlly....FINALLY!!!!
Title: Re: What happened to the Power Output thingie?
Post by: SadisticSid on January 09, 2007, 08:16:15 am
TrashMan, if you want a higher ships limit and don't mind breaking multi, an Inferno build should do the trick.

http://icculus.org/~taylor/fso/willrobinson/reboot-inf.rar is the one I'm using ATM :)
Title: Re: What happened to the Power Output thingie?
Post by: Bobboau on January 09, 2007, 11:29:05 am
well, I've recently noticed that OGL has all kinds of problems(in my code base), not the least of wich is it doesn't seem to recognise texture clamping. I don't know how the hell this happend as I have hardly touched anything API specific, but I have been running in  D3D mode mostly sence I was trying to fix environment mapping.

actualy it looks more like most of those problems have to do with the load order being diferent between D3D and OGL.
Title: Re: What happened to the Power Output thingie?
Post by: karajorma on January 09, 2007, 01:35:39 pm
TrashMan, if you want a higher ships limit and don't mind breaking multi, an Inferno build should do the trick.

That won't actually break multi any more. You've been able to play on Inferno CVS builds for months.

It will break Multiplayer Pilots though so you absolutely must back those up (or just use different named pilots) before using them on an inferno build. Once you have you could have problems if you try going back.
Title: Re: What happened to the Power Output thingie?
Post by: IPAndrews on January 09, 2007, 06:31:38 pm
Something I just sent to Bobboau. Quite proud of it so I'm posting it here for comment ;).

Quote
FS2 Power System V2

Power output:

My view is that a ship's power output should be a total of a ship definable power output setting and and subsystem specific power output settings. So you can specify in the tables that a certain reactor will generate X units of power. The power output of subsystems could be linked to the damage sustained by that subsystem. More damage = less power output. You could do it in any of these ways.

a) Do periodic checks agaisnt a subsystem's damage sustained. The more damage sustained by a subsystem the more likely it is to stop producing power completely for a period of time until the next periodic check. This would result in a nice "flickering off then on" effect for ships with damaged reactors.

b) Reduce the power output of the subsystem based on damage sustained. So 50% damage 50% power output.

c) A combination of the two.

Power distribution:

There are three different power networks.

1. A power network for engines and subsystems such as sensors, navigation, communications, and actually the "weapons" subsystem which I think of as a ship's fire control computer. In fact that's how volition treat it (fire less accurate if destroyed).

2. A power network for shields.

3. A power network for primary and turret weapons.
 
Every turn a ship's power output (specified by $Power_Output for ship and specific subsystems) is shared amongst the power networks based on the ship's engines/shields/gun distribution settings, or in the case of a capship just 33%/33%/33%.

When power goes into a power network it initially goes into a battery. Specified by $Engine_Battery: $Shield_Battery: $Weapons_Battery: . Any power that can't go into a battery (maybe there isn't a battery entry in the table!) is simply made "immediately available" to systems on the network. This immediately available power will be used first by systems in preference to battery power, and is wasted at the end of every turn if not used.

Power usage:

In the tables subsystems can all be given power usage value. Although this value doesn't make sense for turrets. Since turrets only use power when they fire (or in the case of beams constantly as they are firing).

Every turn subsystems use power from the appropriate power network. Immediately available power first, then battery power. In the order that the subsystems appear in the table.

For backward compatability only subsystems that have a $Power_Usage: value will use power, and only turrets with a uses_power flag will only fire if there is enough power to cover their weapon power requirement as specified in weapons.tbl . So you need to add table entries to enable this.

Destroyed subsystems should not use energy.

Power shortage:

Power shortage for different subsystems on a ship will affect the ship differently. But generally speaking it should be the same kind of effect as if the system was destroyed (not functioning). Maybe systems with only part power should work some of the time and not others. A periodic check type thing as with a) in the power output section. Might result in all kinds of fun effects. Like engines or HUD guages flickering on and off. Would look cool :-).
Title: Re: What happened to the Power Output thingie?
Post by: Trivial Psychic on January 09, 2007, 10:02:13 pm
It might also do well to have the ship's power status tied to an actual "reactor" subsystem.  Therefore if the subsystem is knocked out, you have a no-power situation.  As a fighter you can run on internal batteries (as IPA proposed), until a support ship comes in to fix you up.  Its possible that the battery is only sufficient to maintain life support and comm systems, so its like being disabled and disarmed with no shields.  As for tables, we have seen ships in FS_retail that have a "reactor" subsystem, the Moloch, so a special subsystem flag would tell the engine to look tie the new power output to that subsystem.  The use of a subsystem flag would also allow the moder to use a different name for the reactor subsystem, like "generator" or something.  So, you have:

$Power_Output: 5.5 ;; the new one

and

$subsystem:  Reactor, 5, 0.0
$flags: ("makes power") ;; or something like that

This would also allow a ship to have more than one reactor **cough**Lucifer**cough**.  The amount of the total power that each reactor produces would be based on its subsystem strength.  For exmple, if a ship has 3 reactors, with one having a subsystem strength of 6, and the other 2 having strength of 2, that means that the stronger reactor would be producing 60% of the ship's total power, and the other 2 would be producing 20% each.  As these subsystems are dammaged or destroyed, the ship's total power available would drop.
Title: Re: What happened to the Power Output thingie?
Post by: Bobboau on January 09, 2007, 11:03:43 pm
ok, how's this,

we go with option 'b'.

$Power_Output: is the ship's base power output, and has no effect from reactors.

for each subsystem, we have a
$Power_Output:
+Shield: #.#
+Weapon: #.#
+Engine: #.#

these can have negitive values (as you would put to simulate consumption in an engine subsystem), the damage a subsystem has sustained would scale the value in the table. think of it as the net energy of this subsystem.

we add in a weapon energy tag for turrets, wich gets refilled based on how many turrets there are, and maybe a weighting value.
Title: Re: What happened to the Power Output thingie?
Post by: IPAndrews on January 10, 2007, 06:51:57 am
It might also do well to have the ship's power status tied to an actual "reactor" subsystem. 

That's the beauty of my proposed system Triv. You simply give your ship a power output of 0 and your reactor subsystem a power output of whatever. So once the reactor is destroyed your ships's power output drops to 0.
Title: Re: What happened to the Power Output thingie?
Post by: TrashMan on January 10, 2007, 06:55:35 am
Why complicate things?

Simply have the total power output distributed in the ETS. It makes little sense to have a specific subsystem churn out more power for shields but less for engines. Power is power - where you lead it to is another matter.

Alltough having a reduced power output when the fighter is damaged sounds good. The only thing is that fighters don't have a reactor subsystem, and adding it would require to edit each fighter in PCS.

You could tie output power with engines, since they are directly tied to the rector (FUSION drive technology). I don't recall disabled fighters shooting anyway. Thus, for fighters engines would be part of hte reacotr and thus, engines at 50% = reactor at 50%.
Title: Re: What happened to the Power Output thingie?
Post by: IPAndrews on January 10, 2007, 07:04:29 am
Simply have the total power output distributed in the ETS. It makes little sense to have a specific subsystem churn out more power for shields but less for engines. Power is power - where you lead it to is another matter.

I agree with you TrashMan. As in my long wordy proposal. Generate a total power and share it out between the 3 power networks according to ETS.

The actual existance of the 3 power networks at all is intended to make things easier to code. I would be just as happy with one power network. That is one pool of immediately available power and battery. But to implement ETS you would have to earmark a certain percentage of that power network to each of the 3 major groups of systems. At that point it just becomes easier to treat it as three different networks.

With 3 networks you also get the added (useless?) bonus of being able to have a different battery size for each network.

Quote
Alltough having a reduced power output when the fighter is damaged sounds good. The only thing is that fighters don't have a reactor subsystem, and adding it would require to edit each fighter in PCS.

Backward compatability. You don't want to force this on people. It would actually require a reactor system and table entries to support it.

Quote
You could tie output power with engines, since they are directly tied to the rector (FUSION drive technology). I don't recall disabled fighters shooting anyway. Thus, for fighters engines would be part of hte reacotr and thus, engines at 50% = reactor at 50%.

I thought that might be quite difficult to code :).
Title: Re: What happened to the Power Output thingie?
Post by: TrashMan on January 10, 2007, 07:14:42 am
Simply have the total power output distributed in the ETS. It makes little sense to have a specific subsystem churn out more power for shields but less for engines. Power is power - where you lead it to is another matter.

I agree with you TrashMan. As in my long wordy proposal. Generate a total power and share it out between the 3 power networks according to ETS.

The actual existance of the 3 power networks at all is intended to make things easier to code. I would be just as happy with one power network. That is one pool of immediately available power and battery. But to implement ETS you would have to earmark a certain percentage of that power network to each of the 3 major groups of systems. At that point it just becomes easier to treat it as three different networks.

With 3 networks you also get the added (useless?) bonus of being able to have a different battery size for each network.

As I recall, fighters allready have weapon and afterburner power storage... shields don't have them as they can't go over their max and that extra power is transfered to re-charge rate anyway.

Quote
Quote
Alltough having a reduced power output when the fighter is damaged sounds good. The only thing is that fighters don't have a reactor subsystem, and adding it would require to edit each fighter in PCS.

Backward compatability. You don't want to force this on people. It would actually require a reactor system and table entries to support it.

Yup. That's why I said it would be a bad idea.

Quote
Quote
You could tie output power with engines, since they are directly tied to the rector (FUSION drive technology). I don't recall disabled fighters shooting anyway. Thus, for fighters engines would be part of hte reacotr and thus, engines at 50% = reactor at 50%.

I thought that might be quite difficult to code :).
[/quote]

I'm no coder so I wouldn't know, but I doubt it would be really difficult.
Title: Re: What happened to the Power Output thingie?
Post by: IPAndrews on January 10, 2007, 07:31:04 am
As I recall, fighters allready have weapon and afterburner power storage... shields don't have them as they can't go over their max and that extra power is transfered to re-charge rate anyway.

Fighters (all ships I presume in the code) have power storage for primary weapons only and afterburners only. This is very different from my weapons and engines power networks which are intended to serve multiple systems.

The implementation of both existing guages is a bit hacky as it stands but you are right, they need to be taken into account :-). I cannot think of any neat way to tie them into the existing system.

So (ship definable):

$Afterburner_Battery_Recharge: (draining from the engine network)
$Afterburner_Battery_Capacity:
$Primary_Battery_Recharge: (draining from the weapons network)
$Primary_Battery_Capacity:

 :nervous:
Title: Re: What happened to the Power Output thingie?
Post by: Bobboau on January 10, 2007, 11:13:54 am
I'd rather not deal with adding much in the way of 'bateries' it makes things a bit more like a physics simulation, wich inherently are complex, besides they already exsist for the most part, so we don't need to add another layer of power storage. I'd be willing to give turrets a local power storage, beause that would make them more like normal weapon systems.
Title: Re: What happened to the Power Output thingie?
Post by: IPAndrews on January 10, 2007, 02:45:53 pm
I just figured if you have to have the code there for one thing, make it available for everything.
Title: Re: What happened to the Power Output thingie?
Post by: TrashMan on February 08, 2007, 04:46:04 pm
I just tried the power output build..it ain't working.
The game chrashes when I commit to a mission.

Oh yeah, and I et a ton or warinings and errors about primary banks and ballistic flag.. WTF? Has anything been changed there? My entry is as it sez in the Wiki...
Title: Re: What happened to the Power Output thingie?
Post by: redsniper on February 10, 2007, 01:33:13 pm
Hmmm... Having batteries could create some nice frantic situations. Say for some reason or another your reactor gets knocked out (some new kind of missile, or maybe sabatoge) and then you've only got a couple minutes of power left to try and fight off whoever's around you. You could even have a little timer pop up to show you how much time is left until you're hosed.
Title: Re: What happened to the Power Output thingie?
Post by: Mongoose on February 10, 2007, 02:18:01 pm
Great...FS2 goes Evangelion. :p
Title: Re: What happened to the Power Output thingie?
Post by: redsniper on February 13, 2007, 01:50:55 pm
Yeah, I'll admit that's exactly what I was thinking of, but you can't say it wouldn't be cool. :D
Title: Re: What happened to the Power Output thingie?
Post by: TrashMan on February 14, 2007, 04:05:47 pm
Say, will this be in 3.7.0.  ????