PREFAB: Mann Vs Machine Buildables

Discussion in 'Tutorials & Resources' started by LeSwordfish, Aug 7, 2013.

  1. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,109
    Positive Ratings:
    6,058
    Mann the Barricades!
    Mann Vs Machine Buildables

    [​IMG]

    These hologram whatsits turn into real things if you punch them hard enough. Use them to fight robots better. As we speak I am wrestling a leopard.
    -Mann Co. CEO Saxton Hale, entirety of Holographic Defence Assets press release.

    So those of you who haven't yet blocked me in chat will probably know that this is what i've been working on over the past week or so: buildable props for mvm. You put these in your map, and players can then choose which ones they want to construct. There's a whole bunch of uses for them: make new routes for players, add cover, add deathpits, etc etc etc. Bot navigation around them is a little funky, so i wouldn't try and block off whole routes as of yet.

    How it works for players
    In between waves, holographic props appear (think of Bioshock Infinite's "Tears"), along with instructions for their use. Attack the props to spend "build points" on them- when you have purchased a hologram it turns into a full prop. Wrenches next to props mark their cost, with props with a greater gameplay effect costing more. Like spending cash, if you pass the wave your choices are consolidated, if you fail you get to choose again.

    You earn build points however the mapper wants you to. It should be at least a few per wave, though, and I would suggest giving out more for performing certain feats (killing a tank in ten seconds, airblasting three bots to death in one wave, whatever.

    How it works, logic-wise
    The whole thing is too complex to go into here- further details are given in the vmf. For now, suffice to say that the hologram is a prop_dynamic, math_counters are used to track points earned and spent, game_texts display information on screen (game_text_tf is prettier but only appears outside minmode HUD) and lots of logic_relays enable and disable each other so that the objects appear and dissapear as needed. A trigger_multiple is also used, touchtesting itself to prevent players getting stuck as the holograms reenable.

    How to use it, as a mapper
    Instructions can be found in the readme HERE and included in the download.

    To use, extract to your prefabs folder in (yoursteamname)\common\Team Fortress 2\Bin\Prefabs

    Notes
    • This is version one: there's a lot more to come. The sky, and the ability of entities to be disabled/enabled is the limit. I also have only tested this on my own- there may be all sorts of netcode or multiple-user oddities i haven't thought of.
    • The maximum number of build points a team can have is 15. If you want to increase this, you can set up the logic_case and the dozens of game_texts yourself, frankly.
    • Anything else that you want to happen when props are purchased should be put in the build_create entity. Remember to disable/undo it in the build_wavefailed or it won't reset if a wave is failed.
    • For gods sake, use in moderation. This is a bloated system (especially if you use the glows: glows are cool but i can't recommend them) and mvm is a bloated system. This system is as efficient as i can make it, but it's going to be heavy on your entity count.
    • Unless something is broken, version 3 will augument version 2 with sample maps.

    Changelog:
    08/08/2013: version 1:
    ---Sentry, dispenser, general prop, item, glow, and common prefabs available. First release.

    17/08/2013: version 2:
    ---Small bug fixes.
    ---Replacing wrenches with sprites for usability.
    ---To update to this version you will need to replace any buildable prefabs, but not the "common" prefab.

    26/09/2013: version 2.1: (CURRENT):
    ---Added "breaking prop", "spell" and "pumpkin bomb" prefabs.
    ---Adjusted the "Common" prefab for easier setup.
    ---Rewrote the readme for easier use.
    ---To update to this version you need not replace anything. If you have already setup the "Common" prefab the changes will be irrelevant.

    Download

    Talk amongst yourself about all the cool things you will be able to do with this. Also, what other dynamic special buildables would you want? Remember, the less they mess with the pathing of the bots, the better, but otherwise more or less anything goes.
     
    • Thanks Thanks x 8
    • Like Like x 1
    Last edited: Dec 30, 2013
  2. RaVaGe

    aa RaVaGe

    Messages:
    728
    Positive Ratings:
    1,053
  3. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,109
    Positive Ratings:
    6,058
    https://dl.dropboxusercontent.com/u/13673854/MVM buildables.zip

    First buildables available! Includes Sentry, Dispenser, general prop, ammo pickup, plus the common entities and a prefab allowing you to make the holograms get a payload-like glow if you want.

    Sentries and dispensers have triple the health, giving them roughly 600hp, but if they are destroyed they don't respawn until the end of the wave. They also have infinite ammo. I welcome suggestions as to how else this could be done: note that bots attack the buildings, so having invulnerable buildings seems a tad unfair on the bots.
     
  4. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,849
    Positive Ratings:
    4,845
    This is extremely impressive. I've also toyed with this idea but didn't think it possible. Amazing work, Swordy.
     
    • Thanks Thanks x 1
  5. Fr0Z3nR

    aa Fr0Z3nR Creator of blackholes & memes. Destroyer of forums

    Messages:
    6,391
    Positive Ratings:
    4,906
    Buildable walls could be interesting, but I don't think that'd work with the nav mesh. Or would have to be built directly into the map.
     
    • Thanks Thanks x 1
  6. Turbo Lover

    aa Turbo Lover Fight me under Glasgow Central Station

    Messages:
    333
    Positive Ratings:
    317
    Place a func_nav_avoid around your buildable wall, have it start disabled and enable it when it's bought and your pathing should be fine. As always, make sure it covers the entire nav area.
     
    • Thanks Thanks x 3
  7. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,109
    Positive Ratings:
    6,058
    A func_nav_block is included since i thought that was better: i'm happy to defer to turbo's wisdom here. If you want to block a whole route, make sure you unblock at least one other.

    Can an admin remove the "coming soon" from this thread name?
     
  8. Prestige

    aa Prestige im not gay anymore

    Messages:
    1,774
    Positive Ratings:
    1,530
    someone gonna have to combine this w/ donuts turrets tho it might not actually be fun at all
     
    • Thanks Thanks x 1
  9. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,109
    Positive Ratings:
    6,058
    That might be interesting but i'm not sure what it would add, really. You- you can shoot robots under your own initiative, you know? Also, the more complex a thing is, the more complex it is to attach into the system, almost exponentially. (what happens if you disable an in-use game_ui? if you disable a brush that names and unnames players, do they remain named? Unless i think the result will be worth it i'm not really interested in this much work)
     
    Last edited: Aug 10, 2013
  10. DonutVikingChap

    DonutVikingChap L5: Dapper Member

    Messages:
    228
    Positive Ratings:
    142
    I could probably let you use my turrets for this, I think what makes them interesting is that you can change them to shoot different things than just bullets, like my rocket turret prototype. Also, since all the turrets use trigger_hurts for the damage, no points get awarded to the player directly but you can probably count the kills somehow to implement some kind of system that gives the players additional build points or something like that. :D
     
    • Thanks Thanks x 1
  11. Penguin

    aa Penguin Clinically Diagnosed with Small Mapper's Syndrome

    Messages:
    1,992
    Positive Ratings:
    1,233
    incredible
     
    • Thanks Thanks x 1
  12. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,219
    Valve needs to see this. The idea that you can add a feature like this to MvM without even a SourceMod plugin is amazing. The only thing that sucks about it is the limitations of the skin; that ghost/hologram shader I mentioned a while back would work excellently here.
     
    • Thanks Thanks x 1
  13. Penguin

    aa Penguin Clinically Diagnosed with Small Mapper's Syndrome

    Messages:
    1,992
    Positive Ratings:
    1,233
    if i may make a suggestion: illustrate the point cost with an env_sprite above the actual object, using the number textures traditionally used for overlays.

    it's more intuitive.
     
    • Thanks Thanks x 2
  14. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,109
    Positive Ratings:
    6,058
    That would be better, yeah. I just didn't want to find out how to do that.

    I shall, at some point.
     
  15. Penguin

    aa Penguin Clinically Diagnosed with Small Mapper's Syndrome

    Messages:
    1,992
    Positive Ratings:
    1,233
    you literally just use env_sprite and set the material to the overlay texture
     
  16. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,109
    Positive Ratings:
    6,058
  17. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,109
    Positive Ratings:
    6,058
    hahah no it isn't

    I have to rewrite a whole bunch of the logic, so expect this on the weekend maybe.
     
  18. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,109
    Positive Ratings:
    6,058
    Version 2

    Here we go! Version 2 includes some fixes, and replaces the wrenches with sprites.

    Unless something is broken, expect Version 3 to augument Version 2 with new buildables.
     
    • Thanks Thanks x 1
  19. RaVaGe

    aa RaVaGe

    Messages:
    728
    Positive Ratings:
    1,053
    That's really cool, I have too much projects now but this prefab is all I need for the gamemode I wanted to do before.

    GNNNNNNN, I will try to do a MVM map with that, fuck it.
     
  20. RaVaGe

    aa RaVaGe

    Messages:
    728
    Positive Ratings:
    1,053
    Also I see something like that for the walls, before you have a blueprint in front of the wall with the hologram of the wall.

    [​IMG]

    And then when you build it.

    [​IMG]

    I didn't implemented the point system, but idk how to make the wall in func_breakable and be able to enable it after you hit your blueprint... That's just an idea I wanted to share :p

    EDIT : Now you can break it but I have no idea how to toggle it to non-solid before it's build.

    EDIT2 : Now it works.
     
    Last edited: Aug 17, 2013