Obsidian Conflict Mapping Guide and Prefabs [new]

Need Help? The Day isnt going so well on the Mapping front?
User avatar
Tysn
Former Developer
Former Developer
Posts: 358
Joined: Thu Oct 26, 2006 1:57 am
Location: Minnesota, USA
Contact:

Obsidian Conflict Mapping Guide and Prefabs [new]

Post by Tysn »

In this guide I am going to explain the entities and co-op set pieces used in Obsidian Conflict. Throughout the guide I will explain how to implement these things, as well as provide prefabs which you can use in your maps. I have mapped for many mods, and making cooperative maps is by far the most time consuming as rather than just working on layout and detail as in most mods, you need to use all of the entities and design techniques in hl2 for the npc combat and puzzles. Hopefully by providing these resources here it will give greater familiarity with mapping for OC, as well as speed up some of the more redundant parts of co-op mapping.

(Note that is guide is hammer-oriented, scripting tutorials and examples can be found in other places as well as in the obsidian conflict files)

Merchants

Image

By far merchants are the OC feature that people have the most questions about. Merchants in OC are handled in two ways: The merchant NPC, and logic_merchant_relay. Commonly used in addition is point_message_multiplayer for price tags.

npc_merchant
Important Keyvalues:
Merchant Script name - Name of the merchant script to use, located in the scripts/merchants directory
Merchant Icon material - The icon floating above the merchant's head
Icon Height - Height of the icon, important for merchants in sitting or laying down positions

The merchant npc is similar to the npc_civilian, however it does not move on it's own. It accepts a merchant script which you can find examples of in the scripts/merchants directory. The merchant cannot be harmed by the player and will be attacked by enemy npcs, however will not be harmed.

logic_merchant_relay

Important Keyvalues:
Purchase Sound - The sound played on a successful purchase. Normally used is ambient/levels/labs/coinslot1.wav
Cost of Purchase - The number of points needed to buy
Name of Purchase - The name displayed on the text that is shown when attempting to purchase

This entity is used for implementing purchasing function for in-level objects and systems, rather than strictly weapons and items. You can use any sort of trigger or button to send it the "Purchase" input, which will test the player's points to see if they have enough, and if so, subtract those points and fire the output "OnPurchased". The output can then be used for a wide variety of things, such as enabling motion on a prop, spawning an item, or opening a door. You will find examples for these things in the example map provided.

point_message_multiplayer
Important Keyvalues:
Entity Message - The message displayed. Starts at the center of the entity writes outward, so position accordingly
Show message radius - The radius in which players inside can see the message. Set to a resonable value so the text doesn't annoy players
Color (R G B ) - The color of the text

Intended for use as a price tag, this entity is a version of point_message which functions properly online. It can also be used for things such as npc text-based dialog and describing something in the map works.

Merchant Example Map: http://raegquit.com/Tysn/Tutorials/pref ... chants.rar
This prefab is intended to be reverse-engineered, rather than placed directly into maps
In this prefab you'll find examples of npc_merchants with scripted_sequence animations, prop_physics purchasing, and a vending machine system using a point_template.


Cash Pickups

Image

Useful in conjunction with merchants in map, these cash objects can be used to reward players points in a way without fighting npcs. This is done using a template containing prop_dynamics_overrides for the visible cash, an ambient_generic for the pickup sound, a game_score to give points, and a trigger_once to fire all of these entities and then removed them when finished.

Cash Pickups Example Map: http://raegquit.com/Tysn/Tutorials/pref ... e_cash.rar
This map is both a prefab and example, it will demonstrate and parts can be copied directly into your map
This particular prefab spawns cash piles which give 15 points when picked up. To use this prefab, simply copy the group of entities used in the point_template, and then place a copy of the env_entity_maker's named "Cash_15_Spawns". The logic_auto will then spawn instances of the cash at the start of the map.


Countdown Timer

Image

This entity can be used to display, label, pause, and stop a countdown timer in you map. It is great for what valve calls "crescendo" moments like in left4dead, where players must fight off a wave of enemies for a certain amount of time. It is important to note that this entity is purely graphical, it does not fire any outputs when finished, you must instead use the hammer I/O "After a delay in seconds of" to fire outputs that corrispond to your timer.

game_countdown_timer
Important Inputs:
StartTimer - Creates and starts the timer, with the additional parameter being the number of seconds it is to run.
SetTimerLabel - Sets the label of the timer
PauseTimer - Pauses the timer. Be warned that your I/O delays to work with the timer must accomidate it being paused if you use this
ResumeTimer - Resumes a paused timer
StopTimer - Stops the timer. Does not need to be used to remove a finished timer, as the timer will stop and remove itself after finished.

Countdown Timer Example Map: http://raegquit.com/Tysn/Tutorials/pref ... _timer.rar
This prefab is intended to be reverse-engineered, rather than placed directly into maps
In this example you will find a countdown timer ran by two trigger pads. One will start the timer, and one will stop it. The timer counts down until a wood crate explodes.


Scripted Weapons

Image

Here I will describe some info on using scripted weapons in your maps, for actually creating scripted weapons refer to the examples in your scripts\customweapons directory. Custom weapons can be used by both players and NPCS, however require special additions to the weaponmodels to work with NPCS. Currently in OC there are two main scripted weapons that can be used without any special mounts: the OICW and SPAS12. Only the OICW works with NPCs.

weapon_scripted
Important Keyvalues:
Custom Script - A weapon scripted located in the scripts\customweapons directory

Scripted Weapons Example Map: http://raegquit.com/Tysn/Tutorials/pref ... eapons.rar
This prefab is intended to be reverse-engineered, rather than placed directly into maps
This is an extremely simple prefab, containing both the OICW and SPAS12. In the background is also a npc_civilian firing an OICW at a watermelon.


Waypoints

Image
Waypoints in Obsidian Conflict are very useful for relaying the location and distance of things to players. They have a wide variety of applications and can be customized greatly.

info_waypoint
Important Kevalues:
Image - The material displayed by the waypoint.
Text - The text displayed under the waypoint.

Important Inputs:
Enable - Enables the waypoint for all players for a the number of seconds in the additional parameter. For permanent display until disabled, put "0" in the parameters
EnableForActivator - Same as enable, but only for the !Activator of the input targeting the info_waypoint
Disable - Disables the waypoint for all players
DisableForActivator - Disables the waypoint for the !Activator

Waypoints Example Map: http://raegquit.com/Tysn/Tutorials/pref ... points.rar
This prefab is intended to be reverse-engineered, rather than placed directly into maps
Included with this prefab are a bunch of new waypoints for OC, which although you can use now they will be included with the next version of the mod. In the map you will have a trigger pad which will activate many different waypoints, some static, another parented to a gascan, and another that will only last for 10 seconds before disappearing.


Objectives

Image

Objectives can be relayed to players in many different ways, but with this prefab you will be given an easy way to do it. Objectives are usually handled by using game_text_quicks and perhaps a sound to be played alongside their display. You could also use waypoints to give more information about the objective.

game_text_quick
Important Inputs:
DisplayText - Displays the text through the game_text_quick using the text in the parameter override.

The game_text_quick is identical to the game_text, except that it has the DisplayText input which means it a single entity can send many different messages, rather than being tied to one for it's "message" keyvalue. It is important to note that there is no way to place newlines in a single line of text, so you must use separate game_text_quicks to send text with multiple lines at the same time.

Objectives Prefab Map: http://raegquit.com/Tysn/Tutorials/pref ... ctives.rar
This is a fully-functional prefab, it can be placed directly in your map and modified to fit your needs
In this prefab you will find all of the game_text_quicks calibrated for objectives in paragraph format, as well as a set of logic_relays that can be modified to send appropriate objecive text. Copy and paste the entire room into your map, edit the output text in the six logic_relays, and then target the relays in your map to send the objectives.


Advancing Spawns

Image

Moving spawns forward is very important in linear walkthrough maps, since players don't want to walk long distances back to the front line. This prefab can be used to add advancing spawns to your map easily.

Advancing Spawns Prefab Map: http://raegquit.com/Tysn/Tutorials/pref ... spawns.rar
This is a fully-functional prefab, it can be placed directly in your map and modified to fit your needs
In this prefab, you will find blocks of numbered groups of player spawns separated by skip brushes. To place the spawns, take the groups from 1 to 6 and cut and paste them at each point you want new spawns. The group named "PlayerSpawnGroup_Spawns_1" is enabled at the start. To advance the spawns, send a "trigger" input to the logic_relay named "PlayerSpawnGroup_MoveSpawns_Forward". This will disable the previous group of spawns and enable the next in the iteration. You can also use the logic_relay "PlayerSpawnGroup_MoveSpawns_Backward" to move the enabled group of spawns backward.


Basic NPCs

Image

Here I will go over basic NPC usage in Obsidian Conflict. There are many ways to do this, but the method covered here will work well for most linear/combat maps and require no use of any of the AI entities. You will learn how to properly spawn NPCs for an online environment, placing defending NPCs, attacking NPCs, and creating "Last Stand" scenarios where the players must repel an enemy attack for a certain duration.

Firstly, when using NPCs do not directly place them in your map. This is because if all the NPCs already exist, many will be standing around waiting for the players and just causing lag. The right way to include them is to create point_templates of the enemies you wish to use, and then spawn them using an env_entity_maker targeted by a trigger before the players would encounter the NPCs. This lessens lag while playing online. Simply place env_entitiy_makers set to spawn instances of the intended enemies, place a trigger before the player enters the area to spawn. This is the simple way of making defending NPCs.

For attacking NPCs, you'll need to make all of the templates of the NPCs to be spawned in the same squad. Then create an npc_enemyfinder and place it the same squad and put it over the area where you want the players to be ambushed. Then same as before, have a trigger spawn the NPCs out of sight. Because there is now an enemyfinder seeing the players, it will relay the player's locations to the spawned enemies. They will then move out and attack the players, even though they could not see them initially.

Last Stand scenarios are created similarly to basic attacking NPCs, except with a different method of spawning them. First create a NPC to use as a template, and check the "template NPC" flag. Then create an npc_template_maker set to spawn your template NPC. Then make an npc_enemyfinder, covering the area where the players will be and set to the same squad as the template NPC. Then it is as simple as having something enable the npc_template_maker along with whatever timer-related stuff you want, and disabling it when the wave of enemies should stop.

While creating Last Stands like this isn't too complicated, there are many issues you need to know about and compensate for. Firstly, make absolutely sure that there is some way to actually lose the battle, otherwise the entire section is meaningless. Normally players will endlessly spawn to fight the wave of enemies, but by enabling lives in your map you can make it so that players can fail the encounter. However, when making running out of lives the only way to lose you need to make sure that there are no areas the player can hide in to avoid attacking NPCs, or rather run back through the previous parts of the map until the Last Stand is over. Another method is to make it so that the players have to defend a certain object or NPC, like in oc_castledefense or the finale of oc_courier.

That should cover general use of NPCs for combat. But regardless of what method you use for NPCs, remember to never ever simply place a npc_maker that constantly spawns clones of an npc type in the same spot until it is exhausted. This makes for extremely tedious whack-a-mole gameplay and looks terrible. Always try to spawn the NPCs out of sight, or use some sort of logical effect, for instance antlions unburrowing from underground.

Basic NPCs Example Map: http://raegquit.com/Tysn/Tutorials/pref ... c_npcs.rar
This prefab is intended to be reverse-engineered, rather than placed directly into maps
You will want to compile and run this example map before looking at it in detail, as I posted many message posts through the map to describe how each part works.


Two-Button Door

Image

The two-button door is a standard co-op set piece, chances are you've seen it many times while playing. Basically it is a door which has two buttons, often immediately to the left and right of it, which must be pressed at the same time to open it. While it has merit as a teamwork puzzle (it is used in oc_manor as a puzzle) often what these are used for are for when the players should prepare before next area, as it prevents a single player from rushing ahead of everyone else.

Creation of these are fairly easy. First create the func_door (or anything else you would want to open, such as a ramp or ladder lowering) and create a math_counter. In the math counter, set the minimum and initial values to 0 and the max value to 2. Then create an output for OnHitMax to open the door. Then, create the two buttons. In each button put in these two outputs: OnPressed to add one to the counter, and then another OnPressed to set the counter value to 0, this with a delay of around 1/2 a second. Now since both buttons will add one to the counter and then quickly remove it, they both must be pressed at the same time to open the door.

Two-button doors are easy to implement in maps and don't really need a lot of explaining on their use. Basically just remember to space the buttons far enough apart so that one player can't sprint and hit both of them by themself. This set piece can also be expanded for co-op puzzles, for instance maybe one player has to first help another player reach one of the buttons, or perhaps the buttons aren't within sight of eachother and players must communicate to press them at the same time.

Two-Button Door Example Map: http://raegquit.com/Tysn/Tutorials/pref ... n_door.rar
This prefab is intended to be reverse-engineered, rather than placed directly into maps
Within this prefab is an example of a two-button door, using the method described above. There is also a trigger to the right of you when you spawn to allow you to test the door's counter while playing alone.


Momentary Wheels, Platforms, and Doors

Image

Momentaries are those parts of maps where one player must turn a wheel, which provides a path across an obstacle for another player to cross. Momentaries are like the two-button doors in that they are a staple co-op set piece, and many of the considerations behind their use in gameplay are the same. Mainly why you would use one of these instead of a two-button door is to provide a different flavor to a section of your map, or in less technologically advanced environments where having a door operated by two electronic buttons wouldn't make much sense. Also similar to why you would use an elevator instead of stairs and ladders, as momentaries force gameplay to slow down, allowing players to think and communicate rather than the constant rushing action seen in a typical co-op situation.

The two entities behind momentaries are the momentary_rot_button, and func_movelinear. The momentary_rot_buttons are what the player holds down to slowly move the position of the targeted func_movelinear. In both entities you'll want to set the max distance for each to move, "distance" in the button and "move distance" in the movelinear. First measure how far you want the movelinear to move, and then use the same distance for both keyvalues. Then set the "speed (deg/sec)" and "speed" in both entities to the same value as well. Then create an output in the button that targets the movelinear, with the output named "Position" and the input to the movelinear "SetPosition".

From here you have more options in how exactly you want it to operate. Set an auto-return speed in the button to make both the wheel and the movelinear to reset to a normal position once the player lets go of the buton. Or check "toggle" in the button so that it can be moved back and forth.

Like the two-button door, just make sure that one player can't fully turn the wheel and run to whatever is opened by himself. Momentaries are used for more formal co-op puzzles than two-button doors, and by mixing them with different gameplay elements you can create very elaborate teamwork puzzles that require a lot of communication between players. Although there are 2 more things to make note of: first, operating the button requires the player to have a good ping, otherwise it will constantly bounce back and forth and be mostly uncontrollable. Secondly, with other elements momentary-related puzzles can become very complex, and may frustrate players on pub servers with bad communication. If you're not concerned with pubbers then you can ignore this advice, but for instance the wheel/3-levers puzzle in my map oc_stitches has a tendancy to have people screaming "RTV!" once they enter the room. It's sad that for a co-op mod there are still some people that hate teamwork-intensive puzzles which can hurt a map's public server appeal, so that is just something you may want to keep in mind. (Note that this doesn't momentary puzzles will hurt pub server appeal, but elaborate puzzles involving them.)

Momentary Wheels, Platforms, and Doors Example Map: http://raegquit.com/Tysn/Tutorials/pref ... taries.rar
This prefab is intended to be reverse-engineered, rather than placed directly into maps
Like stated in the name, in this map you will find examples of platforms and doors that are operated by momentary wheels.
Last edited by Tysn on Fri Oct 16, 2009 7:37 am, edited 13 times in total.
Image
User avatar
Tysn
Former Developer
Former Developer
Posts: 358
Joined: Thu Oct 26, 2006 1:57 am
Location: Minnesota, USA
Contact:

Post by Tysn »

If anyone has any other requests on how to do things, post them here and I'll add them to the guide. Make sure they're not too specific as this is mainly as a resource that all mappers can draw from rather than for specific map types.
Image
Tono-Tako
npc_combinegunship
npc_combinegunship
Posts: 785
Joined: Tue May 30, 2006 10:28 pm
Location: Half-LIfe series Fan

Post by Tono-Tako »

sooo useful!
thanks
Image
Vote for obsidian conflict in moddb
One click a day doesnt hurt your finger
Axel_m3sh
npc_combine_elite
npc_combine_elite
Posts: 469
Joined: Wed Nov 05, 2008 5:52 am
Location: lolwut L0C4tI0n?
Contact:

Post by Axel_m3sh »

We all love ya Tysn lol

This guide and the prefabs will surely help with new mappers get used to OC, thanks for taking your time to make this :D
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

Wow, you beat me too it and with much more (I had similar idea at the weekend)!

I was going to release a multi merchant template, just because I used so many different ways of using it. recently in my new map.

I might still release some examples of logic_relay merchants showing how to use with buttons, parenting, templates, templates + entity makers, and getting random spawns with logic cases.

I've always wanted to make a quick cs:s mapadd tutorial just a zombie one on cs_office or something, I might get that done aswell.

Also what would be nice is some examples of usage with npcs like template_makers etc or an explanation between npc_maker and template maker and some npcs spawning on point_templates. Oh and not for getting nodes and navigation stuff like ai_scripted_schedule. I just think the last would be good for all those multiplayer mappers that decide to start dabling more with the npc side of mapping.

Well very impressive Tysn, gj!
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
User avatar
Tysn
Former Developer
Former Developer
Posts: 358
Joined: Thu Oct 26, 2006 1:57 am
Location: Minnesota, USA
Contact:

Post by Tysn »

fug4life wrote:Also what would be nice is some examples of usage with npcs like template_makers etc or an explanation between npc_maker and template maker and some npcs spawning on point_templates. Oh and not for getting nodes and navigation stuff like ai_scripted_schedule. I just think the last would be good for all those multiplayer mappers that decide to start dabling more with the npc side of mapping.
I quick made a Basic NPC guide along with an example map. Needing to use stuff like ai_scripted_schedule may be a little over the top for everyday co-op combat gameplay, as without the AI entities you can already make defending and attacking npcs, as well as "Last Stand" defense sections.
Image
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

Nice, yeah its enough to get mappers kick started in the right direction.
If I think of anything else I post it.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

Level transitions, and changelevel. Might be a good one. Though really where do you draw the line. Too much work to template everything.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
User avatar
Vasili
npc_helicopter
npc_helicopter
Posts: 901
Joined: Wed Aug 02, 2006 8:22 pm
Location: England

Post by Vasili »

fug4life wrote:Level transitions, and changelevel. Might be a good one. Though really where do you draw the line. Too much work to template everything.
All you need is the area of the map where you want it to change level to have a trigger changelevel thing and then have the entities set up etc... and then what you need to do is give the props in that part a global entity name and then have them in the other map along with exactly the same brush work.
User avatar
Tysn
Former Developer
Former Developer
Posts: 358
Joined: Thu Oct 26, 2006 1:57 am
Location: Minnesota, USA
Contact:

Post by Tysn »

Updated the guide with info on Two-Button Doors.

I might make one on level changes later. You're right about trying to make prefabs for all possible set pieces would be too much works. Mainly what I don't want to do is create a lot of overlap with other mapping tutorials featured on other sites, as that would be redundant. There are several level transition tuts on other sites, but if people really want one I can make one here. But overall what I'm planning for this guide is to provide tuts that you normally wouldn't find anywhere else, meaning OC specific stuff and hl2 co-op mapping.
Image
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

:truedat:

Perhaps a Trigger_player_count combined with level_transitions.

The only other stuff I can think of is a bit of is an example map of monster npcs. Some can be tricky like getting Snarks in and Hydras or picking the right way to get h_grunts in using the updated models, but that's again getting too specific. People can find that stuff out by posting.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
User avatar
RocketRunner
npc_combine_elite
npc_combine_elite
Posts: 467
Joined: Thu Apr 23, 2009 5:19 am
Location: Phoenix, AZ

Post by RocketRunner »

Hey, you know the two-button door?
What about a variation where two players have to hold a button/valve/etc.?
I've seen something like that in a ZPS map.
I usually run from rockets.
Pretty straightforward.
User avatar
Tysn
Former Developer
Former Developer
Posts: 358
Joined: Thu Oct 26, 2006 1:57 am
Location: Minnesota, USA
Contact:

Post by Tysn »

You mean momentary_rot_buttons? I might make a section for those later as they are useful. However I really don't want to make prefabs for every possible combination of co-op puzzle set pieces, as that's really something the mappers should come up with themselves.
Image
skidz
Obsidian Gold
Obsidian Gold
Posts: 3228
Joined: Mon May 29, 2006 6:36 am
Location: Maple Ridge, BC
Contact:

Post by skidz »

Amazing tutorial Tysn, great work.
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

I hate the rotating Valves, they are useless if your ping is more than 200.
Please take my word on this, I know from bad experiences.

And yeah I'm happy as hell you done all these tutorials, something I feel was long over due. There seems to be a steady influx of half decent mappers showing some interest in mapping for Obsidian. I'm really looking forward to more mappers on the scene.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
Post Reply