Closed docwild closed 12 years ago
This brown dwarf has a ridiculously large radius (far larger than is possible on a real one - 3.5AU!). I suspect that all its orbits are inside it somewhere.
Also, the mass is very, very large. This thing has the dimensions of a black hole.
Over to you, @fluffyfreak. Things to note:
@Brianetta Cool I'll look into it, and maybe I should try and write a tool to help us build custom systems so we don't have this kind of manual data wrangling in the future. Something it discuss in the mailing list I guess.
@Brianetta I'm trying to fix this right now but something is most definitely not right, masses do appear to be in Solar masses but the radius seems to be in Earth radii. Unfortunately this is the only BROWN_DWARF used in the custom systems so there's no other working example to compare it to.
@Brianetta Okay there were several things wrong with the mass and radius, I'm trying to fix them but what I'm getting is almost nonsensical without knowing about celestial mass vs radius vs density etc which I know precisely nothing about.
I've given the brown dwarf (Achernar9) a mass of 0.06537 Sols, and a radius of 0.7526 this gives it a surface gravity 31.672m/s^2 that seems light but I don't know what good values would actually be.
I've also removed it's rotation_period entirely since I couldn't find another example of a star supplying that.
However nothing I do, even replacing it entirely with a 1:1 replica of Sol, can make the autopilot work with it. It is simply never able to compute an orbit.
Where is the autopilot code? is it in Lua because I can't find it (even whilst looking in Lua!)
Autopilot code is not in Lua.
Where is the autopilot code? is it in Lua because I can't find it (even whilst looking in Lua!)
Amazingly, there is information about this on the wiki: Ship AI (of course it's slightly out of date, but not too much; the same files are relevant anyway)
Yep found it now, it's the AiCmdFlyAround, it seems that the altitude is just too big to be within the brown dwarfs frame so it gives up.
Okay I've tried a few things, making sure it was trying to get the correct mass and suchlike but I simply don't understand that code or what it's doing. Someone who understands it is going to have to workout what the correct approach to fixing this is.
My suggestions would include not presenting those options for stars (or other objects) that aren't the systems main star or are too big to have orbits. Or somehow fix it so that it can compute an orbit but ... no idea how you'd go about doing that.
I've glanced through the code and posted a quick fix. This fixes the star orbit frames being zero if there are no issues. A proper solution for the autopilot will require discussion with JohnJ.
For people reading this in the future: The autopilot calculates the minimum radius at which it can orbit a body based on the weakest thruster being used to cancel out the gravitational field and on the radius. A multiplier of this radius (rather than an altitude as the variable name in (the now outdated) worldview.cpp suggests) is used to determine if an orbit is high, medium or low. The issue arises because there's also a check to ensure that the desired radius is within the non-rotating frame of the body. Small, very dense bodies like neutron stars/white dwarfs will still have an issue as it stands. (If it arises in a custom system before the autopilot issue is fixed it can be sidestepped by placing an asteroid or something far enough away).
There doesn't seem to be any gravity to it and you can fly straight through it, the autopilot will not compute an orbit. I'm unsure of any other locations of brown dwarves but I will go exploring (is there an easier way to do this?). I have tried in an int shuttle and an eagle IV.