A Few Parser/Monster Creation Related Questions

epidemico

Well-Known Member
Apr 5, 2016
146
36
Hey all,


So I'm currently taking a whack at creating some combat encounters for the game--starting primarily with Uveto--and I have some questions regarding the dos and don'ts of the process. Specifically:


1)  (XPRaw = #) --- on the googledoc by Gedan, I see this referred to as a number, but the code of other monsters has the # portion as "normalXP," or "bossXP." My question is which do content-creator's use when designing a monster: specific numbers, or one of the latter two tags?


2) (customDodge) --- Can there be more than one kind of customDodge? Like, one for melee and one for ranged attacks? Same question for customBlock.


3a) (meleeWeapon) --- there isn't much--if any--say in related documents as to what this does, other than "outputting the name of your weapon," for PC characters. For monsters, is this supposed to be the same? Or is it used to determine both name and the specific item they're using as a weapon, since in the example in Gedan's doc a "Vanae Spear," is something you can pick up in-game?


3b) Dove-tailing off the above, how would it work if, say...I wanted a creature to randomly show up with different kinds of weapons? (One encounter it might have a spear, another encounter it might have a hammer, etc, etc.) And if those weapons prompted different fighting styles and abilities, can the game-engine/combat-engine as it stands right now handle that?


(For example: Creature A shows up using a Sword, and has the abilities "Slash, Guard, and Counter." as part of its first combat encounter. Next time, it shows up with a Spear and has the abilities: "Thrust, Stab, and Pincushion," but there's also a random chance it might show up using a sword again.)


3c) If meleeWeapon only names the weapons used by a Combat Encounter, then what determines how that weapon functions? Is it, like in using the "Vanae Spear," a question of creating a new item--and therefore the stats of that item--for the monster to use as part of its basic melee attacks, OR is it simply a question of noting something like: "Creature A's basic melee attacks do Shock Damage and have a 30% chance to stun," in your design doc, as I've seen in other submissions?


4) I know Gedan's guide says you--the creators of the game--generally just "copy statblocks," of other characters when making race/character profiles for new characters, but my question is this: is there a baseline we, as people writing submissions, can/should use? Something like: "The stat block of level 5 monsters should be based on THIS stat block of THIS monster already in-game," or: "Your level Z monster on Myrellion should NOT be as powerful or more powerful stat-wise than the Queen of the Depths, as it is the BOSS of that location," etc, etc.


Sorry if these seem like complicated things to ask! I just want to make my document as easy as possible to translate from writing to actual game-code, and I feel that--and this is said with all due respect--but writing combat encounters might go easier on everyone involved if some of the more mechanical things involved in the process were explained in further detail. The submission guide is amazing, don't get me wrong; but as an author that has little experience with the code of TiTs, parsing some of the mechanics involved has proven to be more guess-work than research.
 

Trogdor

Well-Known Member
Apr 10, 2016
309
21
3a) (meleeWeapon) --- there isn't much--if any--say in related documents as to what this does, other than "outputting the name of your weapon," for PC characters. For monsters, is this supposed to be the same? Or is it used to determine both name and the specific item they're using as a weapon, since in the example in Gedan's doc a "Vanae Spear," is something you can pick up in-game?


3b) Dove-tailing off the above, how would it work if, say...I wanted a creature to randomly show up with different kinds of weapons? (One encounter it might have a spear, another encounter it might have a hammer, etc, etc.) And if those weapons prompted different fighting styles and abilities, can the game-engine/combat-engine as it stands right now handle that?

The choice of weapons a character uses is defined in their character definition .as file, so if you wanted to use an existing creature you would need to edit its definition. For an example, take a look at the Alpha Nyrea definition: https://github.com/OXOIndustries/Trials-in-Tainted-Space/blob/master/classes/Characters/NyreaAlpha.as


I picked this creature because I think it's about the only enemy in the game that uses different weapons right now; most use a static function call, as we see on line 54:


this.meleeWeapon = new NyreanSpear();


But for her ranged weapon, it uses a randomincollection to pick from a few different options (line 195):


rangedWeapon = new (RandomInCollection(EagleHandgun, HammerPistol, LaserPistol))();


And finally, the loot table makes sure to drop the weapon the enemy was actually using (line 207-8):


else if (rand(20) == 0) inventory.push(rangedWeapon.makeCopy());
else if (rand(20) == 0) inventory.push(meleeWeapon.makeCopy());


You can see here that it's dropping exact copies of the weapons the npc was using for use by the player, but that doesn't have to be the case. You can make it drop any item (and if you wanted an enemy (like a boss) to always drop an item, you'd chop off the if-then-else rand() stuff and just say inventory.push (new Whatever());.

Code:
else if (rand(3) == 0) inventory.push(new NyreanCandy());


You can also see, starting at line 220, that this file also defines the creature's combat AI, defining the attacks the creature can use (and the text pushed to the user describing what's going on) and when/how often/under what circumstances the creature can use those attacks (look at creatures that has special attacks for when the PC is knocked down for examples, like the Vanae and Raskvel Males). So basically, there's no 'engine' that handles combat for you; you define it yourself.


As for scaling, you can probably answer a lot of your own questions by simply looking at stuff that already exists on Github. :)
 
Last edited by a moderator:

Nik_van_Rijn

Well-Known Member
Sep 10, 2015
2,407
506
Moscow, RF
1) That's the result of the recent XP system overhaul. Each enemy's worth in XP is now determined by some formula I can't be bothered to look up on Github, but that certainly takes if the foe is boss or not into account.


2) AFAIK , you can't.


3b) In addition to what Trogdor has already said, you can sidestep the issue by setting up Swordude and Speardude as two separate entities that will share a lot if not all of statblock and sex scenes but will have different abilities and combat routine.


3c) If the thing you want your NPC's attacks to do can be achieved via weapon flags that already exist or that the devs woe find worthy to bother with, then you just create a new weapon with said flags. If not, you notify the code masters and they set that stuff up by making your NPC's basic attacks an ability.
 

epidemico

Well-Known Member
Apr 5, 2016
146
36
rangedWeapon = new (RandomInCollection(EagleHandgun, HammerPistol, LaserPistol))();

So, if I go this route I'd have to create the weapons from scratch?

3b) In addition to what Trogdor has already said, you can sidestep the issue by setting up Swordude and Speardude as two separate entities that will share a lot if not all of statblock and sex scenes but will have different abilities and combat routine.


3c) If the thing you want your NPC's attacks to do can be achieved via weapon flags that already exist or that the devs woe find worthy to bother with, then you just create a new weapon with said flags. If not, you notify the code masters and they set that stuff up by making your NPC's basic attacks an ability.

3b) That seems like it would double or triple the amount of work behind incorporating them into the game.


3c) This seems like the easiest option outside of creating new items.
 

Trogdor

Well-Known Member
Apr 10, 2016
309
21
As for 2) ...well, you can add


this.createPerk("Ranged Immune",0,0,0,0);


but that's the only other thing I can think of off the top of my head.


For weapons used, no you're not creating weapons from scratch. Not necessarily, anyway. Like I pointed out, those Alpha Nyrea are using the same Eagle Handgun, Hammer Pistol, and Laser Pistol that the player can obtain elsewhere. When it says 'new whatever', that just means it's creating a new copy of an item.


You CAN define new weapons for specific enemies.


In some cases (cuntsnake.as) the weapon is entirely defined within the character definition.


this.meleeWeapon.attackVerb = "bite";
meleeWeapon.attackNoun = "bite";
meleeWeapon.baseDamage.kinetic.damageValue = 4;
meleeWeapon.baseDamage.addFlag(DamageFlag.PENETRATING);
this.meleeWeapon.attack = 2;
this.meleeWeapon.longName = "fangs";
this.meleeWeapon.hasRandomProperties = true;


In other cases (GooeyPsuedopod.as) the weapon is specifically designed for one (or more) npcs to use, but not intended to be something the player will ever legitimately obtain.


So if your characters are going to be using pre-existing items, you don't have to code anything extra beyond "this.melee/rangedWeapon = new filename();"
 
Last edited by a moderator:

Trogdor

Well-Known Member
Apr 10, 2016
309
21
Hm...now to decide if I want to give the weapons to the PC of just keep them in the hands of the monsters they encounter.


Thank you for all the help so far!

Depends on the weapon. If it's something like the gooey pseudopod, well, that's intended to be part of the goo-like creature represented as an unobtainable item. Assuming you're talking about humanoid enemies, remember that you start the game with a knife and a handgun. If the enemy is throwing rocks and poking you with pointy sticks, it's probably safe to assume Steele wouldn't even bother with it.


I would have assumed this to be the case for Nyrean/Vanae spears and primitive bows as well, but apparently there's a steady market for xenomedieval weaponry...?


Then again, often times even advanced enemies like the Black Void don't drop their weapons/equipment. Frankly, so much went into imagining and describing that weird laser rifle/slugthrower thing that Kaska wields, it was a letdown that she doesn't drop it. It's not even an item, it's hardcoded.
 

Etis

Well-Known Member
Creator
Aug 26, 2015
2,497
258
If the enemy is throwing rocks and poking you with pointy sticks, it's probably safe to assume Steele wouldn't even bother with it.

Actually, pointy sticks are better than many things you can buy. Vanae or Nyrea spears, specifically. You can loot primitive bow of Zil or huge wrench from Raskvel. And quite primitive Myr weapons are also top tier at the moment. And Uveto, being a bit upper tier than Myrellion, can have even better things.
 

Trogdor

Well-Known Member
Apr 10, 2016
309
21
Actually, pointy sticks are better than many things you can buy. Vanae or Nyrea spears, specifically. You can loot primitive bow of Zil or huge wrench from Raskvel. And quite primitive Myr weapons are also top tier at the moment. And Uveto, being a bit upper tier than Myrellion, can have even better things.

? A 10 damage, +3 accuracy nyrean spear is top tier? Lava saber is 18 damage with a burn DoT, 5 crit and 3 evasion. Vamp blade is 19 damage with shield leeching and 6 accuracy.


A raskvel wrench is 14 dmg -2 accuracy. A rocket hammer (sold on the same planet) has more damage and no accuracy penalty.


The Myr survival axe has the damage (18) of a modern weapon but without the fancy extra effects and stat buffs. Mediocre.


The Myr Hunting Rifle is nearly identical to the Zk rifle, which you acquired 2 planets ago. And, well, its damage is slightly higher, but realistically probably shouldn't be. But it's a game and later planets have more powerful loot despite logic. Granted, there are weaker items for sale, but I'm not seeing much evidence for your claims of spears and primitive bows being great...
 

Etis

Well-Known Member
Creator
Aug 26, 2015
2,497
258
? A 10 damage, +3 accuracy nyrean spear is top tier? Lava saber is 18 damage with a burn DoT, 5 crit and 3 evasion. Vamp blade is 19 damage with shield leeching and 6 accuracy.


A raskvel wrench is 14 dmg -2 accuracy. A rocket hammer (sold on the same planet) has more damage and no accuracy penalty.


The Myr survival axe has the damage (18) of a modern weapon but without the fancy extra effects and stat buffs. Mediocre.


The Myr Hunting Rifle is nearly identical to the Zk rifle, which you acquired 2 planets ago. And, well, its damage is slightly higher, but realistically probably shouldn't be. But it's a game and later planets have more powerful loot despite logic. Granted, there are weaker items for sale, but I'm not seeing much evidence for your claims of spears and primitive bows being great...

Not great, but competitive, especially considering that they are free and you are getting them basically just for walking around.
 

Trogdor

Well-Known Member
Apr 10, 2016
309
21
Well, I'd discuss the point further, but I don't really want to derail epidemico's thread.
 

epidemico

Well-Known Member
Apr 5, 2016
146
36
Back with more questions!


1) In some descriptions I've seen for blocking an attack with your shield, the set-up will be: shieldparsertag: {describes taking an attack}{other writing describing taking an attack} and I was wondering what e)(actly that does, in-game? Is the first one for a normal hit, and the second for when your shield fails, or...?


2) when adding parser-related tags to writing--and I've checked the current document several times, believe me--are the tags that show up in Minerva during save-editing the same ones the game calls on for stuff? For e)(ample, if I wanted to make a scene check if a player were a certain class, is the correct tag: "if pc.characterClass = 1," to check for Merc, or something else...?
 

Trogdor

Well-Known Member
Apr 10, 2016
309
21
2) KQ2:


if (pc.characterClass == GLOBAL.CLASS_MERCENARY)
{
output(" Hey, you could do something with that....");
if(flags["KQ2_RND_ENTRANCE_OPEN"] == undefined) addButton(0, "Use Tank", kq2UseTank, undefined, "Use the Tank", "That sure is a nice door the research facility has. It'd be a shame if something were to... <i>happen</i> to it. Hop in that tank, crane the main gun around, and knock.");
else if(flags["KQ2_RND_ENTRANCE_OPEN"] == 1) addDisabledButton(0, "Use Tank", "Use the Tank", "You've already used this--no point in using it again unless you want to bring the whole place down.");
else addDisabledButton(0, "Use Tank", "Use the Tank", "The doors are already open--there's really no point in causing unnecessary destruction here...");
}


Not sure about the other question, sorry. If I had to guess, I would say it's for an attack having different effects based on whether your shields are up or not (like when a female Raskvel shoots darts at you; if your shields are up, the attack does nothing and says as much)