Future of RPG Games - Bannerlord and ChatGPT

Users who are viewing this thread

I got it to help me with some bash scripting. And it helped me create a script that I have been banging my head to make even with asking in forums. Chat GPT was able to help create the script I wanted after a few attempts and testing and tweaking. It made a few errors but it actually helped me create some scripting.

I asked it to set up a Bannerlord mod template in C# sharp and it did it. I went further and asked it to create a script for 'body sliding' and after some explanation it produced something that is probably the script that can make that type of mod. The problem is that it thinks that Bannerlord is at 1.5.7 or something.

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using TaleWorlds.Core; using TaleWorlds.MountAndBlade; using TaleWorlds.MountAndBlade.ViewModelCollection; using TaleWorlds.MountAndBlade.ViewModelCollection.GameMenu; using TaleWorlds.Localization; using TaleWorlds.Engine; using TaleWorlds.Engine.Screens; using TaleWorlds.InputSystem; using TaleWorlds.MountAndBlade.View.Missions; using TaleWorlds.MountAndBlade.View.Screen; using TaleWorlds.TwoDimension; namespace MyBannerlordMod { public class ControlAllyOnKO : MissionBehaviour { private Agent _lastPlayerAgent; private Agent _nextPlayerAgent; private bool _playerKnockedOut = false; public override void OnMissionTick(float dt) { base.OnMissionTick(dt); if (Mission.Current.IsPlayerControlledAgentDead && !_playerKnockedOut) { _playerKnockedOut = true; _lastPlayerAgent = Mission.Current.PlayerControlledAgent; _nextPlayerAgent = GetNextPlayerAgent(); if (_nextPlayerAgent != null) { ChangePlayerAgent(_nextPlayerAgent); } } } private Agent GetNextPlayerAgent() { Agent nearestAgent = null; var playerClan = _lastPlayerAgent.Clan; var playerTroop = _lastPlayerAgent.Character.CurrentFormation.Troop; //First Priority: Clan members nearestAgent = Mission.Current.Agents .Where(x => x.IsHuman && x.IsAlive && !x.IsPlayerControlled && x.Clan == playerClan) .OrderBy(x => x.DistanceTo(_lastPlayerAgent)) .FirstOrDefault(); //Second Priority: Nobles if(nearestAgent == null) { nearestAgent = Mission.Current.Agents .Where(x => x.IsHuman && x.IsAlive && !x.IsPlayerControlled && x.Character.IsNoble) .OrderBy(x => x.DistanceTo(_lastPlayerAgent)) .FirstOrDefault(); } //Third Priority: Higher Tier Troops if(nearestAgent == null) { nearestAgent = Mission.Current.Agents .Where(x => x.IsHuman && x.IsAlive && !x.IsPlayerControlled && x.Character.CurrentFormation.Troop.IsBetterThan(playerTroop)) .OrderBy(x => x.DistanceTo(_lastPlayerAgent)) .FirstOrDefault(); } return nearestAgent; } private void ChangePlayerAgent(Agent newAgent) { // Change the player-controlled agent to the new agent Input.Current.PlayerOrderController.Agent = newAgent
 
I'm skeptical that this will actually work. In order to to create a coherent fantasy you will have to create code that understands what the chat bot said and reflect it in the game world. If some NPC says "My brother was slain on the fields of X by Y" then you need code to actually make that, or whatever the bot said, happen. Piping chat AI stuff into bannerlord dialogues is one thing. Having another general intelligence AI which can then make those things real in the game is entirely another. Without that, it's just kinda weightless dialogue from a chat bot being piped into the game but can't actually have any effect on it.
 
I'm skeptical that this will actually work.
The video is demonstrating it is working.
In order to to create a coherent fantasy you will have to create code that understands what the chat bot said and reflect it in the game world. If some NPC says "My brother was slain on the fields of X by Y" then you need code to actually make that, or whatever the bot said, happen. Piping chat AI stuff into bannerlord dialogues is one thing. Having another general intelligence AI which can then make those things real in the game is entirely another. Without that, it's just kinda weightless dialogue from a chat bot being piped into the game but can't actually have any effect on it.
The chat is drawing game information already available under the hood.
 
Last edited:
Impressive implemetation!


Before trying to answer to your question, you first need to understand how BL is populating the in-game scenes.
When you enter a scene, the game is creating "agents" (the bots) to interact with.
There are basically 2 types of agents.
  • Those who are created based on "permanent" characters (unique ID): the main character, notables, Ladies and Lords, companions etc.
  • Those randomly created to make the scene more alive: villagers, traders, townfolks, thugs, chickens, sheeps...
So to reply to your question:
The game may remember about those random NPC's only if they have an unique ID (not the case for villagers).
Which means that every time you speak to a villager (like in this showcase) and that ChatGPT starts to generate some "unique" background, the game will have to create a new "permanent" character with an unique ID. In addition to the appearance, culture etc... the generated background (only keywords maybe) will then be recorded and linked with that new "permanent" character ID.
Looks good so far but if there is no limit set and you start to speak with every single random villagers and townfolks in every villages and towns, you will end up with an impressive save bloat and really long loading time when entering towns/villagers.

But yeah, this showcase shows us probably the next gen of sandbox games.
It seems more likely and practical that this kind of system would be limited to lords, notables and wanderers rather than random townsfolk and villagers. So since these characters already have unique IDs and character records, would storing all their previous conversations add a lot of bloat or would it be manageable?
 
This reminds me of the old wizardry games (6 and 7) where you typed in your questions and got answers, it was obviously very primitive and based on keywords that triggering responses from a database, nothing procedural, but each character had a lot of unique possible responses fitting their personality so it was still quite immersive. You could ask all sorts of things and get answers, it wasn't limited to just the story relevant answers or generic replies but you could ask things like who their friends were and what they like to do etc.

It's actually weird to me that this hasn't been picked up in newer games, I hope the AI chats like this revive that type of system.
 
It's actually weird to me that this hasn't been picked up in newer games, I hope the AI chats like this revive that type of system.

Neural Network chat technology at this level is still fairly new and too slow to be in a game at runtime, but I can almost guarantee that in the next 2-3 years AI is going to play a massive part in the development of games. In the most extreme case it could wipe out most of the level design, coding and modelling jobs that make up most development teams. I don't know if any big studios are using AI yet but it's too lucrative not to use.

However something that's like half AI, half precomputed data that can run on a normal client at runtime has been done already, there are apps with that kind of thing for photo manipulation, which is a lot more complex than text.
 
It seems more likely and practical that this kind of system would be limited to lords, notables and wanderers rather than random townsfolk and villagers. So since these characters already have unique IDs and character records, would storing all their previous conversations add a lot of bloat or would it be manageable?
Far more manageable I guess.
I have no clue about how ChatGPT is working but I imagine only keywords would be linked with the character ID every time you interact with an NPC.
So instead of having different NPC using limited random long pre-written texts (basically what BL is doing now), you will have different NPC using generated texts (based on the existing keywords if any).
Resulting in far more dialog diversity...
But again that's only a personal assumption...
 
It's actually weird to me that this hasn't been picked up in newer games, I hope the AI chats like this revive that type of system.
It wasn't picked up because Sir-Tech Canada went out of business.

In the case of Wizardry, that sort of thing was a ton of additional work and writing. Sir-Tech always had a reputation for humorous and well-written games but the company itself was not well managed. They went out of business shortly after Wizardry 8. W8 was around the same time as Deus Ex, Baldur's Gate 2, Vampire: The Masquerade, Morrowind, so other titles pushed the industry in a different direction.

In the most extreme case it could wipe out most of the level design, coding and modelling jobs that make up most development teams.
Why level design?
 
A lot of a level designer's job is tedious placing of assets or building of AI meshes that has become very time consuming in open world games. There are already algorithms to procedurally generate stuff but their use is fairly limited. AI on the other hand could (probably) generate interesting (enough) flowing interiors covered in details. Just like most environmental artists just use speedtree and world machine now, a AAA level designer of the coming decade might only be a janitor for cleaning up the AI output.
 
Isn't it possible to fake the same functionality of Chat GPT? Instead it could be chat box that is doing something close but in reference to Bannerlord.
 


Bloc said:
A lot of you were asking "integration" to game systems, and this video does just that. I also added some more improvements on top of previous videos. After the critique on previous videos, I tweaked and did some improvements on the AI. You will notice the following: AI answers less verbose. AI speaks in a more accented way (prone to make more mistakes and styled in peasant-ish), AI gives less information about themselves to strangers, AI remembers conversations persistently during the scene. This video demonstrates direct interaction with game systems, such as random encounters, recruiting, haggling, trading and companion hiring. Everything still generated on the fly with accurate information. However, for video purposes, I set a certain probability to 100% so that they would appear in the video. These are: "Chance for random event happening" and "willingness of a person to join a warband if they are carrying item".

Just to give a little more context, during chat-to-system integration, I'm not searching for a "keyword" to understand if the transaction is completed. Instead, there is an NLP(Natural Language Processing) running on the back that evaluates the response. This gives great flexibility to missions and still keeps the freedom in the conversations. Even though the video doesn't have this example, NPCs can reject your haggle depending on their personality. For example, lowering the value too much is likely to be rejected. Sometimes they are not even accepting your gift saying that they are proud and don't need charity. I might have a Q&A type of post in the channel soon on these stuffs. Hopefully in this video you will notice that: AI answers less verbose. AI speaks in a more accented way (prone to make more mistakes and styled in peasant-ish), AI gives less information about themselves to strangers, AI remembers conversations persistently during the scene (I might expand this idea further soon)
 
Neural Network chat technology at this level is still fairly new and too slow to be in a game at runtime
Bloc's latest inWorld (as opposed to ChatGPT) version looks fast enough.


"There are certain limitations with this system. First and more importantly, this system doesn't directly interact with game system (oppose to what I have shown in Chatgpt variant) because this is a different system. However, this system comes with TTS and almost instant response time.
Another tricky limitation is ethics. Usually this shouldn't be any problem, most of your heavy insults won't even reach server, however certain things can reach to server and cause problem. Sometimes even small things, like naming your character "****" can be a tricky thing. You should keep this in mind while interacting with agents.
Language is another limitation at the moment. It only works with English"
 
Last edited:
Back
Top Bottom