Simple scripting for AI

You may post your suggestions about Capitalism Lab here

Would you want us to explore the possibilities of developing a simple scripting system for AI?

Yes
38
100%
No
0
No votes
Not sure
0
No votes
 
Total votes: 38

User avatar
David
Community and Marketing Manager at Enlight
Posts: 10463
Joined: Sat Jul 03, 2010 1:42 pm
Has thanked: 78 times
Been thanked: 233 times

Simple scripting for AI

Post by David »

Would you want us to explore the possibilities of developing a simple scripting system for AI companies in the game?

With such a system, the users will be able to write simple scripts to influence AI behaviors.
chengtsai
Level 4 user
Posts: 129
Joined: Tue Nov 20, 2012 8:04 pm

Re: Simple scripting for AI

Post by chengtsai »

Absolutely yes
User avatar
David
Community and Marketing Manager at Enlight
Posts: 10463
Joined: Sat Jul 03, 2010 1:42 pm
Has thanked: 78 times
Been thanked: 233 times

Re: Simple scripting for AI

Post by David »

Here is an example provided by Megapolis:

There is a solution to this. And it is called events. I should have an ability so set customizable triggers to every firm and aspect of the game. For example I set up a trigger to tell me if I sell less than $250k worth of Smartphones in Department Store #298. Once it will happen, I will get an event. I will change something and postpone this trigger for a month, several months or a year.
Or I need to keep my tennis courts coverage at 30%. Once it will be below that, I will have an event. Then again I will change something and mute the trigger for several months.
Or I will set a reminder when company X shares will drop below $50 combined with mandatory trigger to ping me if it will not drop below $50 in 7.5 months.

In addition to displaying an alert window when a trigger occurs, the AI scripting system will allow the player to edit the script in-game and direct the AI handle to specific trigger events in ways designated in scripts.

With such a system, you will spend less time doing micromanagement, and more time formulating strategy and executing them with the help of AI, and script writing may even become a popular in-game activity!

In fact, these can be the fundamental ideas of a potential new DLC which may potentially transform Capitalism Lab into a grand strategy game, as the scripting and AI will be able to take the micromanagement workload off from the player, allowing the player to concentrate on grand strategy gameplay that includes building more cities and growing the nation. And new features on the national and city levels can be introduced in the future, further reinforcing the game's evolution in this direction.

Please let us know your thoughts on this. When this poll has gathered 30 positive votes, preliminary design work on this may commence.
lagrelax
Level 3 user
Posts: 50
Joined: Wed Sep 12, 2018 8:58 pm

Re: Simple scripting for AI

Post by lagrelax »

David wrote: Sun Nov 10, 2019 3:50 pm Here is an example provided by Megapolis:

There is a solution to this. And it is called events. I should have an ability so set customizable triggers to every firm and aspect of the game. For example I set up a trigger to tell me if I sell less than $250k worth of Smartphones in Department Store #298. Once it will happen, I will get an event. I will change something and postpone this trigger for a month, several months or a year.
Or I need to keep my tennis courts coverage at 30%. Once it will be below that, I will have an event. Then again I will change something and mute the trigger for several months.
Or I will set a reminder when company X shares will drop below $50 combined with mandatory trigger to ping me if it will not drop below $50 in 7.5 months.

In addition to displaying an alert window when a trigger occurs, the AI scripting system will allow the player to edit the script in-game and direct the AI handle to specific trigger events in ways designated in scripts.

With such a system, you will spend less time doing micromanagement, and more time formulating strategy and executing them with the help of AI, and script writing may even become a popular in-game activity!

In fact, these can be the fundamental ideas of a potential new DLC which may potentially transform Capitalism Lab into a grand strategy game, as the scripting and AI will be able to take the micromanagement workload off from the player, allowing the player to concentrate on grand strategy gameplay that includes building more cities and growing the nation. And new features on the national and city levels can be introduced in the future, further reinforcing the game's evolution in this direction.

Please let us know your thoughts on this. When this poll has gathered 30 positive votes, preliminary design work on this may commence.
Sounds decent. Does this apply to the AI companies too? My biggest issue is that AI is too weak, not much competition in late games, especially in mods
User avatar
David
Community and Marketing Manager at Enlight
Posts: 10463
Joined: Sat Jul 03, 2010 1:42 pm
Has thanked: 78 times
Been thanked: 233 times

Re: Simple scripting for AI

Post by David »

Sounds decent. Does this apply to the AI companies too? My biggest issue is that AI is too weak, not much competition in late games, especially in mo
We have just released the new post-release beta version v6.1.00. It comes with a few AI improvements. You may download the new version from https://www.capitalism2.com/forum/viewt ... 769#p28769
User avatar
David
Community and Marketing Manager at Enlight
Posts: 10463
Joined: Sat Jul 03, 2010 1:42 pm
Has thanked: 78 times
Been thanked: 233 times

Re: Simple scripting for AI

Post by David »

This poll has gathered 15 positive votes, so here is the next step:

Let's first explore the possibility of using a script for affecting AI's behavior in setting/changing product prices. Price setting is more straightforward than other aspects of AI and it is logical that we start with an easy goal initially.

Please let us know if you have any good ideas on this.
james88
Level 2 user
Posts: 27
Joined: Mon Feb 09, 2015 4:42 pm

Re: Simple scripting for AI

Post by james88 »

David, is it at all possible to change a mayor's behaviour when selling land via a script option?
The ability would greatly help issues within the boom bust cycle, as sales cause massive negative growth.
User avatar
David
Community and Marketing Manager at Enlight
Posts: 10463
Joined: Sat Jul 03, 2010 1:42 pm
Has thanked: 78 times
Been thanked: 233 times

Re: Simple scripting for AI

Post by David »

james88 wrote: Thu Dec 26, 2019 2:38 pm David, is it at all possible to change a mayor's behaviour when selling land via a script option?
The ability would greatly help issues within the boom bust cycle, as sales cause massive negative growth.
Any more concrete thoughts on how this can be implemented? What kinds of mayor's behaviors in regard of selling land that you have in mind?
User avatar
ALICE
Community Contributor
Community Contributor
Posts: 75
Joined: Thu May 24, 2018 1:53 am
Has thanked: 3 times

Re: Simple scripting for AI

Post by ALICE »

I think AI is weak because it has no business choices. Businesses need to be prioritized and protected from players.
VRBones
Posts: 13
Joined: Thu Aug 10, 2017 9:55 am

Re: Simple scripting for AI

Post by VRBones »

Here's a basic pseudocode for my approach to price-setting:
Initial start: Set price to 15 points above market average rating
If sales utilization >90% set price to 10 points above market rating
If total market share of product above 75% set to 10 points above market rating
If supply limited set price to 5 points above market rating
If Competitor in market, set price to competitor's rating
If own product, increase price by 2 points.

Even with this limited pseudocode, the triggers are quite varied and would indicate a significant structure to be in place to give adequate coverage to even price setting

Here's a couple of other variables / events that could be needed:
Current product total supply (own company & global)
Predicted product total supply (own company & global)
Number of entrants in market (local & worldwide)
Current profit
Predicted profit
Same product sold in city price
Store profit
other product profit in store
Avg product profit per sales unit (own company & global)
Supply sources (volumes, price, freight, quality, brand) (own company & global) (local & worldwide)

Ability to create new variables (eg: If competitor found, PriceWar = True)
Post Reply