The Castle Doctrine Forums

Discuss the massively-multiplayer home defense game.

You are not logged in.

#1 2013-06-06 23:58:00

zed
Member
Registered: 2013-04-16
Posts: 160

Pet movement suggestion

With a game like this, it is important that the full details of the game
mechanics are as easy as possible to discover and reason about.

Currently there are two aspects of the game which are not immediately
transparent: sub-turn power propagation, and pet movement.

This post is about the latter.

The current mechanics in short: pets aim to maximise/minimise their distance
from the player; each turn, pets are processed in order according to current
position, processing row by row from bottom to top, left to right within rows.
When there is a choice, pets rank directions in descending order of
preference as follows: left, right, down, up.

The problem: the asymmetry this leads to, the simplest example being that a
column of dogs will move smoothly downwards but will stutteringly separate out
when ascending, is unintuitive. The result is that predicting pet movement
often becomes a matter of painstaking and error-prone calculation. This means
that puzzles which rely on the details of pet movement can be effective but
unfun.

It's important that the mechanics rely on simple rules, so complicated
solutions involving queuing systems are not a good idea.

I suggest instead the following simply tweak:

Instead of making the order of processing be as described above, reading
across the map from bottom to top, have it be in order of distance from the
(post-move) position of the player.

That's distance in terms of number of moves to get to the square - so
expanding in diamonds out from the player.

Within a diamond, it can still be from bottom to top and left to right,
although perhaps neater would be to have it go round, say, anticlockwise
starting from the square to the right of the player.

(So in other words, I am in short suggesting to enumerate the grid "in polar
co-ordinates" (with the grid metric) rather than the current cartesian ones)

I would suggest that direction preference for tie-breakers also be relative to
the player - e.g. a pet prefers the direction away from player, then the
direction 90 degrees anticlockwise from that, and so on rotating round.

The most obvious results of this: dogs would always flow smoothly towards you,
while cats would always skitter off, separating out. I think this would be
much more intuitive and so more easily learnable.

What do we think?

Offline

#2 2013-06-07 00:49:21

dalleck
Member
Registered: 2013-04-13
Posts: 250

Re: Pet movement suggestion

Pet movement centred around the player makes far more sense than the arbitrary movement system in place now.

I see your suggestion more as a cross-hair than a diamond though, as if a cross is radiating out from the character.


Pet Turn Order

(The numbers represent the order of preference given to movement.)

Is this what you mean?

Edit:

In addition, dogs should always favour moving forwards first, that is, the direction they are facing.  The movement step would turn dogs firstly, then do movement proper.  This would mean dogs would essentially move as they so now.

Cats, on the other hand I feel are completely wrong.  Cats should also favour 'forward' movement, that is, the direction they are facing, but cats always face away from you.  However, if you are in-line with a cat and they have run away from you and are backed against a wall they shouldn't favour either direction, they should be 'stuck' until you move out of their row/column and then they would run.  Cats also shouldn't get struck on the players row/column when you move onto/off their row/column.  The moment you approach the cat they should try to run away from you first, not towards the direction moved from.

These mechanics are actually quite difficult to discuss, and I hope I have made things clear as mud.

Last edited by dalleck (2013-06-07 05:38:31)


The rich aren't safe. Nobody is safe. -jere                   ...but the smell wafts out from the pit, obviously. - Jason Rohrer

And the more dickish they are, the more I feel like beating a house to destruction after finally figuring it out. -bey bey

Offline

#3 2013-06-07 06:07:49

zed
Member
Registered: 2013-04-16
Posts: 160

Re: Pet movement suggestion

dalleck wrote:

I see your suggestion more as a cross-hair than a diamond though, as if a cross is radiating out from the character.

Is this what you mean?

I don't think so. This is what I mean, using increasing numbers then letters
to indicate order of processing:

   g
  h7f
 i826e
j93*15d
 ka4co
  lbn
   m
dalleck wrote:

In addition, dogs should always favour moving forwards first, that is, the direction they are facing.

The problem with using facing is that it's based on your current position
rather than your new position. So it would lead to surprising behaviour like
your moving directly next to a dog which was one square diagonally away from
you, but the dog not moving onto your new position.

Offline

#4 2013-06-07 06:24:09

dalleck
Member
Registered: 2013-04-13
Posts: 250

Re: Pet movement suggestion

zed wrote:

The problem with using facing is that it's based on your current position
rather than your new position. So it would lead to surprising behaviour like
your moving directly next to a dog which was one square diagonally away from
you, but the dog not moving onto your new position.

I wasn't very clear in what I wrote, but I did try to specify that a direction change step would be processed before movement.  So firstly you would move, then the pets work out their new direction, and then they move.

Oh, and yes I can now see more or less what you are saying, and we are kind of saying the same thing, except I am trying to have pet movement use the the rows and columns the player is on first, and then others.
Perhaps more like a 'star'.  So perhaps I am suggesting a 'star' and you a 'diamond'.

Anyway, regardless of the system I am very much in favour of a more sensible model for pet movement.

Last edited by dalleck (2013-06-07 06:39:11)


The rich aren't safe. Nobody is safe. -jere                   ...but the smell wafts out from the pit, obviously. - Jason Rohrer

And the more dickish they are, the more I feel like beating a house to destruction after finally figuring it out. -bey bey

Offline

#5 2013-06-07 14:41:47

Matrix
Member
Registered: 2013-04-06
Posts: 137

Re: Pet movement suggestion

The current implementation uses simple rules already. What you are actually seeing as a problem is a non intuitive result (at least for most players I guess).

The update order that you are suggesting ("diamond" outwards clockwise/anticlockwise) is actually more complex than the current implementation, not simpler. If you think about it, puzzles relying heavily on animal movement mechanics wouldn't be any easier to solve with the suggested system, just the movement would look more intuitive to those players who find it unintuitive now. At the same time, those players who actually try to figure out animal movement in order to solve puzzles would have a more complex system to deal with.

Offline

#6 2013-06-07 16:10:38

zed
Member
Registered: 2013-04-16
Posts: 160

Re: Pet movement suggestion

Matrix wrote:

The current implementation uses simple rules already. What you are actually seeing as a problem is a non intuitive result (at least for most players I guess).

Yes. The current system is good - the results are entirely predictable, mostly
intuitive, and fairly easy to calculate.

Matrix wrote:

The update order that you are suggesting ("diamond" outwards clockwise/anticlockwise) is actually more complex than the current implementation, not simpler. If you think about it, puzzles relying heavily on animal movement mechanics wouldn't be any easier to solve with the suggested system, just the movement would look more intuitive to those players who find it unintuitive now. At the same time, those players who actually try to figure out animal movement in order to solve puzzles would have a more complex system to deal with.

I would say it's no more or less complicated, abstractly. It's the same basic
scheme, with some different choices for orderings. I hope it would make the
rules easier to discover without having to read about it in the source or the
forums, and make it easier for humans to predict details of pet movement.

I might be wrong!

Offline

#7 2013-06-07 19:36:03

dalleck
Member
Registered: 2013-04-13
Posts: 250

Re: Pet movement suggestion

Matrix wrote:

The current implementation uses simple rules already. What you are actually seeing as a problem is a non intuitive result (at least for most players I guess).

The update order that you are suggesting ("diamond" outwards clockwise/anticlockwise) is actually more complex than the current implementation, not simpler. If you think about it, puzzles relying heavily on animal movement mechanics wouldn't be any easier to solve with the suggested system, just the movement would look more intuitive to those players who find it unintuitive now. At the same time, those players who actually try to figure out animal movement in order to solve puzzles would have a more complex system to deal with.

What zed is suggesting is a system where specifically dogs don't separate when moving certain directions.  This is the unintuitive part.  Calculating movement based on player position corrects most of this.

The player doesn't need to know the system that movement is calculated by, just the results.  At the moment a pack of dogs move smoothly downwards and separate upwards, smoothly left and separate right.

I am also think the current cat movement could do with tweaks.


The rich aren't safe. Nobody is safe. -jere                   ...but the smell wafts out from the pit, obviously. - Jason Rohrer

And the more dickish they are, the more I feel like beating a house to destruction after finally figuring it out. -bey bey

Offline

#8 2013-06-07 23:55:56

jasonrohrer
Administrator
Registered: 2013-04-01
Posts: 1,231

Re: Pet movement suggestion

This is an issue, for sure.

But I'm going to table it for now while we iron out some of the bigger-picture issues.

It's a bad sign if the game is hinging so much on the nuances of animal movement, I think...  those nuances shouldn't matter as much as they do.

Offline

#9 2013-06-08 06:44:47

bey bey
Member
Registered: 2013-04-20
Posts: 386

Re: Pet movement suggestion

Maybe the number of dogs in the house should be limited? Or even number of pets? Say a max of 12 pets? Hrm, but then again, that would mean that one could EITHER protect the family or do dickish doggie-kittie-dance locks. Then not having a family would once more be such a big advantage that I'd go for being single.


In fact you can be batman.
(if he robbed houses and murdered families.)
- Dalleck

Offline

#10 2013-06-08 10:09:33

zed
Member
Registered: 2013-04-16
Posts: 160

Re: Pet movement suggestion

jasonrohrer wrote:

It's a bad sign if the game is hinging so much on the nuances of animal movement, I think...  those nuances shouldn't matter as much as they do.

I don't think you can hope for nuances not to matter. A house can always be
designed whose solution will hinge on the precise behaviour in a given
situation.

So I think the best you can do is aim to have the nuances as unsurprising and
easily discovered and learnt as possible.

Offline

#11 2013-06-08 19:52:52

metaldev
Member
Registered: 2013-06-04
Posts: 22

Re: Pet movement suggestion

I don't think you can hope for nuances not to matter. A house can always be
designed whose solution will hinge on the precise behaviour in a given
situation.

I actually disagree.  You could add randomness to the movement choice of the animals... this would really change the game of course,  but it is a way to destroy precise behavior mechanics.

Offline

#12 2013-06-08 20:59:38

dalleck
Member
Registered: 2013-04-13
Posts: 250

Re: Pet movement suggestion

metaldev wrote:

I don't think you can hope for nuances not to matter. A house can always be
designed whose solution will hinge on the precise behaviour in a given
situation.

I actually disagree.  You could add randomness to the movement choice of the animals... this would really change the game of course,  but it is a way to destroy precise behavior mechanics.

I have considered that before.  However, the outcome would be that a house that was possible to solve during a test may indeed become completely impossible for one to rob, or more correctly, a 'shot in the dark'.


The rich aren't safe. Nobody is safe. -jere                   ...but the smell wafts out from the pit, obviously. - Jason Rohrer

And the more dickish they are, the more I feel like beating a house to destruction after finally figuring it out. -bey bey

Offline

#13 2013-06-09 15:39:38

bey bey
Member
Registered: 2013-04-20
Posts: 386

Re: Pet movement suggestion

Probably the biggest problem is, that at this point, it is a working game, yet not the game it was intended to be. It needs a few twists, but it's one way of doing TCD (w blueprints, switches etc.).

Probably you might consider starting a radically simplified different server, as a trial run, where there are no switches, or no frying floors, or only non-conducting walls etc. Because the changes would have to be rather drastic, a solution (for the alpha phase at least) of having a blueprints-electronics-server and a different server that takes out elements to make puzzle electronics impossible seems elegant somehow. One could just see what finds more acceptance ultimately.


In fact you can be batman.
(if he robbed houses and murdered families.)
- Dalleck

Offline

#14 2013-06-10 11:39:32

jasonrohrer
Administrator
Registered: 2013-04-01
Posts: 1,231

Re: Pet movement suggestion

Well, just like I never wanted to make a game that was extremely "solve this really hard, tedious puzzle" focused, I also didn't want to make a game with no interesting electronics in it.

So, removing electronics (switches) from the game is not an option.  Nor is removing animals.

Anyway, I'm convinced that it's also possible to make a maze-like thing, with animals moving around, that is NP-Hard in the generalized (NxN map) case.  Essentially where there is one solution, and the only practical way to find that solution is to try an exponential number of solutions via brute force, even if you have the full map.  In other words, a "magic dance" with no switches at all.

So, the only way to prevent NP-Hard (i.e., tedious) puzzles with the current setup is to restrict all houses to being completely devoid of all dynamic objects!

In other words, looking for some subset of the current house objects that will solve this problem is a dead end.  The problem needs to be flipped upside down.

Offline

#15 2013-06-10 13:33:09

DrNoid
Member
Registered: 2013-04-06
Posts: 56

Re: Pet movement suggestion

Indeed, the question is: How to entice people to make houses that are interesting to rob.

That means the "goal" of the game should change from "Make it impossible to be robbed" to "Make as many people as possible try to rob me"

Instead of trying to stop people from making NP-Hard houses, having an NH-Hard house should not make you "win" the game.

Though I think that would be hard to combine with the theme.

Offline

#16 2013-06-11 07:09:16

Laffinty
Member
Registered: 2013-06-10
Posts: 46

Re: Pet movement suggestion

Hmm either i'm failing to understand your description of how pets move or I dont know..

3djN6.jpg
If i step down now, on top of the cat, it has 1 possibility to move (up) to increase its distance from 0 to 1
Which it does, if i step back up, ontop of the cat again it has 2 possibilities to increase its distance from 0 to 1
By order of preference it would choose down and go back into the dead-end, however it seems to choose up

Or am i getting something wrong?
also once here:
3djPd.jpg
it would have 2 possibilties, right and up, it chooses to go up, but by your order of preference it would prefer to go right (and it keeps going "up" even after the family has no chance of blocking it)

Offline

#17 2013-06-11 09:17:24

bey bey
Member
Registered: 2013-04-20
Posts: 386

Re: Pet movement suggestion

jasonrohrer wrote:

Well, just like I never wanted to make a game that was extremely "solve this really hard, tedious puzzle" focused, I also didn't want to make a game with no interesting electronics in it.

So, removing electronics (switches) from the game is not an option.  Nor is removing animals.

Anyway, I'm convinced that it's also possible to make a maze-like thing, with animals moving around, that is NP-Hard in the generalized (NxN map) case.  Essentially where there is one solution, and the only practical way to find that solution is to try an exponential number of solutions via brute force, even if you have the full map.  In other words, a "magic dance" with no switches at all.

So, the only way to prevent NP-Hard (i.e., tedious) puzzles with the current setup is to restrict all houses to being completely devoid of all dynamic objects!

In other words, looking for some subset of the current house objects that will solve this problem is a dead end.  The problem needs to be flipped upside down.

The intermediate solution would be that one that popped up a few times of making animals only move on sight. That would at least mean that people need to move around and houses be designed that way. (Or that it's at least "only" about figuring out a blueprint instead of recreating dog or cat movement.

Last edited by bey bey (2013-06-11 09:17:50)


In fact you can be batman.
(if he robbed houses and murdered families.)
- Dalleck

Offline

#18 2013-06-11 10:19:32

zed
Member
Registered: 2013-04-16
Posts: 160

Re: Pet movement suggestion

If i step down now, on top of the cat, it has 1 possibility to move (up) to increase its distance from 0 to 1
Which it does, if i step back up, ontop of the cat again it has 2 possibilities to increase its distance from
0 to 1
By order of preference it would choose down and go back into the dead-end, however it seems to choose up

Yeah, there's a special rule I didn't mention: if you step onto a cat, when it's deciding which way to move it uses your *previous* position (i.e. the one you stepped from onto the cat). That's what produces this nice fleeing behaviour.

Offline

#19 2013-06-11 11:55:54

Laffinty
Member
Registered: 2013-06-10
Posts: 46

Re: Pet movement suggestion

zed wrote:

If i step down now, on top of the cat, it has 1 possibility to move (up) to increase its distance from 0 to 1
Which it does, if i step back up, ontop of the cat again it has 2 possibilities to increase its distance from
0 to 1
By order of preference it would choose down and go back into the dead-end, however it seems to choose up

Yeah, there's a special rule I didn't mention: if you step onto a cat, when it's deciding which way to move it uses your *previous* position (i.e. the one you stepped from onto the cat). That's what produces this nice fleeing behaviour.

Which means the cat gets stuck in the dead end though?
Since when you are above it you are 1 from it away
once you step on it you are 0 away, however the cat uses your old position which is 1 away, 3 directions are blocked and in that view going to the only possible one would reduce its distance from 1 to 0.
Or what did you mean?

Offline

#20 2013-06-11 12:10:16

zed
Member
Registered: 2013-04-16
Posts: 160

Re: Pet movement suggestion

Oh sorry, I mean that the distance from the previous position is used to resolve tie-breaks - it still tries to maximise the distance from the robber's new position, but when there are multiple directions to choose from which are equal from that point of view, it goes for the one which is furthest from the previous position (resolving any ties in that in the usual way).

Offline

#21 2013-06-11 12:10:57

Laffinty
Member
Registered: 2013-06-10
Posts: 46

Re: Pet movement suggestion

ah ok :3
how did you figure that btw? just trying around with the mechanics?

Offline

#22 2013-06-11 12:58:07

jere
Member
Registered: 2013-05-31
Posts: 540

Re: Pet movement suggestion

Here's a crazy idea: what if infinite pets could occupy the same space?

Right now, the main difficulty in reasoning about pets is figuring out what happens why they fight for the same space. If they could occupy the same space, they would instead go right through each other and the problem becomes parallelized. Each pet can be analyzed independently and that's a lot simpler. You would change from emulating the code in your head step by step to thinking about puzzles in a more intuitive way, one object at a time. Also, this fixes the stuttering movement with dogs for free.

The reason it's a crazy idea is that it nullifies large packs of dogs, since all dogs in an open space would converge on the same space over time (if you need to get past that space though, you'll still need a large number of clubs). But it might be worth it if the conceptual issues here are really important to fix.

Last edited by jere (2013-06-11 13:03:03)


Golden Krone Hotel - a vampire roguelike

Offline

Board footer

Powered by FluxBB 1.5.8