[WIP] X Consumer Goods (XCG)

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

atrayas
Posts: 19
Joined: Thu, 24. Mar 16, 11:35
x4

[WIP] X Consumer Goods (XCG)

Post by atrayas »

Greetings, X4 community! We're a small team currently working on our "X Consumer Goods" (XCG, working name) mod.

XCG has one purpose: Add a consumer goods industry to the economy of X4 and see it through from raw material production until final consumption by station workers. It has two advantages:
  • The economy will become more diverse, deep and ultimately more fun to play with.
  • The economy will become less reliant on war, smoothing out the dependence of X4's simulation on perpetual war.
In the end, our goal is to make the game more fun to play. Our focus is thus on gameplay first and foremost, not on realism.

Core Principles:
  • Integration with the Existing Economy: We don’t want to create another segregated branch of production. Instead, we connect our own wares and production chains to wares existing in the base game. The goal is to build on top of the existing economy, strengthening the demand for lower tier wares. Despite this, we will also add our own raw and refined materials where it makes more sense. For example, we have plans to add two refined materials that are produced from silicon and ore, respectively.
  • Needs: Station inhabitants (called consumers) have specific implied needs which the player or AI can cater to with their products. They need consumer wares such as computers, clothing and furniture.
  • Habitat Consumption: We simulate consumption by extending existing habitats with additional required wares. For the sake of simplicity, we add only two additional wares to habitats: Consumer Goods and Luxury Goods. These two can be thought of as bundled consumer products. They are consumed like food and medical supplies.
  • Warehouses: Warehouses buy consumer products and package them into the Consumer Goods and Luxury Goods wares. Consumer Goods include Furniture, Clothing and Hygiene Supplies, among other products. Luxury Goods include Jewelry and Computers, among other products. The packaged goods are sold by the warehouse and will be traded by NPC traders or you, the player.
  • Production Modules: We add full production modules for all new raw, refined, intermediate and final wares. We will use models already existing in the game, but are open to modelling if it’s possible.
Team: That's it for now! We haven't finalised the new wares in our production chain, so we will not present them at this time. Please don't hesitate to ask any questions and post any comments. We'd love to hear your feedback and ideas!
Last edited by atrayas on Fri, 14. Dec 18, 15:29, edited 3 times in total.
Tomonor
EGOSOFT
EGOSOFT
Posts: 1932
Joined: Wed, 12. Sep 07, 19:01
x4

Re: [WIP] X Consumer Goods (XCG)

Post by Tomonor »

A variety of independent residential and commercial space stations could work in this regard. This could be something the player has no control over at all.

So far we only have industrial and military stations. These new stations, even if they don't produce useful goods, could boost the available workforce and help with the basic skillset of the NPCs.
Image
TR0LL
Posts: 45
Joined: Tue, 6. Jan 04, 04:12
x4

Re: [WIP] X Consumer Goods (XCG)

Post by TR0LL »

This is something the game desperately needs, I do not know what all goes into the economic simulation in X4, but I hope that it is very deep, flexible and robust. There are several very good papers online on how to set up an economic simulation.

This is the paper that we used as the foundation of the economic simulation in my game.
https://larc.unt.edu/techreports/LARC-2010-03.pdf
atrayas
Posts: 19
Joined: Thu, 24. Mar 16, 11:35
x4

Re: [WIP] X Consumer Goods (XCG)

Post by atrayas »

repatomonor wrote: Wed, 12. Dec 18, 22:05 A variety of independent residential and commercial space stations could work in this regard. This could be something the player has no control over at all.

So far we only have industrial and military stations. These new stations, even if they don't produce useful goods, could boost the available workforce and help with the basic skillset of the NPCs.
That's an interesting idea. We'll consider adding AI-controlled habitat-only stations if we run into demand balancing issues. Workforce is, as far as I know, station-specific, so the only possibility of that affecting other stations (and thus making residentials have the effect you want) would be through scripting.
TR0LL wrote: Wed, 12. Dec 18, 22:18 This is something the game desperately needs, I do not know what all goes into the economic simulation in X4, but I hope that it is very deep, flexible and robust. There are several very good papers online on how to set up an economic simulation.

This is the paper that we used as the foundation of the economic simulation in my game.
https://larc.unt.edu/techreports/LARC-2010-03.pdf
Interesting paper, thanks! The economic simulation is already in place in X4. We only add more wares and transformers to it. We have to be careful with balancing, but we don't have to (and probably can't through scripting alone) change the foundations (hah) of the simulation.
User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Re: [WIP] X Consumer Goods (XCG)

Post by joelR »

Cant wait!
timmmmmy
Posts: 24
Joined: Mon, 19. Jan 09, 23:53
x3tc

Re: [WIP] X Consumer Goods (XCG)

Post by timmmmmy »

I suspect this will be my go to mod when it gets released. I was literally going to post up a [WIP] Distant Worlds mod focused on introducing the military/civilian dynamic from that game into this but it looks like it may already be in development here! :)

While there is a whole host of different resources that can feed into the "habitat", would it be possible to extend the production chain out the other way too e.g. the habitat would manufacture a citizen resource that can be converted, with the right wares, to the staff consumed at shipyards and wharfs? Just noticed that repatomonor asked something similar so how about a bit of a hack: The citizen ware is bought by a "work exchange" where it is combined with some tech to generate "labour". Labour is then a ware that can be added to ship and module component costs.

Oh and if you will be balancing the economy it would be nice if there was some way to manufacture energy cells from ores to guarantee that there was always something required across the galaxy.

I'll dig around this weekend and see if there is anything I can contribute. Now I just need a sister mod to implement passenger ships. :wink:
User avatar
LennStar
Posts: 910
Joined: Fri, 1. Apr 05, 15:22
x4

Re: [WIP] X Consumer Goods (XCG)

Post by LennStar »

Nice! That actually sounds a lot like my suggestion here

viewtopic.php?f=146&t=406762
:idea: BUG REPORT INFO: I play X4 vanilla. You can find all my bug report files in there:
All X4 files: https://www.dropbox.com/sh/83j3cjfhkdlf ... w6HLa?dl=0
ApoxNM
Posts: 783
Joined: Wed, 5. Dec 18, 06:17
x4

Re: [WIP] X Consumer Goods (XCG)

Post by ApoxNM »

Very nice, I also suggested just the same and would love a more complex and deep economy!

Really hope you see it trough!
atrayas
Posts: 19
Joined: Thu, 24. Mar 16, 11:35
x4

Re: [WIP] X Consumer Goods (XCG)

Post by atrayas »

Thanks for the vote of confidence, guys!
timmmmmy wrote: Thu, 13. Dec 18, 10:25 I suspect this will be my go to mod when it gets released. I was literally going to post up a [WIP] Distant Worlds mod focused on introducing the military/civilian dynamic from that game into this but it looks like it may already be in development here! :)

While there is a whole host of different resources that can feed into the "habitat", would it be possible to extend the production chain out the other way too e.g. the habitat would manufacture a citizen resource that can be converted, with the right wares, to the staff consumed at shipyards and wharfs? Just noticed that repatomonor asked something similar so how about a bit of a hack: The citizen ware is bought by a "work exchange" where it is combined with some tech to generate "labour". Labour is then a ware that can be added to ship and module component costs.

Oh and if you will be balancing the economy it would be nice if there was some way to manufacture energy cells from ores to guarantee that there was always something required across the galaxy.

I'll dig around this weekend and see if there is anything I can contribute. Now I just need a sister mod to implement passenger ships. :wink:
I'm not familiar with Distant Worlds. Can you give us an overview of this mechanic?

Your citizen resource idea sounds like a great idea for a separate mod!

In our current production chain concept, we add two new productions consuming ore, one consuming silicon and one consuming ice. This should make the solids mining market more diverse. I'll look at doing the same for gases.

If you want to contribute something, feel free to send me a PM! We can discuss the specifics then. We already have enough programmers for the time being, though.
LennStar wrote: Thu, 13. Dec 18, 14:54 Nice! That actually sounds a lot like my suggestion here

viewtopic.php?f=146&t=406762
Hotels are actually something we might implement in the future to service ship crews. For now we want to focus on extending existing habitats. Otherwise our ideas seem to converge! :D
Vovva
Posts: 32
Joined: Thu, 15. Dec 11, 05:11
x4

Re: [WIP] X Consumer Goods (XCG)

Post by Vovva »

Great idea! I'like to get this mod asap) Also i can suggest another feature for habitates - academies. Some habitates can also consume wide variety of "military" and "industry" materials to provide high ranked pilots, captains, marines and even managers to hire. I think it's also will be useful for such a wider consumption concept.
SpaceCadet11864
Posts: 476
Joined: Tue, 4. Dec 18, 02:14
x4

Re: [WIP] X Consumer Goods (XCG)

Post by SpaceCadet11864 »

I'm part of the team and just wanted to drop this image, it took me all day to figure this out lol
https://media.discordapp.net/attachment ... height=775


{Images posted directly to the forums should not be greater than 640x480 or 100kb, oversize image now linked - Terre}
atrayas
Posts: 19
Joined: Thu, 24. Mar 16, 11:35
x4

Re: [WIP] X Consumer Goods (XCG)

Post by atrayas »

Just to add some context to the image above: We've figured out how to add wares and production modules to the game (huge props to SpaceCadet for the implementation and aerojet for prior work!). The module produces glass, which is a new refined material that will be used in some of our consumer products. The numbers shown in the screenshot have not been balanced (they're in fact copied from refined metals), but glass will be made from silicon and energy cells. I'm currently working on the design and balancing, specifically pricing and production numbers, and we'll give you a list of wares once we've finalised its first iteration.
SumthinSacred
Posts: 2
Joined: Fri, 20. Jan 17, 19:02
x4

Re: [WIP] X Consumer Goods (XCG)

Post by SumthinSacred »

I really like the idea of this. I look forward to seeing your work!
User avatar
paris_england
Posts: 34
Joined: Wed, 3. Oct 18, 01:32
x4

Re: [WIP] X Consumer Goods (XCG)

Post by paris_england »

Consumer goods is a great idea -- hope this goes well for you guys
Beyondfubar
Posts: 41
Joined: Thu, 21. Nov 13, 23:03
x3ap

Re: [WIP] X Consumer Goods (XCG)

Post by Beyondfubar »

Distant worlds had government types and a variety of wares that were required to excel in the game. Most government types were split so a "civilian" or private sector was uncontrolled by the player (well directly anyway) and a public sector where you were able to directly control. A huge part of the game was balancing your public sector to properly support your private sector, by providing them security from piracy and other nations. In turn the robustness of this economy would support you through a happy population, and taxes of course.

Here in this context that is (I am guessing) you can provide a outlet for your industry to make things that don't fire hot lasers and cold missiles! A very very interesting idea, since while making food and guns is great, that's not even the largest part of a standard economic system. I can't wait to see this!
Oderint Dum Metuant
Adronyth
Posts: 7
Joined: Fri, 30. Nov 18, 18:21
x4

Re: [WIP] X Consumer Goods (XCG)

Post by Adronyth »

very nice idea i hope i can test your mod soon
thanks for your hard work guys
atrayas
Posts: 19
Joined: Thu, 24. Mar 16, 11:35
x4

Re: [WIP] X Consumer Goods (XCG)

Post by atrayas »

Beyondfubar wrote: Sat, 15. Dec 18, 04:30 Distant worlds had government types and a variety of wares that were required to excel in the game. Most government types were split so a "civilian" or private sector was uncontrolled by the player (well directly anyway) and a public sector where you were able to directly control. A huge part of the game was balancing your public sector to properly support your private sector, by providing them security from piracy and other nations. In turn the robustness of this economy would support you through a happy population, and taxes of course.

Here in this context that is (I am guessing) you can provide a outlet for your industry to make things that don't fire hot lasers and cold missiles! A very very interesting idea, since while making food and guns is great, that's not even the largest part of a standard economic system. I can't wait to see this!
Oh, that's a cool system!
Adronyth wrote: Sat, 15. Dec 18, 07:47 very nice idea i hope i can test your mod soon
thanks for your hard work guys
If you (or other guys/gals reading this) want to help us test our alpha and beta sometime in the future, we'll put you on a list (a good one, I swear!) and invite you once we're ready! Just comment here or write me a PM.
Beyondfubar
Posts: 41
Joined: Thu, 21. Nov 13, 23:03
x3ap

Re: [WIP] X Consumer Goods (XCG)

Post by Beyondfubar »

Certainly! Class is over until next year, and I've nothing to do till then. Well X4 isn't nothing, but it is somewhat less then productive time spent unless I'm tweaking my play experience!
Oderint Dum Metuant
SpaceCadet11864
Posts: 476
Joined: Tue, 4. Dec 18, 02:14
x4

Re: [WIP] X Consumer Goods (XCG)

Post by SpaceCadet11864 »

Just wanted to update everyone on our progress:

After figuring out how to add a ware, its production module, its blueprint and icon, I've decided to automate this process. Partly because we have a lot of wares to add, and partly because I want to minimize "human error" - when adding a ware and the other things that go with it as previously mentioned, I end up having to create 3 files, modify 2 manifest type file, then update 3 more files - and they're spread out in different directories across assets, libraries, and index.

The generator is written in PowerShell, it takes a simplified xml document with a list of wares and generates files if they dont exist or opens them, then it updates the xml or creates the xml. To save time, we're re-using some of the assets from the game, so I allow the document to define a clone of what production module (for example, refinedminerals module copied over to our glassrefinery), so it grabs that, its icon texture by extracting its gz, (becauase of how it resolves icon textures we have to copy it), and wires up all the files together.

It also prefixes every id with xcg, so we dont have collision issues later on.

It's not finished yet, but here is a sample of the addwares.xml that I use to generate everything:

Code: Select all

<addwares>
  <configuration>
    <prefix value="xcg2"/>
    <gamepath value="%PROGRAMFILES(X86)%\Steam\steamapps\common\X4 Foundations"/>
    <modpath value="extensions\XCG2"/>
    <unpackedPath value="unpacked-132"/>
    <defaults/> <!-- collapsed for brevity -->
  </configuration>
  <generation>
    <addware id="glass" cloneProductionModuleFrom="prod_gen_refinedmetals">
      <ware name="Glass" group="refined" transport="container" volume="32" tags="container economy">
        <price min="735" average="865" max="994" />
        <production time="300" amount="60" method="default" name="Glass">
          <primary>
            <ware ware="energycells" amount="50" />
            <ware ware="silicon" amount="80" />
          </primary>
        </production>
      </ware>
    </addware>    
  </generation>
</addwares>
For more information about everything that goes into adding a ware, you can check out my gist here: https://gist.github.com/MattMcFarland/1 ... 5e2ec491a2
TearsInRain
Posts: 73
Joined: Fri, 30. Nov 18, 00:32
x4

Re: [WIP] X Consumer Goods (XCG)

Post by TearsInRain »

I'd like to see a cost per game hour for all our employees as well, and make it substantial...

Employees on stations should consume food and water and if they run out, they should strike and stop production.

Also you could consider maybe a boost if you supply narcotics to them.

Return to “X4: Foundations - Scripts and Modding”