Archery Expansion First Version Out

Oh man, I missed the updates to this thread somehow.

Thanks for updating the code::blocks guide, I’ll get to it as soon as I finish with some things in Terraria that I’ve started.

Once I get it working, I will post the update for general balance feedback.

In any case, you can decompile the windows version :O?

It’s generally not advisable to decompile open source projects - you’ve got the source right there, already.

Unfortunately, it’s not currently possible to test Flare’s suggesiton without recompiling the source, because ranged weapons can’t be read from data files yet, and recipe support isn’t in any of the precompiled versions.

just wanted to say a quick thanks to those working on expanding the archery department. once my character has a longbow he uses it almost exclusively - so it’s good to see he’ll have his options expanded. also, are slings making it in as well? they’re probably the easiest weapon to make IRL outside of a sharpened stick. saw mention of them in posts but didn’t see any code…

I was thinking about slings, but I currently have no idea on how to make pebbles and single shot exclusive to slings and slings alone.

I could put those in with what I currently know, it would probably result in crossbows, or bows being able to use pebbles as ammo as well as slings. For the Atlatl I think it would be a bit more permissible due to a bolt just being a slightly smaller dart that the atlatl throws.

Ammo uses the terms like AT_ARROW, or AT_GUN, or AT_BOLT. As far as I know, I’m guessing that I just add the tag somewhere where the rest of the AT_Stuff exists, in any case it’s one of the first things I’ll test after making sure the code actually works.

Yeah, that’s essentially what you have to do, is add AT_SLING or something to that list in itype.h, and then track down the other instances of AT_ARROW and see if you need to add your new ammo type there as well (that step shouldn’t be necessary, but our code is wonky).

That second step will be easier if you’ve got a way to find all the occurrences of a specific string of characters in a given set of files. But, since you’re probably on Windows (which doesn’t have a built-in way to do that, sadly), here’s the list of files to check:

item.cpp, itypedef.cpp, itype.h, map.cpp, ranged.cpp

If you’re using CodeBlocks on Windows, it has a “find in files” search option, which will return you all the instances in a given directory.

There are also some AT_* lines in game.cpp.

Thanks for the tips everyone.

Good news is that I’ve been able to compile the source 8). Hopefully I should have this stuff compiled with the source by tomorrow if I haven’t made any coding hiccups.

Bit of an update.

All the items seem to work perfectly in the game. All the bows fire, and all the arrows do what they seem to do.

A bit of a problem with the recipes last night, trying to rebuild the project and adding the recipes.json manually gave me an error when it finished compiling.

I can think of several possible reasons why.
Firstly, it could have been that I shouldn’t have put the recipes.json into the project manually. After all, the other default recipes seem to get in the game alright. This might diverge into two possibilities though, that rebuilding would not take into account the changes of recipes.jason, and I would have to recompile all over again, or it does take it into account seemingly outside of what it says in the log.
Secondly, it could have been because I forgot I had the previous cataclysm exe build open running in the background.

Gonna try and build it again to see if there are any problems.

EDIT: Nevermind, it seems all I need to do is hit the build button every time for a speedy inclusion of any changes I make. That rebuild option is misleading :U.

Recipes seem to show up in the game so far. Text is going off the edges, I need to fix that.

The recipes.json file should get re-loaded every time you run the executable (you shouldn’t need to recompile).

At least, if you’re running the executable from within your file manager, that’s how it should work. If you’re running it from within your IDE, it might be doing odd trickery somehow.

Some crafting recipes are showing up, but only from the bow-like object to the 30kg compound bow. On top of this, everything below the 30kg compoundbow seems to be missing from the crafting menu, even with skills maxed :O.

As for the recipes.json reloading each time. Entirely removing the bow recipes seems to make the executable stop working. The box pops up, but it’s a black screen.

The 30kg_compound bow and 40kg bow seems complete enough, there’s no extra brackets that I could find at the moment.
I’m going to try replacing the bows recipes and removing the arrow ones to see if that works.

Edit: Well that didn’t seem to do anything :p.

I think this part might be the reason why my crafting menu is borked:

In the developer FAQ.

  1. Edit itypedef.cpp. Macros are used for all item types, and they are pretty
    self-explanatory. Be ABSOLUTELY sure that you insert the macro at the same
    point in the list as you inserted the identifier in item_id!

What does that part mean?

The itypedef and itypes thing was a holdover from the old code, so it’s not relevant anymore. Guess that needs to be removed from the dev FAQ.

Apart from missing brackets, extra commas at the end of a json array list can also mess things up. I’m thinking that might be what’s causing your problem.

Okie doke, I’ll look for that in recipes.json.

Edit: I think I found it.

There’s a comma missing from the last two components of the compound bow, specifically the the string material component missing a comma, above the scrap component.

EDIT 2: Ok, now it’s just a black screen when I’m starting it. So I guess there’s an even bigger issue after that comma.

I’ve been compiling all night, the executable doesn’t seem to reload recipes.json, instead giving a black screen when I change it, so recompiling seems to be the only option there.

On another note, the compile time was about 8 minutes shorter than before I put in the comma in. What sort of error would do this?

Good news everyone!

I have limited the area where the issue has been cropping up.

It wasn’t the bow recipes, the options of Code::Blocks, or code block’s compiling issue with recipes.json.

It’s the arrow recipes that are causing the problem. Removal of them fixed everything (aside from the lack of arrow recipes).

Well that was a day and a half wasted.

I think I’ll be able to trace the issue and fix it quite soon now.

Ah, JSON parse errors. Now that I know which block to paste, I’ll test it in the current dev version (which tells you what kind of JSON error happened, and where).

And… it looks like you’ve got 3 extra trailing commas in the tools/components of the exploding arrow.

Thank you for all your help Soron. I seem to have finally got everything under control, lol.

Though of course I only found 2 outstanding commas instead of the three you mentioned :o.

The code works as far as I know, I fixed up some IDs like “stone” being “rock”, and a few mismatched components. It all seems ready to go.

As promised, here is the first version of the mod. Aside from a few spelling errors (if you find any please inform me), the recipes and items seem stable enough.
https://dl.dropboxusercontent.com/u/120202176/Downloads/Cataclysm-DDA-master%20(B%26A%20mod%20Version%201).rar
7.3mb

The next phase would be doing some cosmetic work along side balance, since there doesn’t seem to be an equivalent 30kg bow without mechanical know how at the moment. Testing of AT_stuff will also commence.

as the 52 item slots will remain AFAIK

Erm… 52 item limit is enlarged to 70-something as of 0.4, specifically it’s now this list of characters:
“abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!”#&()*+./:;=?@^_{|}"

I have a plan to maybe enlarge this some more, by allowing the player to input a list of all valid keys on their keyboard, and having the various menus draw from that. (some keys have been trimmed from the list because several types of keyboards don’t have that key).

RE: the different bow types in general, love it, I don’t see any reason not to include these in the game, especially any of them that are crafed-only as opposed to spawning somewhere.

Re: slings/atlatl, Alpha16 has added prototype-ish versions of a sling, and is working on an atlatl. The direction is a bit different, with the goal of being able to use slings to throw any object that will fit in the sling, and being able to use an atlatl to throw any “spear-like” object instead of having specific ammo for each of them.

re: stats divided between bows and ammo, I think I agree with Soron that in the long term we want more specific handling for bows/slings/etc as opposed to shoehorning them into the guns category. Short term though, we might want to instead just add a range modifier to guns, have the range of arrows be minimal, and have most of the range bonus come from bows. (this would be a very simple code change)

[quote=“Kevin Granade, post:36, topic:837”]> as the 52 item slots will remain AFAIK

Erm… 52 item limit is enlarged to 70-something as of 0.4, specifically it’s now this list of characters:
“abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!”#&()*+./:;=?@[]^_{|}"

I have a plan to maybe enlarge this some more, by allowing the player to input a list of all valid keys on their keyboard, and having the various menus draw from that. (some keys have been trimmed from the list because several types of keyboards don’t have that key).[/quote]

is it possible to add F1 to F12 keys to the game ? All keyboards have them AFAIK.

Looks like we can indeed add them on linux at least, they are KEY_F0 through KEY_F12, have to reasearch whether they are also available via catacurses. No totally sure what we want to use them for though, especially since they are frewuently mapped to various things by DEs and WMs. (mine does for example)

Hmm, taking a closer look at the proposed bow stats, I find it odd that the only benefit of higher draw weight bows is that they have increased accuracy and decreased draw time. Those are the two things that I’d expect not to be improved with higher draw weights, and possibly to worsen somewhat. Probably better to give higher draw weight bows more damage and range (when range is implemented). Accuracy improvements by some class of improvement could still definitely be a thing, of course.

Yeah, I’ve got an item on my todo list to add ranges to guns (although I haven’t started on the coding yet). Easier fix, as you say.

[quote=“Kevin Granade, post:36, topic:837”]> as the 52 item slots will remain AFAIK

Erm… 52 item limit is enlarged to 70-something as of 0.4, specifically it’s now this list of characters:
“abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!”#&()*+./:;=?@^_{|}"

I have a plan to maybe enlarge this some more, by allowing the player to input a list of all valid keys on their keyboard, and having the various menus draw from that. (some keys have been trimmed from the list because several types of keyboards don’t have that key).[/quote]

That is so awesome to hear.

Re: slings/atlatl, Alpha16 has added prototype-ish versions of a sling, and is working on an atlatl. The direction is a bit different, with the goal of being able to use slings to throw any object that will fit in the sling, and being able to use an atlatl to throw any "spear-like" object instead of having specific ammo for each of them.

I’d be more than glad to leave the categories of slings and atlatls, seeing as someone with more coding experience and goals than I are working on them.

Isn’t the damage value only linked to the bow’s melee damage and not the projectile one?

Giving the bows better reload speed and accuracy is the only thing I know that will make them better than cruder bows. As a culmination of bow skill and physical conditioning that might be entailed by the archery skill. That’s obviously not a very good choice though, as there are already in-game advantages to improved archery skill.

Another way I can give the more powerful bows is possibly assigning them only the heavier ammunition. A bow with a 50kg draw can throw a much heavier arrow than a small game hunting bow ever can. The main issue is making it so that the 50kg bow can also throw everything below the heavy arrow that only that bow can throw, of which I do not know how to do.