Jump to content

Photo
- - - - -

CEG - Chernarus Electrical Grid (Script Pack and Addon)


  • Please log in to reply
83 replies to this topic
Thread Starter
Loyalguard
Loyalguard

    Master Sergeant

  • Members
  • 658 posts

  • Joined: 26-June 2007

Posted 20 May 2010 - 10:39 #1

Posted Image

CEG - Chernarus Electrical Grid
Script Pack and Addon
by Loyalguard

Development Status: General Release
Current Version: 1.1

Download: MediaFire
(1.21 MB .zip)

Mirrors:
Armaholic

Visual Guide: MediaFire
(2.35 MB .pdf)

OFPEC Beta Testing Thread: CEG - Chernarus Electrical Grid (Script Pack and Addon) (Beta)

Changelog
------------

v.1.1 - 17 Jul 2010
--------------------
-NEW: Added mission maker option to add arc flash explosion (randomly or deliberately).
-FIXED: Corrected code that might cause clients connecting to multiplayer host servers not to experience same effects as host.
-CHANGED: Ensured that if mission script and addon versions were both present that the mission script version would be used instead of addon version to ensure backward compatibility.
-CHANGED: Mission script version is now initialized by editor unit init line (e.g. game logic) instead of from the init.sqf to ensure priority over addon version.
-ADDED: Added a seperate demo mission just for the addon version. Demo for mission script version renamed to avoid confusion.
-ADDED: Added a custom game logic that when placed in the editor by the mission maker adds CEG as a required addon for the mission.
-IMPROVED: Optimized smoke stack particle code.
-UPDATED: readme.txt and missionmaker.txt

v.1.0 - 21 Jun 2010
--------------------
-IMPROVED: Easier to find "Trip" and "Close" Circuit Breaker action menu items when near substation transformers by increasing the activation radius.
-IMPROVED: Added a world name check to make sure CEG is only activated for missions on Chernarus.
-IMPROVED: Power plants no longer emit circuit breaker opening and closing sounds.
-ADDED: Added mission maker option to require password to access grid control system.
-ADDED: Misson maker option to allow CCTV system to use nightvision during non-daylight hours (time customizable).
-UPDATED: readme.txt and missionmaker.txt

v.0.9.6 (Beta/Release Candidate) - 16 Jun 2010
----------------------------------------------
-FIXED: Smokestacks no longer continue to emit smoke when destroyed.
-IMPROVED: Size of sounds reduced to create a smaller download/install package.
-IMPROVED: Adjusted plant noise sound levels to be more easily heard when outside a power plant.
-IMPROVED: More realistic sounds of large substation circuit breakers tripping (opening) and closing.
-IMPROVED: Circuit breaker closing sound no longer plays at mission start.
-UPDATED: readme.txt and missionmaker.txt

v.0.9.3 (Public Beta) - 05 Jun 2010
------------------------------------
-Initial Release (as Beta)

Overview

The Chernarus Electrical Grid (CEG) for Arma2 is the succesor to Sahrani Electrical Grids (SEG) for ArmA. All of the functionality of SEG has been ported to CEG plus much more! All scripts have been completely re-written to take advantage of scripting features unavailable at the time of SEG's release for A1 and now available in A2.

The scope of the project is to simulate a working electrical grid for Chernarus modeled on existing map objects (no new objects/models). The simulation consists of two power plants that transmit power to various electrical substations throughout South Zagoria. The substations in turn distribute power locally to nearby cities, towns, and other areas.

The simulation's core function is to monitor the integrity (damage and connections) of electrical grid components (power plants and substations) and interrupt "power" to affected areas when integrity is lost or diminished. Power interruptions cause street lamps to turn off (other light sources are unaffected).

Features:

-2 power plants (Elektrozavodsk and Chernogorsk) with working smokestacks and power plant noises.
-7 electrical substations that emit a transformer humming noise when energized.
-Ability to interrupt power by destroying components or, if enabled by mission makers, by manually tripping circuit breakers via the action menu (if tripped, breakers can again be closed to restore power). Manually switching circuit breakers could cause arc flash explosions if enabled by the mission maker.
-Mission makers can enable players to remotely logon to grid control software and substation video feeds via custom dialog.
-Grid redundancy - if certain components go offline, power automatically switches to secondary circuits when available.
-Built-in task/objective support via global/public variables (with examples).
-Fully SP, MP, JIP, and persistent mission compatible. Each mode is optimized for minimal performance impact. JIP is self-contained and does not require onPlayerConnected code.
-Extensive documenation for mission makers and players. Easy implementation into any mission.
-Fully featured demo missions (for addon and script version).
-Available in script only (no addons required) and addon versions. Addon version automatically adds CEG to any mission in Chernarus.

Screenshots:

Electrical Distribution Zone Map (Color Coded)
Posted Image
Remote System Control Dialog
Posted Image
Built-in CCTV System
Posted Image


Demo Video:
8u7E8a_5Ag0

Developer Notes

I am happy to announce the general release for CEG and am sincerely appreciative to everyone at OFPEC, Dev Heaven, and here on the BIF whose either direct input or previous work has allowed me to bring my electrical grid simulation to Arma2. The beta testing thread can be found at OFPEC.

If you have comments, questions, or suggestions please post them!

Edited by Loyalguard, 22 October 2011 - 01:18.
Updated Visual Guide Link

LoyalGuard
Former OFPEC Editors Staff Member | Former ACE1 Dev Team Member
My ArmA Projects
"...brain-hurting expressions of realism like Loyalguard’s functioning Chernarus Electrical Grid." -PC Gamer

=FSI=Gen.Nembo
=FSI=Gen.Nembo

    Private

  • Members
  • 10 posts

  • Joined: 04-September 2009

Posted 20 May 2010 - 11:24 #2

News Added in ArmedAssault.info :ok:

wika_woo
wika_woo

    Master Gunnery Sergeant

  • Members
  • 1076 posts

  • Joined: 26-February 2007

Posted 20 May 2010 - 11:34 #3

this is actually awesome
Posted Image

myshaak
myshaak

    Gunnery Sergeant

  • Members
  • 535 posts

  • Joined: 23-February 2009

Posted 20 May 2010 - 11:35 #4

Looks impressive!
Posted Image

Nicolai
Nicolai

    Sergeant

  • Members
  • 103 posts

  • Joined: 21-December 2009

Posted 20 May 2010 - 13:58 #5

this is really cool!

thanks for your hard work!
Work in Progress

Andersson-SWEC-
Andersson-SWEC-

    Master Gunnery Sergeant

  • Members
  • 1300 posts

  • Joined: 25-June 2004

Posted 20 May 2010 - 14:07 #6

Yupp verry cool...
One drop down only..The soundloop is HORRIBLE..
You can do better then that..I know you can..

dimitri_harkov
dimitri_harkov

    Master Sergeant

  • Members
  • 799 posts

  • Joined: 03-July 2009

Posted 20 May 2010 - 14:10 #7

Great!

One just has to love the modding possibilities of ArmA2! Thanks BIS & Loyalguard!

Cheers,
D.
Posted Image

wolfbite
wolfbite

    Sergeant Major

  • Members
  • 1611 posts

  • Joined: 03-November 2005

Posted 20 May 2010 - 14:15 #8

This is actually a brilliant idea... Good luck man..

sickboy
sickboy

    Colonel

  • Members
  • 9947 posts

  • Joined: 11-May 2005

Posted 20 May 2010 - 14:33 #9

Very nice to see this 'out there', congrats!

TRexian
TRexian

    Master Gunnery Sergeant

  • Members
  • 1227 posts

  • Joined: 07-June 2007

Posted 20 May 2010 - 14:59 #10

Great work LG! :) Will try it out (and give feedback). :) (When released.) ;)

Edited by TRexian, 20 May 2010 - 15:03.


Laqueesha
Laqueesha

    Warrant Officer

  • Members
  • 2367 posts

  • Joined: 04-March 2009

Posted 20 May 2010 - 17:42 #11

I can see it now. :D

ArmA 2: The Ultimate Infrastructure Simulator

Is it only going to effect streetlights? What about houses, office buildings, hotels, airports, shops/stores and such? (e.g. translucent textures)

Edited by Laqueesha, 20 May 2010 - 17:48.


Thread Starter
Loyalguard
Loyalguard

    Master Sergeant

  • Members
  • 658 posts

  • Joined: 26-June 2007

Posted 20 May 2010 - 18:12 #12

Thanks for the news link Nembo and thanks to everyone for the positive comments!

@Andersson

One drop down only..The soundloop is HORRIBLE..
You can do better then that..I know you can..


Ah, yes...the sound loop. This has been a thorn in my side since A1/SEG. This is an area where I would love some help...I will post in an editing sub-forum all the details, but in short, the problem is that there is an approximate .10 second delay between one loop iteration and the next one despite all my efforts to prevent it. I think it just must be the time the engine needs to stop one and start the other. It used to me longer when I used an .ogg file but is better now that it is a .wss. This pause is not really noticeable with birds chirping or crickets because there are natural pauses...but for a near monotone hum it is very noticeable.

So, right now it plays for 2 secs, pauses for .1 sec., plays for 2 secs, pauses .1 sec....

Here is an example (not to scale and not the actual waveform of the sound I am using). Top is how it should look, bottom is in-game playback:

Posted Image

I would use a longer loop to make the pause sound less "rythmic", but if I were to use say a 10 second loop, if I cut the power off after 5 secs of a loop iteration, the sound still plays for another 5 seconds which is even more awkward than how it sounds now. The only way I have found to interrupt the sound when power is cut off is to deleteVehicle the logic that is the sound source (but right now I need that logic for other things).

So, that is the quick overview, I will post more in another thread in the scripting forum as to avoid too many technical details here...in the meantime if anyone has any advice my ears are open!

@Laqueesha - I am looking at houselights that are part of ALICE...and I have always looked at othe lights sources as well (towers, lighthouses, airports, traffic lights). ALICE houselights is doable, but doing so whithout breaking other ALICE is a little harder and needs more time. The other light sources would require a lot of other modding that is on the table, but not in the short term. I have always explained them away in SEG and (in CEG) as backed up by generators or other emergency power sources (and candles in the window ;). I am pursuing these further after general release.
LoyalGuard
Former OFPEC Editors Staff Member | Former ACE1 Dev Team Member
My ArmA Projects
"...brain-hurting expressions of realism like Loyalguard’s functioning Chernarus Electrical Grid." -PC Gamer

TRexian
TRexian

    Master Gunnery Sergeant

  • Members
  • 1227 posts

  • Joined: 07-June 2007

Posted 20 May 2010 - 18:53 #13

Hey LG,

On the sound issue, did you try a shorter loop? Like a 1 second wave (or less), but faster? It sounds odd, but sometimes the ear will "translate" something like that as a single sound, even if there is a brief pause.

Or, 2 sounds, played somewhat out of sync with each other?

Just a couple ideas. :)

cctoide
cctoide

    Corporal

  • Members
  • 76 posts

  • Joined: 16-April 2007

Posted 20 May 2010 - 19:17 #14

I haven't done much with playing sounds from scripts, but couldn't the sound-playing loop use spawn{} to play the sound instead of playing the sound itself, so that one spawn{} process starts as the other is ending? You could edit the sound file so it fades in and out, so if they overlap it's not as noticeable.

First thought that comes to mind is the 3ms rule interfering with the script, but I'm not sure what part of it is taking that long to run. Maybe other scripts are getting scheduled in between iterations?

Regardless, this seems like an awesome addon. I love really technical addons, and the amount of thought put into this is nice. I'd consider lowering the volume on the substation humming, though. Could be annoying if you have to be near it for a while.

Thread Starter
Loyalguard
Loyalguard

    Master Sergeant

  • Members
  • 658 posts

  • Joined: 26-June 2007

Posted 20 May 2010 - 20:50 #15

@TRex - I have experimented with loops as short as .1 secs (the same duration as the delay) and actually even smaller (to see if I could actually create a 100hz sound by literally playing a new sound every .01 secs !) but I didn't think of increasing the speed. I will definitely look at that. On the two sounds suggestion (or "dueling hums" as I like to call it ;) ), I had looked at that and Myke suggested it as well and I might be able to make that work. It does involve a second logic as a sound source for each transformer since a logic can only "say" one sound at a time. Thanks for the suggestions! :)

@cctoide - I did try spawn to start a new instance of the sound earlier in development, but, the problem is that since the sound used the same source (logic) there was still a delay even if I timed the new instance to start at the same hundreth of a second the old one stopped. But as discussed above, using it with a second source might work. Regarding fading in and out, that is what I did in the A1 version of the sim, SEG. Using it, you have no idea there is an actual delay as it seems "natural". Unfortunately, compared to the hum coming from an actual substation transformer, it does not sound realistic (not that a .1 sec delay does either!) Thanks for the suggestion and I will re-explore. Regarding the volume, I will look at that as well. I have set the DB level so that you can hear the hum up to 100m away (assuming there are no other audio distractions). I will look into this further to see what is the best fit for realism and gameplay. I do have to say when you are at substations like Elektro (the opening scene of the demo video), the three transformers all going at the same time can be annoying! Thanks again! :)
LoyalGuard
Former OFPEC Editors Staff Member | Former ACE1 Dev Team Member
My ArmA Projects
"...brain-hurting expressions of realism like Loyalguard’s functioning Chernarus Electrical Grid." -PC Gamer

Kroky
Kroky

    Master Gunnery Sergeant

  • Members
  • 1240 posts

  • Joined: 23-January 2003

Posted 20 May 2010 - 20:55 #16

Im looking forward to the addon version, to add this feature to Chernarus by default.

binkowski
binkowski

    cranky old vet

  • Members
  • 3441 posts

  • Joined: 16-May 2007

Posted 20 May 2010 - 21:49 #17

The Sahrani electrical grid script / addon was awesome. Can't wait to see this!

dmarkwick
dmarkwick

    Major

  • Members
  • 7298 posts

  • Joined: 19-March 2006

Posted 21 May 2010 - 17:38 #18

The concept is great :) looking forward to seeing it in action.

RE the sound loop - I had some amount of minor success by fading the sound in & out and overlapping slightly. It doesn't entirely solve the problem just changes it, but maybe the new problem will sound slightly more acceptable then the old problem :)
Feel like ArmA is letting you down in some way? Watch this:
https://www.youtube....h?v=Fh3webkCo4Y

Thread Starter
Loyalguard
Loyalguard

    Master Sergeant

  • Members
  • 658 posts

  • Joined: 26-June 2007

Posted 25 May 2010 - 06:23 #19

I've made some good progress on improving the sound loop. The loop is now a 15 second sample of a consistent hum with minor environmental variations. The .1 sec pause is still there, but there is some distortion that precedes it (sampled from rapidly vibrating insulators) so the gap now sounds more "natural". There is also instant stoppage of the sound when power is turned off . I have also reduced the overall volume. I went to a local substation this weekend to see how far away you can hear the hum. It is now set to 25-50m which is more realistic. Below link is to a video with the new loop, instant stoppage, and output volume. Please excuse video quality. I have all settings on low to make development easier.

02LBu_lxnyo

Thanks to everyone for your suggestions...I used a combo of things to get the effect. I added a new logic that only plays the hum and has no other function. When power is cut, I delete the logic which instantly stops the sound. This allows for a longer loop. When power is restored I add the logic back again and replay the sound. For the sound of the breaker closing and the hum starting again, I have the original logic play/say that sound so they overlap.

Edited by Loyalguard, 25 May 2010 - 06:25.

LoyalGuard
Former OFPEC Editors Staff Member | Former ACE1 Dev Team Member
My ArmA Projects
"...brain-hurting expressions of realism like Loyalguard’s functioning Chernarus Electrical Grid." -PC Gamer

TRexian
TRexian

    Master Gunnery Sergeant

  • Members
  • 1227 posts

  • Joined: 07-June 2007

Posted 25 May 2010 - 13:23 #20

Awesomosity!

So... it's going to be released soon? ;)

Oh... and maybe have the hum "wind down" when the circuit is tripped. (Maybe you already do this, but my speakers are messed up on this PC all of a sudden.)