OpenXcom Forum

Modding => OpenXcom Extended => Topic started by: Meridian on January 24, 2019, 03:52:00 pm

Title: [DONE] [Suggestion] Random manufacturing
Post by: Meridian on January 24, 2019, 03:52:00 pm
11. RANDOM MANUFACTURING
Priority: low
Justification: I know you don't like this idea, but I have some potential uses for it - mostly to do away with some random treasure lists, which are awesome but not optimal in some cases. Still, nothing really revolutionary.

@Solar/Drages/all:
So, let me know what do you expect from this feature and how should the ruleset definition look like...
Title: Re: [Suggestion] Random manufacturing
Post by: drages on January 24, 2019, 04:38:48 pm
Thx for opening this topic.

Randomization is something to break linear game play. For example, You want to create an ultimate weapon as a rare thing, maybe 1 or 2 for total game. To able to make this, you need to create very special game conditions (with much modding skill to code all the unique missions, characters, items, story) or gazillion of A-B-C items to limit to manufacture that weapon. This could be happen for huge mods like X-Com Files which got many story elements and objects to use for unique things. BUT you need to give huge time and knowledge to create such thing.

So you just want to add a more powerful plasma weapon to game. You can only do that just making the required items hell of a number.. like 150x heavy plasma.. is it cool? nop...

You can make a special manufacture, name "Ultimate Plasma Weapon Project" and it could need 5x Heavy Plasma.. the result could be some Alien Allow, Elerium and %5 possibility a next generation plasma rifle. I can create many possibilities over this.. New armor, new energy resources, longer and mostly unpredictable/non-linear game play. Another possibility is to change all the research structure of alien tech. You can get alien power core tech just with one alien power core for example.. but you can make a manufacture to obtain the alien core from it with a percentage, you just cannot figure out alien tech with just a core (it could be done with randomize % research code too).

Randomization should be everywhere to have a complete line. Research, Manufacture and Loot. OpenXcom allows re-research something from same source (which xenonauts does not have), so this researches can have percentage possibilities. So you can find something very unique when you interrogate 12. sectoid... because he wants to talk more then other 11.. why not?
To get random stuff from aliens is very nice. Yes, you can do it already now, but it comes sooner or later rather then being very unique with special possibility code.. maybe first time maybe never..

For loot randomization, as here https://openxcom.org/forum/index.php/topic,6868.0.html , loot transform (shortcut to have tons of mini manufactures for looted items) should have this too, so you can have a good working plasma weapon core from all the alien gear you collected with %5 chance per weapon.. Because all of the alien weapons just self-destruct, but sometimes they are less damaged..
You can create manufacture for every loot to get random items from them but it would kill the system because of ultra boring tons of projects. Random Loot Transform with random manufacture is very smooth streamlined experience. Having random research to this is just perfection.

As code part, very simple for me :P..

Code: [Select]
producedItems:
     STR_ALIEN_ALLOY: 2-5 #RANDOMÄ°ZE 2 TO 5
     STR_ELENIUM: 1-3
     STR_POWER_CORE:0,50-1,35-2,15 #NO CORE %50, 1 CORE %35, 2 CORE %15

Thank you!




Title: Re: [Suggestion] Random manufacturing
Post by: Nord on January 24, 2019, 05:00:50 pm
+1!
I think a syntax must be equal to random research.
Title: Re: [Suggestion] Random manufacturing
Post by: Solarius Scorch on January 24, 2019, 05:35:53 pm
I must say I am not as excited about it as before; Meridian convinced me that it would be easily abused by savescumming, and actually would encourage it more than most RNG elements. But on the other hand I am aware that modders will find ways to use it beyond my wildest imaginations, so... let them worry about it.

As for the actual format, I don't have much, except that it would be a list instead of one item... But you can already have lists (for producing multiple items), so I suppose we would need new options:
1. A random item is chosen from a list of items (like in random loot from maps); for example a project "open the purse" can give you either a diamond, a ruby, or a gold coin.
2. A random set of items is chosen from a list of sets of items; for example a project "open the box" can give you either 10 diamonds + 1000 gold coins, or 1 steel helmet + 1 plate mail + 1 set of gauntlets, or 1 Scroll of Up Yours Player You Get Nothing.
3. (Optional) Like 1 and 2, but you get to also define a number of resulting items; possibly also whether they can be mixed or not. (Just like the random items from maps.)

I don't feel competent enough to actually suggest the syntax, though.
Title: Re: [Suggestion] Random manufacturing
Post by: Nord on January 24, 2019, 05:40:38 pm
Must admit, that this feature is more useful in my case than itemtransformation. In fact, one can replace transformation with some processing in most cases.
But Solarius is right, you never can imagine how something will be used by curious people.
Title: Re: [Suggestion] Random manufacturing
Post by: Solarius Scorch on January 24, 2019, 06:55:31 pm
I've only just read the [Suggestion] Item recovery transformation topic and I also think that

Quote
to recover tons of various loot instead of a loot box (and skip the manufacturing project to open a loot box)

is a better solution than getting random items from manufacturing, for two reasons:
1. Less savescumming potential.
2. Less hassle on the players part.

So if I were to choose between the two, I'd certainly go with item recovery transformation. But I'm sure some things can be done with random manufacturing which cannot be done with random item recovery, it would be nice to have both, I guess.
Title: Re: [Suggestion] Random manufacturing
Post by: Dioxine on January 24, 2019, 08:05:51 pm
2. A random set of items is chosen from a list of sets of items; for example a project "open the box" can give you either 10 diamonds + 1000 gold coins, or 1 steel helmet + 1 plate mail + 1 set of gauntlets, or 1 Scroll of Up Yours Player You Get Nothing.

This is what I imagined it would look like. Allow to set a selection of "boxes", maybe with syntax something like this:
Code: [Select]
    producedItemsRandom:
      RANDOM_SET_1: 60
          STR_DIAMOND: 10
          STR_GOLD: 1000
      RANDOM_SET_2: 40
          STR_OLD_BOOT: 1

So this would give you 60% chance of manufacturing set 1, and 40% of set 2...
Title: Re: [Suggestion] Random manufacturing
Post by: drages on January 24, 2019, 10:26:22 pm

So if I were to choose between the two, I'd certainly go with item recovery transformation. But I'm sure some things can be done with random manufacturing which cannot be done with random item recovery, it would be nice to have both, I guess.

As I said, this is a system which needs randomization at every aspect. It could look that one is enough but when you start one, you will need others to complete your ideas. Random loot transformation is just seamless random manufacture line. Smooth play is very important for player here. Ppl should able to get boring clicking as less as we can. I like to play xcom as long as it gets without finishing it.. but i dont like to make 50 manufacture to just able to make find a rare item.

For this reason, unlimited researches with percentage possibilities could bring you tons of options for any part of the game.
Title: Re: [Suggestion] Random manufacturing
Post by: Meridian on January 25, 2019, 03:31:03 pm
So you can find something very unique when you interrogate 12. sectoid... because he wants to talk more then other 11.. why not?

If I play the game for the very first time and the first Sectoid doesn't give me anything, I will probably try the second one; some people may even try a third one. Nobody tries a fourth one.

If I play the game for the second time or more; and the first Sectoid doesn't give me anything, I immediately stop researching Sectoids.

What exactly is the motivation for the player to "try again"? How is he even supposed to know that something "might happen"?
Title: Re: [Suggestion] Random manufacturing
Post by: drages on January 25, 2019, 05:25:35 pm
If I play the game for the very first time and the first Sectoid doesn't give me anything, I will probably try the second one; some people may even try a third one. Nobody tries a fourth one.

If I play the game for the second time or more; and the first Sectoid doesn't give me anything, I immediately stop researching Sectoids.

What exactly is the motivation for the player to "try again"? How is he even supposed to know that something "might happen"?

I can be maybe wrong, but vanilla game does not tell you about anything with the interrogations of the same alien will give you more things.. like ufo info.. So just adding some info about the possibility of finding new things from interrogations at ufopedia with the first interrogation would be enough to inform player. After all possible researches acquired,  we can inform player with everything done again with ufopedia.

An alien navigator can give you ufo info but with a little chance it can give you "Advanced Ufo Crafting" tech which make you upgrade your aircrafts.. so you can craft MK 2's... you can live without it, but it would be a nice bonus. You can get this info when you interrogate "every" navigator races for %100 percentage if you want to make this for sure to get in a game play.

A commander can give you very nice things with some possibilities too, mostly for endgame.. maybe you want to make things harder and longer to get.. so every commander got some chance to give you the viral information.. but only when you get all the things,you can get that info for %100..
Title: Re: [Suggestion] Random manufacturing
Post by: Meridian on January 25, 2019, 05:30:43 pm
OpenXcom checks if the alien can still tell you anything... and if not, it won't allow you to research anymore.

Note sure how OG worked, probably it allowed, but as I said, as soon as I saw that Sectoid Soldier doesn't tell me anything, I stopped trying.
Title: Re: [Suggestion] Random manufacturing
Post by: drages on January 25, 2019, 05:57:19 pm
OpenXcom checks if the alien can still tell you anything... and if not, it won't allow you to research anymore.

Note sure how OG worked, probably it allowed, but as I said, as soon as I saw that Sectoid Soldier doesn't tell me anything, I stopped trying.

At fiest sectoid soldier interrogation ufopedia could say "We need to interrogate more to find out any secrets.Even we fail to get any info from some of them, there could be one who is more willingly to talk.."

And a mod with randomization would tell this kind of things at mod info anyway..
Title: Re: [Suggestion] Random manufacturing
Post by: Meridian on January 25, 2019, 06:11:23 pm
well, open another thread for research and describe how should it work.... research has many more attributes than manufacture, some depending on each other; it can unlock zero, one or a million topics at once, it can show one to four pedia entries at once, etc. Do you want random on project level, or on attribute level, or on attribute item level, or on all of them and how would it work if one passes and another one doesn't, etc.

if someone makes a complete and meaningful proposal, we'll see...
Title: Re: [Suggestion] Random manufacturing
Post by: drages on January 25, 2019, 10:11:50 pm
well, open another thread for research and describe how should it work.... research has many more attributes than manufacture, some depending on each other; it can unlock zero, one or a million topics at once, it can show one to four pedia entries at once, etc. Do you want random on project level, or on attribute level, or on attribute item level, or on all of them and how would it work if one passes and another one doesn't, etc.

if someone makes a complete and meaningful proposal, we'll see...

To be honest, research got many feature already so maybe i can do what i want as it is. So manufacture and loot randomization is enough for projects in my mind.. after that if i need something to fill, i can tell you then.
Title: Re: [Suggestion] Random manufacturing
Post by: Meridian on January 29, 2019, 05:49:39 pm
So, the syntax would look like this:

Code: [Select]
    randomProducedItems:
      -
        - 60
        - STR_MOTION_SCANNER: 4
          STR_MEDI_KIT: 3
          STR_PSI_AMP: 2
      -
        - 40
        - STR_MOTION_SCANNER: 40
          STR_MEDI_KIT: 30

or alternatively (both are accepted):

Code: [Select]
    randomProducedItems:
      - [60, {STR_MOTION_SCANNER: 9, STR_MEDI_KIT: 8, STR_PSI_AMP: 7}]
      - [40, {STR_MOTION_SCANNER: 5, STR_MEDI_KIT: 6}]


PS: random manufacture will be able to produce only items, no craft
PS2: 60 and 40 are weights, not percentages... 6 and 4 would accomplish the same result

EDIT: Also, it won't be possible to auto-sell when random manufacture is involved

Question: How would you like to inform the user what will he get from the project? (on the attached screen)

Hoping for answer/feedback like:
1/ don't show anything to the player
2/ tell player it's gonna be random, but not any details
3/ tell player all the details/possibilities
4/ make a popup each time something is produced about what was actually done
5/ something even more crazy :)
6/ etc.
Title: Re: [Suggestion] Random manufacturing
Post by: Solarius Scorch on January 29, 2019, 07:49:38 pm
It's probably naive, but:
Would it be possible to add extra indentation to the items? Seeing them just lined up with the weights is really confusing... Like the 40 or 60 was another item to choose.
Title: Re: [Suggestion] Random manufacturing
Post by: Meridian on January 29, 2019, 08:01:55 pm
You can do whatever YAML syntax allows, assuming:
- randomProducedItems is a list
- each list item contains a pair (a sub-list with exactly 2 items)
- first item in the pair is an integer
- second item in the pair is a dictionary (items in dictionary are string on the left and integer on the right)

https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html

This would for example work too:
Code: [Select]
    randomProducedItems:
      -
        - 60
        -   STR_MOTION_SCANNER: 4
            STR_MEDI_KIT: 3
            STR_PSI_AMP: 2
      -
        - 40
        -   STR_MOTION_SCANNER: 40
            STR_MEDI_KIT: 30
Title: Re: [Suggestion] Random manufacturing
Post by: Solarius Scorch on January 29, 2019, 08:24:40 pm
Yes, that looks much cleaner. Thank you! :)
Title: Re: [Suggestion] Random manufacturing
Post by: R1dO on January 29, 2019, 10:36:48 pm
Just out of curiosity, is there something that prevents the weights to be part of the first level of indentation?
e.g.
Code: [Select]
randomProducedItems:
  - 60
    - STR_A: 4
    - STR_B: 5
  - 40
    - STR_C: 6
Title: Re: [Suggestion] Random manufacturing
Post by: Meridian on January 29, 2019, 10:41:21 pm
Just out of curiosity, is there something that prevents the weights to be part of the first level of indentation?

YAML syntax, as far as I know.
Title: Re: [Suggestion] Random manufacturing
Post by: R1dO on January 29, 2019, 10:57:10 pm
Fair enough.

Thanks for the quick answer.
Title: Re: [Suggestion] Random manufacturing
Post by: Roxis231 on January 30, 2019, 12:17:02 am
Has this been added to Extended yet? or are you still working on it?
Title: Re: [Suggestion] Random manufacturing
Post by: Meridian on January 30, 2019, 12:29:41 am
I have asked how should it work a few hours and few posts ago... what do you think?
Title: Re: [Suggestion] Random manufacturing
Post by: Roxis231 on January 30, 2019, 03:25:24 am
Ok.  Will be keeping an eye on this now - I can see a LOT of uses for this when its up and running.
Title: Re: [Suggestion] Random manufacturing
Post by: Meridian on January 30, 2019, 11:06:45 am
Ok.  Will be keeping an eye on this now - I can see a LOT of uses for this when its up and running.

If you plan on using it, then I'm interested in your opinion/feedback on the question stated above too...
Title: Re: [Suggestion] Random manufacturing
Post by: Nord on January 30, 2019, 01:25:07 pm
Question: How would you like to inform the user what will he get from the project? (on the attached screen)

Hoping for answer/feedback like:
1/ don't show anything to the player
2/ tell player it's gonna be random, but not any details
3/ tell player all the details/possibilities
4/ make a popup each time something is produced about what was actually done
5/ something even more crazy :)
6/ etc.
I am voting for [2]. But maybe with a string , informing user about resulting items type. Like "Spare parts", "Donor organs", e.t.c.
Title: Re: [DONE] [Suggestion] Random manufacturing
Post by: Meridian on January 31, 2019, 06:13:49 pm
Since you were the only vote, you win :)

Attached how would it look like:
- just a simple message "Random production!" ...instead of "Units Produced" + list of items
- the string informing about resulting item types should just be the manufacturing project name I guess...

OXCE Download: https://lxnt.wtf/oxem/builds//Extended/Extended-5.2-b5dcebc3c-2019-01-31-win32.7z

One more example... for those, who don't know how to turn off the default production of an item named after the project (just override "producedItems"):

Code: [Select]
manufacture:
  - name: STR_RANDOM_JUNK1
    category: STR_JUNK
    requiredItems:
      STR_ALIEN_ALLOYS: 2
      STR_ELERIUM_115: 1
    producedItems:               # empty
      {}
    randomProducedItems:
      -
        - 70
        -   STR_PSI_AMP: 1
            STR_MEDI_KIT: 2
      -
        - 30
        -   STR_MOTION_SCANNER: 3
            STR_MEDI_KIT: 4
    space: 0
    time: 20
    cost: 1000
Title: Re: [DONE] [Suggestion] Random manufacturing
Post by: R1dO on January 31, 2019, 09:25:42 pm
A sensible decision.

Looking at your example script i have one question though (although i suspect you've already thought of it).

What happens if the modder accidentally leave entries in the "producedItems" slot?
Are they discarded (possibly with a warning in the log), do they show up besides the random items, or is it undefined behavior?
Title: Re: [DONE] [Suggestion] Random manufacturing
Post by: Meridian on January 31, 2019, 11:20:48 pm
A sensible decision.

Looking at your example script i have one question though (although i suspect you've already thought of it).

What happens if the modder accidentally leave entries in the "producedItems" slot?
Are they discarded (possibly with a warning in the log), do they show up besides the random items, or is it undefined behavior?

The "producedItems" will be produced normally and then additionally random items will be produced too.
Title: Re: [DONE] [Suggestion] Random manufacturing
Post by: Nord on February 01, 2019, 02:52:47 am
To be sure, how will look empty production variant? Like this?
 
Code: [Select]
  randomProducedItems:
      -
        - 70
        -   [] #bad luck
      -
        - 30
        -   STR_MOTION_SCANNER: 3
Title: Re: [DONE] [Suggestion] Random manufacturing
Post by: Yankes on February 01, 2019, 11:10:35 pm
This should be map not vector, this mean empty is `{}` not `[]`.

Clue should be this part:
Code: [Select]
    producedItems:               # empty
      {}
where previously was:

Code: [Select]
    producedItems:
      SOME_ITEM: 3
Title: Re: [DONE] [Suggestion] Random manufacturing
Post by: Nord on February 02, 2019, 04:34:32 am
So, if we have 70% for no production and 30% for item1 production, how should it look like?
Title: Re: [DONE] [Suggestion] Random manufacturing
Post by: Meridian on February 02, 2019, 11:44:13 am
Code: [Select]
    producedItems:
      {}                   # empty
    randomProducedItems:
      -
        - 70
        - {}               # empty
      -
        - 30
        - STR_MOTION_SCANNER: 3

or

Code: [Select]
    producedItems: {}                # empty
    randomProducedItems:
      - [70, {}]                     # empty
      - [30, {STR_MOTION_SCANNER: 3}]
Title: Re: [DONE] [Suggestion] Random manufacturing
Post by: Nord on February 02, 2019, 03:33:11 pm
Great, thanks.