Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - mifki

Pages: [1] 2
1
DF General Discussion / Online 3D map viewer - upload and show your forts
« on: September 17, 2017, 10:54:00 pm »

I'm crossposting here because the tool can now be used without DFHack by people playing vanilla and not visiting the other subforum.

In short, while developing a 3D view mode for DF Remote, I decided to make a WebGL-based online 3D viewer as well. You can export your map by copying/pasting a command from the page to DFHack console, or by uploading your save if you're not using DFHack (experimental feature). Either way you get a link that anyone can use to view your fort. This is a work in progress so number of models is missing and other stuff may be broken.

Main thread - http://www.bay12forums.com/smf/index.php?topic=165465.0

2
Utilities and 3rd Party Applications / [WIP] Online 3D map viewer
« on: September 06, 2017, 10:33:32 am »

Recently I resumed (well, restarted) working on a fast and simple 3D visualiser to add to DF Remote app to help new players better understand what their forts look like. Another part to this project is to create a WebGL-based online viewer, potentially a 3D replacement for DFMA.

So here is what I have so far. Not all buildings (and most workshops and furnaces) are rendered at the moment, and other stuff may be broken. To export a map just go to the page, copy and paste script to DFHack console, or upload your save.

Map is currently exported 30 zlevels down from the current level. Map key is generated based on site name and year, so new exports will overwrite previous one.

Requires a modern browser with WebGL support.

http://mifki.com/df/3dview

3
I tried to force a siege by creating an army, a controller and targeting the fort. It seems to work just fine, so now I'm unsure whether just no one tried that, or there are known issues with this approach.

Anyway, here's the script https://gist.github.com/pronvit/e256267e3c65c0e89e08b1aa947df600

The script accepts the following parameters:

-civ HUMAN -race [ GOBLIN TOAD ] -count [ 2 10 ] -undead -debug -cleanup

-civ is optional. If not present, will find a civ for the first race. If present, it can be a race name (will find a civ), or a part of english civ name. Can also be "self" if you can't think of anything better.
-race is require and can be either one value or a list.
-count is required and can be either one value or a list with number of items matching races.
-undead is optional if you're a fan of corpses.
-debug is optional.
-cleanup is optional and will delete the created army controller.

I think doing the cleanup if generally better, but it needs more testing. I've had some crashes when generating a 100 goblin siege both with cleanup and without but not sure whether it's a vanilla DF crash because of a large number of units or is caused by the script.

There are also comments in the code about what some unidentified fields might do.

4


Download https://gist.github.com/pronvit/710f0de2d9fa8a1971c52f64131d24e1

Copy to hack/scripts and start with "performances" cmd. It will show a list of all poetic/musical/dance forms allowing to view their descriptions.

5
Utilities and 3rd Party Applications / TWBT Next
« on: March 19, 2017, 03:58:55 pm »
I suddenly found an easy and reliable way to implement new rendering features I was thinking about for a long time. A separate thread to attract attention of tileset authors because the new features require changes to tilesets.



Features

1. Buildings and items are now rendered separately from the floor - you can notice that coffins, chairs, slabs and so on have different colours but their backgrounds stay the same, and are actual floor tiles - rough, smooth, engraved. No stockpiles on this screenshots, but you'd see stockpile tiles behind items as well.

2. Look at the beds. The bed frames have different colours depending on their material, but pillows and sheets stay the same, i.e. not all tile pixels are affected by the foreground colour.

3. Oblique view mode I showed here http://www.bay12forums.com/smf/index.php?topic=138754.msg7390751#msg7390751 It's not available at the moment, I'll update the post later.

Tileset changes

1. Existing tilesets will continue to work as usual.

2. To support these new features, tilesets need to have three "layers":



First is used to render background colours and normally should just be white for non-empty tile pixels. This is supplied as e.g. Spacefox-bg.png
Second is the main tile image which will be coloured using foreground tile colour, can now have fully transparent pixels where floor should be visible. This is supplied as usual Spacefox.png
Third is just the pixels that won't change colour. This is supplied as Spacefox-top.png
If -bg and -top files are not available, the corresponding features will be disabled and the tileset will work as before.

Notes

1. Binaries are available from build.mifki.com. When installing, copy white1px.png and transparent1px.png to data/art folder. An example tileset based on Spacefox is included.

2. This works the same way for overrides, just supply additional -bg and -top images for each tileset used by overrides. However due to 3 times more tiles now being used and restrictions on the largest texture size, tileset authors using a lot of overrides and/or very big tile sizes need to be careful not to waste any space in tileset images, i.e. having three images with just half of the tiles actually used is bad because all tiles will still be loaded.

3. If you can't see the floor though some of the buildings/items, it's because I forgot to include them, there are quite a few of such (that is, in the code, the example tileset has just a few tiles modified to demo the new features).

6
I've got several undead chinchilla corpses here, my military were chasing them and it seemed to be ok, but then they surrounded them and something happened. They are fighting and all other dwarves stopped doing anything (listed as No Job) gathered around and... watching? ALL of dwarves became legendary observers. FPS dropped to <10. All this doesn't seem normal. DF 0.42.06

Oh cool, also a dwarven caravan arrived with meat/intestines/etc. and nothing else. A lot of meat.

7
I'm working on a tool to check Lua scripts against DF data structures. I need it to track changes between DF versions and update DF Remote scripts accordingly. Maybe it will be useful for other DFHack scripts too.

https://github.com/mifki/df-luacheck

I've just started yesterday, so a lot of things is missing, including support for require(), internal dfhack functions, and more.

Code: [Select]
function test(unitid)
    local ret = {}

    for i,unit in ipairs(df.global.world.units.active) do
        if unit.civ_id == df.global.ui.civ_id and unit.flags1.tame and not unit.flags1.dead and not unit.flags1.forest then
            local work = (unit.profession == df.profession.TRAINED_WAR or unit.profession == df.profession.TRAINED_HUNT)
            local geld = unit.flags3.geld
           
            -- ...
        end
    end

    return ret
end

test(1)
---------------------------
6: ERROR value TRAINED_HUNT does not exist in enum df.profession
6: ERROR type of operand df.profession.TRAINED_HUNT is unknown, assuming the result is bool
7: ERROR field geld does not exist in unit.flags3 of type df.unit_flags3
7: ERROR type of expression is unknown unit.flags3.geld

Code: [Select]
function test(bldid)
    local bld
   
    if bldid then
        bld = df.building.find(bldid)
    else
        bld = df.global.world.selected_bld
    end   
   
    bld.owner_id = df.global.world.units.active[0]
end

test(1)

---------------------------
7: ERROR field selected_bld does not exist in df.global.world of type df.world
7: ERROR type of expression is unknown df.global.world.selected_bld
10: ERROR assigning df.global.world.units.active[0] of type df.unit to bld.owner_id of type number

8
Recently I've posted about my experiments with 3D view for my iOS app, but also I was thinking about a WebGL-based online map viewer. Unfortunately, I couldn't get decent performance in browser (on modern hardware in Chrome it was fine), so had to use nasty tricks (better use Chrome anyway). Need to think what to do with all this now.

http://mifki.com/a/df3dview

9
With all the ongoing discussion still on these forums of course, but I was thinking about a website to store all saves for one game in one place, users/turns management, automatic raw patching to restore ASCII or whatever, turn notifications, etc. And also automatic processing of new saves to gather and visualise some statistics about world/fortress progress, and the fortress itself. I likely had some other ideas I can't remember now, but first anyway I want to know if it's interesting for anyone.

10
DF General Discussion / Dwarf Fortress Remote for iOS is now available
« on: January 14, 2016, 03:56:56 pm »
I'm happy to tell that Dwarf Fortress Remote application is now available on the App Store. It allows to play DF on iPhone or iPad connecting to your home computer or a server.
Supports version 0.40.24, there are several unimplemented things at the moment, see http://mifki.com/df/notes.html

Info and download: http://mifki.com/df
Discussion: http://www.bay12forums.com/smf/index.php?topic=145944.0

Thanks to Toady for allowing this to happen, and to DFHack authors and contributors for making it possible.


11
DF Dwarf Mode Discussion / Caravan prices
« on: January 04, 2016, 04:54:22 pm »
Duplicating my question from IRC the other day.

Seems caravan prices for weapons/armour get some multiplier (compared to item basic value) based on caravan's entity race adultsize property. Is it documented somewhere/is the exact formula known?

12
In Xcode 7 Apple has switched from GCC assembler to LLVM assembler. Even when using GCC to compile, it uses the system assembler. This (or maybe something else changed as well) led to problems compiling DFHack and plugins. When compiling with GCC 4.5, some of the resulting binaries crash, including the protobuf compiler that's build during DFHack build process. When compiling with later GCC versions, the new assembler can't compile one of the produced by GCC files.

Fortunately, you can have several Xcode versions installed, so you can install Xcode 6 to /Applications/Xcode_6.app (don't use path with spaces, as cmake will fail), and switch to it when needed with

Code: [Select]
sudo xcode-select -s /Applications/Xcode_6.app
Also the following symlink is required due to some library changes:

Code: [Select]
cd /usr/local/lib
sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib

And this is required because the old GCC doesn't know about newer systems (I've tried 10.5 but cmake failed, I think supporting 10.6 is enough nowadays):

Code: [Select]
export MACOSX_DEPLOYMENT_TARGET=10.6
With this, I was able to build working DFHack and my plugins on 10.11 with GCC 4.5 and Xcode 7 installed (besides Xcode 6). As I understand, xcode-select affects only console tools, so you can continue to run and use Xcode 7 for other development.

13
Life Advice / Bought a car
« on: September 19, 2015, 02:21:54 am »
Sometimes I want to do things myself that I shouldn't be doing without asking for advice. I'm doing that intentionally because in general I don't like to ask for help, and also mistakes made yourself you remember better and actually understand what exactly you've done wrong, and not just like I shouldn't do this because clever people say so.

So, this time I've bought a car, first car, myself, alone, used, cheap. No, well, I've researched a bit and not just the very first car I saw for sale. But I was intentionally buying a cheap car, just because right now I don't have any preferences at all (never been interested in cars), so wanted something that would just run for a year while I'm thinking what I really need. But as it usually (sometimes?) happens, right after buying something you start seeing things you don't like, so now this and that looks not so good (mechanically), and so on.

Well, it's not the end of the world anyway, in the worst case I've just lost some money, but people will definitely think I'm an idiot, which I'm not sure I am because I did this intentionally for some weird reason.

Hm, not sure what advice I'm asking for... But if you think I'm an idiot you're free to say so:)

14
Working on military screens for the iOS app is a bit boring, so..

Excerpt 1 - http://45.55.167.200/map.html
Excerpt 2 - http://45.55.167.200/map4.html

Colors don't match between some tiles because each region was rendered from the highest point which varies.
Anyway, back to the military screens now)

UPDATE: Full world with sites marked - http://mifki.com/df/bigmap/

15
Utilities and 3rd Party Applications / Legends in Fortress mode
« on: August 03, 2015, 03:45:43 am »
Did you know it's possible to do

Code: [Select]
w=dfhack.gui.getCurViewscreen() ; w.child=df.viewscreen_legendsst:new() ; dfhack.gui.getCurViewscreen().parent=w

and get a fully functional Legends screen? There was couple question about how to get more info about outer world recently. The only thing you can't use ESC to close the screen, instead, use

Code: [Select]
dfhack.gui.getCurViewscreen().breakdown_level=2

Someone needs to make a convenient script, if there's no already.

Pages: [1] 2