An optimization pass on the game would be an extremely welcome sight

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

tomoyat1
Posts: 6
Joined: Thu, 17. Apr 25, 05:19
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by tomoyat1 »

jlehtone wrote: Wed, 6. Aug 25, 08:56 To be fair, the "OOS combat resolution" is currently using some "probability tables" as guns do not make same damage every "round" of combat. There is variance, some probability distribution for chance of hit and/or amount of damage and it seems to be different for different loadouts. Hence "tables" ("models"). These models are obviously "precalculated" (and we see from outcomes that they still do not match IIS combat resolution as closely as we would like).
(May be off topic, but I couldn't resist...)
IS and OOS combat do not match to the point that it feels like I'm playing two separate games at times. Different weapons and tactics are better for IS and OOS.
I would like more simililarity in how effective a Xenon Graviton Turret is when in IS and OOS so that I don't have to watch everything IS to preserve my Xenon. However introducing more approximations as proposed would just further widen the gap. (Unless done "ideally", but who knows whether that's possible)
CBJ
EGOSOFT
EGOSOFT
Posts: 54271
Joined: Tue, 29. Apr 03, 00:56
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by CBJ »

For a bit of lunchbreak fun, I will give a quick demonstration of the mathematical absurdity of trying to create a table of outcomes. I'll use round, but very, very conservative numbers throughout.

First, take the encounter space. Let's say it's only 10km across, and we don't need to be too precise, so let's break it down into a sensible "resolution" on which to base relative positions for an encounter. We'll just divide it up into 1km cubes.

Next, we'll take the whole range of possible ships and lump them together into 10 different ship types.

Then we'll group all the vast range of possible loadouts, including engines, shields, weapons, equipment mods, and so on, and throw those into just 10 different loadout buckets.

Finally, we'll take all the possible crew details, orders and other external factors, and group them into 10 influence categories.

I'm sure you can spot a pattern with the numbers here, but I think you'll agree that they are pretty conservative.

Now, to simulate an encounter, we just need to place two or more ships into our encounter space and store the likely outcomes for each combination, right?

Placing just one ship gives us 10x10x10 (for the location in the encounter space) x10 (for the ship type) x10 (for the loadout) x10 (for the other influences) = 1 million (10^6) possible initial starting values. That's quite a big number to work with, but it's just about manageable because we have powerful computers.

The trouble starts when we add a second ship to create the simplest possible encounter, because that gives us 1m x 1m = 1 trillion (10^12) different combinations for our "table". Now things are getting a little tricky, and it could take a while to calculate them all, and quite a bit of space to store them. But let's press on.

We don't tend to have encounters consisting of just two ships; in reality we have big battles. Sticking with round but still very conservative numbers, let's place a limit of 10 ships. Even ignoring all the battle scenarios with fewer than 10 ships as "insignificant" and just taking those with exactly 10 ships, we now have 10^60 different combinations. That's a number that doesn't even have a name that's in common use; it's also slightly more than we can realistically precalculate, even with a powerful computer.

Now, just for laughs, let's extend the limit to 14 ships, which is still pretty conservative. At that point we reach 10^84 combinations, which is now more than the estimated number of atoms in the observable universe. Good luck finding a way to store the results.

PS. I'm sure someone will pick holes, like "your encounter space can be reflected or rotated to reduce the number of combinations", to which I would counter that there are important factors that I didn't bother to include, such as the orientation of the ships. Even optimising a few things and ignoring the additional complications, the numbers still get very, very out of hand rather quickly. :)
vvvvvvvv
Posts: 1324
Joined: Tue, 28. Nov 23, 15:38
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by vvvvvvvv »

CBJ wrote: Wed, 6. Aug 25, 14:44 For a bit of lunchbreak fun, I will give a quick demonstration of the mathematical absurdity of

...

PS. I'm sure someone will pick holes, like "your encounter space can be reflected or rotated to reduce the number of combinations",
Yup. Also there aren't any holes. Even with very small number of ships things explode in number of possible combinations.
Shadow_rainbow
Posts: 41
Joined: Thu, 10. Apr 25, 06:28

Re: An optimization pass on the game would be an extremely welcome sight

Post by Shadow_rainbow »

CBJ wrote: Stuff
Here, you're effectively describing the most direct approach to a mesh computational model, generally used (in its more advanced form) in computational air/fluid dynamics (like finite volume variation). Of course, approaching such a problem head-on, especially when adding complexity layers, will quickly hit a wall in computation and storage capacity. In practical application, it is always optimized in a number of ways. Also, it is not really scalable without losing accuracy.
Unlike modelling some physical substance, however, we're lucky in several ways. First, our objects are not interconnected. Second, they are not random and are predictable in a number of ways. Third, their values can be both continuous and generalized when it comes to some properties. So, they can be both decoherent from most of the swarm and clusterised.

To think of it, my proposal is also similar to mesh computation, only being closer to finite element and replacing mesh with graphs. That opens up many possibilities.

For your first example, the space of the encounter itself. Storing 10km as 1000 cubes can and must be replaced with storing position in timed points of trajectories (since ship movement can be accurately described with those). So, instead of 1000 cubes each cycle, we only have a single point on a trajectory piece.
That, of course, needs a standard library of trajectory pieces and an assembly map (list or even stack, effectively) for those used by the ship in encounter. But it, unlike static 1000 cube resolution, can be optimized in known (and yet unknown, applicable only to the game mechanics) ways. We won't even need to run the whole bunch through high-resolution Fourier transformer each cycle of the simulation, just run it once per simulation session, saving power on pre-calculating end. Also, despite library volume and map length, both don't multiply with each layer above, first being static (being in fact the most basic layer) and second being per-entity.
Effectively, that turns 10 unvectored coordinates in 10x10x10 space into 1 vectored curve piece location, 1 curve type and 1 curve position, repeated 10 times if we're storing ships as separate entities, or 1 time if we're storing them as a group.
And I suppose the first piece (vectored curve start location) can be optimized upon pretty heavily, like storing relative positions of close vectors in flat or even linear space instead of 3D. I'm not into that math, but outside of that, encounter type should provide us some basic optimization in that regard. That also gives us ability to discern true 3D starts for encounters and 2D ones (since X is generally played out flat-like), further saving dimensions.

As for ship types, yes, clustering ships by capability is a way that seems good for optimizing. It's not like there is a drastic difference in performance between many similar ships, despite their slightly different handling.
Ships also usually have more or less standard loadouts, which can help with this generalization even in cases when loadout elements are missing due to action. That damage seems to be the main hog on our space. Lucky for us, these are quite granular and are generally static (like engine state which is either working, damaged and destroyed). Also, like flight curve path library, it is static and not multiplied per-entity in data volume assessment.

Crew orders, as I see it in application to encounter, can be clustered into just 3 states -- attack/escape, coordinated/uncoordinated, hull/subsystem. The first one would be interchangeable if there was a squadron AI. So there doesn't seem to be a need for 10 variations of those. Again, these can be stored in a static list for all the entities.

Of course, I'm missing a whole lot of optimization here, but in general, instead of 10^6 states per ship, we have following:
1. Encounter type. Number from 1D list, used once.
2.a. (raw) Per ship: curve piece vector in 3D, curve type (stack), curve point (1D, stack?)
2.b. (with optimization) Per large group parts: 1 vector 3D per group part, group part member curve displacement (1D), curve point (per ship).
3. Ship types (1D list)
4. Ship loadouts (2D table)
5. Crew orders (1D list).

So instead of monstrous multi-dimentional matrix that continues growing (it shouldn't do that this quickly, but that's not the point), we're down to only several actually moving parts. Effectively, a list/table of 5 values/lists + vector + 2D table per state. Each easily accessible from simple data structures, I might add. And I'm sure vector and table parts are heavily optimizeable, as well.
Also, if we'd have the full spectrum of simulation results, I'm pretty sure we could use much more heavy optimization with standard (or new, X4-specific) tools for optimization.

Also also, unlike discrepancies mentioned above, it would be significantly more true to behavior observed by players since it'd be a product of direct, not simplified simulation. Especially since I thought of this in light of simulating in-sector encounters.

/EDIT Some typos/corrections. Also also also, we're talking groups as single ships interacting with each other just now. But that's completely unnecessary in most points of simulation. It's usually small groups dishing it out against each other or even a single ship in a small amount of space. That, of course, increases the number of encounter parts, but also reduces volume for each encounter -- and that's what we need, since we're looking for a way do describe it in a shortest way possible.
Last edited by Alan Phipps on Fri, 8. Aug 25, 09:54, edited 1 time in total.
Reason: shortened quote
CBJ
EGOSOFT
EGOSOFT
Posts: 54271
Joined: Tue, 29. Apr 03, 00:56
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by CBJ »

I'm not sure which is more impressive, the sheer number of false assumptions, or the creativity of the pseudo-mathematical hand-waving. I'll leave you to it. :)
Shadow_rainbow
Posts: 41
Joined: Thu, 10. Apr 25, 06:28

Re: An optimization pass on the game would be an extremely welcome sight

Post by Shadow_rainbow »

CBJ wrote: Fri, 8. Aug 25, 10:09 I'm not sure which is more impressive, the sheer number of false assumptions, or the creativity of the pseudo-mathematical hand-waving. I'll leave you to it. :)
If I'm wrong somewhere, please feel free to correct me.
Y-llian
Posts: 578
Joined: Tue, 16. Jan 07, 21:46
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by Y-llian »

Speaking purely as a customer (and also accepting that the view of a single customer is statistically insignificant) if the dynamic / economic simulation is removed I likely will not continue to play the game or purchase expansions. Personally, that will be a shame as I’ve enjoyed every game since XBTF.

For me, the simulation is this product’s USP (unique selling point) there’s really nothing comparable on the market in what X4 attempts to achieve. Is it perfect? No, though few things are… But ripping the core of the game out would be a step too far for me.

Best
Y.
zakaluka
Posts: 586
Joined: Sat, 16. Nov 13, 19:47
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by zakaluka »

I can't believe this thread is still going on. Start your own game development company
Shadow_rainbow
Posts: 41
Joined: Thu, 10. Apr 25, 06:28

Re: An optimization pass on the game would be an extremely welcome sight

Post by Shadow_rainbow »

zakaluka wrote: Fri, 8. Aug 25, 15:56 I can't believe this thread is still going on. Start your own game development company
Well, the game didn't start to run faster in aforementioned moments for me, so it's still relevant. And hey, we're just discussing here, no need to kick me out to start a whole new game just because this one doesn't have good performance in significantly large battles.
User avatar
chew-ie
Posts: 6680
Joined: Mon, 5. May 08, 00:05
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by chew-ie »

zakaluka wrote: Fri, 8. Aug 25, 15:56 I can't believe this thread is still going on. Start your own game development company
I'm following quite a few discussions about experts having a lot of ideas to easily improve performance or produce better AI in no time. TBH I'd like all of those guys'n gals to submit evidence they really can do better.

At the end, this would mean more space games for us. :D
Image
Spoiler
Show
BurnIt: Boron and leaks don't go well together...
Königinnenreich von Boron: Sprich mit deinem Flossenführer
Nila Ti: Folgt mir, ihr Kavalkade von neugierigen Kreaturen!
Tammancktall: Es ist eine Ehre für sie mich kennenzulernen...
CBJ: Thanks for the savegame. We will add it to our "crazy saves" collection [..]

:idea: Feature request: paint jobs on custom starts
zakaluka
Posts: 586
Joined: Sat, 16. Nov 13, 19:47
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by zakaluka »

Shadow_rainbow wrote: Fri, 8. Aug 25, 20:15we're just discussing here
you're insulting and don't even realize it. every page of this several month long thread.

I have a case of, how do you say it, fremdschamen
Shadow_rainbow
Posts: 41
Joined: Thu, 10. Apr 25, 06:28

Re: An optimization pass on the game would be an extremely welcome sight

Post by Shadow_rainbow »

CBJ wrote: Fri, 8. Aug 25, 10:09 I'm not sure which is more impressive, the sheer number of false assumptions, or the creativity of the pseudo-mathematical hand-waving. I'll leave you to it. :)
Well OK, on second thought, maybe storing curve information in encounter state is incorrect. Since encounter recording is quantized by time and flight path is quantized by curve segments, it's appropriate to store the former as a reference and second as a proper path. This just adds another data store to this.
So, the flight path storage should be stored in form of segment numbers coupled with their orientation. Starting points should be stored along with their vectors, allowing for optimization.
That adds a new table, but removes everything connected from the main recording besides the curve number. Yes, the new table will be additive with the number of ships or groups, but it will not be multiplicative in encounter data size. Also, having flight paths in a separate table might open a path for optimizing the storage of that data.

And again, I'm talking separate ships and grouping just some data about them. Imagine what could be done with the scale if ship groups could be grouped into rigid packages that can operate and be stored as one entity with just differences in individual data being recorded.
vvvvvvvv
Posts: 1324
Joined: Tue, 28. Nov 23, 15:38
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by vvvvvvvv »

Shadow_rainbow wrote: Sat, 9. Aug 25, 06:37 So, the flight path storage should be stored in form of segment numbers coupled with their orientation. Starting points
You need to try prototyping it in code so you properly hit every problem you are not seeing right now. Because you obviously have an incredibly vague idea and a feeling that "this should work", and your idea is not an algorithm. Do the R&D. Hit the walls and landmines.

That's actually what you do when you think you're onto something but everybody disagrees for some reason you don't understand. You make a prototype. Then you discover everything that is wrong with the idea first hand.

For an example, "starting point of trajectory" has between 2^96 and 2^192 possible states depending on precision. You won't be precomputing anything for it.
Shadow_rainbow
Posts: 41
Joined: Thu, 10. Apr 25, 06:28

Re: An optimization pass on the game would be an extremely welcome sight

Post by Shadow_rainbow »

vvvvvvvv wrote: Sat, 9. Aug 25, 06:56
Shadow_rainbow wrote: Sat, 9. Aug 25, 06:37 So, the flight path storage should be stored in form of segment numbers coupled with their orientation. Starting points
You need to try prototyping it in code so you properly hit every problem you are not seeing right now. Because you obviously have an incredibly vague idea and a feeling that "this should work", and your idea is not an algorithm. Do the R&D. Hit the walls and landmines.
If I was building a game engine piece, I would do just that, of course. But before prototyping, you have to understand if your general idea is sound. Like throwing it around with some other people and seeing how viable it can possibly be. It's a waste to prototype stuff just to discover it's utterly unapplicable to the case you've prototyped for.
Also, it's a good way to unwind your brain and let off a bit of steam after being enraged by X4's limitations. It's not like I'm building my own game engine here :mrgreen:
vvvvvvvv wrote: Sat, 9. Aug 25, 06:56 That's actually what you do when you think you're onto something but everybody disagrees for some reason you don't understand. You make a prototype. Then you discover everything that is wrong with the idea first hand.
If you have a person that disagrees with you, it's much more efficient to just ask that person of their reasoning and try to understand why do they disagree. They might provide you with a solid reason on why your idea can't work altogether, or provide an insight of some cases where it can work bad, or anything else, including being wrong completely. It's not like a programming contest where both you and your opponent try to solve some puzzle and compare the results.
For example, u/CBJ's reasoning provides us with an example of trying to approach storing the encounter data in a direct way. I think he's multiplying way too much, resulting in many magnitudes more than required, but that provides a good point to detail some features that might be good when we switch to other methods.
vvvvvvvv wrote: Sat, 9. Aug 25, 06:56 For an example, "starting point of trajectory" has between 2^96 and 2^192 possible states depending on precision. You won't be precomputing anything for it.
How did you arrive at these numbers of encounter starting point count for participant?



chew-ie wrote: Fri, 8. Aug 25, 21:08experts having a lot of ideas to easily improve performance or produce better AI in no time. TBH I'd like all of those guys'n gals to submit evidence they really can do better.
This happens not because so many people want to offend the great game. It happens because the game is lacking in so many areas. Those who step up with their criticisms don't want another game, they want this game to be made better. Because they like it in some aspects, but suffering in some way because of something. Otherwise, they would not have wasted their time with forum and would've simply moved on.
Spoiler
Show
For example, I like flight and shooting mechanics in X4 a lot. But seeing how wingmen escorting the destroyer I've plugged some area with just fly away to sacrifice themselves en masse upon nearest defence platform's guns -- just to get to some light freighter parked near it, which was not threatening their capital in any way -- is just appaling, like literally killing my fighting spirit.
Squadron on squadron battles are a mess. Even Dungeon Keeper had an interface to the battle encounter, allowing you to see what's going on, make decisions and take actions in time.
Many flight games allow for at least 'ignore target' order. Not getting into capital's main gun range, if I remember it correctly, was implemented in Descent Free Space and, maybe, even in X-Wing. At least I don't remember my wingmen killing themselves on capital's guns, unless I ordered them to. Like bear-baiting, with a keystroke to attack subsystems. The one you had to install a whole third-party-python-server-based mod for X4 (now defunct BTW).
Strike package structure is a more rare thing to see. I only remember in in Falcon 4. Might be usable feature to attack stations in X4, but not much else (compared to coordinated attack).

All this just displays that people have seen things implemented. They've seen how they worked and wondered how much better that would make the game they like, X4. And yes, it is common that such people are greeted with a cold shoulder and
zakaluka wrote: Fri, 8. Aug 25, 21:25 fremdschamen
from some people of the community thinking all these guys want to do is to harm the game.
Just remember that even a hater is a fan. Just of the disappointed sort.
But please, this topic is about optimization, low performance in X4 and the such. IMO discussing how much cringe I can bring to a person or my other qualities is really for some other ones.
vvvvvvvv
Posts: 1324
Joined: Tue, 28. Nov 23, 15:38
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by vvvvvvvv »

Shadow_rainbow wrote: Sat, 9. Aug 25, 08:01 If I was building a game engine piece, I would do just that, of course. But before prototyping, you have to understand if your general idea is sound. Like throwing it around with some other people and seeing how viable it can possibly be.
No, to understand, you have to build a prototype. The purpose of a prototype is quick test of an idea. You build it, thne you dispose it. As for "throwing it around with other people", you already saw the reaction to yours.
Shadow_rainbow wrote: Sat, 9. Aug 25, 08:01 If you have a person that disagrees with you, it's much more efficient to just ask that person of their reasoning and
And then you can indefinitely ignore everything that person said and keep insisting that you're right. You can also tell yourself, that clearly the other guy did not understand your idea fully or overlooks some minor things. Or that he is incompetent. Or that he is a forum troll.

That's what humans often do.

Prototyping is faster. Because there's nobody to argue with. Meaning when you find you were wrong, your only option is to accept it.
Shadow_rainbow wrote: Sat, 9. Aug 25, 08:01 How did you arrive at these numbers of encounter starting point count for participant?
That's number of possible values a 3 component vector of single/double precision can have.
Shadow_rainbow wrote: Sat, 9. Aug 25, 08:01 But please, this topic is about optimization, low performance in X4 and the such.
In Beta branch someone reported 120 fps with frame generation. And your earlier arguments mentioned low framerate during BATTLE, which undermines your claim that he simulation is causing slowdown.

Make a prototype. Test it. See the problem.
User avatar
chew-ie
Posts: 6680
Joined: Mon, 5. May 08, 00:05
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by chew-ie »

vvvvvvvv wrote: Sat, 9. Aug 25, 08:19 Make a prototype. Test it. See the problem.
Aye. Like xixas :) - he tested his theory of real-time saving and did some awesome work with his prototype:

viewtopic.php?p=5104798#p5104798
https://github.com/xixasdev/tinyspace
Image
Spoiler
Show
BurnIt: Boron and leaks don't go well together...
Königinnenreich von Boron: Sprich mit deinem Flossenführer
Nila Ti: Folgt mir, ihr Kavalkade von neugierigen Kreaturen!
Tammancktall: Es ist eine Ehre für sie mich kennenzulernen...
CBJ: Thanks for the savegame. We will add it to our "crazy saves" collection [..]

:idea: Feature request: paint jobs on custom starts
User avatar
alt3rn1ty
Posts: 3481
Joined: Thu, 26. Jan 06, 19:45
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by alt3rn1ty »

vvvvvvvv wrote: Sat, 9. Aug 25, 08:19 In Beta branch someone reported 120 fps with frame generation.
.. Landed on a station, chilling out in the conservatory watching a TRI fleet taking on a BUC fleet in the near vicinity of the same station = just shy of 180 fps (The in game fps counter bottom right of the screenshot) https://i.imgur.com/pnH2Hu5.png
I chose just to show the fleet battle going by with the bullets/beams/plasma exchanges (not easy to see it all in a still picture), but could have also shown this in the map view while landed on this station with the near battle going on and it would still be 180 fps.

-------------------------

On my laptop I have the game max frame rate capped at 180 with X4 8.0 Beta 5, so currently its not going to go higher than that. Previously I mentioned I was at 120 cap, I have only had this new laptop a few months so I am slowly learning its capabilities and tweaking things cautiously upwards (heat being the main thing to avoid in the confines of a laptop).

I have seen a larger battle take the fps down to 100 fps .. I used to dream of maintaining up to 60, and was happy with the game being above 30 most of the time, the new betas have taken this game way beyond my wishes.

I mentioned it earlier in this topic, if you have an NVidia 40xx or 50xx GPU (no clue what your machine specs are as its not been mentioned), you really ought to be testing the current beta instead of suggesting ridiculous ideas nobody wants, its giving me unprecedented results.

We already have to put up with the disparity of IS (High attention) v OOS (Low attention) combat results in the name of performance, lets not also cut down on more OOS features we love the game for. Egosoft have always had budgets with their scripting for example on traders, and balanced that with not losing too much in the X'verse simulation, to which the community typically responds with scripts to solve the problematic results such as Lucike's excellent mods and the many other script modding done for the X3 series of games, all of which contributing to lowering the performance of the game, but were still very popular with fans because we want the out of sector simulation to be as accurate as it can be. These days with current technology you can run every mod ever made for X3 Farnhams Legacy, and the simulation is as smooth as butter no matter the circumstance. We dont wish to see for example left over cargo after a trade could not be fully completed, just vanish unexplainably or remain in the cargo hold forever after because the left over has been forgotten about limiting the cargo space. Instances similar to this are always getting reported in Betas as bug reports, to which Egosoft responds with an "Oops, we'll get it fixed". They are proud of the universal simulation and nobody wants it to be nibbled away.
This game series matures with time (not just months, but many years, and unlike the creators of Star Citizen, Egosoft delivers), and when Egosoft finishes the product entirely a few years later you will have the machine which can run it perfectly. In the PC world everyone knows you cannot expect to be running the same machine for any great length of time, its not like a games console where you have a reasonable expectation that all games developed for it will strictly adhere to the budgets allowed for the spec.
I have moaned about it sometimes that the game should be able to run any of its scenarios given the minimum published specifications for the game (thats Desktop specifications, they cant give laptop specifications which are far too variable and mostly a lot less capable than the desktop given the same model of CPU / GPU etcetera), but this game series is very much a different kettle of fish, it aspires to being good on future machines after all development has ended (even then, they still surprise us with more updates, and as with X3 Farnhams Legacy, they let the more skilled Modders participate with members of the Egosoft team to expand it even more).

I have been a fan of the game series since X2 The Threat, and a member here since 2006, I cant honestly see your well studied proposals / efforts here changing Egosofts approach or aspirations. IMHO its wasted effort from someone who is obviously quite intelligent, your efforts and time would be put to better use beta testing.
Your choice of course.

Edit: Reference the mention of "Reports all over the Internets" in the OP, yes there are many impatient people now the game series is getting more widely advertised by fans on youtube/reddit etcetera, low attention spans of your average gamer who want everything done yesterday, and will demand their money back as a threat if nothing gets done immediately :) .. 'uman beans.
Last edited by alt3rn1ty on Sat, 9. Aug 25, 11:22, edited 7 times in total.
Spec's@2025-05-17 - Laptop - Acer Predator Helios Neo 16 AI - Win 11 x64
CPU - Intel Core Ultra 9 275HX 2.7-5.4ghz, RAM - 32gb DDR5 6400(OC),
Discrete GPU - NVidia Geforce RTX 5070 Ti, VRAM 12gb GDDR7,
SSD - M.2 PCIe NVME 1Tb
, OLED WQXGA 2560x1600.
:goner: Seeker of Sohnen. Long live Queen Polypheides. :boron:
vvvvvvvv
Posts: 1324
Joined: Tue, 28. Nov 23, 15:38
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by vvvvvvvv »

chew-ie wrote: Sat, 9. Aug 25, 08:42
vvvvvvvv wrote: Sat, 9. Aug 25, 08:19 Make a prototype. Test it. See the problem.
Aye. Like xixas :) - he tested his theory of real-time saving and did some awesome work with his prototype:

viewtopic.php?p=5104798#p5104798
https://github.com/xixasdev/tinyspace
Yup, that's the proper way to do it.
jlehtone
Posts: 22541
Joined: Sat, 23. Apr 05, 21:42
x4

Re: An optimization pass on the game would be an extremely welcome sight

Post by jlehtone »

Set up an encounter -- two fleets (one or more ships each) -- about to meet. The modding makes this possible for a player. Let the encounter run to completion -- one side is dead -- in high attention. Record the outcome: "winner", state of winner, and elapsed time.

Repeat this encounter a thousand times (or preferably more). Collate the results. Form a statistical model: shapes of distributions, variance, etc that describes the result.

Repeat the encounter some more times to verify that the model predicts adequately. Then repeat the encounter in low attention (multiple times). See how well the results fit into the model. Our observations from the game say that they will not.

All this you can do.


Theoretically, if the low attention combat resolution would use the new model, then the battle outcomes would be closer to high attention results.


Alas, you:
(a) made a model for only one pair of fleets. You would have to make models for every possible combination of ships and loadouts -- or prove that one model can predict more than one fleet type.
(b) know that we did predict above the result of whole encounters, which take variable time. The low attention combat is essentially turn-based. Possibly "what did happen in 30 seconds?", not "how will this end?" The evil (player) can at any moment incarnate into the area, rather than wait for the battle to be over.


---

If my fighter's hull is shot down to 1%, I still have same DPS as when intact. If you handle a fleet as one "point" and that fleet takes 30% damage, is that a loss of 30% of the ships, which reduces the DPS of the fleet by 30%, or 30% hull damage to each ship (which has no effect on the DPS)?


If small Galaxy has lower FPS than large Galaxy, then the logical conclusion is to make the Galaxy larger to increase the FPS, rather than to make the Galaxy lighter. Obviously there were other variables, so that conclusion is probably based on incomplete facts and therefore less reliable. You need facts and prototyping can give some.
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.
Shadow_rainbow
Posts: 41
Joined: Thu, 10. Apr 25, 06:28

Re: An optimization pass on the game would be an extremely welcome sight

Post by Shadow_rainbow »

vvvvvvvv wrote: Sat, 9. Aug 25, 08:19
Shadow_rainbow wrote: Sat, 9. Aug 25, 08:01 If I was building a game engine piece, I would do just that, of course. But before prototyping, you have to understand if your general idea is sound. Like throwing it around with some other people and seeing how viable it can possibly be.
No, to understand, you have to build a prototype. The purpose of a prototype is quick test of an idea. You build it, thne you dispose it. As for "throwing it around with other people", you already saw the reaction to yours.
That really depends. Remember we're talking about space battles that are slowing down everything first and foremost.
Spoiler
Show
When you have the engine at the ready, then maybe, doing at least something quick and dirty may not take a lot of time -- if you understand its workings, of course. When not, like the case with the author of quick snapshot project linked in the thread, you have to write it first. That's... an undertaking, even if we're using something like UE4/5. But what if it doesn't even slow down? And if it slows down, but due to the engine's inner workings processing the simulation code?
Then make an actual working prototype for your idea, solving not some, but all the problems that arise along the way. Leaving us with a sim and that prototype, neither of which will be of use to anyone.
And yes, that will take time and effort. Spending free time for weeks (looking at the task, probably months) for that might be a nice hobby, if that's your hobby, but otherwise... Let's just say that maximum programming effort that I do in my leisure time is writing AHK scripts -- and even then I have to really need that script.

vvvvvvvv wrote: Sat, 9. Aug 25, 08:19
Shadow_rainbow wrote: Sat, 9. Aug 25, 08:01 If you have a person that disagrees with you, it's much more efficient to just ask that person of their reasoning and
And then you can indefinitely ignore everything that person said and keep insisting that you're right. You can also tell yourself, that clearly the other guy did not understand your idea fully or overlooks some minor things. Or that he is incompetent. Or that he is a forum troll.

That's what humans often do.

Prototyping is faster. Because there's nobody to argue with. Meaning when you find you were wrong, your only option is to accept it.
That can also be a stance. How useful is it, depends on the other's arguments. If he comments only about my looks, of course that's an 'ignore' cue. But if you look at my posts here, you'll see that no viable argument was left unanswered, unless I missed something. Again, my answers might be wrong, too -- but to date, it wasn't demonstrated. Even my self-corrections concern minor things not affecting the whole.

If someone misunderstood me, I usually try my best at explaining the misunderstanding. As for people just trolling, I've read quite a few forum discussions to understand that rather promptly.

Also, you're referring to the case of me being wrong. But me failing to implement some solution can be downplayed by an argument that I might just not be a proper mathematician for the job, thus just failing to implement it right. And that argument would be much more valid than ignoring an opinion.
So even a total failure of the prototyping doesn't count in determining me being correct or wrong in discussion.

Besides, in Space Rangers you can literally see trajectory pieces for the next turn for each of participants, the whole fight consisting of these. So I've seen the system like it in action :wink:
vvvvvvvv wrote: Sat, 9. Aug 25, 08:19
Shadow_rainbow wrote: Sat, 9. Aug 25, 08:01 How did you arrive at these numbers of encounter starting point count for participant?
That's number of possible values a 3 component vector of single/double precision can have.
This implies that for each participant even slightest deviation from starting position, way less than a centimeter or a degree of angle in game units, can lead us to drastic difference in encounter results. In chaotic system that very well might be the case. But X4 is not such a system, it is rather predictable. AI pirates don't fly butt first to intercept a freighter.

In light of that predictability, I'd have it even stronger, taking both starting positions and angles rather coarse. AI doesn't seem to draw butterflies in space, it flies to the target seemingly in pure pursuit, unless forced to deviate. So maybe it's best described not with points in space around the target, but in deflection angle fractions relative to that target. In that case, instead of applicable area (clustered in some way) or 360 degrees on both horizontal and vertical angles we will then have just 8 - 16 directions on each, nose pointed at the target. And since encounters are rarely (if ever?) started from directly below and from above, we can leave just 3 of the vertical 8 - 16.
That leaves us with 24 to 48 relative starting angular positions we need to pre-calculate for. 256 if you want a full circle. That's quite a bit less than 2^96 and seems very manageable.
Of course, that leaves the factor of distance. In a day to day situations, that is just an encounter starting distance, but specific ones (like encounter switching or someone undocking in the middle of a battle) can also be implemented, so this logic should be flexible.
vvvvvvvv wrote: Sat, 9. Aug 25, 08:19
Shadow_rainbow wrote: Sat, 9. Aug 25, 08:01 But please, this topic is about optimization, low performance in X4 and the such.
In Beta branch someone reported 120 fps with frame generation. And your earlier arguments mentioned low framerate during BATTLE, which undermines your claim that he simulation is causing slowdown.
Frame generation is a devious thing. When native FPS is high, it allows for smoother experience. But if it's low, it entails muddy and unresponsive controls with noticeable input lag, visual artifacts and other problems making it better left off.
Also, I'm on 3060Ti, excluding me from the pool of people with access to the feature as it seems implemented (as I recall it needs 40+ series). Add to that the fact that switching between good graphics and the worst one adds just a fraction of performance lost in big battles for me.

As for simulation causing slowdown -- like I reminded a bit earlier, the whole 'pre-calculate encounters around the universe' thing is just a logical extension of 'pre-calculate parts of battle simulation'. Draw the whole fleet of capitals making a last ditch effort against a mixed attacking force all you like, with caps firing at each other, strikers strafing, fighters fighting and the like -- but each smaller part of that battle will be one of just several scenarios between just a few entities, only difference being when someone's hit points trickling down will come to an end and participants will reallocate to new scenarios.
The logic dictates that if it's resource efficient, any encounter in any part of the universe should then use the same mechanism. Unless a player gets in the way of someone involved in one of those. But that would still involve directly calculating just 3-5 ships directly involved with the player.
So yes, battle first, but I won't object if background simulation follows suit.
Last edited by Shadow_rainbow on Sat, 9. Aug 25, 13:47, edited 1 time in total.

Return to “X4: Foundations”