Weighty stuff

gameplay_loot

Over the last week or so, instead of porting more map entities from the RMQ codebase, I sat down and did SJ’s loot system. As you can see in this flow chart, loot is absolutely central in SJ; almost everything in the game goes through the loot system at some point.  So actually building it just came naturally.

SJ needs a way to store a lot of items of several different types, with quite a few properties per item; it needs to be able to add, remove and transfer items between entities; and it must be able to do random selections from the item pool according to various criteria. This was done using FTEQCC‘s support for structs and arrays.

Loot drops

The most time consuming part turned out to be the random selection. My first implementation was rather simplistic, basically setting up some biases for what could be dropped at what probability and by whom, and then running a simple random() across the pool of eligible items.

There were some problems with that, the major one being that rare items would end up having the same drop chance as common ones. That was shite. Instead, after a lot of research, SJ is going to use weighted random distribution. Most items (generic loot, meds/drugs, ammo, charms etc) will be dropped according to that method. Drop chances of each item are determined per-monster. Weapons are fixed drops, meaning any enemy will always drop their weapon and the ammo that’s still in it.

At some point, I noticed that certain subgroups of items needed to be better developed before they could be included; namely armour, which I hadn’t wasted too many thoughts on previously, and charms. Due to that, I’m now finally nailing down those aspects of the game in order to finish populating the loot structs and tweak the loot handling functions to take all item types into account. I’m researching, designing and programming my ass off at the moment, in other words.

Anyway, the basic system is there, and it only took like a week, which I think is fast. That’s some major progress with the implementation of critical game elements right there.

Creature drops

The same system for weighted selection is going to be used for spawning enemies; this because spawning creatures during runtime is the norm in SJ (unlike Quake where monsters are placed by the mapper and spawned all at once as the level is loaded). We had experimented with randomizing the monster spawns in RemakeQuake already, where they could be randomly picked from a pre-defined, mapper-selected group (‘Lardarse’s randomizer’). In Scout’s Journey, randomness is now a fundamental game mechanic. There are many entry points into the game world for enemies, and very few of them are determined by the level designer anymore. All the level designer does is place installations and mark patrol routes for the factions. Each of the 4 factions has several units (pure surveillance units as well as spellcasters) that can summon troops; even fixed installations around the level can summon troops on their own and send them out on patrols or whatever. That means a level is never truly “finished”, but instead becomes continuously contested ground where situations can emerge between enemy factions and so forth. And each randomly spawned unit is loaded with randomly selected loot, which in turn can be exchanged for *still* other things in certain places by the player.

I actually made myself a set of bottle caps with rarities noted on them to represent my items, and then did random selections on them to better understand the weighted selection process. It’s really quite remarkable. This is why drinking beer is good for you, it helps you understand statistics.

The other half of SJ’s core systems needs CSQC to graphically represent item transactions. That is the next big thing.

Lots of progress recently.

Thanks to Lord Havoc and Spike for valuable input.

Advertisements

6 responses to “Weighty stuff

  • Spiney

    Loot sounds great. How much of Quake is left in the gameplay, are the shooting mechanics still there, or is it more realistic? The baddies still have the same basic makeup? Etc…

    And now I’m curious what’s behind the black boxes! 😮

  • kneedeepinthedoomed

    The majority of weapons in SJ are still projectile-based. There is a lot more melee than in Quake.

    It should still be possible to circle-strafe projectile-using enemies just like in Quake, but the player will have additional options.

    The AI is designed to be a lot smarter than in Quake.

    The player has some definite options besides just open combat which I don’t want to discuss yet. You can wreak havoc on enemies in a number of mischievous ways. There is a skill tree with a lot of skills that are useful to deal with enemies; I don’t want to go into details now though.

    The makeup of the baddies is more differentiated than in Quake; not everybody who can theoretically fight you is an enemy.

    The factions have different cultures and different motives. They fight according to that.

    The Herd like to use high tech equipment – things like energy weapons and robotic support units.

    The Order are a sci-fi Inquisition who accordingly use medieval-inspired weaponry (including siege engines) and devastating arcane spellcasting with a perverse and necromantic slant.

    Tribals are by default neutral to the player. Their warriors fight with crude but effective weapons and their shamans supply them with powerful medicine.

    The fourth faction appear to be no one’s friend or foe. They use elemental forces to defend themselves, and as a whole seem to be elemental-magical in nature.

    The factions are not limited to certain regions; unlike grunts and enforcers in Quake, you can encounter e.g. Herd troops everywhere.

    You’re not supposed to kill everything that moves, and the threat level of some creatures can be hard to assess. Your actions have consequences – you might want to not shoot first unless you’re entirely clear about who the enemy is.

    The actual shooting can be reminescent of Quake, and you can definitely go on raids to get loot, but the world is really rather different and shooting isn’t the only way to deal with things. Most enemies won’t mindlessly charge you either (some will).

    The black boxes are insignificant. Insert Jedi mind trick here.

  • Spiney

    I’ve also been fantasizing about a persistent world Quake (or whatever you want to call it). Revisiting areas Metroid/Zelda style once you have a new ability that allows you to reach new places (like a quiring a grapplehook). I love old school FPS and to me Quake is the high point of the ‘romeroian’ FPS, but mixing it with RPG makes it much more engaging.
    Kind of like a arcady fantasy induced STALKER… which sound exactly what you’re doing, haha.

  • kneedeepinthedoomed

    Somewhat, yeah. STALKER and Bioshock are two main inspirations for SJ.

    Once you have a persistent world, just running around killing stuff – while fun – eventually gets boring. There need to be some additional motivations to keep poking around. One of those are stashes and loot, or stuff like artifact hunting in Stalker; another are quests; yet another is collecting stuff for posterity; character development, finally, is also a motivator to find all the plasmids / get all the ADAM / unlock all the skills and so on.

    Quake does already reward exploration with secrets; that’s basically stashes collected for posterity. But putting 30 secrets in a map will eventually get boring, too, because Quake doesn’t have enough different loot to keep it interesting, and it’s not randomized. Once you find the third yellow armour secret, it loses its impact. This is why I wanted to do charms in RMQ already — I was running out of stuff to put in secrets since the maps were so large.

    Playing the RNG, basically, like in Diablo or Borderlands, is extremely addictive if there is enough different loot. It is like a slot machine, simple but effective.

    Different groups of enemy serve the same goal; keep progression interesting (Crimson Lance in Borderlands) and it ties into the setting as well. A world that has its own conflicts, even without the player, allows for emergent gameplay. You might come across fights that don’t even involve the player, and then you can play both sides against each other. Or lead one side into the other’s camp and watch the carnage.

    And so on.

    Spawning enemies during runtime is a must in a persistent world – as done by STALKER’s alife. SJ isn’t going to reproduce alife, but patrols and surveillance units serve a similar purpose. A full alife-like system isn’t needed because SJ’s environments are quite different from STALKER’s.

    SJ is going to have very clear winning conditions, though, so it should be easy to see how far along you are in the game, and what’s required to proceed.

  • slapmap

    So you gonna make s.t, alker/fallout all by yourself? Derek, is that you?
    Btw did you play Darksiders2?

  • kneedeepinthedoomed

    SJ needs a lot less assets than those games – models, textures, sounds. That’s where you can save man hours if you don’t have a large team. My tech is also on a lower level.

    Compare SJ’s five levels to Stalker’s entire world. It’s just a lot smaller.

    I haven’t played Darksiders 2, but I’ll look at it on Youtube 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: