[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]

/agdg/ - Amateur Game Development General

AGDG - The Board

Catalog

See 8chan's new software in development (discuss) (help out)
Infinity Next update (Jan 4 2016)
Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Embed
(replaces files and can be used instead)
Oekaki
Show oekaki applet
(replaces files and can be used instead)
Options
dicesidesmodifier
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, swf, pdf
Max filesize is 8 MB.
Max image dimensions are 10000 x 10000.
You may upload 5 per post.


Welcome to AGDG, have you ever made a game?
See also: /ideaguy/ | /vm/

File: 1453259968453.png (725.86 KB, 1006x911, 1006:911, Buffs.png)

f2e766 No.24891

Hey /agdg/ I'm working on a game with turn based RPG combat and have hit a wall with the system to use for complex status effects. While just changing stats seems simple enough I have issues with wrapping my head around how to handle effects that e.g. change how combat works while allowing them to interact with other equally complex effects when both try to manipulate the same event.

As an example let's say I have an attacker with a buff that makes him spawn a minor demon each time he damages an enemy in melee and I have a defender that has a magical shield that prevents X damage before dissipating. Both buffs would get a call when the damage portion of combat starts and should ideally modify combat behavior while playing nice with each other. How do I implement something like that without writing cases for each possible status effect combination? Because that would be a nightmare to implement in any case and flat out impossible with too many effects in the game.

93859a No.24906

>>24891

I'm not a programmer by any means, but, my assumption would be to write a second combat code that is mean specifically for that effect and have it activate when the player is afflicted with whatever status you are giving them.

I really have no clue though, but hopefully this helps in some way


1150e0 No.24950

You must rewrite the way damage is dealt.

I'm on a phone, ignore shitty syntax

Create a class called DamageIstance or something like that,with the following fields

>source

>target

>bool ignored

Use the construction method to execute the attack and check among the target and source status of they want to modify the damage

DamageIstance(character tar, character sou ) {

Target = tar

Source=sou

Ignored =false

Foreach (status sts in sou.status)

Sts.recivedDamageInstance(this)

Foreach (status sts in tar.status)

Sts.recivedDamageInstance(this)

If! Ignored

Apply()

}

Then every time you need a different kind of attack you extend that class, for example

Class normalattack extend DamageIstance {

Int damage

Public normalattack (tar, sou, dmg) : base (tar, sou) {

Damage =dmg

}

Void apply () {

Target. Hp-=damage

}

}


3f73c5 No.24957

File: 1453493638110.gif (492.74 KB, 500x281, 500:281, Consider Za Warudo.gif)

You could try somekind of event system where for example you throw out something akin to a DamadeDealtEvent which stores the amount of dmg,attacker e.t.c. and then have the status effect react to it.

Note that I am mostly bullshitting out the ass right now.


033abf No.24960

>>24891

i decided to implement what you were asking.

i hope you use unity.

https://github.com/mushinNoStar/unityUtils/tree/master/

in the example folder there is a really basic shield and character.

to use that code you only need to

>extend the standard character

>create the interaction you need in you battles

>create the status you need in battle

it shouldn't be too hard to change it even in the case you need to save a character status.




[Return][Go to top][Catalog][Post a Reply]
Delete Post [ ]
[]
[ home / board list / faq / random / create / bans / search / manage / irc ] [ ]