Author Topic: C# Aurora Changes Discussion  (Read 439438 times)

0 Members and 1 Guest are viewing this topic.

Offline sloanjh (OP)

  • Global Moderator
  • Admiral of the Fleet
  • *****
  • Posts: 2805
  • Thanked: 112 times
  • 2020 Supporter 2020 Supporter : Donate for 2020
    2021 Supporter 2021 Supporter : Donate for 2021
C# Aurora Changes Discussion
« on: April 02, 2016, 09:39:00 AM »
Here's a place to discuss Steve's changes (mirroring Mechanics).

And I've got one:  Steve:  I noticed that you said that hull sizes are no longer rounded to the nearest integer.  Unless you're using an underlying integral type (e.g. a specially hull-size class that is implemented in private data as an integer times a fraction like 0.001), you probably want to do some level of rounding for numbers that are very close to an integer, e.g if( fabs(size - roundedSize) < 0.001) size = roundedSize.  Otherwise I suspect that you'll run into lot of bugs from players when they try to send a 5000 ton ship through a wormhole with a 5000 ton jump ship and it doesn't work because the jump ship size is actually 4999.999999999 and/or the ship size is 5000.00000000001 due to floating point error.

Let me know if you want an example of the hull-size class I mentioned - I suspect I've only got a 50% chance of having explained it well enough to understand what I'm talking about.

John
 
The following users thanked this post: Graham

Offline Steve Walmsley

  • Moderator
  • Star Marshal
  • *****
  • S
  • Posts: 11644
  • Thanked: 20339 times
Re: C# Aurora Changes Discussion
« Reply #1 on: April 02, 2016, 10:08:51 AM »
Yes, I was thinking about the jump drive issue. In VB6 I was rounding up to the nearest HS for that reason. I like the non-rounding from a variety POV as real world ships are rarely round numbers.

Perhaps the solution is to allow ships to jump other ships that are less than 50 tons larger, as long as the jump drive is large enough. For example, a DD of 5980 tons with a 6000 ton jump drive could still jump ships of up to 6000 tons. The drawback is it might be hard to explain to new players why the DD of 5980 can handle it, but not a DD of 5940 tons.

I could include a 'jump size' rating in the ship design display, which would be the size of the ship for jump purposes (HS rounded up to nearest 50 tons or jump drive capacity, whichever is smaller). That would actually make it easier for new players as we would avoid the small ship, large drive issue.
 

Offline Jaque_Thay

  • Petty Officer
  • **
  • J
  • Posts: 15
  • Thanked: 2 times
Re: C# Aurora Changes Discussion
« Reply #2 on: April 02, 2016, 11:52:02 AM »
Possibly an easier way to explain (while still being codeable) would be that jump drives can propel things up to 1.25x the host vessel's size (up to a maximum of the jump drive's rating). That has two benefits, firstly, you can say that the jump 'bubble' created by the ship can encompass pointy out bits and compensate for hull size mismatches (avoiding the 9999.9999 ton vessel being unable to jump a 10k ton vessel or the handwavium required above to say why a 9980 ton vessel can move a 10k vessel but your 9940 ton example can't).

Secondly, you can make ever so slightly smaller ships and still make use of jump drives you've already designed (eg anything between than 8k-10k tons could make use of a 10k jump drive). This increases flexibility in ship design.
 
The following users thanked this post: KValthaliondil, lordcirth

Offline Retropunch

  • Petty Officer
  • **
  • R
  • Posts: 18
  • Thanked: 6 times
Re: C# Aurora Changes Discussion
« Reply #3 on: April 02, 2016, 11:55:49 AM »
Quote from: Steve Walmsley link=topic=8497. msg88749#msg88749 date=1459609731
I could include a 'jump size' rating in the ship design display, which would be the size of the ship for jump purposes (HS rounded up to nearest 50 tons or jump drive capacity, whichever is smaller).  That would actually make it easier for new players as we would avoid the small ship, large drive issue.

This sounds like a good option.  Even for long term players, quickly being able to see what the jump rating is would make life easier.
 
The following users thanked this post: KValthaliondil

Offline QuakeIV

  • Registered
  • Commodore
  • **********
  • Posts: 759
  • Thanked: 168 times
Re: C# Aurora Changes Discussion
« Reply #4 on: April 02, 2016, 12:49:44 PM »
I still think that group jumps should look exclusively at the rating of the jump drive.  It was mildly enraging to realize that my 20kton jump ship for my 40kton warships had to have a bunch of fuel or something strapped on in order for it to do its job.
 
The following users thanked this post: Kytuzian, lordcirth

Offline rorror

  • Warrant Officer, Class 1
  • *****
  • r
  • Posts: 79
  • Thanked: 6 times
Re: C# Aurora Changes Discussion
« Reply #5 on: April 02, 2016, 03:21:10 PM »
I still think that group jumps should look exclusively at the rating of the jump drive.  It was mildly enraging to realize that my 20kton jump ship for my 40kton warships had to have a bunch of fuel or something strapped on in order for it to do its job.

Back to the drawing table for me.. got the same problem, waited 3years for my jumper and is at 95% of construnction now..  missing 25k tons
And i am micro managing the game.. those 3years in game took over 1 week of play time. :)

Code: [Select]
Jump Force v1 class Jump Ship    23,600 tons     676 Crew     6342.8 BP      TCS 472  TH 1050  EM 0
2224 km/s    JR 5-50     Armour 1-73     Shields 0-0     Sensors 1/1/0/0     Damage Control Rating 49     PPV 0
Maint Life 0.72 Years     MSP 4192    AFR 234%    IFR 3.3%    1YR 5854    5YR 87806    Max Repair 4812 MSP
Intended Deployment Time: 10 months    Spare Berths 1   

ROR J60000(5-50) Military Jump Drive     Max Ship Size 60000 tons    Distance 50k km     Squadron Size 5
ROR 150 EP Ion Drive (10HS 1.25Fuel) (7)    Power 150    Fuel Use 78.61%    Signature 150    Exp 12%
Fuel Capacity 5,000,000 Litres    Range 48.5 billion km   (252 days at full power)

This design is classed as a Military Vessel for maintenance purposes
 

Offline sloanjh (OP)

  • Global Moderator
  • Admiral of the Fleet
  • *****
  • Posts: 2805
  • Thanked: 112 times
  • 2020 Supporter 2020 Supporter : Donate for 2020
    2021 Supporter 2021 Supporter : Donate for 2021
Re: C# Aurora Changes Discussion
« Reply #6 on: April 03, 2016, 10:08:40 AM »
Aaah - I hadn't been thinking in terms of two different ships "really" having the same size (because components add up slightly differently).  I was thinking purely from a computer science point of view: "thou shalt never compare two floats or doubles without using a tolerance" in terms of comparing two ships that are supposed to have exactly the same size (e.g. same components but a different order so they add up differently).  Even leaving the jump drive issue out of it, I think there will quite a few places where you end up comparing hull sizes, so I think you should either have a "compare hull sizes" function that takes a required tolerance (or has one hard-wired inside) or you should discretize hull sizes to e.g. 1 ton or 0.1 ton or 1kg increments.

The above then made me realize an important question:  "Just how many tons are there in a 1000 ton ship".  By this I mean that the calculated tonnage on the design is just an approximation - in the real world the actual size will come out different (and be different for different ships).  So in the real world jump drives would be overdesigned to account for this variation.  So I think the question here is how to model this variation in the game and how much of it to expose to the user.

Possibly an easier way to explain (while still being codeable) would be that jump drives can propel things up to 1.25x the host vessel's size (up to a maximum of the jump drive's rating). That has two benefits, firstly, you can say that the jump 'bubble' created by the ship can encompass pointy out bits and compensate for hull size mismatches (avoiding the 9999.9999 ton vessel being unable to jump a 10k ton vessel or the handwavium required above to say why a 9980 ton vessel can move a 10k vessel but your 9940 ton example can't).

Secondly, you can make ever so slightly smaller ships and still make use of jump drives you've already designed (eg anything between than 8k-10k tons could make use of a 10k jump drive). This increases flexibility in ship design.

I really like this idea for managing it, except I would make the slosh 5% or even 1% and not advertise it to users (or if you do, point out that this is to account for slop and the extra bit shouldn't be used in designs).  So the nominal rating of a jump drive is intended to be able to jump any ship whose nominal tonnage is equal to or less than that rating, and under the covers this allows nominal tonnages that are a bit high to still be jumped.

A more complicated way to manage it (that I'm not keen on) would be to have an "actual size" data member on each ship that randomly fluctuated by e.g. 1% from the design size.  You could play the same game with engine power, jump capacity, etc.  The upside is that this would give personality to the ships (e.g. a particular ship in the days of sail being known as a fast sailer).  The downside is that it would give personality to the ships - paying attention to small variations between ships is nice for single-ship tactical actions, but impractical at the 4X level, plus it forces an extra layer of micro-management on the player in terms of making decisions about just how much they're going to over-engineer jump drives and engines.

John
 

Offline sloanjh (OP)

  • Global Moderator
  • Admiral of the Fleet
  • *****
  • Posts: 2805
  • Thanked: 112 times
  • 2020 Supporter 2020 Supporter : Donate for 2020
    2021 Supporter 2021 Supporter : Donate for 2021
Re: C# Aurora Changes Discussion
« Reply #7 on: April 03, 2016, 10:18:30 AM »
On AG-Infrastructure:

1)  Great idea - makes a ton of sense (pun not-intended)

2)  I assume that AG is built into ships and hidden in the crew quarters/life support tonnage?

3)  Every time I see "AG" I think anti-gravity.

John
 

DroiD

  • Guest
Re: C# Aurora Changes Discussion
« Reply #8 on: April 04, 2016, 02:03:20 PM »
Quote from: sloanjh link=topic=8497. msg88785#msg88785 date=1459696710
3)  Every time I see "AG" I think anti-gravity.
John
Mayby LG (Low gravity) would be less misleading? "Low gravity infrastructure" looks pretty certain and clear for me.
 

Offline Father Tim

  • Vice Admiral
  • **********
  • Posts: 2162
  • Thanked: 531 times
Re: C# Aurora Changes Discussion
« Reply #9 on: April 05, 2016, 04:17:39 PM »
I'd prefer 'Low Gravity Infrastructure,' simply to emphasize that it doesn't work on high-G planets.
 

Offline boggo2300

  • Registered
  • Rear Admiral
  • **********
  • Posts: 895
  • Thanked: 16 times
Re: C# Aurora Changes Discussion
« Reply #10 on: April 05, 2016, 05:06:44 PM »
AG makes me think Agriculture personally
The boggosity of the universe tends towards maximum.
 

Offline QuakeIV

  • Registered
  • Commodore
  • **********
  • Posts: 759
  • Thanked: 168 times
Re: C# Aurora Changes Discussion
« Reply #11 on: April 05, 2016, 07:26:55 PM »
AG makes me think Agriculture personally

Same, actually.
 

Offline 83athom

  • Big Ship Commander
  • Vice Admiral
  • **********
  • Posts: 1261
  • Thanked: 86 times
Re: C# Aurora Changes Discussion
« Reply #12 on: April 05, 2016, 07:45:48 PM »
Maybe PG for Pseudo Gravity, or better yet Paragravity.
Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life.
 

Iranon

  • Guest
Re: C# Aurora Changes Discussion
« Reply #13 on: April 06, 2016, 02:22:59 AM »
I'd be for avoiding needless complication - what you see is what you need to see, without new values that are almost the same as exisiting ones (size vs. effective size for jump purposes).
"There's a slight tolerance for your convenience . If you try to cut corners betting on this, don't complain if it doesn't work".
 
The following users thanked this post: seronis

Offline Bgreman

  • Lt. Commander
  • ********
  • Posts: 213
  • Thanked: 2 times
Re: C# Aurora Changes Discussion
« Reply #14 on: May 05, 2016, 01:14:26 PM »
I was alerted that you'd started (finally! :P) working on a C# port and had to come take a look.  Looks amazing.

BTW For those familiar with C#, I have found one of the major advantages over VB6 (beyond the obvious advantages) is using LINQ and Lambda expressions to retrieve data from collections - very useful and powerful.

The Aurora Viewer stuff I wrote uses LINQ and lambdas heavily.  Something I eventually wanted to do was to have actual json-serializable classes to represent all the entities I use, rather than just pulling primitives out of the DB and writing raw json.

Something I was thinking based on some of the feedback you've received about the class design window:  Rather than having to flip back and forth between available and installed components, why not just have the number of installed components appended to the treeview item.  Add with click, remove with shift-click, or even buttons on the treeview item itself.  Add or remove 5 by also holding CTRL.

For "Ships in Class" it would be nice if launch date would show for civilian ships.  The value is in the DB, it just doesn't get populated in the UI for civ-owned vessels.