Bay 12 Games Forum

Please login or register.

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

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

nop

  • Bay Watcher
    • View Profile
DF lighting system (I wrote a c++ code) + video
« on: November 17, 2012, 11:45:17 pm »

Sure, Sandy created a lot of problems. But I got an idea while sitting in my room without a light for a week...

So, finally I was able to run my first c++ code this evening, and this code implements a very fast 3D lighting system for DF. I hope parts of it will be used in DF one day...





I have to finish and optimize my c++ code (multithreading, caching, all that smart words), but it's the right time for suggestions.
I've got a couple of them.
1) by default, all underground caves and mines are always dark. So, dwarfs should keep the lights on.
2) light can be obtained by burning booze, wood, lignite and all other flammable materials. So, a light source consumes resources. Dozens of farms may be required for a large fortress.
3) fear of the dark. Dwarf caught in a dark becomes mad\depressed very soon and can be cured only by the sunlight(or a booze from the sunshine). Evil regions are always dark outside. More fun 8)
4) evil areas may spawn evil ghosts that arise inside unlit areas of the fortress
5) forgotten beasts are not visible in unlit areas.
6) underground creatures are very happy to destroy light sources
7) dwarfs may process underground plants or seeds to get a source of light \ fuel

What do you think, guys?

UPDATE: more images
http://www.bay12forums.com/smf/index.php?topic=119314.msg3805352#msg3805352

UPDATE 2:
youtube
https://www.youtube.com/watch?v=dD3-vrz_bYQ
https://www.youtube.com/watch?v=wih3k0wnsnc
https://www.youtube.com/watch?v=-ncqex8ijIM

UPDATE 3:
colors and doors
https://www.youtube.com/watch?v=lA4CC5KbowE

UPDATE 4:
ASCII mode
https://www.youtube.com/watch?v=7K_2IBmQswY
Dwarfs forget about their fortress when time passes
https://www.youtube.com/watch?v=6MmgC6TMkjw
« Last Edit: December 16, 2012, 10:32:00 pm by nop »
Logged

Cool Guy

  • Bay Watcher
  • inlcude <iostream>
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #1 on: November 18, 2012, 12:14:35 am »

I actually really like this idea, I don't think they should have to burn resources like that though, maybe a light that can be powered by windmills/waterwheels or a lamp that takes oil or fat.
Logged

NAV

  • Bay Watcher
  • I have an idea!
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #2 on: November 18, 2012, 01:28:55 am »

I usually imagine dwarves using some sort of bioluminecsence. Maybe dwarves use glow in the dark mushrooms as light sources, and some sort of glow in the dark pet creature as a portable light source.
torches and lamps and bonfires are cool too.
Logged
Highmax…dead, flesh torn from him, though his skill with the sword was unmatched…military…Nearly destroyed .. Rhunorah... dead... Mastahcheese returns...dead. Gaul...alive, still locked in combat. NAV...Alive, drinking booze....
The face on the toaster does not look like one of mercy.

Drapestar

  • Bay Watcher
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #3 on: November 18, 2012, 03:13:30 am »

this is awesome!  :D

i think all those methods to create light would be good with the use of a camp fire or bonfire or fireplace like object.

for more sustained light though i think some sort of lamp or candle object could be created. candle made from thread and wax? lamp be like as cool guy said takes oil or fat and would be made of metals.
Logged
1) kill parents
2) rename batman
3) if the child survives until maturity, make him a militia captain

tyrannus007

  • Bay Watcher
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #4 on: November 18, 2012, 03:45:46 am »

I usually imagine dwarves using some sort of bioluminecsence. Maybe dwarves use glow in the dark mushrooms as light sources, and some sort of glow in the dark pet creature as a portable light source.
torches and lamps and bonfires are cool too.
That's a cool idea. Maybe they also have really good night vision?
Logged
GENERATION 26:The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment

hermes

  • Bay Watcher
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #5 on: November 18, 2012, 03:53:19 am »

Love the demo, this pretty much conveys how awesome I've always imagined lighting would be.

There is an official lighting thread from years back that has lots of discussion and a summary of points by Footkerchief iirc.  On my phone now so linking is troublesome.

Should be said that lighting is a MAJOR development that would need fundamental changes to pathfinding and general ai to make it work.  I'd encourage everyone who likes this demo to vote for lighting on the eternal suggestions page!
Logged
We can only guess at the longing of the creator. Someone who would need to create one such as you. - A Computer
I've been working on this type of thing...

10ebbor10

  • Bay Watcher
  • DON'T PANIC
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #6 on: November 18, 2012, 05:57:35 am »

I usually imagine dwarves using some sort of bioluminecsence. Maybe dwarves use glow in the dark mushrooms as light sources, and some sort of glow in the dark pet creature as a portable light source.
torches and lamps and bonfires are cool too.
That's a cool idea. Maybe they also have really good night vision?
They should have.

Some of the cavern mushrooms/animals might also have light sources, albeit for different reasons. (attract panicking animals, and then gobble them up)
Logged

therahedwig

  • Bay Watcher
    • View Profile
    • wolthera.info
Re: DF lighting system (I wrote a c++ code)
« Reply #7 on: November 18, 2012, 08:31:16 am »

I suggest that individuals can see around them regardless of light. But nightvision creatures, such as dwarves should be able to see two or three tiles surrounding them, and humans only the first tile next to them, or something. Then they can carry lanterns to expand that view, and build lightsources for stationary light.

Maybe dwarves can make like chain oil lamps? Where the oil reserves are linked so that it will only take one job to light a series of oil lamps. Or maybe there's one lighter-dwarf(set in noble menu) that just goes around the whole fortress continuously to make sure all lights are dealt with?
It's extremely prey to unwieldy micromanagement.

Anyhow, adventure mode already has field of vision that decreases as there's less light. The main problem would be that DFs display needs to be updated for display different lightness-levels.

Also, Day and Night?
Logged
Stonesense Grim Dark 0.2 Alternate detailed and darker tiles for stonesense. Now with all ores!

Broken

  • Bay Watcher
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #8 on: November 18, 2012, 09:12:48 am »

Magma should emit light as well. Some time ago, i though a magma based lighting sistem.
Build the fortress in alternate z levels (11,13,15,etc), with grate floors and magma filled levels in between. Eternal free light.
Logged
Quote
In a hole in the ground there lived a dwarf. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a dwarf fortress, and that means magma.
Dwarf fortress: Tales of terror and inevitability

Vattic

  • Bay Watcher
  • bibo ergo sum
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #9 on: November 18, 2012, 09:20:21 am »

I suggest that individuals can see around them regardless of light. But nightvision creatures, such as dwarves should be able to see two or three tiles surrounding them, and humans only the first tile next to them, or something. Then they can carry lanterns to expand that view, and build lightsources for stationary light.
I don't know if you've ever been underground but without light darkness can be total. You seldom get this on the surface. In adventure mode it would have to let you know when you are bumping into things somehow, using text perhaps.

Cave adapted dwarves should get used to the dark and be able to see better in it.
Logged
6 out of 7 dwarves aren't Happy.
How To Generate Small Islands

AutomataKittay

  • Bay Watcher
  • Grinding gears
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #10 on: November 18, 2012, 09:27:27 am »

With above comments, I've been wondering if there'll be provision for infrared vision and the like. I imagine it could happen with some of the dark vision stuff, at least for creatures supposedly adapted to living underground ( though they tend to just end up losing ability to see ).
Logged

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #11 on: November 18, 2012, 03:18:09 pm »

I'd like it if you could always "see" at least the nine tiles adjacent, at least if they were walls, floors, or empty space, and if there was a creature there. It would be annoying if not.

Oh, and in case you hadn't gathered...planned.

Oh, before I forget, I'd suggest putting that script on the modding subforum.
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 #12 on: November 18, 2012, 03:46:42 pm »

Well, that's not a dfhack-like script but a separate c++ program at this moment.
Logged

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #13 on: November 18, 2012, 04:52:49 pm »

Is it easily applied to Dwarf Fortress?
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.

MrWiggles

  • Bay Watcher
  • Doubt Everything
    • View Profile
Re: DF lighting system (I wrote a c++ code)
« Reply #14 on: November 18, 2012, 06:07:56 pm »

This is great, except that its entirely to superficial.
Logged
Doesn't like running from bears = clearly isn't an Eastern European
I'm Making a Mush! Navitas: City Limits ~ Inspired by Dresden Files and SCP.
http://www.bay12forums.com/smf/index.php?topic=113699.msg3470055#msg3470055
http://www.tf2items.com/id/MisterWigggles666#
Pages: [1] 2 3 ... 5