[A10-A15] cuproPanda's Mods (Old Thread)

Started by cuproPanda, April 23, 2015, 03:30:55 PM

Previous topic - Next topic

cuproPanda

Small bugfix for CorePanda fixing chandelier placement. A14 removed BuildingTall altitude layer, so I had to make a few changes. They can now be placed over most furniture (like tables)!


Quote from: Darkmark8910 on July 24, 2016, 08:24:01 PM
I hope you can get your scripts back, Cupro!!!

I haven't commented on this thread before, but your mods are my absolute favorites out of all of the mods I've played in Rimworld. I hope you can manage to get them back - and if there's anything we can do on our end, you let us know!! <3

Every time Rimworld's been updated I've gone "Oh, neat! Now let's wait for Additional Joy Objects et al to be added into the latest version" <3

- Random user
Thankfully, I have gotten all the files back! GitHub support is A+ quality.
cuproPanda's Mods: Survivalist's Additions, Additional Joy Objects, Cupro's Drinks, Quarry, Cupro's Stones, Zen Garden, Cupro's Alloys, Preset Filtered Zones, & more!

123nick

hey, for some reason the quarry doesent work, trying too place it down, in a area where it could be, makes log errors:

123nick

Quote from: cuproPanda on July 24, 2016, 09:06:16 PM
Small bugfix for CorePanda fixing chandelier placement. A14 removed BuildingTall altitude layer, so I had to make a few changes. They can now be placed over most furniture (like tables)!


Quote from: Darkmark8910 on July 24, 2016, 08:24:01 PM
I hope you can get your scripts back, Cupro!!!

I haven't commented on this thread before, but your mods are my absolute favorites out of all of the mods I've played in Rimworld. I hope you can manage to get them back - and if there's anything we can do on our end, you let us know!! <3

Every time Rimworld's been updated I've gone "Oh, neat! Now let's wait for Additional Joy Objects et al to be added into the latest version" <3

- Random user
Thankfully, I have gotten all the files back! GitHub support is A+ quality.

oh cool, you got your files back! thats awesome :)

cuproPanda

Quote from: 123nick on July 25, 2016, 09:55:57 AM
hey, for some reason the quarry doesent work, trying too place it down, in a area where it could be, makes log errors:


Try the new 14.12 version. It should fix all the issues on it's own.

I swear, one small change to the way items are placed, and this mod turns to complete garbage. Everyone's having problems with it  :(
cuproPanda's Mods: Survivalist's Additions, Additional Joy Objects, Cupro's Drinks, Quarry, Cupro's Stones, Zen Garden, Cupro's Alloys, Preset Filtered Zones, & more!

Mordgier

Quote from: segundoblz on July 23, 2016, 04:27:12 PM
I find that the quarry have a very tiny little small chance of getting an ore. With 4 miners, I see my colony become a huge stone chunk hahaha

I'm having the same problem. I loaded this mod into my game that has no more steel left on the map - and now I have 3 20x20 dumping areas full of nothing but unrefined rocks AND have 4,000 bricks - I lost track of the number of bricks I sold.

Please adjust the rock production. I don't mind finding rocks, but currently useful resources are WAY too rare.

Is it possible to expose the chance values to be easily end user adjustable?

cuproPanda

I will definitely work on making the odds adjustable by the players in a newer version. It won't be for A14, though, because that would be another thing that causes issues with peoples old saves. It should be no more than ~70% chance to get chunks, though, and that's if you don't have any of the other mods with ores (CorePanda, Powerless, Industrialisation, etc.).
cuproPanda's Mods: Survivalist's Additions, Additional Joy Objects, Cupro's Drinks, Quarry, Cupro's Stones, Zen Garden, Cupro's Alloys, Preset Filtered Zones, & more!

Mordgier

Quote from: cuproPanda on July 25, 2016, 03:56:45 PM
I will definitely work on making the odds adjustable by the players in a newer version. It won't be for A14, though, because that would be another thing that causes issues with peoples old saves. It should be no more than ~70% chance to get chunks, though, and that's if you don't have any of the other mods with ores (CorePanda, Powerless, Industrialisation, etc.).

Are you still planning to go open source?

cuproPanda

#457
Quote from: Mordgier on July 25, 2016, 04:01:19 PM
Quote from: cuproPanda on July 25, 2016, 03:56:45 PM
I will definitely work on making the odds adjustable by the players in a newer version. It won't be for A14, though, because that would be another thing that causes issues with peoples old saves. It should be no more than ~70% chance to get chunks, though, and that's if you don't have any of the other mods with ores (CorePanda, Powerless, Industrialisation, etc.).

Are you still planning to go open source?

https://github.com/cuproPanda/QRY

Make your own version if you'd like, release it if you'd like. I'm seriously getting burnt out on trying to fix it. I've never had so many problems with a project before and nothing I try seems to work.


EDIT: I'm going to be working on a new version that actually works, and I'm going to try to get some people on the forums to help me test it using mods. That's the only thing I can think of as being the issue, since it's worked fine for me since the first release. If I hadn't realized I coded in the potential for errors, I'd swear people were trolling me. I'll also see what I can do about making the resources weighted in XML so people can easily adjust them as needed. I'm currently playing with just my mods (except CFG - I don't like it), and it seems like I get ~50/50 resources/chunks. Other people have said they get very low yields, so maybe it's just poor RNG, or maybe not
cuproPanda's Mods: Survivalist's Additions, Additional Joy Objects, Cupro's Drinks, Quarry, Cupro's Stones, Zen Garden, Cupro's Alloys, Preset Filtered Zones, & more!

Mordgier

#458
Quote from: cuproPanda on July 25, 2016, 04:24:16 PM
Quote from: Mordgier on July 25, 2016, 04:01:19 PM
Quote from: cuproPanda on July 25, 2016, 03:56:45 PM
I will definitely work on making the odds adjustable by the players in a newer version. It won't be for A14, though, because that would be another thing that causes issues with peoples old saves. It should be no more than ~70% chance to get chunks, though, and that's if you don't have any of the other mods with ores (CorePanda, Powerless, Industrialisation, etc.).

Are you still planning to go open source?

https://github.com/cuproPanda/QRY

Make your own version if you'd like, release it if you'd like. I'm seriously getting burnt out on trying to fix it. I've never had so many problems with a project before and nothing I try seems to work.


EDIT: I'm going to be working on a new version that actually works, and I'm going to try to get some people on the forums to help me test it using mods. That's the only thing I can think of as being the issue, since it's worked fine for me since the first release. If I hadn't realized I coded in the potential for errors, I'd swear people were trolling me. I'll also see what I can do about making the resources weighted in XML so people can easily adjust them as needed. I'm currently playing with just my mods (except CFG - I don't like it), and it seems like I get ~50/50 resources/chunks. Other people have said they get very low yields, so maybe it's just poor RNG, or maybe not

Panda,

The reason you get good yields is that you are running with other minerals right?

Looking at your code (thank you for posting it) you rand 1-150, drop anything under 40 as a chunk - then you basically do your checks and say "Hey do you have this metal type in your game? Yes? Cool here is this metal! - if not give them a useless chunk!"

That's the problem. Running just Quarry, you get an 8% chance to get steel, 2% jade, 2% gold or 2% component,  1% chance of uranium and .6% chance of platsteel.

Meaning running no mods but Quarry, you generate 85% waste.

Your logic tree should be reworked to reroll again if the rolled for metal is not in the game rather than giving out junk.

I may get time to do that myself over the weekend...

cuproPanda

Quote from: Mordgier on July 25, 2016, 05:35:21 PM
Quote from: cuproPanda on July 25, 2016, 04:24:16 PM
Quote from: Mordgier on July 25, 2016, 04:01:19 PM
Quote from: cuproPanda on July 25, 2016, 03:56:45 PM
I will definitely work on making the odds adjustable by the players in a newer version. It won't be for A14, though, because that would be another thing that causes issues with peoples old saves. It should be no more than ~70% chance to get chunks, though, and that's if you don't have any of the other mods with ores (CorePanda, Powerless, Industrialisation, etc.).

Are you still planning to go open source?

https://github.com/cuproPanda/QRY

Make your own version if you'd like, release it if you'd like. I'm seriously getting burnt out on trying to fix it. I've never had so many problems with a project before and nothing I try seems to work.


EDIT: I'm going to be working on a new version that actually works, and I'm going to try to get some people on the forums to help me test it using mods. That's the only thing I can think of as being the issue, since it's worked fine for me since the first release. If I hadn't realized I coded in the potential for errors, I'd swear people were trolling me. I'll also see what I can do about making the resources weighted in XML so people can easily adjust them as needed. I'm currently playing with just my mods (except CFG - I don't like it), and it seems like I get ~50/50 resources/chunks. Other people have said they get very low yields, so maybe it's just poor RNG, or maybe not

Panda,

The reason you get good yields is that you are running with other minerals right?

Looking at your code (thank you for posting it) you rand 1-150, drop anything under 40 as a chunk - then you basically do your checks and say "Hey do you have this metal type in your game? Yes? Cool here is this metal! - if not give them a useless chunk!"

That's the problem. Running just Quarry, you get an 8% chance to get steel, 2% jade, 2% gold or 2% component,  1% chance of uranium and .6% chance of platsteel.

Meaning running no mods but Quarry, you generate 85% waste.

Your logic tree should be reworked to reroll again if the rolled for metal is not in the game rather than giving out junk.

I may get time to do that myself over the weekend...

I was thinking, what if it lands on something not installed, rerolls and lands on something else not installed, then again and again. It's all supposed to happen in a single tick, and with a quarry fully stocked, that could start causing lag. Little bits, maybe a stutter here and there, but it's still bad. That was also based on the old way I was doing it; the newer way of determining if an ore exists is much quicker, so I will do that. I never got any feedback on how balanced it was before, so I assumed it was balanced based on my usage.
cuproPanda's Mods: Survivalist's Additions, Additional Joy Objects, Cupro's Drinks, Quarry, Cupro's Stones, Zen Garden, Cupro's Alloys, Preset Filtered Zones, & more!

Mordgier

#460
Quote from: cuproPanda on July 25, 2016, 06:03:08 PM
Quote from: Mordgier on July 25, 2016, 05:35:21 PM
Quote from: cuproPanda on July 25, 2016, 04:24:16 PM
Quote from: Mordgier on July 25, 2016, 04:01:19 PM
Quote from: cuproPanda on July 25, 2016, 03:56:45 PM
I will definitely work on making the odds adjustable by the players in a newer version. It won't be for A14, though, because that would be another thing that causes issues with peoples old saves. It should be no more than ~70% chance to get chunks, though, and that's if you don't have any of the other mods with ores (CorePanda, Powerless, Industrialisation, etc.).

Are you still planning to go open source?

https://github.com/cuproPanda/QRY

Make your own version if you'd like, release it if you'd like. I'm seriously getting burnt out on trying to fix it. I've never had so many problems with a project before and nothing I try seems to work.


EDIT: I'm going to be working on a new version that actually works, and I'm going to try to get some people on the forums to help me test it using mods. That's the only thing I can think of as being the issue, since it's worked fine for me since the first release. If I hadn't realized I coded in the potential for errors, I'd swear people were trolling me. I'll also see what I can do about making the resources weighted in XML so people can easily adjust them as needed. I'm currently playing with just my mods (except CFG - I don't like it), and it seems like I get ~50/50 resources/chunks. Other people have said they get very low yields, so maybe it's just poor RNG, or maybe not

Panda,

The reason you get good yields is that you are running with other minerals right?

Looking at your code (thank you for posting it) you rand 1-150, drop anything under 40 as a chunk - then you basically do your checks and say "Hey do you have this metal type in your game? Yes? Cool here is this metal! - if not give them a useless chunk!"

That's the problem. Running just Quarry, you get an 8% chance to get steel, 2% jade, 2% gold or 2% component,  1% chance of uranium and .6% chance of platsteel.

Meaning running no mods but Quarry, you generate 85% waste.

Your logic tree should be reworked to reroll again if the rolled for metal is not in the game rather than giving out junk.

I may get time to do that myself over the weekend...

I was thinking, what if it lands on something not installed, rerolls and lands on something else not installed, then again and again. It's all supposed to happen in a single tick, and with a quarry fully stocked, that could start causing lag. Little bits, maybe a stutter here and there, but it's still bad. That was also based on the old way I was doing it; the newer way of determining if an ore exists is much quicker, so I will do that. I never got any feedback on how balanced it was before, so I assumed it was balanced based on my usage.

No need to worry about that -
   public void GenProduct() {
      int tmp = Rand.RangeInclusive(1, 150);
    
     do {
      if (tmp < 40) || (tmp >103)  { //58% chunks
        isChunk = true;
        SpawnProduct(chunk, 1);
        return;
      }


      if (tmp >= 40 && tmp < 45) {// 5
        if (DefDatabase<ThingDef>.GetNamed("CP_Copper", false) != null) {
          SpawnProduct(ThingDef.Named("CP_Copper"), 10);
          return;
        }
       
      }
      if (tmp >= 45 && tmp < 50) {// 5
        if (DefDatabase<ThingDef>.GetNamed("CP_Quartz", false) != null) {
          SpawnProduct(ThingDef.Named("CP_Quartz"), 10);
          return;
        }
      }
      if (tmp == 50) {// 1
        if (DefDatabase<ThingDef>.GetNamed("CAL_RoseGold", false) != null) {
          SpawnProduct(ThingDef.Named("CAL_RoseGold"), 5);
          return;
        }
     
      }
      if (tmp >= 51 && tmp < 55) {// 4
        if (DefDatabase<ThingDef>.GetNamed("POW_Coldstone", false) != null) {
          SpawnProduct(ThingDef.Named("POW_Coldstone"), 1);
          return;
        }
       
      }
      if (tmp >= 55 && tmp < 60) {// 5
        if (DefDatabase<ThingDef>.GetNamed("Aluminium", false) != null) {
          SpawnProduct(ThingDef.Named("Aluminium"), 10);
          return;
        }
      }
      if (tmp >= 60 && tmp < 65) {// 5
        if (DefDatabase<ThingDef>.GetNamed("Copper", false) != null) {
          SpawnProduct(ThingDef.Named("Copper"), 10);
          return;
        }
    }
      if (tmp >= 65 && tmp < 70) {// 5
        if (DefDatabase<ThingDef>.GetNamed("MD2Coal", false) != null) {
          SpawnProduct(ThingDef.Named("MD2Coal"), 5);
          return;
        }
     
      }
      if (tmp >= 70 && tmp < 74) {// 4
        if (DefDatabase<ThingDef>.GetNamed("POW_Glowstone", false) != null) {
          SpawnProduct(ThingDef.Named("POW_Glowstone"), 1);
          return;
        }
     
      }
      if (tmp >= 74 && tmp < 86) {// 12
        SpawnProduct(ThingDefOf.Steel, 15);
        return;
      }
      if (tmp >= 86 && tmp < 92) {// 6
        SpawnProduct(ThingDefOf.Silver, 15);
        return;
      }
      if (tmp >= 92 && tmp < 95) {// 3
        SpawnProduct(ThingDef.Named("Jade"), 10);
        return;
      }
      if (tmp >= 95 && tmp < 98) {// 3
        SpawnProduct(ThingDefOf.Gold, 10);
        return;
      }
      if (tmp == 98 || tmp == 99) {// 2
        SpawnProduct(ThingDef.Named("Uranium"), 5);
        return;
      }
      if (tmp == 100 ) {// 1
        SpawnProduct(ThingDefOf.Plasteel, 5);
        return;
      }
      if (tmp >= 101 && tmp < 104) {// 3
        SpawnProduct(ThingDefOf.Component, 2);
        return;
      }
     
      }
     tmp = Rand.RangeInclusive(1, 150); //roll again
     }while true; //do this forever until you breakout via a return.
    }


Yes it's lazy.  Even on vanilla you will break out of the loop on the first try 74% of the time - and your chance of needing a 3rd loop is just 6%. I don't think you'd get a noticeable hit.

Note: I just changed this in notepad++ it may suck.

cuproPanda

Quote from: Mordgier on July 25, 2016, 06:14:45 PM
Quote from: cuproPanda on July 25, 2016, 06:03:08 PM
Quote from: Mordgier on July 25, 2016, 05:35:21 PM
Quote from: cuproPanda on July 25, 2016, 04:24:16 PM
Quote from: Mordgier on July 25, 2016, 04:01:19 PM
Quote from: cuproPanda on July 25, 2016, 03:56:45 PM
I will definitely work on making the odds adjustable by the players in a newer version. It won't be for A14, though, because that would be another thing that causes issues with peoples old saves. It should be no more than ~70% chance to get chunks, though, and that's if you don't have any of the other mods with ores (CorePanda, Powerless, Industrialisation, etc.).

Are you still planning to go open source?

https://github.com/cuproPanda/QRY

Make your own version if you'd like, release it if you'd like. I'm seriously getting burnt out on trying to fix it. I've never had so many problems with a project before and nothing I try seems to work.


EDIT: I'm going to be working on a new version that actually works, and I'm going to try to get some people on the forums to help me test it using mods. That's the only thing I can think of as being the issue, since it's worked fine for me since the first release. If I hadn't realized I coded in the potential for errors, I'd swear people were trolling me. I'll also see what I can do about making the resources weighted in XML so people can easily adjust them as needed. I'm currently playing with just my mods (except CFG - I don't like it), and it seems like I get ~50/50 resources/chunks. Other people have said they get very low yields, so maybe it's just poor RNG, or maybe not

Panda,

The reason you get good yields is that you are running with other minerals right?

Looking at your code (thank you for posting it) you rand 1-150, drop anything under 40 as a chunk - then you basically do your checks and say "Hey do you have this metal type in your game? Yes? Cool here is this metal! - if not give them a useless chunk!"

That's the problem. Running just Quarry, you get an 8% chance to get steel, 2% jade, 2% gold or 2% component,  1% chance of uranium and .6% chance of platsteel.

Meaning running no mods but Quarry, you generate 85% waste.

Your logic tree should be reworked to reroll again if the rolled for metal is not in the game rather than giving out junk.

I may get time to do that myself over the weekend...

I was thinking, what if it lands on something not installed, rerolls and lands on something else not installed, then again and again. It's all supposed to happen in a single tick, and with a quarry fully stocked, that could start causing lag. Little bits, maybe a stutter here and there, but it's still bad. That was also based on the old way I was doing it; the newer way of determining if an ore exists is much quicker, so I will do that. I never got any feedback on how balanced it was before, so I assumed it was balanced based on my usage.

No need to worry about that -
   public void GenProduct() {
      int tmp = Rand.RangeInclusive(1, 150);
 
  do {
      if (tmp < 40) || (tmp >103)  { //58% chunks
        isChunk = true;
        SpawnProduct(chunk, 1);
        return;
      }


      if (tmp >= 40 && tmp < 45) {// 5
        if (DefDatabase<ThingDef>.GetNamed("CP_Copper", false) != null) {
          SpawnProduct(ThingDef.Named("CP_Copper"), 10);
          return;
        }
       
      }
      if (tmp >= 45 && tmp < 50) {// 5
        if (DefDatabase<ThingDef>.GetNamed("CP_Quartz", false) != null) {
          SpawnProduct(ThingDef.Named("CP_Quartz"), 10);
          return;
        }
      }
      if (tmp == 50) {// 1
        if (DefDatabase<ThingDef>.GetNamed("CAL_RoseGold", false) != null) {
          SpawnProduct(ThingDef.Named("CAL_RoseGold"), 5);
          return;
        }
     
      }
      if (tmp >= 51 && tmp < 55) {// 4
        if (DefDatabase<ThingDef>.GetNamed("POW_Coldstone", false) != null) {
          SpawnProduct(ThingDef.Named("POW_Coldstone"), 1);
          return;
        }
       
      }
      if (tmp >= 55 && tmp < 60) {// 5
        if (DefDatabase<ThingDef>.GetNamed("Aluminium", false) != null) {
          SpawnProduct(ThingDef.Named("Aluminium"), 10);
          return;
        }
      }
      if (tmp >= 60 && tmp < 65) {// 5
        if (DefDatabase<ThingDef>.GetNamed("Copper", false) != null) {
          SpawnProduct(ThingDef.Named("Copper"), 10);
          return;
        }
    }
      if (tmp >= 65 && tmp < 70) {// 5
        if (DefDatabase<ThingDef>.GetNamed("MD2Coal", false) != null) {
          SpawnProduct(ThingDef.Named("MD2Coal"), 5);
          return;
        }
     
      }
      if (tmp >= 70 && tmp < 74) {// 4
        if (DefDatabase<ThingDef>.GetNamed("POW_Glowstone", false) != null) {
          SpawnProduct(ThingDef.Named("POW_Glowstone"), 1);
          return;
        }
     
      }
      if (tmp >= 74 && tmp < 86) {// 12
        SpawnProduct(ThingDefOf.Steel, 15);
        return;
      }
      if (tmp >= 86 && tmp < 92) {// 6
        SpawnProduct(ThingDefOf.Silver, 15);
        return;
      }
      if (tmp >= 92 && tmp < 95) {// 3
        SpawnProduct(ThingDef.Named("Jade"), 10);
        return;
      }
      if (tmp >= 95 && tmp < 98) {// 3
        SpawnProduct(ThingDefOf.Gold, 10);
        return;
      }
      if (tmp == 98 || tmp == 99) {// 2
        SpawnProduct(ThingDef.Named("Uranium"), 5);
        return;
      }
      if (tmp == 100 ) {// 1
        SpawnProduct(ThingDefOf.Plasteel, 5);
        return;
      }
      if (tmp >= 101 && tmp < 104) {// 3
        SpawnProduct(ThingDefOf.Component, 2);
        return;
      }
     
      }
  tmp = Rand.RangeInclusive(1, 150); //roll again
  }while true; //do this forever until you breakout via a return.
    }



Yes it's lazy.  Even on vanilla you will break out of the loop on the first try 74% of the time - and your chance of needing a 3rd loop is just 6%. I don't think you'd get a noticeable hit.

Note: I just changed this in notepad++ it may suck.

I'm going to try to change the layout of how it works. Something more readable. If I don't find something I like, though, I'll use your method. Thanks!
cuproPanda's Mods: Survivalist's Additions, Additional Joy Objects, Cupro's Drinks, Quarry, Cupro's Stones, Zen Garden, Cupro's Alloys, Preset Filtered Zones, & more!


123nick

hey, will unifier be updated? it seems handy, i want too use industrialization but i cant because there would be 2 copers.

cuproPanda

Quote from: Mordgier on July 25, 2016, 06:54:02 PM
Try this:

http://akshaya-m.blogspot.com/2015/03/elegant-way-to-switch-if-else.html

I'm a big fan of dictionaries...

Way ahead of you! See the image below  :P


Quote from: 123nick on July 25, 2016, 07:27:21 PM
hey, will unifier be updated? it seems handy, i want too use industrialization but i cant because there would be 2 copers.

It will be sometime this week. You could still play, you'd just have 2 coppers with their own uses. No conflicts.

[attachment deleted by admin - too old]
cuproPanda's Mods: Survivalist's Additions, Additional Joy Objects, Cupro's Drinks, Quarry, Cupro's Stones, Zen Garden, Cupro's Alloys, Preset Filtered Zones, & more!