The Castle Doctrine Forums

Discuss the massively-multiplayer home defense game.

You are not logged in.

#376 Re: Main Forum » Visibility issues not related to the shroud » 2014-01-13 11:32:54

I made this change, and with the current, short reaches of everything, it doesn't change the feel very much.  Except it fixes the stuff that looks obviously targetable but was not before because of subtle issues in the line-of-sight code.

Now the way that it works is this:  If you can see it, and you can clearly walk there in 3 steps, you can hit it with a 3-reach tool, regardless of  a clear throw line.  Something behind a window must thus be closer to you than something with no window in the way (because you'd have to take extra steps to walk around the window).  Logically, it would be kind of a "leaning throw" to throw around the window, which couldn't go as far.

#377 Re: Main Forum » Visibility issues not related to the shroud » 2014-01-12 22:06:14

Removed that.  Yeah, spam was a HUGE problem at first, even with robot-proof math and color questions.  Only a question that required real work (like a question about the game) stopped it. 

I think most spammers are humans!

#380 Re: Main Forum » Robbers no longer dropping tools » 2014-01-08 12:57:44

There was a problem with people using this feature to pass wealth between double accounts.  Imagine using one "dummy" account to rob people without risk, and then carrying tools into the main account (and then leaving) to drop the tools there.  As long as the dummy stays alive, this can be repeated forever.  If the dummy dies somewhere, there will be a chill. 

When you run out the door, you dump your tools in the street!

#381 Re: Main Forum » Visibility issues not related to the shroud » 2014-01-08 12:54:34

To shoot a dog through a window, you must break it with a brick first.

Long before you came on board, we experimented with dogs that stopped moving after they could no longer see you.  We tried removing a lot of things, trying to pare house design down to a place were no "boring, too tough" security systems were possible.  It was never possible.  If we didn't have the magic dance thing, we'd have buttons that the robber had to hit.  Some kind of combo lock is always possible.  Even if you remove all electronics, people could make branching mazes with only one correct path.  That's effectively a combo lock where the answer is LLRRLLRLRL.

And, with each of these things that I removed, "interesting" designs got removed along with it.  If dogs no longer follow you when they can't see you, traps that "release the hounds" behind you (after you've already seen them through a window) become less possible.

Also, I recall people putting hidden buttons right at the edge of the screen with cats that would step off to hit the buttons (and you could see the cats across long pits).  So, yes the cat would stop moving after it went off screen and couldn't see you, but it was still being used to trigger hidden stuff!

In the end, I put most of this removed stuff back in (except for the "animals always follow you, even if they've never seen you at all" part), and shifted the income in the game to bounties, which encourages people to build houses that trick others instead of just scaring them away.

#382 Re: Main Forum » Maximum number of item types a house can FORCE a robber to use? » 2014-01-08 12:46:37

Yes, I'm concerned about that too...  the "just in case" tools create tactical decisions at rob time (whereas a tighter slot limit would create tactical decisions at load-out time).  It's a trade-off.

#383 Re: Main Forum » Visibility issues and Gamma » 2014-01-08 12:44:58

I've tweaked the shroud to "pull back" slightly on wired walls, which restores their visibility to roughly what it used to be.

#384 Re: Main Forum » Visibility issues and Gamma » 2014-01-07 23:07:36

Yes, that's an issue for sure...  hmm...

#385 Re: Main Forum » Hardcore Anti-Cheat » 2014-01-07 22:02:46

Hmm.... I'm starting to come around to your "perfunctory bike lock" analogy.  It lets someone know that the bike isn't abandoned and that someone is probably coming back for it.  No one will ride off on it by accident.  Furthermore, two identical bikes, from different owners, can be parked side by side without any chance of a naive mix-up.

Right now, anyone, even a non-programmer, can mod the game so easily that they might stumble into doing so without realizing the implications of their actions.  At the most basic level, they'll end up dying when they submit a robbery to to the server after mucking around in the gameElements folder.  Oops.

Someone who is building from source, a programmer, might make this or that mod, maybe for convenience, or out of curiosity, without realizing the harm they might be causing to other players.

So, different approach would be to put a lock in place that prevents modded clients from connecting to the main server, but give everyone the key, with instructions about how the key is intended to be used (i.e., not for connecting to the main server with modded clients that violate the spirit and point of the game).  Sorta like the red safety box over the Launch Nukes button.

But if you just compile the source bundle, you'll find that you can't connect to the main server.  You have to read the instructions, where it explains how to modify the header file with the necessary key value, where that key value is something like, "Please don't abuse your power to mod the game by giving yourself an unfair advantage."

The same "key" could be used to sign stuff in the gameElements folder to prevent naive modding of those things.  And a script could be provided in the source bundle to re-sign those things (thus allowing cool, benign stuff like the Halloween mod).

#386 Re: Main Forum » Visibility issues not related to the shroud » 2014-01-07 20:13:42

Hmm... yes, that does seem natural.

The current code came from some tools in older versions having much longer reaches, combined with windows that were supposed to block these tools.  So, you could "see" the object, and it might be "reachable in 7 steps" in a round-about way, but it shouldn't be targetable because there's no line-of-sight unobstructed path.

Now that reaches are shorter, it might not be as much of an issue.  I will look into it.

#387 Re: Main Forum » Visibility issues not related to the shroud » 2014-01-07 19:12:57

Actually, in this case, the line passing between the center of the robber and the center of the dog crosses the wall, so the throw is blocked.  You can see the dog in this case because you have line of sight onto the corner of its tile, but throws require that you have line of sight to the center of its tile.

#388 Re: Main Forum » robbed without a tape » 2014-01-07 19:01:03

The server knows these details.  However, the server-side robbery timeout code is currently not using those details the way that it should when a robbery times out.

#390 Re: Main Forum » Visibility issues not related to the shroud » 2014-01-07 18:51:27

Yes, that looks like a bug with the targeting distance code.  Looking into it.

Regarding dead animals in pits... they really do need to be drawn near the bottom.  Otherwise, they look weird.


That paradox is not a bug, because vision is computed from the player's perspective.  If the player is at B, the wall is much closer to the player, so it obscures more.  If the player is at A, the player is farther from the wall, so the wall blocks less.  If you study it, you'll see that indeed the "cone" of invisibility cast from the player is much wider when the player is standing at B.

AND... to keep things reasonable in the "who saw who" mechanisms, it all depends on what the player can see (I don't compute separate view cones for each vision-sensitive object in the house).  If you can see them, they can see you.  If you can't see them, they can't see you.

#391 Re: Main Forum » Visibility issues and Gamma » 2014-01-07 18:33:50

I've made quite a bit of progress here, not by "sharpening" up the edge of the shroud (which is really hard to do without it becoming ugly, based on the fast way that I'm generating it as a 52x52 pixel image that gets blurred to hide the pixels), but by fixing some logical flaws in where the shroud is drawn.

First, I moved the whole shroud "up" so that it lines up with wall tops instead of wall bases.  This makes more sense and looks better, because the robber's head is near the wall tops.  Also, it "evens" the visibility from above and below.  Before, you could see a lot more if you were standing NORTH of something than you could if you were standing SOUTH.  Now you can see the same (limited) amount from either above or below.

Second, I changed the way that the shroud reacts to visible walls.  Before, it was "eaten into" by visible walls, to make sure that you could see them.  But now that the shroud lines up with the walls better, this isn't such an issue.  So, the shroud can be drawn at full strength right up to the edge of every wall top (with some special cases if the robber is in a corridor, or for the end cap of a corridor).

These two changes have a pretty big impact on "stuff visible around corners" without shrinking the "cone of visibility" as you look through an opening.

Granted, if you amp the gamma, more stuff is still visible around corners.  But without amped gamma, it looks much better now.

Old:
11829087246_d3f61edb39_o.png

New:
11829087286_6f07864e0d_o.png

#392 Re: Main Forum » Visibility issues and Gamma » 2014-01-06 15:36:37

Yes, good points.  Working on this.

#393 Re: Main Forum » Hardcore Anti-Cheat » 2014-01-06 14:22:26

Okay, so put the new HMAC-based method (which includes the email in the generated key for each get_ticket_id call) in place.

I've also changed my own download code.

See if you can get my download code now.

Also, I know it was easy to get the first time because I made a stupid mistake, so I'm not sure if you have any experience cracking PHP scripts, but if you do, please give it a go.  I've done all the "right" things on the server, like passing every user-submitted string through a regexp, etc., so I don't think it's vulnerable to SQL injection, but I might have missed something.  If there's a weakness, having the source should make it easy to find.

During the design, I was really worried about people sniffing traffic in Internet cafes and getting people's game ticket codes, but I didn't want to use SSL for the whole thing, so I treat the game ticket codes as a shared secret between client and server and never send it back and forth.  Of course, the ticket codes are sent by email, but I'm assuming people are checking their email over SSL.

And the server itself uses Yubikeys for admin authentication, so even if you install a keylogger on my home machine and get my admin passwords, you shouldn't be able to get in (again, unless I made a stupid mistake somewhere).

#394 Re: Main Forum » Hardcore Anti-Cheat » 2014-01-06 13:49:51

Yes, because I want to be able to shard out at a moment's notice to multiple game servers (while still keeping a central ticket server).  I may need to do this for load-management reasons if the game becomes hugely popular.  So, I make no assumptions about whether the game server and the ticket server are running on the same machine (they may not have access to the same DB, etc... I want to keep them separate).

Granted, I could have an "allowed IP list" for that one ticketServer call, and forbid Russian IPs like "212.34.113.235," but I shouldn't need to do that, assuming that I don't do something stupid in the security method.

#395 Re: Main Forum » Hardcore Anti-Cheat » 2014-01-06 13:32:00

But you don't know HMAC_SHA1( secret_key, email ) for a given email address.

And being able to compute it for your own email address (which you clearly will be able to do) won't help you compute it for my email address, unless you have the secret key (which you do not).

#396 Re: Main Forum » Hardcore Anti-Cheat » 2014-01-06 13:08:34

Oh, yeah, Der, that was stupid of me.  Fixing that hole now by including the email address in the sha1 to generate the key.

Also, I trust that both "derlafff@..." and "castle@..." are your email addresses, and I trust that you're not going to use my ticket ID for nefarious purposes.

#397 Re: Main Forum » Visibility issues and Gamma » 2014-01-06 12:03:19

Examples, please!

Here's one that I'm aware of:

http://castledraft.com/editor/KGsMOn

So, if you're standing where the robber is standing, the vault is invisible, though on most monitors you can see some "empty floor" back there where the vault should be.

When you move up to where the son is standing, the vault has a non-blocked diagonal neighbor (upper right neighbor floor to vault) that's now visible, so the vault fades into view.

So, what are our options here?  Really, the vault should not logically be visible through that gap.  But... drawing a shroud that FULLY makes that square back there black would impossible without it looking really ugly.   A soft edge of any kind would be impossible in this case, unless you want the shroud to be even wider and make seeing the should-be-visible walls impossible too.

Any other options?  Essentially, you can see empty floor back there because "you don't know what's back there."  It could be empty floor, or something else.  Could I draw "?" blocks back in places like that?

It also sucks how every monitor is different.  On my two main dev machines, this example actually looks pretty great, and not so shocking when the vault fades in.  But on a ThinkPad with a higher gamma monitor, the shroud actually looks pretty ugly and striated, with the empty floor CLEARLY visible.

I'll try tweaking the shrouds a bit more...

#398 Re: Main Forum » duplicate painting » 2014-01-06 11:42:43

I didn't make the second painting.

#399 Re: Main Forum » Hardcore Anti-Cheat » 2014-01-06 11:40:20

Interesting points.

First of all, it wouldn't stop being an open-source game.  It would just be a closed key game.  The game source would ship with a key, but not the key needed to play on the main server.  The source already does this in many other instances in terms of protecting the server (the source ships with various dummy keys in place so that you can't, for example, trick my server into thinking that you've paid for an account when you really haven't---only I and the payment processor have the secret key needed to create new accounts on MY server).

For people who want to build from source and run their own servers, they could stick with the dummy keys, or generate their own.  Nothing would change there.  What would change is that you couldn't (easily) build from source and play on the main server.


Second, what evidence do you have that everyone has been honorable?  The problem with this particular kind of cheating is that it is impossible to detect.  Back when the server didn't check that you weren't walking through walls, several people were doing this (clearly not behaving honorably), but it was easy to spot.  How do you know that some people aren't peeking at where the vault is with a modded client?  I know that, for example, Herb and many others have modded their wire sprites to show the difference between on and off wires.

Essentially, I want more assurance that everyone who is connecting to my server is playing the same game.  Right now, there is absolutely no assurance of that.


Yes, I've been playing with ram dumps on this end.  I've already made some progress here (so that at least the text maps don't hang around in ram anymore).


And I fully get what you're saying about the challenge of breaking a system being tempting.  I myself am a hacker, and I've been on the other side of this fence many times.  I was the first guy to hack the iTunes store back in the day (to allow non-iTunes clients to search the store and listen to the sample clips).  That was a real thrill.  And the whole time, I was thinking, "You fuckers... this is impossible to lock, so why did you even try?"

On the other hand, there wasn't a good reason (that I could see) to keep third party apps from connecting to the iTunes servers.  It was just about exclusivity.

Here, there's a pretty compelling reason to ensure that the vast majority of people are playing with the same game client on the main server.  It's not just about protecting robbery.... so many other aspects of the game become slightly (or very) unfair if people are playing by different rules.  What if you never have to die in a self test?  Wouldn't that be nice?  What if you could run your self test with no shrouds?

#400 Re: Main Forum » Hardcore Anti-Cheat » 2014-01-05 18:24:14

Yeah, I've gone back and forth about this whole scheme over the past week, and now I'm fully back to believing that I should NOT change the game to make robbery steps synchronous with the server.  Looking at the calendar helped:  I've now been coding this design for two full years, and a synchronous game was simply not what I set out to design two years ago.  What I have now has a beautiful elegance and robustness to it that I don't want to spoil. 

Even something as drastic as a server crash is harmless to the active robbers in the game, assuming that they let their clients keep retrying to end the robbery until the server comes back online.  Everything important is in the database.  I wake up each morning without the slightest worry about whether the game service is still running.  It's that robust.  It's been running for 10 months without any intervention on my part.  And given that I'm a one-person "team", if there was something fragile to worry about each morning, I would be the only one doing the worrying.  For the rest of my life, essentially.


There's a belief in engineering circles that if security isn't perfect (as in, breaking it would take more seconds than atoms in the known universe), then it's just as worthless as no security at all.  But when "perfect" security has a an unacceptable cost, "no security at all" is not the only alternative.  Just because a bike lock can be easily cut by some people does not mean it's pointless to lock your bike.  Imperfect security has its place.  If you can stop 99% of people from doing something, that's better than stopping 0%.

One great example is the "encryption" of the robbery maps sent by the server.  Before I added that feature to the protocol, pretty much everyone in the know could peek at the map of a house they were robbing.  People were slurping these maps and posting them on CastleDraft all the time.  Even though the encryption is by no means uncrackable (it's based on a key that is generated by the client itself and sent to the server right there in the robbery request, but fortunately NOT saved into the recordedGames folder), it is enough to make that kind of map peeking drop off the radar screen.  It's no longer a thing that "most people are doing," because each map is encrypted with a fresh key, and decrypting map after map would require more effort than it's worth to most people.

But when I talked to a programmer friend about this the other day and mentioned that the maps sent by the server are encrypted, his response was, "What's the point of that?  You might as well not even do that."  I've now come to see that kind of thinking as flawed.


So, if the client and the server shared a key, and that key was really hard for most people to get, that would make client-server communications even harder to mess with and using modded clients much harder.  Right now, either of these things are already outside the realm of possibility for all but 5% of the player base.  Making it substantially harder would shrink that number significantly.

And I could do this without degrading the quality of the game experience in any way.

The alternative, while offering perfect security against cheating, would noticeably reduce the quality of the game experience for 99 people just to thwart the hypothetical 1 person.  Instead, I can make that 1 person's task annoying and painful without degrading the quality for the other 99 at all.


Security has a cost.  There's a reason that we don't carry around 100-pound bike locks.

Board footer

Powered by FluxBB 1.5.10