Jump to content

  • Log In with Google      Sign In   
  • Create Account

Toriath

Member Since 01 May 2013
Offline Last Active May 31 2013 02:35 AM

Posts I've Made

In Topic: Need Help with Boundless Crafting System

22 May 2013 - 02:23 AM

Well it will Work, but i just think there are easier (more memory efficient) ways of storing the data. IF you do go with this approach, then make sure your 'Object' doesn't store and graphics data E.g. Meshes / Textures or you will be storing 10 Meshes/Textures in the object which are never used and just sit there using Memory.

I didn't even think about Textures by now.^^ Well, I am going to work a little on this now and when I got a little progress and/or more questions I will come beck here. :D
thanks for now @all.
Toriath


In Topic: Need Help with Boundless Crafting System

22 May 2013 - 01:27 AM

Hmm, this looks okay, but what if an Iron Sword could be crafted with lets say 5 different kinds of handles and 7 different kinds of blades? (f.E. sharp blade, rusty blade, long blade...)
I'll just go and tell the Sword to use 1 blade and 1 handle and make each "kind of handle", a subclass of handle?

 

One way I tend to look at 'objects' is that nouns are objects and adjectives are properties of those objects.  So I would look at that as only have 1 kind of blade, but that blade has an assortment of different properties.  Inheritance should always be used frugally.

 

Okay. Instead of creating lots of subclasses for "Blade" I am going to give "blade" an String-array (f.E. String[n] specials = {"special 1","special 2"," special n"}), and the craftingsystem will identify these?

 

Well are you really going to need them?

 

if you have todo this every frame to check what type of dmg todo:

if(allSpikesAreFireDmg)
  return 500000000000 fire dmg.

 

then yes, you'll need them.

 

Personally again, i'd go for once an object is made with spikes, have a DamageType enum, and jsut assign it.

public enum DamageType
{
    Common = 1,
    Fire,
    Ice,
    Shadow,
}
public enum WeaponBonus {
    ArmourPen = 1,
    WeaponDamage,
    MaxHealth,
    MagicResistance,
    MagicDamage,
}

So lets say we have a 2x Spikes with the follwing properties, and 1 Core with the follwing property:

 

 

Spike: 8 WeaponDamge, 1 max Health
Core: 8 WeaponDamage, 4 magic Resistance
 
//We can store in it a Dictionary (HashMap in java?) in each component an just sum it up in the Weapon.
HashMap<WeaponDamage, int> BuffsTable;
 
//Spike
HashMap<WeaponDamage, int> spikeBuffsTable = [WeaponDamage, 8][MaxHealth, 1]
 
//Core
HashMap<WeaponDamage, int> coreBuffsTable = [WeaponDamage, 8][magicResist, 4]
 
//BuffsTable summed
= [WeaponDamage 16, maxhealth 1, magicResist 4]
 

 

I think I should take a deeper look into enumerations and afterwards read this again. ^^
Well the reason why I want to store the Objects is, that there may be the ability to disassamble the Shuriken and to regain each part with its properties.

 

 

This might be a little off, but you could also go in the area of material used / weight of material... So say you use a lighter material 10x spikes would work out good for distance but use a material a lot heavier than construct the object with 10x spikes and you end up with a shuriken that weighs too much to be really effective or not good at long distance, etc... Just a little food for thought since you are looking to develop a nice crafting system.

 

Sounds good. As the crafting system will be used in a game later on, I think i know how to implement this in an interesting way :) Thanks for that Idea.


In Topic: Need Help with Boundless Crafting System

21 May 2013 - 10:35 AM

In terms of Creating Weapons, I would have a base "WeaponBase" class which knows what "Component" object(s) it needs to make the Weapon and use inhertiance so: class UberLongSword extends WeaponBase.

 

So a Iron Sword knows it needs 4x Iron Ingots and 1xWooden stick to make.

 

Hmm, this looks okay, but what if an Iron Sword could be crafted with lets say 5 different kinds of handles and 7 different kinds of blades? (f.E. sharp blade, rusty blade, long blade...)
I'll  just go and tell the Sword to use 1 blade and 1 handle and make each "kind of handle", a subclass of handle?

 

Hmm your Shuriken object doesnt need to hold 'n' Spike objects, Thats a waste of space.

 

Personally I'd just have a a yield function in the Shuriken object (or Deconstruct) which returns 'n' number of NEW Spike objects and a core.

 

So for instance:

 

Stage 1: Player inventory

 

4 x Spikes
1 x Core

 

Stage 2: Player visits a workbench turns the 4 spikes and 1 core into 1 Shuriken Object.

 

Stage 3: Player receives 1 Shuriken, their inventory is now

 

1 x Shuriken

 

The Shuriken object holds the number of spikes used to create it, (as an INTEGER) and then when the player deconstructs the object

 

 

object[] Deconstruct()
{ return 1x core and 'n' Spikes. }

Well, that would work, but what if the shuriken is build out of different spikes? Maybe one grants firedamage and another armor penetration? Would theses Objects still be waste of space?

Maybe I didn't pointed it out before, but there wont be predefined weapons. So a Sword is not only handle + Blade

What I want is "Sword = Handle + Blade + Optional Items (Power stones f.E.). The Swords Name, attributes etc. shall be generatet out of its materials stats.
If i got a big handle(2 att per sec) + long, sharp ironblade(90 damage, Armorpenetration, durability) its going to be a "Sharp Twohanded Ironblade of fast devastation"

Thanks for your answer by the way smile.png

Toriath


PARTNERS