Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 6 7 [8] 9 10 ... 12

Author Topic: [44.12] Musket-Mod v0.5c: Experimental Wall Breaching  (Read 41617 times)

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #105 on: September 10, 2018, 02:06:17 pm »

The damage falloff right now just modifies velocity every 4 tiles of distance flown by something below 1 (or above 1 if your making a rocket or something). Its a bit crude and I might replace that with table that stores per-projectile properties (also handy for smoke, on-impact effects and preventing dumb stuff like smoke being triggered on bullets dropping after they ran out of reach), but it does work nicely for making gunpowder smallarms only go through armor at closer ranges, which was what they were known to do in the middle ages.

Dropping items from a height would in theory work and tried what your suggested, but the item only gets removed from the building holder list once it starts dropping, which is at least 1 tick so you would have to teleport it, use a timeout to wait for it to actually start dropping and then teleport it where you need it. Small bonus might be that it will already be a projectile at that point, so you might only have to change origin/target positions. Its... both kinda janky, so take your preferred pick :)

I should mention that moveToGround and then immediately moving it to container worked at some point when I set the move coords to 5,5,5 but it only worked on one map and I havn't been able to reproduce that. It was weird.

The thing about operator skill is a good point... if product-less reactions don't train them I'll have to add the skill manually since firing the cannon also doens't yield any product.

The way I'm having the reactions go faster now is by adding every initiated artillery job to a table, checking job.completion_timer every 50 ticks, doing nothing if its -1 (default state if no dwarf is working the job yet), to 80 if no target is found and to 0 if one is found as well as dropping the job from the table. Using completion_timer seems to have no downsides and doesn't have issues like gunners gaining skill from having commands cancelled, dwarves finding no targets will just wait for something to blast until the job is cancelled or presumably until the dwarf gets sick of it due to starvation/etc. The only issue I'm having is that the script seems to have trouble identifying a firer every now and then.

The trick I'm using right now for artillery dwarves getting spooked and running off is kinda dumb to be honest, I just make the front facing workshop tiles non-passable. It makes some amount of sense for medieval guns which were often placed behind wooden barricades, what with them often being set up in range of crossbows and other small weapons. I've not really tested it extensively though, my reserve solution was making the operator blind. Can't be spooked by things you can't see and blind dwarves don't really seem impeded in doing jobs. NOFEAR might work too, though it might result in typical dwarf behaviour of leaving the gun to charge and hit them with a sock.

I should also add that onJobInitiated triggers once the player orders up the job, immediately checking for a firer to modify results in the script borking because it doesn't have a firer yet.
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

zaporozhets

  • Bay Watcher
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #106 on: September 10, 2018, 07:05:37 pm »

The damage falloff right now just modifies velocity every 4 tiles of distance flown by something below 1 (or above 1 if your making a rocket or something). Its a bit crude and I might replace that with table that stores per-projectile properties (also handy for smoke, on-impact effects and preventing dumb stuff like smoke being triggered on bullets dropping after they ran out of reach), but it does work nicely for making gunpowder smallarms only go through armor at closer ranges, which was what they were known to do in the middle ages.

I'm actually putting in a table using your example ATM to store different smoke amounts, I haven't put the unique effects in yet, as I was worried about too many table lookups. It looks messier just doing weapon-type checks for weapon-specific function calls in onProjItemCheckMovement, but I think it might be nicer on performance. I'm using the weaponProperties table with indexes to avoid slower string hash lookups too, but again, messier.

Have you noticed any impact on performance storing more stuff in tables? I might just have to bite the bullet (npi), listen to thefriendlyhacker's reminder about writing to disk and get everything into a table if I'm able.

Dropping items from a height would in theory work and tried what your suggested, but the item only gets removed from the building holder list once it starts dropping, which is at least 1 tick so you would have to teleport it, use a timeout to wait for it to actually start dropping and then teleport it where you need it. Small bonus might be that it will already be a projectile at that point, so you might only have to change origin/target positions. Its... both kinda janky, so take your preferred pick :)

I should mention that moveToGround and then immediately moving it to container worked at some point when I set the move coords to 5,5,5 but it only worked on one map and I havn't been able to reproduce that. It was weird.

Damn. That's disappointing. I'll have to keep messing about, I'll be sure to let you know if I come across anything.

The way I'm having the reactions go faster now is by adding every initiated artillery job to a table, checking job.completion_timer every 50 ticks, doing nothing if its -1 (default state if no dwarf is working the job yet), to 80 if no target is found and to 0 if one is found as well as dropping the job from the table. Using completion_timer seems to have no downsides and doesn't have issues like gunners gaining skill from having commands cancelled, dwarves finding no targets will just wait for something to blast until the job is cancelled or presumably until the dwarf gets sick of it due to starvation/etc. The only issue I'm having is that the script seems to have trouble identifying a firer every now and then.

I should also add that onJobInitiated triggers once the player orders up the job, immediately checking for a firer to modify results in the script borking because it doesn't have a firer yet.

Doy, of course there is a counter for it.  :-[
It's nice that the unit stands ready too, would make the idea of a fixed machine gun possible. Could set the timer to a given point above zero (accounting for normal tick-down) corresponding to ammo remaining in the gun and decrement the counter for each bullet fired so the unit doesn't complete the reaction until the gun is empty (or he gets hungry as you say). Looking forward to getting my meathooks on your code and seeing your implementation, I like how thoroughly you think through these things.

I also have had some strangeness with missing firers, it can usually just be checked for and ignored for infantry weapon projectiles (as I'm sure you know), but it's definitely more of an issue for cannon reactions.
The only thing I can offer to help is upon failing to find a firer with the usual check, maybe grab all units in the workshop with dfhack.getUnitsInBox() when the timer starts (assuming the timer stays at -1 until the work actually starts) and checking their profession to ensure you have got the firer and not a kitty, might not be too useful if you need the firer straight away, though.

If that timer works as I think it does, it could give a much-needed modicum of control between a job starting and finishing. Thanks for sharing and being so open, I really owe you one.

The trick I'm using right now for artillery dwarves getting spooked and running off is kinda dumb to be honest, I just make the front facing workshop tiles non-passable. It makes some amount of sense for medieval guns which were often placed behind wooden barricades, what with them often being set up in range of crossbows and other small weapons. I've not really tested it extensively though, my reserve solution was making the operator blind. Can't be spooked by things you can't see and blind dwarves don't really seem impeded in doing jobs. NOFEAR might work too, though it might result in typical dwarf behaviour of leaving the gun to charge and hit them with a sock.

I did consider that method when I read your post, I'm guessing from what you say it causes no problems for the projectile. I'd also be concerned about loading under fire though, I think I'll have to test out some syndromes.
Removing sight is a fine idea, you might have to employ a timeout eyeball de-pluck for abandoned job cases, mind. That's the strangest sentence I've written today.
« Last Edit: September 10, 2018, 07:15:00 pm by zaporozhets »
Logged

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #107 on: September 11, 2018, 01:40:43 pm »

I'm having some issues with the tables still, I'll post it when everything is behaving as desired. Right now it works as long as there are a few guns all neatly completing their reactions, but it breaks once you spam a bunch of reactions (table becomes too large and complains about running out of memory) and when reactions are cancelled (the table entry will linger), I'll have to find a better way to check whether jobs are dead than just completion_timer being 0 and not store the entire job and building entry in the table (just the IDs instead and only looking up the actual job/building/units once the job is under way). I havn't noticed any effect on performance, but I've only let the timeout check the table every 50 ticks so it only does a single check on the job timer per job per 50 ticks, which isn't really a massive burden as long as the table doesn't become polluted with lingering rubbish.

I'm currently in the process of moving though so the next few days will be somewhat less productive for me.

Also yes, that last sentence would make an interesting out of context quote :)
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

Splint

  • Bay Watcher
  • War is a valid form of diplomacy.
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #108 on: September 11, 2018, 01:53:40 pm »

Really quick question, would copy-pasting the override stuff into a separate download of Meph's tileset break anything? I have absolutely no idea how graphic-related stuff works beyond some very bare-bones work I've started, and I'd love to have my engineering sector have just a bit more bite to it than a siegeworks and a couple mechanic workshops, and I don't wanna go just copy-pasting the override.txt into a fresh install of the tileset.

zaporozhets

  • Bay Watcher
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #109 on: September 11, 2018, 04:33:17 pm »

I'm having some issues with the tables still, I'll post it when everything is behaving as desired. Right now it works as long as there are a few guns all neatly completing their reactions, but it breaks once you spam a bunch of reactions (table becomes too large and complains about running out of memory) and when reactions are cancelled (the table entry will linger), I'll have to find a better way to check whether jobs are dead than just completion_timer being 0 and not store the entire job and building entry in the table (just the IDs instead and only looking up the actual job/building/units once the job is under way). I havn't noticed any effect on performance, but I've only let the timeout check the table every 50 ticks so it only does a single check on the job timer per job per 50 ticks, which isn't really a massive burden as long as the table doesn't become polluted with lingering rubbish.

I'm currently in the process of moving though so the next few days will be somewhat less productive for me.

Also yes, that last sentence would make an interesting out of context quote :)

No worries, man. I'll have a bash at something using what you've told me about the timer (thanks again for that) and you can have a good laugh at my bumbling attempts.
I've put in the cannon 'wall' and after finding adding anonymous syndromes and curses would be harder than I thought, I'll have to use vision_impaired until they get into the workshop. It's either that or define a NOFEAR syndrome in an 'adrenaline' inorganic and I'm not too happy about doing that, I was really hoping I could just insert a syndrome synthesized with DFHack.
Hope the move goes well for you and you get settled nicely.

Really quick question, would copy-pasting the override stuff into a separate download of Meph's tileset break anything? I have absolutely no idea how graphic-related stuff works beyond some very bare-bones work I've started, and I'd love to have my engineering sector have just a bit more bite to it than a siegeworks and a couple mechanic workshops, and I don't wanna go just copy-pasting the override.txt into a fresh install of the tileset.

It shouldn't do as long as you only paste in the tileset declaration:
Code: [Select]
[TILESET:musketmod.png:musketmod.png:musketmod_overrides]
as well as the block starting with:
Code: [Select]
[OVERRIDE:228:I:TRAPCOMP:TRAPCOMP:0:musketmod_overrides:83] - cannonball
over the block containing the vanilla trapcomps (so as to update the indexes) into the new overrides.txt.

I'm quite curious as to why you want to add the overrides into a new file rather than copying it, is it due to the new release of Meph's tileset, a mod or something else?
If it's the new Meph tileset, I do apologize for not updating it sooner, I'm nearly done with the next version which will support it.

BTW, did you find everything to be deadly enough for your tastes and to justify the material investment?
Logged

Splint

  • Bay Watcher
  • War is a valid form of diplomacy.
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #110 on: September 11, 2018, 04:52:14 pm »

It is indeed due to updates to the main tileset (of which I suspect another might be coming soon, but I'd have to ask Meph to confirm.) He asked me to show off the tileset, and I figured I'd go ahead and add a few other mods mainly to spice things up, since just a boring old building fort isn't really my style - I'm a war-mongering jackass after all, and I figure I can use it as an opportunity to tell a good story and use the tileset to make a fort that looks damned good while doing it.  ;D

Besides, tell me that copper set isn't begging to be a building for a gunsmith.

I haven't actually used it yet though, unfortunately. Been fiddling around with a whole bunch of other stuff, both mods and not, as well as chipping away at graphics for ZM5's cavern and biome mods, which is... Well, even if I weren't drawing for money or playing games alongside everything else, it's still gonna be a herculean task just in terms of number of things. But I'm genning up a world with the musket mod right now, mainly to see it in action alongside bug-testing stuff of my own.

zaporozhets

  • Bay Watcher
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #111 on: September 11, 2018, 05:57:37 pm »

It is indeed due to updates to the main tileset (of which I suspect another might be coming soon, but I'd have to ask Meph to confirm.) He asked me to show off the tileset, and I figured I'd go ahead and add a few other mods mainly to spice things up, since just a boring old building fort isn't really my style - I'm a war-mongering jackass after all, and I figure I can use it as an opportunity to tell a good story and use the tileset to make a fort that looks damned good while doing it.  ;D

Besides, tell me that copper set isn't begging to be a building for a gunsmith.

I haven't actually used it yet though, unfortunately. Been fiddling around with a whole bunch of other stuff, both mods and not, as well as chipping away at graphics for ZM5's cavern and biome mods, which is... Well, even if I weren't drawing for money or playing games alongside everything else, it's still gonna be a herculean task just in terms of number of things. But I'm genning up a world with the musket mod right now, mainly to see it in action alongside bug-testing stuff of my own.

Ah, I am sorry for dropping the ball on that one and not getting this out sooner. The blame rests squarely on man flu for that.
It's a damned shame you won't get to gas/zap/flamethrow some gobbos/unspeakable horrors for your readers. I'm even retouching the sprites despite my limited ability:



I'm really digging the tesla-esque stuff, I've tried to incorporate material graphics into the workshops (copper cannon barrels and whatnot) but not yet found a way to make it work.

Let me know if you're unhappy with any of the weapons, and watch out for the explosive weapons causing massive fires if you embark in a forested or grassy area (unless a landscape ravaged by war and industry is what you're going for).

I really don't envy you taking that on, I had a look at your announcement and I'm impressed, those things look f*cking twisted (in the nicest possible way) but it seems like a lot of work, be careful not to burn yourself out. I especially like the Flesh Harvester, it's a cutie!
« Last Edit: September 11, 2018, 06:11:03 pm by zaporozhets »
Logged

Splint

  • Bay Watcher
  • War is a valid form of diplomacy.
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #112 on: September 11, 2018, 06:43:18 pm »

Believe it or not, if I can manage to make the place look like a blasted hellscape without  having to pumpstack up magma, whichr equires learning how to even do that, I'll consider it a win. I'll just need to be careful to not use rockets and the like while the infantry are beyond the defenses.  ;)

I also dunno why, but I'm digging the automusket's look.

Quote
I really don't envy you taking that on, I had a look at your announcement and I'm impressed, those things look f*cking twisted (in the nicest possible way) but it seems like a lot of work, be careful not to burn yourself out. I especially like the Flesh Harvester, it's a cutie!

Yeah, well, I figure since I can't really afford to pay someone and happen to have some drawing ability, might as well make them more accessible by including graphics, right? And that'd be on ZM5, he's the one who gave them purple-ish skin. :P

zaporozhets

  • Bay Watcher
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #113 on: September 12, 2018, 10:08:36 pm »

Believe it or not, if I can manage to make the place look like a blasted hellscape without  having to pumpstack up magma, whichr equires learning how to even do that, I'll consider it a win. I'll just need to be careful to not use rockets and the like while the infantry are beyond the defenses.  ;)

No, I completely understand. I've given some early thought to terrain and construction damage from explosions for that very reason, it'd take a lot of work if it's even possible but it would be fun to have a cratered and decimated landscape and would allow for Helm's Deep-esque wall breaches (albeit accidental ones) and a drilling and blasting workshop for mining too.
Friendly fire is going to be even more of a problem with chemical weapons leaving residue on goblinite.
Decontamination chambers and making fully covering uniforms should help. I don't really want to add in an explicit hazmat suit or anything. Doesn't seem right, more fun to let players design their own.

Yeah, well, I figure since I can't really afford to pay someone and happen to have some drawing ability, might as well make them more accessible by including graphics, right? And that'd be on ZM5, he's the one who gave them purple-ish skin. :P

Completely, I love the ascii look (especially wanderlust with the pastel colour scheme) but tilesets make playing so much easier on my atrophied brain. As a non-artist the amount of creatures just seems daunting. More power to you for taking those abhorrent f*ckers on.


Grim, I had a go at eye-plucking the firer and making them wait for a target, very slapdash, but seems to work if it's of any use to you: https://pastebin.com/5P1cZL5H
(hope I've credited you enough)

Note the addition of a killed check in isHostile() you may want to add, could explain the firing-at-seemingly-nothing bug you were having.
Only noticed the problem after repeated test firings at the corpse of an unfortunate wayward kitty. Foolish!
« Last Edit: September 13, 2018, 12:24:17 am by zaporozhets »
Logged

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #114 on: September 14, 2018, 03:23:55 pm »

Neat, the eye-poker will come of use for sure. I've found out what was causing my memory issues, namely not a memory issue; it just says that when it tried to check a job that no longer exists. Consequence of using a jobs table I guess, it should be faster but also a hassle to properly remove finished/canceled jobs.

Also hah, good catch on the hostility check. I wouldn't have figured dead things would still count as a unit, but I guess that is used for necromancers and such.

I should have this working once I figure out how to properly make a check identify job being dead (no luck in the short bit of time I've had, the only job property that is only present on canceled jobs is general_refs[0] instead of general_refs[1], these change numbers throughout for some reason but nuking any job with
  • should do the trick), hopefully not too long after I'm done moving.
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

zaporozhets

  • Bay Watcher
    • View Profile
Re: [44.12] Musket-Mod v0.4i
« Reply #115 on: September 14, 2018, 08:20:42 pm »


Sounds like it should do, but I'm wondering if you're removing the actual jobs through setting the completion timer to 0 or through deleting them from the linked list. If you're doing the latter, did you catch the discussion on the current DFHack thread on page 97 where Fleeting Frames was attempting the same and expressed concern about memory leakage? Might be pertinent.
I'm personally hoping that completing the job with timer modification is triggering the GC and that nothing more needs to be done, though I have no way of checking (that I know of) without creating a reference to the job and impeding collection.

Also discovered a bug with the old targetDistance algorithm you might not have noticed whereby the target being at certain positions away from the cannon can result in the tile passability check being off by one either way.
As best I can tell it's due to them having to use differing methods of obtaining distances and me rejecting Pythagoras' theorem like the idiot I am. I've learned my lesson.

Changed waitForTarget(), canPathTo(), findDistance() and added tilePassable() and with many dead sheep bits in a refuse pile next to my cannon I'm confident it's fixed (thank f*ck).
Hope you've not made it too difficult on yourself to implement the fixed stuff with your modifications (more like improvements) but it should be easy enough to run a diff against the last version I posted and go from there (text-compare.com comes in handy if you don't have something in your environment), as always don't hesitate to ask.

https://pastebin.com/V8YPeiet

Edit: As a follow-up to expressing interest in terrain damage, I've done some really early tests and it seems easy enough to have wall-breaching explosives at the very least:
« Last Edit: September 15, 2018, 07:54:34 pm by zaporozhets »
Logged

DWARFFRAWD

  • Bay Watcher
    • View Profile
Re: [44.12] Musket-Mod v0.5: Tesla Guns and Chemical Warfare
« Reply #116 on: September 16, 2018, 03:05:39 am »

I found mismatch.
tesla gun's token names are not same.


in reaction.txt ,
[PRODUCT:100:1:WEAPON:ITEM_WEAPON_GUN_LIGHTNINGGUN:GET_MATERIAL_FROM_REAGENT:B:NONE]

in weapon.txt ,
[ITEM_WEAPON:ITEM_WEAPON_GUN_TESLAGUN]
   
Logged

Sver

  • Bay Watcher
  • An army marches on its oiling and waxing
    • View Profile
Re: [44.12] Musket-Mod v0.5: Tesla Guns and Chemical Warfare
« Reply #117 on: September 16, 2018, 09:43:40 am »

Hey, nice work on the firearms! Would you mind if I make a compatibility patch between your mod and mine?

Also, in [REACTION:CANNONBALL], a closing bracket is missing in the line [CATEGORY_PARENT:FORGE_AMMO
Nothing cruicial, but the workshop category will probably not work properly.
Logged
DF Combat Reworked
No overpowered force transfer, no easy life without a kidney, more functional variety among the weapons and other improvements.

zaporozhets

  • Bay Watcher
    • View Profile
Re: [44.12] Musket-Mod v0.5: Tesla Guns and Chemical Warfare
« Reply #118 on: September 16, 2018, 11:58:39 am »

I found mismatch.
tesla gun's token names are not same.


in reaction.txt ,
[PRODUCT:100:1:WEAPON:ITEM_WEAPON_GUN_LIGHTNINGGUN:GET_MATERIAL_FROM_REAGENT:B:NONE]

in weapon.txt ,
[ITEM_WEAPON:ITEM_WEAPON_GUN_TESLAGUN]

Hey, nice work on the firearms! Would you mind if I make a compatibility patch between your mod and mine?

Also, in [REACTION:CANNONBALL], a closing bracket is missing in the line [CATEGORY_PARENT:FORGE_AMMO
Nothing cruicial, but the workshop category will probably not work properly.

Thanks guys, I'm an idiot!
Hope it didn't cause you any trouble.

Sver, of course you can.
Can I be straightforward and ask if you're simply being lovely in asking or are genuinely unsure, a few people have asked and I'm worried I've not made it clear enough in the OP that I'm happy for this stuff to be used for whatever. Maybe everyone is just being nice and polite.
Logged

Sver

  • Bay Watcher
  • An army marches on its oiling and waxing
    • View Profile
Re: [44.12] Musket-Mod v0.5: Tesla Guns and Chemical Warfare
« Reply #119 on: September 16, 2018, 12:31:23 pm »

Sver, of course you can.
Can I be straightforward and ask if you're simply being lovely in asking or are genuinely unsure, a few people have asked and I'm worried I've not made it clear enough in the OP that I'm happy for this stuff to be used for whatever. Maybe everyone is just being nice and polite.

Oh, well, it's just that the head post talks specifically about scripts (which will not conflict with my mod in any way - I'm only modifying the raws), and I'm generally wary of straightaway including a huge chunk of someone else's work into my own upload, even with some changes applied.
I mean, it probably wouldn't hurt to specify that the raws are ok to use/modify too - if that's what you want. Then, some people may still be wary or just polite, but wha' can do about it :)
« Last Edit: September 16, 2018, 12:33:46 pm by Sver »
Logged
DF Combat Reworked
No overpowered force transfer, no easy life without a kidney, more functional variety among the weapons and other improvements.
Pages: 1 ... 6 7 [8] 9 10 ... 12