Recent Posts

Pages: [1] 2 3 ... 10
1
C# Suggestions / Re: Suggestions Thread for v2.4.0
« Last post by Steve Walmsley on Today at 09:59:57 AM »
Request for a new fleet order: Begin Overhaul and Join Fleet

I often give ships orders to return to a planet and begin overhaul, and as soon as they arrive and I receive the interrupt event, I manually drag them to a holding fleet.
It would be great if I could do this with a single order and avoid all the extra interrupts and manual fiddling.

Added for v2.6.
2
C# Mechanics / Re: v2.6.0 Changes List
« Last post by Steve Walmsley on Today at 09:58:26 AM »
Join Fleet and Begin Overhaul

I've added a new order called 'Join Fleet and Begin Overhaul'.

This functions as a combination of the Join Fleet and Begin Overhaul orders, with the moving fleet joining the target fleet and immediately entering overhaul. This order will only be available if the target fleet is in a maintenance location and the overhaul will only start if the target fleet is still in a maintenance location when the moving fleet joins it.
3
Yes, I have a similar one in my current campaign. I can't decide whether to just exclude very eccentric planets as potential home worlds, or leave it alone for flavour. The NPR is likely to correct the problem anyway by building lots of infrastructure.
4
General Discussion / Re: What's Going On In Your Empire: C# Edition
« Last post by Kiero on Today at 09:15:17 AM »
I assume their home world has a very eccentric orbit?



Yup 0.41
Water Vapor is messing things up for them, periodically.
5
C# Suggestions / Re: Suggestions Thread for v2.4.0
« Last post by skoormit on Today at 08:57:22 AM »
QOL Suggestion:

Naval Organization window, Fleet -> Movement Orders tab
Double clicking any order in the list of the fleet's current orders should remove all orders after that one (perhaps with a confirmation prompt).


Sometimes I need to trim a long list of orders back to a specific point.
Repeatedly clicking the Remove Last button is the only way to do it currently.
Sometimes that's a LOT of clicks, and sometimes a user overclicks and then has to re-create the unintentionally removed orders.
6
C# Suggestions / Re: Suggestions Thread for v2.4.0
« Last post by Kaiser on Today at 08:35:58 AM »
I do not remember if it has been suggested, could it be possible to personalize the naval organization tab with different colours?

At some point, when there are many ships, fleets, sufleets and command, it became a little messy and my eyes fly around before I can individuate the ship/fleet I am looking for.

It would be great having the possibility to assign a given color to a specific fleet or ship.
7
A bizarre race has been incorporated into the empire.

Temperature range: -16.47 to 128.66



I assume their home world has a very eccentric orbit?
8
C# Mechanics / Re: v2.6.0 Changes List
« Last post by Steve Walmsley on Today at 07:15:45 AM »
Updated Missile Salvo Display

I have updated the Missile Salvos tab on the Naval Organization window to show System and Location, with the latter using the same method as the fleet location description. It also sorts by system and then order of salvo creation.

I've also added a new sidebar tab to the Galactic Map display that shows salvos in a selected system, with just the missile name, amount and location. This is primarily for checking buoy placements.
9
I don't want to turn this thread into a programming debate, which is one of the reasons that I rarely post code ;)

I hope that none of the other readers of this thread have been put out by our monopolization of the topic of discussion :)

Are you suggesting that instead of a new list, I use the LINQ without assigning to a new list as the target in the foreach loop?

If so, I prefer to avoid that. It's harder to read and harder to debug and those are more important to me than straight performance.

Yes, both the CurrentSystems and PossibleSystems variables would be IEnumerable<KnownSystem> instead of List<KnownSystem>. I can’t really see how the code would be more difficult to read, since everything else would be identical except that you would just not call ToList().

However, I suppose I know what you mean about debugging. You want to stop at a breakpoint and be able to view the lists in the debugger. I tend to forget that not everybody can use omniscient debugging yet (I use a debugger called Pernosco a lot, but it is for Linux only.) If I were using a regular debugger and I wanted to verify which systems had been in the final enumeration, I would add a conditional breakpoint inside the loop to print out some information about ks (the system name and number, for instance) and then continue execution. (In Pernosco you can do the same thing but you get all the information that would have been printed without having to actually run the program again.)

As for performance, if this code is just called once any time a fleet transits an unexplored jump point then it is probably irrelevant. Even though you make two whole copies of the list of systems (and you did just make that list significantly larger), that probably takes so little time that nobody will notice. But you might take a look to see if you have made this mistake in more important parts of the code. What is a very minor mistake here would be much more regrettable in the code that implements ship detection, for instance.

OK, I think I finally understand what you are driving at :)

I was concerned I would have the LINQ in the middle of the foreach statement, if I didn't assign it to a List() first and use that as the target for the foreach. Are you saying I could just replace the List<KnownSystem> = with  IEnumerable<KnownSystem> = , remove the ToList() and then use the IEnumerable as the target of the foreach. That would be the same in terms of readability and I assume I could check the contents of the IEnumerable instead of the List?

I basically picked up C# by writing it and figuring things out when I needed to, without any formal learning, so there will be gaps in my knowledge :)

So now you have made me curious, I started reading about it. Some people expressed a view that IEnumerable  only guarantees an enumeration and doesn't guarantee the order of execution (even if ordered beforehand). However, as I read it, its the same execution as list because the latter inherited the former. Which is correct?

EDIT

I just ran an experiment for the missile salvo list on the fleet window, which I just updated.

This is the ToList() version.

List<MissileSalvo> Salvos = Aurora.MissileSalvos.Values.Where(x => x.SalvoRace == this).OrderBy(x => x.SalvoSystem.SystemID).ThenBy(x => x.MissileSalvoID).ToList();

This is looped and various information is used to display missile salvos, using foreach (MissileSalvo ms in Salvos)

I then created a IEnumerable version of the same function

IEnumerable<MissileSalvo> Salvos = Aurora.MissileSalvos.Values.Where(x => x.SalvoRace == this).OrderBy(x => x.SalvoSystem.SystemID).ThenBy(x => x.MissileSalvoID);

I ran both functions several times and in every case, the List version is faster than the IEnumerable version. It may be that the IEnumerable is faster to create, but the List seems to be faster to use. Maybe because everything is preloaded into memory for the List, whereas the IEnumerable has to retrieve the information as needed.

EDIT2:

Further reading suggests that every time you access a method or property of the same element within an IEnumerable foreach, it has to retrieve it again. A list already has it in memory. So its likely that IEnumerable  is faster if you are doing very little with the data you enumerate, but List is faster if you want to access each element more than once (either in multiple iterations, or getting using multiple properties/methods for each element of a single iteration).
10
C# Mechanics / Re: v2.6.0 Changes Discussion Thread
« Last post by alex_brunius on Today at 02:46:41 AM »
Population that is in excess of required manufacturing personnel numbers is generally considered to be gainfully employed, just not in trans-newtonian industries relevant to the game.

Correct, but it could still be relevant to include some smaller pressure from this factor both for gameplay reasons and for flavor/immersion reasons.

For immersion:
It's not mutually exclusive with the idea that this population is available to be more gainfully employed (earning higher salary/status) if they were moved into a prioritized trans-newtonian industry career instead where such opportunities exists on other colonies.

For gameplay:
It's handy to have colony shipping prioritize colonies with surplus workers without having to micromanage this yourself by turning stable on and off again in the larger empires having to monitor the surplus workers.
Pages: [1] 2 3 ... 10
SMF spam blocked by CleanTalk