devolution

Author Topic: General Discussion  (Read 3821828 times)

0 Members and 28 Guests are viewing this topic.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8355 on: September 07, 2016, 07:53:17 AM »
It should. I actually considered renaming the field but decided to leave it until next major code refactoring. There is too much on the plate right now, I've also close a number of issues that called for plain code improvements, there is no time for that, game is getting more complicated.

Xela, you destroyed items evasion just now  :D

lmao, fix it :)
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8356 on: September 07, 2016, 08:05:47 AM »
Just pushed fix for absorption triggering be events. Poison should work fine now.

I am going to do skills sorting next, it has to be fixed all over the GUI and in several places in code so that's gonna take a while. Also gotta figure out a good way to get that done with all the recent changes.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8357 on: September 07, 2016, 08:16:47 AM »
Spells are sorted by element, which makes ME spells look out of place. I'm not really sure what to do with them without using advanced gui, where you have to select an element first, and then it shows you all spells with this element, including all ME.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8358 on: September 07, 2016, 09:02:13 AM »
I am going to do skills sorting next, it has to be fixed all over the GUI and in several places in code so that's gonna take a while. Also gotta figure out a good way to get that done with all the recent changes.

Proved to be a lot simpler than I expected! We do not sort them by instance, prolly was worked out of the game during last major code refactoring.

You can now safely create any skill you like. I'll take a look at Be interface, see what can be done for ME skills.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8359 on: September 07, 2016, 10:02:32 AM »
You can now safely create any skill you like.
No I can't.
Not to mention that I'm gonna tie skills to weapons right after making them, so I need that ability too.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8360 on: September 07, 2016, 10:10:01 AM »
No I can't.
Not to mention that I'm gonna tie skills to weapons right after making them, so I need that ability too.

? I don't follow, are you asking for explanation for to build gfx for skills that look differently from left and right or is there something else?
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8361 on: September 07, 2016, 10:14:57 AM »
First of all, I've yet to see a skill that needs that special field you mentioned. So yeah, I don't even know where to look for an example.

You also haven't changed the comment for P2P class, which leads me to believe it's not ready.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8362 on: September 07, 2016, 10:35:29 AM »
First of all, I've yet to see a skill that needs that special field you mentioned. So yeah, I don't even know where to look for an example.

You also haven't changed the comment for P2P class, which leads me to believe it's not ready.

Let me see what you did and what goes wrong with it. Class is ready, I've deleted the comment. I just updated the code through mass renaming, not went over it line by line.

There should be examples of everything...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8363 on: September 07, 2016, 10:58:19 AM »
You haven't fixed the issue with default attacks I mentioned. If a character has a default attack other than fists, equipping a weapon does not remove it.

Let me see what you did and what goes wrong with it.
You said something is wrong with one of new skills when it's used by enemy, I have no idea what are you talking about  :D
You even haven't mentioned the name of the skills, I'm clueless here.
« Last Edit: September 07, 2016, 11:10:38 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8364 on: September 07, 2016, 11:17:51 AM »
You haven't fixed the issue with default attacks I mentioned. If a character has a default attack other than fists, equipping a weapon does not remove it.

Right! I completely forgot :(

You said something is wrong with one of new skills when it's used by enemy, I have no idea what are you talking about  :D
You even haven't mentioned the name of the skills, I'm clueless here.

I forgot as well  ::) It was really late, I was a bit drunk and too tired to code so I tested the BE. Some new attacks looked off and one crashed due to missing art.

Let me check out the skills first. I'll add new option to setup base attacks to all chars after that.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8365 on: September 07, 2016, 11:27:11 AM »
Some should crash, yeah. Because I changed folders structure a few times while making webms, I'll fix them of course.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8366 on: September 07, 2016, 11:28:46 AM »
Ok, I'll write an explanation on how to create gfx effects because you're doing it wrong. Most attacks are broken when they come from right side because of that. I thought I wrote it already somewhere... gonna check for it first.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8367 on: September 07, 2016, 11:34:23 AM »
You have close to zero comments in both assets and content-classes rpys, of course I'm acting blindly  :)

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8368 on: September 07, 2016, 11:49:04 AM »
I tested fire arrow skill, which uses shatter gfx on death, which uses the infamous HitlerKaputt animation class.
When you kill mobs, they shatter all right, but at the same time the whole shattering cloud shakes, and it looks terrible.

It happens because the sprite damage effect, shake gfx, works at the same time as shatter gfx, and if you remove the shake part, shattering begins to work properly.

I could make the death effect work only after shaking ends by setting big initial_pause. But it looks weird when they explode after 1.5 seconds of shaking. It looks fine for the ice spell though, zero prism,  where damage effect is texture replacement. So we probably should have an option to cancel damage effect if death effect is about to play.
« Last Edit: September 07, 2016, 11:57:00 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8369 on: September 07, 2016, 12:26:11 PM »
Ok, so we use this system to "aim":

Code: [Select]
                aim = self.main_effect["aim"]
                point = aim.get("point", "center")
                anchor = aim.get("anchor", (0.5, 0.5))
                xo = aim.get("xo", 0)
                yo = aim.get("yo", 0)

This is how you defined new attacks:

Code: [Select]
        SimpleSkill(u"Soul Blade", menu_pos=0, range=3, attributes=['melee'], effect=20, multiplier=1.2, vitality_cost=20, desc="Projects a huge blade made from the user's soul energy towards the target.",
                                           main_effect={"gfx": Transform("soul_sword", zoom=1.1), "sfx": "content/sfx/sound/be/soul_sword.mp3", "duration": 0.5, "aim": {"point": "bc", "anchor": (1.0, 1.0), "xo": -80}},
                                           target_sprite_damage_effect={"gfx": "shake", "initial_pause": .3, "duration": .5},
                                           target_death_effect={"gfx": "dissolve", "initial_pause": .5, "duration": .5})

This is the part that's important in main effects gfx context:

Code: [Select]
"aim": {"point": "bc", "anchor": (1.0, 1.0), "xo": -80}}
Reason why it is:

Most attack, especially the once that come from RPG Maker, are very plain and look exactly the same from both sides. Attacks like our Meteor (which you could have used for example), Same thing in the Ice element or Fist Of Bethel (strongest Earth Skill) are different (same counts for stuff like Arrows and FireBalls but they are setup to do the right thing by default). If you just play them like simple attack, they will look ok from the left but will look really bad from the right... It will look as if they are being from the left, just like if your party used them! Also if you used xoffset, it will work against you.

First, let me explain what the positioning means:

"point": "bc"
Point is where you aim the attack! Related to the target sprite. bc means bottom center... Other options are:

Code: [Select]
            center: center of the charcters image
            tc: top center of the characters image
            bc: bottom center of the characters image
            fc: front center (Special per row instruction (for offset) applies)

You'd usually use one of the top 3. This gives you a position of a point you aim at.

"xo": -80
This, can be used to offset the position as it is often required. yo is the other option for vertical offsets. It's all in pixels.

"anchor": (1.0, 1.0)

This is simple Ren'Py's anchor: https://www.renpy.org/doc/html/style_properties.html#style-property-xanchor

Once you got a point from two setting above, you can specify how the attack displayable (doesn't matter if it's a simple image, webm, animation or anything else) should be anchored to that image! So for example (.5, .5) will land it middle of the displayable dead on the point, your setting will land bottom, right corner of the displayable on the point and etc.

As you can imagine, for stuff like simple attacks, best setting would be:
Code: [Select]
"aim": {"point": "center", "anchor": (.5, .5)}
Like: Pick the dead center of a sprite and put the put the middle of the attack sprite right on top of it.


A lot depends in the displayable you're using, often it will require special offsets, sometimes it won't. So it's simple for simple attack... what we do with those "special" cases like Meteor is this:

Extra argument is added to the main gfx dict (not to the aim one):

Code: [Select]
        SimpleSkill("Meteor", menu_pos=12, attributes=['magic', 'fire'], effect=100, multiplier=6.0, mp_cost=15, range=4, true_pierce=True, type="se", desc="Summons flaming fragments of meteor.",
                                           attacker_effects={"gfx": "orb", "sfx": "default"},
                                           main_effect={"gfx": Transform('cataclysm_sideways', xzoom=-1), "sfx": "content/sfx/sound/be/fire8.mp3", "duration": 1.8, "aim": {"point": "bc", "anchor": (0.5, 0.1), "xo": 150, "yo": -370}, "hflip": True}, ...

"hflip": True
What it does is the following:

- It will horizontally flip the attack displayable (once again, no matter what it is).
- It will reverse horizontal offset ("xo").

With such attacks, you can never use anything other than: "anchor": (0.5, xx), because we do not reverse anchors. There should also be no good case when you need to use anything other than it because you can use offset property.


This is for SimpleSkill class...

Other classes:

ArealSkill: Instead of using gfx effect per character, we use one large effect to over the entire field. Point of aim will always be the dead center making "point" utterly useless.

P2P_Skill: Basically fireball, it follows it's own rules and flips the attack automatically.

ArrowsSkill: Similar with a couple of extras.

ATL_ArealSkill: This one is complex (and simple if you know ATL: https://www.renpy.org/doc/html/atl.html). Instead of using preset attacks, ATL is used to create the entire animation sequence. Main effect dict takes extra k/v pairs: right_args and left_args which will be passed to ATL function depending on which side the attack is coming from. We have two such skills: Water Blast and Ice Storm.

Code: [Select]
        ATL_ArealSkill(u"Water Blast", menu_pos=13, attributes=['magic', 'water', 'inevitable'], effect=200, multiplier=10.0, mp_cost=30, piercing=True, range=6, type="all_enemies",
                                                desc="Hits the taget with a massive water blast!",
                                                attacker_effects={"gfx": "orb", "sfx": "default"},
                                                main_effect={"atl": water_combined, "predict": ["water_attack", "water_wave"], "left_args": [1.8, -300], "right_args": [-1.8, 300], "sfx": "content/sfx/sound/be/water7.mp3", "duration": 1.6},
                                                target_sprite_damage_effect={"gfx": "shake", "initial_pause": 0.6, "duration": 0.9},
                                                target_damage_effect={"gfx": "battle_bounce", "initial_pause": 1.6},
                                                target_death_effect={"gfx": "dissolve", "initial_pause": 1.0, "duration": 0.5})

Code: [Select]
    image water_wave = FilmStrip('content/gfx/be/filmstrips/water_wave.png', (531, 213), (3, 3), 0.15, include_frames=range(7), loop=False)
    image water_attack:
        "content/gfx/be/animations/water_attack/00.png"
        pause 0.1
        "content/gfx/be/animations/water_attack/01.png"
        pause 0.1
        "content/gfx/be/animations/water_attack/02.png"
        pause 0.1
        "content/gfx/be/animations/water_attack/03.png"
        pause 0.1
        "content/gfx/be/animations/water_attack/04.png"
        pause 0.1
        "content/gfx/be/animations/water_attack/05.png"
        pause 0.1
        "content/gfx/be/animations/water_attack/06.png"
        pause 0.1
        "content/gfx/be/animations/water_attack/07.png"
        pause 0.1
        "content/gfx/be/animations/water_attack/08.png"
        pause 0.1
        Null()
       
    transform water_combined(xz, xo):
        # It's prolly a better design to work with the displayable directly using contains instead of replacing them with parallel...
        contains:
            "water_attack"
            xalign 0.5
            ypos 600
            yanchor 1.0
           
        contains:
            pause 0.6
            "water_wave"
            xalign 0.5
            ypos 650
            yanchor 1.0
            xzoom xz
            xoffset xo
            yzoom 1.8

You prolly want to play around with one of these attacks to see what's what or don't use this one.

FullScreenCenteredArealSkill: This one is simple, just show the attack displayable over the whole screen :D


===>>>
I'll fix two of your attacks and push so you have an example, you can tweak the others later.
Like what we're doing?