• Content count

  • Joined

  • Last visited

Community Reputation

107 Neutral

About DoubleDouble

  • Rank
  1. Tetris Rotation Problem

    He is poorly explaining that section. When he says, "subtract half the change in size of each dimension that results from each turn" He means... For my example, imagine the 'T' piece. " the size of each dimension"- for the T piece, it is 3 squares across (the x dimension) and two squares up-and-down (the y dimension) If you were to rotate the T piece clockwise, so the part currently sticking down is sticking out to the left, it would be flipped to 2 squares across (x) and 3 squares up-and-down (y) The change in size for each dimension is then 3-2=1 (X dimension) 2-3 = -1(Y dimension) half the change in size: 0.5(X Dimension) -0.5(Y Dimension) At least, thats what it seems like he's saying to me. I'm actually not sure how that helps, and like he says, " you have to think about whether this difference should be positive or negative."
  2. I have it working currently by the client sending 9 bits on each update, 1 whether he clicked or not and a byte for a position (I decided since I am coming up with an arbitrary number of inventory slots it might as well be 255 slots instead) The server then does what needs to be done with that position and any item the player is holding. Currently, it then sends back the entire inventory array. (255 * 1 byte) You are saying I could send back (1byte position, 1byte itemID) instead... that would be quite good [img][/img] I may bring it back to 400 slots if its only two more bits, I'm starting to better understand how to get the most out of each bit. As an afterthought, I can also save the bit on whether the player has clicked and just send the item position when the player clicks couldn't I? Thanks for the response, the help is much appreciated and every little "bit" helps. [img][/img]
  3. I've looked on Google quite a bit, trying to search multiplayer inventories and such, but I'm mostly getting results related to databases or minecraft. So while I am asking here, in addition to answering my questions, I will happily look at any links you may find useful to my situation. I am programming in c#, but I can at least understand code in whatever you guys throw at me. I'm working on a multi-player rpg that has an inventory system similar to Diablo's in that the player has many "slots" they can store items in, and some items take up more than one slot. Currently, my intention is to set it up like so: Inventory: 20 x 20 (400) slots Server: int array[400] playerInventory. //Stores item id's Sends the array to the client Client: receives array of itemIDs, sends any player input, //clicked an item? //moving an item? so, my Questions: In case it is relevant, I am using C# with XNA, Lidgrens 1) What should I use as the array? ints are much larger than something else I could use, yes? 2) How often should I send such a large amount of info? 400 itemIDs seem like a bad amount to send. I was thinking of having a game state monitor, which would let the server know when the player is looking at his inventory screen and only then send all the itemID's, I dislike that solution because I feel there are better ways. Help? 3) How should I send the player input? If a player clicked the item in slot 123 (to pick it up / hold it with mouse) should I send: playerID, actionType, itemSlot. Are there any bugs that I need to be aware of if I do it this way? (latency bugs, possible item dupes?) In conclusion, I want the inventory server-side so it eliminates hacks related to items and inventorys, but I am aware of networking limitations (aware they exist, not what they are) as far as sending and receiving data. My current solution seems like it would send/receive too much, and I am trying to optimize that interaction between client and server. Any help is appreciated.