Author Topic: General Discussion  (Read 3821264 times)

0 Members and 40 Guests are viewing this topic.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8715 on: October 24, 2016, 01:36:16 AM »
My point still stands. Making items and traits work in different "layer", independently of characters maxes, will make everything simpler.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8716 on: October 24, 2016, 01:56:02 AM »
Not really... We have separated char stats from items and traits stats but I don't see how max/min dicts will benefit from the same arrangement. Problems that we had with them were along the lines of combinations of crazy items and traits lowering max below min or pushing min above max. It was also reported to GUI in a seriously messed up ways. Splitting them will not protect the system against that. Our safeguards seem to be doing ok for now and maybe I am offbase here... I have about an hour right now so I'll rename some stuff and look into how else stats code could be refactored.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8717 on: October 24, 2016, 02:41:43 AM »
There won't be need to check if bonuses provided by items are higher that character maxes, and there won't be need in double system of maxes, ie max and lvl_max. Although, it will make all items more powerful too.

As for min...
The min field is truly useful only in a few cases. Here it freezes joy at 50.
Code: [Select]
    {
    "id": "Mysterious Gray Ring",
    "desc": "«If early day, or late at night, it's not my problem, I'll be alright. No cause you name is worth the fight, but if I'm bored, then yeah, I might.»",
    "icon": "content/items/ring/gray_l.png",
    "price": 5000,
    "sex": "female",
    "chance": 1,
    "badness": 0,
    "eqchance": 5,
    "hidden": false,
    "infinite": false,
    "slot": "ring",
    "max": {"joy": -50, "magic": 150, "mp": 150},
    "mod": {"luck": 5, "defence": 100},
    "min": {"joy": 50},
    "evasion_bonus": 2,
    "damage_multiplier": 0.05,
    "defence_multiplier": {"melee": 0.1, "ranged": 0.05, "magic": 0.05},
    "locations": ["Exploration", "Fishing"],
    "goodtraits": ["Indifferent"]
    }
And this one makes sure character will always have at least 5 mp.
Code: [Select]
    {
    "id": "Rune Staff",
    "desc": "This staff is constantly drawing energy from other planes of existence and channels it to its wielder.",
    "icon": "content/items/sweapon/rus.png",
    "price": 3000,
    "sex": "unisex",
    "chance": 10,
    "badness": 50,
    "eqchance": 50,
    "hidden": true,
    "infinite": false,
    "slot": "smallweapon",
    "type": "rod",
    "max": {"magic": 100, "mp": 100},
    "mod": {"magic": 40, "character": 50, "attack": -80},
    "min": {"mp": 5},
    "delivery_bonus": {"magic": 50},
    "delivery_multiplier": {"magic": 0.1},
    "locations": ["Exploration"]
    }
In all other cases min field is almost cosmetic, because the chance of it being used is super low.

I suppose the staff could just restore mp every day. But since effects are ineffective against jobs and items, I can't really achieve the same result for the ring by using effects. We can get rid of all min fields entirely any time as long as you provide other means to freeze a stat reliably. Ie just to have a fixed stat value no matter what as long as an item or a trait is equipped.
Yeah, for traits too. We had to get rid of retarded trait because it didn't prevent intelligence from increasing, giving enough time, so it had little sense. But if it freezes intelligence at 10, then it works as it should.
« Last Edit: October 24, 2016, 03:25:05 AM by DarkTl »

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8718 on: October 24, 2016, 03:38:07 AM »
Now maxes...
Even if we get rid of artificial bonuses to min values, there is still a possibility that negative max will bring stats to zero.

We cannot get rid of max penalties completely. Training and consumables can easily enough overcome simple penalties to current stat values, making them ineffective.
We could replace absolute negative penalties by relative ones. "max_penalty": ["agility" : 0.9] would mean current agility*0.9, max agility*0.9 and min agility*0.9.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8719 on: October 24, 2016, 03:48:41 AM »
So with other words "no"... we cannot try and make sure that stat limits don't get fucked by content and will have to keep trying normalize that on code level :) I got it.

I've been trying to improve code readability whereever possible in the stats system and to try and make sure that all calculations go through the same checks and routines. I believe code is getting more manageable, although slower that I would have liked.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8720 on: October 24, 2016, 03:50:40 AM »
I dunno what to do about max field yet...
But I bet that freezing stat is much easier than logic for min field.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8721 on: October 24, 2016, 03:55:33 AM »
I dunno what to do about max field yet...
But I bet that freezing stat is much easier than logic for min field.

Nothing... system is working at present, does it not? I can look into adding even more checks if we run into more crazy shit like a trait modding min joy to 50 and some item modding max joy to 40 and you'd get some crazy crap like 50/40 joy in GUI at some point, but for now I just want to clean up what we have at the moment before adding more if/else forks to it, especially before we get actual cases with issues.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8722 on: October 24, 2016, 04:56:01 AM »
No, there won't be such things, unless they will be added by players. Moreover, I like how joy becomes 0/0 after equipping two such rings, works as it should  :)
Should be the same for 50/40 cases, I think. If something breaks the logic, we make it 0/0. Or 1/1.
« Last Edit: October 24, 2016, 05:05:36 AM by DarkTl »

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8723 on: October 24, 2016, 05:12:00 AM »
How about adding descriptions and tooltips for effects, just like traits have? Or you are against it?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8724 on: October 24, 2016, 05:22:17 AM »
Or you are against it?

Ofcourse not, you can just add them to the definition dicts as "desc": "description text". It's very easy to add them to interface.
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8725 on: October 24, 2016, 05:33:36 AM »
We are now allowing traits for MC, I wonder if we should allow effects as well. Desc will now appear in girls profile if you add it.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8726 on: October 24, 2016, 05:43:00 AM »
Certainly. Food Poisoning and Caught a Cold, Poisoned effects are universal, and in fact already can be available for MC.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8727 on: October 24, 2016, 10:06:42 AM »
Certainly. Food Poisoning and Caught a Cold, Poisoned effects are universal, and in fact already can be available for MC.

Oki, I'll have to look into adding effects dict to mc and gui.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8728 on: October 24, 2016, 10:28:32 AM »
The game is not launching after our combined merges  ::)
Code: [Select]
  File "game/script.rpy", line 110, in script
    python:
  File "game/script.rpy", line 116, in <module>
    chars = load_characters("chars", Char)
  File "game/library/functions - loading_data.rpy", line 138, in load_characters
    char.apply_trait(traits[trait])
  File "game/library/characters/classes - characters.rpy", line 2420, in apply_trait
    self.traits.apply(trait, truetrait=truetrait)
  File "game/library/characters/classes - characters.rpy", line 306, in apply
    char.disposition += trait.mod_stats.get("disposition", 0)
TypeError: unsupported operand type(s) for +=: 'float' and 'list'

In the "Stats update" push you replaced

Code: [Select]
                for key in trait.mod_stats:
                    # We prevent disposition from being changed by the traits or it will mess with girl_meets:
                    if key in ["disposition", 'upkeep']:
                        setattr(char, key, getattr(char, key) + trait.mod_stats[key][0])
with
Code: [Select]
                if hasattr(char, "upkeep"):
                    char.upkeep += trait.mod_stats.get("upkeep", 0)
                if hasattr(char, "disposition"):
                    char.disposition += trait.mod_stats.get("disposition", 0)
You probably don't have active characters with traits with bonuses to disposition, unlike me.
« Last Edit: October 24, 2016, 11:09:28 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8729 on: October 24, 2016, 02:13:11 PM »
I see the error but why is the depositions mod a list again?
Like what we're doing?