Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4 5

Author Topic: DF lighting system (I wrote a c++ code) + video  (Read 11215 times)

Starver

  • Bay Watcher
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #30 on: November 20, 2012, 12:43:25 pm »

I was thinking the original "two versions" comment was about those wanting to play old-stylee vs those who wanted the lit version.  Like Invasions/No Invasions playing styles, it'd be a simple switch.  (Never tried to turn off vampires, but I just was pretty sure it wasn't an Init setting that affects them.

But light/no light has some similarities, also, with the "show water levels as numbers" setting, as well.  Although a toggleable mode (design in infravision, watch unpaused events unfurl with lighting-limited views?) could be also possible.

There's still the point that light-adjusted tiling is (so far as I know) beyond the wit of the current tile-rendering engine, whether or not at any one moment it should display like that.  But Toady (or Baughn, isn't it?) would know that for certain.
Logged

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #31 on: November 20, 2012, 05:34:54 pm »

Vampires and other interactions can be disabled in advanced worldgen.
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

nop

  • Bay Watcher
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #32 on: November 20, 2012, 11:12:24 pm »

Well, I design this lighting system with the idea in my mind that lighting system should change the whole gameplay and should become an important part of the survival in FORTRESS mode. Otherwise, lighting is useless, just like some joy for kids. Maybe, gradients are not really necessary, so a cell may be either completely visible, not invisible at all. Maybe, lighting system should not be applied to DF because this change makes DF a different game.

How the things are going on. Performance is no longer an issue as I have a version that renders dozens of moving colored lighting sources in less than 1 ms. But the memory is an issue, so x64 app is highly appreciated. Also, I believe that pathfinding (A*) algorithm is likely to become friends with the lighting system. Anyway, an integration with DF is impossible without the Big Toady Boss 8)

And one more thing. Do you guys know where can I get some very late game fortresses to test my engine on? I lost all mine when my hard drive f*#$ed up a month ago, and I'm too fascinated with development of the lighting system engine, so I have no time to build another fortress from the scratch.
« Last Edit: November 20, 2012, 11:18:00 pm by nop »
Logged

CrzyMonkeyNinja

  • Bay Watcher
  • He strikes from above...
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #33 on: November 21, 2012, 02:03:10 pm »

Personally, I really like the gradients. They add to the overall feel of it.

About the fortesses, I have a 10 year fort with lots of big open spaces if you want it (I went for a grand, impractical, great hall of the dwarves approach). I'm not sure if that counts as a "very late game fortress", though.
Logged
“I do not love the bright sword for it's sharpness, nor the arrow for it's swiftness, nor the warrior for his glory. I love only that which they defend” - J.R.R. Tolkien

AutomataKittay

  • Bay Watcher
  • Grinding gears
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #34 on: November 21, 2012, 03:19:12 pm »

Well, I design this lighting system with the idea in my mind that lighting system should change the whole gameplay and should become an important part of the survival in FORTRESS mode. Otherwise, lighting is useless, just like some joy for kids. Maybe, gradients are not really necessary, so a cell may be either completely visible, not invisible at all. Maybe, lighting system should not be applied to DF because this change makes DF a different game.

How the things are going on. Performance is no longer an issue as I have a version that renders dozens of moving colored lighting sources in less than 1 ms. But the memory is an issue, so x64 app is highly appreciated. Also, I believe that pathfinding (A*) algorithm is likely to become friends with the lighting system. Anyway, an integration with DF is impossible without the Big Toady Boss 8)

And one more thing. Do you guys know where can I get some very late game fortresses to test my engine on? I lost all mine when my hard drive f*#$ed up a month ago, and I'm too fascinated with development of the lighting system engine, so I have no time to build another fortress from the scratch.

Check out the community forum? Some of the succession games could have saves you could experiment with.
Logged

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #35 on: November 21, 2012, 06:28:02 pm »

I bet Doomburger would look awesome when lit.
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

Starver

  • Bay Watcher
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #36 on: November 22, 2012, 08:15:13 am »

Got a bit bored, last night, while waiting for a slow Adventuring session to progress, so tried something out myself.  Not particularly brilliant, but I did it anyway.

(Purely in GIMP, using an overlay mask of exactly fitting tile-sized blocks set to a suitable pythagorean intensity from the given centre of interest (which didn't quite marry up with the visual limit, but was close) and a "nightified" version of the screenshot with everything greyscaled except for remains/bodies (reverted to their traditional green hue) and "memorised creature positions" (set back to the reverse-purple appearance)...  This creates some odd hues, however, where it's partial.  I think I should have allowed them to "fade to grey" and leave only "beyond sight" stuff as so coloured.)

Oh, and I play in default tileset (not even squarified, but that was taken account of in my radius calculations).

Spoiler: Raw screenshot (click to show/hide)
Daytime, unadulterated.  Yes, there are that many animals around, and I'm sneaking with a load of flingable ammunition ready to try to incapacitate any that might be in danger of spotting me and alerting the cheetahs, lions and mongeese to my presence.  (Peregrines are a bugger for that, I've found.  that one in the Z+1 insert is one I went on to deliberately avoid, post screenshot. ;))

Spoiler: Fading to visual limit (click to show/hide)
That's from 100% daytime shot at the Adventurer's location, decreasing to slightly below 25% at the extreme limit of normal vision (tried to zero, but didn't look right).  "Sight shadows" caused by obstructions (i.e. trees) are left as they were in the raw view, however far away, given that "beyond limit" and "obscured" items are identical.

Note that you cannot see any further than you could in daytime, but a sufficiently close camp-fire will allow a day-visible tile to be seen to an appropriate degree.  I did not implement shadows of trees on camp-fire illuimination, but then I'd already put enough down (as markers, in this particular Adventuring scenario) to illuminate most areas from ENE-ish clockwise round to S, to make the difference moot.

I did not even try to recreate the "night-vision limit" colour scheme for all tiles within the shorter night-time visual limit, though technically as my adventurer is only slightly less than 60% of the drop-off away from the nearest camp-fire (with an arbitrary limit of ten tiles, or pythagorean equivalent), she should find herself a little bit in the dark.

This looks oddest.  Perhaps setting fires to be "100% visible regardless" (even/especially beyond day-time viewing limits?) would help, as it's their "faded-to-grey appearances" (shared with the "just fading" example above, obviously, given they already sustain themselves as 100% fire-lit and are subject only to the fading already seen in that version) that give colours other than the two shades of red and yellow that they should be flickering between.  (Flickering is obviously not shown in the original static shot and the resulting mock-ups from it.  Could have tried it, but GIF's pallette limit made it not worthwhile to even fake and I didn't feel like converting a string of 'frames' to a proper video file with enough losslessness to look good, either.)

Spoiler: As an extra treat (click to show/hide)
This is something I made by accident.  Fire-lit night-time shot with distance fade-off to night-time, but no "memory" surrounds beyond the normal visual limit (although both "memory beyond obstacles" and "memory due to lack of firelight" greyness can be seen).  Because it fades to blackness, it also has the illusion of being non-flat or even downright non-euclidean, to my eyes. ;)


(Note, in all the above I also applied the same filtering to the Z+1 insert, assuming that centre-centre was 1 tile away upwards and all others Xdif²+Ydif²+1² away , but trying to tune the fade-off so as to be obvious.  I didn't apply firelight effects, though, I now realise.)
Logged

dwarfhoplite

  • Bay Watcher
  • Gentledwarves, prepare for Glory!
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #37 on: November 24, 2012, 04:51:41 pm »

Can you provide a sample what this would look like with vanilla graphics?
Logged

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #38 on: November 24, 2012, 05:34:46 pm »

There's one in the post above yours.
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

Starver

  • Bay Watcher
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #39 on: November 24, 2012, 06:04:32 pm »

It's not exactly the same as OP's though.  A different set of visualisation philosophies and I completely chickened out on[1] putting tree-shadows (as far as it affects camp-fire light) in, and my fortresses aren't even designed with the same philosophy as OP's apparently is.

Yeah, I asked for a default tileset as well.  Not sure how relevant it would be.  But if the OP (nop?) could do it I'd be a little happier. ;)


[1] Read: initially forgot and couldn't be bothered all the hard work of correcting once I'd realised. ;)
Logged

Helari

  • Bay Watcher
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #40 on: November 25, 2012, 03:38:17 pm »

doesn't the time advance in dwarfmode in such a way that days would actually take only a few seconds, making day and night fly by like a strobe light?

I think outside in dwarf mode should be always bright but inside in the subterranean you'd need light.
Logged

Vattic

  • Bay Watcher
  • bibo ergo sum
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #41 on: November 25, 2012, 10:36:05 pm »

doesn't the time advance in dwarfmode in such a way that days would actually take only a few seconds, making day and night fly by like a strobe light?

I think outside in dwarf mode should be always bright but inside in the subterranean you'd need light.

This is the case. It has been suggested that it be abstracted into month long days and nights similar to when you are near the poles. Even if we don't have day and night in fort mode this would still be nice for adventure mode and having the underground be dark.
Logged
6 out of 7 dwarves aren't Happy.
How To Generate Small Islands

Starver

  • Bay Watcher
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #42 on: November 26, 2012, 05:43:54 am »

Would it be irrelevant to point out that you only get month-long days and nights whenever the days are virtually all daylight or benighted for around a month of actual 24-hour periods?

(At the axial poles, you only get 6 whole months of daylight and 6 whole months of night-time, give or take the week's-long period of dawn and dusk.  As you mover further away the summer/winter cycle is added to the day/night cycle to let daytimes intrude gradually into the wintery half of the seasons and night-times to intrude into the summery half of the seasons, until at the Arctic and Antarctic Circles you find yourself with midnights being always dark and mid-days always light (or, in close proximity, a combined dusk/dawn 'low-point' of the sun at midsummer and a combined dawn/dusk 'high-point' in midwinter).

Of course, Dwarfworld isn't Roundworld (it's even Euclidean, apparently[1], at least horizontally[2]), so it can be set up any-which-way seems best to Toady.


[1] Rather than set upon a spherical surface, like ourselves, unless the entire world is just so large that not only doesn't it wrap-around but it also doesn't significantly distort upon whatever ellipsoid or torus or otherwise it exists.

[2] And above the resolution of a standard tile.  Below that it's apparently infinitely folded space, etc, at least at floor-level.
Logged

Vattic

  • Bay Watcher
  • bibo ergo sum
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #43 on: November 26, 2012, 03:29:43 pm »

I am aware of how it works Starver. I was just using that as an example people are familiar with.

I always figured the world seemed flat because there was a lot more off the edges. Toady even spoke of having people come from over the edges before.
Logged
6 out of 7 dwarves aren't Happy.
How To Generate Small Islands

Metruption

  • Bay Watcher
  • They/Them
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #44 on: November 26, 2012, 06:37:29 pm »

Perhaps glowing vermin can be captured and made into low-light lanterns and mining helmets when their glowy parts are extracted.
Logged
Pages: 1 2 [3] 4 5