Bay 12 Games Forum

Please login or register.

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

Author Topic: Stop plant-trampling the easy way!  (Read 2655 times)

Mel_Vixen

  • Bay Watcher
  • Hobby: accidently thread derailment
    • View Profile
Re: Stop plant-trampling the easy way!
« Reply #15 on: January 20, 2009, 06:56:54 pm »

Also, I think the tile structure will have some free bits anyway now that splatters are getting shifted to a dynamically allocated system.
 

Ok i am not fond in the Mapping or the Memohacking but if i were the Programmer i would just give every Item and splatters are items now, an XYZ Coordinate or container ID that determines its current place. Since it would be messy to have the old flags still around i atleast would remove them.
Logged
[sarcasm] You know what? I love grammar Nazis! They give me that warm and fuzzy feeling. I am so ashamed of my bad english and that my first language is German. [/sarcasm]

Proud to be a Furry.

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Stop plant-trampling the easy way!
« Reply #16 on: January 20, 2009, 07:39:27 pm »

Footkerchief, just depends on whether you want to optimize for speed or for space!  It's just one more check, and it's actually pretty efficient--just one read and one branch--but if your dwarves are checking ten thousand tiles a second, that's...

Okay, fine, it's minimal.  c.c  I just have optimization on the brain, and this is one of those cases where you have to make your optimization decisions early.
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

CobaltKobold

  • Bay Watcher
  • ☼HOOD☼ ☼ROBE☼ ☼DAGGER☼ [TAIL]
    • View Profile
Re: Stop plant-trampling the easy way!
« Reply #17 on: January 21, 2009, 05:48:11 am »

Maybe make it higher than 5, just in case you get a really badly organized map and that 5 wouldn't change the pathing. But, yeah, I like it.
Just changing from normal (2) to low(5) is enough to di'ert unless you ha'e to do a seriously circuitous:
Code: [Select]
22*
252
*22
Bottom left to top right would be 6 length if no low-traffic. Di'erting by one square is 8-cost, and walking o'er is 9-cost.

...Actually, I think that if this is your test case, your costs would want to be 1, 3, 7, 15, as that's the minimum that forces di'ersion in each case. (But there're naturally other things you want to a'oid with much larger cases, like that magma channel.) hmm....

And actually, with the water system, does not trampling anything at all get anyone else problems getting trees to complete?
Logged
Neither whole, nor broken. Interpreting this post is left as an exercise for the reader.
OCEANCLIFF seeding, high z-var(40d)
Tilesets

PTTG??

  • Bay Watcher
  • Kringrus! Babak crulurg tingra!
    • View Profile
    • http://www.nowherepublishing.com
Re: Stop plant-trampling the easy way!
« Reply #18 on: January 28, 2009, 06:08:15 pm »

It's at least a little complicated.  I think it'll cost two bits per tile to implement, or 415k of memory on a 6x6 map that's all dug out.  When a harvestable grows, you store its current pathfinding cost into two bits, and overwrite its value on the map with the shrubbery cost (if higher).  When the harvestable is removed (harvesting, death, etc), you restore the original values.  If the player designates a new path cost overtop of your shrubberies, just store that new value into the the tile's cost and into the 'backup', so it'll keep the new value when the shrubbery goes away.

You kinda have to do it that way.  Because if you didn't change the pathfinding cost, and instead checked to see "is there a shrubbery here" every step of pathing, you'd see slowdowns.  Pathing loops can be made -really- tight, and adding even a single extra check for each tile is something that you don't want.

And yeah, even deep underground needs to be checked for shrubberies, in case you found spores and have a tree farm somewhere!
Much simpler than that, though. Just add five if a shrubbery appears, then subrtract five when it goes away. That's all; no new memory, even.
Logged
A thousand million pool balls made from precious metals, covered in beef stock.

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Stop plant-trampling the easy way!
« Reply #19 on: January 28, 2009, 06:38:21 pm »

Wrong, because path costs aren't stored as numbers, I'm pretty sure.  They're stored as one of (high, normal, low, forbidden) and only take up two bits that way.
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Duke 2.0

  • Bay Watcher
  • [CONQUISTADOR:BIRD]
    • View Profile
Re: Stop plant-trampling the easy way!
« Reply #20 on: January 28, 2009, 06:54:32 pm »


 Or we could set sizes to plants, so creatures smaller than the plants require a bit of climbing or such to get around, and if large enough you can walk over the plant. We can apply this to trees, to represent elves climbing trees and titans walking over them. Thus you would not need to have an order for such things, as dwarves automatically know that large bush will require more time and effort to walk through than to just walk around.

 Then we can set various other things to require different amounts of effort, like dwarves not climbing on tables because they require the dwarves to climb on said tables. Or boulders being avoided because it requires effort to climb.
Logged
Buck up friendo, we're all on the level here.
I would bet money Andrew has edited things retroactively, except I can't prove anything because it was edited retroactively.
MIERDO MILLAS DE VIBORAS FURIOSAS PARA ESTRANGULARTE MUERTO

Nesoo

  • Bay Watcher
    • View Profile
Re: Stop plant-trampling the easy way!
« Reply #21 on: January 28, 2009, 07:31:51 pm »

It's at least a little complicated.  I think it'll cost two bits per tile to implement, or 415k of memory on a 6x6 map that's all dug out.  When a harvestable grows, you store its current pathfinding cost into two bits, and overwrite its value on the map with the shrubbery cost (if higher).  When the harvestable is removed (harvesting, death, etc), you restore the original values.  If the player designates a new path cost overtop of your shrubberies, just store that new value into the the tile's cost and into the 'backup', so it'll keep the new value when the shrubbery goes away.

You kinda have to do it that way.  Because if you didn't change the pathfinding cost, and instead checked to see "is there a shrubbery here" every step of pathing, you'd see slowdowns.  Pathing loops can be made -really- tight, and adding even a single extra check for each tile is something that you don't want.

And yeah, even deep underground needs to be checked for shrubberies, in case you found spores and have a tree farm somewhere!
Much simpler than that, though. Just add five if a shrubbery appears, then subrtract five when it goes away. That's all; no new memory, even.

I had thought of that too, but then things could get mucked up if the player changes the traffic designation for the tile (assuming that it's stored as a number, but I doubt that).
Logged
000508 □ [dwarf mode][flows] flooding over a full pond will kill the fish inside

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Stop plant-trampling the easy way!
« Reply #22 on: January 28, 2009, 07:35:26 pm »

Then we can set various other things to require different amounts of effort, like dwarves not climbing on tables because they require the dwarves to climb on said tables. Or boulders being avoided because it requires effort to climb.

Ooh!  I love the aesthetics of that idea.  It'd become important to have walkways in your dining rooms, for example.  You could even make dwarves a little bit annoyed if they keep having to climb over stuff.

My only concern is potential for abuse.  Specifically, it becomes a very desirable tactic to surround your fortress with tables.  That way, goblins take longer to climb over them, and you can shoot them.  Of course, they could probably take cover under those stone tables, I guess...

Okay, rough terrain that the user can create is desirable as long as it can give partial concealment vs. attacks.  That doesn't benefit the player too much because a player would just want to build fortifications, getting more benefit for no detriment.  Plus it would make fights in a dining room more epic.
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Savok

  • Bay Watcher
    • View Profile
Re: Stop plant-trampling the easy way!
« Reply #23 on: January 28, 2009, 08:00:47 pm »

Ah, but table-to-table costs just as much as floor-to-floor.
Logged
So sayeth the Wiki Loremaster!

Duke 2.0

  • Bay Watcher
  • [CONQUISTADOR:BIRD]
    • View Profile
Re: Stop plant-trampling the easy way!
« Reply #24 on: January 28, 2009, 09:54:03 pm »

Ah, but table-to-table costs just as much as floor-to-floor.

 What I said before seems like something Toady would add anyway. What I am about to suggest seems even out of the way for Toady.

 Basically, weak tables would wobble and possibly even break, as with a titan standing on a XXrough wooden tableXX. Thus while you could walk from table to table, any weak ones or ones that cannot stand the weight of those trolls would collapse and stun them for a little bit. Titans would be large enough that the chance of them stumbling would be much smaller, but there.

 Or trolls could just turn over the tables and walk through the path.
Logged
Buck up friendo, we're all on the level here.
I would bet money Andrew has edited things retroactively, except I can't prove anything because it was edited retroactively.
MIERDO MILLAS DE VIBORAS FURIOSAS PARA ESTRANGULARTE MUERTO

Normandy

  • Bay Watcher
    • View Profile
Re: Stop plant-trampling the easy way!
« Reply #25 on: January 29, 2009, 09:22:15 pm »

I don't see how that's an exploit in any case; that sounds like it'd be a totally viable tactic, even in real-life. Granted you have a bunch of tables to spare. Maybe if a furniture factory was being sieged... Tables cost 1 stone, same as walls, and it could be sort of a last-resort say, if you don't have many defenses in place, you could put all the tables from your dining room into a giant palisade around your fort and give your small marksdwarf force a fighting chance.
« Last Edit: January 29, 2009, 09:24:37 pm by Normandy »
Logged
Pages: 1 [2]