The Castle Doctrine Forums

Discuss the massively-multiplayer home defense game.

You are not logged in.

#1 2013-06-24 12:38:46

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

New backpack behavior

Backpacks are now returned to your vault after 5 minutes of inaction, and also if you view security tapes.  So, you can no longer use the backpack to keep tools hidden and safe from robbers.

Hilariously, this change brought 50 houses out of the woodwork that had been fully looted but were still hiding tools in their backpacks!  They are now back to earning salary as a result.

This change happened server-side.  As usual, keep an eye out for any strange server behavior.  This time, I made a full database backup right before applying the change, though.

Offline

#2 2013-06-24 12:55:20

colorfusion
Member
Registered: 2013-04-02
Posts: 537

Re: New backpack behavior

Slight bug; the items pushed into the vault through this don't actually seem to add onto the house price.

Offline

#3 2013-06-24 13:23:37

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

Re: New backpack behavior

Oh.... yeah, not in the initial push of existing backpacks.  I used a place-holder value of $100 for all of those existing backpacks.

But ever after, a separate value estimate (rounded-off resale value) is being track for every backpack.  So, whenever backpack and vault are merged, the value estimate can reflect the true value of backpack items added.  I'm pretty sure this part is working.

I wasn't able to assign true values for existing backpacks because I did the update with a MySQL query in one fell swoop, and there's no way to do the item-string to value conversion in such a query (the value calculation occurs in my code), so I just used a placeholder value there.  That means that some houses are rather undervalued in the house list right now.  As soon as owners touch those houses, though, each will be fixed.

Offline

#4 2013-06-24 13:28:18

largestherb
Member
From: england
Registered: 2013-05-27
Posts: 381

Re: New backpack behavior

the top house with $44,000...

was.. empty..

..but the vault had 90 guns.

edit: i have been robberying a lot and someone has been in my house the whole time. my cash/tools do not go into my vault until i return home, right?

edit 2: yes, good!

Last edited by largestherb (2013-06-24 13:38:23)

Offline

#5 2013-06-24 13:40:45

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

Re: New backpack behavior

jasonrohrer wrote:

I wasn't able to assign true values for existing backpacks because I did the update with a MySQL query in one fell swoop [...]

Bit off-topic, but I'd like to ask - how have you found using a mySQL database
has worked out for this project?

I'd have been tempted to just use flat files and a directory structure, with
hand-rolled indices where necessary, and flock() or whatever for locking.

Would you estimate that using mySQL instead has, on balance, increased or
decreased pain over such an ad hoc approach?

Offline

#6 2013-06-24 13:53:46

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

Re: New backpack behavior

I've used flat files for server-side stuff in the past, but would never go back.

MySQL + PHP are the quickest way to get complicated stuff done that I've ever found.  The data storage and retrieval part of your project are done, right from the start.

Furthermore, it is SO easy to solve many common "programming problems" using a simple DB query without even writing any real code.  These solutions are inherently robust, in that they usually fail and rollback in the case of a bug, instead of doing something that you're not expecting.

Finally, it's pretty malleable, in that I can change table structure in rather dramatic ways rather simply without breaking things.  I never need to do anything manually, like writing scripts to filter and update data files after a structural change.  Again, such updates can be done with simple queries.

Finally finally, it's really fast.  Or at least fast enough where it doesn't matter.  A black box that just works magically, and always works.  I've never found a single bug in it.

The C side of my world (client code) is much more messy, time-consuming, and error prone because I don't have MySQL running there.  You should see the hairy, branch-laden mess that is used to slurp in all the house object configurations out of a directory tree.  That would be like one line in MySQL.

Offline

#7 2013-06-24 13:57:31

largestherb
Member
From: england
Registered: 2013-05-27
Posts: 381

Re: New backpack behavior

oh okay $50000000 floods into the game this is dumb again. send me a memo when its gone

Offline

#8 2013-06-24 14:03:26

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

Re: New backpack behavior

Ah!  But it was there all along, hidden in backpacks.

Though that hidden value suddenly did cause a bunch of houses to start earning again, which is where all the extra money is coming from.

Offline

#9 2013-06-24 14:06:16

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

Re: New backpack behavior

Thanks for the mySQL pitch, that's really interesting.

Maybe it's time I actually finally learnt how to use it...

Offline

#10 2013-06-25 01:22:40

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

Re: New backpack behavior

...and with that Batman is dead.

R.I.P.   +
         |  |   
     ....|  |..

Last edited by dalleck (2013-06-25 01:26:13)


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

#11 2013-06-25 04:25:39

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

Re: New backpack behavior

Wot happened?! Influx of that much cash and still only 6 houses on the block?!?! :-o


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

Offline

#12 2013-06-25 06:22:55

ukuko
Member
Registered: 2013-04-06
Posts: 333

Re: New backpack behavior

I think a lot of that cash was spent on ladders.

Offline

#13 2013-06-25 06:27:14

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

Re: New backpack behavior

Looks like it. Funnily enough, I just happened to login after somebody had pumped up a starting layout house to 30+k with guns. Don't mind if I do. smile


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

Offline

#14 2013-06-25 10:55:23

largestherb
Member
From: england
Registered: 2013-05-27
Posts: 381

Re: New backpack behavior

bit better now~

Offline

Board footer

Powered by FluxBB 1.5.8