Naval Grid OXP

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Naval Grid OXP

Post by Lone_Wolf »

Made some small fixes, did some play testing and everything seems in order.

Uploaded new 1.10 file here : https://app.box.com/s/7i1wzs0mubup2fjqjtp91gknchogc5gq

Also uploaded to oxz manager.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at lone_wolf@klaas-de-kat.nl

User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Naval Grid OXP

Post by Lone_Wolf »

It seems my playtesting was not thorough enough, as i found several errors.

New version 1.11 uploaded to OXZ manager and my box account : https://app.box.com/s/bjhrll2e791iprid4r7n44svxqf0kvw7

Change log

v1.11
- it was impossible to install Naval Energy Unit or Naval Grid if you had civilian energy grid installed, added sell option for energy grid to solve this
- fixed errors in the functions that handle apply/revert the modificationss to the shield charge values
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at lone_wolf@klaas-de-kat.nl

User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Naval Grid OXP

Post by Lone_Wolf »

function name in replacement equipment handler was wrong.
corrected in v1.11.1 .
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at lone_wolf@klaas-de-kat.nl

User avatar
phkb
Commodore
Commodore
Posts: 2692
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: Naval Grid OXP

Post by phkb »

Getting these messages in my log file after the update to 1.11.1:

Code: Select all

15:01:50.036 [script.javaScript.exception.overRecursed]: ***** JavaScript exception (oolite-default-player-script 1.82): InternalError: too much recursion
15:01:50.274 [script.javaScript.exception.overRecursed]: ***** JavaScript exception (oolite-default-player-script 1.82): InternalError: too much recursion
I reverted back to version 1.0 and the errors went away.

User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Naval Grid OXP

Post by Lone_Wolf »

Thanks for the report, Phkb.

After i saw this I checked my logs and noticed the same error .
The error is caused by the replacement handlers 1.10+ install, but wasn't noticed earlier because of the error i corrected in 1.11.1 .

It's clear now the new version needs a lot more testing, I have reverted the Naval Grid version in the oxz manager to 1.00 .

I'll look into the recursion error, once i fixed it i will upload it as a separate oxp/oxz called "Naval Grid Next" .
(I should probably have done that with 1.10 instead of replacing the stable version).
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at lone_wolf@klaas-de-kat.nl

User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Naval Grid OXP

Post by Lone_Wolf »

I've looked hard at the problems in 1.10 / 1.11 and abandoned the replacement handler strategy.
v1.12 uses a different method that i have playtested for several hours without getting problems.

Naval Grid Next 1.12 is uploaded to the OXZ manager and the oxp version to my box account, https://app.box.com/s/uzy1s9tcgn8m0863kn9wv0sx87hhvj0g

My play testing was mostly done with the military version on a FDL_3G+(t) , and i did get the feeling it may be a bit TOO good.
Please test with other ships , and also with the civilian version.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at lone_wolf@klaas-de-kat.nl

Anonymissimus
---- E L I T E ----
---- E L I T E ----
Posts: 299
Joined: Mon Apr 27, 2015 9:03 pm

Re: Naval Grid OXP

Post by Anonymissimus »

In your equipment.plist there's
requires_equipment = "EQ_EXTRA_ENERGY_UNIT";
but should be requires_equipment = "EQ_ENERGY_UNIT";

Now I can actually buy it. But for a ship with only EEU and cobra 3 energy recharge (7.2) it's not really worth it it seems as there's often not enough energy for ECM and weapons anyway. I've modified the values for _ng_switch_max, but I think that any way of determining the additional shield recharge in a static way is inappropriate. The additional shield recharge should be calculated dynamically, depending on the current status of the energy banks. Complete energy recharge available to the shields when at > 80% max capacity and no extra recharge when at < 30% or so. So that in a fight when ECM is ringing (e.g. Barracuda assassins) all the time there's enough energy for it, while in a fight vs thargoids (They don't use missiles) a little more shield recharge if enough energy is available.
warning sound if a missile is inbound: Missile warning

User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: Naval Grid OXP

Post by Lone_Wolf »

In your equipment.plist there's
requires_equipment = "EQ_EXTRA_ENERGY_UNIT";
but should be requires_equipment = "EQ_ENERGY_UNIT";
Good catch, will be changed in next version.
But for a ship with only EEU and cobra 3 energy recharge (7.2) it's not really worth it it seems as there's often not enough energy for ECM and weapons anyway. I've modified the values for _ng_switch_max, but I think that any way of determining the additional shield recharge in a static way is inappropriate. The additional shield recharge should be calculated dynamically, depending on the current status of the energy banks. Complete energy recharge available to the shields when at > 80% max capacity and no extra recharge when at < 30% or so. So that in a fight when ECM is ringing (e.g. Barracuda assassins) all the time there's enough energy for it, while in a fight vs thargoids (They don't use missiles) a little more shield recharge if enough energy is available.
The shield recharge of a ship is the Max amount used for shield recharging.
The core game code takes into account how much energy is left in the banks and decreases the actual amount going to the shields if necessary .
If i was to implement your suggestion, it would have to be timer-based and we'd have 2 independent mechanisms (core game and oxp) that both interfere with actual shield recharge.

Did your cobra 3 have Mil. shields ?
If so, i'd advise removing the civilian grid .
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at lone_wolf@klaas-de-kat.nl

Rustem
Deadly
Deadly
Posts: 170
Joined: Mon May 25, 2015 5:23 pm
Location: Russia

Re: Naval Grid OXP

Post by Rustem »

Made some fixes, if someone will play testing and will reported everything seems in order, it is may uploaded to the OXP-manager.

Uploaded new 1.13 file here for testing: https://app.box.com/s/nzckyxtmtncdb09c3zhzhz49jgayiive

Change log

v1.13
- renamed the equipment key for Naval Grid.
- correctly setup of the recharge rates after buy&sell the energy, grid, shield equipments.

Added calculation table for check the recharge rates.

Question:
Naval Energy Grid and Civilian Energy Grid may be installed simultaneously(in concept)?

dybal
---- E L I T E ----
---- E L I T E ----
Posts: 405
Joined: Mon Feb 10, 2020 12:47 pm
Location: São Paulo, Brasil

Re: Naval Grid OXP

Post by dybal »

Version 1.13 available on the Expansion Manager or here.

Changes:
- corrected equipment misnaming that prevented the civilian version from being available for purchase.

PS: I only saw the previous post after uploading the new version. I downloaded Rustem's update and will incorporate it into a new version coming out soon :P

dybal
---- E L I T E ----
---- E L I T E ----
Posts: 405
Joined: Mon Feb 10, 2020 12:47 pm
Location: São Paulo, Brasil

[RELEASE]:NavalGrid OXP v2.0

Post by dybal »

NavalGrid OXP v2.0 is available on the Expansion Manager and here.

Changes:
  • The Naval Energy Grid is now compatible with the EEU - if it can handle the NEU's output, it sure should be able to handle EEU's.
  • NEU or EEU can be sold for a 40% refund.
  • The civilian energy grid transfers a lower fraction of the available energy when NEU (instead of EEU) was installed (lower fraction of a larger amount of energy is still a higher energy transfer).
  • Re-write to expose functions to calculate the shield recharge rates taking into account the Shield Boosters and taking into account the Energy Grids for other OXPs (N-Shields) to use enabling the Energy Grids for NPC ships.
Last edited by dybal on Sun Nov 01, 2020 4:28 pm, edited 2 times in total.

User avatar
Nite Owl
Deadly
Deadly
Posts: 164
Joined: Sat Jan 20, 2018 4:08 pm
Location: In The Dark

Re: Naval Grid OXP

Post by Nite Owl »

Took a look at the NavalGrid.js in the new release and a bit of a puzzle crossed my mind. It occurs in the section where you define the recharge rates with ng_switch_max = [recharge rate percentage]. If the following interpretation of what is scripted there is wrong then my apologies in advance and your answers will further my education on such matters.

Civilian Energy Grid + Extra Energy Unit = 0.5 (50%) Shield Recharge Rate
Civilian Energy Grid + Naval Energy Unit = 0.3 (30%) Shield Recharge Rate
Naval Energy Grid + either Extra Energy Unit or Naval Energy Unit = 0.9 (90%) Shield Recharge Rate

The drop in recharge rate between the first two can be explained with a bit of handwavium - "The Civilian Energy Grid cannot properly conduct the vast amounts of energy being output by the Naval Energy unit." The third is a bit more perplexing as both Energy Units appear to be outputting the same amount of energy for the Naval Energy Grid to handle. Surely the Extra Energy Unit should output less energy than the Naval Energy Unit. Unless we resort to more handwavium - "The Naval Energy Grid is able to boost the output of the Extra Energy Unit through a series of built in step up transformers."

Anyhoot the above remains speculation on my part until you can confirm if my reading of the script is correct or not. However, if it is correct may the following be taken under advisement.

Civilian Energy Grid + Extra Energy Unit = 0.3 (30%) Shield Recharge Rate
Civilian Energy Grid + Naval Energy Unit = 0.5 (50%) Shield Recharge Rate
Naval Energy Grid + Extra Energy Unit = 0.7 (70%) Shield Recharge Rate
Naval Energy Grid + Naval Energy Unit = 0.9 (90%) Shield Recharge Rate

Just my two ₢ on the matter. Take it, leave it, tell me my reading of the script is wrong, whatever. The thoughts started rolling around in my head and needed to be dumped somewhere. Is that not what internet forums are for? Thanks in advance for taking the time to read this and for the effort it takes to put out such great content for fools like me to mess with.

P.S.
Check the Manifest. There is an error in there somewhere. Was able to make a best guess to get the OXZ to load but it would be best for others to get a corrected version from you with the proper information.
Humor is the second most subjective thing on the planet

Brevity is the soul of wit and vulgarity is wit's downfall

Good Night and Good Luck - Read You Soon

dybal
---- E L I T E ----
---- E L I T E ----
Posts: 405
Joined: Mon Feb 10, 2020 12:47 pm
Location: São Paulo, Brasil

Re: Naval Grid OXP

Post by dybal »

Nite Owl wrote:
Sat Oct 31, 2020 6:20 pm
Took a look at the NavalGrid.js in the new release and a bit of a puzzle crossed my mind. It occurs in the section where you define the recharge rates with ng_switch_max = [recharge rate percentage]. If the following interpretation of what is scripted there is wrong then my apologies in advance and your answers will further my education on such matters.

Civilian Energy Grid + Extra Energy Unit = 0.5 (50%) Shield Recharge Rate
Civilian Energy Grid + Naval Energy Unit = 0.3 (30%) Shield Recharge Rate
Naval Energy Grid + either Extra Energy Unit or Naval Energy Unit = 0.9 (90%) Shield Recharge Rate

The drop in recharge rate between the first two can be explained with a bit of handwavium - "The Civilian Energy Grid cannot properly conduct the vast amounts of energy being output by the Naval Energy unit." The third is a bit more perplexing as both Energy Units appear to be outputting the same amount of energy for the Naval Energy Grid to handle. Surely the Extra Energy Unit should output less energy than the Naval Energy Unit. Unless we resort to more handwavium - "The Naval Energy Grid is able to boost the output of the Extra Energy Unit through a series of built in step up transformers."

Anyhoot the above remains speculation on my part until you can confirm if my reading of the script is correct or not. However, if it is correct may the following be taken under advisement.

Civilian Energy Grid + Extra Energy Unit = 0.3 (30%) Shield Recharge Rate
Civilian Energy Grid + Naval Energy Unit = 0.5 (50%) Shield Recharge Rate
Naval Energy Grid + Extra Energy Unit = 0.7 (70%) Shield Recharge Rate
Naval Energy Grid + Naval Energy Unit = 0.9 (90%) Shield Recharge Rate

Just my two ₢ on the matter. Take it, leave it, tell me my reading of the script is wrong, whatever. The thoughts started rolling around in my head and needed to be dumped somewhere. Is that not what internet forums are for? Thanks in advance for taking the time to read this and for the effort it takes to put out such great content for fools like me to mess with.

P.S.
Check the Manifest. There is an error in there somewhere. Was able to make a best guess to get the OXZ to load but it would be best for others to get a corrected version from you with the proper information.
The energy grids allow part of the "excess" energy available to be directed to improve shield recharge, "excess" energy available being the amount of generated energy that remains after the shields are recharged.

For example, if the ship has the standard shield recharge rate, it will take 4 energy units/s to recharge the shields, if available; if the energy recharge rate is 6 units/s, there will be an "excess" of 2 units/s beyond the standard shield recharge that the energy grids can redirect to improve the shield recharge.

The energy grids don't redirect all "excess" energy to the shields. The naval version is a complete substitution of the factory energy grid, able to transfer vast amounts of energy and will always redirect 90% of the "excess" to the shields, no matter how big the "excess" might be, leaving 10% (of the excess, not of the total generated) for other equipments. The civilian version is not so robust (it adds to the factory energy grid, which is scaled to deal with the original energy recharge, so the civilian capacity will be proportional to the original energy recharge too) and will redirect a much smaller fraction of the "excess" to the shields, 50% if the EEU is installed or 30% if the NEU is installed - the restriction there being the energy grid itself.

Lets look as an example at a ship with energy recharge rate of 3 (a Mamba Escort, for example) and the standard shield recharge rate of 2 for each shield.

Without an energy unit, that ship isn't able to generate the energy for its full shield recharge rate (4 units/s, 2 units/s per shield), so the shield recharge is "starved" at 1.5 per shield.

If it has EEU, its energy recharge goes from 3 to 5.4 and the shields aren't starved, so the "excess" is 1.4 units/s. The naval version would take 90% of that excess, 1.26 units/s, and distribute between shields, 0.63 for each, so the shield recharge would go from 2 to 2.63. The civilian version would take 50% of that excess, 0.7 units/s, distribute between shields and the shield recharge would go to 2.35.

If it has NEU, its energy recharge goes from 3 to 7.8 and the "excess" is 3.8 units/s. The naval version would take 90% of that excess, 3.42 units/s, and distribute between shields, 1.71 for each, so the shield recharge would go from 2 to 3.71. The civilian version would take 30% of that excess, 1.14 units/s, distribute between shields and the shield recharge would go to 2.57, so the ship would still have better shield recharge than if it had an EEU, but not so good as if its NEU were paired to a naval energy grid.

BTW, I found and corrected the syntax error in the manifest, thanks!

Post Reply