The International Simutrans Forum

 

Author Topic: More colours lighting at night - definition in dat file  (Read 2715 times)

0 Members and 1 Guest are viewing this topic.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
More colours lighting at night - definition in dat file
« on: November 12, 2013, 09:24:41 PM »
I have idea how to allow more colours lighting without risk of unwanted night lighting of already existing objects ... and probably without large change of code.

Addon colours could be set in dat file of object.

For example, there could be line
Code: [Select]
night_colour[colour1] = colour2

where
colour1 - colour that should light at night
colour2 - colour that would be used as pattern (colour that its night light will be used)

So, really there could be
Code: [Select]
night_colour[76,51,51] = 87,101,111
or
Code: [Select]
night_colour[63,51,51] = 77,77,77

This would give authors of (mostly building) addons colour freedom - for example to create railstation like this (see image below), with dark brown windows lighting at night.



Of course, this station building is not much beautiful - but it is a very interesting for its very large windows of waiting hall (that are dark brown).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9438
  • Languages: De,EN,JP
Re: More colours lighting at night - definition in dat file
« Reply #1 on: November 12, 2013, 09:45:46 PM »
The colors can be only replaced paksetwide (at the moment), as this is shared with all other images. There are, in pricinple, still 240 slot open ...

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5454
  • Languages: EN, NO
Re: More colours lighting at night - definition in dat file
« Reply #2 on: November 12, 2013, 10:08:12 PM »
Aren't those the player color slots?

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: More colours lighting at night - definition in dat file
« Reply #3 on: November 12, 2013, 10:20:50 PM »
The idea might be interesting: 255 special colors per pakset, but the dat file "activating" the desired ones for the given object.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9438
  • Languages: De,EN,JP
Re: More colours lighting at night - definition in dat file
« Reply #4 on: November 12, 2013, 10:33:19 PM »
We have 14 night colors and 16 player colors, but there could be easily space for more (pakset) dependent colros to replace. In principle there are more than 32000 entries left, but in practice less than 256 should be ok. (Just imagine drawing without accidently using any of those 256 colors ... )

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5454
  • Languages: EN, NO
Re: More colours lighting at night - definition in dat file
« Reply #5 on: November 13, 2013, 06:07:13 AM »
The 32000 figure made more sense to me. But only the 14/15 (?) existing lights will be accessible as a special color throughout the game, the rest is only possible for images.

The best way of having any light one wants without affecting other objects is to have a special lights overlay (for each image, not for each object like a front image, so it wouldn't consume image numbers). As Simutrans in any case does preprocessing to generate the correctly lit images for objects, it shouldn't be too hard to get into Simutrans. Getting it into Makeobj in a user friendly might be more of a challenge. With a third overlay, one could also free up the colors currently mapped to player colors. Anti-aliasing would also be possible for player colors, but not for the others, so may be more confusing than useful.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: More colours lighting at night - definition in dat file
« Reply #6 on: November 13, 2013, 07:24:48 AM »
We have 14 night colors and 16 player colors
2*8 player colours, but only 10 night colours - but my sheet of special colours may be very old

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9438
  • Languages: De,EN,JP
Re: More colours lighting at night - definition in dat file
« Reply #7 on: November 13, 2013, 09:52:43 AM »
Yes but more night colors are not a problem from the code. (Just the darkening will take up more time with more indices).

About the interface: An easy way out would be one special color which can be redefined by any object. That would keep the bloat of the images low and allow for enough flexibility without adding lots of special colors to shades and alike. And since we have a 65536 image limit, this shoudl be fine with almost any color.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: More colours lighting at night - definition in dat file
« Reply #8 on: November 13, 2013, 10:18:05 AM »
Anti-aliasing would also be possible for player colors, but not for the others, so may be more confusing than useful.
Ters, your fear is comprehensible, but on other hand, how much anti-aliasing is used?

In comic paksets it is not used, if I am not wrong - or very rarely. And for other paksets, if you create windows, they have a little different colour than their surroundings (walls and other decorations) - and also, you have control over colour of windows and doors.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2839
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: More colours lighting at night - definition in dat file
« Reply #9 on: November 14, 2013, 04:53:34 PM »
In comic paksets it is not used, if I am not wrong - or very rarely.
Old objects don't use it, but then maintainers started to ask for them. pak192.comic is already following the latest "standard" by adding them more.