Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: trap fixes  (Read 1434 times)

blizzerd

  • Bay Watcher
    • View Profile
trap fixes
« on: January 18, 2012, 07:19:58 am »

a well built trap line is a guaranteed defence against anything goblins can throw at you
i believe therefor that traps are too strong and effective at what they do... a well built "player designed" trap should approach this effectiveness, but not a simple construct building that just needs some caravan bought materials and some mechanics for example


therefor i suggest making the enemy able to "disable" them as with doors when they walk trough them

trapavoid > nothing changes, they walk trough traps without problem

non-trapavoid > they get captured/killed, but the trap becomes "visible" for every "sentient" enemy untill the trap is "cleaned" (different from traps that are jammed, but the same game mechanic... dwarf walks up to them and cleans the blood... therefor making enemies no longer have the smear of blood as a warning to danger)

for damage traps (weapon traps/spike traps etc) this means they still work, but enemies know they are there and will try to avoid the general area (5 on 5 area with the trap in the center gets +-100 pathing points added per tile (like in traffic designation) or something like it

maybe even a higher chance of not making the trap/pressure plate go off in the 5 on 5 area as the enemy is prepared now

for cage traps this means enemies depending on morale will ether "avoid" the trap as with damage traps or "attack" the trap (deconstruct it, but without the tag building destroyer needed) and in the process free any caged up person present on the tile and then proceed to treat that tile the same as with damage traps (avoid a 5 on 5 area with the trap as the center)

i know things like this have been suggested before, but why is it not implemented "before"? therefor i post this here as my interpretation of a good fix to both raise awareness and make a possible easy fix plan for toadyone
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: trap fixes
« Reply #1 on: January 18, 2012, 09:08:11 am »

i know things like this have been suggested before, but why is it not implemented "before"? therefor i post this here as my interpretation of a good fix to both raise awareness and make a possible easy fix plan for toadyone

Toady already knows it's popular.  That's why trap stuff is on the dev page:

Quote from: dev.html
Traps

    Whatever comes out of mechanics (below) should occur in the sites you explore to the extent that the traps can be detected and surpassed

Improved Mechanics

    Better traps
        Stone traps should require the stone be placed above the tile that is targeted
        Stones should be able to roll (perhaps if they are started from or land on a ramp tile)
        Weapon traps should be multi-tile and require a spring or other potential energy source -- automatic resetting should require some explicit establishment of a feasible mechanism
    Large pipe sections -- walk on them or crawl inside them, allow passage for fluids
    Moving fortress sections (lifts, crushing traps, etc.)
    Waterproof axles through some mechanism
    Rock grinders? Fans? We'll do some other machines around this time -- whichever feasible ones are the most entertaining for dwarves and treasure hunters
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: trap fixes
« Reply #2 on: January 19, 2012, 11:40:49 am »

for damage traps (weapon traps/spike traps etc) this means they still work, but enemies know they are there and will try to avoid the general area (5 on 5 area with the trap in the center gets +-100 pathing points added per tile (like in traffic designation) or something like it

Those extra pathing costs would only hurt FPS and not solve the AI issue.

It also does nothing against the deadliest trap I ever made:

| = upright steel spike * 3
^ pressure plate (connected to the spikes)
# = wall
. = floor

##########
|||||||||#
|||||||||#######
||||||||||||^...
|||||||||#######
|||||||||#
|||||||||#
##########


Roughly speaking.  It was the only path from the Western and Southern edges of my embark zone, first gobo to step off (stepping on retracts the spikes) that pressure plate killed the entire squad behind him.  At which point he'd then flee, as he was "outnumbered" and kill himself.

Northern and Eastern edges went to a tiny strip of land (hill that had its ramps removed, except one) that had a series of about 4 tiles with giant spinning blades in them.  Chunks when everywhere.  It didn't even matter if one of them got jammed, because there were still more traps behind it (and a gobo would have to walk over ALL of them to get to the fort).
« Last Edit: January 19, 2012, 11:43:06 am by Draco18s »
Logged

blizzerd

  • Bay Watcher
    • View Profile
Re: trap fixes
« Reply #3 on: January 25, 2012, 06:28:01 am »

for damage traps (weapon traps/spike traps etc) this means they still work, but enemies know they are there and will try to avoid the general area (5 on 5 area with the trap in the center gets +-100 pathing points added per tile (like in traffic designation) or something like it

Those extra pathing costs would only hurt FPS and not solve the AI issue.

It also does nothing against the deadliest trap I ever made:

1: pathing cost does not work like that, its not like pathing cost makes it step on X additional "unseen" tiles when it calculates it, it just makes a number go up faster, favoring other paths over the current one if they are shorter... and even if it did... since trapping and goblins are a small but very important part of the game, they should be able to have  an AI that is able to make semi-smart decisions... gobbos running in a meatgrinder hoping it will jam from all the gobbo goo is the main problem of sieges atm

also
Quote
maybe even a higher chance of not making the trap/pressure plate go off in the 5 on 5 area as the enemy is prepared now

this would imply a goblin squad to set off the trap, get massacred and from then on goblins in the area KNOW there is a pressure plate there, and that it triggers death... tey will try to avoid it as much as possible, but if they cant, they will go trough with an added "awareness" of the pressure plate, and chances of it springing will be reduced... (how much reduced i would make Dependant on factors (for example) as "survivors that saw it happening and ran away" (80% chance of dodging everything in a 5*5 area per goblin) to "heavily wounded goblins still alive inside the trap" (60% chance of dodging everything in a 5*5 area per goblin) to "bloody gore everywhere" (40% chance on dodging in a 5*5 area per goblin)

chances of dodging seem high, but remember that you can always put extra traps further down the hall...

Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: trap fixes
« Reply #4 on: January 25, 2012, 10:40:47 am »

for damage traps (weapon traps/spike traps etc) this means they still work, but enemies know they are there and will try to avoid the general area (5 on 5 area with the trap in the center gets +-100 pathing points added per tile (like in traffic designation) or something like it

Those extra pathing costs would only hurt FPS and not solve the AI issue.

It also does nothing against the deadliest trap I ever made:

1: pathing cost does not work like that, its not like pathing cost makes it step on X additional "unseen" tiles when it calculates it, it just makes a number go up faster, favoring other paths over the current one if they are shorter... and even if it did... since trapping and goblins are a small but very important part of the game, they should be able to have  an AI that is able to make semi-smart decisions... gobbos running in a meatgrinder hoping it will jam from all the gobbo goo is the main problem of sieges atm

You don't actually know how A* works, do you?

By artificially increasing the pathing cost of a tile like this, if that path is the only path, which is will be, because of how people play Dwarf Fortress,* the pathing algorithm's "number of tiles checked for lowest cost" skyrockets.

For every tile of "this is the only path" that has a path cost of 100 instead of 2, the algorithm adds to memory and spends CPU on fifty** normal cost tiles.

*Come on, seriously, how many untrapped paths to you give the gobos to get into your fortress?  How many of the trapped paths are more than 1 block wide?  More than 3?  5?

**This is actually a lower-bound.  The actual number is higher, as the path-cost has to be even, which means that each and every other possible path is 50 tiles longer......in every direction.
« Last Edit: January 25, 2012, 10:42:50 am by Draco18s »
Logged

blizzerd

  • Bay Watcher
    • View Profile
Re: trap fixes
« Reply #5 on: January 25, 2012, 11:24:07 am »

for damage traps (weapon traps/spike traps etc) this means they still work, but enemies know they are there and will try to avoid the general area (5 on 5 area with the trap in the center gets +-100 pathing points added per tile (like in traffic designation) or something like it

Those extra pathing costs would only hurt FPS and not solve the AI issue.

It also does nothing against the deadliest trap I ever made:

1: pathing cost does not work like that, its not like pathing cost makes it step on X additional "unseen" tiles when it calculates it, it just makes a number go up faster, favoring other paths over the current one if they are shorter... and even if it did... since trapping and goblins are a small but very important part of the game, they should be able to have  an AI that is able to make semi-smart decisions... gobbos running in a meatgrinder hoping it will jam from all the gobbo goo is the main problem of sieges atm

You don't actually know how A* works, do you?

By artificially increasing the pathing cost of a tile like this, if that path is the only path, which is will be, because of how people play Dwarf Fortress,* the pathing algorithm's "number of tiles checked for lowest cost" skyrockets.

For every tile of "this is the only path" that has a path cost of 100 instead of 2, the algorithm adds to memory and spends CPU on fifty** normal cost tiles.

*Come on, seriously, how many untrapped paths to you give the gobos to get into your fortress?  How many of the trapped paths are more than 1 block wide?  More than 3?  5?

**This is actually a lower-bound.  The actual number is higher, as the path-cost has to be even, which means that each and every other possible path is 50 tiles longer......in every direction.

you are making a mind error, if there is only 1 path, it will take the path no matter the cost, if there are 2 or more, it will take the path that has the lowest tile-cost of the 2... sure it will add "some" increase (note, this is from searching very short 3 to 4 tile loops around this tile, no more should be expected... so almost neglectable for most dwarf fortress applications

here is a simple tutorial on how its most commonly implemented
http://www.policyalmanac.org/games/aStarTutorial.htm
« Last Edit: January 25, 2012, 11:26:45 am by blizzerd »
Logged

Neonivek

  • Bay Watcher
    • View Profile
Re: trap fixes
« Reply #6 on: January 25, 2012, 11:31:46 am »

Personally I have one change to a trap but I don't think many people will agree with it.

The Rock Fall trap should be a LOT deadlier then it currently is. Right now it seems more like it pelts you with a modestly sized rock... rather then the Boulder it actually is.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: trap fixes
« Reply #7 on: January 25, 2012, 11:56:14 am »

you are making a mind error, if there is only 1 path, it will take the path no matter the cost, if there are 2 or more, it will take the path that has the lowest tile-cost of the 2... sure it will add "some" increase (note, this is from searching very short 3 to 4 tile loops around this tile, no more should be expected... so almost neglectable for most dwarf fortress applications

here is a simple tutorial on how its most commonly implemented
http://www.policyalmanac.org/games/aStarTutorial.htm

I am not making a "mind error."  I'm trying to tell you that execution speed will be abysmal if there is only one valid path.  That's why I said, "would only hurt FPS."

My whole point is that making the path cost go up means that the algorithm looks at more tiles to find an alternate path when there isn't one.*  That is, I am disproving your claim that "its not like pathing cost makes it step on X additional "unseen" tiles when it calculates it, it just makes a number go up faster, favoring other paths" because that's exactly what the path cost is.  Making it higher makes it look at more tiles.

*Or if there is, it is one that is significantly long enough to have a higher cost and appear longer.
« Last Edit: January 25, 2012, 12:04:15 pm by Draco18s »
Logged

blizzerd

  • Bay Watcher
    • View Profile
Re: trap fixes
« Reply #8 on: January 25, 2012, 05:00:30 pm »

you are making a mind error, if there is only 1 path, it will take the path no matter the cost, if there are 2 or more, it will take the path that has the lowest tile-cost of the 2... sure it will add "some" increase (note, this is from searching very short 3 to 4 tile loops around this tile, no more should be expected... so almost neglectable for most dwarf fortress applications

here is a simple tutorial on how its most commonly implemented
http://www.policyalmanac.org/games/aStarTutorial.htm

I am not making a "mind error."  I'm trying to tell you that execution speed will be abysmal if there is only one valid path.  That's why I said, "would only hurt FPS."

My whole point is that making the path cost go up means that the algorithm looks at more tiles to find an alternate path when there isn't one.*  That is, I am disproving your claim that "its not like pathing cost makes it step on X additional "unseen" tiles when it calculates it, it just makes a number go up faster, favoring other paths" because that's exactly what the path cost is.  Making it higher makes it look at more tiles.

*Or if there is, it is one that is significantly long enough to have a higher cost and appear longer.

it seems we are talking next to each other then onto a subject or conclusion, lets just move on with the suggestion
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: trap fixes
« Reply #9 on: January 25, 2012, 05:15:31 pm »

it seems we are talking next to each other then onto a subject or conclusion, lets just move on with the suggestion

The suggestion is bad because it will cause a drastic reduction in FPS and not solve the perceived problem.
Logged