devolution

Author Topic: General Discussion  (Read 3821233 times)

0 Members and 50 Guests are viewing this topic.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #1485 on: January 24, 2014, 10:19:52 AM »
I'm totally owned by work this week, did I miss something? We are already making skills for BE without a new BE?  ???

LoL

CW does... but it's all within the same framework so whatever he creates today will be VERY easy to port. Also, it might be a while until we code a BE of our own (if ever). Jake's BE can be extended indefinitely, I still didn't study it for long enough to decide if coding a new BE will actually be faster than building upon old one.

Not mentioning that it offers a lot of different battle scenarios...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #1486 on: January 24, 2014, 10:31:52 AM »
Yeah, but don't we need, for example, elements for a start for both skills and items?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #1487 on: January 24, 2014, 10:49:35 AM »
Yeah, but don't we need, for example, elements for a start for both skills and items?

Yeap, but with modifications, there is no reason why Jake's BE can't handle that. Like I've said, it's all about balance :)
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #1488 on: January 24, 2014, 10:52:26 AM »
Then please create a thread for BE discussion. I guess it's about time.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #1489 on: January 24, 2014, 11:03:13 AM »
Then please create a thread for BE discussion. I guess it's about time.

Done: http://www.pinkpetal.org/index.php?topic=2670.0

We can discuss the topic, but we'll make final decisions post Alpha I expect.
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #1490 on: January 24, 2014, 01:57:18 PM »
Arena screen for the Alpha:




I'll start adding content and removing last bugs tomorrow...
« Last Edit: January 24, 2014, 02:22:47 PM by Xela »
Like what we're doing?

Offline CherryWood

  • Hero Member
  • *****
  • Posts: 643
Re: General Discussion
« Reply #1491 on: January 24, 2014, 03:33:15 PM »
May I ask for a bit more help? I tried to find it in renpy documentation, but without much luck...
I have this in assets.rpy
Code: [Select]
    image Flame SniperS:
        Image("content/chars/Sailor_mars_test/Mars/combat (10).jpg")
        pause 0.6
Code: [Select]
    Library.Skills.FlameSniper = MagicFighterAttackSkill2("Flame Sniper", attributes=['magic', 'fire'], damage=5, cost=5, range=4, sprite_cast=BattleSprite('Flame Sniper1',anchor=(0.5, 0.),sprite_fly=BattleSprite('Flame Sniper2',anchor=(0.5, 0.),sprite_impact=BattleSprite('Flame Sniper3',anchor=(0.5, 0.),sprite_special=("Flame SniperS"), pause=1, sfx="content/sfx/sound/be/fire.wav") And this in engine-skills.rpy
Code: [Select]
    class MagicFighterAttackSkill2(Skill):
       
        def __init__(self, name="Magic Fighter Attack2", command=None, attributes=['magic'], damage=1, cost=1, range=5, sprite_cast=None, sprite_fly=None, sprite_impact=None, sprite_special=None, pause=0, sfx=None, endTurn=True, hotkey=None, weight=0):
            self._damage = damage
            self._cost = cost
            self._targets = TargetData.TargetFightersLos(range=range)
            self._sprite_cast = sprite_cast
            self._sprite_fly = sprite_fly
            self._sprite_impact = sprite_impact
            self._sprite_special = sprite_special
            self._pause = pause
            self._sfx = sfx
            self._endTurn = endTurn
            self._attributes = attributes
           
            if command == None:
                command = [("Magic", 5), (name, 0)]
           
            super(MagicFighterAttackSkill2, self).__init__(name=name, command=command, hotkey=hotkey, weight=weight)


           
        def SetUpFighter(self, fighter):
            fighter.RegisterStat("Magic", 10)
            fighter.RegisterStat("MP", 10)

        def PerformAction(self, fighter, target):
            if (self.IsAvailable(fighter)):
                if (target != None):
                   
                    fighter.Stats.MP = fighter.Stats.MP - self._cost

                    if self._sfx != None:
                        renpy.music.play(self._sfx, channel="sound", loop=False)
                   
                    face = fighter._battle.GetFacing(fighter.Position, target[0].Position)
                    fighter._battle.ChangeFighterState(fighter, "magic", facing=face)

                    # Make sure that the camera centres on the target before the spell goes off
                    fighter._battle.PointOfInterest(fighter=target[0])
                   
                    sprite_flip1 = False
                    if (fighter.Position.X < target[0].Position.X):
                        sprite_flip1 = True
                       
                       

                    tag = "MagicFighterAttackSkill2_"+target[0].Tag+"_"+str(renpy.random.random()*1000)
                    l = fighter._battle.GetLayer('Fighters')                       
                   
                    if self._sprite_special != None and self._pause > 0 and dice(50):
                        renpy.show(tag, what=self._sprite_special, at_list=[Position(xpos=0.5,ypos=0.], layer=l, zorder=fighter.Position.Z + 0.001)
And I would like this image in the last line Resized, and apply transitions on it. But I'm not sure where to write that...

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #1492 on: January 24, 2014, 03:34:39 PM »
and I want this image in last line Resized, and apply transitions to it, but I just don't know where to write it...
I'm sorry to ask again, I tried to find it in renpy documentation, but without much luck.

Please be more specific, what are you trying to do?

Code: [Select]
    image Flame SniperS:
        Image("content/chars/Sailor_mars_test/Mars/combat (10).jpg")
        pause 0.3

Images are easier to resize so you might as well do it here (use im.Scale(path, 100, 100)) instead of Image(path).

Code: [Select]
renpy.show(tag, what=self._sprite_special, at_list=[Position(xpos=0.5,ypos=0.], layer=l, zorder=fighter.Position.Z + 0.001)

I think you can use At() function and transform in "at_list" property. Might even resize displayable... who knows :) I don't really have straight answers for these questions, I usually get things right by trail and error with some help from Ren'Py docs and their forums.
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #1493 on: January 24, 2014, 04:13:18 PM »
Code: [Select]
renpy.show(tag, what=self._sprite_special, at_list=[Position(xpos=0.5,ypos=0.], layer=l, zorder=fighter.Position.Z + 0.001) And I would like this image in the last line Resized, and apply transitions on it. But I'm not sure where to write that...

http://www.renpy.org/wiki/renpy/doc/reference/functions/renpy.with_statement

This might also work if you put it right after renpy.show() line.
Like what we're doing?

Offline CherryWood

  • Hero Member
  • *****
  • Posts: 643
Re: General Discussion
« Reply #1494 on: January 25, 2014, 04:48:46 AM »
Please be more specific, what are you trying to do?

I want to display big image over the whole screen as a part of some skill animations. (It's often used in some fight games and I think it looks cool)
But the images in BE's assets.rpy are loaded directly so they can easily end too small or over-the-screen big. I need to specify the size they should fit in somewhere. I know that we have something called ProportionalScale class in game, but I don't understand how set up something like that.


Also, do I need to take config sizes into account, or the game can do that automatically? Like this from interaction:
Code: [Select]
$renpy.show('chr', what=chr.show('date',resize=(int(config.screen_width*0.85), int(config.screen_height*0.785))), at_list=[Position(ypos = 0.8])
« Last Edit: January 25, 2014, 05:01:20 AM by CherryWood »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #1495 on: January 25, 2014, 05:48:04 AM »
Also, do I need to take config sizes into account, or the game can do that automatically? Like this from interaction:
Code: [Select]
$renpy.show('chr', what=chr.show('date',resize=(int(config.screen_width*0.85), int(config.screen_height*0.785))), at_list=[Position(ypos = 0.8])

No you do not, just specify the size. Basically config.screen_width and config.screen_height are simply integers: 1280 and 800. There is no magic involved.

I want to display big image over the whole screen as a part of some skill animations. (It's often used in some fight games and I think it looks cool)
But the images in BE's assets.rpy are loaded directly so they can easily end too small or over-the-screen big. I need to specify the size they should fit in somewhere. I know that we have something called ProportionalScale class in game, but I don't understand how set up something like that.

ProportionalScale() will keep the image proportions. im.Scale() will force a resize but image might turn out to stretched. im.FactorScale() can also resize images based on factors but keeping in proportion.

Images are loaded into the game at their resolution and are scaled automatically with the window. Changing game's resolution will not be supported in PyTFall, as long as we are using good quality images, game should look good even on large screens.

So to answer your question:

1) You can simply resize your image in windows.

2) You can use im.Scale() if you want to define image in the init:
image KaaaBOOM:
    im.Scale("path_to_image", 1280, 800)

3) Or, if you are making a new unique animation (I would advice against creating a new class as you did by the way, simple if fork will look better (as in my example)):

inside the method of class you can also simply use:

kaboom = im.Scale("path_to_KaaaBOOM", 1280, 800)

or

kaboom = Image("path_to_KaaaBOOM") (if you resized it in windows)

and then:

renpy.show('chr', what=kaboom, at_list=[Position(ypos = 0.8])

If your animation is unique, it actually makes a lot more sense to do it this way, than use the BE approach.

You can also do cool stuff like randomly recoloring your attacks using im.twocolor() for example... You just need to understand how Ren'Py is handling images and displayable.
Like what we're doing?

Offline CherryWood

  • Hero Member
  • *****
  • Posts: 643
Re: General Discussion
« Reply #1496 on: January 25, 2014, 10:31:40 AM »
Ok, if we don't allow changing resolution, then I can do it manually.
...and that probably also means that all of my girlpack images over 800 height are a wasted disk space  :)




Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #1497 on: January 25, 2014, 10:54:46 AM »
Ok, if we don't allow changing resolution, then I can do it manually.
...and that probably also means that all of my girlpack images over 800 height are a wasted disk space  :)

Well, it's a moot point, really. I found that images sized at 2000x2000 and resized in Ren'Py look a LOT better on a large screen than 1280x800 images native to resolution. There is also quality factor involved (pixed depth, saturation and other factors noone but graphical designers and artist truly understand...). I am afraid that I simply do not know enough about graphics to confirm or reject your statement :(

But yeah, I am not coding the game with presumption that resolution will be changed. That would require effort with very little reward...
Like what we're doing?

Offline CherryWood

  • Hero Member
  • *****
  • Posts: 643
Re: General Discussion
« Reply #1498 on: January 25, 2014, 04:01:01 PM »
Ok, with your help I changed MagicFighterAttackSkill class to allow missile spells, and created 3+1 spells to test it, and after like 100 errors I got in last two days it seems to be working.
So I satisfied my curiosity for a while and I will go back to much more tedious tagging   :)

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #1499 on: January 25, 2014, 04:03:32 PM »
Ok, with your help I changed MagicFighterAttackSkill class to allow missile spells, and created 3+1 spells to test it, and after like 100 errors I got in last two days it seems to be working.
So I satisfied my curiosity for a while and I will go back to much more tedious tagging   :)

Can you create an account on SourceForge and push the code (I'll give you developer rights)? Or simply upload it to DB?
Like what we're doing?