Game Mechanics Moving chests which are not empty.

paticzek

Terrarian
Hello guys. I tried to post about this like 3 months ago but I didn't so today is the day.


I was thinking about a problem with moving full chests in your house. When you don't have enough space in your inventory and you just want to move one chest(or your whole basement) to another place in your house.

I know that you think about using this to carry more items for free but wait a minute.

Carrying this chest would make you move like 50-70% slower, block you from attacking and using Magic Mirror(also Recall Potion, Gravity Potion etc.) or Wings(if he has them). That would probably help a lot when you want to just rearrange your house. And this would be able only for like 1 minute. After this time your chest would just "explode" and all the items would be on the ground.

And i know that you can just create a new chest, place your items there, take items from chest you want to move and place it wherever you want. But wouldn't that be useful?

Just let everybody know what you think.

P.S. Sorry for some mistakes. Im kinda tired. :)
 
A placed chest and a chest in your inventory are fundamentally different things. It's impossible for an inventory chest to contain anything (or even have the ability to contain anything to begin with) without substantial modifications to the game engine.
 
Maybe connecting this with a Flying Piggy Bank mechanic would be useful for making this. You know if you pick up a chest containing something it's called like "Containing chest"(I'm not good at creating new names) and this would just take items from picked up chest but you couldnt do anything with them. You could see them but not move them to your inventory or drop them.
 
That wouldn't work either. The contents of a chest are linked to the instance of said chest. The Piggy Bank's inventory is shared.
 
O'm not sure how moving you slower will help you to place a chest content to the other side of the map :/ It's an odd penalty to me.

I'm not sure how hard it can be to remember the chest contents when picking up. (as the game does remember chest contents by loading a world)

In the current version, I just empty my inventory, use loot all, move the chest, and deposit it in the moved chest. here's the "penalty" a full inventory. instead of movement limitations.
 
O'm not sure how moving you slower will help you to place a chest content to the other side of the map :/ It's an odd penalty to me.

I'm not sure how hard it can be to remember the chest contents when picking up. (as the game does remember chest contents by loading a world)

In the current version, I just empty my inventory, use loot all, move the chest, and deposit it in the moved chest. here's the "penalty" a full inventory. instead of movement limitations.

Thats exactly why i want this slow. It's not about moving this chest from the other side of map to your house with additional inventory place. It's about changing your house. With no penalty players would just stack their chests from dungeon etc. and get free space. Thats not what i want.
 
From a programming perspective, this isn't necessarily difficult, but there are some things to consider. First, literally picking up a chest and making the contents its own entity is probably not a good idea. Think about what would happen if you picked a chest up and the game crashed while you were holding this "virtual" inventory, or you left the game in some other unusual fashion. Even if you stored the held chest in the player data as a fourth inventory container (in addition to main inventory, safe, and piggy bank), there's a good opportunity to the content data to go poof if something goes wrong. It would also need to work in both single player and multiplayer.

The good news is that it's all just data and there's an easier way to relocate a chest without breaking things and without the possibility that anything gets lost in the process. This does involve adding a couple properties to both chests and players.

First, the chest. Each chest is indexed and has an X,Y coordinate telling the game where it is in the world and an array of contents. Don't touch the position until absolutely necessary, and do absolutely nothing with the contents. Each chest has a new isMovedBy property that refers to the player number carrying a chest. By default every chest has this as an invalidating value like -1 which says the chest is stationary. If a player picks up a chest, this gets set to their index and the chest acts as if it's locked (no one else can open it). The original chest is rendered at 50% opacity while a player is holding it.

Second, the player. The player has a holdingChest property that contains the index of the chest they're holding. While this points to a valid chest in the world, the player is rendered with arms out holding the chest in front of them, and is unable to use any items. The player then can move around and the only thing he or she can do is click on a valid spot to place the chest. When the chest is placed, the X,Y of the chest's data is updated and the old sprite gets removed. No contents are touched. If the game crashes, the only thing lost is the isMovedBy state in memory. If the player disconnects (multiplayer), the isMovedBy state gets reset and the chest unlocks. There's no additional risk.

The only other catch I can think of here is that there might be a mechanism to prevent naturally spawned chests from being moved. Perhaps an item, like a dolly, would need to be acquired and would need to be in inventory in order to move chests.

I'm not sure a movement penalty is really necessary. You're already being penalized by not being able to use any items while holding a chest, so a speed reduction probably should be minimal.
 
Well i really like your idea. Thats exactly what i wanted but i didn't have any more ideas.

About slow. I just didn't want this to be used for moving chest from Ocean, Dungeon etc. :p
 
About slow. I just didn't want this to be used for moving chest from Ocean, Dungeon etc. :p

That had crossed my mind, but I'm not sure how much of a difference it would make. Even if you pick up a dungeon or underworld chest, you still need to get somewhere with it and that doesn't change the locked behavior. Going with the idea of a required item to move chests, maybe it should be sold by the Cyborg to minimize progression impact in a normal playthrough.

And speaking of moving chests from the dungeon and risking getting killed, I would think dying should simply reset the chest to its initial state. Even in mediumcore or hardcore, dumping the chest contents would be unfair, problematic, and possibly exploitable.
 
That had crossed my mind, but I'm not sure how much of a difference it would make. Even if you pick up a dungeon or underworld chest, you still need to get somewhere with it and that doesn't change the locked behavior. Going with the idea of a required item to move chests, maybe it should be sold by the Cyborg to minimize progression impact in a normal playthrough.

And speaking of moving chests from the dungeon and risking getting killed, I would think dying should simply reset the chest to its initial state. Even in mediumcore or hardcore, dumping the chest contents would be unfair, problematic, and possibly exploitable.

Well when i talk about moving chests from dungeon i think about using this to just get these items if u dont have enough space in your inventory. Locked chests should be unmovable. This is only about chests which player can open and take items from inside.
 
Well when i talk about moving chests from dungeon i think about using this to just get these items if u dont have enough space in your inventory. Locked chests should be unmovable. This is only about chests which player can open and take items from inside.
He would need to be extremely skilled in dodging the enemies attacks to move the chest from dungeon or underworld, and he would need to go back to his home without the mirror or recall potions. I think the only possible exploit would be with ocean chests(move outside of water to look their loot without worrying about air), but having the risk of being attacked by sharks.
Anyway, I think that 1.3.1 will have something to make us able to move something from one chest to the other via wiring or something similar, so, no need to worry too much about it.
 
Last edited:
Hold on now, are we actually breaking the chest and putting it in the inventory, or just moving it without breaking it? Because in that case, yes, it becomes somewhat more possible from a technical point of view.
 
Hold on now, are we actually breaking the chest and putting it in the inventory, or just moving it without breaking it? Because in that case, yes, it becomes somewhat more possible from a technical point of view.

My interpretation assumed the latter, and would actively prevent inventory access when the chest is being carried.
 
Back
Top Bottom