Archery Expansion First Version Out

Bows/guns have two damage values. The one often labeled MDG is the weapon’s melee bashing damage, the one often labeled DMG (right before the the ACC value) is the weapon’s ranged damage.

I’ve always wondered what MDG was for :o.

Relevant updates from dev-land: guns (and hence bows) can now be defined in JSON data files. There’s also a “range” field on guns, which actually works now. I think this gives us the tools we need to make bows a little less hacky :).

One potential balance issue, I’m wondering how much damage bows and arrows should do through out the stages.
I don’t think they should have the penetration of some of the medium calibres aside from the really heavy arrows and strong bows.

Range is also an issue. How far should a bow be able to fire? For the strong bows it’s likely to be incredibly inaccurate, so I think that even if I give them the ability to loose far away, it woukd still be balanced somewhat. Though this depends on the accuracy and hit calculations.

Currently, I feel like longbows have way too little range. They feel more like a weak shortbow to me, and have about the same range as handguns. That seems appropriate for weak/crude bows, but not for quality archery gear.

I’d say that the range on bows should be more comparable to a weak rifle. It looks like rifles range from 30 squares to 90 squares, so somewhere in the 25-40 square range is probably appropriate, depending on just how good the bow is. Possibly even higher for some. Also, consider that the draw weight isn’t the only thing that differs between bows; there’s also, for instance, the general shape of the bow, as well as the materials it’s made of. Not to mention things like sights, and such. So, it seems like we could tweak things enough so that

Mind you, all this is assuming fletched arrows. Unfletched arrows should definitely have a range and accuracy penalty. After all, 10 squares suddenly seems a lot more reasonable if we assume you’re basically just shooting sharpened wooden sticks (but then the commercial carbon fiber arrows are still 15 squares, so…).

In terms of armor penetration, discussions on IRC make me think that the AP should be pretty low on standard arrows - and certainly not powerful enough to be of much help against robots. High armor piercing may be acceptable on certain specially constructed arrows, but if so, I think they should be difficult to construct/obtain, and should require materials that are actually valuable.

After talking a bit on the IRC, I’ve concluded that I don’t want to put two types of arrows (heavy and normal).

My proposed solution to balancing this is to give the heavier arrows an accuracy, damage, and range hit that the stronger bows with more pull weight will be able to compensate for, the usage of heavier arrows will then be solely for AP. This has significant drawbacks though, namely that since we don’t want these arrows to have too much AP akin to a large calibre bullet, heavy arrows might not be all that effective against nearly everything compared to the normal arrows shot from a stronger bow that doesn’t have the damage, accuracy, and range penalties the heavy arrows have.

If you were interested in having ammunition variety still, you could also toy with the idea of having bodkins and broadheads.

Bodkin arrows for cop and soldier zombies, broadhead arrows for animals, basically.

I don’t think you’d need bodkins against kevlar. A knife can easily shear through the fabric, an arrow with a cutting edge, or a heavy arrow with a pointed tip ought to work fine. Kevlar is made to catch round bullets AFAIK. Pointy rifle rounds pass right through them.

Not too sure about what other material soldier armor would have along side kevlar though, but I’m pretty sure it’s going to be a piece of plating of some sort that can resist rifle rounds, which leaves arrows incredibly little room to be lethal. Of course, you could always just shoot the head, but targeting body parts isn’t an option right now. You’ll have to suffice with the exploding arrows atm.

In any case, bodkins weren’t traditionally armor piercing as far as I’ve researched. The shape of the head aside (or maybe a little later in the paragraph), metallurgy tests seem to show that they never had the tempering required to harden them enough that they could stand a chance against plate. As NightNinja said about them, they tend to pigtail when they hit the plate or any other hard surface.

Going back to the shape. A very long cone is a horrible shape to piece armor. It could be argued that it is likely the second worst shape to pierce armor, the first being a round ball. If the tip manages to go through, the circle/hole in which the arrow head needs to push through gradually needs to push the hole bigger, and inward. As the hole gets bigger and the dart further in, the resistance will increase exponentially. So not only will the resistance be continuous and constant, it will increase significantly the more the head goes in.

An armor piercing head is a bit cone shaped, but only for a tiny segment of the round, and the concave is outwards to provide more more mass in the centre of the tip so the head holds. You would expect an armor piercing head to look something like a nail. The head puts all of its energy into the hole all at once and not in a slow gradual process of enlargening a hole.

Edit: Updated everything except for the recipes.

The strongest bow is the one that has the greatest range and damage, but is also the most inaccurate, and slowest to shoot.

The strongest bow with the greatest damaging arrow does 34 ranged damage and 4 AP, at a total of 28 tiles, with an accuracy of 66.

The strongest bow with the arrow that can fly the furthest totals to a maximum of 36 tiles doing 28 damage, an AP of 1, with an accuracy of accuracy 46.

Going to test this out tomorrow.

When you are adding in new guns and recipes, all that has to modified (in the latest version) is only the ranged.json and the recipe.json, right?

Correct, if you’re just adding a crafted gun that uses existing ammo and such, you only need to edit ranged.json and recipe.json, neither of which require a recompile. And they should be giving passable error messages now, too :).

Ammo still needs to be defined in itypedef.cpp, although that will hopefully be changed soon.

If you want them to occur “naturally” (i.e., without crafting), you’ll need to edit stuff like mapitemsdef.cpp as well.

[quote=“Soron, post:50, topic:837”]Correct, if you’re just adding a crafted gun that uses existing ammo and such, you only need to edit ranged.json and recipe.json, neither of which require a recompile. And they should be giving passable error messages now, too :).

Ammo still needs to be defined in itypedef.cpp, although that will hopefully be changed soon.

If you want them to occur “naturally” (i.e., without crafting), you’ll need to edit stuff like mapitemsdef.cpp as well.[/quote]

Well then, mind checking my changes then? The .exe refuses to run with these changes:

item and surrounding code:

[spoiler] “type”: “GUN”,
“symbol”: “(”,
“color”: “magenta”,
“name”: “NX-17 charge rifle”,
“description”: “A multi-purpose rifle, designed for use in conjunction with a unified powersupply, or UPS. It does not reload normally; instead, press fire once tostart charging it from your UPS, then again to unload the charge.”,
“rarity”: 1,
“material”: [“STEEL”, “PLASTIC”],
“flags”: [“CHARGE”, “NO_UNLOAD”],
“skill”: “rifle”,
“ammo”: “none”,
“weight”: 16,
“volume”: 13,
“damage”: 8,
“cutting”: 0,
“to_hit”: -1,
“ranged_damage”: 0,
“range”: 0,
“accuracy”: 6,
“recoil”: 0,
“durability”: 8,
“burst”: 0,
“clip_size”: 10,
“reload”: 0
},
{
“id”: “v30”,
“type”: “GUN”,
“symbol”: “(”,
“color”: “magenta”,
“name”: "V30 laser rifle ",
“description”: “The work of a master electrician. By disabling the safeties and extending thecharging array, this rifle features improved lethality and accuracy overits predecessor, at the expense of clip size.”,
“rarity”: 1,
“material”: [“STEEL”, “PLASTIC”],
“skill”: “rifle”,
“ammo”: “fusion”,
“weight”: 18,
“volume”: 16,
“damage”: 7,
“cutting”: 0,
“to_hit”: 1,
“ranged_damage”: 5,
“range”: 0,
“accuracy”: 25,
“recoil”: 0,
“durability”: 8,
“burst”: 0,
“clip_size”: 10,
“reload”: 300
},

{
“id”: “flamethrower_simple”,
“type”: “GUN”,
“symbol”: “(”,
“color”: “pink”,
“name”: “simple flamethr.”,
“description”: “A simple, home-made flamethrower. While its capacity is not superb, it ismore than capable of igniting terrain and monsters alike.”,
“rarity”: 1,
“material”: [“STEEL”, “PLASTIC”],
“flags”: “FIRE_100”,
“skill”: “shotgun”,
“ammo”: “gasoline”,
“weight”: 8,
“volume”: 16,
“damage”: 8,
“cutting”: 0,
“to_hit”: -1,
“ranged_damage”: -5,
“range”: 0,
“accuracy”: 6,
“recoil”: 0,
“durability”: 6,
“burst”: 0,
“clip_size”: 800,
“reload”: 800
},
[/spoiler]

recipe and surrounding code:

[spoiler] {
“result”: “coilgun”,
“category”: “CC_WEAPON”,
“skill_pri”: “electronics”,
“difficulty”: 3,
“time”: 25000,
“reversible”: true,
“autolearn”: true,
“tools”: [
[
[“screwdriver”, -1],
[“toolset”, -1]
],
[
[“soldering_iron”, 10],
[“toolset”, 1]
]
],
“components”: [
[
[“pipe”, 1]
],
[
[“power_supply”, 1]
],
[
[“amplifier”, 1]
],
[
[“scrap”, 6]
],
[
[“cable”, 20]
]
]
},

{
  	      "result": "v30",
    	    "category": "CC_WEAPON",
    	    "skill_pri": "electronics",
      	  "skill_sec": "mechanics",
      	  "difficulty": 10,
  	      "time": 40000,
   	     "reversible": true,
  	      "autolearn": true,
        "tools": [
                     [
                         ["screwdriver", -1],
                         ["toolset", -1]
                     ],
                     [
                         ["wrench", -1],
                         ["toolset", -1]
                     ],
		 [
		     ["soldering_iron", 6],
                         ["toolset", 2]

		 ]
                 ],
        "components": [
                          [
                              ["scrap”,3]
                          ],
                          [
                              ["v29”,1]
                          ],
                          [
                              ["cable", 10]
                          ],
                          [
                              ["amplifier", 2]
                          ],
                          [
                              ["power_supply", 3]
                          ]
                      ]
    },



    {
        "result": "noise_emitter",
        "id_suffix": "radio-mod",
        "category": "CC_ELECTRONIC",
        "skill_pri": "electronics",
        "difficulty": 1,
        "time": 15000,
        "reversible": false,
        "autolearn": true,
        "tools": [
                     [
                         ["screwdriver", -1],
                         ["toolset", -1]
                     ],
                     [
                         ["soldering_iron", 5],
                         ["toolset", 1]
                     ]
                 ],
        "components": [
                          [
                              ["radio", 1]
                          ],
                          [
                              ["amplifier", 2]
                          ]
                      ]
    },

[/spoiler]

You’re using smart quotes in a few places (around the description, and after the words “scrap” and “v29” in the recipe). Don’t do that, it confuses the computer. Use the ASCII character ".

Also, you’re missing a price field, and “damage” got renamed to “bashing” within the past day or two, but those shouldn’t stop your changes from working.

[quote=“Soron, post:52, topic:837”]You’re using smart quotes in a few places (around the description, and after the words “scrap” and “v29” in the recipe). Don’t do that, it confuses the computer. Use the ASCII character ".

Also, you’re missing a price field, and “damage” got renamed to “bashing” within the past day or two, but those shouldn’t stop your changes from working.[/quote]
And auto correct strikes again! Guess it is to be expected for trying to use word for this.

Thanks for your help. I’m planning on creating a mod of assorted odd improvised weapons/traps/food/stuff, and getting these .json s sorted out is only the beginning. :slight_smile:

Yeah, don’t use MS Word for editing code or code-like stuff ;). Try something like Notepad++?

Tried that and had a wonderful case of ascii madness. Guess I’d better fix it instead of dealing with word’s autocorrect.

Next task: using java knowledge to understand higher level C++. Going to be interesting.

Edit: Uninstalling and reinstalling seemed to work. Alright, back to work.

Maybe I should change the name of this thread to include other human powered weaponry :P.

Before I embark on fixing the recipes to account for the new bow and the added arrows, I decided to add other stuff in.

The first item is the wood_ pile. I noticed the wiki says for things made out of paper that their burn time depends on volume. So I made this item in hopes of making something that would burn for a good amount of time that is “crafted” through a bunch of logs.

The other items are a test for sword and board stuff. They are items crafted through a shield and a spear to make their respected items. It effectively turns two melee weapons into one, though not excelling compared to either weapon is able to take advantage of each of the items’ capabilities.

There are essentially two tiers: Improvised and not. An improvised shield would be a very shoddily made shield. An improvised spear would be like the pointy stick or a javelin. Crafting would take no time.

A spear without the improvised quality would be something like the spear knife, or wooden spear, or fire hardened wooden spear. The recipe for a normal shield and board, compared to the impr shield and impr board, would require these more valued items.

Other possible combinations could be axe and board, mace and board, and sword and board, though those will require a bit more time to make as I will need to work out the recipes for additional melee weapons that would fit in here.

  {
    "id": "wood_pile",
    "symbol": "O",
    "color": "brown",
    "name": "wood pile",
    "description": "A large pile of wood cobbled together so that it would burn for long periods of time than simple logs.",
    "rarity": 0,
    "material": "PAPER",
    "weight": 40,
    "volume": 280,
    "damage": 10,
    "cutting": 0,
    "to_hit": -10
  },
  
  { 
	"id": "impr_shield",
    "symbol" : "0",
    "color": "light_red",
    "name": "impr_shield",
    "description": "An improvised wooden shield. Using weak glue, wood that has not been fire hardened or dried, no boss in the middle, and no rim among other things, this shield is a mere shadow of what proper shield craft can produce though it is well built enough to stay in one piece.",
    "rarity": 0,
    "price": 0,
    "volume": 10,
    "weight": 8,
    "damage": 6,
    "cutting": 0,
    "to_hit": 2,
    "flags": "SPEAR",
    "techniques": ["WBLOCK_1"]
  }
  
  { 
	"id": "shield",
    "symbol" : "0",
    "color": "light_red",
    "name": "shield",
    "description": "A metal rimmed shield, with boss, and correct building processes. Not only does this shield shed unnecessary weight, it can also pack a decent strike.",
    "rarity": 0,
    "price": 0,
    "volume": 10,
    "weight": 7,
    "damage": 8,
    "cutting": 0,
    "to_hit": 2,
    "flags": "SPEAR",
    "techniques": ["WBLOCK_2"]
  }
  
  { 
	"id": "impr_spear_and_impr_board",
    "symbol" : "/",
    "color": "light_red",
    "name": "impro spear and impro board",
    "description": "Ubiquitous the world over, not only due to the simplicity of make and complimenting pairing, but also for its effectiveness.",
    "rarity": 0,
    "price": 0,
    "volume": 18,
    "weight": 12,
    "damage": 6,
    "cutting": 6,
    "to_hit": 1,
    "flags": "SPEAR",
    "techniques": ["WBLOCK_1"]
  }
  
  { 
	"id": "impr_spear_and_board",
    "symbol" : "/",
    "color": "light_red",
    "name": "impr spear and board",
    "description": "Ubiquitous the world over, not only due to the simplicity of make and complimenting pairing, but also for its effectiveness.",
    "rarity": 0,
    "price": 0,
    "volume": 16,
    "weight": 12,
    "damage": 6,
    "cutting": 10,
    "to_hit": 2,
    "flags": "SPEAR",
    "techniques": ["WBLOCK_2"]
  }
  
  { 
	"id": "spear_and_impr_board",
    "symbol" : "/",
    "color": "light_red",
    "name": "impr spear and impr board",
    "description": "Ubiquitous the world over, not only due to the simplicity of make and complimenting pairing, but also for its effectiveness.",
    "rarity": 0,
    "price": 0,
    "volume": 16,
    "weight": 12,
    "damage": 8,
    "cutting": 8,
    "to_hit": 2,
    "flags": "SPEAR",
    "techniques": ["WBLOCK_2"]
  }
  
  { 
	"id": "spear_and_board",
    "symbol" : "/",
    "color": "light_red",
    "name": "impro spear and impro board",
    "description": "A pair of weapons that has killed man since recorded history, and for many ages before that, and likely for many ages to come...",
    "rarity": 0,
    "price": 0,
    "volume": 16,
    "weight": 10,
    "damage": 10,
    "cutting": 12,
    "to_hit": 3,
    "flags": "SPEAR",
    "techniques": ["WBLOCK_2"]
  }

Hmm, looking at the code (field.cpp, starting at line 83)… wow, that’s kind of a mess. No wonder fire behaves so weird. Each material is handled differently. Paper increases fire lifespan by a decent amount per unit of item volume, but only does that for density 1 fire (whatever density 1 means - “small fire”?). Wood gives a small, constant per-item increase to the fire’s lifespan (4 units, whatever that means). High proof alcohol, on the other hand, gives 300 units to the lifespan.

If you want to mod in an item that allows for long-lasting fire, it looks like you’d want something made of the POWDER material, which gives an increase to lifespan of 1 unit per unit of volume. But I think we really need to dig into the C++ source and fix up how fire works, one of these days.

One important factor I noticed with the POWDER is that it creates one level more in smoke. The ALCOHOL tag produces an immense amount of smoke according to the wiki, making its use as a heat source or crafting source suspect.

That being said, I’m going to try and make a POWDER one to see what happens.

Banging out the recipes tonight, and came onto a problem about the techniques melee weapons use.

In itemdefs, (TEC_WBLOCK_1), exists. And in melee.json it is rerepresented as this “techniques”: [“WBLOCK_1”]

Currently for a well made shield I’ve given it “techniques”: [“WBLOCK_2”]. Would this still work or does each term need some coding in the other files to make the program recognize these tokens in melee.json?

If it is the case that it wouldn’t work, I’m going to go put them into the itemdefs for the moment.

Also, does “flags”: “SPEAR” in melee,json equivalent to mfb(TEC_RAPID) in itemdefs?

Yes and yes. Each term needs to be coded for in the appropriate files (currently, that’s all in the item loading code). The good news is that all the TEC_FOO stuff has been mapped to “FOO” in the JSON files. So yes, WBLOCK_2 in JSON gets you the same as TEC_WBLOCK2 in the itypedef.cpp file.

Nope, it’s equivalent to IF_SPEAR. GlyphGryph removed rapid attack from the pointy spear when he moved it to JSON.