1. Post #1
    Arania's Avatar
    November 2007
    57 Posts
    Arania’s Contraption Damage Engine

    This has been my pet project for the better part of a year, and I believe it may finally be time that I show of the fruits of a near 12 months worth of poking Gmod with a very sharp stick

    What is it?
    The Contraption Damage Engine (CDE or CoDE) is my solution to what I considered to be a critical flaw in currently-available damage engines: You build contraptions in Garry’s Mod, from large spaceships to small automated drones, and yet both CDS and GCombat use weapons that apply damage on a per-entity basis.

    CDE does the exact opposite: damage from weapons is applied to an entire contraption, and it is only destroyed once its cumulative health reaches zero, allowing for more extended firefights which can last for minutes at a time, instead of mere seconds. Larger contraptions tend towards being more durable, instead of the existing model of only being as strong as their weakest part.

    Primarily, CDE is designed to be as simple and streamlined as possible for players, allowing them to focus on contraption building and combat rather than fiddly combat mechanics, while providing maximum functionality to developers through a modular design allowing them to easily make their own weapons and damage types, or even tie the addon into a gamemode!






    Features
    [LIST][*]Damage applied to entire contraption, rather than individual components (can be toggled off for a more Gcombat-like feel)[*]Destroying a contraption will leave wreckage, which then fades out over time (Wreckage settings can be modified via convar)[*]Cinematic death explosions that can take more than 5 minutes to complete for large contraptions, such as space stations (Can be toggled off for a more fast-paced combat style)[*]Shielding that covers an entire contraption, along with more conventional spherical shields that cover an area[*]Shield spheres overlap properly, producing the impression of a large shield ‘blister’ instead of a bundle of disparate bubbles[*]Modular damage system allows custom entity and damage types to be added easily (such as anti-missile or anti-shield damage types, for example)[*]Works with Gcombat, CDS, and PewPew Weapons[/LIST]Media
    Pics:

    Before, During and After shots of a Wi-Fi hotspot getting destroyed-


    Shield Dome Exterior Shots-


    Overlapping Shields, Interior and Exterior Shots-


    Contraption-Conforming Shields on an SBMP Ship. Unshielded and Shielded Shots-


    'Leviathan' Missile Submarine, used in beta testing-


    Videos:

    View YouTUBE video


    http://youtube.com/watch?v=Cn40gM4lOyM



    View YouTUBE video


    http://youtube.com/watch?v=EX6hZcjn07s



    A Note before you ask: these videos are from two seperate earlier versions, and DO contain a few bugs which have since been fixed. Some visual effects have also been changed.
    Also: In the second video, the missiles seemingly coming from nowhere out of the water are being fired from a submerged Leviathan Submarine, pictured above

    Where can i get it?
    For SVN Users: http://contraptiondamageengine.googl...com/svn/trunk/
    For Non-SVN Users: http://code.google.com/p/contraption...downloads/list

    Before Posting Bugs:
    Please be sure to read the included Readme File, as the problem you are encountering may be detailed there (along with its fix)

    If there is not a fix in the readme, please be sure to include as much detail as possible in your post. Factors such as which version of CDE you are using (SVN or ZIP), What other addons you have installed, and even your game settings and computer specifications can help in finding the problem. Simply posting 'Item x doesn't work!' tells me nothing.



    Questions are very welcome
    Reply With Quote Edit / Delete Reply Australia Show Events Useful x 45Artistic x 12Dumb x 6Optimistic x 3Friendly x 3Agree x 2Lua Helper x 1Lua King x 1 (list)

  2. Post #2
    Pass along
    commander204's Avatar
    May 2008
    4,065 Posts
    Nice.
    Reply With Quote Edit / Delete Reply France Show Events Agree Agree x 9Friendly Friendly x 1Lua Helper Lua Helper x 1 (list)

  3. Post #3
    Gold Member
    Kogitsune's Avatar
    September 2005
    2,744 Posts
    I like the idea, it makes it more casual than alternatives, plus less annoying when the explosion ruins one part that cripples the whole contraption.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 15 (list)

  4. Post #4
    Gold Member
    Crazy Quebec's Avatar
    May 2008
    2,449 Posts
    I really like the concept. It would make it feel more like playing a videogame then playing a crappy simulation that your whole contraption is treated as a single entity.
    Reply With Quote Edit / Delete Reply Canada Show Events Agree Agree x 8 (list)

  5. Post #5
    HanBammer's Avatar
    May 2009
    88 Posts
    This looks like fun, good luck with it! Oh, will it have it's own guns like gcombat does? That would rock.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 3Disagree Disagree x 1 (list)

  6. Post #6
    Gold Member
    Datsun's Avatar
    January 2008
    1,830 Posts
    Sounds like a nice simple damage system. I hope it stays that way.

    Keep up the great work!
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 2 (list)

  7. Post #7
    Gold Member
    Nutnoze's Avatar
    April 2006
    1,236 Posts
    Feedback on the concept:

    I really like the idea of having the entire contraption taking damage rather than individual components (Because I too hate the whole "Sweet a perfect destroyer" *lose one part* *half ship's functions crippled*

    However, it also I believe could have a few improvements.
    For instance, instead of all the damage being absorbed into the contraption as a whole, have 95% of the damage be distributed among the contraption and the remaining 5% be applied only to the entity being shot. This way if you keep shooting a ship's left side, it will be destroyed before the others, but not before you do significant damage to the rest of the ship anyways.

    Also, for added coolness, once the ship has very little (5%ish) health left, constraints start to be undone (for added "Oh shit my ship is coming apart" factor)
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 43Funny Funny x 1 (list)

  8. Post #8
    Gold Member
    Datsun's Avatar
    January 2008
    1,830 Posts
    One question I have right now.

    How flexible is this in terms of damage? Will this be limited to only a certain amount of weapons or practically anything that can do damage? I would vote for the latter.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 4 (list)

  9. Post #9
    Gold Member
    Morcam's Avatar
    September 2008
    1,537 Posts
    -Snip-

    Looks Good
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 1 (list)

  10. Post #10
    Gold Member
    ZenX2's Avatar
    February 2009
    4,914 Posts
    i'm liking the shields.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 2 (list)

  11. Post #11
    Arania's Avatar
    November 2007
    57 Posts
    This looks like fun, good luck with it! Oh, will it have it's own guns like gcombat does? That would rock.
    It'll come with a small set of weapons to start with (about 5-6), but i will be adding more weapons over time once i get the engine core completed and stable. Until then, I will likely be including an engine option to make Gcombat and CDS weapons use CoDE's damage system (With a Convar toggle), so you won't be completely short of weapons to start with



    For instance, instead of all the damage being absorbed into the contraption as a whole, have 95% of the damage be distributed among the contraption and the remaining 5% be applied only to the entity being shot. This way if you keep shooting a ship's left side, it will be destroyed before the others, but not before you do significant damage to the rest of the ship anyways.

    Also, for added coolness, once the ship has very little (5%ish) health left, constraints start to be undone (for added "Oh shit my ship is coming apart" factor)

    I could include an option for that, but i would be fairly hesitant about having it on by default. The main problem is that small components (such as wire parts, hoverballs and thrusters, for instance) would have fairly small amounts of health, so if they got hit by a weapon that did a large amount of damage, even only taking a small percentage of the hit would likely still kill them outright, thus bringing back the problem of lucky/random hits shooting off a potentially critical piece of the contraption. I CAN see what you mean though. I'll see what i can do

    As for the ship coming apart at low health, i believe i have created a similar feel with an engine option that delays the final contraption death explosion for a few seconds, while setting off 'secondary' explosions at random points all over the contraption, similar to the death throes of the HL2 Helicopter and Gunship. It doesn't look particularly good on very small contraptions, but on aircraft and spacecraft it is quite pretty (especially on moderate-sized ships built using SBMP models. With that setting turned on it takes about 10 seconds for the ship to die after reaching zero health, with random secondaries popping off all over the ship)

    I DO like the idea of pieces getting blown off when the contraption is at low health, though. I'll see what i can do about adding that in as an option. Good idea!



    One question I have right now.

    How flexible is this in terms of damage? Will this be limited to only a certain amount of weapons or practically anything that can do damage? I would vote for the latter.
    What do you mean by flexibility? I'm not sure I follow you.
    Reply With Quote Edit / Delete Reply Australia Show Events Friendly Friendly x 1Informative Informative x 1 (list)

  12. Post #12
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    What do you mean by flexibility? I'm not sure I follow you.
    Does it work with all weapons automatically or do they need some special code to make them compatible?

  13. Post #13
    Gold Member
    imadaman's Avatar
    August 2008
    10,924 Posts
    Will/Does it support Resource Distribution 3?
    Reply With Quote Edit / Delete Reply Finland Show Events Dumb Dumb x 1 (list)

  14. Post #14
    Gold Member
    robowurmz's Avatar
    April 2007
    2,244 Posts
    Can you allow this to be independant of wiremod or resources if we so desire?
    It's be nice just to be able to make the weapons use normal numpad inputs and just use a tool to put them on. (Provided there are weapons, that is).

    I'm not saying that you should remove or go without wiremod entirely in this addon, I'm just saying it'd be nice to have a non-wiremod option for a change.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Disagree Disagree x 2Agree Agree x 1 (list)

  15. Post #15
    Gold Member
    pedroion's Avatar
    December 2007
    4,351 Posts
    Feedback on the concept (...)
    This would be really, really nice, almost perfect. I hope that you can implement it.

    @Project: Awesome. Looking forward for it.

  16. Post #16
    Gold Member
    Schmaaa's Avatar
    June 2009
    5,975 Posts
    Very awesome idea ya got there. All I can say is, make the explosions epic, not just trails of light gray smoke. Oh, and when a contraption is destroyed, have most of the contraption be deleted like in gcombat, but have the remaining parts fly off in different directions!

  17. Post #17
    Gold Member
    Datsun's Avatar
    January 2008
    1,830 Posts
    What do you mean by flexibility? I'm not sure I follow you.
    What I mean by flexibility is not being limited to just a small amount of weapons, waiting for some one to script more.


    I think it would be better to use weapons that have already been created, such as the Prop Cannon, Malawar Cannon, etc. This makes it so that extra options such as RD, Wire, etc, do not have to be directly specified by you but more or less the users who are going to use this addon.


    Would it be possible to use this other than Space? Say like making floating contraptions (boats) sink after a considerable amount of damage is taken. Just a suggestion.
    Reply With Quote Edit / Delete Reply United States Show Events Disagree Disagree x 3 (list)

  18. Post #18
    Gold Member
    Morcam's Avatar
    September 2008
    1,537 Posts
    Do the shields block all projectiles? (I.E. Those from default HL2 guns and SWEPS, as well as CDE rounds)

    And are those custom models for the shield gens?

  19. Post #19
    Kude's Avatar
    April 2008
    842 Posts
    Looks nice.
    At least, sounds better than GCombat so far..
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1 (list)

  20. Post #20
    Arania's Avatar
    November 2007
    57 Posts
    Will/Does it support Resource Distribution 3?
    Not as yet. Everything i've coded thus far that uses it uses RD2 as I was under the impression that RD3 is still pre-beta. Once RD3 gets closer to release, i will more than likely add support for it.


    I think it would be better to use weapons that have already been created, such as the Prop Cannon, Malawar Cannon, etc. This makes it so that extra options such as RD, Wire, etc, do not have to be directly specified by you but more or less the users who are going to use this addon.


    Would it be possible to use this other than Space? Say like making floating contraptions (boats) sink after a considerable amount of damage is taken. Just a suggestion.

    Guns made for Gcombat and CDS will work with CoDE, as the engine can optionally force those weapons to use CoDE's damage calls instead of the normal Gcombat/CDS call. (This can be turned on and off in-game through the console)

    And the engine can be used in non-space environments (naval combat, urban vehicular, etc. etc...) quite easily, it's not restricted to any one setting. Most boats will actually capsize and slowly sink after being destroyed


    Do the shields block all projectiles? (I.E. Those from default HL2 guns and SWEPS, as well as CDE rounds)

    And are those custom models for the shield gens?
    Not ALL projectiles. The projectiles need to have 2 lines of code added to them to make the shield recognise them (Specifically: a collision group assignment, and a 1-line callback function), along with using VPHYSICS movement. HL2 guns and SWEPs using the FireBullets() call will pass stright through, as will projectiles that 'move' by continually calling SetPos().

    In the pictures, there are two different models for the shield generator being used. In the first picture (the one on the ice cap) the shield is a small decorative prop from the SBMP pack. in the other three, the generator is a 1.75-size PHX sphere. The generator STool allows you to select a custom model, if you want one, by right-clicking on a prop to use its model. Practically, you can use whatever model you want for the generator
    Reply With Quote Edit / Delete Reply Australia Show Events Optimistic Optimistic x 1Friendly Friendly x 1Useful Useful x 1 (list)

  21. Post #21
    Gold Member
    Smoot's Avatar
    December 2006
    2,500 Posts
    Looks nice, keep it up :)
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 2Dumb Dumb x 1 (list)

  22. Post #22
    Gold Member
    Sodisna's Avatar
    May 2007
    2,908 Posts
    I'm liking the shields.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 9 (list)

  23. Post #23
    Gold Member
    Datsun's Avatar
    January 2008
    1,830 Posts
    How long until a beta release is scheduled?

    I would like to see this in action. Have any current videos?
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1 (list)

  24. Post #24
    fishface60's Avatar
    May 2007
    430 Posts
    I'm getting a strong Supreme Commander vibe from this addon.
    How about a personal shield generator which just protects entities it's constrained to instead of in a bubble around itself. If possible a shield effect would improve the appearance, such as a refractive outline on the entities.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Funny Funny x 1Agree Agree x 1 (list)

  25. Post #25
    Pilotclan9404's Avatar
    January 2009
    813 Posts
    i really like the concept. It would make it feel more like playing a videogame then playing a crappy simulation that your whole contraption is treated as a single entity.
    holy crap op wow nice job cannot wait.

  26. Post #26
    Arania's Avatar
    November 2007
    57 Posts
    How long until a beta release is scheduled?

    I would like to see this in action. Have any current videos?
    I should have a good demonstration video ready by the end of next week, and i'm hoping to have a version ready for beta release shortly after that, I still have some minor bugs to sort out.


    I'm getting a strong Supreme Commander vibe from this addon.
    How about a personal shield generator which just protects entities it's constrained to instead of in a bubble around itself. If possible a shield effect would improve the appearance, such as a refractive outline on the entities.
    Yea... Supreme Commander was the main inspiration for making the shield bubbles like that.
    There IS also a personal shield exactly like you described already coded (i completely forgot to put up photos for it). It still needs some minor work on the visuals though, they're a bit erratic at the moment.

  27. Post #27
    cleversheep's Avatar
    July 2008
    52 Posts
    I take it that the shields come down before any damage is done to the entities? So that you can keep it going longer with better shields?

  28. Post #28
    Gold Member
    Xion21's Avatar
    May 2007
    1,150 Posts
    This is very nice! Did you have any plans to further expand with different types of damage? Say a weapon fires normal bullets, they should do kinetic or ballistic type damage. A missile (depending on the warhead) could do different types. A rail gun (if implemented) could do some sort of energy damage and kinetic. Energy damage like ionic, plasmatic, and so forth.
    Reply With Quote Edit / Delete Reply United States Show Events Bad Reading Bad Reading x 1Funny Funny x 1Useful Useful x 1 (list)

  29. Post #29
    King Kambroo's Avatar
    October 2007
    25 Posts
    Words cannot express how much I'm looking forward to this.

    I can't ever remember having this much anticipation for an addon.
    Reply With Quote Edit / Delete Reply Australia Show Events Agree Agree x 4 (list)

  30. Post #30
    kccool2's Avatar
    August 2006
    79 Posts
    I have to say, the shields are very sexy. The sheer size is awesome! :) Keep this up, I'd really like to see this complete. =D

  31. Post #31
    Zedger's Avatar
    June 2009
    63 Posts
    Can't wait for release :)
    Reply With Quote Edit / Delete Reply Hungary Show Events Agree Agree x 2 (list)

  32. Post #32
    Gold Member
    Doctor_Communism's Avatar
    June 2009
    2,141 Posts
    Can it be configured so that some parts will fall off but others are part of the larger health pool?

  33. Post #33

    September 2009
    3 Posts
    What is CDS?
    Reply With Quote Edit / Delete Reply Australia Show Events Funny Funny x 1 (list)

  34. Post #34
    Gold Member
    Datsun's Avatar
    January 2008
    1,830 Posts
    What is CDS?
    CDS stands for Custom Damage System. It was popular back in the days where SB reigned high in most popular GMs but quickly died after awhile.

    I have no idea what current status it is in though. Either way just wait for this one to be released.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1 (list)

  35. Post #35
    TheLolrus's Avatar
    June 2008
    3,320 Posts
    CDS is still in a very early development stage. I'd say, though, that CDS 3 doesn't look nearly as good as this. Contraption damage? Epic. That shield fitted to the ship? The most epic thing I've seen all month! It will be a happy day when any build of this is released!
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 3 (list)

  36. Post #36
    Dr Smashy's Avatar
    September 2007
    1,084 Posts
    Damn man this is sexy.

    Looking forward to this.
    Reply With Quote Edit / Delete Reply Canada Show Events Agree Agree x 2 (list)

  37. Post #37
    Arania's Avatar
    November 2007
    57 Posts
    I take it that the shields come down before any damage is done to the entities? So that you can keep it going longer with better shields?
    Yes. A shield has to be completely depleted before any damage can be done to the entities it protects


    This is very nice! Did you have any plans to further expand with different types of damage? Say a weapon fires normal bullets, they should do kinetic or ballistic type damage. A missile (depending on the warhead) could do different types. A rail gun (if implemented) could do some sort of energy damage and kinetic. Energy damage like ionic, plasmatic, and so forth.
    I have some plans for different damage types, yes. The beta release will only have 3 or so for each weapon, but i do have plans to add more in a subsequent release. I'm still working out the specifics for it.
    Reply With Quote Edit / Delete Reply Australia Show Events Friendly Friendly x 3 (list)

  38. Post #38
    fishface60's Avatar
    May 2007
    430 Posts
    Yes. A shield has to be completely depleted before any damage can be done to the entities it protects
    Say a shield has 50 points and a weapon does 100 points of damage, do the remaining 50 points of damage get through to the contraption?
    If not then the regeneration rate would have to be wide enough that people could get hits through the shield. Or have a down-time after depletion when hits can get through.
    I have some plans for different damage types, yes. The beta release will only have 3 or so for each weapon, but i do have plans to add more in a subsequent release. I'm still working out the specifics for it.
    Kinetic, Energy and Plasma?

    Edited:
    Just saw the Contraption Conforming shield, looks pretty nifty even though there are some unusual effects from closer entities being drawn over the shields of further away entities.
    I'm interested in how you achieved it as I was previously thinking of making a shield generator like that.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Disagree Disagree x 1 (list)

  39. Post #39
    Gold Member
    Morcam's Avatar
    September 2008
    1,537 Posts
    Say a shield has 50 points and a weapon does 100 points of damage, do the remaining 50 points of damage get through to the contraption?
    If not then the regeneration rate would have to be wide enough that people could get hits through the shield. Or have a down-time after depletion when hits can get through.

    Kinetic, Energy and Plasma?

    Edited:
    Just saw the Contraption Conforming shield, looks pretty nifty even though there are some unusual effects from closer entities being drawn over the shields of further away entities.
    I'm interested in how you achieved it as I was previously thinking of making a shield generator like that.
    The new shields look great.

    And if I had to hazard a guess, it looks like he just duplicated the prop and increased its scale/added a new material. Although he probably used renderx for merging it all into one seamless figure (which is badass).

    I'd also be interested in knowing the default damage types.
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 1 (list)

  40. Post #40
    Dr Smashy's Avatar
    September 2007
    1,084 Posts
    How is the health of a contraption determined?

    Is it number of props, weight, size, or some combination of them?