Author Topic: [HELP] Developing my first mod, could use some guidance  (Read 11728 times)

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: [HELP] Developing my first mod, could use some guidance
« Reply #15 on: June 30, 2015, 04:44:54 pm »
You could, but then that soldier will suddenly find his rifle extremely heavy ;)


If you divide the soldier's str by 3, have weight 1 grenades, you also need to divide every other items' weight by 3 and you will run into rounding issues (ex.: items that used to weight 9 and 10 units, will now both weight 3).

A 30 str soldier throwing a weight 3 grenade will get the same result as a 10 str soldier with a weight 1 grenade. It doesn't really change anything, except that there are more numbers between 3 and 30 than there are between 1 and 10, so you can have more variety in weights for other items.

Offline SIMON BAILIE

  • Commander
  • *****
  • Posts: 676
    • View Profile
Re: [HELP] Developing my first mod, could use some guidance
« Reply #16 on: July 03, 2015, 01:30:20 pm »
I agree that some of the throwing distances now are a bit insane but on looking at the formula: distance=2.5xSoldier's strength/weight of item what about changing the 2.5 down to say 2, this would reduce throwing distances to 80% of previous. For example a troop with 70 strength can throw a weight 3  grenade 58 squares but that would reduce to 46 squares. I'm not exactly sure how you change the 2.5 but if it can be done that might be a solution which you could always tweak with say 1.5 instead of 2.5?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11731
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [HELP] Developing my first mod, could use some guidance
« Reply #17 on: July 03, 2015, 02:36:49 pm »
I agree that some of the throwing distances now are a bit insane but on looking at the formula: distance=2.5xSoldier's strength/weight of item what about changing the 2.5 down to say 2, this would reduce throwing distances to 80% of previous. For example a troop with 70 strength can throw a weight 3  grenade 58 squares but that would reduce to 46 squares. I'm not exactly sure how you change the 2.5 but if it can be done that might be a solution which you could always tweak with say 1.5 instead of 2.5?

I think x2.0 is perfectly fine. 56 tiles is more than the size of a typical map (50x50), and I've always felt that grenades are too good at long ranges.

It would be nice if this formula could be externalized. And even better, differentiated between normal environment and underwater.

Offline SIMON BAILIE

  • Commander
  • *****
  • Posts: 676
    • View Profile
Re: [HELP] Developing my first mod, could use some guidance
« Reply #18 on: July 03, 2015, 02:57:25 pm »
I'm assuming then from what you said Solarius that it would be a bit more involved than "simply" creating a mod with a .rul file. In other words a major change to the code, but on looking at this a bit further (as I wouldn't have a clue where to begin) it would be nice if any change like this was done, that the multiplier of strength in the formula could be changed to suit different people's playing styles.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11731
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [HELP] Developing my first mod, could use some guidance
« Reply #19 on: July 03, 2015, 03:58:09 pm »
I'm assuming then from what you said Solarius that it would be a bit more involved than "simply" creating a mod with a .rul file.

Yeah, only some formulas (like on which the AI can start using grenades) are externalized to ruleset. Most are just code.

In other words a major change to the code

I wouldn't call it a major change, it's just one variable. But it's significant. :)

but on looking at this a bit further (as I wouldn't have a clue where to begin) it would be nice if any change like this was done, that the multiplier of strength in the formula could be changed to suit different people's playing styles.

Well, the more is externalized, the better for modders. The devs, on the other hand, are probably thinking differently. :D

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: [HELP] Developing my first mod, could use some guidance
« Reply #20 on: July 03, 2015, 05:13:19 pm »
Well, every modder has different views and ideas, and complexity explodes : from this:
Code: [Select]
distance =  str * 2.5 / weight;
You end up with this:

Code: [Select]
distance =  max(param_min_dist, min(param_max_dist, param_const + str * param_factor + str * str * param_quadratic / max(min_weight, min(max_weight, weight)))));
https://param_min_dist : minimum throwable distance
https://param_min_dist : maximum throwable distance
https://param_min_weight : items lighter than this are considered to have this weight for throwing formula
https://param_max_weight : items heavier than this are considered to have this weight for throwing formula
https://param_const : initial number of tiles (ie: 3 if any item can be thrown at least 3 tiles)
https://param_factor : multiplier of strength for thrown distance
https://param_quadratic: multiplier for squared strength, generally a tiny negative number so that there is diminishing returns for high strengh
Which may allows some very precise fine-tuning, but is completely obscure for both modders and players.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11731
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [HELP] Developing my first mod, could use some guidance
« Reply #21 on: July 03, 2015, 05:44:41 pm »
Nah, I've seen worse. :)

Besides, it's not like you need to understand every single thing in rulesets to mod. You only need to worry about this if you intend to change precisely that.