Author Topic: C# Suggestions  (Read 272811 times)

0 Members and 1 Guest are viewing this topic.

Offline Father Tim

  • Vice Admiral
  • **********
  • Posts: 2162
  • Thanked: 531 times
Re: C# Suggestions
« Reply #555 on: May 11, 2020, 01:37:50 PM »
Class Design window

I know some people wanted the abbreviation after the name, but I'd like an option to put back in front.  I use the abbreviations as a shorthand to quickly find the entries I want.  In that same vein, an option to include the abbreviation in the class list would be helpful for the same reason.


Yes, Gord darn it!  Yes.  If we can't get the hull type and the hull type abbreviation separated into two fields, then put the abbreviations back in front where they belong and sort the list alphabetically by abbreviation, not long name.
 

Offline smoelf

  • Commander
  • *********
  • Posts: 337
  • Thanked: 142 times
  • 2021 Supporter 2021 Supporter : Donate for 2021
Re: C# Suggestions
« Reply #556 on: May 11, 2020, 02:14:02 PM »
Minor quality of life suggestion:

Currently, if you train 9 company formations then train a HQ formation, the suggested name is "10th HQ". It would be nice if the ground unit construction tracked the unit numbers (1st Company, etc) by template rather than globally. I think it would be a relatively simple thing to track, and would make unit construction a smoother experience.


I object to this.  It wouldn't improve my quality of life at all; it would wreck it.  I don't want to deal with fifteen different "1st Companies".

To put it bluntly, I think it would be easier for you to rename 10th HQ Co than for me to rename 2nd through 9th.

You wouldn't necessarily have to rename all of them if the numbering is tracked per formation type instead of per unit. Build 10 Companies, and they will be numbered 1st to 10th. Build two HQ Companies and they will be numbered 1st to 2nd. Build 5 Armored Regiments and they will be numbered 1st to 5th. Compare this to the continuous 1st to 17th that we have now. I think that would be a nice feature, but I'm not sure it's worth it.

You might encounter some issues if you start updating or altering existing formations. I don't know how unit and/or formation ID is tracked, but if there is a chance that changing a formation composition (with an updated infantry unit) would also reset the numbering if it's considered a new formation, then the whole exercise becomes much less worthwhile. If it resets just once (or doesn't), when it shouldn't, then there is nothing gained from it.
 

Offline Father Tim

  • Vice Admiral
  • **********
  • Posts: 2162
  • Thanked: 531 times
Re: C# Suggestions
« Reply #557 on: May 11, 2020, 02:34:00 PM »
You wouldn't necessarily have to rename all of them if the numbering is tracked per formation type instead of per unit. Build 10 Companies, and they will be numbered 1st to 10th. Build two HQ Companies and they will be numbered 1st to 2nd. Build 5 Armored Regiments and they will be numbered 1st to 5th. Compare this to the continuous 1st to 17th that we have now. I think that would be a nice feature, but I'm not sure it's worth it.

You might encounter some issues if you start updating or altering existing formations. I don't know how unit and/or formation ID is tracked, but if there is a chance that changing a formation composition (with an updated infantry unit) would also reset the numbering if it's considered a new formation, then the whole exercise becomes much less worthwhile. If it resets just once (or doesn't), when it shouldn't, then there is nothing gained from it.


I would have to rename every single unit after the first.  To be clear, the way I want it to work is exactly the way it works now.  My fifty-fifth battalion -- whatever 'type' it may be -- I want to be my 55th Battalion.
 

Offline smoelf

  • Commander
  • *********
  • Posts: 337
  • Thanked: 142 times
  • 2021 Supporter 2021 Supporter : Donate for 2021
Re: C# Suggestions
« Reply #558 on: May 11, 2020, 02:55:50 PM »
I would have to rename every single unit after the first.  To be clear, the way I want it to work is exactly the way it works now.  My fifty-fifth battalion -- whatever 'type' it may be -- I want to be my 55th Battalion.

That's fair. I guess I misunderstood what you meant by 'fifteen different "1st Companies"'.
But since the way it works now means that I (and probably surprise, who suggested it) have to rename every single unit after the first, so I would probably be in favor of a change.
 

Offline kenlon

  • Sub-Lieutenant
  • ******
  • k
  • Posts: 102
  • Thanked: 39 times
Re: C# Suggestions
« Reply #559 on: May 11, 2020, 03:04:19 PM »
I would have to rename every single unit after the first.  To be clear, the way I want it to work is exactly the way it works now.  My fifty-fifth battalion -- whatever 'type' it may be -- I want to be my 55th Battalion.

So your intent is to build all units at the same size and never incorporate them into any sort of hierarchy ever? That sounds suboptimal.
 

Offline Father Tim

  • Vice Admiral
  • **********
  • Posts: 2162
  • Thanked: 531 times
Re: C# Suggestions
« Reply #560 on: May 11, 2020, 03:38:29 PM »
Actually my intent is to not have a "1st Infantry Company" and a "1st Machine Gun Company" and a "1st Mortar Company" and a "1st Headquarters Company" and a "1st Anti-Air Company" and a "1st Logistics Company" and a "1st Transport Company" and a "1st Infantry Battalion" and a "1st Tank Battalion" and a "1st Artillery Battalion" and a "1st Headquarters Battalion" and a "1st Fire Support Battalion" and a "1st Communications Battalion" and a "1st Infantry Division" and a "1st Armoured Division" and a "1st Motorized Division" and a "1st Mechanized Division" and a "1st Mountain Division" and a "1st Marine Division" and a "1st Desert Division" and a "1st Arctic Division" and a "1st Naval Division" and a "1st Jungle Division" and a "1st Swamp Division" and a first any other bloody thing.


I remember the nightmare it was trying NOT to have a system named Le Harve [sic] and how it damn near ruined that empire.
« Last Edit: May 11, 2020, 03:40:46 PM by Father Tim »
 

Offline SpikeTheHobbitMage

  • Bug Moderators
  • Commodore
  • ***
  • S
  • Posts: 670
  • Thanked: 159 times
Re: C# Suggestions
« Reply #561 on: May 11, 2020, 05:47:40 PM »
I think the issues with naming (ships, fleets, ground forces, etc) all come down to different people having mutually incompatible play-styles and organizational methods and configuring such things to be flexible enough to support such different styles is a fussy problem.  I would suggest using a string interpolation system with a user supplied format string, but it seems C# doesn't support that out of the box and the solutions I could find in a quick search are best described as 'flakey'.

This was one of the better ones:
Code: [Select]
public string Format(string input, object p)
{
foreach (PropertyDescriptor prop in TypeDescriptor.GetProperties(p))
input = input.Replace("{" + prop.Name + "}", (prop.GetValue(p) ?? "(null)").ToString());

return input;
}

Code: [Select]
Format("test {first} and {another}", new { first = "something", another = "something else" })
 

Offline Migi

  • Captain
  • **********
  • Posts: 465
  • Thanked: 172 times
Re: C# Suggestions
« Reply #562 on: May 11, 2020, 06:02:13 PM »
Actually my intent is to not have a "1st Infantry Company" and a "1st Machine Gun Company" and a "1st Mortar Company" and a "1st Headquarters Company" and a "1st Anti-Air Company" and a "1st Logistics Company" and a "1st Transport Company" and a "1st Infantry Battalion" and a "1st Tank Battalion" and a "1st Artillery Battalion" and a "1st Headquarters Battalion" and a "1st Fire Support Battalion" and a "1st Communications Battalion" and a "1st Infantry Division" and a "1st Armoured Division" and a "1st Motorized Division" and a "1st Mechanized Division" and a "1st Mountain Division" and a "1st Marine Division" and a "1st Desert Division" and a "1st Arctic Division" and a "1st Naval Division" and a "1st Jungle Division" and a "1st Swamp Division" and a first any other bloody thing.


I remember the nightmare it was trying NOT to have a system named Le Harve [sic] and how it damn near ruined that empire.

I might regret asking but what do you do with your ships? Do you rename them in order of launch date, regardless of class?
 

Offline SpikeTheHobbitMage

  • Bug Moderators
  • Commodore
  • ***
  • S
  • Posts: 670
  • Thanked: 159 times
Re: C# Suggestions
« Reply #563 on: May 11, 2020, 06:05:16 PM »
Actually my intent is to not have a "1st Infantry Company" and a "1st Machine Gun Company" and a "1st Mortar Company" and a "1st Headquarters Company" and a "1st Anti-Air Company" and a "1st Logistics Company" and a "1st Transport Company" and a "1st Infantry Battalion" and a "1st Tank Battalion" and a "1st Artillery Battalion" and a "1st Headquarters Battalion" and a "1st Fire Support Battalion" and a "1st Communications Battalion" and a "1st Infantry Division" and a "1st Armoured Division" and a "1st Motorized Division" and a "1st Mechanized Division" and a "1st Mountain Division" and a "1st Marine Division" and a "1st Desert Division" and a "1st Arctic Division" and a "1st Naval Division" and a "1st Jungle Division" and a "1st Swamp Division" and a first any other bloody thing.


I remember the nightmare it was trying NOT to have a system named Le Harve [sic] and how it damn near ruined that empire.

I might regret asking but what do you do with your ships? Do you rename them in order of launch date, regardless of class?
Father Tim's system is actually used by many militaries.  The logic is that the divisions are really:
1st Division, Arctic
2nd Division, Desert
3rd Division, Arctic
4th Division, HQ

IIRC that system dates back to the Romans.
 

Offline skoormit

  • Rear Admiral
  • **********
  • Posts: 804
  • Thanked: 324 times
Re: C# Suggestions
« Reply #564 on: May 11, 2020, 07:34:17 PM »
...I would suggest using a string interpolation system with a user supplied format string, but it seems C# doesn't support that out of the box ...

Really? I think it does.
 

Offline Gnoman

  • Leading Rate
  • *
  • G
  • Posts: 12
  • Thanked: 4 times
Re: C# Suggestions
« Reply #565 on: May 11, 2020, 11:09:14 PM »
Minor, but I'd like a "Hull Number" option in the "Name Templates". It would work like the "name plus number", but operate off the hull designation. So instead of something like "Essex 1, 2, 3; Saratoga 1, 2, 3; Forrestal 1", you'd have "CV 1, CV 2, CV 3, CV4, CV 5, CV 6, CV 7".

This would be handy if you're doing something like tiny missile stations or immobile fuel stations.
 
The following users thanked this post: Azuraal

Offline TMaekler

  • Vice Admiral
  • **********
  • Posts: 1112
  • Thanked: 298 times
Re: C# Suggestions
« Reply #566 on: May 12, 2020, 02:35:35 AM »
A special warning message when a story character dies.

Since gameplay is so much quicker in C# Aurora and since commander health is not differenciated from commander death, I quite often happen to miss when my planetary governors die and leave important positions vacant - until I happen to stumble upon it in the planetary display... .

So it would be nice to get a separate warning message for story characters when they die off. That way I can ensure "immediate new elections" :-)
 
The following users thanked this post: ropedog

Offline TMaekler

  • Vice Admiral
  • **********
  • Posts: 1112
  • Thanked: 298 times
Re: C# Suggestions
« Reply #567 on: May 12, 2020, 04:30:47 AM »
What would you think of the event log as a kind of "notepad"? I am thinking of making event log entries permanently visible through a checkbox. Those whom I check they stay at the top of the eventlog, no matter how many event days are displayed. Good idea?

Also adding manual event log entries would be a nice addon to help remembering things that have to be done next, when saving a game.
 

Offline Duzzit

  • Petty Officer
  • **
  • D
  • Posts: 17
Re: C# Suggestions
« Reply #568 on: May 12, 2020, 04:44:55 AM »
I feel a bit bad putting this here because I mentioned it in the bug thread way back when, but if it's not too much trouble I'd like to ask if it's possible to (re)implement a 'research all techs up to X cost' for SM mode? Individually instating all techs after several restarts is not the quickest thing.
 

Offline SpikeTheHobbitMage

  • Bug Moderators
  • Commodore
  • ***
  • S
  • Posts: 670
  • Thanked: 159 times
Re: C# Suggestions
« Reply #569 on: May 12, 2020, 05:07:30 AM »
...I would suggest using a string interpolation system with a user supplied format string, but it seems C# doesn't support that out of the box ...

Really? I think it does.
That was one of the first things I looked at.  It fails for two reasons:  It is static compiled so it can't handle dynamic format strings, and even if it was dynamic there is no way to limit the scope.  Either of these faults by itself would be grounds to reject it outright.

Python's str.format would be ideal, but C# has no built-in equivalent and user-supplied methods seem to either be clunky or require asp.net support.  Something like this:
Code: [Select]
fmt = "This {thing} has {attribute} {feature}."
text = fmt.format({'thing':'cat', 'attribute':'grey', 'feature':'fur'})
« Last Edit: May 12, 2020, 05:09:35 AM by SpikeTheHobbitMage »