Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (731)
Games in Android Showcase (217)
games submitted by our members
Games in WIP (799)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Fully Data Driven Skill System  (Read 1493 times)
0 Members and 1 Guest are viewing this topic.
Offline tariqbroadnax

Junior Devvie


Medals: 1
Exp: 3 years



« Posted 2017-03-13 07:14:12 »

Anyone have any tips for this. I'm pushing through but things are looking shaky.

So far, i have PassiveAbilities and ActiveAbilities.


PassiveAbilities apply GradualEffects to one or more targets, optionally after some event.

I have a TargetSupplier class which takes in the ability owner and produces targets. For example, I could have it return all people in the same party as the owner.

I also have a EventListener which can be polled to determine whether the corresponding event has occurred and reset to begin listening for the event again.


Now for the harder thing, ACTIVE ABILITIES

At the top is hierarchy is the ActiveAbility which supports cooldowns, mana cost, stocks, and barrages. I also partially support levels but I am still not sure whether i will leave this.

There are three types of ActiveAbilities: BasicAbilities, PointAbilities and EntityAbilities. BasicAbilities require no additional data to be cast. PointAbilities require a Point. EntityAbilities require an entity. That is, the only difference between the types is the data they require. Consequentially, this is the interface that the PlayerController interacts with.

Each of these sub-types, have two types: EffectAbilities and SpawnAbilities. EffectAbilities apply some effect using some target generated with available data. The TargetSupplier comes into play again here, except there are 3 TargetSupplier classes that take in corresponding data (Point, Entity, or nothing). SpawnAbilities...,you guessed it, spawn entities. These entities, in turn, apply effects. For example, a SpawnAbility might create a bullet that applies a damage effect when it collides with a monster. SpawnAbilities have a AbilityEntity, the entity being spawned, and a SpawnStrategy, a strategy for determining where to place the AbilityEntity and how of them to create. Again there are 3 types of AbilityEntities and 3 types of SpawnStrategies that take in the corresponding types of data (Point, Entity, or nothing).


Here are some problems I am facing:

1. Naming. If you have a better name for anything, I am all ears.

2. There are 3 types of ActiveAbilities, TargetSuppliers, SpawnStrategies, and AbilityEntities. Something about this feels unsettling. Maybe because all 3 types are very similar. I mean, I created 3 types because each type takes in different data (Point, Entity, or nothing). As a OOPist, I feel obligated to make them different classes. To help satisfy myself, I've tried to collapse them where the Entity type is also a Point type and a Point type is also a nothing type. But, a small part of me keeps suggesting that I make 1 type that takes all possible types of data where they might be null.

3. Type safety. I am using an ECS. I know for sure that these are inherently not type safe. I accept that. But, I am eventually going to make an editor. I just do not see it going well because I have to manually make sure that the editor does not allow changes to entities that violate types. And, that is only after I make sure all code is working. Sounds difficult and error-prone.  >:|

4. Abstraction. Let say I want to make a character that uses guns and bigger guns. Or maybe a character that use weapons. Both are very possible in my system, although I may make a tweak here and there. But, neither is easily identifiable because of the metaphor I set up. How many people would guess that attacks and guns would fall under the term, abilities? When I think of abilities, I think of spells. Simplicity is key in a lasting project and I wonder if my system is too complicated. Tbh, this probably isn't the biggest problem because I will almost surely make external data structures that work with abilities to achieve the desired effect. For example, I make make a combo class that changes switches out abilities based on the current combo. I therefore am not forced into the current metaphor.

5. Placement of Data. Let's say that I want a projectile to apply an effect with it collides with a monster. I have a RigidBodyComponent that takes in CollisionResponses. For sure, I am going to have to add one. Should I use CollisionResponse called ApplyEffects that stores and applies effects or should create another EntityComponent called EffectBodyComponent that store effects and adds a CollisionResponse that applies its effects. Obviously, the former is a more direct way of doing this. But within the class hierarchy, the latter is one level higher. Also logically speaking, if I wanted to find the effects that a projectile applies, does it really make since to have to look inside the RigidBodyComponent's CollisionResponses.


If anyone cares, I am trying to make top-down, open world, coop game. I want a really good combat system. Currently, I am taking inspiration for mobas. That's because these types of games are very creative about effects. Next I will study and incorporate fighting games. I definitely want simple combo attacks. If anyone knows any good articles on making combat systems, I all ears.
Offline 65K
« Reply #1 - Posted 2017-03-13 13:02:05 »

I am unpolite and answer with questions:
Why do you want it fully data driven ? That means you don't want to program individual behaviour ?
Why do you use an ecs ?
What do you do if you need to spawn more than one entity and while doing so need both a t hand ?
You say you want separate classes because of different data. A better motivation is individual behaviour.
What s your overall goal ?



Lethal Running - a RPG about a deadly game show held in a futuristic dysoptian society.
Offline smtgzlgn

Junior Newbie





« Reply #2 - Posted 2017-03-13 15:25:25 »

If you want you can create a Component interface for connecting components with each other.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tariqbroadnax

Junior Devvie


Medals: 1
Exp: 3 years



« Reply #3 - Posted 2017-03-13 16:10:25 »

Quote from: 65K
Why do you want it fully data driven ? That means you don't want to program individual behaviour ?

I just do not want to hard code any abilities because I will eventually make an editor. I am still programming behaviour but i am making it general enough for it applied to many scenarios.

Quote from: 65K
Why do you use an ecs ?

I use an ECS because my entity hierarchy would be too complicated without one.

Quote from: 65K
What do you do if you need to spawn more than one entity and while doing so need both a t hand?

SpawnStrategy also decides how many entities for spawned. To be honest, it is akin to a particle emitter class, except it does not bother with the internal of the AbilityEntity.
If the AbilityEntity requires information about other spawned entities, then I have no other choice but to make the SpawnStrategy pass the info. But, I would rather not do that because I either have to make it that all AbilityEntities can parse that information or the SpawnStrategy would have to assume information about AbilityEntity.

Quote from: 65K
You say you want separate classes because of different data. A better motivation is individual behaviour.

I don't understand. By taking in different data, different behavior is assumed. You can't create a homing projectile with a stand-alone point.

Quote from: 65K
What s your overall goal ?

A cleaner, more elegant design.

Quote from: smtgzlgn
If you want you can create a Component interface for connecting components with each other.

Which problem are you talking about?
Offline smtgzlgn

Junior Newbie





« Reply #4 - Posted 2017-03-13 16:28:20 »

I am talking about 5 and 2 problem
Offline tariqbroadnax

Junior Devvie


Medals: 1
Exp: 3 years



« Reply #5 - Posted 2017-03-13 16:42:49 »

I am talking about 5 and 2 problem

Sorry but I am not seeing how this solves the problem. Can you describe it some more.
Offline 65K
« Reply #6 - Posted 2017-03-13 17:47:09 »

Simplicity is key in a lasting project and I wonder if my system is too complicated.
IMHO the setup is clearly too complicated and not simple at all. Might lead to a scattered system which is hard to follow and debug.
But each to their own - my focus is on readabilty and maintainable simple code.
I wonder if you have everything you need at hand whereever you interact with the game world.

Anyway, have fun Wink

Lethal Running - a RPG about a deadly game show held in a futuristic dysoptian society.
Offline tariqbroadnax

Junior Devvie


Medals: 1
Exp: 3 years



« Reply #7 - Posted 2017-03-13 20:23:45 »

Simplicity is key in a lasting project and I wonder if my system is too complicated.
IMHO the setup is clearly too complicated and not simple at all. Might lead to a scattered system which is hard to follow and debug.
But each to their own - my focus is on readabilty and maintainable simple code.
I wonder if you have everything you need at hand whereever you interact with the game world.

Anyway, have fun Wink

Yeah, I've decided to collapse the 3 types into 1 type. This type takes in either a point, entity, or nothing. Its up to code that relies on this data to determine if they can do anything or not.

For example, if i create a homing projectile and give it no input, obviously it would not be able home into anything that relies on a target. But, it can home into anything that relies on caster because there is always a caster. I might make an ability that spawns 3 projectiles that home into members of the caster party and heal them when it collides.

I made this decision because I thought of another type of ability, ActionAbilities. Actions are anything an entity can do: move, fight, fish, farm, etc. This is a organizational choice because I technically could have included this all in Effects. Specifically, I am going to use it for the caster to gives commands to summons, pets, ai, etc. If I continued with my previous system, I would have had to make 3 types. Yeah....., I don't want to do that.
Pages: [1]
  ignore  |  Print  
 
 

 
Archive (339 views)
2017-04-27 17:45:51

buddyBro (537 views)
2017-04-05 03:38:00

CopyableCougar4 (984 views)
2017-03-24 15:39:42

theagentd (1019 views)
2017-03-24 15:32:08

Rule (994 views)
2017-03-19 12:43:22

Rule (976 views)
2017-03-19 12:42:17

Rule (974 views)
2017-03-19 12:36:21

theagentd (1073 views)
2017-03-16 05:07:07

theagentd (995 views)
2017-03-15 22:37:06

theagentd (770 views)
2017-03-15 22:32:18
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!