Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Mar 21, 2019 8:41 am

All times are UTC




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sat Mar 09, 2019 5:23 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Dec 23, 2004 6:31 pm
Posts: 2096
Location: Wisconsin, USA
When I was a kid one of the more impressive aspect of A-Train (Imported through Maxis in the US) was the cycle between day and night, with lights in buildings and train windows, and dawn and dusk transitions. Having a Macintosh LCII back then, this was quite impressive.

There has been for some time a night GRF set for TTD and now OpenTTD. But the game stays in night time, which is not really much better for long term play.

OpenTTD's day length patch gives me an idea, a button to toggle between "Regular time scale" and "Realistic time scale". To elaborate, the manual to Railroad Tycoon explained that the months it took for trains to travel between towns only a couple hundred miles away (Much as they do in TT onward) is balanced by the exaggerated revenue (Also in TT and newer) and the effect is one animated train doing the work of many unseen identical trains. One three car passenger train taking a year to travel between New York and Chicago, is a visual representation of hundreds of trains, and costs and revenues are scaled to reflect this.

This to me has always been an acceptable way to balance game play with realism. But it does not lend itself well to micromanaging and finely tuning schedules. And there's no good way to emulate seasons or days.

The idea I have had is a button that, when pressed, changes the date at the bottom of the screen to hours and perhaps minutes (Or perhaps 5-10 minute blocks, I.e. 12:00 then 12:05, then 12:10 and so on) and adjusts other time related things as well, such as vehicle timetables, and also adjusts the vehicle operating expenses and revenues. A locomotive that costs $10,000 per year to run would still cost that much in one year, just the amount spent per game "tick" might differ if one "Tick" represented one game day, or 10 minutes out of a day.

The effect would also be that in normal TT game time day and night transitions and changes would be disabled, the game would stay in daytime, or nighttime if the user preferred (A preference setting could handle this) but when running in "Scale" time, day night changes and transitions would be possible.


I do not know enough about GRFs to know if they could automatically handle day night changes, A-Train did so by a simple pallate swap, and I do not know if a solution like that would work, but I do think it would be possible for GRF artists to have action colors (Like the dark blue in original TT graphics) that would react to pallate swaps. Perhaps a line of code in a GRF like 'nightchangeenabledgrf' that if it is present, tells OpenTTD that day night transitions will work, and if some GRF sets do not have that, a message advising the player that some sets are not known to be compatible with night transitions and may look odd. Some abandoned GRF sets, given the right license, could probably be picked up and given minor changes to windows and other parts to make them compatible, though I am not sure if it really would be that simple or not. Pallate swaps may not even be possible for all I know.


A button on the toolbar would serve as the control. This way, if I wanted to closely watch a new train or bus service run in a more realistic timetabled setting I could, but then toggle back to original speeds as a sort of "Fast forward" for a while.

I don't know how feasible any of this really is, but I would love to see this implemented, especially with day/night transitions.

_________________
Without Trains America Stops

Image
Image


Top
   
PostPosted: Sat Mar 09, 2019 8:09 am 
Offline
Traffic Manager
Traffic Manager

Joined: Fri Apr 14, 2017 3:51 pm
Posts: 145
Location: Czech Republic
I think some things you write about as a novelty are already included in the OpenTTD JGRPP. But I can not judge how your version differs ...

_________________
Owner and admin of servers:
Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
My newGRFs: ---


Top
   
PostPosted: Mon Mar 11, 2019 7:04 am 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Mon Dec 19, 2011 7:54 am
Posts: 443
Location: Washington State, USA
It's funny, not too long ago while revisiting NightGFX I came up with some ideas myself about how a Day/Night cycle could be done "the right way" in OpenTTD, but never got around to posting it. My thoughts on how it would work are a little different (mostly no daylength stuff, since that seems like a good way to get shot down quickly ;)), but the end result of a day/night cycle would be mostly the same. Most of my concept revolves around how to make this work with NewGRFs, which will be a central issue with something like this. But I think, at least conceptually, my 'plan' offers a good solution. Bear in mind that I lack the skills to really understand the technical implications of what I'm proposing, but I've tried to consider the real issues and offer something at least somewhat realistic to implement (my first point below is no doubt the biggest hurdle, if even possible, and unfortunately it's also the key to the whole thing :? )

Anyway, here's what I came up with:

My Proposal for Doing "Night Mode" the Right Way™

From a conceptual standpoint, NightGFX is not a good implementation of doing "night mode" for several reasons. Even though it's possible to make NewGRFs that work with NightGFX, the way in which it's done is cumbersome and laborious, for authors and players alike. It requires complete manual conversion for all sprites, and only works for a specific combination of this one baseset and whatever NewGRFs may decide to support it, and requires saving and exiting the game to manually make the switch.

A better solution would be integrating a day/night cycle directly into OpenTTD. Easier said than done, this needs a few key pieces to be done right. Most importantly:

OpenTTD itself needs to supply the "night-time" effect.

Somehow the game must be able to apply a sort of 'darkness filter' over everything in the game world. This is the only way to ensure 'compatibility' with the wide variety of graphics already available, especially older ones which won't get updated (more on that below). There is simply no way to make OpenTTD include a night-mode without somehow making it work for everything out-of-the-box. Relying on (and effectively forcing) NewGRF authors to update their sets to support a feature like this simply won't work; the effect needs to be handled automatically.

That being said, there is more to a night mode than just making everything dark...

What to do about lights?

If OpenTTD handles the darkness, then the only thing set authors have to handle are the (optional) lighting effects. My thought on implementing this was something like adding a new flag to the alternative_sprites block (talking NML here, obviously) so that the lighting effects could be simply coded as a separate layer to be applied when the game calls for it (some time during the day/night transition). This also makes it easy (at least in theory) to maintain parallel support for 32bpp/EZ since those are also applied as flags in the same way, so just pick and choose which to activate to supply the graphics for each situation. (obviously I'm completely ignorant on how this would work on the backend, but, you get the idea!)

This would mean relatively little additional work necessary for NewGRF/Base Set authors to add some cool effects for night time if they wanted to, and easier for authors = more acceptance, right? ;) Of course there's room for different ideas here; this was just the one that made sense to me :)

OK great, but what if I play with the original TTD graphics?

Well that's the great thing about doing the darkness stuff within OpenTTD itself; all graphics and basesets are 'supported', it just needs some additional love to add the lights. In the case of the original TTD graphics, these light sprites would need to be added to the openttd.grf shipped with the game (or possibly a new one?) to maintain support. Yes, this takes some work initially, but it's a one time investment, and people like me can even help with that :)

How does this work for the end user?

With the technical details worked out as proposed above, the end user should have a much better experience where the day/night cycle just 'works', even when NewGRFs don't explicitly support it. Obviously older/non-conforming sets won't have any lighting effects, but at least they will still fit in with everything else by being darkened, which is probably the most acceptable result possible. At least it is vastly preferable to any altenatives I could think up :)

As far as how it would work, I imagine something relatively simple wherein the actual day/night cycle would be an option activated (by default?) via a new setting. Maybe a three-way setting between 'Day Only', 'Night Only', and 'Day/Night Cycle'. The day/night cycle time would likely end up being something arbitrary that feels right, but perhaps an additional setting to adjust the length of the day/night cycle might be preferable (but this of course starts really opening up the conversation to the aforementioned daylength debate, so....;))

So in review...

In order to do a true, well-implemented day/night cycle, it is necessary that OpenTTD itself handles much of the work to make the transition to night and back, especially when considering the NewGRF situation. It opens up the possibilities of making a smooth day/night transition instead of instant, easier handling of compatibility for older graphics, and perhaps most importantly, reduced effort needed for authors and players alike to make it happen. Also, adding night mode might be a good candidate for making the jump to OpenTTD 2.0, so we can keep the OpenTTD versions matching the release year (I'm only slightly joking here :P)

Obviously reduced effort for end users means more work for anyone developing this, but to do it right is the only way in my opinion. If it can't be done right, just leave 'night mode' to NightGFX and let it be as the experiment that it is now, which is fine :) Also I'm sure I've overlooked and oversimplified some things while putting this together; just throwing some ideas out there. Feel free to comment, add to it, shoot it down in flames, or propose some alternatives. :)

_________________
WSF Ferry Set [WIP] || American Road Replacement Set || NightGFX Base Graphics Set || Wasteland [WIP] || RattRoads (NRT Only) || American Bridge Replacement Set [WIP]


Top
   
PostPosted: Thu Mar 14, 2019 11:09 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Dec 23, 2004 6:31 pm
Posts: 2096
Location: Wisconsin, USA
Andrew350,

My idea about the day length was mostly for people like me who like to build something, then watch it, then build some more, watch some more, and so on.

I was playing SimCity 4 last night, and the day/night cycle just felt "right" even though it took days and months to make a complete cycle. It works there, and I think it could work in OpenTTD the same way.

I know nothing about NML, but using NML flags, is that like a certain color that does something in game? Like if headlights used a specific pixel color, they would change color at night?

_________________
Without Trains America Stops

Image
Image


Top
   
PostPosted: Fri Mar 15, 2019 5:55 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Mon Apr 17, 2017 4:52 pm
Posts: 666
Location: Western Ile-de-France Region
Railwaymodeler wrote:
Like if headlights used a specific pixel color, they would change color at night?

This could happen, but this would make the palette even more of a minefield of unusable colours than it already is, with company colour, water cycle and fire cycle colours already. Having a designated sprite would work better, I think, especially with backwards compatibility.


Top
   
PostPosted: Sat Mar 16, 2019 2:04 am 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Mon Dec 19, 2011 7:54 am
Posts: 443
Location: Washington State, USA
Railwaymodeler wrote:
I know nothing about NML, but using NML flags, is that like a certain color that does something in game? Like if headlights used a specific pixel color, they would change color at night?

No, I was thinking of using separate sprites which are activated by a special flag in the NewGRF code. So basically the 'headlights' would be their own sprite drawn separately, which would then be applied on top of the vehicle sprite during the day/night transition when the game called for it. But the effect would be the same :)

As Gwyd says, making certain colors 'special' so they work differently at night would be a headache, especially for any graphics which aren't expecting it (i.e. everything in existence :P), so I don't even think that's really an option.

But that reminds me, one thing I forgot to touch on above is the palette action colors (such as the crossing cycle, fire cycle, and flashing yellow) would either have to be somehow excluded from the darkening effect, or otherwise these colors would also need to be (re)applied in the same way as the rest of the lights as a separate layer (which isn't a big deal I guess, but could slightly 'break' some old graphics).

_________________
WSF Ferry Set [WIP] || American Road Replacement Set || NightGFX Base Graphics Set || Wasteland [WIP] || RattRoads (NRT Only) || American Bridge Replacement Set [WIP]


Top
   
PostPosted: Sat Mar 16, 2019 10:15 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7300
the thing is, if you want to do light properly, you need shaders and stuff, because a light would affect the adjacent pixels

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Sat Mar 16, 2019 11:06 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Mon Dec 19, 2011 7:54 am
Posts: 443
Location: Washington State, USA
Well, yeah, but that's probably like a whole game re-write to do that properly. With some clever shading one can at least achieve some level of local light glow with pixel art/rendered graphics, you just can't make things like headlights that shine down the tracks or anything.

Although who knows what amount of work it would take to do the darkening effect like I've proposed; maybe "real lights" aren't a huge step past that by comparison :P

_________________
WSF Ferry Set [WIP] || American Road Replacement Set || NightGFX Base Graphics Set || Wasteland [WIP] || RattRoads (NRT Only) || American Bridge Replacement Set [WIP]


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


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-2019 phpBB Limited

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