Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 32 33 [34] 35 36 ... 185

Author Topic: Text Will Be Text - dfhack plugin  (Read 802212 times)

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Text Will Be Text - dfhack plugin
« Reply #495 on: July 13, 2014, 03:57:53 am »

I'll try.

Yes, I thought there might be a function for this in dfhack... However I see vmethod_pointer_to_idx on Windows uses some complex magic that I don't understand, so not sure what's better) But I'll consider using it anyway to get rid of some #ifdefs, thank you.

There are several ways of resolving incompatibility with the nextgen branch, I'll think about that later.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #496 on: July 13, 2014, 05:12:30 am »

I thought that vmethod hackery was because mifki is using gcc to compile plugins? If you are using msvc your compiler does all the work.

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Text Will Be Text - dfhack plugin
« Reply #497 on: July 13, 2014, 05:35:01 am »

I thought that vmethod hackery was because mifki is using gcc to compile plugins? If you are using msvc your compiler does all the work.

What are you talking about?

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #498 on: July 13, 2014, 06:01:29 am »

Well manually reading vmethods from vtables instead of just using inheritance. Including custom assembly to call said methods instead of just calling them (like rest of dfhack does it). I though that it's because of different calling conventions used in gcc and msvc.

Mayama

  • Bay Watcher
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #499 on: July 13, 2014, 07:19:41 am »

Would it be possible to have multible layers of, for example, grass and extra sprites for each grass density etc someday in the future or am I completly over enthusiastic?
Logged

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Text Will Be Text - dfhack plugin
« Reply #500 on: July 13, 2014, 08:13:18 am »

Well manually reading vmethods from vtables instead of just using inheritance. Including custom assembly to call said methods instead of just calling them (like rest of dfhack does it). I though that it's because of different calling conventions used in gcc and msvc.

Ok, so...
In the first version (what was the main branch until recently) I was saving address of certain vmethods, and replacing them in the original renderer vtable with my functions - that was the easiest way because I needed only to hook 2 vmethods. Then, on OS X and Linux I can just call the original vmethods as normal functions because on these systems "this" pointer is just passed as the first function argument. However on Windows the calling convention for vmethods is different from normal function calls, so assembler code was required.

In the current version I use different approach. I made my renderer inherit from renderer_opengl, and I added several dummy vmethods to it. Then I copy entire vtable from the original renderer to my object except for vmethods I want to override, and set original addresses of overriden methods instead of those dummy vmethods. Finally I copy all data fields from the original renderer to my object and set my object as the renderer. Old renderer is not needed anymore. This allows me to call original vmethods without any tricks and doesn't require copying screen* fields between old and new renderers each time like you do in rendermax, and I got rid of assembler code (to make you happy:) ).

There's nothing wrong in doing this, dfhack is doing more terrible compiler-specific things with vmethods, including things I don't understand (as I'm not a C++ developer) like virtual_identity::get_vmethod_ptr and functions it calls.

Spectre Incarnate

  • Bay Watcher
  • Possibly inside a dragon's toothy maw.
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #501 on: July 14, 2014, 12:48:13 am »

Hopping over here from another post to see what it's all..

..about.

._.

Wait, w..ww.. what? WHAT?! NO WAY?! You're joking... this has to be a joke. April Fools? (No.. it's not April, ya dork.) Then this is real?!

Haha, I love how he's all "Hey guys, I did a thing" like it's no big deal, and we're all like...

Dancing on the Ceiling!
https://www.youtube.com/watch?v=OdQDXs75Ulo

Dude, do you have any idea how long we've all waited for more tileset support? (And for how dumb we all feel for not thinking of this?)

Mifki the Wizard Dwarf has come to the fort!! All hail Mifki!! You are my new five-letter god! To HFS with that Armok guy. >_>

Logged
The in-game text has punctuation!  Who knew?
Mister Adams,
How many licks does it take to get to the [candy] center of a Dwarf Fortress?

Natti

  • Bay Watcher
  • Gremlin lurker
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #502 on: July 14, 2014, 09:34:00 am »

Hey, I seem to have a slight problem with the plugin. I'm running the DF starter pack thingy with Phoebus' graphics, and... well, the volcano looks like this:
Spoiler (click to show/hide)
Anybody know how to fix this, or what causes it?
Logged
+Amazigh (~Amazigh@poop.poop) Quit (Quit: Life is your butter, I shall be the margarine, beware heart disease.)

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #503 on: July 14, 2014, 09:47:14 am »

It looks like it treats liquids as being transparent, and thus shows the bottom of them. While it could be cool to exploit this kind of effect, I'm pretty sure it's a bug at the moment.
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #504 on: July 14, 2014, 09:51:04 am »

Hey, I seem to have a slight problem with the plugin. I'm running the DF starter pack thingy with Phoebus' graphics, and... well, the volcano looks like this:
Spoiler (click to show/hide)
Anybody know how to fix this, or what causes it?

AFAIK that's intentional, the lava is lower than your current viewpoint, so there's a "fog" rendered above that makes it blueish. I'd say there's about 3-5 z-levels of air above the magma. You can use this commands in the dfhack window to change it:
Code: [Select]
multilevel fogcolor <r> <g> <b> command sets fog colour. Default is 0.1 0.1 0.3.
multilevel fogdensity <d> command sets fog density. Default is 0.15.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #505 on: July 14, 2014, 10:08:06 am »

I get the same effect in the middle of the volcano, with lava on the current level and every level below.
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #506 on: July 14, 2014, 10:24:05 am »

I get the same effect in the middle of the volcano, with lava on the current level and every level below.
You're right. Now that you mention it, it does show up at the magma see too, and imho it's kind of useful for obsidianizing to see how deep the magma is. So I'm a bit clueless how this can be solved satisfactorily.

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #507 on: July 14, 2014, 10:46:05 am »

A good start might be making the magma red?
Logged

Natti

  • Bay Watcher
  • Gremlin lurker
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #508 on: July 14, 2014, 10:48:26 am »

Yeah, forgot to mention it looks like that even in the middle of the volcano, which seems a bit odd.
Logged
+Amazigh (~Amazigh@poop.poop) Quit (Quit: Life is your butter, I shall be the margarine, beware heart disease.)

salithus

  • Bay Watcher
  • gottagofast
    • View Profile
Re: Text Will Be Text - dfhack plugin
« Reply #509 on: July 14, 2014, 12:26:21 pm »

A good start might be making the magma painting the roses red?

couldn't help myself
Logged
Pages: 1 ... 32 33 [34] 35 36 ... 185