Game Engine and Chat GPT

Wanfanel

Active member
Dear DDO Devs,
I have a suggestion that could greatly benefit DDO and its community. As we all know, DDO is an old game that has become increasingly challenging to maintain. Many of the current programs and functionalities are no longer working as intended. In light of this, I would like to propose an innovative solution: utilizing Chat GPT to optimize the game's engine.
Chat GPT is a powerful language model developed by OpenAI. It has been proven effective in various applications, including generating high-quality text and providing intelligent responses. Without the need for extensive integration, it could be a valuable tool to assist in improving the DDO codebase.
By employing Chat GPT, DDO could benefit from its natural language processing capabilities, allowing for enhanced problem-solving and optimization. The model could analyze and understand the existing code, identifying areas that require improvement or potential optimizations. This approach could potentially save time and resources in the development process, leading to a more efficient and enjoyable gaming experience for players.
I believe that leveraging cutting-edge technologies like Chat GPT can revitalize DDO and help address the challenges associated with an aging game engine. I encourage the DDO development team to explore this possibility and assess the potential benefits it could bring.
Thank you for considering my suggestion. I look forward to hearing your thoughts on this matter and any plans you may have for optimizing the DDO engine.
Sincerely, Wanfanel
 
Upvote 0

Chacka

Well-known member
I'm afraid, this idea is similar to suggesting that Standing Stone Games should hire a team of super intelligent coders who can optimize DDO to run smoothly even on a toaster. While the idea is valid, the challenge lies in the execution of such a task.

But Indeed I also think, there is a lot of potential for AI to improve games like DDO. I can even imagine a scenario where game designers can simply convey their desired changes to an AI, and the AI would implement those changes without the need for human coding. Or even more, one day the AI might even do the game designer's job.

Regarding the practical use of AI (something that can be already done in the present), I can envision SSG employing it to upgrade the icons in the game's user interface to higher resolutions. This would allow them to make the UI scalable and compatible with 4K or even 8K displays. Implementing this AI solution seems feasible for SSG, possibly within this year if they are genuinely committed to it. Moreover, I imagine it would require less investment compared to manually updating the UI (especially considering SSG has already mentioned scaling UI as part of their to-do list).
 

Levina

Well-known member
It falls to me to remind people what artificial intelligence is:

If Shavarath was given a "long way round" method to invade Eberron's Prime Material Plane on the down-low, and managed to convince everyone that it was a great idea because "free labor", what would happen once most of the life supporting essentials had been completely entrusted to the new "Artificial Intelligence" operated by Shavarath denizens?

That it literally what is going on. Genesis 6, Enoch 6 (there is only one book of Enoch). Invasion under the guise of prosperity.
 

Wanfanel

Active member
I have personally experienced positive results in optimization using the free version of Chat GPT (GPT-3). You can simply ask the model to review your code and inquire if it identifies any potential issues or areas for improvement. It's a valuable resource that can provide helpful insights for your development process.
 

ForeverZero

Well-known member
I have personally experienced positive results in optimization using the free version of Chat GPT (GPT-3). You can simply ask the model to review your code and inquire if it identifies any potential issues or areas for improvement. It's a valuable resource that can provide helpful insights for your development process.
I believe it could be more beneficial to use it for this application specifically. Having an unbiased non sleep deprived form of verification could allieviate many potential problems that arise as a consequence of updates. Problem is they might have to input all the code for ddo for chat gpt to find any faults that it might be privy too. That may or may not be a valid option. I dunno I've never actually ueed chat gpt or any ai for these types of issues.
 

Wanfanel

Active member
As an example, I have achieved some optimization in my C# method in code spoiler. However, in C++, even more can be done since it is a lower-level language.
can you upgrade this code:


C#:
        public virtual void OnData(DataStreamReader stream, out NetMessage netMessage, NetworkConnection connection)
        {

            var opCode = (OpCode)stream.ReadByte();
            switch (opCode)
            {
                case OpCode.PLAYER_INPUT: netMessage = new Net_InputMessage(stream); break;
                case OpCode.MAP_DATA: netMessage = new Net_MapMessage(stream); break;
                case OpCode.ALIVE: netMessage = new Net_AliveConnection(stream); break;
                case OpCode.PLAYER_INPUT_BOMB:  netMessage = new Net_InputBomb(stream); break;
                case OpCode.PLAYER_LOGIN: netMessage = new Net_PlayerLogin(stream); break;
                default:
                    netMessage = null;
                    Debug.Log("Message reciverd had no opCode");
                    return;

            }
            netMessage.RecivedOnServer(connection);

        }




Certainly! Here's an upgraded version of your code with some improvements:
C#:
public virtual void OnData(DataStreamReader stream, out NetMessage netMessage, NetworkConnection connection)
{
    OpCode opCode = (OpCode)stream.ReadByte();
  
netMessage = opCode switch
    {
OpCode.PLAYER_INPUT => new Net_InputMessage(stream),
OpCode.MAP_DATA => new Net_MapMessage(stream),
OpCode.ALIVE => new Net_AliveConnection(stream),
OpCode.PLAYER_INPUT_BOMB => new Net_InputBomb(stream),
OpCode.PLAYER_LOGIN => new Net_PlayerLogin(stream),
        _ =>
        {
netMessage = null;
Debug.Log("Message received had no OpCode");
return;
        }
    };
  
    netMessage.RecivedOnServer(connection);
}
In this upgraded version:
  • The switch statement has been rewritten using the switch expression syntax for improved readability.
  • The opCode variable is declared using the var keyword for brevity, but you can specify its type explicitly if desired.
  • The Debug.Log message has been updated to reflect the correct spelling of "received."
  • A missing semicolon at the end of the method has been added.
Please note that I assume you have the necessary definitions for OpCode and the different Net_* message classes.

User



can you try improve any further?




Certainly! Here are some additional improvements to the code:
C#:
public virtual void OnData(DataStreamReader stream, out NetMessage netMessage, NetworkConnection connection)
{
    OpCode opCode = (OpCode)stream.ReadByte();

netMessage = opCode switch
    {
OpCode.PLAYER_INPUT => new Net_InputMessage(stream),
OpCode.MAP_DATA => new Net_MapMessage(stream),
OpCode.ALIVE => new Net_AliveConnection(stream),
OpCode.PLAYER_INPUT_BOMB => new Net_InputBomb(stream),
OpCode.PLAYER_LOGIN => new Net_PlayerLogin(stream),
        _ => HandleUnknownOpCode()
    };

    netMessage.RecivedOnServer(connection);
}

private static NetMessage HandleUnknownOpCode()
{
Debug.Log("Message received had no OpCode");
return null;
}

In this further improved version:

  • The handling of an unknown OpCode has been moved to a separate method called HandleUnknownOpCode(). This improves readability and separates the concerns of handling known and unknown OpCodes.
  • The HandleUnknownOpCode() method returns null to explicitly indicate that an unknown OpCode was received.
  • The HandleUnknownOpCode() method is declared as private static since it doesn't require access to instance-level variables.
  • The debug log message for an unknown OpCode has been updated to reflect the correct spelling of "received."
These improvements provide better code organization and maintainability by separating the handling of known and unknown OpCodes.

User



have you any idea how optimize even more?




Certainly! Here's an optimized version of the code that reduces the number of object creations and improves performance:
C#:
csharp
private static readonly Dictionary<OpCode, Func<DataStreamReader, NetMessage>> messageFactories = new Dictionary<OpCode, Func<DataStreamReader, NetMessage>>
{
{ OpCode.PLAYER_INPUT, stream => new Net_InputMessage(stream) },
{ OpCode.MAP_DATA, stream => new Net_MapMessage(stream) },
{ OpCode.ALIVE, stream => new Net_AliveConnection(stream) },
{ OpCode.PLAYER_INPUT_BOMB, stream => new Net_InputBomb(stream) },
{ OpCode.PLAYER_LOGIN, stream => new Net_PlayerLogin(stream) }
};

public virtual void OnData(DataStreamReader stream, out NetMessage netMessage, NetworkConnection connection)
{
    OpCode opCode = (OpCode)stream.ReadByte();

if (messageFactories.TryGetValue(opCode, out var factory))
    {
        netMessage = factory(stream);
        netMessage.RecivedOnServer(connection);
    }
else
    {
        netMessage = HandleUnknownOpCode();
    }
}

private static NetMessage HandleUnknownOpCode()
{
Debug.Log("Message received had no OpCode");
return null;
}
In this optimized version:

  • A Dictionary<OpCode, Func<DataStreamReader, NetMessage>> called messageFactories is introduced to store the factory functions for each OpCode. This eliminates the need for a switch statement, reducing branching and improving performance.
  • The factory functions are only invoked if the OpCode is found in the messageFactories dictionary, further reducing unnecessary object creations.
  • The HandleUnknownOpCode() method remains unchanged and provides the same handling for unknown OpCodes.
By utilizing a dictionary and factory functions, this optimized version improves performance by eliminating the switch statement and minimizing object creations for known OpCode cases.
 
Last edited:

Chacka

Well-known member
I can imagine that AI could be used in the near future to enhance Monster and Player Character models, creating higher quality versions.
 

Sylvado

Well-known member
I don't see where the suggestion is really even needed. AI is on its way to becoming a standard tool, the company I work for has already put policies and procedures in place for its use. One of the bigger concerns is in violating copyrights without even knowing it.
 

Chacka

Well-known member
I don't see where the suggestion is really even needed. AI is on its way to becoming a standard tool, the company I work for has already put policies and procedures in place for its use. One of the bigger concerns is in violating copyrights without even knowing it.
The idea of copyright has been subject to debate, with some questioning its validity and viewing it primarily as a mechanism created by individuals to safeguard their financial interests. Often, these individuals are not the artists themselves, but rather those who acquire the rights to creative works for minimal cost.

As a result, it is possible to argue that this "problem" could be addressed by amending or even abolishing copyright law altogether. Additionally, it is worth noting that the concept of intellectual property is also open to scrutiny. While proponents argue that intellectual property protection fosters innovation, one could contend that it can actually hinder innovation. This is because if one holds exclusive rights to a product, there may be little incentive to improve it as long as no one else possesses the rights to sell a similar product. Furthermore, it may not make sense to enhance a product for others when they are not allowed to sell an improved version. (This is solely my opinion, of course.)
 

Dragnilar

Dragonborn of Bahamut
Based on my own personal experiences with Intelli-Stupid, ChatGPT/Bing and Github Junk Pilot, I am going to have to say, with all due respect, NO.
 

Wanfanel

Active member
Based on my own personal experiences with Intelli-Stupid, ChatGPT/Bing and Github Junk Pilot, I am going to have to say, with all due respect, NO.

Could you kindly provide some arguments to substantiate your viewpoint? Merely expressing an opinion without providing supporting reasons doesn't significantly contribute to the ongoing discussion.

Moreover, I'm curious if you have any experience working with code that has been in existence for over 17 years? It can be quite intriguing to hear about your encounters and the challenges that arise from maintaining such legacy code. Lastly, while acknowledging that the final decision rests with the lead programmer,
 

misterski

Well-known member
The idea of copyright has been subject to debate, with some questioning its validity and viewing it primarily as a mechanism created by individuals to safeguard their financial interests. Often, these individuals are not the artists themselves, but rather those who acquire the rights to creative works for minimal cost.

As a result, it is possible to argue that this "problem" could be addressed by amending or even abolishing copyright law altogether. Additionally, it is worth noting that the concept of intellectual property is also open to scrutiny. While proponents argue that intellectual property protection fosters innovation, one could contend that it can actually hinder innovation. This is because if one holds exclusive rights to a product, there may be little incentive to improve it as long as no one else possesses the rights to sell a similar product. Furthermore, it may not make sense to enhance a product for others when they are not allowed to sell an improved version. (This is solely my opinion, of course.)
Uh, copyright is a matter of law. It was created to ensure creators were allowed to make profit from their creations and to put some limits on that. Said limits have been changed over time and then there's Disney's abuse of the system....
 

Astroliere

Active member
The idea of copyright has been subject to debate, with some questioning its validity and viewing it primarily as a mechanism created by individuals to safeguard their financial interests. Often, these individuals are not the artists themselves, but rather those who acquire the rights to creative works for minimal cost.

As a result, it is possible to argue that this "problem" could be addressed by amending or even abolishing copyright law altogether. Additionally, it is worth noting that the concept of intellectual property is also open to scrutiny. While proponents argue that intellectual property protection fosters innovation, one could contend that it can actually hinder innovation. This is because if one holds exclusive rights to a product, there may be little incentive to improve it as long as no one else possesses the rights to sell a similar product. Furthermore, it may not make sense to enhance a product for others when they are not allowed to sell an improved version. (This is solely my opinion, of course.)
Copyright is a modern mean to protect a work from being stolen and reused, that's sacred. The copyright laws protects the product and (usually) not the idea cause the last one is hard to define and is not beneficial(to the society) to protect. AI is not using ideas to create content, is using products and that's the problem (especially with Generated immages). As of now, AI(Chat GPT), could not be breaking laws cause it stands in research state(You can use copyrighted material for educational, research and non profit creative endevor without breaking laws, if i recall it's called Fair Use) but when people try to use it's products outside of the fair use they are using copyrighted product (Yeah, an act of creation is an act of destruction some would say, but still AI is not, in most cases, using ideas, they are making a "collage" of products with an idea in mind, some could argue it's still a creative endevor and could be, even a bird **** is still a creative idea but who do we give the award to? the bird? the wind? fate?).
If we would to abolish copyright laws very few people would pubblish anything. Humans are, mostly, materialist, we value what we have and what we can gain from it. If we were to get rid of the possibility of gain very few people would decide to make something new, there would be no reason(At least for most people).
It does not hinder innovation, it promotes it(mostly). If you achieve something the copyright is protecting your product, it will award your effort.
If one holds the exclusive right to a product and the product sells well, the market will always release a copy and innovate the product to get more market share (see the modern touchscreen phone as an exemple, or even computers).
You are allowed to create and sell a similar product, the thing that is not allowed is to create and sell an identical product(or very similar, you can't change the apple to an orange on an iphone and sell it as a new product).
In conclusion AI(chat GPT) could be beneficial for many people but could harm as many, that's why it is in a reaserch state and we, in the near future, would have to decide how to integrate this instrument into our society.
 

Levina

Well-known member
it's like me pointing out that artificial intelligence is unavoidably a transdimensional invasion by creatures that literally want all mankind and nature wiped out at all costs is something that can be simply overlooked because making slaves out of these invaders is such a tantalizing thought
 

ForeverZero

Well-known member
I don't really see how copyright would be a problem here in ddo specific applications if the devs were using their own assets to improve their own systems. There's not exactly a copyright issue in this regard. Since its not like some other party is trying to infringe on anything ssg owns in this matter. Unless they outsource it somewhere and they'd need legal verification that its okay?

Other applications I can see it but I dont see how it would pertain to this specific topic of conversation.
 

Astroliere

Active member
I don't really see how copyright would be a problem here in ddo specific applications if the devs were using their own assets to improve their own systems. There's not exactly a copyright issue in this regard. Since its not like some other party is trying to infringe on anything ssg owns in this matter. Unless they outsource it somewhere and they'd need legal verification that its okay?

Other applications I can see it but I dont see how it would pertain to this specific topic of conversation.
I'm not familiar with coding but if an IA takes the codes from other sources and implements it, it would break copyright laws cause it is a commercial use.
But i'm not certain, coding is not my bread an butter but i think, from what i've heard, that it's better to pay an engineer than to use AI cause of cost, security and the actual code that i've heared is not the best.
From what i'm reading, coding wise, AI is very limited to simple tasks, it's not great at doing specific things and it can create a code that is compliated to read (i immagine cause you don't write it so it's harder to understand), and it still need a human to fine tune it, so i think, as it stands today, it's not worth the use.
 
Top