Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3]

Author Topic: Beta-test a mining-related utility  (Read 9065 times)

ctrlfrk

  • Bay Watcher
    • View Profile
Re: Beta-test a mining-related utility
« Reply #30 on: September 14, 2008, 05:18:13 pm »

Making it scale with mining skill might have some interesting effects when you hit hidden features...
It seems to use the 17x17 blocks when it does the mass reveal of the entire river/pipe/chasm.
So if a dabbling miner found the underground river hardly anything would be revealed.

You might want to update the link in the first post from beta1 to beta3. You don't actually have any links to it in this thread.
Not that it was hard to find... but people are lazy.
Logged

eerr

  • Bay Watcher
    • View Profile
Re: Beta-test a mining-related utility
« Reply #31 on: September 15, 2008, 06:48:19 pm »

what about random blocks within 2? 1 randomly revealed per level or something easy to scale like that...
Logged

ctrlfrk

  • Bay Watcher
    • View Profile
Re: Beta-test a mining-related utility
« Reply #32 on: September 16, 2008, 12:10:01 am »

Having never tried anything like this i can only guess how 0x517A5D is doing it, but id say it probably
involves changing 2 loops to go from -8 to +8 instead of -1 to +1.
Toady probably uses this miniloop to reveal tiles around any tile that triggers an updatevisibility event or some such.

I'm not sure how feasible it is to add code rather than just change existing constants.
If he can, then it would be possible to add a call to the rng and a 'continue;' if the returned value is
greater than whatever chance you want for the tile to be revealed.

Then again he said making the square a circle was "right out", and that would just be replacing
the call to the rng with a sqrt(x^2+y^2).

I think changing the code like that involves patching the exe directly, rather than patching the process after it's started.
Logged

Earthquake Damage

  • Bay Watcher
    • View Profile
Re: Beta-test a mining-related utility
« Reply #33 on: September 16, 2008, 06:40:00 pm »

Oooh!  This is a neat concept.  It'd be nice to see an option to set the detection radius, though.  It'd also be nice to see options to detect only ore, only gems, or both.
Logged

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Beta-test a mining-related utility
« Reply #34 on: September 16, 2008, 08:33:31 pm »

Having never tried anything like this i can only guess how 0x517A5D is doing it, but id say it probably involves changing 2 loops to go from -8 to +8 instead of -1 to +1.
That is exactly what I'm doing.

Quote from: ctrlfrk
I'm not sure how feasible it is to add code rather than just change existing constants.
It's very very difficult to add new code.  It's easiest to remove functionality completely, then it's five to ten times harder to change functionality, then it's five to ten times harder again to add new functionality.

Quote from: ctrlfrk
If he can, then it would be possible to add a call to the rng and a 'continue;' if the returned value is
greater than whatever chance you want for the tile to be revealed.
I can't easily call the game's RNG but I could put in a simple RNG of my own.  It just ups the difficulty.  If this is something most people want, I can try to do it.

Quote from: ctrlfrk
Then again he said making the square a circle was "right out", and that would just be replacing the call to the rng with a sqrt(x^2+y^2).
I've been thinking about how to do this.  I'd have to change the bounds of the inner loop on-the-fly based on the current value of the outer loop.  This is possible.  I likely wouldn't use the formula.  Instead I would hardcode the values.

So I retract the "right out" statement.  I could do it if that's what people tell me they want.

Quote from: ctrlfrk
I think changing the code like that involves patching the exe directly, rather than patching the process after it's started.
Often that's the easier path.  But this utility works with the in-memory copy of the game, while it's running.

Currently I'm just changing 4 bytes of the game.  01 to 08, twice, and FF to F8, also twice.  (FF is a signed byte -1, F8 is a signed byte -8.)

I do know how to add new code to the game, while it's running, using a technique called memory injection.  That's what I did with Regional Prospector.  It's not easy.  But I could.

Currently I'm going for the most bang for the buck, the most gain for the least pain.  That means sticking very close to how the game already does things.

The other thing is, the more I add, the more fragile my additions get.  I saw this with Regional Prospector.  I tried to make it automatically work with future versions of the game, but it kept breaking.  It got kind of annoying after a while.  Currently, the Stone Sense beta installs in every version from .32a (the first 3d version) onward.
Logged

ilsadir

  • Bay Watcher
    • View Profile
Re: Beta-test a mining-related utility
« Reply #35 on: September 21, 2008, 07:29:17 pm »

Clearly Toady just needs to create an NDA and copyright transferral agreement for you and let you do this in the code itself.  Days of work hacking hex or just a few minutes to create a nifty little feature in the code.

It sucks being a programmer and wanting to help.  My Adamantine Artifacts for SVN access!
Logged

Jifodus

  • Bay Watcher
  • Resident Lurker
    • View Profile
    • Dwarf Fortress Projects
Re: Beta-test a mining-related utility
« Reply #36 on: September 21, 2008, 10:59:45 pm »

Clearly Toady just needs to create an NDA and copyright transferral agreement for you and let you do this in the code itself.
I somehow don't think that would be as fun.
Logged
Pages: 1 2 [3]