Underhell is a Source Engine game developed by the Underhell Team in collaboration with We Create Stuff. Underhell Chapter 1 requires ONLY Source SDK Base 2007 installed. No Source game is required.

Report article RSS Feed Item_Random for Random Loot !

This brief tutorial will explain how the random placement and selection of items/weapons works in Underhell, as well as a short tutorial on how to place them.

Posted by Mxthe on Oct 3rd, 2012
Basic Mapping/Technical.

Randomization = Replay Value

This is a simple rule, that has driven Underhell to take steps to ensure that no playthrough will be exactly the same.
The Random Factors of the game are so diverse and complex, that I couldn't explain it all in one tutorial, so for this tutorial, let's focus on one VERY important Random Factor, the LOOT!

In many games, especially Survival games, Looting is one of the key elements of gameplay, it's about making the player NEED certain elements, and then HIDING those elements to encourage the player to explore, open drawers, lockers, cabinets, closets, footlockers ect...

There is just one common problem with many of those games, the loot is always the same, and it is always placed at the same location.

This, is where Item_Random comes in.

Item_Random


Item_Random is a brand new entity that we have created for Underhell.
This item's keyvalues determine which item will spawn at the selected location, but it also possesses a few tricks that are worth mentioning.

The basic keyvalues are :

  • TargetName: The name of the "Item_Random" is passed to the Item it will create.
  • Angles: For the spawn angles of any item this "Item_Random" will create.
  • DisableShadows:(0-1): To avoid item's shadows from inside a locker/cabinet.

Special Keyvalues

Respawn: (0-1)

If set to 0, the "Item_Random" will delete itself after creating the first item, to avoid spamming the Edicts Count.
The Item_Random also comes with a "Respawn" Input, when sent, the previous Item that was created will get deleted, and the Item_Random will spawn another Randomized Item from it's list.In order to use the "Respawn" Input, the "Respawn" Keyvalue must be set to 1.

Nothing: (0% - 100%)

This is where the magic occurs.This keyvalue specifies how often the Item_Random will NOT spawn anything.If set to 50, the Item_Random will have 50-50 chances of spawning an item from it's list.
This is a great tool to easily balance maps, especially considering the "Respawn" keyvalue as well, to easily re-create items when necessary.

Item_X: (Item Name)

The Entity uses it's keyvalues as "Flags" to decide which items can be spawned from the "Item_Random".

Example:


As you can see, this particular Item_Random can spawn any item from the ones specified in the list, and it will have 50-50 chances of spawning something.

Thanks to this very simple yet effective system, Item_Random can be placed at EVERY potential position where an item could spawn, and yet the game will randomly decide which one will exist, and which one will not.

Furthermore, if one of the item_random was to have a special weapon as one of it's keyvalues, for example a "Weapon_Shotgun_XM1014", only a few lucky players would get this weapon, which would considerably change the way they will play certain parts of the game.

Of course, this wouldn't be much without the 20+ NEW Item Types that we have created for the game, which includes Tools, Food, Drinks and Medical Items.

Programming by Carlos "Charly" Sotelo
Post comment Comments
FrontierPsychiatrist
FrontierPsychiatrist Oct 3 2012, 8:31am says:

Awesome.

+7 votes     reply to comment
TheShadowMG
TheShadowMG Oct 3 2012, 9:14am says:

So freakin awesome, I hate findin the same SMG in the same spot everytime I play again. This should be added to all linear games, so the experience is different everytime, from "Im totally ******" to "I just found the best weapon in the game, lets have some fun"

+7 votes     reply to comment
Light_Kill
Light_Kill Oct 3 2012, 10:15am says:

It reminds me l4d item system :D
Good work guys !

+7 votes     reply to comment
JoshZemlinsky
JoshZemlinsky Oct 3 2012, 10:18am says:

Awesome, im very very happy to see you guys are making progress. It's always awesome to see a project go well :)
keep up the good work you too, it's just getting better and better :D

+5 votes     reply to comment
BillionLioe
BillionLioe Oct 4 2012, 5:57am says:

The food and drinks portion kicked up my enthusiasm:D

I appreciate this insight into the workings of the mod,
it is very interesting (for me at least) to know how what you are playing works.

Updated Underhell will be so epic!

+7 votes     reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Icon
Half-Life 2 Icon
Platform
Windows
Developed By
Mxthe
Contact
Send Message
Release Date
Released Mar 5, 2011
Mod Watch
Track this mod
Tutorial
Browse
Tutorials
Report Abuse
Report article
Related Mods
Underhell (Half-Life 2)
Underhell Half-Life 2 - Single Player Adventure
Related Games
Half-Life 2
Half-Life 2 Single & Multiplayer First Person Shooter