Den of Thieves 2.0 (tactical stealth mod)

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by gfgtdf »

rgwesnoth wrote: May 3rd, 2020, 7:44 pm [*] Bug: Can't reload some missions from the very beginning after having been defeated. I tried to reload a rescue mission (the mission.tgz) file but it kept saying "defeated" while still changing up the units. I can reload from the auto-saves though.
This is probably an issue in the game engine but we probably won't change the engine behaviour for 1.14 . So what happens that the engine doesnt recall the leader because the sides type= attribute is empty. Even though the sides leader will be recalled the type= attribute must be set to let the engine know that you actuall want a leader to be recalled automaticially. Alterntiveley, you have to recall the the leader manually.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
demario
Posts: 131
Joined: July 3rd, 2019, 1:05 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by demario »

Hi jb and Bob_the_Mighty, thank you for the information.
I have played some more scenarios and things are looking really good.

I have some other circumstances where I am a bit confused on the AI moves.
That is kind of an issue as we are expected to play close around AI units based on information on how it behaves.
  • we have seen that if an alarmist can't reach a bell tower, he starts being very passive.
    I have found a case where the alarmist is on the bell tower and doesn't ring the alarm :shock:
  • the description of the trapper ability says that unit will find "any hidden traps within the unit's movement range."
    I actually was surprised that if a AI unit was blocking the way to the trap, the trapper couldn't see it anymore.
    If it is a feature, I am wondering if the description should be clearer. :hmm:
  • Last one is a patroller that starts moving the way towards hidden units.
    He even has different moves based on the position where units are hiding. That is quite confusing.
This obviously is small problems compared to the great achievement this campaign is.
But I am afraid it makes the learning curve unnecessary steep and could make people not giving it a fair chance.
I really hope my reports doesn't dishearten you, you did real nice thing with this game.
Last edited by demario on July 10th, 2020, 11:48 am, edited 1 time in total.
"simply put, it's an old game"T — Cackfiend
User avatar
Bob_The_Mighty
Posts: 870
Joined: July 13th, 2006, 1:15 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by Bob_The_Mighty »

Hey Demario, thanks for the ongoing feedback - very useful!

- The alarmist not ringing the alarm is a bug. It currently only rings the bell in a moveto event as I didn't consider that a unit could become an alarmist while being trapped like this. I will fix.

- The trapper issue has already been fixed in my version. Before it was using the spotter's movement range which is affected by ZoC; it should instead use the unit's vision range.

- The situation with the patroller is weird. Patrollers are set to walk their route unless there is a visible enemy within five hexes in which case they will move towards them. However, in your savegame the situation is unusual: there is a visible enemy within 5 hexes, so the patroller is released from his route, but he also cannot reach the visible enemy. So I think he might be reverting to default ai behaviour. Is he moving to capture the village maybe? The reason I am unsure is that side 4 is set to village_value=0, so it shouldn't really be doing that. Maybe gfgtdf can shed some light on it?
Last edited by Bob_The_Mighty on May 20th, 2020, 8:06 pm, edited 1 time in total.
My current projects:
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
User avatar
Bob_The_Mighty
Posts: 870
Joined: July 13th, 2006, 1:15 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by Bob_The_Mighty »

gfgtdf wrote: May 19th, 2020, 10:01 pm
rgwesnoth wrote: May 3rd, 2020, 7:44 pm [*] Bug: Can't reload some missions from the very beginning after having been defeated. I tried to reload a rescue mission (the mission.tgz) file but it kept saying "defeated" while still changing up the units. I can reload from the auto-saves though.
This is probably an issue in the game engine but we probably won't change the engine behaviour for 1.14 . So what happens that the engine doesnt recall the leader because the sides type= attribute is empty. Even though the sides leader will be recalled the type= attribute must be set to let the engine know that you actuall want a leader to be recalled automaticially. Alterntiveley, you have to recall the the leader manually.
Thanks gfgtdf, that seems to have fixed it. I wonder if you can help me with another problem I'm having with the side tag. The campaign has two starting scenarios, one for 2p and one for 3p. After that it uses the same 3p maps. 3p games play fine, however in a 2p game it keeps asking the host to assign a player to side 3 - even when side 3 has no leader and is set to controller=null in the opening 2p start scenario. I've tried a few different ways of eliminating this, but no luck. Can you tell what might be going on?
My current projects:
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by gfgtdf »

Well when the game advances to the next scenario it detects that it has a human side, that has no controller: the engine compares the save_id attributes to the save_id attributes of the previous scenario, and if there is a side with controller=human in the new scenario that it cannot assign a player to it shows the mp connect dialog.

There is no simple way to fix this problem, afaik the only way is to use scenario_generation=lua which involves a few lua lines, if you want i can help you with that.

EDIT: actually nevermind, the scenario_generation=lua approach i had in mind requires wesnoth 1.15.3 or later, so yes i don't think there is a good way do do it except maybe dublicating every scenario via macros. for that you can actually still make the memory footprint of your addon rather low by using the [load_ressource] inside [multiplayer]
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by mattsc »

Bob_The_Mighty wrote: May 20th, 2020, 7:58 pm - The situation with the patroller is weird. Patrollers are set to walk their route unless there is a visible enemy within five hexes in which case they will move towards them. However, in your savegame the situation is unusual: there is a visible enemy within 5 hexes, so the patroller is released from his route, but he also cannot reach the visible enemy. So I think he might be reverting to default ai behaviour. Is he moving to capture the village maybe? The reason I am unsure is that side 4 is set to village_value=0, so it shouldn't really be doing that. Maybe gfgtdf can shed some light on it?
You guessed correctly about what's going on, except the part with heading toward a village. You have the Patrol Micro AI filter set to only include units that are not within 5 hexes of one of the other sides' units. So the MAI does not control that spearman at 13,13 during this turn, which means that the default AI takes over. As no enemy unit is in range, an attack is not possible and the move-to-targets candidate action takes over instead. Below is some debug output that shows that the unit is moving toward the enemy leaders (and not a village).

If you can tell me exactly what behavior you want, I can probably make some suggestions how to achieve that.
AI debug output

Code: Select all

20200520 17:59:12 info ai/ca/move_to_targets: choosing move with 2 targets
20200520 17:59:12 { BEGIN: choosing move
20200520 17:59:12 info ai/ca/move_to_targets: Considering target at: 14,11
20200520 17:59:12 info ai/ca/move_to_targets: 3.75/10 = 0.375
20200520 17:59:12 info ai/ca/move_to_targets: Considering target at: 13,10
20200520 17:59:12 info ai/ca/move_to_targets: 3.75/16 = 0.234375
20200520 17:59:12 info ai/ca/move_to_targets: choose target...
20200520 17:59:12 info ai/ca/move_to_targets: complex targeting...
20200520 17:59:12 info ai/ca/move_to_targets: done complex targeting...
20200520 17:59:12 info ai/ca/move_to_targets: best unit: 13,16
20200520 17:59:12 info ai/ca/move_to_targets: grouping...
20200520 17:59:12 info ai/ca/move_to_targets: done grouping...
20200520 17:59:12 info ai/ca/move_to_targets: Moving to 13,13
20200520 17:59:12 } END: choosing move (took 5ms)
20200520 17:59:12 info ai/ca/move_to_targets: choose_move ends with 2 targets
20200520 17:59:12 info ai/ca/move_to_targets: move: 13,16 -> 13,13
20200520 17:59:12 info ai/actions:  check_before full move by side 4 from location 13,16 to location 13,13
20200520 17:59:12 info ai/actions: start of execution of: full move by side 4 from location 13,16 to location 13,13
You can ignore most of that. The important part is that there are two targets, at 14,11 and 13,10, which are the two enemy leaders, and that's what the patroller is moving toward.
demario
Posts: 131
Joined: July 3rd, 2019, 1:05 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by demario »

mattsc wrote: May 21st, 2020, 1:21 am You have the Patrol Micro AI filter set to only include units that are not within 5 hexes of one of the other sides' units. So the MAI does not control that spearman at 13,13 during this turn, which means that the default AI takes over. As no enemy unit is in range, an attack is not possible and the move-to-targets candidate action takes over instead. Below is some debug output that shows that the unit is moving toward the enemy leaders (and not a village).
Hi mattsc, thank you for the detailed explanation. This is very interesting to have a view of what is happening behind.
I hope Bob_the_Mighty will not mind my hijacking his thread but there is another run that I have trouble to understand.
I tried to use your magic (--log-info=ai/ca/move_to_targets), but it gives me nothing. It is basically the same position
with the conceal unit being on the other village. So it should look exactly the same for AI, right?
Still, the patroller attacks unit hidden on village now. What is happening? :shock:
mattsc wrote: If you can tell me exactly what behavior you want, I can probably make some suggestions how to achieve that.
As a player I was expecting the patroller to ... patrol some more :lol:
Last edited by demario on May 24th, 2020, 1:14 am, edited 1 time in total.
"simply put, it's an old game"T — Cackfiend
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by mattsc »

demario wrote: May 21st, 2020, 11:22 am I hope Bob_the_Mighty will not mind my hijacking his thread but there is another run that I have trouble to understand.
I cannot speak for Bob_the_Mighty, but my interpretation of his previous post is that both the former and this case (as you will see below) is not the behavior he desired. So it's probably okay, but BtM should tell us.
demario wrote: May 21st, 2020, 11:22 am As a player I was expecting the patroller to ... patrol some more :lol:
The reason why the patroller is not patrolling is the same as in the previous case: there are visible enemy units within 5 hexes (the woodsman and bandit in the north) and BtM has the Micro AI filter set so that the unit does not patrol in this case. So that's a scenario setup issue that can be resolved (assuming it is undesired, which is not my call to make).
demario wrote: May 21st, 2020, 11:22 am I tried to use your magic (--log-info=ai/ca/move_to_targets), but it gives me nothing.
That's because it is not the MtT candidate action that does the move, but the village grabbing action (see debug output below). Bob_the_Mighty says that he has village_value set to zero (and he has, I checked using the inspector). However, as explained on AiWML, that only means that the AI does not send units toward village targets (in other words, villages that are out of reach) with the move-to-targets CA. Village grabbing is handled by a different CA. If you do not want village grabbing to happen, you need to remove the villages CA.

Hope that makes sense. In brief, the AI is doing exactly what it is instructed to do. Again, Bob_the_Mighty, let me know if you would like help changing the side setup (assuming that you want to do so in the first place, that is).
More AI debug output

Code: Select all

20200521 12:53:44 debug ai/stage/rca: Ending candidate action evaluation loop because current score 60000 is greater than the upper bound of score for remaining candidate actions 40000
20200521 12:53:44 debug ai/stage/rca: Executing best candidate action: candidate action with name [ai_default_rca::get_villages_phase]
20200521 12:53:44 info ai/actions:  check_before full move by side 4 from location 13,16 to location 15,15
20200521 12:53:44 info ai/actions: start of execution of: full move by side 4 from location 13,16 to location 15,15
20200521 12:53:44 info ai/actions: Error #2005 (move_result::E_AMBUSHED) in full move by side 4 from location 13,16 to location 15,15
User avatar
Bob_The_Mighty
Posts: 870
Joined: July 13th, 2006, 1:15 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by Bob_The_Mighty »

gfgtdf wrote: May 21st, 2020, 12:09 amThere is no simple way to fix this problem, afaik the only way is to use scenario_generation=lua which involves a few lua lines, if you want i can help you with that. EDIT: actually nevermind, the scenario_generation=lua approach i had in mind requires wesnoth 1.15.3 or later, so yes i don't think there is a good way do do it except maybe dublicating every scenario via macros.
Thanks for looking at this, gfgtdf. I suppose I can live it how it works at the moment. In a 2p game it asks you to assign side 3 at the first scenario transition. If you assign it to an active player it stops asking on subsequent transitions (although that means chat comes out green instead of red). If there is a solution in 1.15.3 I would like to adopt that when it becomes stable.
My current projects:
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
User avatar
Bob_The_Mighty
Posts: 870
Joined: July 13th, 2006, 1:15 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by Bob_The_Mighty »

mattsc wrote: May 21st, 2020, 1:21 am You guessed correctly about what's going on, except the part with heading toward a village. You have the Patrol Micro AI filter set to only include units that are not within 5 hexes of one of the other sides' units. So the MAI does not control that spearman at 13,13 during this turn, which means that the default AI takes over. As no enemy unit is in range, an attack is not possible and the move-to-targets candidate action takes over instead. Below is some debug output that shows that the unit is moving toward the enemy leaders (and not a village).

If you can tell me exactly what behavior you want, I can probably make some suggestions how to achieve that.

You can ignore most of that. The important part is that there are two targets, at 14,11 and 13,10, which are the two enemy leaders, and that's what the patroller is moving toward.
Hey mattsc. Can I clarify the situation? So, the Spearman in demario's example (which is no longer controlled by the 'patroller' micro_ai) will move to capture an enemy village, but won't take the same move to capture an unclaimed village? And this has nothing to do with village_value, which only applies to villages that can't be reached in one move? And if there wasn't a village involved, it would move towards an enemy leader instead? What if all enemy leaders were hidden? So many questions!

Originally, I wanted ai units to follow set guard behaviours (such as following a patrol route) unless they could attack an enemy. I wasn't able to find a way to do this properly, because I couldn't figure out how to filter on reachable locations (the standard unit filters in the micro_ais don't seem to accept $this_unit.max_movement to check guards' movement range). So my compromise was to set the detection radius at 5 hexes. Is there an alternative to this workaround? Or a way to mitigate the unexpected moves it sometimes throws up? Ideally, I would like it to be a simple yes or no: can it reach a visible enemy? If so, attack as normal. Otherwise, carry on with guard behaviour.
My current projects:
MP pirate campaign: The Altaz Mariners
RPG sequel: Return to Trent
MP stealth campaign: Den of Thieves
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by mattsc »

Hey Bob. I'm going to reply to your questions later. I want to look at the two saves again and test a couple things first, just to be sure.

As for your desired behavior, if I understand you correctly that should actually be relatively simple to accomplish, I think, and without any work arounds. You want to set the score of the patrol candidate action lower than that of the attack (combat) candidate action, but higher than actions like village grabbing and move-to-targets. The default CA scores are given here. Thus, using ca_score=90000 in the [micro_ai] tag with the filter simply set to the id of the patrol unit(s) should do the trick.

Let me know if I misunderstood what you want the AI to do.
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by mattsc »

Okay, so here are the answers to your questions.
Bob_The_Mighty wrote: May 25th, 2020, 7:38 pm Can I clarify the situation?
Of course! It's always good when somebody tries to understand what the AI actually does, rather than treating it as a black box.
Bob_The_Mighty wrote: May 25th, 2020, 7:38 pm So, the Spearman in demario's example (which is no longer controlled by the 'patroller' micro_ai) will move to capture an enemy village, but won't take the same move to capture an unclaimed village?
Yes. That's because the patrollers' side has no leader. As the code puts it:

Code: Select all

		// If it is a neutral village, and we have no leader,
		// then the village is of no use to us, and we don't want it.
You can test that with the first save demario sent. If you either make the village enemy owned (debug-put a unit on it and then kill it or move it away) or turn one of the Side 4 units into a leader, the spearman will go for it.
Bob_The_Mighty wrote: May 25th, 2020, 7:38 pm And this has nothing to do with village_value, which only applies to villages that can't be reached in one move?
Correct.
Bob_The_Mighty wrote: May 25th, 2020, 7:38 pmAnd if there wasn't a village involved, it would move towards an enemy leader instead?
Also correct.
What if all enemy leaders were hidden?
In 1.14 and before, when there are no (visible) enemy leaders, no villages to move to, and no enemies within attack range, the AI is idle. This was changed for 1.15 by adding the move-to-any-enemy CA. See the last CA at the same link as in my previous post.
Bob_The_Mighty wrote: May 25th, 2020, 7:38 pm So many questions!
:) See my comment above. Questions are good. Let me know if anything remains unclear.
Computer_Player
Multiplayer Moderator
Posts: 181
Joined: March 16th, 2008, 6:39 am

Re: Den of Thieves (new MP stealth campaign system)

Post by Computer_Player »

I'm glad to welcome this new way of experiencing Wesnoth, its unlike almost any other add-on right now and I have (and am) quite enjoying it. I'm looking forward to further developments that are forthcoming, there are a many directions that you guys can do!

The learning curve is a bit steep (mistakes are punished hard, but that's par for stealth games). but once you get the hang of it you're fine. The hardest part is definitely early on when you are still learning about things, and where there is especially the risk of running out of gold by over recruiting or overleveling your units such that you can't recruit them anymore. Perhaps a loan mechanism to soften that risk and give a 2nd chance to finish the game?

I know you've got tons of Ideas, but please forgive me for putting some of mine here because I cant help it! :

Bombs can be picked up by non-carrying bombers (bombs are hard enough to use, so you can have a chance of correcting your wrong placement)
Different kinds of bombs (large range, incendiary, .. even healing bomb?)
Trappers can trap animals (same way assassins can assassinate)
Trappers can deploy traps (sort of like the RPG era ... actually, I thought that was the same mechanic with trappers so I was confused early on with them)... ...basically bombers have large radius vs trappers being 1 hex.
Chance of bounty hunters / law enforcement encounters the higher the Doom counter is
Den of Thieves era be usable on normal MP maps (so we can have shadow pvp XD) or maybe have a heist battle with many players


Once again thank you and I'd continue testing/ playing it :)

P.S. ctrl + b = is your best friend
demario
Posts: 131
Joined: July 3rd, 2019, 1:05 pm

Re: Den of Thieves (new MP stealth campaign system)

Post by demario »

Bob_The_Mighty wrote: May 20th, 2020, 7:58 pm The [...] issue has already been fixed in my version.
Hi Bob, I don't know if you are still interested in problem reports on version 0.1.0.
But this one is so straightforward that you might still have missed it. So here it is.
When a leader talked twice to the boss first time in Den, he got 4 skills. 8)
That is the good thing to play on server with random people.
Bob_The_Mighty wrote: May 4th, 2020, 6:02 pm
Bug: I'm not super sure what triggered it, but I stepped on a poison trap and the poison trap failed to trigger. It gave me the error message shown in the screenshot below. It might've happened because right after I walked on the poison trap, I started panicking and quickly made a bunch of clicks or right-clicks. Just for clarification, after I stepped on the trap, I could see the poison bottle, but my unit didn't get poisoned and the poison bottle still remained under me.
Was the trap adjacent to an enemy that you were moving to attack? I'm not sure why, but I think the attack might interrupt the trap event and stop it from executing properly. Will fix.
I hit the problem a couple of time. It seems more random than that. In the first attachment you see it happening on a slow trap next to a door.
I think it is worth noting that this problem never happened in MP for me.

It happened a second time in the same game, it was on a poison trap (next to a door too):
- If you reload the auto-save and redo the moves it doesn't happen again.
- If you save the replay and play it back, it doesn't happen in replay.

At turn 14, the situation looked much different in the replay from the game as in game the poison trap was not triggered, another unit could move on it and be poisoned. You can load the savegame or load it as replay in two wesnoth instances to see the difference at turn 14.
On AI move at turn 14, in replay, the 1 HP poisoned unit is not dying on hit which creates an OOS (as the unit was not poisoned in game, HP were higher).
Last edited by demario on July 10th, 2020, 11:50 am, edited 5 times in total.
"simply put, it's an old game"T — Cackfiend
ZEN-CAT
Posts: 47
Joined: April 21st, 2014, 7:41 am

Re: Den of Thieves (new MP stealth campaign system)

Post by ZEN-CAT »

Hey Bob and jb,

thx a lot guys for bringing this great scenario online. After playing the RGPs of Bob´s RPG era and having lots of fun, this is a very welcome new and fresh experiance. Today YourMaster and me finished the demo. Here are some of my "hopes and whishes" for the future: :D (some may have been posted before)

- 3 or 4 players would be awesome

- the later maps should be getting harder. After having leveled leaders and some other guys the guards are no match

- I agree that being able to pick up bombs or traps would be cool, but I also like it as it is

- there could be some possibility to hire units for gold with the abilities you lack in your team (due to units that died)

- this idea is from YourMaster: some sort of assassination mission would be cool. Like killing some well-guarded guy without being seen

So much for now :)
Post Reply