Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Light From Sides  (Read 982 times)

Batgirl1

  • Bay Watcher
    • View Profile
Light From Sides
« on: January 25, 2015, 08:22:36 pm »

Would it be easy to tweak the light-sensing things such that a square next to a lit square, with no wall in between, would itself register as lit?  This would allow us to take advantage of cliff-faces in order to stave off cave adaptation, and make windows more useful.  In fact, maybe sacrifice realism for ease of programming by having only windows transmit light sideways: then the computer would only need to check for "Am I adjacent to a window, and is the window adjacent to a lit square?" 
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Light From Sides
« Reply #1 on: January 25, 2015, 11:22:29 pm »

The entire system is due for a complete rewrite. As it stands, once a tile is light it can't ever be dark again, meaning light would instantly and permanently flood the entirety of the fortress with lit squares. Tweaks are pointless at the current time.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Batgirl1

  • Bay Watcher
    • View Profile
Re: Light From Sides
« Reply #2 on: January 26, 2015, 03:23:46 pm »

The entire system is due for a complete rewrite. As it stands, once a tile is light it can't ever be dark again, meaning light would instantly and permanently flood the entirety of the fortress with lit squares. Tweaks are pointless at the current time.

Ah, ok.  Fair enough.
Logged

Zarathustra30

  • Bay Watcher
    • View Profile
Re: Light From Sides
« Reply #3 on: January 27, 2015, 06:02:53 pm »

I think we could have multiple tiers. Light in direct sunlight, well-lit for tiles adjacent direct sunlight, dimly-lit for tiles adjacent to those, and dark, for none of the above. If a square was adjacent to enough well-lit tiles, instead of being dimly-lit, it would also be considered well-lit. The same would apply to dimly-lit tiles.

Windows would propagate light, so if a window was well-lit, then the tiles surrounding it would also be considered well lit. Torches (future) could be single tile sources of well-lit. The surrounding tiles would be dimly lit, but if you have enough grouped together, entire halls could be well-lit.

The biggest problem would be processor load. It would be like having an additional game instance of Conway's Game of Life running 24/7. However, if the game calculates one light level at a time, then the lighting algorithm only has to be run twice (once for well-lit, once for dim) whenever the light changes.
Logged
How did we pass from inns with merry songs and happy music to temples of doom and medieval torture with so much easiness and eagerness??

Batgirl1

  • Bay Watcher
    • View Profile
Re: Light From Sides
« Reply #4 on: January 27, 2015, 08:55:09 pm »

Removing Dim would probably reduce the processor burden:  We could just have Directly Lit, Indirectly Lit, and Dark.  Indirectly would be any tile adjacent to directly (or adjacent to a window that's adjacent to directly).
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Light From Sides
« Reply #5 on: January 28, 2015, 12:22:23 am »

I doubt that this is a better solution, but maybe fluids have been more optimized than I thought.  Tiles could have 8 levels of light, 0 to 7, like a fluid level.  Some quick-to-calculate formula to determine light level from adjacent tiles (not flow mechanics!), such as equal to max of tile above or below if unblocked, plus sum of 1/4 the level of all horizontally adjacent tiles with a max of the brightest adjacent tile.  Then different light sources can have different levels, with the sun being 7.

To really melt your CPU, the sun can track across the sky to work out realistic shadows...
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

SixOfSpades

  • Bay Watcher
  • likes flesh balls for their calming roundness
    • View Profile
Re: Light From Sides
« Reply #6 on: January 28, 2015, 12:56:48 am »

Personally, I'm hoping for actual day and night, in relative real-time, like Adventure mode. Days would be shorter, of course, so that an in-game year would not take a real-time month to play, but still long enough that a dwarf could walk the perimeter of a standard 4x4 embark and return home the same day. So, yes, relatively real shadows, so that windows facing east would get noticeably more light in the mornings than windows with a western exposure.
Logged
Dwarf Fortress -- kind of like Minecraft, but for people who hate themselves.