Discussion ChatGPT Can help writing Code for Orbiter

Trekkie

Starfleet Head of Ship Design
Addon Developer
Donator
Joined
Feb 6, 2016
Messages
350
Reaction score
89
Points
43
Location
Starfleet Ship Design Bureau
Hi!

i was just fooling around on ChatGPT when i wanted to try out if it knew some code for Orbiter2016

here are my results (first are the questions i asked then the answers)

Question 1: Can you write a basic Planet Code for Orbiter 2016?

Sure! Here's a basic planet code for Orbiter 2016:
; === Configuration file for planet ===
Name = MyPlanet
EllipticOrbit = TRUE ; ignore perturbations
HasElements = TRUE ; orbital elements follow

; === Planetary Mean Orbits ===
Epoch = 2451545.0 ; epoch Julian date
SemiMajorAxis = 149597870700 ; in metres
Eccentricity = 0.01671022
Inclination = 0.0
LongAscNode = 0.0
LongPerihelion = 102.94719
MeanLongitude = 100.46435

; === Physical Parameters ===
Mass = 5.9722e24 ; in kg
Size = 6371000.0 ; mean radius in metres
AlbedoRGB = 0.7 0.7 0.7

; === Rotation Elements ===
SidRotPeriod = 86164.09 ; 23h 56m 4.09s
SidRotOffset = 0.0 ; default orientation
Obliquity = 0.40910518 ; in radians
LAN = 0.0 ; vernal equinox

; === Atmospheric Parameters ===
AtmPressure0 = 101.325e3 ; pressure at sea level in Pa
AtmDensity0 = 1.225 ; density at sea level in kg/m^3
AtmGasConstant = 287.058 ; specific gas constant in J/(K kg)
AtmGamma = 1.4 ; specific heat ratio c_p/c_v
AtmAltLimit = 100000.0 ; altitude at which atmosphere ends in metres
AtmHorizonAlt = 2000.0 ; altitude at which horizon is visible in metres
AtmHazeExtent = 0.1 ; extent of atmospheric haze
AtmColor0 = 0.61 0.8 1.0 ; base color of atmosphere
AtmHazeColor = 0.75 0.9 1.0 ; color of atmospheric haze

; === Data for the Visual ===
MaxPatchResolution = 8 ; highest sphere patch level

; === Visualisation Parameters ===
MinCloudResolution = 1 ; cloud layer from this resolution
MaxCloudResolution = 6 ; highest cloud resolution level
This code defines a planet with basic physical and atmospheric parameters, as well as an elliptical orbit with elements specified. You can customize these parameters to create your own planet in Orbiter 2016.

Question 2: can you make me a Basic Spacecraft4 .ini Vessel file?

Answer: Sure, here's an example of a basic spacecraft4 vessel .ini file for Orbiter 2016:
[VESSEL]
Meshname = spacecraft4\spacecraft4.msh
Mass = 1000
EmptyMass = 500
Thrust = 5000
Isp = 300
EngineAnimation = spacecraft4\engine_anim.msh
DockingPort = 0.0 0.0 10.0 0.0 0.0 1.0
This example includes the basic parameters for a spacecraft4 vessel, including its mesh file name, mass, thrust, specific impulse, engine animation, and docking port position. You can modify these parameters to customize the vessel for your specific needs.

Question3: Can you write me a scenario file for Orbiter 2016?
Answer: Sure! Here's a sample scenario file for Orbiter 2016
BEGIN_DESC
Basic scenario for Orbiter 2016
END_DESC

BEGIN_ENVIRONMENT
System Sol
Date MJD 59000
END_ENVIRONMENT

BEGIN_FOCUS
VESSEL Shuttle-A
NAVMODE 1
TRACKMODE 2
END_FOCUS

BEGIN_HUD
PROJMODE 0
NEAR_CLIP 1
FAR_CLIP 200000000
FOV 60.0
COCKPIT_PANEL 0
PANEL_TRANSPARENCY 0.0
PANEL_COLOR 0 0 0
END_HUD

BEGIN_CAMERA
TARGET Shuttle-A
MODE Cockpit
END_CAMERA

BEGIN_MFD_LEFT
TYPE Surface
END_MFD_LEFT

BEGIN_MFD_RIGHT
TYPE Map
END_MFD_RIGHT

BEGIN_SHIPS
Shuttle-A "Default Shuttle"
{
MODEL ShuttleA
STATUS Landed Earth
POS 28.5 -80.6 0
HEADING 90
ALT 200
PTDOWN 0
}
END_SHIPS

This scenario places the player's spacecraft, Shuttle-A, on the launchpad at Kennedy Space Center in Florida, USA. The HUD is set up to display a cockpit view and two MFDs on the left and right sides of the screen. The camera is set to focus on Shuttle-A and is in cockpit mode. The environment is set to the Sol system and the date is set to MJD 59000.

Its not really SDK but i thought it was interesting, what do you all think of this?
 

Matias Saibene

Development hell
Joined
Jul 7, 2012
Messages
1,028
Reaction score
580
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
Hi!

i was just fooling around on ChatGPT when i wanted to try out if it knew some code for Orbiter2016

here are my results (first are the questions i asked then the answers)

Question 1: Can you write a basic Planet Code for Orbiter 2016?



Question 2: can you make me a Basic Spacecraft4 .ini Vessel file?




Question3: Can you write me a scenario file for Orbiter 2016?


Its not really SDK but i thought it was interesting, what do you all think of this?
It is helping me to learn C++. I'm not in a hurry and neither is ChatGPT, so I ask him a lot of questions and he answers them 98% correctly. In my case I prefer to learn C++ and not ask ChatGPT to write the code for me, unless I ask it to demonstrate some function, like system calls for writing a file or creating a folder on the file system and see how it is done by asking him for a detailed explanation of what he did. It helps me a lot to understand when it's hard for me to understand and pay attention.
I think it's a good method for learning simple things.
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,804
Reaction score
2,789
Points
188
Website
github.com
Can it make 3D models and textures?
How about surface bases, airports and buildings? The hab from The Martian, or some other movie?
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,423
Reaction score
677
Points
203
I just asked it and this was the first paragraph of the response:
"As an AI language model, I do not have the capability to create a 3D model or export it in Orbiter msh format. However, I can suggest some software tools that can help with this task."
 

steph

Well-known member
Joined
Mar 22, 2008
Messages
1,390
Reaction score
712
Points
113
Location
Vendee, France
Tried asking it to write code, and, according to a few modders and long-standing members, it wasn't functional code. I don't know much coding myself, but even I could see that it was at the very least pulling numbers out of its virtual behind, regardless of code structure. At least for the vanilla version freely available, while it can give a lot of good answers, it can also screw-up badly and/or lie. I asked him to write some code for the Ryze Tello quadcopter, then, in a separate conversation, to use the DJI SDK for the Mavic Air2 to write an app or script. It wrote the same code as for the Tello, despite the fact that it shouldn't normally remember previous conversations.

As for the 3D stuff, I guess there may be an AI for that, but it's not ChatGPT at the moment. It doesn't 'get' visuals, perhaps it can't 'see' at all. When asked about certain youtube videos, it seems to give out random answers, all wrong. I once asked it for directions, just out of curiosity, and the response it gave was woefully wrong. Looked like it was trying to do a sort of touristic presentation/guide of the area, but even that wouldn't work , since the indications are all wrong.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,256
Reaction score
3,231
Points
203
Location
Toulouse
As for the 3D stuff, I guess there may be an AI for that, but it's not ChatGPT at the moment. It doesn't 'get' visuals, perhaps it can't 'see' at all.

Keep in mind that ChatGPT isn't more self-aware than a rock or a car and has absolutely no idea (from ancient greek ἰδεῖν = to see) of what it is talking about. So, no, it doesn't "see" anything in the usual meaning of the word. It has no "mental picture", so it acts "blindly".
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,254
Reaction score
3,149
Points
138
Location
Massachusetts
I just asked it and this was the first paragraph of the response:
"As an AI language model, I do not have the capability to create a 3D model or export it in Orbiter msh format. However, I can suggest some software tools that can help with this task."
You might need to be more specific with your request. Being a language model, it can only handle text. You might ask it to create a node and connectivity table in Orbiter API format corresponding to a 3d mesh.
 
Top