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.

Messages - ag

Pages: [1] 2 3 ... 17
1
Utilities and 3rd Party Applications / Re: DFHack 0.40.12-r1
« on: September 17, 2014, 01:50:16 pm »
The main reason symbols.xml is still loaded at runtime is that the values in it cannot ever carry over to a new release and must be found one way or another anew. Keeping the file loaded at runtime allows adding more values to it without recompiling as we work on it.

However the bulk of the knowledge about DF is all the rest of xml files, and they are in effect compiled into both dfhack core and any plugins. If anything at all other than symbols.xml changes everything must be recompiled.

On the other hand if symbols.xml is truly the only thing that changed like with 0.40.12, then you can just get a new version of it and drop into the old dfhack, and it will work just fine.

2
Utilities and 3rd Party Applications / Re: DFHack 0.40.08-r2
« on: August 22, 2014, 03:22:57 pm »
Whenever expwnent will have time?..  ;)

3
Utilities and 3rd Party Applications / Re: DFHack 0.34.11 r5
« on: July 28, 2014, 11:31:58 am »
The yellow area was marked by automated code running a quick check on structures in memory; it's yellow precisely because no human looked at that stuff.

4
Utilities and 3rd Party Applications / Re: DFHack 0.34.11 r5
« on: July 22, 2014, 02:58:33 am »
Why won't it reach 100%? Are there structures that just aren't there anymore, or are the dfhack people not bothered to do it?

Some of  the structures are part of the economy or similar rare or obsolete things, so finding an instance to verify is hard or requires hacking things to turn disabled stuff on. Also, most of the yellow section of the diagram can be recolored green by now; only the red is completely untouched.

5
Utilities and 3rd Party Applications / Re: DFHack 0.34.11 r5
« on: June 27, 2014, 06:04:32 am »
Plus I have a question about item-occupancy.lua: What does it do, should I run it with repeat, or at all.

That script is an extremely slow process intended to diagnose and fix corruption from buggy scripts or plugins teleporting items around. It should only be used if you encounter problems like dwarves claiming there is an item in a tile when there is none. It's somewhat similar to programs like chkdisk that fix your filesystem.

6
Utilities and 3rd Party Applications / Re: DFHack 0.34.11 r5
« on: June 26, 2014, 04:17:34 am »
And a bit noob question. The patch that jj posted looks like this:
Code: [Select]
00110776: 75 90
00110777: D8 90
006602C4: 04 3C
006602CE: 40 47
Do I need to use it as it is, or only the lines with the plus signs? I'm asking because I've seen github patches that marked the line changes with minus and plus signs, and I'm unsure about this one. The game accepts the binpatch either way, but I can't confirm if it's working correctly or not. :(

Actually the important part is those four lines at the end. The rest is just documentation.

7
Anyway, these classes are not in dfhack, so it's pointless to talk about what would be possible to do if they were there.

The reason dfhack does not really define renderer classes other than the base one, is that in the linux version they are located in a separate library, so their vtable pointers are hard to specify. Also, messing with renderers is also not something to be undertaken lightly because of the threading limitations; it is also not needed unless you are doing something well beyond the current capabilities, like warmist's lighting plugin. However, when you are going that far, you might as well subclass the base class and implement vmethods normally.

8
These renderer classes are not in dfhack (and we even don't know which one is actually used), so "manually" (in quotes because that's what dfhack is doing anyway) changing vtable is the natural way to override couple methods. "Weird" assembly is required because of the special C++ calling convention used on Windows, dfhack is also doing something weird to overcome this, but I'm not sure.

Manually means doing weird things, with hard-coded indexes that would break if stuff changed, or if another plugin did the same thing, and inline assembly, instead of a supported API.

What dfhack does is described here.

9
I had a discussion with lxnt, baughn and Toady, and later on another with Taffer, Baughn and Toady. Baughn would like to update the graphics significantly, but cant work without source access. Toady understands this, but wont give this access. (which is perfectly within his right to do)

I seem to have read Baughn saying somewhere that adding too much stuff to objects makes the game crash or something, which slows down the possible rate of change. I may have an idea why this happens, and a very easy workaround would be to add some "char padding[256]" to the end of all global objects that baughn wants to grow, so that once Toady recompiles, enough space is reserved.

Regarding the plugin, manually hacking into the vtables is a very bad approach when dfhack has an already available vtable interposing API, which doesn't require any weird inline assembly, and even allows different plugins to define hooks for the same methods without conflicting.

Another thing is that renderers don't have the right to access any game objects, because rendering is run in a different thread and is only synchronized for a buffer swap. Thus, the appropriate way to do such thing is to hook the render vmethod of viewscreen_dwarfmodest (using the interposing API is a must, because other plugins already hook it), and work with the tile arrays via the Pen API. In order to make the game load the necessary tile images, you can assign one of the tiles in your bitmap as a graphical icon for something silly and impossible like "cat miner ghost" via raws, and then use findGraphicsTile to look up the index.

10
Utilities and 3rd Party Applications / Re: DFHack 0.34.11 r3
« on: April 23, 2014, 06:33:17 am »
The API for working with the map is mostly only available in C++, and since r4 it supports setting a tile to an arbitrary stone material using the vein method. It is used by the 3dveins plugin, and also exposed in the tiletypes command.

11
If anything, "unit" would be the one who did the interaction and "unit_syndrome" would be the one who didn't.

If you look at the XML properly, you will note that unit_syndrome is a structure type, and it has nothing whatsoever to do with doing interactions. This method is involved in per-tick processing of syndromes already active on a unit.

12
Utilities and 3rd Party Applications / Re: DFHack 0.34.11 r3
« on: March 06, 2014, 01:06:40 am »
r4 has been unofficially released quite a while back now, and there won't be an official release of it because things have changed since then. Instead, there may be an r5 eventually.

13
Utilities and 3rd Party Applications / Re: DFHack 0.34.11 r3
« on: February 17, 2014, 01:55:19 am »
Yeah, those are missing for whatever reason, but here's a simple function that should do the same thing (weighted for syndromes as well):

Oops, forgot to actually add those to the export list - will be fixed in the next release whenever that happens.

14
Utilities and 3rd Party Applications / Re: DFHack 0.34.11 r3
« on: February 16, 2014, 05:11:23 am »
Is there a way to run a function whenever the game is saved?  I need to retain some persistent variables accurately but saving them every frame causes major slowdown.

If you are doing something every frame, it may be better done in C++, and the persistence API there is more low-level and allows you to keep a reference to the actual memory used to store the data, so it can be modified without any overhead. The downside of course is that you can crash some plugins if you delete their persistence entries without telling them, e.g. via the lua api.

15
Utilities and 3rd Party Applications / Re: DFHack 0.34.11 r3
« on: February 08, 2014, 02:19:35 am »
What is the purpose of the "Nemesis" entries anyways? What do they do that isn't redundant to the unit or historical figure data?

As far as we understand, they control how unit data is stored in unit-*.dat files in your save directory. They are also where the game stores permanently which units are your current or past adventurer, and who its companions are.

Pages: [1] 2 3 ... 17