Jump to content

Lindor

Sacred Game Modder
  • Posts

    1,101
  • Joined

  • Last visited

  • Days Won

    37

Posts posted by Lindor

  1. type:
    BONUS_SPEED
    BONUS_SPEED_LIMIT

    spez:
    SPEED_ANY
    SPEED_ATTACK
    SPEED_ATTACK_MOUNTED
    SPEED_CAST
    SPEED_CAST_MOUNTED
    SPEED_MAX
    SPEED_WALK
    SPEED_WALK_MOUNTED

     

     

    SPEED_CAST_MOUNTED and SPEED_WALK_MOUNTED are not present in any game versions blueprint.txt. I got them by looking at the dll files. You can create a bonus with the SPEED_WALK_MOUNTED spez and attach it to your mount in creatures.txt to increase your mount movement speed. Or you can give yourself the bonus through other means, like e.g. armor or a skill.

    I once knew the difference between BONUS_SPEED and BONUS_SPEED_LIMIT, ut I have forgotten. The latter one is e.g. what in_in_eifer uses (inquisitor's frenetic fervor).

  2. On 2/13/2024 at 7:06 PM, idbeholdME said:

    Yes.

    I gave the Scarabs in the desert dangerclass of 9 so that they'd drop boss amounts of loot and to make them able of dropping Legendaries in the first place, gave Magisil 20000 weidghtedprob and put ZRareExpectation15 to 500 or so, which combined with Enhanced Perception made it so that every Scarab kill would roll a tier 15 item.

    Result was only Magisil whenever a Legendary item dropped.

    For my personal use, I manually edited the weightedprob of all tier 15 and 14 items to be much, much higher than those of tier 13 (most sets and legendaries) to ensure that when the game rolls ZRareExpectation14 or 15, it actually gives me an item of that rarity. The game rolling 15 only means that it can generate up to rarity tier 15, not that it will drop. It still determines the item to drop by the weightedprob, So even if you score ZRareExpectation15 but there is 1 Legendary and 15 normal uniques with the same weightedprob in the drop list, you still have only 1/16 chance of getting the Legendary.

    I can give you my modded drop.txt if you want to see. In game, I noticed quite a bump in the drop rates of rarity tiers 14 and 15 without touching the ZRareExpectation.

    Hmm. That would be a reasonable explanation why higher tier items have higher weightedprob. I guess we were wrong all along. Nice job!

    • zomgod! 1
  3. 18 minutes ago, idbeholdME said:

    Strange(...)

    And even just from general gameplay, I can safely say that the lower the weightedprob, the less likely the item is to drop when selecting an item from the drop list.

    :

    On 8/4/2022 at 2:51 AM, Flix said:

    Higher values make the item more rare.  At least, I hope so because that's how the entire file is set up from top to bottom.

    I can confirm that the entire file is structured like that. If higher values made items more likely to drop, we would see legendaries all over the place.

    And:

    18 minutes ago, idbeholdME said:

    Because I tested it, just increased the Magisil to 20000 and got only Magisils and nothing else. With PFP of course.

    Maybe you simultaneously tempered with some other value like zrareexpectation or so?

    On 1/26/2023 at 8:13 PM, idbeholdME said:

    Tested by setting the ZRareExpectation in balance.txt to 999 and then adding several zeroes to the weidghtedprob of items in a specific droplist.

    Because if weightedprob really increased the drop likelihood, we're in trouble. For ages everybody thought the opposite.

  4. ...
    FLAG_HAS_WORLDOBJECT_RS = 16777216;
    FLAG_CLICKTHROUGH = 33554432;
    FLAG_EXCLUDEFROMNAVIGEN = 67108864;
    FLAG_NO_ANIM_OPTIMIZATION = 134217728;
    
    local newItemType = {}
    ---------------------------------------------------------------------
    -- Itemtypes
    ---------------------------------------------------------------------
    newItemType = {
    	-- standard info
    	renderfamily = "RENDERFAM_CREATURE",
    	family       = "FAMILY_CREATURE",
    	subfamily    = "SUBFAM_LIFE_HUMAN",
    	classification = "CLF_DEFAULT",
    	flags        = "FLAG_HASHAIR + FLAG_HASBLINKANIM + FLAG_HASSOUND + FLAG_HASPREVIEWIMAGE + FLAG_NO_ANIM_OPTIMIZATION",
    	weargroup    = "WEARGROUP_SERAPHIM",
    	-- 3d model + animation info
    	model0Data = {
    	  name         = "models/heroes/seraphim/c_sera_skin.GR2",
    	  user         = "WEARGROUP_INVALID",
    	},
    	-- logic bounding box
      logicBox = {
        minx=-9.623, miny=-8.72, minz=0.12, 
        maxx=12.52, maxy=13.248, maxz=72.018, 
    	},
    	dangerclass   = 0,
    }
    mgr.typeCreate(1, newItemType);
    ...

    If the flags are stored as global integers, why are the flags stored in the itemtypes as Strings? Did you ever wonder that?

    To me this looks like an exporting mistake.

    Did someone ever try to remove the quotation marks? From this:

    flags        = "FLAG_HASHAIR + FLAG_HASBLINKANIM + FLAG_HASSOUND + FLAG_HASPREVIEWIMAGE + FLAG_NO_ANIM_OPTIMIZATION",

    To this:

    flags        = FLAG_HASHAIR + FLAG_HASBLINKANIM + FLAG_HASSOUND + FLAG_HASPREVIEWIMAGE + FLAG_NO_ANIM_OPTIMIZATION,

    ?

    What happens?

  5. I have written a script that is averaging out the item tier for each jewelry itemtype so I know which itemtypes I can use when creating new jewelry of a tier.

     

    Sorted by itemtype:

    Spoiler

    rings:
        11529:    8.0
        11593:    13.5
        11594:    14.0
        11595:    14.0
        11596:    13.0
        11597:    13.0
        10536:    7.6
        11530:    8.0
        11592:    13.0
        7137:    8.8333333333333
        7138:    8.6666666666667
        7139:    7.8
        7140:    10.0
        7141:    6.25
        7142:    8.0
        7143:    6.25
        7144:    7.6
        7145:    8.8333333333333
        7146:    8.6666666666667
        7147:    8.7142857142857
        7148:    7.6
        7149:    10.222222222222
        7150:    9.1428571428571
        7151:    7.6
        7152:    9.4285714285714
        7153:    14.0
        7154:    10.125
        7155:    9.7142857142857
        7156:    8.5
        7157:    7.6
        7158:    7.6
        7159:    9.1428571428571
        7160:    14.0
        7161:    7.6
        7162:    7.6
        7163:    8.8333333333333
        13255:    13.0
        11512:    8.0
        11513:    8.5
        11514:    6.25
        11515:    6.25
        11516:    6.25
        11517:    6.25
        11518:    6.25
        11519:    7.6
        11520:    8.5
        11521:    8.0
        11522:    8.0
        11523:    7.6
        11524:    6.25
        11525:    9.1666666666667
        11526:    8.8333333333333
        11527:    8.0
        11528:    7.6
        13254:    13.0

    amulets:
        7182:    11.0
        7183:    7.0
        7184:    10.0
        7185:    7.0
        11533:    15.0
        11534:    13.0
        11535:    14.0
        7189:    11.0
        7190:    10.5
        7191:    10.0
        7192:    11.0
        11540:    15.0
        11543:    13.0
        11544:    13.666666666667
        11546:    13.0
        11547:    13.0
        11548:    13.0
        11598:    13.0
        7187:    10.0
        7186:    12.25
        10535:    13.5
        7188:    11.0
        7164:    4.0
        11532:    15.0
        7165:    8.0
        7166:    9.75
        7167:    11.0
        7168:    8.5
        7169:    9.0
        7170:    6.0
        7171:    7.3333333333333
        7172:    10.0
        7173:    8.5
        7174:    10.4
        7175:    11.8
        7176:    7.0
        7177:    10.5
        7178:    11.333333333333
        7179:    10.75
        7180:    11.2
        7181:    8.0
        11539:    13.0

    Sorted by tier (rounded):

    Spoiler

    rings:
        0:    
        1:    
        2:    
        3:    
        4:    
        5:    
        6:    7141, 7143, 11514, 11515, 11516, 11517, 11518, 11524
        7:    
        8:    11529, 10536, 11530, 7139, 7142, 7144, 7148, 7151, 7157, 7158, 7161, 7162, 11512, 11519, 11521, 11522, 11523, 11527, 11528
        9:    7137, 7138, 7145, 7146, 7147, 7150, 7152, 7156, 7159, 7163, 11513, 11520, 11525, 11526
        10:    7140, 7149, 7154, 7155
        11:    
        12:    
        13:    11596, 11597, 11592, 13255, 13254
        14:    11593, 11594, 11595, 7153, 7160
        15:    

    amulets:
        0:    
        1:    
        2:    
        3:    
        4:    7164
        5:    
        6:    7170
        7:    7183, 7185, 7171, 7176
        8:    7165, 7181
        9:    7168, 7169, 7173
        10:    7184, 7191, 7187, 7166, 7172, 7174
        11:    7182, 7189, 7190, 7192, 7188, 7167, 7177, 7178, 7179, 7180
        12:    7186, 7175
        13:    11534, 11543, 11546, 11547, 11548, 11598, 11539
        14:    11535, 11544, 10535
        15:    11533, 11540, 11532

    EDIT:

    I don't know if this is useful, but if we just use the items with fixed boni, uniques, sets, legendaries etc., we get the following distribution:

    Spoiler

    rings:
        0:    
        1:    
        2:    
        3:    
        4:    
        5:    
        6:    
        7:    
        8:    
        9:    
        10:    
        11:    
        12:    7147, 
        13:    11592, 11596, 11597, 10536, 7140, 13254, 7144, 7148, 7149, 7150, 7151, 7156, 7157, 7158, 7159, 7161, 7162, 11513, 11519, 11520, 11523, 11528, 13255, 
        14:    11593, 11594, 11595, 7137, 7138, 7139, 7145, 7146, 7152, 7153, 7154, 7155, 7160, 7163, 11526, 
        15:    7142, 11530, 11512, 11521, 11522, 11529, 11525, 11527, 

    amulets:
        0:    
        1:    
        2:    
        3:    
        4:    
        5:    
        6:    
        7:    
        8:    
        9:    
        10:    
        11:    
        12:    
        13:    7182, 7184, 11534, 7190, 7191, 7192, 11543, 11546, 11547, 11548, 11598, 11539, 7166, 7168, 7171, 7173, 7174, 7175, 7188, 7177, 7180, 7187, 
        14:    11535, 11544, 7167, 7169, 10535, 7178, 7179, 7186, 
        15:    7165, 11532, 11533, 7189, 11540, 7172,

    7147 sticks out, dntknw why

     

    EDIT2:

    This is the distribution I will probably use, this time the itemtypes are sorted (ascending)

    Spoiler

    rings:
        3:  7141
        6:  7143, 11514, 11515, 11516, 11517, 11518, 11524
        9:  7137, 7138, 7139, 7140, 7142, 7144, 7145, 7146, 7147, 7148, 7149, 7150, 7151, 7152, 7154, 7155, 7156, 7157, 7158, 7159, 7161, 7162, 7163, 10536, 11512, 11513, 11519, 11520, 11521, 11522, 11523, 11525, 11526, 11527, 11528, 11529, 11530
        12: 11592, 11596, 11597, 13254, 13255
        15: 7153, 7160, 11593, 11594, 11595

    amulets:
        3:  7164
        6:  7170, 7171, 7176, 7183, 7185, 
        9:  7165, 7166, 7168, 7169, 7172, 7173, 7174, 7181, 7184, 7187, 7191
        12: 7167, 7175, 7177, 7178, 7179, 7180, 7182, 7186, 7188, 7189, 7190, 7192, 11534, 11539, 11543, 11546, 11547, 11548, 11598
        15: 10535, 11532, 11533, 11535, 11540, 11544

     

    EDIT3:

    Changed my mind

    Spoiler

    rings:
        3:  7141, 7143, 11514, 11515, 11516, 11517, 11518, 11524
        6:  7139, 7142, 7144, 7148, 7151, 7157, 7158, 7161, 7162, 10536, 11512, 11519, 11521, 11522, 11523, 11527, 11528, 11529, 11530
        9:  7137, 7138, 7145, 7146, 7147, 7150, 7152, 7156, 7159, 7163, 11513, 11520, 11525, 11526
        12: 7140, 7149, 7154, 7155, 11592, 11596, 11597, 13254, 13255
        15: 7153, 7160, 11593, 11594, 11595

    amulets:
        3:  7164
        6:  7170, 7171, 7176, 7183, 7185, 
        9:  7165, 7166, 7168, 7169, 7172, 7173, 7174, 7181, 7184, 7187, 7191
        12: 7167, 7175, 7177, 7178, 7179, 7180, 7182, 7186, 7188, 7189, 7190, 7192, 11534, 11539, 11543, 11546, 11547, 11548, 11598
        15: 10535, 11532, 11533, 11535, 11540, 11544

     

  6. Uhmm.. I have jewelry with ome bonusgroups containing all kinds of boni. I go ingame and notice that all rings the combomaster sells have the same bonus. To make matters worse, some have more boni than the blueprint has bonusgroups.

    I don't know what is happening. I prepare a darkmatters post. Then I notice bonusgroups can be put on stuff through typification.txt. I thought that I had thought about this and the overhaul would redirect every existent ID to the new ID. CLF_RING has bonusgroupID = 261. ID is non existent pre-overhaul, but got taken post-overhaul. The redirection failed because of this, so all rings get a new bonusgroup.

     

    Notice to anyone using this tool: check typification.txt for leftover bonusgroup IDs after enabling.

    The game is trolling me.

    • Appreciation 1
  7. On 11/24/2022 at 12:29 AM, idbeholdME said:

    Just put the weightedprob for Magisil to 20000 and literally only Magisil is dropping

    It's the other way around. Higher values make the item more rare. Two items, one with weightedprob=50 and one with 150, the 50 will drop 3 times more often compared to the 150.

     

    EDIT: also for impact:

    minquality > zrareexpectation > weightedprob

    So weightedprob has the least amount of impact.

    Haven't figured out expecttype yet.

  8. 4 hours ago, Flix said:

    I can write guides if I knew there was some demand. I can either do script analyses or instructions on how to complete a specific goal. I just need to know what people are interested in learning. Dumping the sum total of knowledge I've picked up would be a lot of time and effort. 

     Can you create https://www.sacredwiki.org/index.php/Sacred_2:drop.txt and explain your detailed knowledge?

    Also https://www.sacredwiki.org/index.php/Sacred_2:Sacred_2_-_Item_Drop_Mechanics I'd bet this is pretty outdated by know. Also could be made less discussion-like and more wiki-like, more structured. But anybody can improve this once you drop.txt knowledge is there.

     

    No need to hurry and feel free to reject.

  9. I know that there were roughly three versions planned, v1, v2 and v3

    I know that the current stage is v1 and v2 never got released.

    I know that v1 had issues which I wanted to fix for v2 before making v3.

    I know that I was very close at finishing v2 when I decided that it wouldn't be worth the time an I could just straightly jump to v3.

    I know I have had an idea for a better lua code beautifyer for v3. I had a very specific idea and wanted to code it entirely different to what I had for v3. I just can't remember the idea anymore.

  10. If we limit the highest exponent to 2 and say we want the function to be a fraction of two polynomials, this is the entire set of all the functions which satisfy the wanted properties:

    Numerator:      c * (x^2 - 2 * x^2 * y^2 + y^2) - 2 * x^2 * y^2 + x^2 * y + y^2 * x
    /
    Denominator:   c * (x + y - x^2 * y - y^2 * x) - x^2 * y - y^2 * x - 2 * x * y

     

    The one I posted above is for c = -1

    It also works for the limit as c goes to infinity

     

    After all this, it's funny because I still think just taking the max is best. It's the best compromise between calculation intensity and beauty. If you don't care about complexity, I think a value of c = -0.5 would probably look best.

  11. On 7/23/2022 at 2:42 AM, Lindor said:

    I have taken another thought on this. When balancing light_col_amb (moonlight) and light_col_diff (daylight, also magiclight/streetlight etc.) can take values between 0 and 1. We want to balance it so the result is also between 0 and 1. What I've done above is just adding them. Not a problem per se, the game automatically caps color at 1.

    The plot would look like this (x and y are moon- and sunlight values):
    YI1x122.gif
    Not the best. Might become too bright too quickliy.

    The intuitive solution would be to go with average instead:
    wCxNW7f.gif
    The issue is: at day, moon is 0 and sun is 1 and vice versa, so we's never really get to 1.

    The next best solution would be to go with max of day and sun:
    PssYCHP.gif
    Not bad., but we have that wierd sharp edge. Light transition wouldn't feel smooth.

    Is there a function which is smooth is always x if x=y, always x if y=0 and always y if x=0? Yes there is. Some math magic including orthogonal projection later and we have this:
    IFjewlj.gif
    This is what we wanted! Formula: ((x^2)+(y^2))/(x+y)

    So you should use this code instead:

      Reveal hidden contents
    #ifdef PS_SPASS_LIGHTNING_NONORMAL_20
      struct pixdata {
        float4 hposition   : POSITION;
        float4 texcoord0   : TEXCOORD0;
        float4 lightDist   : TEXCOORD1;
        float2 depthFog    : TEXCOORD2;
      };
      #define VS_OUT_hposition
      #define VS_OUT_lightDist
      #define VS_OUT_depthFog
    
      fragout2 mainPS(pixdata I,
          uniform sampler2D texture0,
          uniform sampler2D fog_texture,
          uniform float4    light_col_amb,
          uniform float4    light_col_diff,
          uniform float4    system_data)
      {
    	  fragout2 O;
    
    	  // get texture values
    	  s2half4 tex0 = tex2D(texture0, I.texcoord0.xy);
      	
    	  // calc to-face-lightning
    	  float is2Lightning = step(0.2, I.lightDist.w);
    	  float lightAlpha = (light_col_amb.w * light_col_amb.w + light_col_diff.w * light_col_diff.w) / (light_col_amb.w + light_col_diff.w);
    	  float normalize = sqrt(dot(light_col_amb.xyz + light_col_diff.xyz, light_col_amb.xyz + light_col_diff.xyz));
    	  float lengthAmb = sqrt(dot(light_col_amb.xyz, light_col_amb.xyz));
    	  float lengthDiff = sqrt(dot(light_col_diff.xyz, light_col_diff.xyz));
    	  float lengthFinal = (lengthAmb * lengthAmb + lengthDiff * lengthDiff) / (lengthAmb + lengthDiff);
      	
    	  O.col[0] = float4(is2Lightning * lightAlpha * float3(1.0, 1.0, 1.0), tex0.a);
    	  O.col[1] = float4(is2Lightning * lightAlpha * (lengthFinal / normalize) * (light_col_amb.xyz + light_col_diff.xyz), 0.0);
    
        #ifdef S2_FOG
          // calc fog
          fogGlow( O.col[0].xyz, fog_texture, I.depthFog );
          fogGlow( O.col[1].xyz, fog_texture, I.depthFog );
        #endif
    
    	  return O;
      } 
    #endif

     

    It's done here for the whole vector though, and the length can be more than 1 (it can be sqrt(3)). Another option would be doing it component-wise, not for the whole vector:

      Reveal hidden contents
    #ifdef PS_SPASS_LIGHTNING_NONORMAL_20
      struct pixdata {
        float4 hposition   : POSITION;
        float4 texcoord0   : TEXCOORD0;
        float4 lightDist   : TEXCOORD1;
        float2 depthFog    : TEXCOORD2;
      };
      #define VS_OUT_hposition
      #define VS_OUT_lightDist
      #define VS_OUT_depthFog
    
      fragout2 mainPS(pixdata I,
          uniform sampler2D texture0,
          uniform sampler2D fog_texture,
          uniform float4    light_col_amb,
          uniform float4    light_col_diff,
          uniform float4    system_data)
      {
    	  fragout2 O;
    
    	  // get texture values
    	  s2half4 tex0 = tex2D(texture0, I.texcoord0.xy);
      	
    	  // calc to-face-lightning
    	  float is2Lightning = step(0.2, I.lightDist.w);
    	  float lightAlpha = (light_col_amb.w * light_col_amb.w + light_col_diff.w * light_col_diff.w) / (light_col_amb.w + light_col_diff.w);
    	  float lightRed = (light_col_amb.x * light_col_amb.x + light_col_diff.x * light_col_diff.x) / (light_col_amb.x + light_col_diff.x);
    	  float lightGreen = (light_col_amb.y * light_col_amb.y + light_col_diff.y * light_col_diff.y) / (light_col_amb.y + light_col_diff.y);
    	  float lightBlue = (light_col_amb.z * light_col_amb.z + light_col_diff.z * light_col_diff.z) / (light_col_amb.z + light_col_diff.z);
      	
    	  O.col[0] = float4(is2Lightning * lightAlpha * float3(1.0, 1.0, 1.0), tex0.a);
    	  O.col[1] = float4(is2Lightning * lightAlpha * float3(lightRed, lightGreen, lightBlue), 0.0);
    
        #ifdef S2_FOG
          // calc fog
          fogGlow( O.col[0].xyz, fog_texture, I.depthFog );
          fogGlow( O.col[1].xyz, fog_texture, I.depthFog );
        #endif
    
    	  return O;
      } 
    #endif

     

    I think this is the better option, both aesthetics- and calculationcost-wise.

     

    On 5/19/2023 at 11:46 PM, Lindor said:

    I have thought of another function:

    Download.gif.68306d227481e908e3aceea351cfba94.gif

    f(x, y) = x-xy+y

    Just that at x=y, it isn't f(x) = x, it's f(x) = x(2-x)

    Still kinda cool, though.

    I have finally found what I was looking for and it is beautiful :)

    finally.PNG.f492cd533c9073039b21f3e447337e29.PNG

    f(x, y) = ((x^2)(y-1)+(y^2)(x-1))/(2xy-x-y)

    Has all the properties wanted:
    => f(x, x) = x
    => f(0, y) = y
    => f(x, 0) = x
    => f(1, y) = 1
    => f(x, 1) = 1
    => f(1, 1) = 1
    => f(0, 0) = 0 (in the limit from the positive side)

  12. 22 minutes ago, Vishanka said:

    @Lindor Actually I want to look into materials. Let's take these legs for example. How can I add two more material layers so that the thigh cotton would for example be silk and the blade on the knee metal?

    The material for each itemtype is specified in iteminfo.txt. I don't know what happens if you specify multiple iteminfos for the same itemtype, but I guess that most likely the one furthest down the script will overwrite all others.

    In order for there being multiple materials for an item, I think one would need multiple itemtypes for an item, like it's e.g. the case with the armored spiders. The saddle of the spider mount has a different itemtype than the body e.g., 13341=saddle, 13342=body. But I don't know wether achieving this for a blueprint.txt item is possible. E.g. "dagger_1h_normal" has multiple itemtypes, but I don't know wether, like for the spider, they all come together to create one model or the game just randomly picks one if the item drops.

  13. On 1/31/2024 at 7:19 PM, Vishanka said:

    Can you change the color of the effect, for example to red?

     

    On 1/31/2024 at 7:59 PM, Lindor said:

    Ye just edit the textures.

    I'm curious. Are there any interesting colors / texture combinations which you did come up during experimenting? Would love to see some more of your work :)

  14. 35 minutes ago, Vishanka said:

    Can you change the color of the effect, for example to red?

    Ye just edit the textures. In the surface.txt file which contains just the changes I tried to describe what each texture of the surface does, though I admit that it's a bit more complicated than I described. Just play around with it; e.g. if you swap texture1Name to "fx/te_fx.tga" you get a red-ish background.

×
×
  • Create New...
Please Sign In or Sign Up