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.
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
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 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 :
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".
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.