EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[Script] Hive Shield v1.20 (10/10/2011)
Post new topic Reply to topic Goto page 1, 2  Next
View previous topic :: View next topic
Author Message
BinaryBoy





Joined: 14 Oct 2008
Posts: 78 on topic

Thank you for registering your game
modified
PostPosted: Fri, 19. Nov 10, 05:21    Post subject: [Script] Hive Shield v1.20 (10/10/2011) Reply with quote Print

Hive Shield

Hive Shield v1.20

Introduction
---
In version 1.20, I moved away from the inital idea of all ships supporting each other, and more towards the Shield Ship Idea, greatly increasing the scripts performace and away from working passively, using the command console instead.

Mechanics
---
you will need an M1, M2 or M7 with special command software MK1 installed in order to use Hive Shield.

Hive shield only works on ships that are within 5Km of Ships designated as Hive Shield Ships, for any ship that's within range of the Shield Ship, those ships get 5% of the value of the ships shields energy (shield energy that is available, not max shield capacity). However, the Shield ship has to hold position in order to activate the Shield ship effect.

overcharge modes will improve the Hive Shield Ship effect but will constantly leech shield energy, overcharge modes can either provided an extended range of 15Km, an doubled regen rate or an increased regen amount of 8%.

V1.20
No longer an AL Plugin, instead it's activated via Command console
reduced effected ships to selected 'Shield Ships'
Hive shield ships will provide a bigger boost in regen to other ships than before
Overcharge modes added

v1.10
Reduced effected ships to player owned ships only
excluded docked ships from being effected
range increased to 5Km
a few other minor improvements.

if you prefered the previous version of Hive shield instead (1.10v), it's still downloadable here

Command slot used <t id="546">COMMAND_TYPE_SPECIAL_46</t>


_________________
Scripts by me

JumpPoint v1.40b
Hive Shield v1.20


Last edited by BinaryBoy on Mon, 10. Oct 11, 18:29; edited 5 times in total
Back to top
View user's profile Send private message
Ikaruga





Joined: 30 Jan 2004
Posts: 366 on topic
Location: France, Lyon
Thank you for registering your game
PostPosted: Fri, 19. Nov 10, 09:45    Post subject: Reply with quote Print

Good idea ! Reminds me a ship from the XTM mod for Reunion called the Custodian : she had the ability to take shield damages instead of the ships around her.

However, you might want to increase the distance because 1km is a bit short and collision avoidance script/ships crashes will happen before a friendly ship reaches this distance. Even longer before with capital ships.

I suggest you change it to be 5 km.


_________________
If brute force doesn't solve your problems, then you aren't using enough
Back to top
View user's profile Send private message Send e-mail
BinaryBoy





Joined: 14 Oct 2008
Posts: 78 on topic

Thank you for registering your game
modified
PostPosted: Fri, 19. Nov 10, 16:45    Post subject: Reply with quote Print

I'll make the distance changes from 1Km to 5Km in the next version, for the time being, I've provided a small patch if you want it to be 5Km now.

just replace the events script file with the one from the provided zip according to which one you installed.

Sector Version 5Km Patch


_________________
Scripts by me

JumpPoint v1.40b
Hive Shield v1.20


Last edited by BinaryBoy on Sat, 27. Nov 10, 21:08; edited 1 time in total
Back to top
View user's profile Send private message
Triaxx2





Joined: 29 Dec 2009
Posts: 7071 on topic

Thank you for registering your game
PostPosted: Fri, 19. Nov 10, 17:00    Post subject: Reply with quote Print

This is awesome. I was expecting something like clusters set to use shields equal to all the ships in it, but this is just awesome.

I think 5km is a better number. Unless you can make it scale with ship size. Since fighters inside of 1k are fine, but carriers and destroyers that close aren't really a good idea.

Back to top
View user's profile Send private message
Bobucles





Joined: 25 Dec 2009
Posts: 2252 on topic

Thank you for registering your game
PostPosted: Fri, 19. Nov 10, 17:10    Post subject: Reply with quote Print

Quote:
2% of those ships shields energy (shield energy that is available, not max shield capacity) is added to that ship
What does this mean??? Confused


_________________
Core Shields (Rebirth)
Back to top
View user's profile Send private message
Ikaruga





Joined: 30 Jan 2004
Posts: 366 on topic
Location: France, Lyon
Thank you for registering your game
PostPosted: Fri, 19. Nov 10, 17:57    Post subject: Reply with quote Print

If I guessed correctly, when a ship equipped with this device gets hit, it takes shield battery from the friendly ships 1 km around instead of its own, but not more than 2 % of the other ship ...

Example : a fighter has 25 MJ and lost 5 MJ in a fight, it gets close to a corvette which has 100 MJ, the fighter will insta reload 100 * 0.02 = 2 MJ from the corvette.

Can BinaryBoy confirm this please ?

And thanks for the new version, by the way ! Glad I could help Cool


_________________
If brute force doesn't solve your problems, then you aren't using enough
Back to top
View user's profile Send private message Send e-mail
BinaryBoy





Joined: 14 Oct 2008
Posts: 78 on topic

Thank you for registering your game
PostPosted: Fri, 19. Nov 10, 18:39    Post subject: Reply with quote Print

It adds a boost to shield regeneration, but doesn't subtract shield energy from other ships

the script gets a list of all ships that are close to each ship in the sector, it then gets the value of available shield energy and calculates what 2% of that value is. the script then uses that number and adds that number to the current ships shield value.

it does this every 10 seconds

the example you gave sounds about right.


_________________
Scripts by me

JumpPoint v1.40b
Hive Shield v1.20
Back to top
View user's profile Send private message
BinaryBoy





Joined: 14 Oct 2008
Posts: 78 on topic

Thank you for registering your game
PostPosted: Fri, 19. Nov 10, 18:41    Post subject: Reply with quote Print

to explain what happens with the script better, I've prepared a scenario and diagram for reference



say there are several ships, which are numbered 1 to 5 from left to right, range is shown in kilometres at the top, and shields are shown in megajoules at the bottom

Ship 1 is an M2, with 8000MJ of shield energy available and is already at full shields, so no regeneration for ship 1 is needed.

Ship 2 is an M3, and has 60 out of 75 shield energy available, and since it's within range of ship 1, which has better shields so ship 2 will get a significant regeneration effect. Ship 2 is also within range of ships 3 and 4.

Ship 2 cap is 20% of 75 = 15
get 2% shield value from other ships
S1 (160) + S3 (1.2) + S4 (0.2) = 161.4

Ship 3 is within range of ships 2 4 and 5

S2 (1.1) + S4 (0.2) + S5 (1.5) = 2.8

Ship 4 is within range of ships 2 3 and 5, which is the same number of ships and same type of ships as the last ship we calculated, but actually gets a better regeneration effect since there's a larger amount of shield energy available.

S2 (1.1) + S3 (1.2) + S5 (1.5) = 3.8

Ship 5 has full shields already, so it is ignored and receives no regeneration effect


_________________
Scripts by me

JumpPoint v1.40b
Hive Shield v1.20
Back to top
View user's profile Send private message
lamoyja





Joined: 09 Dec 2009
Posts: 121 on topic

Thank you for registering your game
PostPosted: Thu, 25. Nov 10, 03:49    Post subject: Reply with quote Print

Love the idea.

Think there's alot of room for ideas from this one. Shield ships,etc...

Back to top
View user's profile Send private message
Alex Corvis





Joined: 29 Dec 2006
Posts: 1283 on topic

Thank you for registering your game
PostPosted: Fri, 26. Nov 10, 10:50    Post subject: Reply with quote Print

What about docked ships? Will there be a boost to a M7's shields if there are many ships docked? or does it only work with ships in ships?

A. Corvis


_________________
Argon TS/TP Body Fix
X-Tra Ship/Station Pack (Thread) von Cadius
Back to top
View user's profile Send private message
BinaryBoy





Joined: 14 Oct 2008
Posts: 78 on topic

Thank you for registering your game
PostPosted: Fri, 26. Nov 10, 21:24    Post subject: Reply with quote Print

Hive shield currently doesn't distinguish between docked and flying ships, although that may change in a later version to flying only.


_________________
Scripts by me

JumpPoint v1.40b
Hive Shield v1.20
Back to top
View user's profile Send private message
Litcube





Joined: 20 Oct 2006
Posts: 4171 on topic
Location: Canada
Thank you for registering your game
PostPosted: Sat, 27. Nov 10, 03:44    Post subject: Reply with quote Print

Mother of God. This is a neverending 15 ms loop. You're going to get AL pileups, which are null run scripts of the main event. Some games have 3,000 - 5,000 ships in the Universe on average. 15 ms isn't actually a 15 ms wait. Depending on the number of scripts being run, this could be about 100 - 200 ms. Your script will not complete in time to run its second instance of the AL event within 10 seconds.

Rough math, it'll take 10 - 15 mins to complete one full loop on a Universe scale. Check your global scripts. See if there's a few running on the null stack.

Also, 10 seconds will have no effect 1/3 of the time on a Universal scope. The ships themselves are only updated once every 30 seconds. I'd stick with the sector only version. Even then, looping through every ship every 10 seconds is a costly thing.

Back to top
View user's profile Send private message
BinaryBoy





Joined: 14 Oct 2008
Posts: 78 on topic

Thank you for registering your game
modified
PostPosted: Sat, 27. Nov 10, 21:05    Post subject: Reply with quote Print

thanks for the info, I'll stick to a sector wide version from now on. The sector wide script should be ok to run without a wait command added.


_________________
Scripts by me

JumpPoint v1.40b
Hive Shield v1.20


Last edited by BinaryBoy on Sat, 27. Nov 10, 23:57; edited 1 time in total
Back to top
View user's profile Send private message
Litcube





Joined: 20 Oct 2006
Posts: 4171 on topic
Location: Canada
Thank you for registering your game
PostPosted: Sat, 27. Nov 10, 21:10    Post subject: Reply with quote Print

Your loop is what is refered to as n². If the current sector has 80 ships, your new script is going to run through that 6,400 times before any other script can take hold of the engine. And it'll do this every 10 seconds. Very Happy

Back to top
View user's profile Send private message
BinaryBoy





Joined: 14 Oct 2008
Posts: 78 on topic

Thank you for registering your game
PostPosted: Sat, 27. Nov 10, 21:19    Post subject: Reply with quote Print

So should I keep some wait to avoid tying up the engine when it's run?


_________________
Scripts by me

JumpPoint v1.40b
Hive Shield v1.20
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2  Next
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Fri, 20. Oct 17, 19:54

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.40192 seconds, sql queries = 29