[X3LU] Mayhem 3.21b

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
User avatar
Hector0x
Posts: 998
Joined: Mon, 18. Nov 13, 18:03
x3tc

Post by Hector0x » Thu, 21. Sep 17, 14:49

@Falcrack:
This is all nice and dandy and i've always wanted economics and production like that. But it only works if there is an ai which actually understands all these concepts. X3 ai needs spawning and ship building without any connection to the economy. The no fake thing won't happen. Especially not without a big dev team.
We should hope for X4 laying the foundation and some modders who build your vision on top of it
Last edited by Hector0x on Thu, 21. Sep 17, 16:05, edited 1 time in total.

Falcrack
Posts: 4997
Joined: Wed, 29. Jul 09, 00:46
x4

Post by Falcrack » Thu, 21. Sep 17, 15:26

VincentTH wrote:@Falcrack

You should write your own mod :-)

BTW, Crystals are not only used for SPP as you have claimed. They are also used for Laser production.
I can't write my mod, I have no coding skills :(

The best I could come up with is waving money in front of a modder and say "here, make this mod and I will pay you several thousand dollars", but I can't do that either, as my wife would kill me :)

VincentTH
Posts: 6627
Joined: Wed, 6. Nov 02, 20:31
x4

Post by VincentTH » Thu, 21. Sep 17, 20:07

Falcrack wrote: I can't write my mod, I have no coding skills :(
The problem is some of your suggestion cannot be done (or requires a lot of work) in the context of a mod. For example, changing production scheme of a Solar Power Plant has been a thorn in my side, but that is very hard to do without messing up other factory production.

Shepp
Posts: 196
Joined: Fri, 20. Feb 04, 22:20
x3ap

Post by Shepp » Thu, 21. Sep 17, 21:33

How far along is it typical to get before starting to take over other systems? My current game is far enough along that I've already had my first OCV invasion. I'd like to move into at least on other sector to start some mining but I'm hesitant because I still only have a few combat ships.

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Thu, 21. Sep 17, 22:10

@Shepp

Try going after Unknown Sector Alpha (the NPCs have to conquer a xenon sector to get there, you don't) and then the other Unknown Sectors. The only motivation to claim the other unknown sectors quickly is that the NPCs will take them over rather quickly. Other than that, there is no obligation to scale quickly since the strength of ennemies attacking you is always adjusted to your sector count, aside from the increase in threat level every 24 hours (which gets knocked back if your Sanctuary is destroyed).

From my own experience, it takes at least 5 sectors with full production capabilities to build and equip an invasion force, YMMV.

Try a 'Normal' start if things seem too brutal.

Hope this helps,
-lpa

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Thu, 21. Sep 17, 23:03

@Falcrack

I'll try to address each of your points the best I can with my current understanding of x3, the LU optimizations and Mayhem's way of doing things. Bear in mind that much of x3's approaches to simulate the universe are obscure and cut many corners to favor real-time execution.

(Some of the replies may seem blunt, I'll take my chances and don't mind getting flamed if it's justified.)

0. Some determining factors drive the replies to your points:
a) The X3 series are 'real-time simulations' that must simplify/cheat as much as needed to maintain playable frame rates on a single 'average' processor core. In our case this translates into creating the illusion of a dynamic economy, since computers can only compute so much and programmers are expensive, among other real-life constraints.
b) Modders simply CANNOT script their way around the base game's way of handling things. This is due to the programming architecture.
c) The game's script engine is SLOW (~30x slower than compiled code, according to Jack08). And apart from LU's team, it's all modders have to work with. So while it's feasible to make extensive augmentations, script engine overhead becomes a major hit on the game's performance. Mayhem is actually getting close to that threshold (well, it is on my 2.66 Ghz with no other mods installed).
d) Mayhem is designed to be hard.

1. Having the factions build ships the same way the player does with resources can't be done without basically re-writing most of game and also because of #0. However, it is a stated goal of X4 to have NPCs work with an economy similar to the players'.

2. Mayhem forces you to build your own ships from scratch by design for the challenge of doing so and based on the back-story of being Sohnen (a specie that first appeared in X-Tended for X3, afaik) and being generally hated by other factions as a consequence.

3. Given enough Sanctuaries and ware production facilities, building large fleets is entirely possible. This is again by design to force the player to build all the needed infrastructure. Where the NPCs are concerned, see #1.

4. Also a consequence of #1.

5. That is supposedly the goal of Equipment Docks and Trading Stations : to serve as (illusory, indeed) stockpiles for shipyards.

6. One of the aspects of justifying multi-faction economies is that no faction knows how to build everything they need for ship building and equipping (except the Sohnen :twisted: ) .

7. There are scripts that address both of those aspects:
NPC traders with jumpdrives : available as SPK. Unfortunately. Cycrow's mod-manager isn't compatible with LU, which Mayhem's code is based on. However, it is possible to manually install SPK contents.
Bounty rewards : actually by Joubarbe. It used to be recommended as a Mayhem extension, but not anymore.

8. From what I understand, corporations aren't implemented as species-independent factions in the base-game and only exist as hacked-in features. Wr/t production, see #1. Wr/t to satellites etc, see #0.

9. A consequence of #1 as well.

10. There is a script for that : Crystal-free SPPs. It only applies to the player though.

11. Traders will with the script mentioned in #7. Also dependent on having NPCs rely on a proper economy.

12. I don't see overstocking happening even in the case where NPCs have a full economy. At least not before developing a mature game economy as a player (game weeks +).

13. That's pretty much the intended illusion as it exists already.

14. Improved AI behavior translates into many more processor cycles, the processing and programming needs scale much more than linearly when it comes to AI complexity. See #0.

15. I think that's pretty much the way it actually is: the more sectors a faction posses, the more 'neighboring' sectors will get invaded and vice-versa. It's the impression I have but only Joubarbe can properly confirm or deny that.

16. That would be implied in the case of NPCs relying on a properly simulated economy. #1...

17. The base game just isn't designed to handle factions getting completely wiped out. New stations will always 'appear' in factions' 'origin' sectors even with 0 faction presence. I believe the safe sectors in Mayhem were implemented the way they are because of that.

18. There are a number of key sectors that define the shape of trade routes for the entire universe. Split Fire is one of those, for example. But that point and the others you mention are moot if NPCs use jumpdrives.

----
2 cents, *plink*.
-lpa

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Thu, 21. Sep 17, 23:32

2. Sohnen are from real X universe lore (from X3 Reunion).

8. Wrong. Corporations could be real factions if I had the courage to properly implement them. There are available faction slots, just waiting to be used. That was a goal of Litcube (Phanon), that was a goal of mine; none of us properly did it.

X. Let's wait for X4. X3 needs less ships and less CPU charge. Not more. Each ship must be more important, that's the only way to avoid problems. Mayhem is already very laggy to my taste.

If menus were customizable, many things would be possible. Including a total overhaul of the factories; how they produce, how they interact with each other... I have a full gamedesign document on a proper economy, and I probably have the coding skills... but as in everything in life: I don't have the money or the will to do it. It takes more than ideas to change the world :)

Falcrack
Posts: 4997
Joined: Wed, 29. Jul 09, 00:46
x4

Post by Falcrack » Fri, 22. Sep 17, 02:58

So, I went a bit overboard with suggestions. I had a really slow day at work, and a lot of time to think about stuff, so I spent a fair chunk of the day writing that up!

In retrospect, I suppose my main concern with having NPC shipyards need wares to build ships is that I wanted the territory and factories held by the NPC factions to have some bearing on their ship building capacity.

So I have a basic question. Is the production ability of NPC shipyards influenced by any in-game variable, such as number of sectors owned, or number of factories owned by an NPC faction? So basically, are bigger factions any more powerful due to increased shipyard production? Do they get more shipyards than smaller factions because they have more territory?

User avatar
Joubarbe
Posts: 4796
Joined: Tue, 31. Oct 06, 12:11
xr

Post by Joubarbe » Fri, 22. Sep 17, 03:50

Shipyards themselves always build at the same rate. I intend to change that, but for now, the only variable is how many shipyards they have. Obviously, if a faction has more shipyards than another, it will build more ships overtime.

Falcrack
Posts: 4997
Joined: Wed, 29. Jul 09, 00:46
x4

Post by Falcrack » Fri, 22. Sep 17, 05:06

Joubarbe wrote:Shipyards themselves always build at the same rate. I intend to change that, but for now, the only variable is how many shipyards they have. Obviously, if a faction has more shipyards than another, it will build more ships overtime.
I notice each of the sectors has a value in the war report screen. Maybe the value could correspond to the amount of production points they contribute, which are distributed across the various shipyards?

To prevent one faction from overrunning all the others, perhaps they will stop trying to conquer new territory once they reach a critical size. In addition, the bigger they get, the higher threat level they get, and the more other factions will tend to gang up against them to cut them down to size?

Nefasi
Posts: 24
Joined: Sun, 21. Sep 14, 05:23
x3tc

Post by Nefasi » Fri, 22. Sep 17, 11:27

Falcrack wrote: To prevent one faction from overrunning all the others, perhaps they will stop trying to conquer new territory once they reach a critical size. In addition, the bigger they get, the higher threat level they get, and the more other factions will tend to gang up against them to cut them down to size?
You could take the sectors from the faction overrunning others and give them to others.

I could be wrong, but I believe the same assets a faction uses to take sectors are the same assets it uses to defend them. If you hit a few sectors in hit and runs that should keep them tied up, allowing other factions to take sectors uncontested or with little resistance and you can probably take a few out before having to retreat.

Personally, I like the idea of a dynamic victor depending on how the cards fall. If gives the feeling of an actual war going on.

Falcrack
Posts: 4997
Joined: Wed, 29. Jul 09, 00:46
x4

Post by Falcrack » Sun, 24. Sep 17, 04:25

I have a hopefully not too difficult to implement suggestion. Since the tuning when your ships dock at a sanctuary is free, would it be possible to make it so that anytime your personal ships dock at a sanctuary, they automatically receive the tuning upgrades?

sky7105
Posts: 1
Joined: Sun, 24. Sep 17, 05:13
x3ap

Post by sky7105 » Sun, 24. Sep 17, 05:32

good!

VincentTH
Posts: 6627
Joined: Wed, 6. Nov 02, 20:31
x4

Post by VincentTH » Tue, 26. Sep 17, 09:03

Falcrack wrote:I have a hopefully not too difficult to implement suggestion. Since the tuning when your ships dock at a sanctuary is free, would it be possible to make it so that anytime your personal ships dock at a sanctuary, they automatically receive the tuning upgrades?
Sigh! So now Joubarbe will make tuning cost something!!!! :-)

Falcrack
Posts: 4997
Joined: Wed, 29. Jul 09, 00:46
x4

Post by Falcrack » Wed, 27. Sep 17, 02:54

I got some super important questions:

Regarding food.
1. What is the formula the game uses to calculate amount of food consumed at sanctuaries?

2. Is it based on refugee population?

3. Do slaves consume food?

4. If multiple food types are present, is food consumption lowered for each food type? For example, 1 meatsteak cahoona per minute might be consumed if it is the only food type present, but if two food types are present, it is 1 meatsteak and 1 BoFu every 2 minutes, if 3 food types are present, it is 1 meatseak, 1 BoFu, 1 Soja Husk every 3 minutes, etc? If consumption is not reduced with multiple food types, then it makes no sense to me whatsoever to keep multiple food types present, because it would just be double, triple, quadruple, or more the cost to myself with each new food type present.

5. Are different food types consumed at different rates? BoFu is super expensive compared to scruffin fruits, if it turns out my people consume 1 BoFu at the same rate as 1 Scruffin fruit, then my people will eat nothing but scruffin fruits, forever.



Finally, a non food related question.

Were there any adjustments made to factory resource requirements and production rates compared to vanilla X3 TC for Mayhem? I am balance resource producing factories (cattle ranch, meatsteaks, solar power plants, crystal fabs) with end product factories (chip plants, computer plants, etc) and wondered if I could use the online complex calculator for X3, or if that tool is obsolete. If there are changes, where would I go to see what the changes are?

lostProfitssssArrgh
Posts: 161
Joined: Tue, 22. Aug 17, 13:14

Post by lostProfitssssArrgh » Wed, 27. Sep 17, 08:50

@Flacrack

1. Script: Mayhem.Monitor.Shipyard.Player.xml

Code: Select all

$playtime = playing time

$timeConsumption = [THIS]-> get local variable: name='mayhem_timeConsumption'
....
$foodPerPeople = get global variable: name='mayhem_foodPerPeople'
....
if $playtime - $timeConsumption >= $cycle.Consumption

    [THIS]-> set local variable: name='mayhem_timeConsumption' value=$playtime

    $allFood = [THIS]-> call script 'Mayhem.GetMaxFood' : getArray=[TRUE]
    $allFood = [THIS]-> call script 'Joubarbe.Lib.RandomizeArray' : srray=$allFood
    $nourrished = 0

    for each $food in array $allFood
        $qty = [THIS]-> get amount of ware $food in cargo bay
        $need = ($people - $nourrished) * $foodPerPeople

        if $qty >= $need
            $neg = $need * -1
            = [THIS]-> add $neg units of $food
            $nourrished = $people
        else if $qty > 0
            $neg = $qty * -1
            = [THIS]-> add $neg units of $food
            $nourrished = $nourrished + ($qty / $foodPerPeople)
        end

        do if $nourrished >= $people
            break

    end

    if $nourrished < $people AND $people > 0
    $qty = 0
    $starved = $people - $nourrished
...
**** Starvation kills a few people at every check time
External dependencies:

Code: Select all

**** Mayhem.BuildStation.xml
'mayhem_timeConsumption' = $playTime
**** setup.Mayhem.xml
= [NULL]-> call script 'Joubarbe.Lib.LoadTextInteger' : page=9972 id=9 variable='mayhem_foodPerPeople'
**** 9972-L044.xml >  page=9972 id=9
2
**** So 2 units of edible food per person per time cycle
You should get X-Studio and X3 Editor 2 to satisfy your curiosity in the future.

2. Yes, see answer #1.

3. No.

4. See this past reply to a similar question of yours.

5. See #4.

Finally...:
A quick look doesn't reveal changes to stations' base production rates, I could be wrong though.
Wr/t using a complex calculator: keep in mind that Mayhem introduces L variants to S size stations (production rates for S is 1x, M=2x, L=5x, XL=10x).

Falcrack
Posts: 4997
Joined: Wed, 29. Jul 09, 00:46
x4

Post by Falcrack » Wed, 27. Sep 17, 15:21

They shall feast on Scruffin Fruits then! It makes the most for the least input, and only requires 1 factory instead of 2. I'll just use my initial sector to make scruffin fruits, and export the excess to other sectors

As to L sized variants being introduced, I was wondering why it seemed like 1 cattle ranch + 1 cahoona bakery could only support 1 factory (like a quantum tube fab), and not several.

I restarted my game after 3 game days. The 3rd OCV invasion is proving too tough to handle, and I can't build up my military fast enough from any of my saves to adequately counter them. Oh well, live and learn.

So here is my initial sector plan. I plan to import energy, silicon wafers, and ore

1. Chelts meat (to feed people initially, then to support Rastar Refinery)
2. Teladianium (station building material, sell excess)
3. Wheat farm (support Rimes Fac)
4. Rimes fac (station building material, sell excess)
5. Rastar refinery (station building material, sell excess)
6. Scruffin Farm (to feed sanctuaries, sell excess)
7. Cattle Ranch (for Bakery)
8. Cahoona Bakery (to maintain Chip Plant)
9. Crystal Fab (for laser production, selling, and to support SPP in additional sector when I get one)
10. Cattle Ranch (for Bakery)
11. Cahoona Bakery (to maintain Computer Plant)
12. Chip Plant (for ship production and selling)

VincentTH
Posts: 6627
Joined: Wed, 6. Nov 02, 20:31
x4

Post by VincentTH » Wed, 27. Sep 17, 16:27

Falcrack wrote:
I restarted my game after 3 game days. The 3rd OCV invasion is proving too tough to handle, and I can't build up my military fast enough from any of my saves to adequately counter them. Oh well, live and learn.
OWPs and Lasertowers are your friend. The Lasertowers would drain the target ship of energy and render the hostile ship disabled.
When you receive the OCV signal, you have 4 hours, good enough time to build 2 Medium OWPs (depending on the population of your sanctuary, give or take). Relocate them (and deploy the lasertowers nearby to protect the OWPs) at the final warning, when you know wheat direction the OCVs are coming from.

Szynszyl
Posts: 276
Joined: Fri, 2. Jan 09, 20:23
x4

Post by Szynszyl » Wed, 27. Sep 17, 18:17

Hello,
I play with litcube and Mayhem long time ago and i have big problem with food consumpion by sancuary. I want to know it is still that huge?

User avatar
Hector0x
Posts: 998
Joined: Mon, 18. Nov 13, 18:03
x3tc

Post by Hector0x » Wed, 27. Sep 17, 18:27

Szynszyl wrote:Hello,
I play with litcube and Mayhem long time ago and i have big problem with food consumpion by sancuary. I want to know it is still that huge?
No, they are on rations now.

VincentTH wrote:OWPs and Lasertowers are your friend. The Lasertowers would drain the target ship of energy and render the hostile ship disabled.
When you receive the OCV signal, you have 4 hours, good enough time to build 2 Medium OWPs (depending on the population of your sanctuary, give or take). Relocate them (and deploy the lasertowers nearby to protect the OWPs) at the final warning, when you know wheat direction the OCVs are coming from.
Also note that you can use the shields of your stations to drain the enemy of missles and laser juice too. So place the OWPs behind your factories and lure them in your defence later on with wasp missles or something.
Falcrack wrote:So here is my initial sector plan. I plan to import energy, silicon wafers, and ore
I tried to be self sufficient with ore and silicon and built only mines in my asteroid sector. Food is important of course. And some of the station production components.
If you maintain some friends i wouldn't bother with the tech (quantum tubes, computer and chips). They are small and i had a cheap trader (M4 even) on the ready at the corresponding selling locations at all times and just bought them as needed. Later i switched to the Dockware manager and maintained a little stockpile in my dock to build small ships in small bunches or bigger ships one at a time.
Last edited by Hector0x on Wed, 27. Sep 17, 18:40, edited 2 times in total.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”