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

Valentijn
Engineer
Engineer
Posts: 118
Joined: 07 Nov 2007 10:04

Re: NoGo - A Scriptable Game Framework

Post by Valentijn »

TrueBrain wrote:
Valentijn wrote:I think its a very cool feature, keep up the goodwork.

If you want consistency in the naming, you could thank about using NG.

Just like AI.
I totally fail to see the relation between NG and AI :P We have NoGo and NoAI framework ... NG and NA I can see ... ;)
Oops. You're right of course. I've never used NoAI. Sorry. I'll shut up now haha.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post by TrueBrain »

Valentijn wrote:
TrueBrain wrote:
Valentijn wrote:I think its a very cool feature, keep up the goodwork.

If you want consistency in the naming, you could thank about using NG.

Just like AI.
I totally fail to see the relation between NG and AI :P We have NoGo and NoAI framework ... NG and NA I can see ... ;)
Oops. You're right of course. I've never used NoAI. Sorry. I'll shut up now haha.
Hehe :D Was just wondering, maybe I had missed something obvious ;)
The only thing necessary for the triumph of evil is for good men to do nothing.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post by Eddi »

maybe should be "gamescript" directory. should avoid any confusion...
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: NoGo - A Scriptable Game Framework

Post by Zuu »

New version of my unnamed game script that relate town demand to the size of neighbouring towns. It has been updated to the new API names. In addition it demonstrates how SuperLib can be used in a GameScript (by combining Helper.SetSign and Tile.GetRandomTile). The bundled SuperLib edition certainly contains OpenTTD API calls that are not yet supported and may even crash OpenTTD. (the crash due to calling GSController.GetSetting has been "fixed" by substituting all those calls by a zero)

Mind that if you want to inline a library in a GameScript, I believe that the GameScript need to use the same license as the library.
Attachments
test.zip
License: GPL2
(25.74 KiB) Downloaded 94 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

Zuu wrote:New version of my unnamed game script that relate town demand to the size of neighbouring towns. It has been updated to the new API names. In addition it demonstrates how SuperLib can be used in a GameScript (by combining Helper.SetSign and Tile.GetRandomTile). The bundled SuperLib edition certainly contains OpenTTD API calls that are not yet supported and may even crash OpenTTD. (the crash due to calling GSController.GetSetting has been "fixed" by substituting all those calls by a zero)

Mind that if you want to inline a library in a GameScript, I believe that the GameScript need to use the same license as the library.
How far off is that from processing industries' production depending on size of nearby cities?
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post by Eddi »

Industry production is heavily governed by NewGRFs already, it'll become very messy if scripts interfere with that.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

Eddi wrote:Industry production is heavily governed by NewGRFs already, it'll become very messy if scripts interfere with that.
It's not that you would require both approaches at the same time though :). If you can have approach as a gameplay variable you don't need it by NewGRF's.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: NoGo - A Scriptable Game Framework

Post by planetmaker »

Hyronymus wrote:
Eddi wrote:Industry production is heavily governed by NewGRFs already, it'll become very messy if scripts interfere with that.
It's not that you would require both approaches at the same time though :). If you can have approach as a gameplay variable you don't need it by NewGRF's.
It's not about 'require'. But adding it to goal scripts won't remove it from NewGRFs nor is removing that knowledge from NewGRFs a desirable thing as it'd break all existing industry NewGRFs. Thus the question is what to do in the case of conflicting input from game script and industry (like one saying "close down" and the other saying "produce at max. output" - a conflict which hardly can be resolved. Thus manipulating individual industries is at least tricky and most certainly will lead to questions of the "why is my newgrf broken" type.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoGo - A Scriptable Game Framework

Post by Kogut »

planetmaker wrote:
Hyronymus wrote:
Eddi wrote:Industry production is heavily governed by NewGRFs already, it'll become very messy if scripts interfere with that.
It's not that you would require both approaches at the same time though :). If you can have approach as a gameplay variable you don't need it by NewGRF's.
It's not about 'require'. But adding it to goal scripts won't remove it from NewGRFs nor is removing that knowledge from NewGRFs a desirable thing as it'd break all existing industry NewGRFs. Thus the question is what to do in the case of conflicting input from game script and industry (like one saying "close down" and the other saying "produce at max. output" - a conflict which hardly can be resolved. Thus manipulating individual industries is at least tricky and most certainly will lead to questions of the "why is my newgrf broken" type.
Maybe it should be routed through "change production cheat"?
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: NoGo - A Scriptable Game Framework

Post by Alberth »

So to play any game with a script controlling the industries, you have to cheat?
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: NoGo - A Scriptable Game Framework

Post by dihedral »

Why tamper with the amount of cargo an industry produces - i'd rather want to influence how much of that produced cargo goes to a certain player
that way the newgrf has no issue, as it still controlls its cargo as it should, and the script can still influence the game play
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

Well, I was merely thinking out loud and the discussion is going a bit off topic now towards my thought :oops: . But to me it would make sense if grf's only fix graphics and not gameplay.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: NoGo - A Scriptable Game Framework

Post by TrueBrain »

It is an ongoing 'battle'. Atm newgrf has a lot of power, and people of course don't want to remove that power, but some of that power is very much misplaced (but by the lack of other methods, logic that is was put in place). So it is a balance act.

I think a good start would be if GameScripts can *hint* towards increase or decrease of production, without knowing if the NewGRF reacts on it or not. That way both stay in control, and in time it might converge to a common solution.

And Hyronymus: this is not off topic, not at all. More and more of these discussions have to be held regarding GameScripts, where his influence stops, and the NewGRFs start.

In those regards, just to share, a few things are very clear:

- NewGRFs command instances, the smallest of the game. Vehicles, town-houses, trees, ... NewGRFs tell the speed of a vehicle, what he can pull, what type of rail he needs, ....
- GameScripts command the more global picture, never an instance. You can tell the town to build a house, but you cannot say which house. You can influence the global aspects, like town growth, industry development, rating, ..., but not set the values.

Just to make it clear where we (or at least I) want to put the line between those two. A GameScript will never be called every tick to get some information for a vehicle. NewGRFs should be doing that (both for performance reasons as for clear separation).

Another way to think about that is, a GameScript cannot respond to callbacks (native to how we implemented Squirrel). It is a big while(true){} loop, in which it performs actions. NewGRFs are (almost) purely callback based. This sets those two apart.

That said, if production of an industry should increase or not is exactly in the middle of this line :D
The only thing necessary for the triumph of evil is for good men to do nothing.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: NoGo - A Scriptable Game Framework

Post by Eddi »

i'd draw the line like this: GameScripts can influence where an industry is built (or whether it is built at all), and possibly can force it to close. GameScripts can try to steer the production increase/decrease of industries, but that will ALWAYS be overridden if the NewGRF uses CB29 (possibly push some values towards var10, which the newgrf can use or ignore)
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: NoGo - A Scriptable Game Framework

Post by Kogut »

Alberth wrote:So to play any game with a script controlling the industries, you have to cheat?
No - but script may use prepared "decrease/increase production" code - and it is probably somehow implemented in newgrfs, as in old FIRS it was impossible to use this cheat and in new versions it is possible.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: NoGo - A Scriptable Game Framework

Post by michael blunck »

Hyronymus wrote: But to me it would make sense if grf's only fix graphics and not gameplay.
Like to take a last look on your signature? Adios Dutch Trainset ... :mrgreen:

regards
Michael
Image
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: NoGo - A Scriptable Game Framework

Post by andythenorth »

Kogut wrote:...script may use prepared "decrease/increase production" code - and it is probably somehow implemented in newgrfs, as in old FIRS it was impossible to use this cheat and in new versions it is possible.
This would be the production multiplier.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

michael blunck wrote:
Hyronymus wrote: But to me it would make sense if grf's only fix graphics and not gameplay.
Like to take a last look on your signature? Adios Dutch Trainset ... :mrgreen:

regards
Michael
I don't see how the Dutch Trainset influences the production levels of industries or the town growth ratio. I do see how FIRS influences the first though, i.e.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: NoGo - A Scriptable Game Framework

Post by Alberth »

If one interprets gameplay as everything outside graphics, then your settings of vehicle speed/cost/cargoes are already gameplay. I doubt however that you want to drop those from the NewGRF :p
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: NoGo - A Scriptable Game Framework

Post by Hyronymus »

Alberth wrote:If one interprets gameplay as everything outside graphics, then your settings of vehicle speed/cost/cargoes are already gameplay. I doubt however that you want to drop those from the NewGRF :p
Gameplay to me is how the game is designed to work - independent of which vehicle sets you use.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 20 guests