Page 1 of 2

[Feature Request] Force closest task on drop

PostPosted: 11 Mar 2011, 14:47
by Bodsda
When you drop a creature, it should immediately look for the closest tasks and begin them. If there is a conflict, a priority order should be in place to handle this. For example, if I want to make a Kobold claim a particular area, I dont want to wait for him to decide that that is what he wants to do, me dropping him there is telling him to do it. This will also have benefits when things like the dojo or workshop are implemented, if I drop you in there, start training/working, dont walk off to decide what you want to do.

Bodsda

Re: [Feature Request] Force closest task on drop

PostPosted: 11 Mar 2011, 14:55
by andrewbuck
In principle this should be pretty easy to do. I think the pickupCreature() function clears their action state stack, we could add code to dropCrearture() function which does some checking to see what they should do and then pushes this action onto the top of their stack.

-Buck

Re: [Feature Request] Force closest task on drop

PostPosted: 11 Mar 2011, 17:49
by svenskmand
If you have a hungry creature, say then it should not just work because you tell it to, that is the point of the game, if the creatures wants to give you the finger and get some food it will, that was one of the core elements that made DK different from any other RTS game.

Re: [Feature Request] Force closest task on drop

PostPosted: 11 Mar 2011, 20:31
by Bodsda
svenskmand {l Wrote}:If you have a hungry creature, say then it should not just work because you tell it to, that is the point of the game, if the creatures wants to give you the finger and get some food it will, that was one of the core elements that made DK different from any other RTS game.


What if you drop it in the middle of a fight, or at a call to arms spell, 95% of the time, your instruction would win. If they started to disobey your, they would get that grey bubble and turncoat on you. Food is yummy, but not getting bludgeoned to death by a troll is more important.

Bodsda

Re: [Feature Request] Force closest task on drop

PostPosted: 11 Mar 2011, 21:50
by svenskmand
Lets say it is sleepy, hungry and still not paid, then it should flee. Who wants to fight for someone who does not appreciate your services?

Re: [Feature Request] Force closest task on drop

PostPosted: 11 Mar 2011, 22:01
by StefanP.MUC
I like Bodsdas idea. But I think it should affect only imps/workers in most cases (all other creatures are doing their own stuff normally). Just played a round DK1 and it really annoyed me that the imps didn't do what I wanted. Claiming some completly unneeded tiles when I really wanted them to hack some walls to increase the dojo. Even if I dropped them directly next to the walls, most of them went back to the tile claiming again because it still had a higher priority in their task queue.

The specifics about priority should be part of the balancing later on, however.
We have two situations: Fighting and non-fighting.
Fighting: workers flee (default) or fight (if there's no chance of fleeing/surviving). Non-workers fight (fleeing only in extremly Keeper-hating state and only with a possibility smaller than 100% -> balancing the number later on).
Non-Fighting: Workers forget their old task and look in the near-field for new work (that's why we drop them there in the first place). Are there several different tasks in the near field (wall hacking, gold mining, tile claiming, ...) than a priority list decides (-> balancing). Non-workers do as always: they do whatever they like.

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 03:49
by andrewbuck
I like the idea of applying different systems to workers/non-workers. The non-workers should primarily be driven by their own thoughts/desires. DK2 would just look at the tile you dropped them on and see if it was claimable. If it was they went to claim state, if not they checked to see if their neighbors were marked for digging, if they are they go into the dig state, otherwise they just idle.

Non-workers can just be put into the idle state and then they should automatically check for enemies, etc.

This system would be trivial to code, if you think it is a good one I can code it up.

-Buck

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 07:15
by svenskmand
StefanP.MUC {l Wrote}:I like Bodsdas idea. But I think it should affect only imps/workers in most cases (all other creatures are doing their own stuff normally). Just played a round DK1 and it really annoyed me that the imps didn't do what I wanted. Claiming some completly unneeded tiles when I really wanted them to hack some walls to increase the dojo. Even if I dropped them directly next to the walls, most of them went back to the tile claiming again because it still had a higher priority in their task queue.

The specifics about priority should be part of the balancing later on, however.
We have two situations: Fighting and non-fighting.
Fighting: workers flee (default) or fight (if there's no chance of fleeing/surviving). Non-workers fight (fleeing only in extremly Keeper-hating state and only with a possibility smaller than 100% -> balancing the number later on).
Non-Fighting: Workers forget their old task and look in the near-field for new work (that's why we drop them there in the first place). Are there several different tasks in the near field (wall hacking, gold mining, tile claiming, ...) than a priority list decides (-> balancing). Non-workers do as always: they do whatever they like.

This is how I want the system to be :)
andrewbuck {l Wrote}:I like the idea of applying different systems to workers/non-workers. The non-workers should primarily be driven by their own thoughts/desires. DK2 would just look at the tile you dropped them on and see if it was claimable. If it was they went to claim state, if not they checked to see if their neighbors were marked for digging, if they are they go into the dig state, otherwise they just idle.

Non-workers can just be put into the idle state and then they should automatically check for enemies, etc.

This system would be trivial to code, if you think it is a good one I can code it up.

-Buck

Sounds good :)

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 11:27
by StefanP.MUC
If it's really trivial to code then I'd say: Yes, I want it already in 0.4.8. :D

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 16:10
by MCMic
andrewbuck {l Wrote}:I like the idea of applying different systems to workers/non-workers. The non-workers should primarily be driven by their own thoughts/desires. DK2 would just look at the tile you dropped them on and see if it was claimable. If it was they went to claim state, if not they checked to see if their neighbors were marked for digging, if they are they go into the dig state, otherwise they just idle.

Non-workers can just be put into the idle state and then they should automatically check for enemies, etc.

This system would be trivial to code, if you think it is a good one I can code it up.

-Buck

But we can't drop a worker on a tile that's not already claim, can we?

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 16:23
by StefanP.MUC
No, it's not possible to drop on neutral/enemy tiles. But what has this to do with the dropping feature? Pseudo code:
{l Code}: {l Select All Code}
if(dropTile == ownTile)
{
  creature.drop();
  creature.findNewTaskInNearField();
}

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 18:01
by andrewbuck
You can drop workers on unclaimed dirt as well as your own tiles.

The new AI sequence could go like this. When the creature is dropped it checks to see if the tile type is dirt and if one of its neighbors is claimed for your color. If it is, it pushes a claimTile action to its queue. If the situation is not exactly that we push a digTile action which will cause the creature to dig any tiles it can see, if it can't see any it would then just revert to idle.

-Buck

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 18:15
by Bodsda
andrewbuck {l Wrote}:You can drop workers on unclaimed dirt as well as your own tiles.

The new AI sequence could go like this. When the creature is dropped it checks to see if the tile type is dirt and if one of its neighbors is claimed for your color. If it is, it pushes a claimTile action to its queue. If the situation is not exactly that we push a digTile action which will cause the creature to dig any tiles it can see, if it can't see any it would then just revert to idle.

-Buck



Ah, Buck, are you saying that currently if a kobold can't 'see' a tile to dig, it will go into idle state? This might explain why its so difficult to expand the dungeon currently

Bodsda

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 18:21
by StefanP.MUC
DK1/2 did't allow to drop on not owned tiles. I think this also shouldn't be possible in OD. With workers dropping everywhere you could just drop workers all over the map making the whole "crawl and explore" useless.

It should work like this: If you drop an imp close to dirt tiles, they forget their old task and claim the near dirt tiles (if there's a wall hack order in reasonable distance it should have higher priority though, because wall hacking is an explicit order, while claiming is only implicit).

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 18:30
by svenskmand
That is not correct DK 1 and 2 allowed you only to drop creature on claimed tiles and workers on claimed and dirt tiles, this also how Buck discribed it and how it should be for OD.

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 19:44
by StefanP.MUC
I currently play DK1 and it doesn't let me drop workers on dirt tiles. And this site confirms for DK2 that imps can only be dropped on own tiles (that's also in my own memory, didn't play DK2 in the last time).
Maybe they added/removed/changed it in a patch?

Didn't know that OD has the ability to drop workers on non-claimed tiles (never checked it until now, because I believed it doesn't work ;) ). But then there should at least be a limit to the distance (e.g. only allow dropping on dirt if it's at least 30 tiles or less to your main territory). Eveything else feels a bit like "cheating", IMHO.

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 20:47
by svenskmand
It does in my DK1 I play it often, have not trid DK2 recently. Which dk edition do you have?

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 20:58
by Skorpio
StefanP.MUC {l Wrote}:I currently play DK1 and it doesn't let me drop workers on dirt tiles. And this site confirms for DK2 that imps can only be dropped on own tiles (that's also in my own memory, didn't play DK2 in the last time).


That's odd, I still play DK1, too, and I can drop imps on dirt tiles. Maybe it's a bug. And I don't think dropping imps on dirt is a problem as long as they can only claim tiles which are adjacent to your territory. Of course you shouldn't be able to drop your workers on unexplored territory, but that isn't implemented in OD yet.

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 21:23
by oln
I also remember being able to drop imps on dirt, as long as the dirt was in sight of either creatures or buildings on your team. (And not the reveal spell)

Re: [Feature Request] Force closest task on drop

PostPosted: 12 Mar 2011, 21:23
by svenskmand
Skorpio {l Wrote}:
StefanP.MUC {l Wrote}:I currently play DK1 and it doesn't let me drop workers on dirt tiles. And this site confirms for DK2 that imps can only be dropped on own tiles (that's also in my own memory, didn't play DK2 in the last time).

That's odd, I still play DK1, too, and I can drop imps on dirt tiles. Maybe it's a bug. And I don't think dropping imps on dirt is a problem as long as they can only claim tiles which are adjacent to your territory. Of course you shouldn't be able to drop your workers on unexplored territory, but that isn't implemented in OD yet.

Yes that is also like in DK, and I think that is how it should be.

Re: [Feature Request] Force closest task on drop

PostPosted: 15 Mar 2011, 15:47
by Bodsda
I played DK2 yesterday and can confirm that you can drop imps on unclaimed tiles

Re: [Feature Request] Force closest task on drop

PostPosted: 15 Mar 2011, 16:57
by TheAncientGoat
While looking at DK for inspiration is a good idea, I don't think it should be the end-all factor to design decisions. Once we get LOS working, it could work having kobolds droppable anywhere (and could be an interesting advantage they have over "advanced" workers, although that feature has been dropped. As well as the wants thing, advanced workers could have normal creature desires, but oh well)

Re: [Feature Request] Force closest task on drop

PostPosted: 15 Mar 2011, 17:22
by oln
This is something that will have to be tried to see if it should be used or not.

Re: [Feature Request] Force closest task on drop

PostPosted: 15 Mar 2011, 17:36
by svenskmand
TheAncientGoat {l Wrote}:Once we get LOS working

What is LOS?

Re: [Feature Request] Force closest task on drop

PostPosted: 15 Mar 2011, 17:46
by TheAncientGoat
Line Of Site (or Fog of War). Basically something to stop you from being able to drop your imps /anywhere/