Bay 12 Games Forum

Dwarf Fortress => DF Modding => Utilities and 3rd Party Applications => Topic started by: Warmist on July 13, 2013, 06:55:46 am

Title: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 13, 2013, 06:55:46 am
So there were few ideas and suggestions floating around about implementing light in df. This plugin allows that (and more).
eye candy:
Spoiler (click to show/hide)
Current features:
Stuff occluding/emitting light

Things to-do so i won't forget (in no particular order):

In more detail: http://www.bay12forums.com/smf/index.php?topic=128487.msg7409464#msg7409464 (http://www.bay12forums.com/smf/index.php?topic=128487.msg7409464#msg7409464)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 13, 2013, 06:56:24 am
Example settings:
Spoiler (click to show/hide)
Some explantions (also read included rendermax.lua):
Spoiler (click to show/hide)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: fricy on July 13, 2013, 07:58:39 am
Awesome, PTW.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lightrow on July 13, 2013, 09:33:53 am
this looks interesting, cant wait to try it out! It also would be nice if we had some sort of "field of view" or "fog of war", so that we don't know what lies within an unlit area, unless a dwarf approaches it, or a torch or something like that is built in there.

Minecraft style: forgotten beasts spawning in unlit areas  :)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Hommit on July 15, 2013, 03:42:24 am
Oh WOW!

any torches/lamps/etc planned?

ps: assuming you gave code to Toady, what do you think chances will be that wee see this in main game in current release?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 15, 2013, 04:55:48 am
this looks interesting, cant wait to try it out! It also would be nice if we had some sort of "field of view" or "fog of war", so that we don't know what lies within an unlit area, unless a dwarf approaches it, or a torch or something like that is built in there.

Minecraft style: forgotten beasts spawning in unlit areas  :)
Currently the system works as a layer on top of view (to be precise it just multiplies the color value of each tile) thus does not modify the actual working of the game. That being said it is possible to do some features like that but imho it's enough that it's too dark to see.

As for minecraft style, yeah that would be !!FUN!!, but alas we don't have explosions (terrain destroying) in DF so no creepers :<

Oh WOW!

any torches/lamps/etc planned?

ps: assuming you gave code to Toady, what do you think chances will be that wee see this in main game in current release?
for torches/lamps/etc -> i'll let modders do that (by making custom 1x1 workshops). My work is to create a system. Modders -> create implementations (magical crystals?, glowing fungus trees?, maybe lava only lighting and then megaprojects that all the corridors would have lava?) and users to play :)

and for ps: NONE. First of all Toady has said multiple times that he does not want to collaborate, secondly we from dfhack do it quite differently then Toady does (because he has access to source code) and lastly Toady One has his one ideas which (most probably) are totally different from our implementation.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on July 15, 2013, 09:35:00 pm
Yeah :)

You did it :)

I already have brazier, candelabra and fireplace set up as 1x1 workshops, and plan on glowing fungus for the caverns. It will look great. Did you experience any FPS-affects when running this?

I will gladly wait for dfhack r4 for this.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Putnam on July 15, 2013, 10:12:34 pm
i love the name for your "ultra high settings" variable, btw
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 16, 2013, 02:34:22 am
Yeah :)

You did it :)

I already have brazier, candelabra and fireplace set up as 1x1 workshops, and plan on glowing fungus for the caverns. It will look great. Did you experience any FPS-affects when running this?

I will gladly wait for dfhack r4 for this.
It's not as slow as you would think, but it is a bit slower. But due to Japa's persistence it's multi threaded now and hopefully will be more efficient as time goes on. Currently it only calculates lighting for visible part of world (so smaller screen, less of performance drop).

As for waiting for dfhack r4, i am hoping (i.e. procrastinating at the moment) to make a back-ported version of this, so it would work with r3 (does not need to mess with dfhack itself actually. Can work as a dll plugin). Although it has a few nasty bugs (like crashing randomly if you resize screen while running, or try to disable it...)

i love the name for your "ultra high settings" variable, btw
Thanks. That was inspired by a better algo pictured here: image (http://i.imgur.com/ikZHIFb.png) that eats your cpu like crazy (something like O(n!) vs our O(n^2) ) but it looks nice.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Sutremaine on July 16, 2013, 05:25:29 pm
So, screenshot mode then?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: GSV Urist on July 17, 2013, 06:52:59 am
Damn!  I have been lurking on forums since about 2007 but almost never post.  Just wanted to say this looks amazing, and if it works smoothly would add real flavour to DF. So mad props for doing it!  This kind of tuff blows my mind not being a programmer, can this pass back info to df? Could you use this to simulate gas?  Like saturate a tile in green then kill stuff that enters it? 

Between this and digging invaders there are some really interesting new plugins out.  Sadly I tend bottom out at about 20 fps with 80 dwarves pop limit after a while but hopefully lighting wont impact that too much.

Also wanted to say a big thanks to Meph, who I know has been pushing for this.  I have been playing masterwork almost exclusively now for a while and im kinda in awe of how much work it must have taken.  I know it uses alot of different mods as well to thanks to Putnam et al + anyone else who contributes to masterwork and the DF/Hack collection.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 17, 2013, 07:08:52 am
So, screenshot mode then?
That is a whole different idea...
Damn!  I have been lurking on forums since about 2007 but almost never post.  Just wanted to say this looks amazing, and if it works smoothly would add real flavour to DF. So mad props for doing it!  This kind of tuff blows my mind not being a programmer, can this pass back info to df? Could you use this to simulate gas?  Like saturate a tile in green then kill stuff that enters it? 

Between this and digging invaders there are some really interesting new plugins out.  Sadly I tend bottom out at about 20 fps with 80 dwarves pop limit after a while but hopefully lighting wont impact that too much.

Also wanted to say a big thanks to Meph, who I know has been pushing for this.  I have been playing masterwork almost exclusively now for a while and im kinda in awe of how much work it must have taken.  I know it uses alot of different mods as well to thanks to Putnam et al + anyone else who contributes to masterwork and the DF/Hack collection.

It could. But currently it does not (for purity and separability). Also there is an issue that this only calculates everything in viewscreen only, thus anything involving said gases out of screen will not work.

The performance is ongoing battle. It's performance against quality. It would be very nice to have diffuse lights (i.e. it would travel around corners somewhat) and full map lights (maybe with crazy stuff like mirrors that bring sunlight from outside into the fort? or huge crystals that light up ALL the center of huge fort?). Currently it can benefit from rewriting the occlusion and lights stuff into threads (light propagation is already in threads). Occlusion is all the stuff that blocks (colors) light and lights is the step that add light sources (also sunlight is a big performance drain because it checks multiple layers, including constructions and water etc...).

Edit: main thing that it's lacking for me is ability to hack adv-mode so it would not use default vision but instead use this lighting system.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lightrow on July 17, 2013, 03:53:20 pm
will it be rendered by CPU or GPU? I mean, will the be any benefit from a good videocard or not?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 19, 2013, 02:24:20 pm
will it be rendered by CPU or GPU? I mean, will the be any benefit from a good videocard or not?
Cpu. It is theoretically possible to offload it to e.g. shader but currently the light itself (which could be offloaded) is not very computation intensive and general reading (and computing) the map is taking most of the time and it can not be done on gpu (it also requires locking df, so it would not change the map in the middle of computation)

Btw: i added a pre-alpha-preview version of this. Mostly for playing around and mod makers to get the feel for the plugin. In the next versions the lua file will probably move to raws (thus be world dependant) and arena mode does not work (limitation of dfhack r3).
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Sutremaine on July 19, 2013, 05:49:52 pm
Where does rendermax.lua go? I've tried it in a bunch of folders, but the DFHack console keeps telling me: "File not found: rendermax.lua".

It sort of works -- dwarves generate their own light, but nothing else does. Even the surface is dark where there aren't any dwarves.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Putnam on July 19, 2013, 06:12:48 pm
Quote
put dll into hack/plugins
put lua file into same dir as df exe file is.
for best effect set black (in data/colors.txt) to non-black e.g. :
[BLACK_R:40]
[BLACK_G:40]
[BLACK_B:40]
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Sutremaine on July 19, 2013, 06:35:59 pm
Okay, I dunno how I missed that, since I caught the note about changing the black to off-black...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on July 20, 2013, 10:57:00 pm
I tried to use it on a save, but either it shows nothing, or it crashes. I use dfhack r3 with the latest MasterworkDF version, Df34.11.

If I use 2D or 2DASYNC mode it says that I need a non-2D mode, and should try STANDARD, once I type "rendermax enable" into dfhack. It complains about missing open GL. So I changed the init to STANDARD, but the game instantly crashes back to desktop when trying to load a world. I get this message:

(http://i.imgur.com/4AD7u2i.png)

It probably is a limitation of the netbook, running Win7. Anyone else getting this?

I am also unsure how to link the light generation to a plant, creature or workshop. I assume that part has not been written yet?

EDIT: I could only find this, so it seems a problem with the GPU. Although I have no idea why it can run graphics just fine, but not your rendermax plugin. http://www.bay12forums.com/smf/index.php?topic=41858.0 (http://www.bay12forums.com/smf/index.php?topic=41858.0)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: fricy on July 21, 2013, 01:19:42 am
Possible, it would be good to know the model number and the manufacturer of your GPU. If it's an older netbook it's reasonable to assume that you have an intel GMA 950 chipset, and those are terrible, opengl support is only partial, the drivers are hacked together to make it look like it works. Nothing can be done about. If you have something newer you should check if there's an updated driver that you can install.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Hommit on July 21, 2013, 02:24:36 am
It works, and even didnt crash on disable

seems like light cycling isnt working, or i dont know how its supposing to work

[edit]: it works after reloading game
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 21, 2013, 03:14:38 am
I tried to use it on a save, but either it shows nothing, or it crashes. I use dfhack r3 with the latest MasterworkDF version, Df34.11.

If I use 2D or 2DASYNC mode it says that I need a non-2D mode, and should try STANDARD, once I type "rendermax enable" into dfhack. It complains about missing open GL. So I changed the init to STANDARD, but the game instantly crashes back to desktop when trying to load a world. I get this message:

(http://i.imgur.com/4AD7u2i.png)

It probably is a limitation of the netbook, running Win7. Anyone else getting this?

I am also unsure how to link the light generation to a plant, creature or workshop. I assume that part has not been written yet?

EDIT: I could only find this, so it seems a problem with the GPU. Although I have no idea why it can run graphics just fine, but not your rendermax plugin. http://www.bay12forums.com/smf/index.php?topic=41858.0 (http://www.bay12forums.com/smf/index.php?topic=41858.0)
Unfortunately i can't help you there. This is (currently?) opengl only. Maybe upgrading drivers might work? Btw does it crash with rendermax enabled when loading or just "STANDARD" mode?

As for plants this makes them glow: (although it's not split from plant when it's growing and plant-material when it's used in building)
Code: [Select]
addMaterial("PLANT:TOWER_CAP",nil,{0.65,0.65,0.65},6)
addMaterial("PLANT:MUSHROOM_CUP_DIMPLE",nil,{0.03,0.03,0.5},3)
addMaterial("PLANT:CAVE MOSS",nil,{0.1,0.1,0.4},2)
addMaterial("PLANT:MUSHROOM_HELMET_PLUMP",nil,{0.2,0.1,0.6},2)
Buildings:
Code: [Select]
addBuilding("Statue",{1,1,1},{0.9,0.75,0.3},8)
addBuilding("Bed",{1,1,1},{0.3,0.2,0.0},2)
addBuilding("WindowGlass",nil,nil,0,{"useMaterial"})
addBuilding("WindowGem",nil,nil,0,{"useMaterial"})
addBuilding("Door",nil,nil,0,{"useMaterial"}) -- special case, only closed door obstruct/emit light
addBuilding("Floodgate",nil,nil,0,{"useMaterial"}) -- special case, only closed door obstruct/emit light
Also supports custom workshops: "Workshop:Custom:<your name>" works. Did not do anything fancy with it. Japa suggested setting setting emision and occlusion to each workshop tile if it has more than one tile. This might be what i will do.
And yes creatures are not yet in. And i don't know about items: they might be a big performance drain.

Edit: just checked, 2d modes don't have an easy way to make them truecolored.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 21, 2013, 03:15:20 am
It works, and even didnt crash on disable

seems like light cycling isnt working, or i dont know how its supposing to work

[edit]: it works after reloading game
You can try "rendermax lights reload" after changing settings.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on July 21, 2013, 03:29:09 am
Yeah, its an older netbook, dont think I can do a lot about it. Guess I'll have to wait 2 months till I am back on a real PC.

Plants and workshops seem fine to me. Creatures was just an idea. I assume dwarves automatically generate light? Or do people really have to outfit everything underground with the fitting workshops (1xtile ones for light generation)? I'd rather like that.

I assume that this "{"useMaterial"})" means that the workshop generates light the color of the build-mat? So a marble-candelabra would make white light, but a cinnabar/realgar-candelabra produces red light?

I dont know about items. While it would be fun to make a blessed armor or a sword that glows blue when greenskins are close, I think it would be more of a gimmick then anything else.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lightrow on July 21, 2013, 03:54:38 am
Alright, it works and it looks great! My embark max FPS dropped from 600 to 250 though, so no more fast-forwarding, but its worth it, thanks!

PS: never thought about how fast a day/night cycle is in DF...
PSS: FPS drop might have originated from changing printmode from 2D to STANDARD
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on July 21, 2013, 03:58:17 am
Sorry Warmist, completely forgot your question:

I start with rendermax disabled, nothing in the init. Then I type "rendermax enable" and get the dfhack error message about missing opengl and that I should try non-2d mode, or standard mode. I then exit Df, change the init, start with STANDARD mode, rendermax still disabled, and the game crashes when it tries to load a world.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lightrow on July 21, 2013, 04:01:11 am
i did it this way:

1. Launch DF, load world
2. type "rendermax light" - it says "switch to STANDARD/non-2D"
3. quit ( "die" in console )
4. change 2D to STANDARD in d_init
5. start DF, load world
6. type "rendermax light"
7. it works
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on July 21, 2013, 04:09:21 am
Sure it works for you, it is not a problem with the script, its the lacking hardware I try to run it on. ;) Nothing I can do about it, it crashes on Step5.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Sutremaine on July 21, 2013, 05:09:49 am
I assume dwarves automatically generate light?
Dwarves generate light, though not very much.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 21, 2013, 07:17:46 am
I assume dwarves automatically generate light?
Dwarves generate light, though not very much.
this defines how much light they emit/occlude (i forget if they occlude or they ignore that param)
Code: [Select]
special.CITIZEN=makeMaterialDef(nil,{0.80,0.80,0.90},6)

Plants and workshops seem fine to me. Creatures was just an idea. I assume dwarves automatically generate light? Or do people really have to outfit everything underground with the fitting workshops (1xtile ones for light generation)? I'd rather like that.

I assume that this "{"useMaterial"})" means that the workshop generates light the color of the build-mat? So a marble-candelabra would make white light, but a cinnabar/realgar-candelabra produces red light?

I dont know about items. While it would be fun to make a blessed armor or a sword that glows blue when greenskins are close, I think it would be more of a gimmick then anything else.
The usematerial does use material but not that way. It tries to use material provided (e.g. cinnabar -> blocking light and not emitting light) and if it does not find it then it uses the one defined in lua. This should be used with e.g. modded in glowing crystals or just set to emit light always (like statues and beds currently do).

As for dwarfs glowing it's in and you can tweak that with line i mentioned before, but imho it's more fun when they don't and you need to build glass walls that bring light from surface or magma in the corridor walls so it would have nice red light.

I'll update second post with more info. About configuration file.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on July 21, 2013, 08:39:22 am
Yeah, a little readme makes sense. I would have gladly tested and tried a few things and written a how-to with some screenshots, like I did for autosyndrome, but I cant get it to work on the netbook.

So when you say glowing crystals you mean that you can make specific materials glow? So for example adamantine could glow blue? And anything made of adamantine? Well, I guess I just wait for your update on the matter, since it is theoretical knowledge for me anyway. ;)

Still, my current idea is this:
 - Optional Settings for Masterwork, by default ON (depending on how high the FPS effect is)
 - Dwarves generate no light.
 - Surface would always be bright. No day/night cycle (since the speed is so high it would drive people mad after a short while, at least with the 72times faster fortress mode. A "spring twilight - summer bright - autumn twilight - winter dark" change of surface light would make more sense I think, although slightly unrealistic of course.)
 - Underground would be dark.
 - 4 custom workshops give light: Brazier, Candelabra, Fireplace and Glowing Crystal.
 - First and Second Cavern plants give light. Bioluminescence from mushrooms and crystal-tree/plants.

 - If inorganics can give light, then specific materials like Warpstone or Blood/Tear of Armok (special veins and gems from the mod) would emit a faint light.
 - If inorganics can give light, would that include material emissions? Firebreath is a perfect example, or any other magical attack. It would be awesome to see burning arrows and exploding catapult ammo, both in the mod already, to generated some warm yellow/red glow.

And thats about it.

Plants and workshops can already be done, I'll await your answer/ideas about inorganics and items, and as a feature request I would ask you to try the seasonal day/night changes, just to see how it goes. Even if winter is only half-dark on the surface it would change the mood/atmosphere quite a bit.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: fricy on July 21, 2013, 08:46:24 am
@Meph: What about smelters/forges? I feel they should give a red glow too. At least the custom workshops, if the vanilla workshops cannot be modded. (Can they?) Otherwise seems good.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on July 21, 2013, 09:09:13 am
Magmaforges would constantly give a glow because of the nearby magma... normal forges should only cause light when in use... I already have a dust-cloud effect on all of them, if inorganics can be set to emit light it would be easy to just add the appropriate glow to this cloud of boiling rock. Whenever a reaction is run in a forge, fuel is used, and a cloud of black smoke is generated, it could also give a red glow. Again, only possible if inorganics are set to emit light.

It would make sense to add braziers, candelabras or fireplaces as buildmats to specific buildings that should have light. For example I can clearly see the Embassy or the Tavern be brightly illuminated, or the Mages Guild showing off some kind of glow. But I think its currently only possible to make a workshop glow, not specific tiles of a workshop.

Example:
(http://i.imgur.com/vUbFt2U.png)

Any possible way of only making the 4 tiles emit light which show the firepace/brazier? I assume it would be quite a bit of work, so making the entire workshop glow would be ok too. Its probably easier to  just change building designs to meet the requirements of the plugin.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Hommit on July 21, 2013, 11:15:03 am
Test screening fort (all channels to be grated later):
(http://4put.ru/pictures/small/676/2078999.jpg) (http://4put.ru/view-max-picture.php?id=2078999) (http://4put.ru/pictures/small/676/2079000.jpg) (http://4put.ru/view-max-picture.php?id=2079000) (http://4put.ru/pictures/small/676/2079002.jpg) (http://4put.ru/view-max-picture.php?id=2079002)
Imho, thats abit too dark... For any normal light, fort must drown in statues and magma... (and all walls is windows, sadly no sand there)

ps: any glass emits light, not just windows? (including furniture etc. and what colors will be glass statues?)

hmm... is it possible to have non-circle light sources? (linear, oval, half-circles etc).
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 22, 2013, 12:48:34 am
@Meph:
Yes materials can glow (and pass light). In default configuration the light passes through gem veins.
Spoiler (click to show/hide)
Speed of days can be modified and color of light could be modified too (it has a list of colors) so it could work as a seasonal warm sun -> colder color sun->warm sun or sth...
Trees and mushrooms can (and do by default) glow.
Material emissions are half done. Dragonfire/fire does glow (and orange/red depending on density) looks real cool.
For buildings i think i'll do something like this:
Code: [Select]
X=<color ocupancy>, <color emmisive>, <radius>
Y=<color ocupancy>, <color emmisive>, <radius>
and then
X  Y
YY X
XXXX
@Hommit:
Actually they are not circular :D. Although with current light propagation it's a bit limited (i.e. looks ugly) if you lower the amount of light the air blocks (because it's exponential).
This line does that, and e.g. setting to {1,1,1} would disable light decay.
Code: [Select]
special.AMBIENT=makeMaterialDef({0.85,0.85,0.85}) --ambient fog

Also all values support > 1. That would make some strange things (esp with dark color schemes). It looks like HDR or something.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lightrow on July 22, 2013, 09:27:58 am
we've got darkness, now we need torches to light it up. I don't know a thing about modding raws but maybe someone can make it? Maybe as a piece of furniture? Made by woodburner at wood furnace?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Hommit on July 22, 2013, 11:43:38 am
Quote
Actually they are not circular :D. Although with current light propagation it's a bit limited (i.e. looks ugly) if you lower the amount of light the air blocks (because it's exponential).
Hmm i see what you mean. Player with values, and i think value around 0.88-0.9 is better - its more brighter, but not that much as 0.95. Need to correct light radius for entries, but they can be put for as giht as 20 or more, and then light will decay on its own anyway.

water doesnt give light even when specified :(
special.WATER=makeMaterialDef({0.5,0.5,0.8},{0.5,0.5,0.9},10)
or... it's strange. with this water does give light, but only on its own level and dont propagate across z, unlike lava. weird.
special.WATER=makeMaterialDef(nil,{0.5,0.5,0.9},10)

caverns are cool :)
Code: [Select]
addMaterial("PLANT:FUNGIWOOD",nil,{0.5,0.6,0.1},6)
addMaterial("PLANT:TUNNEL_TUBE",nil,{0.7,0.3,0.6},6)
addMaterial("PLANT:SPORE_TREE",nil,{0.1,0.5,0.5},6)
addMaterial("PLANT:NETHER_CAP",nil,{0.2,0.2,0.9},6)
addMaterial("PLANT:BLOOD_THORN",nil,{0.6,0.1,0.2},6)
(stitched from 3 images)
(http://4put.ru/pictures/max/677/2081775.jpg)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: sayke on August 02, 2013, 10:34:26 am
holy crap this is amazing. warmist, you rule! posting to follow.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on August 02, 2013, 11:03:55 am
Feature Request: Temporary lightsource from reaction.

Example: Workshop Oil-Lamp. Reaction: Light the oil lamp. Reagent: Oil. Product: 1 ingame month of light.

Just leaving this here, because I think its a neat idea. Weak lightsources that are constant, and powerful lightsources that need reagents.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bloax on August 03, 2013, 02:49:38 am
Could You (the adventurer) also emit light by default? ???

It wouldn't really have much of an effect in the adventurer mode, but it'd make things a bit gloomier.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on August 03, 2013, 05:24:18 am
Could You (the adventurer) also emit light by default? ???

It wouldn't really have much of an effect in the adventurer mode, but it'd make things a bit gloomier.
I'll add that to next version (if i don't forget). The main annoyance to me in adv mode is that we can't override the default view distance. If it was my choice i would set it to fullscreen and then only use the rendermax to light up stuff.

Feature Request: Temporary lightsource from reaction.

Example: Workshop Oil-Lamp. Reaction: Light the oil lamp. Reagent: Oil. Product: 1 ingame month of light.

Just leaving this here, because I think its a neat idea. Weak lightsources that are constant, and powerful lightsources that need reagents.
I'm not sure how this would work. Maybe it's already possible with low ignition point materials? Like bonfire mod?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bloax on August 03, 2013, 06:16:14 am
Well truth to be told, I like it more for the ambience it provides. Most notably nights being really, really dark.
Spoiler (click to show/hide)
Though it'd be nice (if it's possible that is) if it didn't affect the interface, since my complaint ought to be rather obvious once you look at it:
Spoiler (click to show/hide)

also omfg lights in df whoah cool
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on August 03, 2013, 08:18:40 am
Yeah lights over the interface is very annoying too. Can't do anything about that though...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on August 03, 2013, 08:28:36 am
I know that dfhack recognizes which screen it is currently watching, so why not set the default brightness/illumination to very high once you open a menu, and set it back to dark once you exit it.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on August 03, 2013, 08:35:05 am
In adv mode it's a bit more complicated. But that might be how i'll do it later.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on August 03, 2013, 09:01:27 am
I dont know if you know (or if its important), but all my suggestions will always be for fortress mode. I have never played AdvMode and MasterworkDF is completely geared towards FortMode.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on August 03, 2013, 09:11:13 am
Yeah nobody loves advmode ;< (except rumrusher)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on August 03, 2013, 10:01:58 am
Toady does... most of what he has done these last 2 years is for AdvMode.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bloax on August 03, 2013, 10:05:23 am
It's hard to love something that's nothing but an empty, unfinished shell that's completely static and without any signs of life at this point.

You know, what with the missing goblin, elf and dwarf sites, nothing going on - shops being completely useless, the same old quest structure of bandits->more bandits->something/bandits->blabla
Oh, and the cavern populations getting completely wiped out apparently due to a bug. Which means there's only the overworld to explore, unless you like pointlessly wandering for hours on end while utterly lost.

and what with the next version of DF sitting there and making playing that seem utterly pointless (not to mention all the other games available out there seem more attractive currently)

Don't get me wrong on that I don't like it at all (http://www.bay12forums.com/smf/index.php?topic=51245.msg4460102#msg4460102) (I do like the premise), it's just that it's so lackluster and dead at the moment that it's not really worth being a general timesink.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: PeridexisErrant on August 03, 2013, 11:24:17 pm
Is this potentially able to implement full graphics support, #4 eternal suggestion (http://www.bay12forums.com/smf/eternal_voting.php)?  As I understand it, Toady is unlikely to ever implement that due to issues with the SDL code, so it's a prime candidate for some kind of hacky workaround.  I'd imagine that this is on the more difficult end for implementation, so literally just asking if it's possible. 

The other potentially interesting graphics hack - which would be a lot easier (I think) - is to give a better view of lower z-levels.  This is mostly laid out in suggestion #35, to display the layers below open space with some sort of fog or darkening effect to distinguish depth (I'd imagine fog is more compatible with lighting, if people want both at once).  There are plenty of mockups of this and similar ideas, so:

Thoughts?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on August 03, 2013, 11:40:42 pm
I dont think so... even if you manage to read out whats on the lower levels and overlay it graphically to show something akin to the screenshot you posted, even then the DF interface wouldnt recognize it. So you can see the trees on Z3 while on Z5, but you cant designate them for cutting... it would be purely graphical, like Stonesense. At least thats my understanding of it.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: PeridexisErrant on August 04, 2013, 12:00:23 am
If you manage to read out what's on the lower levels and overlay it graphically to show something akin to the screenshot you posted, the DF interface wouldn't recognize it. So you can see the trees on Z3 while on Z5, but you cant designate them for cutting... it would be purely graphical, like Stonesense.

Yes, this is intended to make DF pretty and nothing else. 

I would expect it to act as a replacement for the usual dots on z-1 and blank below that- interaction editing is pretty clearly beyond scope and introduces a whole consistency problem with controls to the point I'd want to disable it.  Maybe have a thick fog layer over the first layer down, and thinner subsequently to make the distinction between the 'active' level and 'visible' levels? 

Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on August 04, 2013, 12:44:01 am
I'd say lets wait for warmist to finish rendermax and the lighting first. ;)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on August 04, 2013, 02:50:43 am
I'd say lets wait for warmist to finish rendermax and the lighting first. ;)
Actually I am already working on that. I needed an offscreen renderer (i.e. a renderer that allows to draw anything from anyplace in a map) for mutiplayer. But that combined with rendermax can work to make a multilevel view.
Of course as everything done by me it's not finished and i'm going for a vacation ;D
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: PeridexisErrant on August 04, 2013, 02:57:59 am
So... The multilevel view is possible and might even happen (!!!), and no news yet on full graphics?  Sounds pretty good to me. 
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Putnam on August 04, 2013, 03:04:33 am
offscreen renderer (i.e. a renderer that allows to draw anything from anyplace in a map) for mutiplayer.

what
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on August 04, 2013, 04:04:33 am
So... The multilevel view is possible and might even happen (!!!), and no news yet on full graphics?  Sounds pretty good to me.
Same thing can also be used for full graphics support (when you are drawing everything yourself you can draw it anyway you wish). Though currently it does not do a lot of stuff: no blinking stuff, incorrect lower level drawing, grasses might be incorrect, no item drawing. Basically this:
 album here  (http://imgur.com/a/B33L4)
As you can see the view in some places is better in others it's worse. The draw order might be broken too... So the idea is it needs a tons of work until it's nice and ready for usage.
As for multiplayer itself- currently it only tracks individual units from your fort. I'm thinking of allowing players to control them in some way. Other mode would be to control fort by multiple players, but that would need me to implement more drawing stuff and each and every workshop menu etc... Not sure how hard that would be.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Greendogo on August 04, 2013, 09:12:49 am
I really like this idea.  It's way better than the void of nothingness that we get with Vanilla Dwarf Fortress.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Mayama on August 04, 2013, 09:48:23 am
I really like this idea.  It's way better than the void of nothingness that we get with Vanilla Dwarf Fortress.

yeah thats really the best mockup
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Isher on August 05, 2013, 02:49:38 pm
If the layers are few and very transparent, then you get to the point that you can make each square incrementally larger and stack them for a sortof pseudo-3d, or 2.5d if you will. This would come with its own drawbacks of course, but it would mean you could see a multi-level tree or staircase, though it would be shown in sections and would not appear to have sides when seen from 5 squares or more away. I've been musing to myself about this for a while.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: PeridexisErrant on August 05, 2013, 07:26:14 pm
This was also proposed in the depth by darkening/fog (http://www.bay12forums.com/smf/index.php?topic=30114.0) thread, which I should have linked to before.  See also the thread for full graphics support (http://www.bay12forums.com/smf/index.php?topic=41266.0).  There was even a FotF where Toady discussed depth-viewing issues (http://www.bay12forums.com/smf/index.php?topic=1788.msg27992#msg27992)... in 2007.


While I think it's a neat idea, I'd guess that it would be enough work to eg get the offsets and scaling right that we'd be better off putting the same work into a simpler fog effect and then later on full graphics. 
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Isher on August 06, 2013, 08:45:51 am
This was also proposed in the depth by darkening/fog (http://www.bay12forums.com/smf/index.php?topic=30114.0) thread, which I should have linked to before.  See also the thread for full graphics support (http://www.bay12forums.com/smf/index.php?topic=41266.0).  There was even a FotF where Toady discussed depth-viewing issues (http://www.bay12forums.com/smf/index.php?topic=1788.msg27992#msg27992)... in 2007.


While I think it's a neat idea, I'd guess that it would be enough work to eg get the offsets and scaling right that we'd be better off putting the same work into a simpler fog effect and then later on full graphics.

Good mockup. Unless there are any better ones I might try to get a real mockup using layers some time this week. I have a template from one I did in edge animate (not for DF) a while back for my own purposes, and it's crappy but it'll show a few layers stacked w/ transparency so I'll try pulling some layers from a fortress to display.

Seeing how good or bad it displays may tell us how much more work would be involved other than just getting layers stacked.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: LordBistian on August 12, 2013, 03:58:12 pm
What I was going to suggest has been suggested already it appears... Items in buildings/workshops... and potentially Creatures emitting light. Perhaps there could be a flag on buildings or creatures to check it for the first item that could potentially emit light and set that light for the entire building, which would work really well for the oil lamp building as suggested. Maybe a building should, if it could, distinguish a material it was built with from an item currently inside it though.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on August 12, 2013, 04:10:17 pm
What I was going to suggest has been suggested already it appears... Items in buildings/workshops... and potentially Creatures emitting light. Perhaps there could be a flag on buildings or creatures to check it for the first item that could potentially emit light and set that light for the entire building, which would work really well for the oil lamp building as suggested. Maybe a building should, if it could, distinguish a material it was built with from an item currently inside it though.
It already does that to some extent (this being only the first material matters? or sth... dunno it should work same as pumps get their material: from blocks?)

This was also proposed in the depth by darkening/fog (http://www.bay12forums.com/smf/index.php?topic=30114.0) thread, which I should have linked to before.  See also the thread for full graphics support (http://www.bay12forums.com/smf/index.php?topic=41266.0).  There was even a FotF where Toady discussed depth-viewing issues (http://www.bay12forums.com/smf/index.php?topic=1788.msg27992#msg27992)... in 2007.
<2.5 idea>
unfortunately, if nobody does it, it's outside of my interests (meaning i might do it some day, but not someday soon). The main problem being: this would need rewriting renderer that is quite big and uses either sdl or opengl. Although source code for them exist (the only part of df that is opensource) it's very complicated and i would like to avoid messing too much with that (same idea with 2d modes not working with rendermax).
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: DVNO on August 20, 2013, 05:30:30 pm
Quote
[DFHack]# rendermax light
Sorry, this plugin needs open gl enabled printmode. Try STANDARD or non-2d
[DFHack]#

.___.

Okay, so how do I enable open gl printmode? What did I do wrong?

EDIT:

nvm, got it.

To anyone else who gets this error: DFHack is talking about the [PRINT_MODE:] variable in the init. The init is a text file in Dwarf Fortress/data/init/
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on August 27, 2013, 01:59:31 am
Just wanted to let you know that I am still working on my mod for this. I got it down to disposable torches that are used as buildmats, and then rot away and deconstruct the workshop, leaving nothing. So a dwarf can build a torch-workshop, 1x1 tiles, which gives light for a few ingame weeks before it disappears. :)

I also made a Chandler's Workshop which will make candles and candelabras which burn indefinetly. So people can get cheap, early, but time-restricted light from wood/coke, but need a bit of tech till they can build relyable lightsources.

Special gems from either Alchemy or Magic will supplement this, with a Glowing Orb or something similar. I might also do Oil Lamps, but I dont know yet how to simulate that.

Do items made of a specific materials give light? Because I could make an item "light" which is not stockpileable (and thus, more or less unmoveable) which is generated in these workshops and then rots away after a while. People could still dump it, but thats about the only way I can think of to move it on purpose.

It would work like this: Build Oil Lamp, needs Oil Lamp Tool. Run reaction "Light Oil Lamp", needs oil and a tinderbox. Oil is used up, tinderbox is preserved. Reaction produces item "light" which stays in the workshop till it rots away, generating light in the meantime.

EDIT: Tested, works:
(http://i.imgur.com/rPtKzgR.png)

I can even make it give of miasma, to simulate stench/smoke from cheap fuels.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Kuikka on August 31, 2013, 08:50:33 am
Very interesting mod, kudos for carrying the torch from the point where nop dropped it. I love everything that adds more immersion to DF (atmospheric sounds, nice tileset, 3D visualizer). Dwarves are treated as subterranean race which doesnt love/need light but it certainly looks cool to have shadows and light.

Hopefully there'll be a day when torches can be placed to walls, idle dwarfes could replace them as daily "chores" (like cleaning etc) and certain enemies/beasts would extinguish light when they move pass the source of light.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 21, 2013, 12:51:56 pm
Hey,

I started testing. I cant get buildings to work at all so far, as well as creatures. the example lists CREATURE:DRAGON:BLOOD, which is only its blood? What to add to make the creature itself glow?

An example for a building would be nice. I tried Workshop:Chandler's Workshop and Furnace:Brazier, and it recognizes these as valid buildings, but they dont generate light ingame.

Another thing I noticed it this:
2D mode enables TTF.
STANDARD enables Rendermax, but no TTF.

Is there no way to have both Rendermax and TrueType active at the same time?

EDIT: Update:
Furniture and vanilla workshop (Workshop:Masons) works, but custom ones seemingly dont.
It looks very, very pretty.
It hurts FPS quite a bit, depending on the forts activities.
I cant take screenshots (only get black when I paste into paint/photoshop) for some reason. OpenGL related?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Boltgun on September 21, 2013, 01:49:40 pm
I like using the plugin, there is a lot of potential with weather effects and other mods, but any chance to see it compiled for linux?

About ttf in openGL, I guess it requires someone to write it in...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 21, 2013, 01:54:26 pm
Further testing:
Putting DF from fullscreen into windowed mode creates some pretty funky effects. Changing it back to fullscreen crashes the game. (Just when I had magma, adamatine, glowing statues and a warpstone on one screen, argh)
Inorganics only glow when unmined. For example adamantine glows, but adamantine ore or bars or items do not.

I got nice results in fort mode with 0.1 for day/night cycle. :) My caverns look pretty rad, and the mining as well. Cant get creatures (glowfrog for example, or fireflies) to work, neither the custom workshops. And the ttf is killing me. On the one hand Rendermax looks awesome, on the other hand not having TTF cuts of lots of custom reaction names. -.-
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Etherdrinker on September 21, 2013, 04:04:11 pm
Sounds and look pretty neat, but...  I can´t imagine the FPS killer you are crafting here!!! 

(nope I don´t have a crappy machine, not godly, but not crappy)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 21, 2013, 05:06:56 pm
Then dont use it, it will be optional. You can even enable/disable it on the fly, so play with it in a small fort, but when it gets too big, disable it for a nice fps boost. I can embark with a solid 150 FPS even while running Rendermax.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on September 22, 2013, 03:08:19 am
Sounds and look pretty neat, but...  I can´t imagine the FPS killer you are crafting here!!! 

(nope I don´t have a crappy machine, not godly, but not crappy)
Actually the funny thing is it takes away from your "graphical fps" not the "game fps" because it only performs work on drawing part of the game cycle and most forts have low "game fps" because the game complexity increases, but not the drawing of it.

TTF+opengl: unfortunately baugh did not implement that
Screenshots: probably broken opengl drivers (works fine for me)
Custom workshops: it has strange order: "addBuilding("Workshop:Custom:SCREW_PRESS",{1,1,1},{1,1,1},5)"
Creatures and items are not implemented: fireflies are items, and creatures are not implemented at all (but their blood/pus/gas/etc are). Only citizens are added.
Crashes on resize/disable : yeah i'm a crappy coder, something with multithreading maybe? Dunno, been hunting this one for a while.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 22, 2013, 03:37:11 am
Ok, that sorts most of the problems. Saying: Dont window the game and chose between TTF or Light is easy enough, even if TTF is a pretty big deal when your tileset abuses the letter-tiles all the time and TTF just looks odd with it. ^^


Custom workshops: it has strange order: "addBuilding("Workshop:Custom:SCREW_PRESS",{1,1,1},{1,1,1},5)" => Nice, I'll try it out asap. So its Workshop/Furnace:Custom:BUILDING_ID. :) Why the two sets of colors? I saw that several times already, didnt quite figure out what for.

Creatures are not implemented: Thats sad... but I could do a "Glowling" which has a secretion on its skin that emits light, correct?  Would be the same as a glowing creature.

Items are not implemenented: Thats a lot more problematic. I had this system set up where you spawn a rotting plant which withers away, called Fire or Torch. So you go to a Torchbearer Statue, add a torch and it spawns a unstockpileable "Lit Torch" which gives light, after 10 days it withers, still giving light, and after 20 days it is completely gone... That should have been the lightsource in my Candlemaking and Torchmaking industry. I guess I can just use it as a buildmat, and the custom building will do all the work. Just have to rebalance some stuff then.

Can you think of any way to make light by reactions? I had a magical orb/gem planned that allows color changing. "touch the orb and turn it red" for example... but if items dont glow, I wouldnt know how to do that.

So in the end its fucking amazing, and most of these minor issues I can work around, but the TTF not being available is really bad. Is Baugh still active?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on September 22, 2013, 04:08:33 am
Two sets of colors are: occlusion and then emittance. Meaning: how much does it block/absorb other rays (including e.g. it not allowing only blue light) and the other one how much it glows.

I'm currently implementing both creatures and items (they might be a bit too much processor intensive).

Lights by reaction: i'm not sure how that will go. Probably making an item which somehow fades away (??)

About Baugh: i think Toady One mentioned that he disappeared somewhere. Theoretically somebody else could implement it just as well. I can even point to the line where it needs to be put.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: CLA on September 22, 2013, 04:18:37 am
I just noticed that displaying multiple layers at once is being discussed, so I figured I'd post a mockup with a solid ground tileset I did some time ago for reference.

Spoiler (click to show/hide)

I think these work better than with punctuation.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 22, 2013, 05:09:34 am
I wrote Baughn. He hasnt been here in 6 months though. I'll wait a bit, if I get no answer, I write Toady.

Lights by reaction: i'm not sure how that will go. Probably making an item which somehow fades away (??) => That is exactly what I am doing atm, just that items dont glow yet. ;)

If you say it would be more processor heavy, does that mean "IF a ton of items are around", or just by default. Would the script check every item for possible glow or not? Because if it hurts FPS/GPS I'd rather work around the issue using buildings instead of items. Same for creatures, its not a big deal, although fireflies in the caverns would look pretty neat. ;)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on September 22, 2013, 05:34:12 am
It's not as bad as i though. It only checks for items in current 16x16 visible blocks. Also it will skip checks if no item lights are defined.

Edit: nope, all in_play items need to be checked...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 22, 2013, 06:29:42 am
Can you do a "rendermax light noitem" and "rendermax light item" version ? I am sure people will appreciate not using the full processor capacity for a feature I can work around. ;) Or do no items... I dont know. I dont know how big the impact is, but with old forts and 10,000 items lying around its probably quite significant.

EDIT: Just a heads up, Baughn did write me.
Quote
It's absolutely possible, I just haven't gotten around to doing so.
So yeah, TTF and OpenGL together is possible. :) Warmist, if you want to have a chat with him, you can get in touch on IRC, on Rizon or Freenode. Nickname Baughn.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 23, 2013, 04:48:51 pm
I tried making all gems glow in their color, but I guess addMaterial("INORGANIC:GEM_ID",{useMaterial},{useMaterial},5) doesnt work? Do I need to manually fit the hue of the light to the color of the gem?

All the rest is working fine. My UI now includes a button to toggle Rendermax on and off... I just wish I could make screenshots. ^^

EDIT: Actually, I cant get gems to glow at all. Metal veins, yes. Gems clusters, no.

The custom workshops do glow now, with the one upper-left tile giving light. Dont know if thats intended or not. Its fine for my 1x1 workshops that should give light, but I thought about adding a little bit of light to all workshops/furnaces, and it does look odd on the larger ones, like 11x11. ^^
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Clatch on September 24, 2013, 12:12:11 am
I'm not really familiar with the technology around this project.  The light showing through the different colors of glass in the demo looks absolutely amazing.  Is there any chance this could be packaged into a Mac .so instead of a Windows .dll?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on September 24, 2013, 12:32:37 am
I tried making all gems glow in their color, but I guess addMaterial("INORGANIC:GEM_ID",{useMaterial},{useMaterial},5) doesnt work? Do I need to manually fit the hue of the light to the color of the gem?

All the rest is working fine. My UI now includes a button to toggle Rendermax on and off... I just wish I could make screenshots. ^^

EDIT: Actually, I cant get gems to glow at all. Metal veins, yes. Gems clusters, no.

The custom workshops do glow now, with the one upper-left tile giving light. Dont know if thats intended or not. Its fine for my 1x1 workshops that should give light, but I thought about adding a little bit of light to all workshops/furnaces, and it does look odd on the larger ones, like 11x11. ^^
The gems are added as a list of them all by a function (was too lazy to list all gems out so made a function), you can overwrite any one of them.
(http://i.imgur.com/Cyri3A5.png?1)
this shows a gem cluster coloring the light from cursor.
As for bigger workshops, it will be a pain to implement the "locations of lights in workshops". But it's planned some time in the future. Btw i have made a version that supports items and creatures, but haven't ported it back to r3 yet.

I'm not really familiar with the technology around this project.  The light showing through the different colors of glass in the demo looks absolutely amazing.  Is there any chance this could be packaged into a Mac .so instead of a Windows .dll?
If you find somebody with mac to build it.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Clatch on September 24, 2013, 01:03:38 am
If you find somebody with mac to build it.

Is the source public somewhere?  I don't mind giving it a shot if it's not dependent on windows libraries.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on September 24, 2013, 01:31:18 am
If you find somebody with mac to build it.

Is the source public somewhere?  I don't mind giving it a shot if it's not dependent on windows libraries.
Source is public as of all dfhack. Though i think there was some mac specific build problems but if you are willing to try it, you will need:
or if you are selfish:
Just build this (https://github.com/warmist/dfhack/tree/master). But then resulting .so will not be sharable as will be built against newer then r3 dfhack. Also visit dfhack thread (and irc) if you need any help building.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 24, 2013, 04:12:49 am
I noticed that gems let light through, but I wanted to make them emit light. Cant find that in the files.

For workshops, using the "work-tile" would be fine. :)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on September 24, 2013, 04:38:15 am
I noticed that gems let light through, but I wanted to make them emit light. Cant find that in the files.

For workshops, using the "work-tile" would be fine. :)
The syntax is:
Code: [Select]
addMaterial(<token>,<absorb color>,<emit color>,<range>)
here: <token> is something from raws. <absorb color>/<emit color> is in form {value,value,value} where value is any number, range is either -1 (meaning auto calculate range) or some integer (afair).
also adding gems MUST happen after this line: https://github.com/warmist/dfhack/blob/master/plugins/rendermax/rendermax.lua#L209
if not they will be overwritten.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 24, 2013, 04:49:20 am
addgems ("INORGANIC:DIAMOND",{0.6,0.6,0.6},{0.6,0.6,0.6},5) is ok?
 OR
addMaterial("INORGANIC:DIAMOND",{0.6,0.6,0.6},{0.6,0.6,0.6},5), which I used so far, but didnt work... but I can try in that different location you posted.

BTW, you example shows ADAMANTINE, which is the metal... did you mean RAW_ADAMANTINE, which is the mineral vein?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on September 24, 2013, 05:14:19 am
addgems ("INORGANIC:DIAMOND",{0.6,0.6,0.6},{0.6,0.6,0.6},5) is ok?
 OR
addMaterial("INORGANIC:DIAMOND",{0.6,0.6,0.6},{0.6,0.6,0.6},5), which I used so far, but didnt work... but I can try in that different location you posted.

BTW, you example shows ADAMANTINE, which is the metal... did you mean RAW_ADAMANTINE, which is the mineral vein?
addMaterial thing. Also yes, that probably needs to be ALSO RAW_ADAMANTINE, because i wanted both stuff from adamantine and veins to be a bit glowy.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Clatch on September 25, 2013, 02:11:43 pm
Source is public as of all dfhack.

Thanks! I've been slammed with work this week, but I plan on messing around with the build this weekend.  I'll let you know how it turns out.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Clatch on September 25, 2013, 10:11:11 pm
OMG this plugin is amazing!  Dwarf Fortress just took Brogue out for dinner. :P

This link includes a compiled version for Mac using universal so it should run on most systems.
https://anonfiles.com/file/1b25f461a52c99a787ed8e0ea9c52615 (https://anonfiles.com/file/1b25f461a52c99a787ed8e0ea9c52615)

Check out the sweetness on the Oblivion tile set.

(http://s8.postimg.org/pqhqg6x9h/rendermax_using_oblivion.png)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 25, 2013, 10:42:26 pm
Yep, its pretty sweet. I have to try and get some screenshots again.

Spoiler: 8 screens (click to show/hide)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Boltgun on September 26, 2013, 02:40:43 am
I started working on a config that generously light up the fort and use statues as light sources:
https://gist.github.com/Devduweb/6659504

I also added a sunset and twilight in the day cycle.

Anyway I love the plugin this made me design my latest fort with decorations in mind.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on September 26, 2013, 03:28:36 am
Btw i have a version that has both item and creature lights:  here  (https://github.com/warmist/dfhack/commit/a6ae10eaa823e4b0ba827c88da7ebd709b788874) But it's still untested and not sure how to implement (in a fast way) the item flags. Namely these ones  are all the same:haul,equiped,inBuilding,inContainer. OnGround and useMaterial should work (haven't tested it yet)...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: fricy on September 26, 2013, 09:16:12 am
OMG this plugin is amazing!  Dwarf Fortress just took Brogue out for dinner. :P
This link includes a compiled version for Mac using universal so it should run on most systems.
https://anonfiles.com/file/1b25f461a52c99a787ed8e0ea9c52615 (https://anonfiles.com/file/1b25f461a52c99a787ed8e0ea9c52615)

It's ALIVE!!! :) Sort of. Performance is not ready for prime time though: my test fort with 120 average FPS went to around 40 on daytime, and 10 at night. Still, it looks awesome.

About Baugh: i think Toady One mentioned that he disappeared somewhere. Theoretically somebody else could implement it just as well. I can even point to the line where it needs to be put.

http://www.bay12forums.com/smf/index.php?topic=94528.0
Theoretically this new renderer should work better than Baugh's version, IF Toady decides to support it... AFAIK OpenGL and TTF is implemented, problem is it's only working on linux at the moment. :(
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 26, 2013, 10:27:15 am
The Internet-Install-Guy is coming by tomorrow, then I can move away from this netbook and run my real PC again... I'll check IRC and try to find Baughn and see what he can come up with, concerning the OpenGl vs. TTF issue.

Boltgun: Can I merge the first lines from your build into mine, with the different colors for sunrise and sunset?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Boltgun on September 26, 2013, 10:40:02 am
The Internet-Install-Guy is coming by tomorrow, then I can move away from this netbook and run my real PC again... I'll check IRC and try to find Baughn and see what he can come up with, concerning the OpenGl vs. TTF issue.

Boltgun: Can I merge the first lines from your build into mine, with the different colors for sunrise and sunset?

Sure, use any part you want.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 27, 2013, 04:11:14 pm
Warmist, the game always crashes when you window it... if you cant fix this, why dont you add a hotkey that disables rendermax when people press F11? It would eliminate that problem.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on September 28, 2013, 01:23:03 am
Warmist, the game always crashes when you window it... if you cant fix this, why dont you add a hotkey that disables rendermax when people press F11? It would eliminate that problem.
It crashes when you disable it. There is rendermax disable. You can bind it to anything.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on September 28, 2013, 04:02:10 am
wait, it even crashes when I enter "rendermax disable" and the go into window mode and back to fullscreen? I have to test that.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Clatch on September 30, 2013, 02:09:05 am
http://www.bay12forums.com/smf/index.php?topic=94528.0
Theoretically this new renderer should work better than Baugh's version, IF Toady decides to support it... AFAIK OpenGL and TTF is implemented, problem is it's only working on linux at the moment. :(

Yeah, I was wondering why F12 quit on me.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Boltgun on October 02, 2013, 02:34:31 am
I failed to build the plugin on linux so far. After fetching 32 bit libraries (and busting my video driver and unity for some reason), I got the latest dfhack release to compile but not for the plugin itself.

I will try again with the master branch of dfhack  and see if this improve. If not, I'll post the log.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Deon on October 15, 2013, 08:41:39 am
This is amazing.

However this:
Code: [Select]
addMaterial("PLANT:bitterroot",nil,{0.4,0.4,0.1},2)
addMaterial("PLANT:cave wheat",nil,{0.3,0.3,0.3},2)
addMaterial("PLANT:dimple cup",nil,{0.1,0.1,0.4},2)
addMaterial("PLANT:fly-agaric",nil,{0.4,0.1,0.1},2)
addMaterial("PLANT:gnome moss",nil,{0.1,0.4,0.1},2)
addMaterial("PLANT:plump helmet",nil,{0.4,0.1,0.4},2)
addMaterial("PLANT:shadowleaf",nil,{0.2,0.2,0.5},2)
addMaterial("PLANT:silkweed",nil,{0.5,0.5,0.5},2)
addMaterial("PLANT:sweet pod",nil,{0.4,0.1,0.1},2)
addMaterial("PLANT:blood boil",nil,{0.4,0.1,0.1},2)
addMaterial("PLANT:glowberry",nil,{0.9,0.9,0.1},4)
addMaterial("PLANT:glowstring",nil,{0.2,0.4,0.4},3)
addMaterial("PLANT:mossberry",nil,{0.1,0.4,0.1},2)
addMaterial("PLANT:purple stalk",nil,{0.4,0.1,0.4},2)
addMaterial("PLANT:crystal cane",nil,{0.1,0.7,0.7},2)
addMaterial("PLANT:quarry bush",nil,{0.3,0.3,0.3},2)
addMaterial("PLANT:rock melon",nil,{0.1,0.3,0.3},2)
addMaterial("PLANT:shard thorn",nil,{0.5,0.5,0.7},2)
addMaterial("PLANT:starapple",nil,{0.4,0.6,0.8},3)
addMaterial("PLANT:stone root",nil,{0.5,0.5,0.7},2)
addMaterial("PLANT:FUNGIWOOD",nil,{0.5,0.5,0.1},5)
does not make plants and fungiwood to glow.



Warmist, the game always crashes when you window it... if you cant fix this, why dont you add a hotkey that disables rendermax when people press F11? It would eliminate that problem.
It crashes when you disable it. There is rendermax disable. You can bind it to anything.
Strange, it does not crash for me when I disable it. However resizing game window makes the game stuck.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on October 15, 2013, 08:47:41 am
Doesnt crash for me either.

Its because you use "nil". Your plants emit no light, because you tell them to emit no light, but let other light through. Did you copy from glass/gems?

Try: addMaterial("PLANT:bitterroot",{0.4,0.4,0.1},{0.4,0.4,0.1},2)

The 2 is very low btw, for cavern plants I use a lot more.   
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Deon on October 15, 2013, 08:59:43 am
I see! I did not understand the syntax fully (or rather did not read into it)! Yeah, I thought glass was going to glow for some reason. Now I see that it makes sense that the light just passes through. Thank you!
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: cango on October 15, 2013, 09:06:28 am
I am using a not-that-bad laptop but still can't use STANDARD. No OpenGL. Any way to take care of this problem?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on October 15, 2013, 09:10:06 am
cango: No, it needs opengl.

deon: the first value is the light it emits, the second value is the light it lets through. so in your example it was nothing to emit, and some blueish color that is added to light that passes it. That way you can shine white light at a blue gem-window, and the resulting color behind it will be blue.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: cango on October 15, 2013, 03:24:23 pm
Meph, thanks, but obviously my card supports OpenGL so all I had to do was disable creature sprites and it worked fine :) Messing around with settings (and your card settings too maybe) solves the problem. Also everytime you press something in the same column with the Printmode, the settings.exe changes the ini.txt and sets the printmode into something else other than STANDART. So one should remember to edit the printmode in the ini after fiddling with the options in the settings.exe.

But this plugin is truly amazing..
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on October 15, 2013, 05:54:29 pm
Quote
Also everytime you press something in the same column with the Printmode, the settings.exe changes the ini.txt and sets the printmode into something else other than STANDART.
Actually that should only happen when you change the tileset, since it replaces the entire init with a new one. All the other settings just toggle values inside the file and shouldnt interfere with the print mode.

Still, no TTF is a big problem, at least for me. I have so many long reaction names, which are perfectly fine with TTF, but get cut off without it.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Deon on October 16, 2013, 12:41:43 am
Would it be possible to make specific creatures emit light? Namely an option to do so with LIGHT_GEN creatures.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on October 16, 2013, 01:24:21 am
current version only accepts creatur mats, so you can do blood or a secretion that covers the creatur. But warmist mentioned a version that supports both creatures and itmems... the drawback is that it is a lot slower then the current build.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on October 16, 2013, 02:11:50 am
current version only accepts creatur mats, so you can do blood or a secretion that covers the creatur. But warmist mentioned a version that supports both creatures and itmems... the drawback is that it is a lot slower then the current build.
I haven't noticed big slowdown. But my pc is quite a monster :P
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Vhorthex on November 07, 2013, 10:18:43 pm
Oh god, I've never been torn this much over usability and a 'mod' ever before. Truly wish by some miracle of the gaming gods that it'd be possible to have this mind blowing light plugin work with TTF!

Did not notice how much I had gotten used to them!

But man, does that lighting ever change the mood of your fort!
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Urist McTeellox on November 17, 2013, 09:26:50 pm
Hey fabulous people!

I'm in the process of integrating (http://www.bay12forums.com/smf/index.php?topic=133174.0) DFHack (http://dffd.wimbli.com/file.php?id=8068) r4 into Masterwork (mod).

I'm wondering if there's a DFHack r4 binary-compatible rendermax plug-in that I can download? That would make my integration live much easier. :)

~ T
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on November 22, 2013, 07:48:36 am
Waiting for official r4 release mostly
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on November 22, 2013, 04:03:25 pm
Same here. I"ll wait, before I start with r4.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on December 27, 2013, 12:35:11 pm
Sorry for the double post, just wanted to give this a bump. MDF has now been released with r4, and Rendermax is the last plugin/utility that needs to be updated. So... no pressure. :P
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on December 27, 2013, 12:58:16 pm
i'll try to figure out which version is that. I'm a bit confused about current dfhack versioning. I'll try to merge in the rendermax so it would be released with dfhack.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on December 27, 2013, 01:22:55 pm
I am basing everything on this:

Windows r4 link: http://dffd.wimbli.com/file.php?id=8068
Linux r4 link: http://dffd.wimbli.com/file.php?id=8067

New stuff: https://github.com/expwnent/dfhack/blob/0.34.11-r4/NEWS

Also forgot to put in that document: the eventful script now exposes EventManager events to lua scripts. See the lua documentation for details.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on December 30, 2013, 10:13:42 am
Um updated the plugin to r4. afair i added something from last version bug can't remember what...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on December 30, 2013, 05:02:04 pm
Thank you. I will add it asap. :)

I am not aware of any bugs in the last version, except for the "crash when window/resize".
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on December 30, 2013, 05:27:11 pm
Thank you. I will add it asap. :)

I am not aware of any bugs in the last version, except for the "crash when window/resize".
ah my nemesis. I'll think about adding light propagation in reverse direction (i.e. lava pits lighting from below) and maybe generalize the light in z direction (big spaces could be lit up by chandeliers hanging up above, could be hard/processor intensive). Currently what i don't like that the light falls off too fast imho. Maybe a hdr mode? Like having sunlight 1000 or something that big and simulating eyes getting saturated (no values over 1 displayed) and renormalized (like reading from lcd is impossible in sunlight, so lava would not appear to glow in sunlight)...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on December 30, 2013, 09:24:10 pm
Maybe make workshops glow either on every tile, or only on the work-tile, or on tile specified in the config. All tiles is probably easiest and works just fine.

I would really like to make forges and custom workshops glow a bit, but it looks odd if you have only the top-left corner glowing.

EDIT:
Quote
ret.items={}
ret.creatures={}
Oh... AWESOME :)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on December 31, 2013, 05:10:42 am
I remembered that items are a bit hard to detect when they are worn, etc... Was hoping to detect them with flags (and have 0 overhead) but apparently it uses one flag for everything. So currently it's just onGround or not on ground :)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on December 31, 2013, 05:17:38 am
Thats fine by me. I just wanted to have unstockpileable items called "fire" or "burning torch" anyway. They wither away, so after 2 weeks its "withered fire" and after 4 weeks its gone.

Same thing for my "gem of light". Its white light, and if you touch it, it generates a withering item of the wanted color. So dwarves have reactions like "turn gem yellow" or "turn gem red", and the item makes the fitting color. :)

At least thats the plan. I did write the raws at some point, but items were not supported... guess I have to go looking for them again.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on December 31, 2013, 05:31:04 am
Thats fine by me. I just wanted to have unstockpileable items called "fire" or "burning torch" anyway. They wither away, so after 2 weeks its "withered fire" and after 4 weeks its gone.

Same thing for my "gem of light". Its white light, and if you touch it, it generates a withering item of the wanted color. So dwarves have reactions like "turn gem yellow" or "turn gem red", and the item makes the fitting color. :)

At least thats the plan. I did write the raws at some point, but items were not supported... guess I have to go looking for them again.
Fill up the minecart with various coloured gem lights and make a minecart-shotgun :D
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on December 31, 2013, 05:55:29 am
So that I can puke rainbows at invaders?  :D
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on December 31, 2013, 06:53:24 am
So that I can puke rainbows at invaders?  :D
That too, also fireworks. Oh i just remembered that projectiles probably don't glow :/
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: The_Force on December 31, 2013, 09:57:57 am
I've discovered a bug, dwarves no longer give light after they have been to sleep.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: ThaMuzz on December 31, 2013, 10:36:48 am
Pertaining to buildings:
It would be nice to be able to spawn multiple lightsources on a building, with differing offsets to define where they are located.
I have not looked at the source yet, so I don't know how possible this would be.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on January 01, 2014, 06:13:24 am
I just got a error messages from Rendermax:

Invalid custom building:CHANDLER

First one is about this line: addBuilding("Workshop:Custom:CHANDLER",{1,1,1},{0.9,0.75,0.3},8)
The thing is, I do have a chandler in the raws. [BUILDING_WORKSHOP:CHANDLER]. The only source could be that it is not enabled in the entity I am currently playing. Is that the case? Does Rendermax read them out from the entity file, not the building files? That would mean I can only have buildings that glow, if I enable them for all races.

Could you give some examples for use of items? Does it only work with item type, like WEAPON:ITEM_WEAPON_TORCH, or can I also add material, like WEAPON:ITEM_WEAPON_TORCH:INORGANIC:FIRE_RED ?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on January 01, 2014, 06:24:30 am
first one: are you sure it's not "chandelier"?
Second one addItem should be item, e.g. PLANT. And then add flag "useMaterial" and add material as light emmitting. Though maybe i'll add some way to specify that just this item with this material glows...
Code: [Select]
addMaterial("PLANT:CATTAIL",{1,1,1},{1,1,1},4) -- this means that cattail structural material will glow.
addItem("PLANT",nil,nil,nil,{"useMaterial","onGround","hauling"}) --now plants will try to glow if they have material defined
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on January 01, 2014, 06:48:29 am
You are always so quick with the answer. :)

But addItem("PLANT",nil,nil,nil,{"useMaterial","onGround","hauling"}) means ALL plants. Not just the subtype I want, correct? Or would only the ones glow that I previously listed under "addMaterial" ?

I tried this:
Code: [Select]
addMaterial("PLANT:GLOW_RED",{1,0,0},{1,0,0},50)
addItem("PLANT",nil,nil,0,{"useMaterial","onGround"})

It shows no error message, so thats fine, but the created plants in the workshop do not glow. And my FPS hit rock bottom with <10. ^^
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on January 01, 2014, 06:52:43 am
try to dump the plane, "onGround" means only on ground. Also yes addItem will mean that ALL plants will look for material to glow
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Hommit on January 01, 2014, 05:11:57 pm
Currently what i don't like that the light falls off too fast imho. Maybe a hdr mode? Like having sunlight 1000 or something that big and simulating eyes getting saturated (no values over 1 displayed) and renormalized (like reading from lcd is impossible in sunlight, so lava would not appear to glow in sunlight)...
yeah. when i tried, basically, u have to place some light in every room corner and somehow (grated lava under floor) light up all corridors. too dark everywhere otherwise :(
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on January 01, 2014, 10:03:39 pm
Currently what i don't like that the light falls off too fast imho. Maybe a hdr mode? Like having sunlight 1000 or something that big and simulating eyes getting saturated (no values over 1 displayed) and renormalized (like reading from lcd is impossible in sunlight, so lava would not appear to glow in sunlight)...
yeah. when i tried, basically, u have to place some light in every room corner and somehow (grated lava under floor) light up all corridors. too dark everywhere otherwise :(
I'm a bit torn about this, my original idea was to add lights into df so that you would have reason to do magma piping and skylights (also that underwater forts would look cool, and colored lights...). So i'm not yet sure if it's enough to play with the variables (and add more light sources like meph does) or some more fancy logic is needed.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on January 01, 2014, 10:27:57 pm
I am ok with how much/little light there is. Surface looks fine, caverns look glorious, magmalake and hell look awesome, and the fort itself: Build custom workshops that make light. Thats the point. ^^
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Mirkrali on January 02, 2014, 10:39:47 pm
I really love the look of this plugin, but I'm having a little trouble with it. I'm running dfhack r3 (which I believe is the latest?) but when I try to run the game dfhack tells me that it could not load this plugin. I have absolutely no idea what I could have done wrong, or whether or not I'm missing something to get things to run. Any ideas?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on January 03, 2014, 12:17:05 am
Did you set your mode to STANDARD in the init?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Hommit on January 03, 2014, 06:05:37 am
and the fort itself: Build custom workshops that make light. Thats the point. ^^
Make them, then we build them :)  Not everyone have awesome modding skills like you ;)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on January 03, 2014, 06:37:22 am
But I already made some and put them into my mod. ^^ I would have released them for vanilla as well, but they dont have the graphics then, and I have no idea what type of ascii tiles I should use.

Here you go:

Code: [Select]
BRAZIER
[BUILDING_FURNACE:BRAZIER]
[NAME:Brazier]
[NAME_COLOR:7:0:1]
[WORK_LOCATION:1:1]
[BUILD_LABOR:ARCHITECT]:MASON]
[BUILD_KEY:CUSTOM_R]
[DIM:1:1]
[WORK_LOCATION:1:1]
[BLOCK:1:0]
[TILE:0:1:245]
[COLOR:0:1:0:0:0]
[TILE:1:1:32]
[COLOR:1:1:0:0:0]
[TILE:2:1:32]
[COLOR:2:1:0:0:0]
[TILE:3:1:245]
[COLOR:3:1:7:0:0]
[BUILD_ITEM:1:BOULDER:NONE:NONE:NONE]

chandelier
[BUILDING_FURNACE:CHANDELIER]
[NAME:Candelabra]
[NAME_COLOR:7:0:1]
[WORK_LOCATION:1:1]
[BUILD_LABOR:ARCHITECT]:MASON]
[BUILD_KEY:CUSTOM_X]
[DIM:1:1]
[WORK_LOCATION:1:1]
[BLOCK:1:0]
[TILE:0:1:145]
[COLOR:0:1:7:0:0]
[TILE:1:1:96]
[COLOR:1:1:7:0:0]
[TILE:2:1:96]
[COLOR:2:1:7:0:0]
[TILE:3:1:145]
[COLOR:3:1:7:7:1]
[BUILD_ITEM:1:BOULDER:NONE:NONE:NONE]


[BUILDING_FURNACE:FIREPLACE]
[NAME:Fireplace]
[NAME_COLOR:7:0:1]
[BUILD_LABOR:ARCHITECT]:MASON]
[BUILD_KEY:CUSTOM_Z]
[DIM:1:1]
[WORK_LOCATION:1:1]
[BLOCK:1:0]
[TILE:0:1:216]
[COLOR:0:1:7:0:0]
[TILE:1:1:249]
[COLOR:1:1:7:0:1]
[TILE:2:1:135]
[COLOR:2:1:7:0:1]
[TILE:3:1:216]
[COLOR:3:1:7:7:1]
[BUILD_ITEM:1:BOULDER:NONE:NONE:NONE]


[BUILDING_FURNACE:TORCHBEARER_STATUE]
[NAME:Torchbearer Statue]
[NAME_COLOR:7:0:1]
[BUILD_LABOR:ARCHITECT]:MASON]
[BUILD_KEY:CUSTOM_NONE]
[DIM:1:1]
[WORK_LOCATION:1:1]
[BLOCK:1:0]
[TILE:0:1:234]
[COLOR:0:1:7:4:1]
[TILE:1:1:234]
[COLOR:1:1:7:4:1]
[TILE:2:1:234]
[COLOR:2:1:7:4:1]
[TILE:3:1:234]
[COLOR:3:1:7:4:1]
[BUILD_ITEM:1:STATUE:NONE:NONE:NONE][CAN_USE_ARTIFACT]

[BUILDING_FURNACE:GLOWING_ORB]
[NAME:Gem of Light]
[NAME_COLOR:7:0:1]
[BUILD_LABOR:ARCHITECT]:MASON]
[BUILD_KEY:CUSTOM_NONE]
[DIM:1:1]
[WORK_LOCATION:1:1]
[BLOCK:1:0]
[TILE:0:1:4]
[COLOR:0:1:5:7:1]
[TILE:1:1:4]
[COLOR:1:1:5:7:1]
[TILE:2:1:4]
[COLOR:2:1:5:7:1]
[TILE:3:1:4]
[COLOR:3:1:5:7:1]
[BUILD_ITEM:1:GEM:NONE:NONE:NONE][CAN_USE_ARTIFACT]

And this goes into the rendermax.lua

Code: [Select]
addBuilding("Furnace:Custom:BRAZIER",{1,1,1},{0.9,0.75,0.3},12)
addBuilding("Furnace:Custom:TORCHBEARER_STATUE",{1,1,1},{0.8,0.1,0.1},20)
addBuilding("Furnace:Custom:CHANDELIER",{1,1,1},{0.9,0.65,0.2},35)
addBuilding("Furnace:Custom:FIREPLACE",{1,1,1},{0.7,0.45,0.3},5)
addBuilding("Furnace:Custom:GLOWING_ORB",{1,1,1},{1,1,1},50)

First three buildings cost only a boulder, because they use custom items in my mod, which dont exist in vanilla DF. I deleted that and replaced it with boulders.

You just need to enable them in the entity with PERMITTED_BUILDIN:building-id-here, and gen a new world.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Mirkrali on January 03, 2014, 12:51:39 pm
Did you set your mode to STANDARD in the init?

Did you mean print mode in the main DF init? I attempted this, but it still did not give me any results.

However, when running dfhack I get an error right before it tells me that it cant load the plugin:
"The procedure entry point ??0VMethodInterposeLinkBase@DFHack@@QAE@PAVvirtual_identity@1@HPAX1HPBD@Z could not be located in the dynamic link library SDL.dll."

I'm using what I think is the latest LNP (PeridexisErrant LNP), and that's it. I honestly have no idea what that error means or how to fix it.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on January 03, 2014, 12:57:19 pm
I think its because you are using dfhack r3, but downloaded rendermax for dfhack r4. (or the other way around)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Mirkrali on January 03, 2014, 12:58:38 pm
I think its because you are using dfhack r3, but downloaded rendermax for dfhack r4. (or the other way around)

Mmm, that's probably the problem then. I didn't know that dfhack had a version above it. Whoops!
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: CaptainArchmage on January 07, 2014, 09:17:14 pm
Does this plugin limit creatures' fields of vision in the dark or not?

Does it work on dfhack for Mac?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on January 08, 2014, 01:37:42 am
Does this plugin limit creatures' fields of vision in the dark or not?

Does it work on dfhack for Mac?
1. No, does not limit anything, just a visual thing.
2. It would if somebody would build it for mac.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: fricy on January 08, 2014, 04:54:39 am
Does it work on dfhack for Mac?
2. It would if somebody would build it for mac.

Here you go:

OMG this plugin is amazing!  Dwarf Fortress just took Brogue out for dinner. :P

This link includes a compiled version for Mac using universal so it should run on most systems.
https://anonfiles.com/file/1b25f461a52c99a787ed8e0ea9c52615 (https://anonfiles.com/file/1b25f461a52c99a787ed8e0ea9c52615)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: milo christiansen on January 13, 2014, 02:11:54 pm
Is there a r3 version?

I really don't want to require r4 until an "official" version is out and r4 is "done".
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: follower of nux on January 14, 2014, 04:00:43 pm
Hello there!

I have this particular problem in which fireplaces and braziers dont give off light after i light a fire in there although the sun cycles and dwarfs emit light alright.
rendermax, standard and no true type fonts.

Any ideas ?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on January 14, 2014, 04:57:28 pm
Hello there!

I have this particular problem in which fireplaces and braziers dont give off light after i light a fire in there although the sun cycles and dwarfs emit light alright.
rendermax, standard and no true type fonts.

Any ideas ?
Could you give me more info? It certainly sounds like a MasterworkDF specific question. Which tileset do you use, which OS, which Mod version ? (you can see the version number in the main menu). When you say "light a fire", is that the reaction that actually starts fires that spread?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Moridin920 on January 15, 2014, 04:56:52 am
Hey Meph I've got the same issue as the other poster, my dwarves give off light and the day/night cycle happens but when I build a brazier it doesn't give off light. It's got the regular light a fire reaction that starts an actual spreading fire.

I'm on Windows 7, version .4g of Masterwork, on the Spacefox tileset. Standard print mode.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on January 15, 2014, 04:59:04 am
Do the others work? Because I have this in my files: addBuilding("Furnace:Custom:BRAZIER",{1,1,1},{0.9,0.75,0.3},12) and it should work. Its just not a lot of light from the brazier.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: follower of nux on January 15, 2014, 12:28:34 pm
There is no light from the brazier, not just a little.
its 4.g, standard print with phoebus

oh, fireplaces dont work either.
trying to get statue of light from the embark and see if they work
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on January 26, 2014, 06:47:43 am
Improving rendermax lately: fixed that crash bug (probably) and added diffuse light (now it has option to have more rays (more cpu use)) produces nicer shadows:
comparison:  here  (http://imgur.com/AIJiApX,nvmOZBm#1)

Question: would it be better if workshop would glow from every tile?

Also tweaked a bit the advmode:
Spoiler (click to show/hide)
Now it respects the visible part of screen. Darkness level is set by levelDim, very low values tend to make the gui unreadable. Unfortunately i have no way to detect what is map what is screen.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on January 26, 2014, 08:42:43 am
Quote
would it be better if workshop would glow from every tile?
Yes. Otherwise large workshops look odd. Either every tile, every corner tile, or only the worktile, or preset tiles per workshop that can be done by hand. Whatever suits you most. ;)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: follower of nux on February 08, 2014, 12:14:35 am
Got an update on that bug.
I genned a new world to test rendermax in which it actually worked properly, i think.
Just building a brazier gives off light without having a fire started and the day-night transition was really slow and actually had an orange offset on dawn and dusk.

However, that was just a test world with a test embark so I genned another one anyway in which the console gave off an error and the day-night transition was really fast (every few seconds) and braziers stopped giving light. Errorcode is in attachment

nvm, i cant attach anything here it seems
anyway, the code looks like this:

rendermax.lua:25: Material not found
stack traceback:
            [C]: in function 'error'
            rendermax.lua:25: in function 'addMaterial'
            rendermax.lua:201: in main chunk


hope this helps >.< dont want to play without proper rendermax anymore

Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: follower of nux on February 08, 2014, 12:32:43 am
things are starting to clear up:
rendermax works perfectly off of a clean df install  (do you say it like that?)
i usually delete reactions_orc and reactions_kobold because i dont play those modes but maybe its related
also, the world gen tab in this masterwork settings gui doesnt save settings so i have to put things in manually in the advanced world gen

ill look after the bug again tomorrow
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Putnam on February 08, 2014, 12:57:52 am
That bug isn't a fault of Rendermax; it's Rendermax being given faulty input. Note that the error is "Material not found". This means that that line (25 of rendermax.lua) contains a material which does not exist in your current raws.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on February 08, 2014, 03:10:59 am
Line 25 is actually the line that says "Material not found". Its line 201 you want:

addMaterial("PLANT:CAVE MOSS",nil,{0.1,0.1,0.4},2)

Cave moss is a MDF specific grass, and can be toggled with one of the buttons, "Cavern Flavor", which makes the caverns look differently, by adding new grasses/plants.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: follower of nux on February 08, 2014, 05:43:01 am
ooh, funny thing tho.
after seeing cavern flavor in one of the screenshots i always disable it tho its given me an error message since a few versions (i think)
the error message from the settings gui:

Failed to save option!

Invalid/missing tokens:
YESSTANDARTCAVERN[

BUT the option remains ticked anyway and everything of rendermax still works after that.

now when i exit the settings gui and start it up again, cavern flavor is then actually disabled and when i try to enable it again it gives me a similar same error message:

Failed to save option!

Invalid/missing tokens:
!NOCAVERNFLAVOR!
YESSTANDARTCAVERN[

clicking it after that without restarting the settings gui then just cycles between those 2 errors. well, hope that helps fixing this other bug

thanks for the help, rendermax is so awsum ^.^

Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Freak2121 on February 09, 2014, 06:22:58 pm
Don't mean to sound impatient but any estimates as to when the next update will be? That screenshot of adventure mode is really exciting for me, it breathes some life into it.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 10, 2014, 02:13:12 am
Don't mean to sound impatient but any estimates as to when the next update will be? That screenshot of adventure mode is really exciting for me, it breathes some life into it.
Well i was thinking of waiting for new dfhack release. Not sure when that will happen. I'll try to compile a version myself (though windows only probably)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bo-Rufus CMVII on February 12, 2014, 12:29:15 am
Should I assume that the .dll means that this only works on Windows?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 12, 2014, 01:17:37 am
Should I assume that the .dll means that this only works on Windows?
Not quite, i think there was someone who built it on linux (that was for dfhack r3). I just don't have linux to build on.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bo-Rufus CMVII on February 12, 2014, 01:20:43 am
Is the source for that in the download?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 12, 2014, 01:59:15 am
Is the source for that in the download?
No it's in github with dfhack.
 source here  (https://github.com/warmist/dfhack/tree/dev-buildings/plugins/rendermax)
and then add a line in cmake: here (https://github.com/warmist/dfhack/blob/dev-buildings/plugins/CMakeLists.txt#L179)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bo-Rufus CMVII on February 13, 2014, 10:16:49 pm
I just gitcloned your whole fork of dfhack to build.  For future reference, would it work to just clone your stuff into the "vanilla dfhack" plugins/ directory and add the rendermax stuff to CMakeLists?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Nopenope on February 14, 2014, 12:18:26 am
Don't mean to sound impatient but any estimates as to when the next update will be? That screenshot of adventure mode is really exciting for me, it breathes some life into it.
Well i was thinking of waiting for new dfhack release. Not sure when that will happen. I'll try to compile a version myself (though windows only probably)

Are we sure there will ever be a new dfhack release, especially with a new DF release being months imminent?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: PeridexisErrant on February 14, 2014, 01:09:57 am
r4 is getting skipped, r5 is close. I don't know how the new version of DF would interrupt these plans, but I don't think it's likely to happen that soon.

Hello. I think it's time for a status update!

I'm not dead... yet :D

The past year, I've been busy with finishing university, getting a job, MultiMC5 (http://multimc.org/), having a job and MultiMC5 some more (http://multimc.org/). DFHack and any other related activities just went out of the window.

Anyway, today I've started making some changes.
  • DFHack and related projects are now under a github organization, with me, angavrilov and Quietust: https://github.com/DFHack - this should allow more people than just me to make releases.
  • Releases will be moved from my site (http://dethware.org/dfhack/download/) back to github (https://github.com/DFHack/dfhack/releases). I've already begun doing that.
  • Release 4 for 0.34.11 will be entirely skipped. I'm pretty sure I've done no builds of it, so they are all 'unofficial'. It's chaotic. I will salvage whatever changelog information I can from it and move on.
  • I will begin merging in changes and work towards Release 5. This might take a week or two, because I still have a job and a MultiMC5 to worry about ;)
  • I'm getting a Mac! So we might even have proper OSX support. If not in r5, then surely in r6.

I'll try to answer any PMs sent up to this point now.

Unless you think there's something in the many thread pages I'm skipping right now that I should *really* know about, I'll skip them. There's just too many to read :)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bo-Rufus CMVII on February 14, 2014, 07:38:55 am
I just gitcloned your whole fork of dfhack to build.  For future reference, would it work to just clone your stuff into the "vanilla dfhack" plugins/ directory and add the rendermax stuff to CMakeLists?
For the record...

I finally got peterix's dfhack to build with gcc 4.6 (notes posted in the r3 thread), put rendermax source in the plugins/ directory, and added the rendermax lines to CMakeLists.  To make it build I had to:

a) add 'class' after 'friend' in renderer_light.cpp

b) include cmath rather than math.h in renderer_opengl.hpp

However, I get several pages of warnings, some scary.  And it doesn't work: 'load rendermax' followed by 'rendermax light' doesn't do anything in the game, revvs up the CPU usage, and never returns to the dfhack prompt.

I may have to go back to playing on Windows... also can't get DT to work after a system upgrade.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 14, 2014, 07:42:44 am
I'll try to fire up my linux, and see it builds. Though it might have more success if based on r4. Also i'm currently trying to tidy up my repo for incoming changes/release of r5.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bo-Rufus CMVII on February 14, 2014, 01:02:14 pm
Is there a place where I can check out r4 or r5?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 14, 2014, 01:14:41 pm
Is there a place where I can check out r4 or r5?
r5 nope, r4 is https://github.com/expwnent/dfhack/tree/0.34.11-r4
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on February 15, 2014, 06:56:41 pm
Can rendermax be modified to add a hue to the game that fits the season? Something like a changed color scheme, but without the need to restart the game every time the season changes.

Happier, more saturated colors in spring, maybe some brighter slightly yellow summer, some greyish-reddishness in autumn, and cold-blueish in winter? It could add a lot more atmosphere. :)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 16, 2014, 07:33:34 am
Can rendermax be modified to add a hue to the game that fits the season? Something like a changed color scheme, but without the need to restart the game every time the season changes.

Happier, more saturated colors in spring, maybe some brighter slightly yellow summer, some greyish-reddishness in autumn, and cold-blueish in winter? It could add a lot more atmosphere. :)
You mean sun? yes it could be.

Also uploaded r4 version of rendermax for linux.
Edit: Updated r4 for windows too
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on February 16, 2014, 07:45:31 am
Sun? I dont mean day/night cycles, but I saw a suggestion by someone for vanilla DF that the color scheme should change between seasons to visually show the season a bit more. I know that wont work without restarting the game, but I thought Rendermax could simulate that. Just adding a cold hue for winter and a warm hue for summer for example.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 16, 2014, 07:48:11 am
Sun? I dont mean day/night cycles, but I saw a suggestion by someone for vanilla DF that the color scheme should change between seasons to visually show the season a bit more. I know that wont work without restarting the game, but I thought Rendermax could simulate that. Just adding a cold hue for winter and a warm hue for summer for example.
Yeah it's possible.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Freak2121 on February 16, 2014, 05:37:49 pm
Checked it out and it's great! It's just a shame advmode isn't functional. :(
Thanks for uploading it! :D
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 17, 2014, 12:13:43 am
Checked it out and it's great! It's just a shame advmode isn't functional. :(
Thanks for uploading it! :D
New version should have functioning advmode. Not sure what you meant by that.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Freak2121 on February 17, 2014, 12:24:56 am
Weird, enabling it freezes my display (though the game still takes inputs and the display refreshes on alt-tab) and then crashes after a short while.

Edit: It might be my DFHack, I'll try recompiling.
Even that isn't working now :(
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Freak2121 on February 17, 2014, 11:22:09 pm
Right, managed to get DFHack compiling. Still get the same issue. I'll go through everything I do, if that'll be any help.
(https://dl.dropboxusercontent.com/u/32146097/Dwarf%20Fortress%202014-02-17%2020-11-37-95.png)
I start up DF, it's normal.
(https://dl.dropboxusercontent.com/u/32146097/Dwarf%20Fortress%202014-02-17%2020-11-48-42.png)
I type "rendermax light" into DFHack
(https://dl.dropboxusercontent.com/u/32146097/Dwarf%20Fortress%202014-02-17%2020-12-26-15.png)
I type "rendermax lua" into DFHack, this usually makes the display refresh only on alt tabbing.
(https://dl.dropboxusercontent.com/u/32146097/Dwarf%20Fortress%202014-02-17%2020-12-39-89.png)
If I type "rendermax light" again, that happens.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 18, 2014, 12:23:28 am
Hmm should have removed that "rendermax lua" probably. It's not being worked on anymore. Try "rendermax trippy" or "rendermax truecolor" they are a simplest thing that you can check to see if it works at all. I think it works but it might have the settings wrong or something...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Freak2121 on February 18, 2014, 12:31:35 am
Still no adv-mode on either of those. I wonder what the issue is..
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bo-Rufus CMVII on February 20, 2014, 01:15:39 am
FYI, the link to the Linux version says I need permission to get it.

Also, when you say you uploaded r4, does that mean your entire dfhack r4, or just rendermax? (And in the latter case, cany you use it with dfhack r3?)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 20, 2014, 01:42:28 am
FYI, the link to the Linux version says I need permission to get it.

Also, when you say you uploaded r4, does that mean your entire dfhack r4, or just rendermax? (And in the latter case, cany you use it with dfhack r3?)
Just the rendermax. And you can't use it with r3.
Looking over the forums, it's quite hard to find r4 (especially linux build and mac-os might be non-existant). I'll see what i can do.

Edit: also fixed the permission thing.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Boltgun on February 20, 2014, 05:51:02 am
Just the rendermax. And you can't use it with r3.
Looking over the forums, it's quite hard to find r4 (especially linux build and mac-os might be non-existant). I'll see what i can do.

Edit: also fixed the permission thing.

Linux r4 is on dffd somewhere near the windows build, lethosor managed to build on r4 and it seems to work well on my barely-to-date mac here (http://www.bay12forums.com/smf/index.php?topic=91166.msg4876842;topicseen#msg4876842).

Looking at the recent commits, cross platform might be easier for r5.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 20, 2014, 06:01:46 am
Just the rendermax. And you can't use it with r3.
Looking over the forums, it's quite hard to find r4 (especially linux build and mac-os might be non-existant). I'll see what i can do.

Edit: also fixed the permission thing.

Linux r4 is on dffd somewhere near the windows build, lethosor managed to build on r4 and it seems to work well on my barely-to-date mac here (http://www.bay12forums.com/smf/index.php?topic=91166.msg4876842;topicseen#msg4876842).

Looking at the recent commits, cross platform might be easier for r5.
Also in irc peterix mentioned having mac now, so maybe even official mac builds will be possible.
Edit: here's some links:
 Linux dfhack-r4  (http://dffd.wimbli.com/file.php?id=8067)
 Windows dfhack-r4  (http://dffd.wimbli.com/file.php?id=8068)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: fricy on February 20, 2014, 06:11:16 am
(/snip) lethosor managed to build on r4 and it seems to work well on my barely-to-date mac here (http://www.bay12forums.com/smf/index.php?topic=91166.msg4876842;topicseen#msg4876842).
Looking at the recent commits, cross platform might be easier for r5.

Thx for the link, I somehow missed that. Kudos! Now off to do some testing.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bo-Rufus CMVII on February 20, 2014, 04:43:54 pm
Edit: here's some links:
 Linux dfhack-r4  (http://dffd.wimbli.com/file.php?id=8067)
 Windows dfhack-r4  (http://dffd.wimbli.com/file.php?id=8068)
Thanks.  For the record, the Linux kit doesn't extract properly (loses the internal directory structure), so you probably want to extract it on Windows and copy it over.

However, I'm getting into all kinds of library dependency issues.

I tried rendermax on Windows and it's gorgeous, but makes it pretty hard to see what you're doing.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Boltgun on February 21, 2014, 03:46:20 am
Edit: here's some links:
 Linux dfhack-r4  (http://dffd.wimbli.com/file.php?id=8067)
 Windows dfhack-r4  (http://dffd.wimbli.com/file.php?id=8068)
Thanks.  For the record, the Linux kit doesn't extract properly (loses the internal directory structure), so you probably want to extract it on Windows and copy it over.

However, I'm getting into all kinds of library dependency issues.

I tried rendermax on Windows and it's gorgeous, but makes it pretty hard to see what you're doing.

Deleting the offending library from df fixed it for me. I had it installed through apt.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Bo-Rufus CMVII on February 21, 2014, 09:16:12 am
Deleting the offending library from df fixed it for me. I had it installed through apt.
That gets me over one hump, but it also wants a newer libstdc++ than I find in the Ubuntu repository, and I'm reluctant to start jacking with my system libraries.  I can play on Windows for now.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: destroctor51 on February 25, 2014, 10:17:43 pm
Can I still download this for dfhack r3?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Askot Bokbondeler on March 03, 2014, 11:01:39 pm
Ptw
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: DrKillPatient on May 11, 2014, 05:41:24 pm
Wow; I just came across this and it looks amazing. Any chance we could get a version of the plugin for the Mac-native DFHack R3?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on May 11, 2014, 11:16:35 pm
Not likely, sorry. But it will be included in release of DFHack r5 :)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: PeridexisErrant on May 12, 2014, 12:07:10 am
Not likely, sorry. But it will be included in release of DFHack r5 :)

Dare I ask when r5 will be released?  I've been getting "soon (tm)" for months...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on May 12, 2014, 12:34:29 am
Not likely, sorry. But it will be included in release of DFHack r5 :)

Dare I ask when r5 will be released?  I've been getting "soon (tm)" for months...
Please annoy peterix so he will have to release it :) Usually he has more time in the weekends but this weekend only sort-of-like feature freeze happened (well at least lot of merging and tidying up before release). So it will be released very soon but in "valve time". ;)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: fricy on May 12, 2014, 02:45:52 am
Wow; I just came across this and it looks amazing. Any chance we could get a version of the plugin for the Mac-native DFHack R3?
Someone compile a version last september, you can get it here. (https://db.tt/WxEAU5Gb)

Extract:
rendermax.lua to /Dwarf Fortress
rendermax.plug.so to /Dwarf Fortress/hack/plugins

open
/Dwarf Fortress/data/init/init.txt

and change print mode to ... I'm not sure, maybe standard?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lethosor on May 14, 2014, 06:30:09 pm
I have a Mac build of the current development version of DFHack (plus rendermax) that I can package and put up if anyone wants it (it fixes a few bugs in rendermax, namely the crash from zooming too much). You should be able to use r3 and r4+ with the same save folder, or just copy it over (the develop branch is fairly stable right now, but you'd probably want to keep r3 around in case of crashes).

(I'm having trouble merging the rendermax changes into r3 without updating the rest to r4 too, but I can try to make a r3 version of the plugin if anyone wants it. I'm not sure if it requires any r4+ features or not, but I don't think it does.)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Nopenope on June 25, 2014, 12:16:33 pm
Am I missing something or is rendermax simply missing in dfhack r5? I can't find it in PE's pack either FWIW.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: PeridexisErrant on June 29, 2014, 01:26:01 am
Am I missing something or is rendermax simply missing in dfhack r5? I can't find it in PE's pack either FWIW.
I'm looking to include it in the next starter pack release, but can't find a build for Windows dfhack-r5.  Anyone got a link?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on June 29, 2014, 04:02:26 am
Am I missing something or is rendermax simply missing in dfhack r5? I can't find it in PE's pack either FWIW.
I'm looking to include it in the next starter pack release, but can't find a build for Windows dfhack-r5.  Anyone got a link?
Wait a sec. I'll upload it.

EDIT: there. Due to my error it got skipped in release of dfhack r5 (except osx version).
Few changes. I think most important that rendermax.lua is now in raws folder and is per-save.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Quarterblue on June 29, 2014, 05:47:30 pm
Any hope for a Linux build?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: PeridexisErrant on June 29, 2014, 06:51:50 pm
Am I missing something or is rendermax simply missing in dfhack r5? I can't find it in PE's pack either FWIW.
I'm looking to include it in the next starter pack release, but can't find a build for Windows dfhack-r5.  Anyone got a link?
Wait a sec. I'll upload it.

EDIT: there. Due to my error it got skipped in release of dfhack r5 (except osx version).
Few changes. I think most important that rendermax.lua is now in raws folder and is per-save.

I get the 'plugin compiled for r4, you have r5' error, and I have checked that I got it from the r5 link.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lethosor on June 29, 2014, 07:15:07 pm
I get the 'plugin compiled for r4, you have r5' error, and I have checked that I got it from the r5 link.
Typing "help" in the DFHack console is a quicker way to check the DFHack version.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: PeridexisErrant on June 29, 2014, 07:20:53 pm
I'm aware that I'm using dfhack-r5, the problem is that the link at the top of this thread to Rendermax compiled for windows dfhack-r5 is actually compiled for r4, so I can't use it. 
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on June 29, 2014, 10:39:04 pm
I'm aware that I'm using dfhack-r5, the problem is that the link at the top of this thread to Rendermax compiled for windows dfhack-r5 is actually compiled for r4, so I can't use it.
Gah... I think i know what happened. :/

EDIT: okay try now :)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: PeridexisErrant on June 30, 2014, 06:36:11 pm
Working nicely, thanks. 

The only annoying thing about all these awesome graphics mods is that they're OpenGL-dependant, and thus incompatible with truetype...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: fricy on July 02, 2014, 12:49:38 pm
@warmist:
Trying to config rendermax.lua to add light to buildings/workshops. I'm working with Boltgun's example config. (https://gist.github.com/Devduweb/6659504)

these work: (line 1-58)
Code: [Select]
addBuilding("Table",nil,{0.8,0.8,0.8},6,{"useMaterial"})but these don't: (line 61-103)
Code: [Select]
addBuilding("Trap:Lever",{1,1,1},{1.3,1.3,0.3},4)
addBuilding("Workshop:Masons",{1,1,1},{1,1,0.8},10)
addBuilding("Furnace:WoodFurnace",{1,1,1},{1.2,0.5,0.5},15)

Any of these entries just gives me a dfhack error message pointing to the problematic line:
Code: [Select]
data/save/region2/raw/rendermax.lua:61: attempt to concatenate field '?' (a nil value)
stack traceback:
data/save/region2/raw/rendermax.lua:61: in function 'buildingLookUp'
data/save/region2/raw/rendermax.lua:136: in function 'addBuilding'
data/save/region2/raw/rendermax.lua:255: in main chunk

any advice?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 02, 2014, 10:48:15 pm
Ah there is a bug in rendermax.lua :/
the buildingLookUp function should look like this:
Code: [Select]
function buildingLookUp(id)
local tokens={}
local lookup={ Workshop=df.workshop_type,Furnace=df.furnace_type,Trap=df.trap_type,
SiegeEngine=df.siegeengine_type}
for i in string.gmatch(id, "[^:]+") do
table.insert(tokens,i)
end
local ret={}
ret.type=df.building_type[tokens[1]]
if tokens[2] then
local type_array=lookup[tokens[1]]
if type_array then
ret.subtype=type_array[tokens[2]]
end
if tokens[2]=="Custom"  and tokens[3] then --TODO cache for faster lookup
if ret.type==df.building_type.Workshop then
for k,v in pairs(df.global.world.raws.buildings.workshops) do
if v.code==tokens[3] then
ret.custom=v.id
return ret
end
end
elseif ret.type==df.building_type.Furnace then
for k,v in pairs(df.global.world.raws.buildings.furnaces) do
if v.code==tokens[3] then
ret.custom=v.id
return ret
end
end
end
qerror("Invalid custom building:"..tokens[3])
end
end
return ret
end
Or all the code like this:
 fixed rendermax.lua  (https://gist.github.com/warmist/be14ff4464483c65594f)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: fricy on July 03, 2014, 02:15:31 am
Thx, now it looks like goblin xmas!

Any way to distinguish between activated/non-activated levers/pressureplates, jammed/working traps and powered machine components?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 03, 2014, 02:36:25 am
there is "poweredOnly" flag e.g.:
addBuilding("don't remember what can be powered...",{1,1,1},{1.3,1.3,0.3},4,{"poweredOnly"})
Other could be added (not sure about pressure plates though...)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on July 03, 2014, 03:05:34 am
there is "poweredOnly" flag e.g.:
addBuilding("don't remember what can be powered...",{1,1,1},{1.3,1.3,0.3},4,{"poweredOnly"})
Other could be added (not sure about pressure plates though...)
Awesome :)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: fricy on July 03, 2014, 03:53:54 am
there is "poweredOnly" flag e.g.:
addBuilding("don't remember what can be powered...",{1,1,1},{1.3,1.3,0.3},4,{"poweredOnly"})
Other could be added (not sure about pressure plates though...)
I can't get it to work, switching off power doesn't turn off the light, and the plugin crashes if I have both {"useMaterial"} and {"poweredOnly"} defined separately, is this the correct syntax: {"useMaterial","poweredOnly"} ?
I also tried defining two lines for each machine comp., one with powerOnly tag, the other without, different colors. That doesn't work either, the second entry overwrites the first.

Code: [Select]
addBuilding("Trap:Lever",{0.5,2,0.5},{0.3,1.1,0.3},5,{"useMaterial"})
addBuilding("Trap:TrackStop",{2.5,0.3,0.3},{2.5,0.5,0.5},8)
addBuilding("GearAssembly",{1,1,1},{0.8,0.8,0.8},5,{"poweredOnly"})
addBuilding("Rollers",{1,1,2.5},{1.5,1.5,2.5},4,{"poweredOnly"})
addBuilding("AxleHorizontal",{1,1,1},{0.8,0.8,0.8},5,{"poweredOnly"})
addBuilding("AxleVertical",{1,1,1},{0.8,0.8,0.8},5,{"poweredOnly"})
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on July 03, 2014, 04:21:00 am
Hmm... yes correct syntax is {"useMaterial","poweredOnly"}.
I'll look into it on the weekend. Can't remember what the limitations were.

Also this system is a bit limiting in my opinion. What if you want to e.g. "useMaterial" when powered but emit constant light when unpowered (reverse would be useful for e.g. steam engine). But i have no real answer in how to improve it.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Dwarf_Fever on August 09, 2014, 04:03:47 pm
Huh, this looks like a pretty neat mod.

Oh WOW!

any torches/lamps/etc planned?

I would kinda hope that tables and dressers have candles on them by default, and doors and fortifications would have torches already...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Devast on December 21, 2014, 12:37:41 am
Does this still work with the latest updates?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on December 21, 2014, 04:47:22 am
Does this still work with the latest updates?
If you mean latest update that has dfhack then yes. Latest df version does not have dfhack so does not have this either
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Baleur on February 01, 2015, 05:59:06 am
Does this still work with the latest updates?
If you mean latest update that has dfhack then yes. Latest df version does not have dfhack so does not have this either

How about now? :)
Works with latest Dwarf Fortress 40_24 Starter Pack r2 ?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on February 01, 2015, 06:51:46 am
Should be included. Just type "rendermax light" into the dfhack window, and see for yourself.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Shonai_Dweller on February 01, 2015, 07:59:51 pm
Should be included. Just type "rendermax light" into the dfhack window, and see for yourself.
Any specific hardware requirements for rendermax?
'rendermax light' causes DF to crash. Always has done, still does now, so I always assumed it wasn't 40.x compatible.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lethosor on February 01, 2015, 08:22:53 pm
You need to be using an OpenGL-enabled print mode (PRINT_MODE:STANDARD probably works best), and not using TwbT.
(Actually, PRINT_MODE:TWBT_LEGACY may work.)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: notfood on February 01, 2015, 09:03:13 pm
Seems to freeze under Linux with latest DFHack release (0.40.24-r2) printmode Standard.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lethosor on February 01, 2015, 09:19:45 pm
It worked for me. What distro are you using? Does "rendermax trippy" work? Anything relevant in stderr.log?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: notfood on February 02, 2015, 03:36:56 am
rendermax trippy works.
rendermax light locks the dfhack console, the game keeps running. If I try to exit DwarfFortress, it just locks. It eats 100% CPU as well.

stderr.log shows:
Code: [Select]
Invoking: rendermax light
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Shonai_Dweller on February 02, 2015, 04:51:16 am
Ah, so it's Rendermax or TWBT then?
That's tricky...pretty lights or sexy font? Hmmm. Will experiment later.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Boltgun on February 02, 2015, 05:17:32 am
Afaik it works with TWBT in lagacy mode, but fps would be bad and in my experience rendermax gets confused as to what z level to render.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 02, 2015, 06:05:57 am
TWBT stealing my fanbase ;(

In all seriousness: i'm a bit stuck myself. I would love to increase feature list (like real raytraced lights with metals being shiny and ambient lights) but it's already slowish+ TWBT rendering everything multiple times...

Maybe i'll talk to my graphics expert'ish friends and they could suggest some fancy algos to boost everything... But in the end it will never be as fast as vanilla df.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: mifki on February 02, 2015, 06:48:04 am
Will it be hard to take z-levels into account, so that it works better with twbt? Not to render lights for lower levels but rather just not to take lower tiles into account when calculating light for the current level. I'm storing tile 'depth' in bits 4-7 of the brightness (3rd) byte of the tile.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 02, 2015, 06:55:27 am
Will it be hard to take z-levels into account, so that it works better with twbt? Not to render lights for lower levels but rather just not to take lower tiles into account when calculating light for the current level. I'm storing tile 'depth' in bits 4-7 of the brightness (3rd) byte of the tile.

I'm not sure in what order twbt and rendermax is called. It it's possible to figure out that it's trying to draw non-current level than a simple "do nothing" would increase performance greatly. I'll need to look into this because currently i have almost no idea how twbt even works with rendermax :)

Oh and another idea i had (with some help from Elle from irc) using quads in df to color tiles in 4 corners. I.e. if you have wall that is lit from one side and not lit from other, it should have nice gradient. One problem though df uses two triangles per tile with 6 points (instead of e.g. using vertex list with 4 vertexes and triangle list with vertex ids) so setting them becomes a cache nightmare and a real mess...

Edit2: can't seem to run twbt with rendermax at all... Is there some trick to it?
Edit3: Ah i heard it needs TWBT_LEGACY...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Baleur on February 12, 2015, 03:46:07 am
I really would love TWBT + Rendermax working together. Lighting is the final frontier in DF right now.
1. We now have multi-tile rendering. Success.
2. We now have individual tile overwrites, eventually every individual item can be unique. Success.
3. We now have a lighting engine that can simulate a day night cycle. Success.

When 1+2 can work with 3, it'll be a glorious day.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on February 12, 2015, 08:45:07 am
Actually that is what I was trying to do (until i got sidetracked) 10 days ago.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on February 18, 2015, 02:53:48 am
More like 16 days ago... :P
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: utunnels on February 25, 2015, 07:25:31 pm
Maybe you can disable the light sources from the map edges? It looks really strange especially if you are playing a 1x1 map, when you get two bright edges.

Never mind, it seems to be a glitch with twbt enabled. I changed print mode to standard and it was fixed.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: GhostDwemer on February 25, 2015, 09:26:27 pm
Just want to note that I use Rendermax to get lighting effects together with TWBT for text when I am playing the latest version of Masterwork (v6.2). In the GUI, I set print mode to STANDARD, enable Rendermax along with Creature Sprites and Item Graphics, and set Z-levels to 0. I don't care much for multi-level rendering anyway, it kinda confuses me sometimes. This combination looks amazing and works fine, I am getting 30FPS on a 20 year old fort with nearly 200 dwarves and way too many big stockpiles.

Screen shot:
Spoiler (click to show/hide)
(I love how the light coming through the clear glass and reflecting off the silver walls looks!)

Thanks for making this amazing plugin! And also thanks to Meph also for making Masterwork utilize Rendermax so nicely. Finally, a use for Large Gems!
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Shonai_Dweller on February 26, 2015, 04:08:53 am
Just want to note that I use Rendermax to get lighting effects together with TWBT for text when I am playing the latest version of Masterwork (v6.2). In the GUI, I set print mode to STANDARD, enable Rendermax along with Creature Sprites and Item Graphics, and set Z-levels to 0.

You can get TWBT text with print mode set to Standard?
I thought it was an either/or option.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: mifki on February 26, 2015, 04:46:41 am
Just want to note that I use Rendermax to get lighting effects together with TWBT for text when I am playing the latest version of Masterwork (v6.2). In the GUI, I set print mode to STANDARD, enable Rendermax along with Creature Sprites and Item Graphics, and set Z-levels to 0.

You can get TWBT text with print mode set to Standard?
I thought it was an either/or option.

He's talking about DF 34.11, TWBT didn't use print_mode setting back then.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on May 04, 2016, 07:54:24 am
Actually that is what I was trying to do (until i got sidetracked) 10 days ago.
Or a few more days than 10. :P
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on May 04, 2016, 10:17:28 am
Actually that is what I was trying to do (until i got sidetracked) 10 days ago.
Or a few more days than 10. :P

I did not have any success then... There were a few changes that might be relevant in the mean time. But can't say for sure when i'll have the time as this needs more time than small scripts and stuff.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Abadrausar on May 04, 2016, 01:46:33 pm
In all seriousness: i'm a bit stuck myself. I would love to increase feature list (like real raytraced lights with metals being shiny and ambient lights) but it's already slowish+ TWBT rendering everything multiple times... Maybe i'll talk to my graphics expert'ish friends and they could suggest some fancy algos to boost everything... But in the end it will never be as fast as vanilla df.
Why not trow the GPU (https://en.wikipedia.org/wiki/Graphics_processing_unit) in the equation? Vanilla almost do not have a use for it
A full universitary department is investigating how to use little DSLs (https://en.wikipedia.org/wiki/Domain-specific_language) able of being run into the GPU. The root project that group all their research lines is called AnyDSL (https://anydsl.github.io/index.html). In this paper (https://anydsl.github.io/index.html) they explain how they are doing and the performance that they have achieved, their Impala repo (https://github.com/AnyDSL) shows that even if they are using a Rust (https://en.wikipedia.org/wiki/Rust_(programming_language)) dialect in their compiler, they have not bootstrapped (https://en.wikipedia.org/wiki/Bootstrapping_(compilers)) it, as the general Rust project has, this mean that all their compiler code source is C++ like DFHACK.
They seems  to rely on a Higher-Order Intermediate Representation (http://anydsl.github.io/index.html?page=thorin) called Thorin (https://github.com/AnyDSL/thorin) to achieve their GPU optimizations. Two more reddits:
1. Impala: (https://www.reddit.com/r/rust/comments/3a6ts5/impala_a_rust_dialect_that_can_partially_evaluate/) a Rust dialect that can partially evaluate functions at compile time and produce GPU code
2. A graph-based higher-order intermediate representation (https://www.reddit.com/r/rust/comments/396rg3/a_graphbased_higherorder_intermediate/?) (demonstrated on Impala, a dialect of Rust)
Returning to our world now, they do not manually low level program the GPU, instead of that they are coding all their logic in the same high level language and then by means of some attributes, I believe, some fragments of code are marked by the programmers to generate GPU code while all the rest generate CPU (https://en.wikipedia.org/wiki/Central_processing_unit) code and both worlds interact.
Terra (http://terralang.org/) seems to be doing exactly the same thing, but starting over a paradigm slightly different, their repo (https://github.com/zdevito/terra)

About which one of those is more near to DFHACK? or if any kind of integration with DFHACK is even possible?

I am completely lost. Maybe your graphics expert'ish friends know...

It would be cool to find our way into one of those algoritm crushers or something similar by the way. Call me a dreamer! If you want, but respect my right to dream.  ;)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: mifki on May 04, 2016, 05:04:24 pm
Since someone necroed this thread.

Shaders is the way to go. In the iOS app I recently changed it to render background colours, tiles, and shadows all with one OpenGL call and just simple shaders. I'd be interesting to finally create a shader-based renderer for desktop DF, so that the shader code could be easily modified for different effects.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on May 04, 2016, 11:14:10 pm
Since someone necroed this thread.

Shaders is the way to go. In the iOS app I recently changed it to render background colours, tiles, and shadows all with one OpenGL call and just simple shaders. I'd be interesting to finally create a shader-based renderer for desktop DF, so that the shader code could be easily modified for different effects.
And also to abadrausar: it would help a bit but main thing that is slow is reading shit-ton of memory (even slower- sending said data to gpu) each frame. Also it does not help any way to twbt-rendermax compatability.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: mifki on May 05, 2016, 12:05:38 am
Also it does not help any way to twbt-rendermax compatability.

Why? Well, not exactly "compatibility", but if we just pass the required data to the shaders and perform further calculations there, we could combine them in one plugin/set of shaders. Or maybe it could even be separate plugins each adding some data to send to shader stage, and several separate shader source files defining rendering/postprocessing stages.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on May 05, 2016, 01:09:32 am
Also it does not help any way to twbt-rendermax compatability.

Why? Well, not exactly "compatibility", but if we just pass the required data to the shaders and perform further calculations there, we could combine them in one plugin/set of shaders. Or maybe it could even be separate plugins each adding some data to send to shader stage, and several separate shader source files defining rendering/postprocessing stages.
That might work. Has anyone done any asking around how many people will have the hardware for this?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: mifki on May 05, 2016, 07:13:30 am
Also it does not help any way to twbt-rendermax compatability.

Why? Well, not exactly "compatibility", but if we just pass the required data to the shaders and perform further calculations there, we could combine them in one plugin/set of shaders. Or maybe it could even be separate plugins each adding some data to send to shader stage, and several separate shader source files defining rendering/postprocessing stages.
That might work. Has anyone done any asking around how many people will have the hardware for this?

It shouldn't be a problem. OpenGL ES which is sufficient for my needs (and WebGL, see https://www.shadertoy.com/browse) and corresponding desktop OpenGL version are about 8 years old.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Abadrausar on May 05, 2016, 11:14:17 am
Also it does not help any way to twbt-rendermax compatability.
Why? Well, not exactly "compatibility", but if we just pass the required data to the shaders and perform further calculations there, we could combine them in one plugin/set of shaders. Or maybe it could even be separate plugins each adding some data to send to shader stage, and several separate shader source files defining rendering/postprocessing stages.
That might work. Has anyone done any asking around how many people will have the hardware for this?
It shouldn't be a problem. OpenGL ES which is sufficient for my needs (and WebGL, see https://www.shadertoy.com/browse) and corresponding desktop OpenGL version are about 8 years old.
I like this one (https://www.shadertoy.com/view/Ms2SD1), impressive modeling of the waves in the sea, with so little code...
But, could this be used to move chosen parts of the actual DF interface pipeline from the CPU to the GPU?
And, if yes, which parts could profit more?
... Shaders is the way to go. In the iOS app I recently changed it to render background colours, tiles, and shadows all with one OpenGL call and just simple shaders. I'd be interesting to finally create a shader-based renderer for desktop DF, so that the shader code could be easily modified for different effects.
I ask this because a full shader-based renderer for desktop DF, could soon become overly ambitious, as lnxt try at it show us (http://www.bay12forums.com/smf/index.php?topic=94528.0), but a more limited in scope project where the easy picks are treated first, have more chances of success or at least, of being interesting enough for the developer, the time required to achieve something ...
In this way, one subsystem at a time, you could end with a whole shader-based renderer for desktop DF, without having noticed it.   ;):P
This principle is called the Gandalf´s lemma or also you would better say to Bilbo, little by little, that he has to feed 12 hungry dwarves plus a wizard! or were they hungry philosophers?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: vanatteveldt on March 30, 2017, 12:41:18 am
Sorry for the necro, but this looks absolutely awesome and I wanted to try it out. So, I set print mode to STANDARD and ran 'rendermax light' on the dfhack prompt. That worked, but totally kills my FPS.

I'm playing on a laptop (dell xps13) with 4K screen, is that likely to be the problem?

Is there a way to change settings to reduce the burden?

(edit: and I use a tileset, I think Ironhand, with df 43.05)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on March 30, 2017, 07:27:40 am
Sorry for the necro, but this looks absolutely awesome and I wanted to try it out. So, I set print mode to STANDARD and ran 'rendermax light' on the dfhack prompt. That worked, but totally kills my FPS.

I'm playing on a laptop (dell xps13) with 4K screen, is that likely to be the problem?

Is there a way to change settings to reduce the burden?

(edit: and I use a tileset, I think Ironhand, with df 43.05)

Unfortunately it does not have anything like that.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Clyybber on March 31, 2017, 04:52:45 pm
So this is still being worked on?
I could help if there are problems.
Amazing project dare i say
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lethosor on March 31, 2017, 09:28:02 pm
It's not being actively worked on, but that doesn't mean you can't work on it - it has some performance issues, as mentioned above. Not sure if that's the sort of thing you meant or not.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on April 01, 2017, 03:57:20 am
So this is still being worked on?
I could help if there are problems.
Amazing project dare i say

One low hanging fruit that i can think of: it uses multithreading to fill out the light values. However it does not use it to propagate the sun. It was just because i was stupid and thought that we are doing this while df is running, but we are not. So that could be moved and it should speed up quite nicely.

On things that would be bit higher - there was an idea by Elone to process world in chunks. Maybe somehow mark which chunks changed, etc. This way it potentially can be very fast (even unnoticeable). However there are no good way to detect that. You could just limit how many chunks to update each iteration but it might be ugly (not sure though).

Next on things i would like to see (and probably no one else) is a better light transport system. Something that would bounce light around. However this was very slow in any form i tried.

Other thing i played around: HDR. Basically setting sun to be 10000 and simulating eye adaptation. This way when you are looking in caves lit by magma it looks okay, outside looks okay and if you see both outside and inside it looks dark inside. All the cool kidsgames use it nowadays. Easyish to do...

Imho lack of last two points this makes forts very dark.


Oh and BIG thing that is missing: TWBT compatibility. I tried to make it happen but i forget what was the problem. Also new twbt exists (twbt-next?) maybe mifki does it in different way? I personally only use the multi-level rendering but it would be nice to have everything from both mods.

Edit: also - shaders. Basically think of a way to best push everything to gpu and let it do the work. This way we could easily (comparatively) have full light ray tracing (imagine having shafts for light to come down, and then silver floor to bounce the light around in the throne room). This of course would depend on gpu and there is (was?) shader based renderer in df itself. So it could even integrate nicely.
I imagine full fort in gpu memory might not fit (i.e. now it only has light sources (3*float per tile) and opacity (3*float) for visible portion and hacks for sunlight) but somebody needs to think about this :)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on April 16, 2017, 02:07:22 pm
So i've had some time to work on this, and made a new light calculation method. It's loosely based on shadow casting. Idea is that you don't need to visit any cell more than once, whereas old algo(s) were visiting too many cells. Other things good about this method is that it only needs stack and is perfect for shaders.

So it works like this:
Code: [Select]
3->....
 2->.#.
  1->..
      X

You visit cells in rows from 1 to 3 (left to right). If you encounter an obstacle you add it's "shadow" to final layer. To color each point you get the slope of a line from source (here "X") to the cell and sample last layer.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Clyybber on May 06, 2017, 11:40:32 am
So im a bit confused. Is this light plugin also in the official dfhack repo or only in your fork? And if the latter: Would i only need to replace rendermax.lua in my current df setup?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lethosor on May 06, 2017, 11:53:13 am
It's in the official DFHack repo: https://github.com/DFHack/dfhack/tree/master/plugins/rendermax
I think you would have to recompile the plugin if that part wasn't in the repo.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on May 06, 2017, 12:23:47 pm
It's in the official DFHack repo: https://github.com/DFHack/dfhack/tree/master/plugins/rendermax
I think you would have to recompile the plugin if that part wasn't in the repo.
But if you want to see newest changes, they are in my repo under dev-rendemax. However they are not very impressive... I still need to redo everything in shaders, and do a lot of stuff for this to payoff. E.g. now it has some artifacts if you allow for ambient fog. This is apparent e.g in water.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on October 31, 2017, 01:18:56 am
I cast this spell of necromancy!

So i've been working on this again. Mostly rewrote EVERYTHING (well 70%) to allow for other future uses (like you could ask someday for a full fort "render") better thread support and finally: opencl!

So what is opencl. For those who don't know it's toolkit/thing/driver that allows writing very parallel code. In our case each cell in world could calculate it's own light on it's own "thread" (well it's not exactly a thread) but it's on gpu and very very fast. And if we have more resources to run these light calculations then we could either include more of the map, have more correct light calculations (e.g. atmospheric effects?) or have light bounces (then you would have a use for those metal walls!)

Other thing i sort of stumbled upon is that of light adaptation effect. E.g. if you suddenly see an explosion, first the explosion will look too bright, then the rest of the scene will look dark until your eyes readjust. This allows for more real light simulation (e.g. sun is 100000 lux on avg day, while office lights is 320-500 so you can't display both in non-hdr display) and fun effects, like if you scroll to outside while it's day you would see stuff too bright for a moment.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Fleeting Frames on October 31, 2017, 01:15:40 pm
Pretty fast adaptive lights, huh.

Atmospheric effects...I suppose a larger embark might be big enough to have mirages, but wouldn't that amount to roughly same as metal surfaces, given the top-down view?

The "future uses" could be interesting. Don't know yet, but that example sounds like to-be-not-theoretical, given your other work.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on November 01, 2017, 01:29:28 pm
So a bit of images first:
Without light adaptation but log light (https://imgur.com/a/fAud1)
With light adaptation (https://imgur.com/a/7Dkkq)

So the problem i'm having now is the light adaptation changes the color of light. I'm using an idea i found on one paper that you could just divide by Y component of CIEXYZ color to have semi-working tonemapping. Because as it works now, the light values can (and do) go beyond 1. This makes sense, but we need some way of displaying what that means...

Other problem visible in the second set of images is that bounces are quite stupid. It concentrates the light in middle of cavern.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Fleeting Frames on November 01, 2017, 03:56:27 pm
Not only that, but there's the question of where the souther section gets the light when it is disconnected?

As far as the first set of images go, the 2 bounce view feels bit too...naturalized? Sharp? Anyway, feels off to have the colour of soil ramp right next to magma so similar to the colour for the "," in ~ centre of three SE bloodthorn saplings. Comparison next to each other: ▉▉

1 bounce feels better on that front.

I take it the colour of the object light bounces from affects the resultant colour?

Is it too expensive to have the magma underneath the trees in the northern part light them up? It's odd that they're mostly in darkness when things on higher z-level get better lightning even dozen+ tiles away.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on November 02, 2017, 03:42:42 am
Not only that, but there's the question of where the souther section gets the light when it is disconnected?

As far as the first set of images go, the 2 bounce view feels bit too...naturalized? Sharp? Anyway, feels off to have the colour of soil ramp right next to magma so similar to the colour for the "," in ~ centre of three SE bloodthorn saplings. Comparison next to each other: ▉▉

1 bounce feels better on that front.

I take it the colour of the object light bounces from affects the resultant colour?

Is it too expensive to have the magma underneath the trees in the northern part light them up? It's odd that they're mostly in darkness when things on higher z-level get better lightning even dozen+ tiles away.
Heh... You noticed. The southern part lit because of some bug... The "offscreen" for some reason generates light... Probably something todo with the arrays limits or sth...

And yeah current bouncing just takes the light at the location after first pass and move it into light emitter buffer. Which is not correct to say the least. I need to figure out a diffuse/specular distinction and have colored but not transparent object.

This might need some sort of light directionality. Not sure how to do that simply though...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on April 24, 2018, 10:45:13 pm
Bump, because someone brought it up on Reddit once more. We want Rendermax + TWBT :P
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on April 25, 2018, 07:58:55 am
Bump, because someone brought it up on Reddit once more. We want Rendermax + TWBT :P
Mostly been overcomplicating everything: current state it does not work, and looks terrible when it does :D

I'm waiting for mifki to finish his rewrite for twbt integration. I think it will be easier to do then.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Meph on April 25, 2018, 09:03:15 am
Has he even started? ^^
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: mifki on April 25, 2018, 11:18:30 pm
Bump, because someone brought it up on Reddit once more. We want Rendermax + TWBT :P
Mostly been overcomplicating everything: current state it does not work, and looks terrible when it does :D

I'm waiting for mifki to finish his rewrite for twbt integration. I think it will be easier to do then.

Hm... What I was going to do is mostly internal stuff related to handling overrides and shouldn't make much difference to you. However, I'm also thinking that eventually, I need to move to shader-based rendering and _that_ maybe will make it easier to add visual effects. Although I don't see how twbt+rendermax can co-exist as two separate plugins anyway. I'd like to have a visual fx framework, where other developers may provide shader code fragments to be included, and have their C++ plugins feed data to them, but I'm not sure it's worth it when there's only rendermax needing this so far.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on April 26, 2018, 01:10:56 am
Bump, because someone brought it up on Reddit once more. We want Rendermax + TWBT :P
Mostly been overcomplicating everything: current state it does not work, and looks terrible when it does :D

I'm waiting for mifki to finish his rewrite for twbt integration. I think it will be easier to do then.

Hm... What I was going to do is mostly internal stuff related to handling overrides and shouldn't make much difference to you. However, I'm also thinking that eventually, I need to move to shader-based rendering and _that_ maybe will make it easier to add visual effects. Although I don't see how twbt+rendermax can co-exist as two separate plugins anyway. I'd like to have a visual fx framework, where other developers may provide shader code fragments to be included, and have their C++ plugins feed data to them, but I'm not sure it's worth it when there's only rendermax needing this so far.
Yeah and in any way it would need a c++ part still where it would calculate stuff from map, unit, buildings etc... so only shader would be not enough and passing EVERYTHING into a shader would be insane

On the other hand it still needs some way of knowing that e.g. if it get's called (by render vmethod) that it's a second call this frame (e.g. multilevel 2nd level). I think it could just have "please calculate light for this region(x=0,y=0,z=0,w=10,h=10,d=10) into this array" function that other plugins could call. This would probably make it into a module so that other plugins could see or do we have other ways to call other plugin functions?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Betrix5068 on October 22, 2018, 10:32:53 am
Seeing as it's been a while could I ask what the status of this whole thing is? This thing looks amazing and as someone getting back into DF I would love to use it.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Fenrir on October 22, 2018, 04:42:25 pm
I'm currently using it, and the only problem I've had so far is FPS. Reducing the number of caverns, setting special.diffuseCount=0 and capping the GFPS at 30 gets me 100 FPS, but it remains to be seen how that will hold up as the fort ages.

I don't know if there's further optimization that can be done – seems most of the taxing stuff is on the dfhack side of the things and can't be moved into another thread.

EDIT: And I'm using a 3x3 fort size. 2x2 would probably be even faster, given that rendermax will have less map to check.
EDIT 2: Actually, fort size probably doesn't matter for rendermax specifically, since it looks like it's just checking the viewport not the whole map.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on October 23, 2018, 01:21:42 am
I'm currently using it, and the only problem I've had so far is FPS. Reducing the number of caverns, setting special.diffuseCount=0 and capping the GFPS at 30 gets me 100 FPS, but it remains to be seen how that will hold up as the fort ages.

I don't know if there's further optimization that can be done – seems most of the taxing stuff is on the dfhack side of the things and can't be moved into another thread.

EDIT: And I'm using a 3x3 fort size. 2x2 would probably be even faster, given that rendermax will have less map to check.
EDIT 2: Actually, fort size probably doesn't matter for rendermax specifically, since it looks like it's just checking the viewport not the whole map.

Also now that i think about it, it shouldn't recalculate the light as often. It only needs calculation if: view changed, tick passed (i.e. something in world changed) or you moved your cursor and cursor gives off light.

I'll need to remember this when i come back to this...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Betrix5068 on October 24, 2018, 06:20:34 pm
Is there any chance of seeing multi-level compatability in the near future? The two are mutually exclusive and while it is a shame to forgo these beautiful lights multilevel is much more fundimental than that and thus takes precidence. If you did get that down like you were talking about pre-necro I would be squeeing.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on October 28, 2018, 03:51:28 am
Nope! Done nothing in this project.

However my other project was very opengl (and shaders) heavy so it might help moving all light propagation to gpu.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Betrix5068 on November 04, 2018, 06:24:56 pm
well that's a darn shame. But it's good to know that there's a chance, even if it's still distant.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: flbr on May 24, 2020, 11:13:03 pm
Hey Warmist, is this still being developed? Though even if it's not, what would I have to do to check it out? This looks super cool!
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Fleeting Frames on May 24, 2020, 11:41:09 pm
Type rendermax light occlusionON into dfhack console in STANDARD print mode. Doesn't seem to work in all versions, but here's shot of it in 43.05:

|(https://i.imgur.com/oCYCfw8.png)|

That's an outdated version compared to latest screenshots in thread though, ofc
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: flbr on May 24, 2020, 11:42:16 pm
Cool, I'll try that out!
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on May 25, 2020, 01:03:42 am
Hey Warmist, is this still being developed? Though even if it's not, what would I have to do to check it out? This looks super cool!

As all of my projects they are in perpetual "in development, but me has new game to play/work/life" state. Newest idea/inspiration was from minecraft RTX. I think it would be better to make a full fort light simulation but only for screenshots - slowly integrate all the light by raytracing. Also i need to think through light bouncing in fort some more. Current model is very naive/roguelike. Issues/ideas:

<...>Type rendermax light occlusionON into dfhack console in STANDARD print mode.  <...>

It should be "rendermax light" as occlusionON is a debug command (i.e. to see how much every tile is occluding). See  manual  (https://docs.dfhack.org/en/stable/docs/Plugins.html#rendermax) for more info.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Fleeting Frames on May 25, 2020, 02:39:55 am
Yeah I tried that first and it froze and never rendermaxed
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on May 25, 2020, 04:41:50 am
Yeah I tried that first and it froze and never rendermaxed

Huh strange it shouldn't freeze.

Anyway, tested with 0.44.12-r3 x64:
(https://i.imgur.com/f06JDo9.png)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lethosor on May 25, 2020, 09:55:23 am
Yeah I tried that first and it froze and never rendermaxed
What DFHack version and OS? I did recently fix an issue that could cause just the DFHack console to freeze, but I think that was after 0.47.04-r1.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on May 25, 2020, 02:45:36 pm
Yeah I tried that first and it froze and never rendermaxed
What DFHack version and OS? I did recently fix an issue that could cause just the DFHack console to freeze, but I think that was after 0.47.04-r1.
Whoops should have looked up what is the newest DF version  :-[
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Fleeting Frames on May 26, 2020, 12:09:48 am
@lethosor: "DFHack version 0.43.05-r2 (release) on x86_64" and linux. And to clarify, its less frozen and more like the prompt for next command never returns plus rendermax doesn't execute.

@Warmist: yeah that doesn't work in 44.12-r1 x64 for me.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on May 26, 2020, 02:08:04 am
<... random dev plans ...>

Oooh new idea... Maybe make it semi-real-time? Stochastic real time? Inspired by this (probably misunderstanding and not watching all of it) (https://www.youtube.com/watch?v=hOHIzAkMrIw) lets just construct a grid of probes (e.g. each 5x5x5 block has one) and then raytrace from them randomly (maybe with some way of detecting if blocks changed etc...). The screen gets full raytracing and when it hits limit just look up the probe?

Though minor issue is that i've never done this (well tried to understand the spherical harmonic encoding and redo it to 2d for last implmentation) and i'm not sure how good does this propagate the light...
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lethosor on May 26, 2020, 08:14:37 pm
@lethosor: "DFHack version 0.43.05-r2 (release) on x86_64" and linux. And to clarify, its less frozen and more like the prompt for next command never returns plus rendermax doesn't execute.
Yeah, this sounds like almost exactly the issue I fixed in this commit (https://github.com/DFHack/dfhack/commit/be517370a69ab6d8b35ffff58c6c5fc5068257ec). There's a chance it won't occur in the GCC 4.8 build, so if you're using the GCC 7 build, you could try switching, but I can't guarantee it will help. You could also try grabbing a DFHack development build from https://dfhack.org/builds/ and extracting rendermax.plug.so from it (I don't recommend using the entire dev build due to this issue (https://github.com/DFHack/dfhack/issues/1576) - not sure if rendermax will crash because of this, but it's less likely). This will only work with 0.47.04-r1, though. If you want to apply the commit to older versions, it would probably be straightforward enough, but would require compiling DFHack (https://docs.dfhack.org/en/latest/docs/Compile.html).
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Medtob on August 15, 2021, 03:39:22 pm
Hi all,

Sorry to necro the thread, but this seemed like the most logical place to post, and less obnoxious than opening up an entire new thread for it.

Is there any consensus on how to best implement a day/night cycle in Rendermax?

After perusing this thread, I used the command

rendermax light sun <.1>|cycle

...but am not getting any cyclical changes in outdoor lighting. How should I go about attaining that?
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: lethosor on August 15, 2021, 07:48:53 pm
Sorry to necro the thread, but this seemed like the most logical place to post, and less obnoxious than opening up an entire new thread for it.
You did 100% the right thing. This is a long-lived thread for a project - despite recent activity, posting to it will reach people familiar with the project, and posting to the forum at large would probably not be seen by the right people. (I don't have a lot of familiarity with rendermax, but I can take a guess.)

Quote
After perusing this thread, I used the command

rendermax light sun <.1>|cycle

...but am not getting any cyclical changes in outdoor lighting. How should I go about attaining that?
Is this the literal command you ran? If so, I think you misinterpreted the help text:
Code: [Select]
rendermax light sun <x>|cycle - set time to x (in hours) or cycle (same effect if x<0)
The "|" means "OR", so you should either run "rendermax light sun <some number>" or "rendermax light sun cycle". The <> symbols mean that some value is required, so an example of the first option would be "rendermax light sun 0.1". (All of these should not include quotes when run in the DFHack console.)
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Medtob on August 15, 2021, 10:44:30 pm

The "|" means "OR", so you should either run "rendermax light sun <some number>" or "rendermax light sun cycle". The <> symbols mean that some value is required, so an example of the first option would be "rendermax light sun 0.1". (All of these should not include quotes when run in the DFHack console.)


Ah, many thanks, my misinterpreting was in fact the issue. I have little-to-no experience with inputs like | so am a bit more sensitive to it now at least, lol.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: leastannoyingman on December 01, 2022, 08:46:15 am
I never managed to get this plugin to work a long time ago, but it always looked awesome. That being said, are you planning to port it to the Premium version? Some lighting would really make the new visuals come alive even more.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: myk on December 01, 2022, 12:28:38 pm
we'll have to see what is possible with the new DF renderer. I suspect the answer is yes, though rendermax will not be in the first wave of plugins/scripts that we update for the Steam version. The question will come down to whether we can safely hook the low level renderer functionality.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: leastannoyingman on December 05, 2022, 06:29:38 am
we'll have to see what is possible with the new DF renderer. I suspect the answer is yes, though rendermax will not be in the first wave of plugins/scripts that we update for the Steam version. The question will come down to whether we can safely hook the low level renderer functionality.

I see, thanks. When you say "we", do you mean there's a group of people going through all (or many) of the plugins to update them? I'd have assumed each developer would have to do that individually.
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: myk on December 05, 2022, 08:46:34 pm
It's wonderful when the original plugin/script authors show up to help, but that is not always feasible for them. The DFHack team is ultimately responsible for the functioning of the tools distributed with DFHack. I've started doing some light triaging for which tools get updated first here: https://github.com/orgs/DFHack/projects/22/views/2
Title: Re: Dfhack: Rendermax (and it's subplugin light)
Post by: Warmist on December 08, 2022, 01:57:27 am
I'll probably help.

It's interesting to see how much the renderer has changed and how better/worse this will work and look.