Display posts from previous

Sort by

I've been following LT dev since around 2013, was sad to see updates end, but really glad Josh is in a good place and still working as he can on the game.

I'm very curious about the AI of NPCs in the game. Single player experience has always been something very important to me, as I'm kind of averse to multiplayer games these days, and heck even multiplayer games could be better with fully fleshed out NPC AI.

Josh I think you could, if you wanted to, really inspire and teach a lot of developers and potential developers (like me) by writting blogs about programming and development of all of these wonderful systems you've created and honed.

Anyhoo I'm just really curious how the AI of NPCs was designed to interact with the 'economy' of the game, and how different aspects of the AI scripting or the framework of the economy itself would change things or could be applied to different types of games and systems.

Velcome to ze forums!
I would also like to know this. I keep forgetting to ask. There is the possibility that it has already been asked and answered though, but I'm too lazy to find it. Plus the forum's search ain't too helpful.

Economy self balances through some AI's staying in older areas of profit, and some moving to new areas.
Some AI's will die off due to staying too long (just like video rental stores did), some will die off due to jumping in too early.

As AI's get richer, they should spawn children AI's that do the same thing, and their random chance is based on their parent's +/- some amount. This allows for sector growth, and development. Children pay a dividend to the parent, until they earn enough to "buy out" their contract with the parent and spit off to be their own entity.

Players then have a possible start point, being a child of a rich enough AI, and paying back their benefactor until they can buy their contract out and make it on their own.

Hmmm, yes that makes sense. Thanks! How then would an AI come to the conclusion of wanting to do some kind of.. nepharious plot against another AI or the player, and try to conspire with other AIs to do it? Also AI's hiring other AI's to fufill requests.

Sorry for tacking those on but I think its somewhat related and I'm curious how AI would be involved in those as well.

Banjojohn wrote:Hmmm, yes that makes sense. Thanks! How then would an AI come to the conclusion of wanting to do some kind of.. nepharious plot against another AI or the player, and try to conspire with other AIs to do it? Also AI's hiring other AI's to fufill requests.

Sorry for tacking those on but I think its somewhat related and I'm curious how AI would be involved in those as well.

AI scans local freighters and sees the value of the cargo, subtracts the convoy's defences to get a approximation of how much profit he can expect.
If the margin is high enough, and/or he is aggressive enough, then he will attack said convoy and capture their goods to sell.

If another AI is also making profit on the same good, the first AI will check the second AI's defences and determine if it would be worth attacking to lower supply, therefore increasing profit for him. otherwise same as above.

If an AI want's any task done, he can put a number on that task for it's value to him, and put that up as a mission.
This includes shipping items, killing enemies, anything really (every possible task should be in this list)
However if he owns his own ships that can fulfil that role, he can then check their ability to do that role against the profit of their current task and reassign them fittingly. Shoring up any lack of capability with mercenaries.
Basically this is how he decides to do things anyway, and could be determined by a value of something like "Likes to own stuff", if he doesn't like to own stuff, then hiring mercs to do jobs for him, like moving goods, mining ore, researching tech, killing his enemies, may be the way he goes.
In fact it should be perfectly possible for a player or AI to play the role of an empire without owning a single ship, by just putting up jobs.

Consiring with other AI's might be a problem, but two or more might put a similar job out, like killing a third factions ships.
Which would look like conspiracy to the players.

Don't worry, asking questions is good, and it allows people to put their thoughts on the matter out there.

Consiring with other AI's might be a problem, but two or more might put a similar job out, like killing a third factions ships.
Don't worry, asking questions is good, and it allows people to put their thoughts on the matter out there.

"Conspiring with other AI's ... "
(ftfy)

And there's always someone somewhere who knows how to spell properly!
(speed of typing vs ability of brain to realise typos)

Excellent responses silver.

From what I know the AI has cogs that are determined by their own "brains" as Josh terms it.
Like a coin falling in those arcade games where it bounces from one stick to another.
Josh programs the AI to just do it's thing, each AI has it's own personal branch of "AI" as determined by race, and other aspects of personality traits that are thrown in to the mix.

One vid I watched recently showed that some AI chose to be miners, whilst others (the Captains) chose their role based on their "end-goal" (either make money, miner - or dominate, be captain and henceforth a faction leader).
Add in the extra special stuff that Silver hints at above, and you have AI that have equally different goals throughout every system/ asteroid field/ planet.
Josh has shown in the vids how the AI will randomly choose a sell price, whether they are successful are not is determined by the fluctuation in the markets based on supply/ demand.

Luckily the actual structure of a free-market AI is pretty simple.
Look for profit, do thing to make profit, if other job has more profit, decided if you should do that instead.

The programming of most of it is just logic trees.
But the programming of advanced profit calculation, that's the cincher. If you can manage to get this part of the equation working accurately, guessing at base profit for each task, then the AI will pursue these tasks properly, and the world will seem properly alive (because it will be alive!!)

However you do need to have enough AI to populate each sector to be able to do this long term.
As market stability long term in this sort of scenario is dependant primarily on the number of individuals making decisions, and the quality of their decisions.

A few hundred AIs will have a much less stable market than one with a few thousand.
Simply because more can afford to make mistakes without dooming the market to die a slow and painful death.

Silverware wrote:
However you do need to have enough AI to populate each sector to be able to do this long term.
As market stability long term in this sort of scenario is dependant primarily on the number of individuals making decisions, and the quality of their decisions.

A few hundred AIs will have a much less stable market than one with a few thousand.
Simply because more can afford to make mistakes without dooming the market to die a slow and painful death.

I have previously suggested this before, but doing so again wouldn't hurt.

First, station AI should have an order of magnitude more control over the local market than a mobile Ship AI to account for onboard beings making their own decisions about investments. And colonies should have orders of magnitudes more than that. (eg. Ship-Origin goods might be traded in increments of 1, Station-Origin goods in increments of 10, and Colony-Origin goods in increments of 1000)

Planetary colonies should always be BY FAR the largest players in a system's market... with the possible exception of a large faction's multi-system trade hub. Huge players like colonies with gigantic stockpiles and production of resources (compared to deep-space stations or with ships) will provide a lot of stability for a market with the handful of AI that would normally be present in a system. Colonies would of course have their own volatility based on internal dynamics, and this planetary volatility would often have more effect on the economy than all the local ships combined.

Because Planet's will have the greatest impact, their internal dynamics would be the most important factors for a system's economy. As such, I have suggested that each Planetary colony have multiple AI with different interests, stockpiles, and production capacities, much like different companies in the real world.(This could easily be tied into Planetary Ownership Play, but that's for a different discussion)

These AI aren't nearly as complex as the mobile ships, and are focused on high level decisions and planning in the forms of Production, Profit, and [relative] Power. They aren't full AI, but they have enough intelligence to be independent actors in a given economy, and given their size, they have the power to skew the entire system in their favor (as they ought be able to)

Challenging your assumptions is good for your health, good for your business, and good for your future. Stay skeptical but never undervalue the importance of a new and unfamiliar perspective.Imagination Fertilizer
Beauty may not save the world, but it's the only thing that can

I was thinking an AI might have an active memory of encounters with other AI's and of course the player, depending on the nature of the encounter it might effect the AI's view on the other entity positively or negatively on the 'friendliness scale', if you get too negative on the friendliness scale, and the AI remembers why it doesnt like you like 'cost me lots of money' or 'shoots at me or people i like' it might check the friendliness level of you with other AI's it encounters and forms a new organization or social group with AIs that consider you a certain level of unfriendly. Then who knows where it goes from there as far as trying to out-maneuver you for economic things, trying to find neutral AI bounty hunters to take you out, etc.

I was thinking an AI might have an active memory of encounters with other AI's and of course the player, depending on the nature of the encounter it might effect the AI's view on the other entity positively or negatively on the 'friendliness scale', if you get too negative on the friendliness scale, and the AI remembers why it doesnt like you like 'cost me lots of money' or 'shoots at me or people i like' it might check the friendliness level of you with other AI's it encounters and forms a new organization or social group with AIs that consider you a certain level of unfriendly. Then who knows where it goes from there as far as trying to out-maneuver you for economic things, trying to find neutral AI bounty hunters to take you out, etc.

Hi Banjojohn,

This is where Josh showed us in an update vid how factions work.
In brief:
- Picture 3x factions all vying for the same market (e.g. mining)
- One faction puts out a tender to cause damage to its competitor over a specific time range - This could be you, the player, who has a mining op in the sector.
- Other AI will then accept this "Mission to cause damage" and start firing at your ships

I know you're talking about individual groups, but I don't know if Josh has this covered, or whether it is covered under the umbrella of Factions above.

From a user's standpoint, the AI should behave almost indistinguishably from a rational player.
I like Banjojohn's thoughts of the relations scale. Additionally, perhaps one could concieve of a predictive algorithm which looks at the sources of profit, positive and negative, and determines if a particular threat is anywhere from buzzing fly to an existential crisis. For instance, if a character (player or otherwise) begins to prey upon the miners in some backwater 'roid belt, the massive faction which employs them might decide that it's cheaper to lose some ships. Or, if the agressor begins to attack the larger, more important targets, the faction AI might predict that the threat seems to have an upward trend and kill off the pirates before its profits suffer to too great a degree. If the threat is sudden and forceful enough, a player should be able to force the AI to choose different shipping lanes.
In the event that a factional AI fails to possess the needed force by which it may extinguish the threat, or if it deems it more profitable to do so, the AI should put up a contract offer to either a mercenary group to kill the pirates, or to a freight transport service which uses its higher rates to afford a form of protected convoy.