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 - Warmist

Pages: 1 ... 17 18 [19] 20 21 ... 75
271
Utilities and 3rd Party Applications / Re: DFHack 0.43.03-r1
« on: August 21, 2016, 03:30:55 am »
... and the rest of it was a lot of work. After several years of maintenance, I left the project for others to worry about :)

Although not being involved in development, are you still playing DF? Were you playing it a lot back then (for example, I must admit, I am developing much more than playing, which is a problem sometimes as I just don't know some gameplay stuff well)?

It's just interesting why people suddenly lose interest in their projects (I'm not saying I don't do that sometimes myself). Back in good old OSx86 days, there was a guy, Maxxus, who first hacked first versions of OS X 10.4 to run on non-Apple hardware and documented the process of binary patching to the kernel. And then he disappeared. We had to use his old kernel with new OS X versions until.. um.. I was able to build a new one from sources. And we didn't, and still don't (AFAIK) know, who he was and why he abandoned the project.

Here, GavJ disappeared after starting to work on a very interesting geological project, fricy disappeared...
Yeah it's the natural order of things. E.g. currently i don't play because anything i try gets fps death. Next step for that is 1x1 fort with 20 dwarf limit (+20 children +20 visitors). Maybe that could work for some time...

272
Utilities and 3rd Party Applications / Re: DFHack 0.43.03-r1
« on: August 18, 2016, 11:45:23 am »
Very good lyrics! I almost can feel the Iluvatar music weaving into the shining reality of today DFHACK  ;)
You must have a poet soul to transform a relevant bunch of boring and precise technical jargon into an interesting saga song  ;D

Thanks, on a rare full moon i try to bard things up :D

273
Utilities and 3rd Party Applications / Re: DFHack 0.43.03-r1
« on: August 17, 2016, 02:19:56 pm »
For on of masters of this thread  :)
Can someone told me short story of DFHack creation, and probadly give some linkes to first discussions about it? I really need it. Thanks.
At first there was chaos. Many young hackers did the same and did it differently. It was good time, because df was stuck in one version.

But soon one of those hackers has risen. He chose the hard path: to join everyone under a dfhack banner (and the nice performance gain by being in same address space) and that person was Peterix. And thus the Dfhack has risen from the chaos and is thriving since that day.

The second big revolution was "Lua". From the depths of internet came a person named "ag" (in these forums). He took the idea i toyed around and made it beautiful and powerful. And thus we could do anything (well almost) without any recompile.

The third big revolution was "Vmethod interposing". Again big thanks to "ag". This allowed us to do "MAGIC" with dfhack. Like catch when df calls some functions and replace them VERY EASILY. And also the gui was born.

Though this is only one half of it. During all that time there were many people - Like Peterix and Quietust - that worked on very important systems. Like the dfhack architecture itself and reversing the df.

Some links: old dfhack thread

Spoiler (click to show/hide)


274
DF Adventure Mode Discussion / Re: Settler Mode?
« on: August 16, 2016, 02:19:05 pm »
If dfhack is not a problem there is also advfort

275
Utilities and 3rd Party Applications / Re: DFHack 0.43.03-r1
« on: July 26, 2016, 03:47:50 am »

For a new fort the onload.init runs while df.global.gps.screen.value is 0, and then it becomes 219 when the embark screen is ready for user input.  It is also 219 in fort mode and arena mode and while a saved game is reloading, so I'm not sure what that value is really supposed to represent.  But, since you can't get to "screen 0" in an active fort it's good enough for my purposes.
The gps.screen.value iš the first tiles ( upper left corner) character. So it might fail with fps display on ( or off)

276
Also it's my quest to have everything df related in df :D
(like lua powered browser for wiki ;D)

277
Also we could have a function that constructs a viewscreen from the helpstring. Then we could show (maybe interactive?) help screen.

278
DF Modding / Re: DFSembbly, the DF assembly indexing project
« on: June 23, 2016, 02:51:56 pm »
This is for global function (not methods like what DFHack knows about) right?

How hard would it be to replace such functions, or, better yet, allow users to call them from DFHack plugins?
As a person that did this some time ago: not very hard. basically you replace call <offset> with your own call <other offset>. then in that function you can choose to call or not the original.

Nasty part is finding the functions and then updating them between versions. This is somewhat easier using dfhack tools (e.g. ida dfhack structs, and global offsets) if they are updated to the new version. Otherwise it would take <very long>. Exceptions exist e.g. mifki is using one function that loads a png/bmp file for graphics and another that renders the map. He has quite easy to follow instructions to find the functions for new df version.

This is with the old df that was build with older visual studio. Haven't tried anything on the new one...

279
bump to remind people that now you can mix advfort with adventurer fort making (e.g. you can make site with vanilla df and furnish it with advfort)

280
Utilities and 3rd Party Applications / Re: DFHack 0.42.06-r1
« on: June 20, 2016, 11:41:22 pm »
Will we get another release before we start working on the new version?
The compiler changed so it's very possible.

281
Oh cool. I was thinking that we lack tools for lua.

Have you looked at strict lua. It's one include and takes care of most(?) global nil references. Though its runtime thing not like this nice static checking.

282
Utilities and 3rd Party Applications / Re: DFHack 0.42.06-r1
« on: May 30, 2016, 03:00:13 pm »
Well, to be fair, it's not really a "problem" in C/C++ because pointers are arrays and arrays are pointers.  That's why you can say 5[array] instead of array[5], if you want to be weird about it.  The subscript operator is just a bit of convenient syntactic sugar.  (And, for size information, you should also really never use sizeof() on an array.  It's the closest to undefined behaviour you can get without actually being undefined behaviour.  Personally, I don't think it should even be allowed, but there are legacy reasons for keeping it around, and frankly most compiler vendors would probably keep it as undefined behaviour even if the standard was changed.)

Good to know about that offset shortcut in gm-editor, though.  I've seen it in the help page, but there was nothing that indicated what that was supposed to do, and I haven't come across a bare array anywhere else in any of the data structures dfhack exposes, so I haven't had an opportunity to experiment with it.  Maybe adding a little note to the help page to clarify that it's for indexing bare arrays would be useful?

But, just out of curiosity, has it been determined that that particular variable is actually a bare array?  Is it possible that that's a vector and nobody's noticed yet?  I mean, everywhere else that I've seen, vectors are used, even in places where you could legitimately get away with even a statically-sized array, like the unit attributes and personality traits.
Short answer: no this can't be vector.
Long answer:
We mostly have the layouts from disassembly (and by we i mean other smarter people). This naked array is stored as an simple pointer (thing void* because in assembly every pointer is void*). Only the accessing code is reading e.g. by byte and checking nearby word or byte to stop or not the iteration. The vector on the other hand is totally different. It has three pointers. Each read is usually prefixed by size check which is read two pointers and shift/div/etc to figure out the item count, then compare to imput and sometimes jmp to exception or just jump to ret 0 part.
Statically sized arrays are also different thing. It's just like having a struct with N fields (e.g. {int x,y,z} is same as {int p[3]} but not {int* p} or {int p[] (is this valid at all?)}) So it looks totally different and the resulting size of struct is way bigger.
Then there is a HUGE magical thing that is lua wrapper. At the start i tried writing one but then angavrilov wrote the whole thing. There are some limitations like - you can't interpose vmethods from lua as it requires compiled code to replace the original (or doing automatic wrapper for EACH VMETHOD FOR ALL CLASSES - would be slow like hell) or like lua does not have "please list out all vmethods of this object with arguments" because nobody did need this bad enough to implement. Or in this case size for T* arrays. Although there are very few of them, and you could write out special handling for each of them - it's simpler to understand what is happening and have small snipped that does the same.

283
Utilities and 3rd Party Applications / Re: DFHack 0.42.06-r1
« on: May 30, 2016, 01:37:17 pm »
Nope.  It may be a bug in the current version of DFHack, but currently building_extents is the x, y, width, and height of the bounding box, and a single pointer to a uint8 that's just: "0 - not room; 1 in stockpile; 2 wall; 3 inner; 4 distance boundary" according to df-structures.

Maybe the pointer is supposed to be to an array of something like struct { uint8 extent_type; union { /* the different types of extent */ }; }; but that's gotten lost?

EDIT: Aha!  Sorry, I keep forgetting that the source of DFHack is just on Github.  Just looked at the code, and figured out what the problem is: the pointer is a pointer to a bare array, but both the Lua API and gui/gm-editor are only set up to access vectors.  So, from a plugin, I can just do a lookup into that array, I just won't be able to rely on bounds-checking to catch bugs.

RTM :D Dynamic size arrays can not be nicely shown in gm-editor or lua. You need to index into them manually. Thus use ptr[x+y*w] or similar. In gm-editor there is "displace" or "offset" shortcut for that. For normal usage there is lua helpers (e.g. "dfhack.buildings.containsTile(building, x, y[, room])").
The same problem in C or C++ really. C type arrays when passed as an argument are turned into pointer thus loosing the size information.

284
Utilities and 3rd Party Applications / Re: DFHack 0.42.06-r1
« on: May 30, 2016, 11:09:27 am »
There is building_extents (IIRC) they hold if cell of building WxH box is part of the building

285
So new df has adventurer forts... I was hoping i could let this die. Unfortunately it still does not have most of the stuff i'm interested in. So next dfhack (the one that will support 43.xx) will have updated advfort.

Mostly bug fixes. Also i ask you to place issues in my github place: https://github.com/warmist/dfhack/issues Cause i'm too forgetful/lazy i guess.

Also hopefully someone will research how the vanilla system works and we would be able to hijack it for our own needs (at least for some buildings etc...)

Pages: 1 ... 17 18 [19] 20 21 ... 75