NoGo - A Scriptable Game Framework - v1.5

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post by Eddi »

"funny" very quickly turns into "annoying".
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

Eddi wrote:"funny" very quickly turns into "annoying".
Depends on the type of boss you are. If you do good you will receive good ;).
Torrasque
Engineer
Engineer
Posts: 94
Joined: 19 Aug 2004 13:33
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Torrasque »

More information in relation with the HQ. Mainly where it is build and set the price. ( It could be a cool way to claim a city )
Being able to know if a station is docked could be used for fun scenario. ( For exemple, the first to stockpile x crates of good at his HQ, or the man with the station with the highest throughput )

Ability to modify the share system. The actual one is really not fun.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

Torrasque wrote:More information in relation with the HQ. Mainly where it is build and set the price. ( It could be a cool way to claim a city )
Being able to know if a station is docked could be used for fun scenario. ( For exemple, the first to stockpile x crates of good at his HQ, or the man with the station with the highest throughput )

Ability to modify the share system. The actual one is really not fun.
About the HQ: create a message with the offer to expand your HQ at a certain cost or postpone the expansion to a later date (where you hope you have more money). Expansion costs could be dependent on length of owned track rather than company value.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post by TrueBrain »

I read some good suggestions. I will just quickly reply to a few:
Dwight_K._Schrute wrote:It would be great to allow or disallow a SINGLE city/city to grow. Maybe with a checkbox oder something like that in the town gui.
There will not be such an option in the near future. A GS can make some towns grow and others not, but this will not be switchable from the GUI.
XeryusTC wrote:Limit the amount people can terraform. Possibly separate limits for raising and lowering.
Already in trunk (a while ago).
planetmaker wrote:Ability: Merge two company
In case you mean the event, already done. In case you mean the action: I have no real interest in adding this short term (as the normal game mechanics are sufficient in this respect as far as I am concerned atm). One of those things to add later, possibly ;)
Eddi wrote:
planetmaker wrote:Ability: Merge two company
improving on that: buying/selling individual "lines" (all connected tiles with same owner/vehicle type, plus all vehicles)
Same, and that is even further away from me :) Those things are way to advanced for GS, and far outside the scope of NoGo :) (just to make a bit clear how far I want to go for now :))
Torrasque wrote:More information in relation with the HQ. Mainly where it is build and set the price. ( It could be a cool way to claim a city )
(..)
You can already see in a GS where a HQ is built, and with that claim a city.
The only thing necessary for the triumph of evil is for good men to do nothing.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post by TrueBrain »

Today I have been working (and talking) a lot to get a translation system in place. It is getting shape really well. Basically, how it will look (give or take):

Code: Select all

local a = GSText(GSText.STR_TOWN_TEXT);
a.company. = 0;
a.goal. = GSText(GSText.STR_GOAL_GROW);
a.goal.target. = 1000;
GSTown.SetText(2, a);
With strings:

Code: Select all

STR_TOWN_TEXT: This town is claimed by {COMPANY company}.{}Current goal: {STRING1 goal}
STR_GOAL_GROW: Grow this town to a population of {COMMA target}
But this is rather far away. What currently does work:

Code: Select all

local t1 = GSText(GSText.STR_GOAL_GROW);
local t2 = GSText(GSText.STR_TOWN_TEXT).AddParam(0).AddParam(t1);
t1["param_1"] = 1000;
t1.param_1 = 1000;
t1.SetParam(1, 1000);
t1[0] = 1000
t1.0 = 1000

GSTown.SetText(2, t2);
You see all possible current syntaxes here. I am not really sure what will be the one included in the end .. most likely only a few will make it. But you get the idea. You can recycle the objects all you want, not until SetText are they all resolved. There are a few pitfalls, but nothing that worries me greatly at this stage.

All the work done today is only on the Squirrel side, to make that a bit solid. The OpenTTD side is rather ... hacked in, and still needs a lot of work is needed before it is finished. But at least there is a start, a proof-of-concept.


You might wonder why this is needed. Well, for AIs it did fine to have:

Code: Select all

AISign.BuildSign("My English Text");
Although this works fine for GS too, our whole game is translatable (in the fullest, even grfs!). So having a script that controls the flow of the game in English, is annoying. You want to see your goals, achievements, quests, town-info, news messages, ... all in your local language too. So .. that means a bit more work to get it all done and fixed.

On a very positive side, it also means strings can be as long as you like. And if this continues to go this well, soon you will be able to trigger news messages via GS, in the local languages :)

Exact details etc will be made available over time. Atm the format will be like english.txt, and every other .txt in the src/lang file, including all the tags that are used there. It will give you full control (in both the english as in the translated string) over the text you want to print, including RTL, different order of parameters, plurals, cases, ... just the normal you are used from us :)


I hope to make more progress over the weekend, and I hope a few other developers will help me out with this OpenTTD part, as it is very difficult (for me) to get my head around it :D
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
MinchinWeb
Traffic Manager
Traffic Manager
Posts: 225
Joined: 01 Feb 2011 12:41
Contact:

Re: NoGo - A Scriptable Game Framework

Post by MinchinWeb »

I love the idea. I'm excited to see what develops.

A couple of ideas/requests:
  • The ability to start an AI. With the combination of NoGo, you could build the network and then hand it over to a 'Manager' AI.
  • Code libraries. I realize that Zuu and I are the only ones who have developed libraries of late, but what libraries were available helped me greatly when I started coding my AI. I would be happy to port my own library over to the framework.
And a couple of questions:
  • You mention that NoGo scripts can be run at map generation time; could they effectively recreate the map?
  • Will NoGo allow you to build 'neutral' infrastructure like roads and stations that can be used by all players? I'm thinking similar to the dock/heliport on the Oil Rigs.
Alberta Town Names - 1500+ real names from 'Acme' to 'Zama City'
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: NoGo - A Scriptable Game Framework

Post by dihedral »

Eddi wrote:something that i remember being sugggested was a way to create/remove money out of thin air (not give to another company), for certain administrative purposes.
i quite like this idea - i consider this a nice solution on multiplayer games in order to display some type of penalty.
Xaroth
Engineer
Engineer
Posts: 103
Joined: 01 May 2006 09:09

Re: NoGo - A Scriptable Game Framework

Post by Xaroth »

dihedral wrote:
Eddi wrote:something that i remember being sugggested was a way to create/remove money out of thin air (not give to another company), for certain administrative purposes.
i quite like this idea - i consider this a nice solution on multiplayer games in order to display some type of penalty.
or better.. quests! :lol:
Lead Manager of OpenDUNE
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

Will it be possible to receive an offer from a virtual person who offers you to help the company by cutting overhead costs/improving reliability/improving profit? This is something I always liked about RRT2/3.
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: NoGo - A Scriptable Game Framework

Post by Expresso »

How about economic collapse: Nobody has money anymore (so, a lot less passengers for a few years), industries closing by the droves (eventually only the largest producers remain)... and ofcourse everybody's favorite, hyperinflation (triple digit inflation). Things slowly return to normal afterwards, but this is a really severe disaster... enoughn to be more then a nuisance.

Or how about a tsunami which removes everything in its path from the map, it should go on until it encounteres a mountain which is higher then the wave.

What about meteor impacts (from small to very large). This tends to turn an area into a crater.

What about the killer virus, spreading using your infrastructure. Decimating the population of entire towns, reducing the production of local industries significantly... and of course nobody wants to use your transport company anymore.

And... erm... this last one would be a nice disaster... elections :) The various parties could have various effects on how the town behaves, reacts to changes in its environment and/or the chance of industries spawning nearby. If each town holds its own elections every N years, things could get interesting.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Michi_cc »

Expresso wrote:What about the killer virus, spreading using your infrastructure. Decimating the population of entire towns, reducing the production of local industries significantly... and of course nobody wants to use your transport company anymore.
This is a thread about a scriptable game/goal framework, not a thread about the best way to frustrate players.

-- Michael Lutz
krinn
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 29 Dec 2010 19:36

Re: NoGo - A Scriptable Game Framework

Post by krinn »

I like the idea, but i see "problems" with the concept

- As you can now build AI that could cheat using the GS, lol let my AI ask GS to build a road for me from point A to point B, but eheh, make sure GS will use anyone but not my AI to build the road. But it will be tied to ave a GScript that accept that. Not a real problem, except for trust source, as i can right now use my ai version 1.0 that have bad code... And when uploading savegame, anyone that own my ai/gs version 1.0 (but clean original code) won't see the cheat...
If GS code have such power to change economy or event make someone goes bankrupt, maybe then gave it even more power, i see interrest of changing some value that might not appears at first useful but can influence gameplay (see lower with vehicle flaw+age)

- Just because of that i see also plenty benefits : you can now make a GS helper :
Put sign A and put Sign B, now GS will take control of your compagny, pathfind, and build the road/rail for you (lazzy dude!)
- You need to upgrade all your trains from two incompatible railtype? No problem, a GS helper can look at your trains, record their group/destination/orders... sell them all, upgrade the rails, and rebuild a default train with wagons and all orders as before (another lazzy option)

I see some speaking about disasters and events/goal :
- A vehicle type design flaw was found, all vehicle model X currently own by all companies get their date + 30 years ( to higher breakdown and to trigger old age event, this is of course not possible as GS cannot change that age value), this way until the company has replace all his current vehicle model fleet that have the flaw is punish.
- Expropriate: A town dislike your HQ/airport/unused/badly served station and will query you to move it away, until you do as the town ask you get your company rating down to the worst (must also control town rating so)
- Love town: A company have its HQ&statue in a town, that town will take control of company just to hit itself the "found new building/repair road/buy exclusive right" (random, but once or two in a year)
- A constructor think his engine isn't well enough represent, it offer another free vehicle if you buy 20 models of the engine (also not possible as you cannot set price of an engine, newgrf authors might complain...)
- The green town : every month all companies represent in the town must build X number of trees...
... I have some more i could share if you like

The real question here is, how much power GS should have or how much will you gave it ?
For now i just see you gave all the power to kill a player/ai with no reward (for now your GS can take away all money from a company making it buys something, but cannot gave some money back).
So even the classic "it's your birthday all players gave you 100$" cannot be made :)
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoGo - A Scriptable Game Framework

Post by Kogut »

krinn wrote:For now i just see you gave all the power to kill a player/ai with no reward
Probably nobody will use "stupid" scenarios.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: NoGo - A Scriptable Game Framework

Post by frosch »

I wondered about the use of libraries. I only found two usecase:
  • General purpose libraries, which provide helper functions. These are actually not GS specific, but would be the same as for AIs.
  • Plugins for interfaces. I.e. imagine some guy writes a web application to display highscores, leagues and stuff including an interface to the admin port. He also provides a GS library which real GS may use to communicate with the common web interface, which is not specific to a single GS.
However, judging by this thread there is a requirement for a similiar feature as "libraries". This thread is full of small things a GS could do. For a lot of them it makes sense to not load them as an exclusive GS. They are rather small gadgets which can just be added to some other GS controlling the big picture, but without really influencing it.
Examples are:
  • Small quests with mini goals.
  • Events/Disasters/Jokes.
  • Controlling prices/inflation over time.
  • Cheats/Helpers.
All this stuff does not conflict with each other, nor does it conflict with some GS doing something big, like controlling town growth, etc...

Since it is unlikely that users will be allowed to pick multiple GS for a game (due to the obvious conflicts), I would assume that once these small things turn up, there will soonish appear "patchpacks". They would combine multiple GS and add an appropiate settings GUI to enable/disable the individual parts, while checking for stuff that works together.

Now there are two ways to achieve this:
  • Just putting the source of all into one tar. (obvious)
  • Including the parts as "libraries" into the "GUI frontend". (This would be different from AIs; here a GS could be both library and stand-alone GS at the same time.)
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
krinn
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 29 Dec 2010 19:36

Re: NoGo - A Scriptable Game Framework

Post by krinn »

Kogut wrote:
krinn wrote:For now i just see you gave all the power to kill a player/ai with no reward
Probably nobody will use "stupid" scenarios.
Having a scenario that is able to kill someone is not always something stupid, some players might like challenge or crazyness.
Just like having a scenario that (if ability is gave) give away freely millions dollars to plant one tree might be seen also as "stupid".

Giving authors ability to control some parameters that a player shouldn't control might appears scary, but you could see gold things at end. Per example, ever dream of a town asking you 10x more than normal price but if you pay that extra money allow you to add another airport near it, how many times you were wishing that ? Or as many people ask everywhere/everytime more accidents/events that influence gameplay, even without even need to add some extra graphics (like my "engine flaw" sample).
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post by Eddi »

i agree with frosch here. the "Game Script" would then be reduced to something like a configuration tool, which picks its pieces from the available libraries (like a random event library, a town government library, a road connection library, ...)

this would keep most of the flexibility of having multiple GS active, but offloads the task of ensuring compatibility to the "GS-configurator" author, while having the task of ensuring functionality lies with the GS-library authors
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post by Eddi »

andythenorth wrote:
Eddi wrote:...offloads the task of ensuring compatibility to the "GS-configurator" author
It would be wise to allow version pinning there...
i would assume that that's the same way AIs work currently.
User avatar
MinchinWeb
Traffic Manager
Traffic Manager
Posts: 225
Joined: 01 Feb 2011 12:41
Contact:

Re: NoGo - A Scriptable Game Framework

Post by MinchinWeb »

Another few suggestions:
  • The ability to draw on the map. Either as a line, or to shade an area, to show things like "political" boundaries. I don't know whether this would require new lands sprites, just overlay sprites, or if you could just 'draw a line.'
  • The ability to refuse player actions. For example, to keep player from building airports or roads or certain vehicles.
  • The ability to restrict player actions, but only for certain areas of the map. This could be used to require a player's first station in a town to be something other than an airport, to keep a player from T-ing in to "public" roads, or to disallow rail/road level crossings.
  • The ability to give/take money from a player. This has huge potential to be misused, but opens up lots of possibilities: things like (road) tolls, or taxes, or prizes...
  • The ability for AI's to know what GS is running. If GS's are changing the "rules" of OpenTTD, there needs to be a way for AI's to determine the new rules. A good stopgap to truly understanding the "rules" would be to have an AI identity the GS running, and then react accordingly.
  • The ability for a GS to know what NewGRF's are loaded. This would allow for GS to make use of "prize" buildings or vehicles, made available via the NewGRF. This might be a way to provide the "political bountry" sprites I mentioned above.
Alberta Town Names - 1500+ real names from 'Acme' to 'Zama City'
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 11 guests