Hime-Works / Requests

Bug reports and requests that may require longer discussions and is not suitable to leave on the blog
http://himeworks.com/
GNU General Public License v2.0
7 stars 9 forks source link

Crafting system affix add-on #111

Open HimeWorks opened 10 years ago

HimeWorks commented 10 years ago

I have no interest in writing a crafting system from scratch, so I'll be adding some extra functionality to an existing crafting system.

The basic idea is to allow you to work with affixes. In any crafting system, users need a way to specify the following

Let's start with an example. Suppose I wanted to create an upgrade system using a crafting system. I have a recipe for Hand Ax +2, which requires Hand Ax +1 and an upgrade crystal.

Using my affix system, you would create a suffix called +1, and if you attach it to a Hand Ax, that results in a weapon called Hand Ax +1.

Now, instead of creating separate weapon entries for your hand ax to account for every possible level, you would simply mix and matches weapons and suffixes.

Consequently, the crafting system needs to check not only the base material, but optionally the affixes as well. Similarly, you need a way to specify the affixes that will be added to the output.

Some other details:

  1. Crafting systems need to have an add-on to support instance items. The ID that you write as the material requirement should be a template ID, not an item ID.
  2. If no affix is specified as a requirement, then the crafting system will only check the template ID. For example, if you need a Hand Ax, then it doesn't matter whether you use Hand Ax, Hand Ax +1, Hand Ax +232, etc.
  3. If you require that the ingredient does not have an affix, then you need to explicitly set the prefix and suffix to 0 (which means no prefix/suffix)

Our upgrade system is not complete yet with the above changes. If you pass in a Hand Ax +1 and an upgrade crystal, you will receive a Hand Ax +2. But this is the same hand ax, except with a new suffix! It's not a new weapon.

This will require some thought. Basically, you want to indicate that it is a change in affix, and not the creation of a new object.

Roguedeus commented 10 years ago

Might I recommend Bubbles Ogre Crafting? :))

If you managed to complete this any time soon, I'll most definitely do what I can to troubleshoot and implement it in my system. Speaking of, did I make the entire instance support code available here yet?

HimeWorks commented 10 years ago

I like the way his crafting system is set up, using items for recipe books. That makes sense from an RM design POV because if you ever wanted to gain a recipe book...well there you go. And then you can have your crafting scene pull a list of recipes that you have, and everything just works out so smoothly.

I think with the option parsing it will also make it easy to add affix requirements and results. Specifically for an upgrading/forging system where you usually take ONE equip and improve THAT equip, it is easy to deal with: you simply specify the "base" equip ID, and the engine will figure out which one should be used as the output.

For my upgrade add-on, where you take a Hand Ax +1 and an Upgrade Crystal to upgrade it to Hand Ax +1, you would specify the input as

weapon: 1; suffix: 72

And for the output, you would indicate that you are doing an affix operation and specify what the affix is

affix: true
suffix: 73

The actual tags would depend on what the crafting system uses, but for the most part, it shouldn't be too bad.

Basically, this mechanic is what I would call "affix operations".

You can set up your recipes so that you have something like

{any weapon}
Thunder Crystal
Result: {any weapon} of thunder

{any weapon}
Fire Crystal
Result: {any weapon} of fire

However, this will require additional options to specify "any weapon". As usual, it is up to the devs to figure out how to set up their recipe books.

Selchar commented 10 years ago

If you're going for a "linear" progression route, such as the +1, +2 example, then it would be easier to piggy back off of an equip leveling script. Otherwise yeah, I'd like to see something to go along with Bubble's Crafting, tho I'm sure fixing it up to work properly might get complicated.

As an example of linear progression affixes, I made the following script a week or so ago. https://drive.google.com/file/d/0BywhvOtY4_H9ZnFTS1BFUWtEckU/edit?usp=sharing

It let's me have affixes based on an equip's level, different for each equip. The affixes given persist until a level with a new affix is reached, and disappears if an equip could "de-level". You can think of it as inspiration should you try something involving linear affix progressions. It was more or less my way of adding features based on levels without complicated notetags and stuff.

HimeWorks commented 10 years ago

It was mainly just an example. The general idea is to be able to assign affixes to an equip using the crafting system. Linear progression is a particular use case one could implement.

Roguedeus commented 10 years ago

Have you considered creating a use item on item script instead?

Say you flag an item to open an application window, instead of run a common event, that lets you select an equipable item from a list. The selected item gains whatever the used item designates as an upgrade. This way, normal crafting could be used to make the item, and it would side step the majority of the crafting system hacking.

Roguedeus commented 10 years ago

Example: +5 ATK Gem is crafted like any other item. But when used, it allows you to select the target weapon. Selecting, destroys the gem, and grants the Affix (+5 ATK) to the weapon.

May be a lot easier with less troubleshooting.

Equippables can also be flagged as upgradable. So you they wont show up on the window list.

Hell, you might even just make a generic script that can be used in whatever way needed.

HimeWorks commented 10 years ago

"Instead" lol. A forging system where you insert gems into a weapon can be done, and it'll be up to other scripts to determine how those gems will be used.

The basic idea behind having recipes can be used, but I probably wouldn't overload a crafting system with that. If you had a forging system, sure.

I would leave that to a separate script. That's a different use case and would have its own topic.