Author Topic: Questions Not Worth Their Own Thread: C# Edition  (Read 446727 times)

0 Members and 7 Guests are viewing this topic.

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11954
  • Thanked: 22140 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4365 on: October 23, 2024, 10:04:32 AM »
I'd like to be able to project the position of a system body (at an arbitrary point in the future), given its orbital parameters and current location.

Would that be a straightforward formula you could share?

It's not really straightforward due to it being an eccentric orbit, plus planets move at different speeds at different points of that eccentric orbit, and planets can potentially orbit a star that orbits a second star, that orbits a third star.

It's a few hundred lines of code, including some parts you wouldn't need, such as moons and environmental changes, but I would need to figure out which parts. Essentially, I calculate the movement as degrees of arc, based on body speed and time elapsed, then calculate the distance of the planet at that point of the arc, primarily using trigonometry, although some conversions are needed for the way C# handles it. If you orbit something that orbits something else, etc. you need to calculate everything in order.
 

Offline skoormit

  • Rear Admiral
  • **********
  • Posts: 928
  • Thanked: 383 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4366 on: October 23, 2024, 11:14:51 AM »
I'd like to be able to project the position of a system body (at an arbitrary point in the future), given its orbital parameters and current location.

Would that be a straightforward formula you could share?

...It's a few hundred lines of code...

I suspected that might be the case.

Am I correct in recalling that orbiting bodies sweep their orbital area at a constant rate over time?
And if that is correct, is that how Aurora implements it?
If so, I can probably work out the general case formula from there.
(Not, like, over a lunch break. But eventually.)
 

Offline Migi

  • Captain
  • **********
  • Posts: 467
  • Thanked: 173 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4367 on: October 23, 2024, 02:08:58 PM »
I'd like to be able to project the position of a system body (at an arbitrary point in the future), given its orbital parameters and current location.

Would that be a straightforward formula you could share?

...It's a few hundred lines of code...

I suspected that might be the case.

Am I correct in recalling that orbiting bodies sweep their orbital area at a constant rate over time?
And if that is correct, is that how Aurora implements it?
If so, I can probably work out the general case formula from there.
(Not, like, over a lunch break. But eventually.)
Your wording of Keplar's 2nd law is not quite correct, but I expect you know what you meant.
"An imaginary line drawn from the center of the [star] to the center of the planet will sweep out equal areas in equal intervals of time"
https://www.physicsclassroom.com/class/circles/Lesson-4/Kepler-s-Three-Laws
The question is whether Steve has coded Aurora to account for gravitational interactions from other bodies. :)
 

Offline GodEmperor

  • Commander
  • *********
  • Posts: 324
  • Thanked: 32 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4368 on: October 23, 2024, 03:27:28 PM »
What happens to ground units transported on board a ship if the ship gets hit and the troop transport component gets damaged?
Assuming there is no spare space for them of course and i have the exact amount of tons of GU's as transport capability.
."I am Colonel-Commissar Ibram Gaunt. I am known as a fair man, unless I am pushed.
You have just pushed me."
 

Offline Antonin1957

  • Petty Officer
  • **
  • A
  • Posts: 24
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4369 on: October 23, 2024, 04:27:45 PM »
I've noticed that my officers are retiring at age 32-33. Should there be a kind of military administrative structure to provide them with jobs as they age? A fleet staff structure or a general staff for ground commanders? If the answer is "yes," how would I create such a structure?

I don't have any warships, and the only ground unit I have is the "1st Infantry Regiment." I don't have any alien invasions or NPRs enabled in this game. It's my 7th restart.
 

Offline Andrew

  • Registered
  • Commodore
  • **********
  • Posts: 737
  • Thanked: 147 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4370 on: October 23, 2024, 04:36:39 PM »
If you have no navy or army why would any officers stay in the service?
Unemployed officers tend to retire faster than employed officers. It is usually a good idea to use your starting research points to develop some tech, then design some ships and spawn them using your starting points for troops and ships.That way you have a navy (military or commercial) and army and that means your officers have meaning. Also you can actually do things and have fun
 
The following users thanked this post: Antonin1957

Offline Antonin1957

  • Petty Officer
  • **
  • A
  • Posts: 24
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4371 on: October 23, 2024, 05:56:02 PM »
If you have no navy or army why would any officers stay in the service?
Unemployed officers tend to retire faster than employed officers. It is usually a good idea to use your starting research points to develop some tech, then design some ships and spawn them using your starting points for troops and ships.That way you have a navy (military or commercial) and army and that means your officers have meaning. Also you can actually do things and have fun

I have a couple of survey ships, a sorium harvester and a couple of freighters. I have not built a military because I'm not very interested in the military side of the game, at least not until I understand the basics of building up an economy.
 

Offline Garfunkel

  • Registered
  • Admiral of the Fleet
  • ***********
  • Posts: 2925
  • Thanked: 1179 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4372 on: October 23, 2024, 07:32:35 PM »
Then you don't have to worry about your officers retiring. Academies will train new ones.
 
The following users thanked this post: Antonin1957

Offline Migi

  • Captain
  • **********
  • Posts: 467
  • Thanked: 173 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4373 on: October 23, 2024, 08:08:14 PM »
I've noticed that my officers are retiring at age 32-33. Should there be a kind of military administrative structure to provide them with jobs as they age? A fleet staff structure or a general staff for ground commanders? If the answer is "yes," how would I create such a structure?

I don't have any warships, and the only ground unit I have is the "1st Infantry Regiment." I don't have any alien invasions or NPRs enabled in this game. It's my 7th restart.

You can assign commanders to academies, via the commanders screen. If you have lots of scattered academies that can give them something to do.

You can also create a naval command structure using the Naval Organisation screen.
Some people use this to create a civilian command structure as well, here is a post showing that:
https://aurora2.pentarch.org/index.php?topic=13664.msg171811#msg171811
The industral, logistics and survey admin types will provide useful bonuses even in an entirely peaceful game.
 
The following users thanked this post: Antonin1957

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11954
  • Thanked: 22140 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4374 on: October 24, 2024, 05:57:49 AM »
What happens to ground units transported on board a ship if the ship gets hit and the troop transport component gets damaged?
Assuming there is no spare space for them of course and i have the exact amount of tons of GU's as transport capability.

They will be damaged in proportion to the loss of troop capacity.
 
The following users thanked this post: Kaiser

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11954
  • Thanked: 22140 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4375 on: October 24, 2024, 06:46:39 AM »
I'd like to be able to project the position of a system body (at an arbitrary point in the future), given its orbital parameters and current location.

Would that be a straightforward formula you could share?

...It's a few hundred lines of code...

I suspected that might be the case.

Am I correct in recalling that orbiting bodies sweep their orbital area at a constant rate over time?
And if that is correct, is that how Aurora implements it?
If so, I can probably work out the general case formula from there.
(Not, like, over a lunch break. But eventually.)

Orbital Speed = Math.Sqrt((2 / DistanceToParent) - (1 / OrbitalDistance));
 

Offline db48x

  • Commodore
  • **********
  • d
  • Posts: 663
  • Thanked: 214 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4376 on: October 25, 2024, 05:44:51 AM »
If so, I can probably work out the general case formula from there.
(Not, like, over a lunch break. But eventually.)

I looked into this a while back while contemplating better ship navigation. You might find the code helpful. As described in that post, I found a formula for the distance between the ship and the target planet given the timestamp. Handling moons requires a different formula for moons than for planets, another for moons of moons, and so on. Luckily computing the derivatives using a CAS is but a moment’s work.
 

Offline Indefatigable

  • Chief Petty Officer
  • ***
  • I
  • Posts: 32
  • Thanked: 38 times
Re: Questions Not Worth Their Own Thread: C# Edition
« Reply #4377 on: Yesterday at 05:42:13 AM »
Whats the matter with Galactic Map Window lagginess?
The left side menu flickers and feels like it reloads all the data for every object seen in the view when you pan around even the slightest amount.
Main Tactical view has small fraction of same behaviour.