Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Dec 12, 2018 1:23 pm

All times are UTC




Post new topic  Reply to topic  [ 49 posts ]  Go to page 1 2 3 Next
Author Message
 Post subject: Awards GS
PostPosted: Mon Nov 18, 2013 5:47 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
Here's a new gamescript : awards.
This GS doesn't handle goals and town growth. Offering a different style of gamescript.
It need an openttd that handle 1.4 GS API.

There's currently no dependencies for it. Language: english and french.

Here are the rules (but just hit the storybook button for more explain):
- You win awards, medals... by playing the game and get points for each one you own.

If enable, you can also win rewards :
- For each X points (per default 100) : a company steal money from others companies.
- For each X month, all companies get a percent of money base on their rank.

The amount of money, inverval... are options you can set.

Both rewards use a base money amount for money operation, that "BaseMoney" is x * LoanInterval (where x is configurable in the script option) : per default 1

* 1 reward is a periodic one (disable per default): companies cannot loose money with this one, it have two usage :
- Gives a bit of money to boost companies that lead the rank table
- Balance the other reward bad effect (as this one takes money)
It's pretty simple :
The company rank 1st gets 100% of BaseMoney
The company rank 2nd gets the percent of points from the 1st company of BaseMoney : so if 1st company have 130 points, 2nd company have 90 points and BaseMoney is 10000 : 1st company takes 10000, 2nd company takes 90 / 130 * 10000 = 6923.... And another one with 40 points : 40 / 130 * 10000 = 3000

* And the 2nd reward is gave to any companies that reach an amount of points (this one is per default enable, to spice things), per default the amount is set to 100 but it's also configurable :
When a company reach 100 points : BaseMoney is taken from all other companies and add to its account : So with 5 companies playing : 4 companies loose 10000, 1 company gets 40000.
This one can be a serious threat for new company sure, but it could be balance by enabling the other one or disabling it.
There also some rewards that can only be get when you plays poorly or do wrong things... This should help new companies a bit to not stay at 0 points.

Disable both rewards to play a "classic" openttd game while still getting awards/medals.
This gamescript is license under the GPLv2+ and source are there : http://dev.openttdcoop.org/projects/gs-awards
Attachment:
awards.png [86.72 KiB]
Downloaded 9 times


Last edited by krinn on Sun Dec 15, 2013 7:42 pm, edited 5 times in total.

Top
   
 Post subject: Re: Awards GS
PostPosted: Mon Nov 18, 2013 11:05 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
I think it is an interesting concept that I'm sure will add some spice to causal multiplayer games.

At start I though it was a bit hard to know what to do in order to obtain awards. But I saw that the AI got some rewards just by playing, so I just started to play too as usual and got some awards.

Regarding the medals, it is a bit hard when all you know is that they are hard to obtain. Eventually people who play competitive with this GS will look up in the source how to obtain the medals (I did that as I was wondering what kind of effort was required to get a medal, but will not post the solution here in case that give a spoiler to someone who like to try it out without this information)

Taking money from the companies with least points and give to the company with most points may for some seem to be a bit silly as that make it harder for new companies than it is already. However, as long as the money taken is not too significant it may bee seen as just some fun fact and I see that you can turn off this if you still want to play with the awards but with no money impact. (says the guy who wrote the API to give/take money ;-) )


krinn wrote:
It's not yet finish, but if you want test, report bug, translate (and fixes spelling), i'll be happy.

You may get more testers, if you tell a bit about what is finished or not? Eg. is it worth the effort to try it out? After testing, I would say yes, but I had no clue when I read this statement.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: Awards GS
PostPosted: Tue Nov 19, 2013 12:36 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
I'll update the first post with a more details, here are the full rules for rewards:

Both rewards use a base money amount for money operation, that "BaseMoney" is x * LoanInterval (where x is configurable in the script option) : per default 1

* 1 reward is a periodic one (disable per default): companies cannot loose money with this one, it have two usage :
- Gives a bit of money to boost companies that lead the rank table
- Balance the other reward bad effect (as this one takes money)
It's pretty simple :
The company rank 1st gets 100% of BaseMoney
The company rank 2nd gets the percent of points from the 1st company of BaseMoney : so if 1st company have 130 points, 2nd company have 90 points and BaseMoney is 10000 : 1st company takes 10000, 2nd company takes 90 / 130 * 10000 = 6923.... And another one with 40 points : 40 / 130 * 10000 = 3000

* And the 2nd reward is gave to any companies that reach an amount of points (this one is per default enable, to spice things), per default the amount is set to 100 but it's also configurable :
When a company reach 100 points : BaseMoney is taken from all other companies and add to its account : So with 5 companies playing : 4 companies loose 10000, 1 company gets 40000.
This one can be a serious threat for new company sure, but it could be balance by enabling the other one or disabling it.
There also some rewards that can only be get when you plays poorly or do wrong things... This should help new companies a bit to not stay at 0 points.


Many rewards included clues on how to get them in their title, and nearly all gave the conditions to get them when someone reveal them.
SPOILER ALERT : As example The "We are the Borg" is grant to a company that buy all shares of another one...

Medals & rewards even depends on the current game configuration : the current map type and the newGRFs in use. So some cannot be earn on a "stock openttd". And yes you cannot earn all rewards available in one game.


Top
   
 Post subject: Re: Awards GS
PostPosted: Sat Feb 08, 2014 10:36 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
enhlish.txt wrote:
<space>:<space>

In lots of places you have a space before the colon in a sentence. This is not common in English to do so. Is there any reason why you have this extra space?

english.txt wrote:
STR_INFO_39 : The first owning the three awards.

Should "the" really be there. Is this award really an award for having 3 specific awards or is it awarded to someone having 3 random awards? In the later case, there should not be any "the" there. In the former case the sentence is incomplete as it doesn't specify which 3 specific awards that it indicate that you need to achieve.


Edit: Making an initial translation by editing english.txt may be useful, but for easier maintaining of translations, especially those languages that you do not know yourself it would be good if you could use Eints (translator.openttdcoop.org). To do so it is a good idea to first move those setting strings to some .nut definition file rather than having them in the translation system. If you use eints and change a string in english.txt, then that string will be marked as needing verification/update for all translations. After someone looking through the string he/she can save the string again and it will be marked as up to date.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: Awards GS
PostPosted: Sun Feb 09, 2014 12:37 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
Zuu wrote:
enhlish.txt wrote:
<space>:<space>

In lots of places you have a space before the colon in a sentence. This is not common in English to do so. Is there any reason why you have this extra space?

No, that's a mistake or bad habit, french use <word space : space word> version, something i should fix.

english.txt wrote:
STR_INFO_39 : The first owning the three awards.
Should "the" really be there. Is this award really an award for having 3 specific awards or is it awarded to someone having 3 random awards?

Really for having 3 specific awards
Quote:
In the former case the sentence is incomplete as it doesn't specify which 3 specific awards that it indicate that you need to achieve.

It will shown the needed 3 awards only when that award is earn by someone, this is normal as this award is rank medal.
But really you don't get a clue of what the three could be by its title, that's a real classic movie...

Quote:
Edit: Making an initial translation by editing english.txt may be useful, but for easier maintaining of translations, especially those languages that you do not know yourself it would be good if you could use Eints (translator.openttdcoop.org). To do so it is a good idea to first move those setting strings to some .nut definition file rather than having them in the translation system. If you use eints and change a string in english.txt, then that string will be marked as needing verification/update for all translations. After someone looking through the string he/she can save the string again and it will be marked as up to date.

I have no idea how this works, even i have use it to update some files for you :)
But in my case, i'm not sure it would be really of help, i don't plant to change awards, i might add new ones, but won't change older ones, so language files should remain the same except for the additionnal awards. I mean a fix in english.txt (like the : case) shouldn't propagate need for fixes in other languages.


Top
   
 Post subject: Re: Awards GS
PostPosted: Fri Mar 21, 2014 3:57 pm 
Offline
Engineer
Engineer

Joined: Tue Oct 12, 2010 1:55 pm
Posts: 94
Hi Krinn,

i recently had a multiplayer game using r26156 und your awards gs. Problem is, it didn't seem to start.
There are no ranks or medals assigned to any company after now 40 game years. There's also only one company (owner of that company being the server) in the rank list (with 0 points).

P.S. i really like the idea of your script and in single player (with AIs) it's working well
P.P.S. PM me, if you need any newgrfs to load attached save game


Attachments:
Malaysian Airlines, 27. Dez 1944.sav [485.83 KiB]
Downloaded 101 times
Top
   
 Post subject: Re: Awards GS
PostPosted: Sat Mar 22, 2014 5:51 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
lugo:
I will look for that, but i'm afraid i would need to setup a server for that, and might need some answers from the bad guys at #openttd as there's no difference from the API pov with a server or a standalone game.
I suppose (and hope to reproduce the bug without it) i won't need that savegame, FFS ! How many newGRF are there ! openttd content download help me for like 20 of them, but i'm still missing like 8-12 grfs!


Top
   
 Post subject: Re: Awards GS
PostPosted: Sat Mar 22, 2014 6:45 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
In dedicated multiplayer there is no company zero created at first tick after worldgen, instead companies are created when people join. There is an API to check if the game is running on a multiplayer server. I'm unsure if you can tell a dedicated server from a GUI-server but in general if you write code that work on dedicated servers it will work on both GUI-servers and single player.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: Awards GS
PostPosted: Sat Mar 22, 2014 1:55 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
Zuu wrote:
In dedicated multiplayer there is no company zero created at first tick after worldgen

That's good hint , i will look at that, it might be possible i assume one exists.


Top
   
 Post subject: Re: Awards GS
PostPosted: Sat Mar 22, 2014 4:42 pm 
Offline
Engineer
Engineer

Joined: Tue Oct 12, 2010 1:55 pm
Posts: 94
I don't know if that's relevant, but iirc i created the map in single player, saved and copied it over to the server (which is not dedicated) and loaded it there as a multiplayer game.

P.S. PM with GRFs should be in your inbox, krinn


Top
   
 Post subject: Re: Awards GS
PostPosted: Sun Mar 23, 2014 2:02 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
lugo: It is relevant how you saved that game. Was it saved on the server or from a client? When you join a multiplayer game as client and save it, the save game will NOT contain Game Script data even including information about what script is running is only present on the server. Thus if you ever made a save from a client and then uploaded here or transfered to your server to resume the game, information about what GS to use will be lost.

If you made a single player save game and then loaded that in the server, that should in general work, unless there is a limitation in the specific GS that you use.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: Awards GS
PostPosted: Sun Mar 23, 2014 2:27 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
Ok after enabling newgrf devtools to bypass the missing newgrf (thanks planetmaker). I finally could load the game, and Zuu is right, there's no gamescript in that savegame.


Top
   
 Post subject: Re: Awards GS
PostPosted: Sun Mar 23, 2014 4:35 pm 
Offline
Engineer
Engineer

Joined: Tue Oct 12, 2010 1:55 pm
Posts: 94
Quote:
If you made a single player save game and then loaded that in the server, that should in general work, unless there is a limitation in the specific GS that you use.


That's what i initially did, but the save i uploaded here is from a client.
Note: the server didn't have the GS downloaded.
So the question is: should the server download the GS if it's loading a save game with that GS?
I attached the save game the server was started with.


Attachments:
Unbenannt, 1. Jan 1914.sav [374.6 KiB]
Downloaded 88 times
Top
   
 Post subject: Re: Awards GS
PostPosted: Sun Mar 23, 2014 5:40 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
lugo wrote:
So the question is: should the server download the GS if it's loading a save game with that GS?


Yes, in my view (and I know other devs agree on this too) it _should_ inform you about missing GS and offer you to download that just as with NewGRFs. However, currently it will silently just not load any missing Game Script.

There are some technical difficulties in making it work well. That includes the problem that OpenTTD currently saves the script name and not its uniqueid (short name) in the save game file.

I've started a patch queue to work on this, but so far I've not got very far. If anyone else want to work on this, it is welcome.


Edit: To download a GS on a dedicated server, there is a console command called "content" which allow you to access the content download system. If you use 1.4-beta/rc or trunk, it will be enhanced to allow you to filter the search results.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: Awards GS
PostPosted: Mon Mar 24, 2014 6:18 pm 
Offline
Engineer
Engineer

Joined: Tue Oct 12, 2010 1:55 pm
Posts: 94
Thanks for clarifying Zuu,

so to get back on topic.
Is there a chance you can add your project here: https://translator.openttdcoop.org/?

And by the way i had some pretty good laughs while translating :)
Sadly, while testing it, there were immediatly gone, because debug-window says there might be an error in a lang file.
I'm a little clueless as to what the problem might be. I checked if all {, and ( are closed, they are.

edit: typos


Attachments:
german.txt [11.85 KiB]
Downloaded 66 times
Top
   
 Post subject: Re: Awards GS
PostPosted: Tue Mar 25, 2014 2:45 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
Thank you for the language file lugo.

At first, the filetype should be in linux format if i'm right. Ending with \n only. Windows format add an extra \r
Easy to fix it. (make sure your editor is setup for linux file)
Code:
english.txt: UTF-8 Unicode text, with very long lines
french.txt:  UTF-8 Unicode text, with very long lines
german.new:  UTF-8 Unicode text, with very long lines
german.txt:  UTF-8 Unicode text, with very long lines, with CRLF line terminators


Still there's another error, with invalid UTF char in the file.
Code:
dbg: [script] german:33: FATAL: Unwanted UTF-8 character U+0009 in sequence ' FAHRZEUGPRÄMIE   '

Removing the tab after the word. Fix.

And removing the part from the german.txt state as #No translation need -> upto # Translation need. (see french.txt for example or the new german.txt i will attach here).
If that part is missing in german.txt, openttd will default display the one from english.txt
So you modify STR_LGS_AUTHOR from english.txt, and remove it from german.txt. If it was there, openttd would only display it in german, if the part miss in any language, it will use the one from english.txt. So in all language that part display the same text.
This way, even english users will see who has made the german version instead of only german users. This also avoid duplicate what would be common in all languages files.

Here are the updated files, if you want see in real the result :)


Attachments:
english.txt [10.8 KiB]
Downloaded 74 times
german.txt [11.06 KiB]
Downloaded 82 times


Last edited by krinn on Tue Mar 25, 2014 2:55 pm, edited 1 time in total.
Top
   
 Post subject: Re: Awards GS
PostPosted: Tue Mar 25, 2014 2:51 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9062
Location: Sol d
Just a hint: The DevZone's translation service can also handle game scripts. It would take care of these errors mostly automagically.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
 Post subject: Re: Awards GS
PostPosted: Tue Mar 25, 2014 3:03 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
Zuu speak about that too, i use it myself to update Zuu script language file, but i wasn't sure anyone have interest in that (with my script i mean).
I will look into adding that.

edit: Add it thru eints, there : https://translator.openttdcoop.org/project/gs-awards


Top
   
 Post subject: Re: Awards GS
PostPosted: Tue Mar 25, 2014 5:35 pm 
Offline
Engineer
Engineer

Joined: Tue Oct 12, 2010 1:55 pm
Posts: 94
Quote:

Thank you. Much more convinient!
One thing i forgot to mention, when i posted the first translation.
I haven't found the strings for the AI/GS-settings window, i.e. "Display news when a medal or award is won" , in english.txt


Top
   
 Post subject: Re: Awards GS
PostPosted: Tue Mar 25, 2014 11:11 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
lugo wrote:
I haven't found the strings for the AI/GS-settings window, i.e. "Display news when a medal or award is won" , in english.txt


Those strings are not translatable. It would be good if it was, but it is currently not implemented.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 49 posts ]  Go to page 1 2 3 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.