[Feature Request] Force closest task on drop

[Feature Request] Force closest task on drop

Postby Bodsda » 11 Mar 2011, 14:47

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
User avatar
Bodsda
OD Moderator
 
Posts: 195
Joined: 18 Feb 2010, 08:19

Re: [Feature Request] Force closest task on drop

Postby andrewbuck » 11 Mar 2011, 14:55

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
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: [Feature Request] Force closest task on drop

Postby svenskmand » 11 Mar 2011, 17:49

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.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: [Feature Request] Force closest task on drop

Postby Bodsda » 11 Mar 2011, 20:31

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
User avatar
Bodsda
OD Moderator
 
Posts: 195
Joined: 18 Feb 2010, 08:19

Re: [Feature Request] Force closest task on drop

Postby svenskmand » 11 Mar 2011, 21:50

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?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: [Feature Request] Force closest task on drop

Postby StefanP.MUC » 11 Mar 2011, 22:01

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.
StefanP.MUC
 

Re: [Feature Request] Force closest task on drop

Postby andrewbuck » 12 Mar 2011, 03:49

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
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: [Feature Request] Force closest task on drop

Postby svenskmand » 12 Mar 2011, 07:15

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 :)
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: [Feature Request] Force closest task on drop

Postby StefanP.MUC » 12 Mar 2011, 11:27

If it's really trivial to code then I'd say: Yes, I want it already in 0.4.8. :D
StefanP.MUC
 

Re: [Feature Request] Force closest task on drop

Postby MCMic » 12 Mar 2011, 16:10

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?
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: [Feature Request] Force closest task on drop

Postby StefanP.MUC » 12 Mar 2011, 16:23

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();
}
StefanP.MUC
 

Re: [Feature Request] Force closest task on drop

Postby andrewbuck » 12 Mar 2011, 18:01

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
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: [Feature Request] Force closest task on drop

Postby Bodsda » 12 Mar 2011, 18:15

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
Last edited by Bodsda on 15 Mar 2011, 15:42, edited 1 time in total.
User avatar
Bodsda
OD Moderator
 
Posts: 195
Joined: 18 Feb 2010, 08:19

Re: [Feature Request] Force closest task on drop

Postby StefanP.MUC » 12 Mar 2011, 18:21

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).
StefanP.MUC
 

Re: [Feature Request] Force closest task on drop

Postby svenskmand » 12 Mar 2011, 18:30

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.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: [Feature Request] Force closest task on drop

Postby StefanP.MUC » 12 Mar 2011, 19:44

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.
StefanP.MUC
 

Re: [Feature Request] Force closest task on drop

Postby svenskmand » 12 Mar 2011, 20:47

It does in my DK1 I play it often, have not trid DK2 recently. Which dk edition do you have?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: [Feature Request] Force closest task on drop

Postby Skorpio » 12 Mar 2011, 20:58

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.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: [Feature Request] Force closest task on drop

Postby oln » 12 Mar 2011, 21:23

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)
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: [Feature Request] Force closest task on drop

Postby svenskmand » 12 Mar 2011, 21:23

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.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: [Feature Request] Force closest task on drop

Postby Bodsda » 15 Mar 2011, 15:47

I played DK2 yesterday and can confirm that you can drop imps on unclaimed tiles
User avatar
Bodsda
OD Moderator
 
Posts: 195
Joined: 18 Feb 2010, 08:19

Re: [Feature Request] Force closest task on drop

Postby TheAncientGoat » 15 Mar 2011, 16:57

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)
User avatar
TheAncientGoat
Community Moderator
 
Posts: 518
Joined: 27 Dec 2009, 19:06

Re: [Feature Request] Force closest task on drop

Postby oln » 15 Mar 2011, 17:22

This is something that will have to be tried to see if it should be used or not.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: [Feature Request] Force closest task on drop

Postby svenskmand » 15 Mar 2011, 17:36

TheAncientGoat {l Wrote}:Once we get LOS working

What is LOS?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: [Feature Request] Force closest task on drop

Postby TheAncientGoat » 15 Mar 2011, 17:46

Line Of Site (or Fog of War). Basically something to stop you from being able to drop your imps /anywhere/
User avatar
TheAncientGoat
Community Moderator
 
Posts: 518
Joined: 27 Dec 2009, 19:06

Who is online

Users browsing this forum: No registered users and 1 guest