ToyTrax: Coding Questions

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

ToyTrax: Coding Questions

Post by SimYouLater »

The ToyTrax development topic can be found here.

Original Post: "TTD-Scale"
[+] Spoiler
Image

UGH! It's hideous! Can't... look... directly... at it...

Image

Yeah, I'll just be turning on OpenGFX now, thank you very-

Image

Wait.

This is...

Actually really boring.

TTD-Scale: How can it be done?

We can all agree that Toyland was an eyesore. The issue I'm seeing with it seems to be that it's too "busy" and bright, though. You might hate the tracks and roads too, but IMO they are the one thing in Toyland that looks worse in OpenGFX. So here's my idea...

A tracktype that uses the original TTD Toyland rails, and static road graphics from same, unless licensing makes this utterly impossible (in which case I guess I'll have to learn to do good spriting for the first time since the webcomic bubble of the mid-2000's). Which means some questions...

Is it possible to re-use original TTD graphics under any license whatsover, or if not, under no license at all?
If so, what options would be available? Is editing them (such as to make the static roads into an NRT roadtype or create static tram tracks/tramtype) banned, if not use?
If not allowed at all, to what degree am I legally allowed to use the original TTD graphics as inspiration?


Is there any single tracktype NewGRFs licensed under GPL v2 and coded in NML which I can use as a starting point?
Attachments
Unnamed, 2017-01-01.png
(146.34 KiB) Not downloaded yet
Trenfingwell Transport, 2017-01-05.png
(115.7 KiB) Not downloaded yet
Trenfingwell Transport, 2017-01-05#1.png
(178.91 KiB) Not downloaded yet
Last edited by SimYouLater on 28 Apr 2018 21:47, edited 4 times in total.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: "TTD-Scale": License Question

Post by kamnet »

As to the legalities, unless somebody is willing to speak as a lawyer (they're not), nobody can say with any certainty what you're legally allowed to do with somebody else's copyrighted works.

But, what you could try, and I'm won't guarantee that this will work... what you could try is to write an NFO or NML file that references the original TTD sprites, and then distribute that file, and require that players a) either own or legally obtain a copy of the TTD sprites, and b) compile the NewGRF on their own, with the understanding that they are not allowed to distribute that NewGRF.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: "TTD-Scale": License Question

Post by Alberth »

SimYouLater wrote:Is it possible to re-use original TTD graphics under any license whatsover, or if not, under no license at all?
If you have the rights of some work, you can relicense it to anything you want.

Since you're not the owner of OpenTTD sprites (seems likely at least), you cannot change its license, or distribute it without permission of the owner (unless you can provide proof that he has given such rights away, but given you are asking, you likely don't have that either).

If you want to go ahead anyway, and use the original sprites, you should probably ask a real lawyer instead of some $random noob people at the Internet.


Copying the graphics doesn't make it your work. "Inspired" well yeah, but as a precaution I'd use a free set of tracks as source of inspiration instead. Much less dangerous. Ideally you'd never have seen the tracks, but that's a bit difficult :)
I think you should aim for an improved set rather than a copy, since they already exist, and it's pointless to make it again.

As for toyland being an eyesore, nah, you get used to it, really :)
I played hours and hours in that climate, it has awesome industries!

Alternatively, use OpenGFX+landscape (if I remember correctly), it provides temperate green in toyland climate, so you can play your favourite industries in lucious green grass.
Being a retired OpenTTD developer does not mean I know what I am doing.
Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: "TTD-Scale": License Question

Post by Supercheese »

But.... I like Toyland! :|
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: "TTD-Scale": License Question

Post by SimYouLater »

Supercheese wrote:But.... I like Toyland! :|
I do like the infrastructure from it. Useless in most games, but it would be a fun option to have a "TTD-Scale" tracktype and roads. Unfortunately any other Toyland infrastructure except the hideous industries and the cute but unsuitable (IMO) buildings would have to be programmed in NFO IIRC.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: "TTD-Scale": Questions

Post by SimYouLater »

Okay, I think I know how I'm going to do this, but I just have one problem. The only NML codebases that I can find for tracktypes are large and composed of .pnml files which are useless to my level of experience, or licensed in GPL v3... and the only GPL v2 tracktype newgrfs I can find are either NFO or, you guessed it, composed of a s***ton of .pnml files.

Help?
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: "TTD-Scale": Questions

Post by Gwyd »

Sure. What do you need?
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: "TTD-Scale": Questions

Post by SimYouLater »

Gwyd wrote:Sure. What do you need?
Source code in a single NML file along with with the graphics, containing only a single tracktype, licensed in GPL v2. Thanks beforehand.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: "TTD-Scale": Questions

Post by Gwyd »

Would it be possible to link me the large and complex sets of .pnmls, then I can work from there.
luxtram
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 10 May 2016 19:09

Re: "TTD-Scale": Questions

Post by luxtram »

SimYouLater wrote:the only GPL v2 tracktype newgrfs I can find are either NFO or, you guessed it, composed of a s***ton of .pnml files.
Source in pnml is the same as is nml with the difference that you first have to combine a single nml before feeding it to the nmlc (nml compiler). This is usually done by the C (language) preprocessor (i.e. the program that does the same for the C files).

Usually there is a so called main pnml file that then contains multiple #include statements what inserts the individual pnml files. There can be also #define statements that can be used to define constants (i.e. values that have name) or macros (i.e. small code snippets that have name). These can be then used instead of values/code blocks (makes code more understandable and easier to manage in the long run).

So pnml or nml is pretty much the same. There is very small difference in the end.

Only thing you nee is a C compiler (precompiler comes with it).

There is probably included also a .bat file (for Windows) or .sh file (for Linux or OSX, or other Unix derivatives). This contains shell (command line) commands to orchestrate the whole compiling process. So which compiler you need to install mostly depends on this - check if it uses gcc (GNU C Compiler) or vc (Visual studio C compiler, community edition is more than fine for this).

You can also post the link to the source code so I could investigate it.
California City Sets viewtopic.php?t=76786
1000 building set viewtopic.php?t=75250
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: "TTD-Scale": Questions

Post by SimYouLater »

luxtram wrote:
SimYouLater wrote:the only GPL v2 tracktype newgrfs I can find are either NFO or, you guessed it, composed of a s***ton of .pnml files.
Source in pnml is the same as is nml with the difference that you first have to combine a single nml before feeding it to the nmlc (nml compiler). This is usually done by the C (language) preprocessor (i.e. the program that does the same for the C files).

Usually there is a so called main pnml file that then contains multiple #include statements what inserts the individual pnml files. There can be also #define statements that can be used to define constants (i.e. values that have name) or macros (i.e. small code snippets that have name). These can be then used instead of values/code blocks (makes code more understandable and easier to manage in the long run).

So pnml or nml is pretty much the same. There is very small difference in the end.

Only thing you nee is a C compiler (precompiler comes with it).

There is probably included also a .bat file (for Windows) or .sh file (for Linux or OSX, or other Unix derivatives). This contains shell (command line) commands to orchestrate the whole compiling process. So which compiler you need to install mostly depends on this - check if it uses gcc (GNU C Compiler) or vc (Visual studio C compiler, community edition is more than fine for this).

You can also post the link to the source code so I could investigate it.
It appears it's worse than I thought. Going through the list again to find a GPL v2 single tracktype in .pnmls turned up nothing. The only GPL v2 single tracktype out there is FS-Maglev which is programmed in NFO. I basically need a small and simple example to work with in GPL v2, which doesn't seem to exist.

EDIT: Also, I noticed that the North American Track Set is licensed as GPL v2, yet the "website" button takes me to Nekomaster's userpage. Nothing in the readme indicates where the source code is.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
Kruemelchen
Transport Coordinator
Transport Coordinator
Posts: 287
Joined: 18 Feb 2017 17:47

Re: "TTD-Scale": Questions

Post by Kruemelchen »

Why not have a look at NuTracks? I always thought it's clean and easy to understand NML code.

i.e. the main file
http://dev.openttdcoop.org/projects/nut ... racks.pnml

of course you'd need to cut out all the unnecessary parts...
but you can easily take every #included file and cut out everything that defines anything different than what is used for the RAIL tracktype

PS: I guess for single tracktype NewGRFs you won't find pnml examples, as it doesn't make any sense to you pnml if you only have 1 tracktype :)

PPS: If I remember correctly there has been some ruckus with NuTracks and copyright some time ago? But I don't think this had anything to do with the source code, as it is clearly stated as GPLv2 (even though the author puts a copyright claim on it too which doesn't make any sense if you use GPL but that's just my 2 cents...)
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: "TTD-Scale": Questions

Post by oberhümer »

Kruemelchen wrote: the author puts a copyright claim on it too which doesn't make any sense if you use GPL
On the contrary, it certainly does, because copyright is what allows me to impose license terms in the first place. Copyright statements are still not really necessary, but nice to have.
The copyright issues with NuTracks concerned modified versions that included non-freely licensed track graphics.

As for the NuTracks code, I agree it might be a bit complex for a beginner. SimYouLater, the NML rail/track types page contains a simpler example, if you haven't checked it out yet. Not complete GRF code though, that would be a nice addition.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: "TTD-Scale": Questions

Post by SimYouLater »

oberhümer wrote:
Kruemelchen wrote: the author puts a copyright claim on it too which doesn't make any sense if you use GPL
On the contrary, it certainly does, because copyright is what allows me to impose license terms in the first place. Copyright statements are still not really necessary, but nice to have.
The copyright issues with NuTracks concerned modified versions that included non-freely licensed track graphics.

As for the NuTracks code, I agree it might be a bit complex for a beginner. SimYouLater, the NML rail/track types page contains a simpler example, if you haven't checked it out yet. Not complete GRF code though, that would be a nice addition.
This would definitely help. I'll see if I can't release TTD-Scale and FicTown+ Names before going into lurker mode for the forseeable future.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: ToyTrax: Coding Questions

Post by SimYouLater »

Can someone explain why the ToyTrax and ElecTrax don't allow normal (standard gauge) trains on them?
Attachments
toytrax_railtype.zip
Current source code
(109.32 KiB) Downloaded 77 times
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
User avatar
Quast65
Tycoon
Tycoon
Posts: 2642
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: ToyTrax: Coding Questions

Post by Quast65 »

I am not a trackcoder, so I cant help you personally, but have you checked out Foobars Metro Track Set?
viewtopic.php?f=67&t=49476&hilit=metro+trackset
You can have that either as extra railtype or as replacement for maglev/monorail.
But (via parameter) you can also run "normal" (non)electrified trains on it. Isnt that close to what you want to get?
Its sourcecode may help you (and is GPLv2)...
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: ToyTrax: Coding Questions

Post by SimYouLater »

Here is my latest set of code. Gwyd was unable to help me fix the issue, and I can't figure it out myself.

Basically, no trains will appear on ToyTrax. We don't know why, the code is supposed to be able to allow RAIL and ELRL to be compatible.

We've already determined that TYTX and ELTX labels are not the issue. Changing them to SAAN and SAAE still results in having no trains available to purchase.
Attachments
ToyTrax Source Code.zip
Latest Source Code
(132.52 KiB) Downloaded 94 times
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: ToyTrax: Coding Questions

Post by PikkaBird »

SimYouLater wrote:Basically, no trains will appear on ToyTrax. We don't know why, the code is supposed to be able to allow RAIL and ELRL to be compatible.
It's been a while since I coded a track set, but I think these properties are not reciprocal; that is, if you want to allow RAIL and ELRL vehicles to use ELTX, you need to modify RAIL and ELRL.
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: ToyTrax: Coding Questions

Post by SimYouLater »

PikkaBird wrote:
SimYouLater wrote:Basically, no trains will appear on ToyTrax. We don't know why, the code is supposed to be able to allow RAIL and ELRL to be compatible.
It's been a while since I coded a track set, but I think these properties are not reciprocal; that is, if you want to allow RAIL and ELRL vehicles to use ELTX, you need to modify RAIL and ELRL.
Ah. So I would need to include RAIL and ELRL sections in the nml?
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
User avatar
CMircea
Chairman
Chairman
Posts: 887
Joined: 29 Dec 2006 14:05

Re: ToyTrax: Coding Questions

Post by CMircea »

Try definiting RAIL & ERLR, add your custom track type as compatible to RAIL & ELRL and see if that does the trick.
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 4 guests