Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DF lighting system alpha code  (Read 4222 times)

nop

  • Bay Watcher
    • View Profile
DF lighting system alpha code
« on: April 23, 2013, 09:31:37 pm »

proto lighting engine for DF. Lost my will to develop it as I was able to obtain a working prototype
check this http://www.bay12forums.com/smf/index.php?topic=119314.msg3802421#msg3802421




alpha code is here http://dffd.wimbli.com/file.php?id=7599
What's inside the archive:
1) plugins/mapexport contains modified version of mapexport plugin for dfhack
can be used to export custom DF maps
2) code
3) map, sprites
4) lighting map

I used qtcreator 4.8, c++11
Provided ./lighting executable was compiled under fedora 17 x64 c++11 gcc 4.7 -mavx (I've got core i7 i3610M)

enable GENERATE_DEPTH_FILE if you want to generate an advanced lighting map
try changing WALKING_DWARFS_COUNT as well (for ex, 10-50)

every light is a point 3D-light (light6) that consists of 6 light1-pyramids

take a look here and other videos.
http://www.youtube.com/watch?v=6MmgC6TMkjw

use mouse to close \ open doors

use or modify this code as you want to. It should not contain serious bugs, just limitations

alexanderguzhva@gmail.com
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: DF lighting system alpha code
« Reply #1 on: April 24, 2013, 12:38:38 am »

Impressive
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: DF lighting system alpha code
« Reply #2 on: April 24, 2013, 01:22:26 am »

If I get it right, it's just a visualizer. Did you plan to make it work with things like Stonesense or make a separate visualizer? I mean, it has nothing to do with the actual game, so what was your original plan for the final version, I wonder?
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DF lighting system alpha code
« Reply #3 on: April 24, 2013, 06:40:39 am »

I love this.

Adding light not only to dwarves but light-sources like braziers, bonfires, candles or torches would really be amazing.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Godlysockpuppet

  • Bay Watcher
  • [Insert wit here]
    • View Profile
Re: DF lighting system alpha code
« Reply #4 on: April 24, 2013, 07:34:17 am »

Wow. Me likey ;D
Logged

nop

  • Bay Watcher
    • View Profile
Re: DF lighting system alpha code
« Reply #5 on: April 24, 2013, 08:21:25 pm »

this code was designed to handle hundreds of moving point lighting sources and thousands of static ones, and to be a part of engine. I believe that lighting (and tracing lighted areas) should become an essential part of the game. But then I read that big boss does not accept 3-rd party code, and had no wish to implement a simple stupid visualizer for ladies and kids. Ideally - to make a fortress dark, cold, creepy, with mad dwarves that were lost in the darkness.

I'm done with these hopes. And with this code.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DF lighting system alpha code
« Reply #6 on: April 24, 2013, 08:26:53 pm »

But why? It is widely known that Toady One never includes anything done by anyone else. Thats why we have mods, or the LNP. You would be surprised how many people use those. If you connect your visualizer to the dwarf fortress.exe, no one will stop you releasing it as a bundle.

I would love to see this work, to make dwarves build light sources, slowly explore caverns, strategically mine with a support crew that brings torches/light... maybe add a day/night cycle based on the seasons (with winter being night, summer being day)

What is wrong with adding this as an utility, similar to the Therapist or Soundsense?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DF lighting system alpha code
« Reply #7 on: April 24, 2013, 09:25:48 pm »

But why? It is widely known that Toady One never includes anything done by anyone else.

except the SDL code >_>

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: DF lighting system alpha code
« Reply #8 on: April 25, 2013, 02:14:50 pm »

But why? It is widely known that Toady One never includes anything done by anyone else.
except the SDL code >_>
Which he has since said that he hated doing. :P
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Mohreb el Yasim

  • Bay Watcher
  • ♫♪♫♫♪♫♪♪♫♪
    • View Profile
Re: DF lighting system alpha code
« Reply #9 on: April 25, 2013, 07:03:52 pm »

nice images nop, i feel your lighting a bit harsh on the edges, reflected secondary ligth seems completly ignored and the perception wise the degrading should be slower on the dark ends as our eyes work more that way so it would give it a more real-like feeling ...
Meph, i do not think this thread was addet to be merged with DF and even if there migth ghave been such intention we all know it wont happen, (for gameplay wise it is better to not have lighting in my opignon for fortress mode anyway) but it is still a nice study of ligthning transmissions in squerical spaces ...
Logged
Mohreb el Yasim


GENERATION 24:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experime

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DF lighting system alpha code
« Reply #10 on: April 25, 2013, 07:17:13 pm »

I know it wont be merged into DF by Tarn Adams, but my question was: Why not develop this as a utility that people can run on the side, like Therapist or Quickfort? I know I would play with it. Seeing everything that is going on in the caverns, without a dwarf far and wide was always a pet peeve of mine. I suggested a fog of war several times in the dfhack thread... somehow porting it from adv. mode. But this here is even better.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

nop

  • Bay Watcher
    • View Profile
Re: DF lighting system alpha code
« Reply #11 on: April 25, 2013, 09:03:42 pm »

Well, man, I have spent two months for writing this code. You want a visualizer - you should do it yourself: find  how to deal with dfhack, stonesense, debug it, and so on. Everybody would be grateful for your job, no doubt.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DF lighting system alpha code
« Reply #12 on: April 25, 2013, 09:17:06 pm »

But... it already works, doesnt it?  How else could you have done the videos?  Or maybe I should just shut up, because I obviously have no idea what I am talking about.  I dont know a single line of C++, I am no programmer whatsoever.^^
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DF lighting system alpha code
« Reply #13 on: April 26, 2013, 10:12:06 am »

You can replace the visualizer in df by using dfhack. It's been done a few time (for remote visualization) and is not that hard. Unfortunately visualizer only gets what char or pic to place where without any info about tile passibility or anything else. Of course you could just look into map yourself. So in the end it's not trivial to add something like this into df. But far from impossible.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: DF lighting system alpha code
« Reply #14 on: May 03, 2013, 08:06:29 pm »

Can the lighting actually be used?  Like creatures without infrared token can't see in the dark?  Could the light have an ingame effect other than being visual?  Of course it would affect the player since he can't see beyond the darkness, but what about bad guys?  Then again, what about noise?