Busy Bee: Fulfill small transport goals

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Busy Bee: Fulfill small transport goals

Post by Alberth »

Sapphire united wrote:I really REALLY like this script.ever
Thanks :)
Sapphire united wrote:It forces me to reallocate parts of my network to focus transport to different parts of the map as time passes.
Ha, it cleverly displays a goal to you, and it measures progress of deliveries, that's all it takes to make people believe they have to do things :D
But yeah, it's nice to get goals that you can fulfill, I also fall for the above trick :)
Sapphire united wrote:However, it also makes me revert to point to point spaghetti garbage builds in order to get things done fast and cheap.
I tend to keep everything, and unify with other transport later, as the need arises. It mostly depends on how you play the game, I guess.
Sapphire united wrote:Perhaps requiring large amounts of tranported products would reduce the tendancy to build spagetti garbage train setups?
I don't know if that would be the case. The script generates random destinations for random cargoes, so your transport lines get scattered all over the map, you keep that, no matter how large the goal is.

If you want, you can experiment with the idea.
Unpack the .tar file to a directory with its files (and move the .tar out the way to avoid openttd finding it).
Open "main.nut" in a text editor (eg notepad++ is said to be useful for Windows afaik, but there are lots of text editors).
Around line 304 it says "cdata.AddActiveGoal(cargo, accept, amount);" where 'amount' is the amount of cargo you need to deliver. Multiply that eg with 10, like "cdata.AddActiveGoal(cargo, accept, amount * 10);" (ie add the " * 10" text just before the closing parenthesis).
That change will give you goals with 10 times as much cargo. Save the file, and launch openttd.

It should find BB again, and give you larger transport goals. Please report back if it works for you.
Sapphire united wrote:Or mix this with a cash goal aswell..
Why would this work? In my games, I have more cash than I need, so I really don't care about cash. Does giving cash for a goal increase your urge to fulfill something?
Being a retired OpenTTD developer does not mean I know what I am doing.
ST2
Engineer
Engineer
Posts: 63
Joined: 07 Apr 2011 14:17

Re: Busy Bee: Fulfill small transport goals

Post by ST2 »

about the amount, instead of a fixed value, can be used a multiplier setting.

made a small diff file with changes that work but I dnt know if placed the GetSetting on the correct place :roll:

anyway, it's a suggestion too :)
Attachments
_Cargo_amount_Multiplier.diff
cargo amount multiplier
(1.68 KiB) Downloaded 177 times
ST2
Engineer
Engineer
Posts: 63
Joined: 07 Apr 2011 14:17

Re: Busy Bee: Fulfill small transport goals

Post by ST2 »

Alberth suggested the usage of % instead of integer values, and I took the laziest solution, aka * 100 on settings with a /100 in the script. I think it works as intended :D

added a step_size of 10 in settings (hopefully on the correct place), but that's not important since value can be edited directly

well, here it is (diff file attached)

Note: don't need to thank. It's polite, I know! And GS's get better with testers and people suggesting things, but the real thanks are to the GS creators. I'm not very good at programming stuff so, thank you very much for giving me the opportunity of playing with this gamescript :)
Attachments
_Cargo_amount_Multiplier2.diff
(1.73 KiB) Downloaded 164 times
User avatar
Zhall
Tycoon
Tycoon
Posts: 1237
Joined: 17 Jul 2007 01:36
Skype: moonray_zdo
Location: Teh matrix, duh.
Contact:

Re: Busy Bee: Fulfill small transport goals

Post by Zhall »

A cash goal will motivate players to take things long distances, therefore building decent networks instead of point to point small ones, it will even create the urge to repurpose large networks, and re-ordering groups of trains (which I have never done) is now a real possibility.

Shared orders and grouping vehicles will become extremely important later on in the game.
ST2
Engineer
Engineer
Posts: 63
Joined: 07 Apr 2011 14:17

Re: Busy Bee: Fulfill small transport goals

Post by ST2 »

Sapphire united, instead of cash goal, why not a Goal to complete X BusyBee goals? The gamescript is based on it, complete the goals, it doesn't matter if you have much or less cash in bank, neither cares about profits.
And that's the way I love this gamescript.

As a suggestion, try to apply my diff, and set cargo amount (%) to 2000%

and there we can talk about cash xD

Edit:
what I liked on this GS is that you have to complete specific goals, doesn't matter the cash you have. Ofc, it helps if you have more profit tracks/deliveries, but profit and cash, imo, it's not the goal of this gamescript :)
The way players fullfill the goals presented... it's their choice. Or with short tracks (less profit), or longer ones (more profit). And 2nd option gives more space to invest to complete other BB goals.

Btw, about complete X BusyBee goals and company win the game, or the company that complete more BB goals in Y game years already been tested, in a server online (1.5.0-beta2 now), since the 1st public release of BusyBee GS.
I made some other changes, including the usage of Storybook to keep each company completed goals (can be endless if server have no goal or time to restart). I'll post changes here... after all well set :)
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5656
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: Busy Bee: Fulfill small transport goals

Post by andythenorth »

So...one of the reasons I wanted to make Busy Bee (and I think Alberth might concur) is to get more people making GS.

I can't see Busy Bee adding cash (or other) rewards for completing goals. Really, Busy Bee is a non-goal goal script. There is no bigger purpose than completing the next transport goal, and I think it will stay that way by design. The only 'reward' is another goal to complete. :D

That doesn't stop other people forking it, or writing their own from scratch. Writing GS does require some programming ability, but it's not rocket science. Forking Busy Bee and adding a cash goal would probably be quite easy.

http://dev.openttdcoop.org/projects/busy-bee-gs

To anticipate a likely request; no I don't think rewards would be added as a configurable option to Busy Bee. I would rather see lots of different GS, and play a new one each time I start a game, rather than trying to make one ultimate uber-configurable GS. Configuration is generally tedious. :wink:
User avatar
te_lanus
Transport Coordinator
Transport Coordinator
Posts: 326
Joined: 19 Jul 2012 18:04
Location: The Elizabeth Arkham Asylum for the Criminally Insane

Re: Busy Bee: Fulfill small transport goals

Post by te_lanus »

Just a quick question or two :D

1) Is it possible for the script to check the size of a city when it makes a passenger goal to scale it to the city population. I've had it where a big city (2000+ p) had a goal of 170 passengers, and a town of 300 have a goal of 2600 (the last one is ok, and only used as an example) using ST2's patch makes big towns "more profitable", but now small towns get swamped.

2) Is there a way to cancel a goal, or a switch that one can use to replace unused goals that's nearing the end. (This is the longest I've taken to do a post 105minutes (busy at work))
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Busy Bee: Fulfill small transport goals

Post by Alberth »

Sapphire united wrote:A cash goal will motivate players to take things long distances, therefore building decent networks instead of point to point small ones, it will even create the urge to repurpose large networks, and re-ordering groups of trains (which I have never done) is now a real possibility.
Really?
You have a zillion dollar company (or whatever money unit they use in teh Matrix), and you need 1 dollar from the script to create an urge?

Maybe 1 dollar isn't enough, but how much is enough then? 10 dollar, 1000 dollar, another zillion dollar? As ST2 says, you can keep all the money you get from the deliveries themselves, at least that makes sense, as in, you worked to make that happen.
Sapphire united wrote:Shared orders and grouping vehicles will become extremely important later on in the game.
Not sure, it depends a lot on how you play the game I guess.
I do use shared orders, although for a BB game, you can get quite far even if you don't use them. The scattered goals encourage building small scale solutions all over the map, rather than the one big network solution you see a lot.

I have never used grouping in my games at all, so cannot say anything about them.
ST2 wrote:Btw, about complete X BusyBee goals and company win the game
As Andythenorth said already, BB is a non-competitive script by design. It's an experiment to get away from all the "win by doing <something> best" scripts that exist, in order to find new forms of playing. In other words, how can you provide an entertaining game where winning is not the drive to play.
Due to the above, winning a BB game is thus quite impossible. That also includes competition against one self, eg trying to beat the time you need to finish X goals.

So while using BB for that is not going to work very well, I would like to see or do other experiments where there is room for competition at some time.
te_lanus wrote:1) Is it possible for the script to check the size of a city when it makes a passenger goal to scale it to the city population
Currently, the script only checks for having a non-zero provider at some distance from the destination (ie a sort of feasibility check that the requested cargo can be obtained at all). It does not look at the amount provided nor at the amount required. It may be useful to extend those checks. I am not so much worried about too small goals. BB mostly pushes towards building a connection, delivering the actual cargo isn't that important in my view. I am more worried about too big goals, eg 6000 bags of mail, and only very small towns in the area, so it takes forever to get that much mail.


[Hmm, "delivering the cargo isn't that important"... :idea: ]
te_lanus wrote:2) Is there a way to cancel a goal
Just wait for the timer to expire. In BB version RC1, you had to complete the goal before the timer expired. In version RC2M, you can take as long as you like, since the timer starts a new cycle when you deliver cargo. That makes it feasible to set the timeout length relatively short, so goals that you don't like disappears relatively quickly. I would like the option to cancel goals, but the standard goal window doesn't seem to support this, it may need a story page to interact with goals.


Edit: Added the patch, thanks ST2.
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
Zhall
Tycoon
Tycoon
Posts: 1237
Joined: 17 Jul 2007 01:36
Skype: moonray_zdo
Location: Teh matrix, duh.
Contact:

Re: Busy Bee: Fulfill small transport goals

Post by Zhall »

Hah, in the 7 years I've been on the forums that's the first time anyone has notice the "The matrix"

I see now why a cash goal is irrelevant, and how station throughput (thus large, efficient networks) will become the focus.
User avatar
Awesometrains
Traffic Manager
Traffic Manager
Posts: 129
Joined: 22 Nov 2015 17:07

Re: Busy Bee: Fulfill small transport goals

Post by Awesometrains »

Percy: James, you must be a busy bee!
James: Do you mean I have to be painted yellow and black?
Percy: Yes!
James: But why?
Percy: Because I'm Controller for the day!
-----------------------------------------
This is why I laugh when I see this script


Image

---------------------------------------------------------------------------------------------------------------------------------------------------------
On Topic

You should have a scaling difficulty becuase at the very start , i cant afford to build a route across the whole map
Qa'pla!
User avatar
Sylf
President
President
Posts: 957
Joined: 23 Nov 2010 21:25
Location: ::1

Re: Busy Bee: Fulfill small transport goals

Post by Sylf »

When I play on a BB multiplayer server, I find 10 goals at a time keeping me busy the whole game.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Busy Bee: Fulfill small transport goals

Post by Kogut »

"It requests a given amount of cargo of a given type to deliver to a given destination within a time frame."

Is it possible to add this descripton to Bananas description? Currently it has only "new goals for transportation" what is not making clear what kind of goals is generated (for example, citybuilder GS also has "new goals for transportation").
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
xarick
Transport Coordinator
Transport Coordinator
Posts: 336
Joined: 26 Feb 2015 00:52

Re: Busy Bee: Fulfill small transport goals

Post by xarick »

[14:13] <Samu> i found a bug in busybee
[14:14] <Samu> it collects 16 companies, while there's only 15
[14:16] <Samu> for (local comp_id = GSCompany.COMPANY_FIRST; comp_id <= GSCompany.COMPANY_LAST; comp_id++) {
[14:16] <Samu> line 113
[14:16] <Samu> main.nut
[14:17] <Samu> <= should be <
[14:18] <Samu> also in line 426
Formerly known as Samu
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Busy Bee: Fulfill small transport goals

Post by Alberth »

Fair enough, however, the documentation says "last available company", which lead me to believe that the value could be used.
At least it's better than the other way around :)
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: Busy Bee: Fulfill small transport goals

Post by 3iff »

Bug found in Busy Bee and Bee Rewards v5892

Main.nut line 260.

It reads prod_score = best_score; but that's actually backwards.
It should read best_score = prod_score;

That way, it actually records the best score. At the moment it just selects the last non-zero score and uses that as the goal destination.

Anyway, using Bee Rewards is giving me a lot of fun as I've tuned down the delivery payments so vehicles barely make a profit and I'm relying on completing goals to generate enough cash to keep the company viable.

I also limit myself to only creating routes that will fulfill a goal. The start is hard work but after 20+ years I have many routes that automatically pick up a new goal (as it was an old goal once).
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Busy Bee: Fulfill small transport goals

Post by Alberth »

3iff wrote:Bug found in Busy Bee and Bee Rewards v5892
Thanks for the report. I forwarded the bug to the project: https://dev.openttdcoop.org/issues/8647

Bee rewards uses an older version of the internal goal selection, I checked busy bee too and there isn't a "best_score" variable in the files any more.
BB is now also smarter to avoid asking for the same transport goals, but it doesn't pay anything, so your setup would not work.
Being a retired OpenTTD developer does not mean I know what I am doing.
User avatar
3iff
Tycoon
Tycoon
Posts: 1093
Joined: 21 Oct 2005 09:26
Location: Birmingham, England

Re: Busy Bee: Fulfill small transport goals

Post by 3iff »

Regarding the different code on Busy Bee for choosing transport goals:

If I'm reading this correctly, it should choose the best 32 goals (if there are that many) then randomly choose one of those. If that's the intent, then I don't think that's what it actually does. I added this code section to my version of Beereward then added GSLOG.Info code to show what it was actually doing...and it didn't seem right.

As I only found this possible problem at 10pm last night I've had almost no time to investigate...of course, if I have misunderstood the intent then I'm chasing wild geese!

However, I only look from the point where a new possible route is to be added to the candidates array so I'm presuming it's a valid possible route...and that's where it all falls apart...the new route is added but sometimes another route is removed.

However, it does create some goals and successfully chooses one of those so it's not all bad, I just don't think it's doing what is actually intended. It's just me trying to be a perfectionist!

More investigations today and more info next Tuesday when I'm back online.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 10 guests