Hi guys, together with another friend, we tested an advanced artificial intelligence to be able to understand if actually these programs can be useful to help developers to be able to better edit the Open Rails codes.
We did a test to interface Arduino systems with keyboard controllers and we succeeded (there are only a few holes to fix).
Having said that, I asked the AI to develop, for example, a C# language code that allows you to edit the water Shaders, and this is what follows:
To change the water shader in Open Rails using the C# programming language, you need to use the DirectX development library.
Here is a C# code example that allows you to change the water shader in Open Rails using DirectX:
csharp
using System;
using System.Windows.Forms;
using Microsoft.DirectX.Direct3D;
OpenRails namespace
{
public partial class Form1 : Form
{
private Device devices;
private Effect waterShader;
private string waterShaderFile = "water.fx"; // Name of the water shader file
public Form1()
{
InitializeComponent();
InitializeGraphics();
}
private void InitializeGraphics()
{
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed = true;
presentParams.SwapEffect = SwapEffect.Discard;
device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);
// Load the water shader
waterShader = Effect.FromFile(device, waterShaderFile, null, ShaderFlags.None, null);
}
private void Render()
{
// Use the water shader for rendering
device.SetVertexShader(waterShader);
device.SetPixelShader(waterShader);
// Render the water
// ...
// Reset shaders to default
device.SetVertexShader(null);
device.SetPixelShader(null);
}
}
}
In this code example, a DirectX Device object is created, which represents the video card and handles graphics rendering. The water.fx file containing the water shader is then loaded.
In the Render function, the water shader is set as the current shader used for rendering water. After rendering the water, the default shaders are restored for rendering the other objects.
This is just a sample of code that you can use as a starting point for changing the water shader in Open Rails. You'll need to customize the code to suit your specific needs and the version of Open Rails you're using.
In your opinion, is it possible\useful to be able to support such a program to have more support\help in the development of the code? Could it be a positive outcome for the team?
Page 1 of 1
Using AI to generate\Help developers? It is possible to use the AI Systems for Help Developers with the code
#2
Posted 30 April 2023 - 12:03 PM
Basicly this is how the shaders are handled in Openrails, so there is nothing new in this code. Different library used, more sophisticated loading than this simplyfied code piece, but the same basic concept.
#3
Posted 30 April 2023 - 08:42 PM
gpz, on 30 April 2023 - 12:03 PM, said:
Basicly this is how the shaders are handled in Openrails, so there is nothing new in this code. Different library used, more sophisticated loading than this simplyfied code piece, but the same basic concept.
Yes, but the basenote is simply an example.
Years ago a very bright programmer who professionally wrote code for satellites added some code in the loader that others, for a very long time, found completely incomprehensible. It worked but nobody understood how. If that block of code is still present it might be worthwhile to toss it at ChatGPT with a request to explain how it works. Or re-write it so ordinary humans can follow what it does and maintain it with greater ease. Maybe something of use comes back, maybe not. Either way some exploration of ChatGPT might make clear more feasible opportunities.
#4
Posted 01 May 2023 - 12:51 AM
#5
Posted 01 May 2023 - 04:51 AM
The Visual Studio built-in ChatGPT integration is tied to Azure-subscription, which we hobby-programmers don't have, I suppose. So personally I cannot check what specific help it could provide by analising the whole program package. The free functionality is limited to a dozen of program lines only. For example it can help refactoring LINQ functions to foreach loops, which can help e.g. in reducing allocations.
#6
Posted 01 May 2023 - 04:11 PM
In other words, it can help provided that you know the foundations of the C# code and be able to correct any incorrect parameters.
On water shaders I think you should definitely interface the graphic shader to the code, i.e. have a physical structure of the water and associate it to the code, the same goes if you need to implement some visual or dynamic atmospheric phenomenon, anyway..
Typically I would see it quite useful, so I opened a topic about it, if we have to project ourselves into the future, everything at least I think it's legitimate :-D
On water shaders I think you should definitely interface the graphic shader to the code, i.e. have a physical structure of the water and associate it to the code, the same goes if you need to implement some visual or dynamic atmospheric phenomenon, anyway..
Typically I would see it quite useful, so I opened a topic about it, if we have to project ourselves into the future, everything at least I think it's legitimate :-D
#7
Posted 01 May 2023 - 06:53 PM
gpz, on 01 May 2023 - 04:51 AM, said:
The Visual Studio built-in ChatGPT integration is tied to Azure-subscription, which we hobby-programmers don't have, I suppose. So personally I cannot check what specific help it could provide by analising the whole program package. The free functionality is limited to a dozen of program lines only. For example it can help refactoring LINQ functions to foreach loops, which can help e.g. in reducing allocations.
I see a year subscription to ChatGPT is $240. Is that for a team or per person?
Page 1 of 1