> Forest of True Sight > Questions & Answers Reload this Page technical question bout storage space
Reply
Old Apr 13, 2009, 06:06 PM // 18:06   #1
Forge Runner
 
snaek's Avatar
 
Join Date: Mar 2006
Profession: N/
Advertisement

Disable Ads
Default technical question bout storage space

im not a coder, and so i was curious to how storage space worked...

what takes up more server space:
a) 255 items stacked in 1 storage slot
b) 255 items placed separately across 255 storage slots.

or do they take up the same exact amount of server space?


i'm just curious because if stacked items like mats and collectible items and other stackable items take up less server space, then wouldn't it be wise to let weapon mods and other such items stack as well?

(btw this is purely from a coding perspective...please don't say this is a bad thing to do because it will screw the economy etc etc)
snaek is offline   Reply With Quote
Old Apr 13, 2009, 06:46 PM // 18:46   #2
Ascalonian Squire
 
KemikalRx's Avatar
 
Join Date: Aug 2007
Guild: Passionate Kiss Of The Tiger [KISS]
Profession: Mo/
Default

I would guess they are both the same,

my understanding is that the storage space itself is what takes up the room, weather it is full or empty is just a 1 or 0 to the system. (simplified)

having the storage available uses the space.

(Slap me if im wrong)
*depending who you are i hope im wrong

PS im ignoring the fact that 255 items is not possible in a stack.
KemikalRx is offline   Reply With Quote
Old Apr 13, 2009, 06:51 PM // 18:51   #3
Krytan Explorer
 
Tharg's Avatar
 
Join Date: Jun 2006
Location: Massachusetts
Guild: Omega Glory
Profession: Mo/
Default

it's a bad thing to do because it will screw the economy etc. etc.

LOL

They probably coded each slot with a number to identify the slot, an item number code and a quantity, so 3 memory spaces per inventory slot. The reason that you max out at 255 items per slot is that 255 (and the 0) makes 256, which is 2 power 8, which is exactly one 8-bits byte. (a bit can be a zero or a one).

Come to think of it, since they work with 16-bits bytes these days, they might even use the first 8 bits for the slot identification, the the second 8 bits for the quantity and a full 16 bits for the item code. This means they would use two 16-bit bytes.

Last edited by Tharg; Apr 13, 2009 at 06:54 PM // 18:54.. Reason: added / changed info
Tharg is offline   Reply With Quote
Old Apr 13, 2009, 06:53 PM // 18:53   #4
So Serious...
 
Fril Estelin's Avatar
 
Join Date: Jan 2007
Location: London
Guild: Nerfs Are [WHAK]
Profession: E/
Default

We have absolutely no way to be sure. It'd require knowledge (even partial) of data structure, relational schemas and HDD server data representation to be able to have the sketch of a good answer.

It's a server-side question you're asking. Servers are under the sole control of Anet, which won't release any kind of information about that. It's a trade secret.
Fril Estelin is offline   Reply With Quote
Old Apr 13, 2009, 07:33 PM // 19:33   #5
Lion's Arch Merchant
 
Ratson Itamar's Avatar
 
Join Date: Dec 2006
Location: "Flame Shield On!"
Default

First, It sounds rather complicated to id each weapon by mere numbers, you'll need to call to a number separator function each time and what if one item uses 6 characters (3,3) and the other 8 characters (6,2)? Your idea will strain the computer (and the programmer :P) while being completely unneeded.

Second, they don't need to assign to each item it's place, you can just use a loop until the the last item. This way it's less strain on the memory and make the process a bit faster

it's more likely that they assign 2 variables to each item, then send the item id variable to a function that ids the item. there's nothing special about quantity, it doesn't need to be sent to a function or anything so it can be a part of the item straight away.

To the OP, I think that it does matter. The more items in your bag, the longer the loop, (at least) two new variable are assigned and more importantly the id function is called again with each item and just as important a new item is built, taking more space in memory.
Ratson Itamar is offline   Reply With Quote
Old Apr 13, 2009, 07:34 PM // 19:34   #6
Frost Gate Guardian
 
Join Date: Sep 2006
Location: Norway
Profession: A/
Default

Well.. I'm not that experienced I could say I got the answer. but the way I think is:
Say you got one variable called "a", then you assign "a" to (probably) contain an array of strings (several words) and this variable "a" will take 10 kb (random number, if 10 slots makes it easier to understand, imagine it that instead) of space. That's for your a) question, for b you will have to make 255 different variables (or same if you got several of the same items or stacked items), which each wil take 10kb (10 spaces w/e).

long story short:
a) 10kb
b) 10kb * 255 = 2550kb (2,55 Mb)

Option b takes up a lot more space than option a.

edit: typos

Last edited by ZeAliX; Apr 13, 2009 at 07:43 PM // 19:43..
ZeAliX is offline   Reply With Quote
Old Apr 13, 2009, 07:41 PM // 19:41   #7
Lion's Arch Merchant
 
Ratson Itamar's Avatar
 
Join Date: Dec 2006
Location: "Flame Shield On!"
Default

I didn't understand you fully, but I will refer to what I did.

Why assigning a string? it will make your programming *x (x stands for the number of characters assigned to id an item) times worse than a simple int would.

Your way of calculating is wrong. The "b" way will take more effort on the server side than you thought. It will not only make new variables it will also call more functions and make the loop longer.

Last edited by Ratson Itamar; Apr 13, 2009 at 07:45 PM // 19:45..
Ratson Itamar is offline   Reply With Quote
Old Apr 13, 2009, 07:45 PM // 19:45   #8
Frost Gate Guardian
 
Join Date: Sep 2006
Location: Norway
Profession: A/
Default

Well.. when I think more about it.. might be easier to just let each item be an object which containt name (string) and amount (int).

I didn't want to go into programming way of speaking since that may confuse many, that's the reason for a bit weird things in the other explanations.

But the calculations in my other post says it all..

EDIT: @ above, lol.. reading parentheses ftw.

Last edited by ZeAliX; Apr 13, 2009 at 07:51 PM // 19:51..
ZeAliX is offline   Reply With Quote
Old Apr 13, 2009, 07:54 PM // 19:54   #9
Jungle Guide
 
TheodenKing's Avatar
 
Join Date: Jun 2008
Location: DoA
Guild: Dark Order of Retarded Knights (doRk)
Profession: N/Me
Default

Not sure eabout the coding... but I do know that a stack of 250 is much easier on your graphics.
TheodenKing is offline   Reply With Quote
Old Apr 13, 2009, 07:57 PM // 19:57   #10
Lion's Arch Merchant
 
Ratson Itamar's Avatar
 
Join Date: Dec 2006
Location: "Flame Shield On!"
Default

Ok, but why do you want strings? It's not like your notebook when you have to read from a list and a bunch numbers make no sense. The computer can't read so it will have to go to a function (which may have to call other function(s)) to id the weapon. A string will just be an unneeded burden.

I will make it more clear to you (personally, as you said you do know "some" programming), it is very basic so I'm sure you'll understand. A string is exactly like an array of numbers, each letter on that string is like a new variable of a simple int. Take a second look at my previous post (more precisely the second paragraph) to understand fully.

Feel free to ask me again if it's not clear (it's ok, it may be hard to grasp at first).
Ratson Itamar is offline   Reply With Quote
Old Apr 13, 2009, 08:08 PM // 20:08   #11
Krytan Explorer
 
Tharg's Avatar
 
Join Date: Jun 2006
Location: Massachusetts
Guild: Omega Glory
Profession: Mo/
Default

I am not a coder, but a long time ago I did do a fair amount of coding. Probably techniques have changed but I'll give you my $0.02 worth.


I think you would have to use number codes to identify the item. It would take way too much memory to actually keep the name in a string format. And actually it's much more complicated than I scetched in the previous posting, since you have all kind of stats to a weapon or armor, including the code for color. And you also need to include the stats of three possible additions as well (sword hilt, sword pommel and inscription).

So you could get for a weapon a record with the following cells:
- type - 4 or 5 bits
- name (could be a number code) - 16 bits
- maximum damage range - 8 bits
- damage type - 3 or 4 bits
- requirement level - 4 bits
- requirement attribute (i.e. strength) - 4 bits
- color (white / blue / purple / gold / green) - 3 bits
- references (pointers?) to the upgrades and inscriptions

The upgrades have their own record, which holds the pertinent information.


Something similar, though slightly less complicated, with armor - but then including references to runes etc.


And now you see why they can't make weapons or armor stackable in an inventory slot. It's just too much information. In comparison, a stack of crafting material only requires:
- name (could be a number code) - 16 bits gives you 65,536 possibilities
- location in the chest or inventory - 8 bits
- quantity in the slot - 8 bits (0 - 255)
Tharg is offline   Reply With Quote
Old Apr 13, 2009, 08:10 PM // 20:10   #12
Frost Gate Guardian
 
Join Date: Sep 2006
Location: Norway
Profession: A/
Default

lol.. we might be programming some way different programming languages, because your explanations made no sense to me at all, but I left it at that. Reason I want a string was just random.. seriously.. ofc it can be a id-number of the item, but did you really have to bitch about it?
ZeAliX is offline   Reply With Quote
Old Apr 13, 2009, 08:14 PM // 20:14   #13
Lion's Arch Merchant
 
Ratson Itamar's Avatar
 
Join Date: Dec 2006
Location: "Flame Shield On!"
Default

@tvalentijn - he said that the items could be stacked, so no weapons or armor, only materials and other simple drops.

@ZeAliX - are you talking to me? because I didn't try to offend you in any way. I thought about it and you probably never programmed in C (the dos version) and that's why you don't know how things work "behind the curtain". I'm sorry if I offended you in any way.
Ratson Itamar is offline   Reply With Quote
Old Apr 13, 2009, 08:17 PM // 20:17   #14
So Serious...
 
Fril Estelin's Avatar
 
Join Date: Jan 2007
Location: London
Guild: Nerfs Are [WHAK]
Profession: E/
Default

Quote:
Originally Posted by Ratson Itamar View Post
you probably never programmed in C (the dos version)
what's this "DOS version" of C?

Most pro applications are developped in C++ nowadays (and from the recent Anet job ads, it seems GW is).
Fril Estelin is offline   Reply With Quote
Old Apr 13, 2009, 08:19 PM // 20:19   #15
Frost Gate Guardian
 
Join Date: Sep 2006
Location: Norway
Profession: A/
Default

Ye.. it was at you. I kept it as simple as it could be.. the OP said he wasn't a programmer, so I there's not point going like too detailed about it. I have programmed in C as well (probably not as much as you), but I didn't see the need to pull in functions since the OP asked for space and not the work the server has to do, so I gave a random example which should give the OP answer to what he wanted to know.. (assuming I was right).
ZeAliX is offline   Reply With Quote
Old Apr 13, 2009, 08:24 PM // 20:24   #16
Lion's Arch Merchant
 
Ratson Itamar's Avatar
 
Join Date: Dec 2006
Location: "Flame Shield On!"
Default

Anet probably coded in the Visual addition. The dos version was used before windows and the like. Actually c and c++ are the same, it's just easier to create and use objects with c++. It's like a super expansion of c
Ratson Itamar is offline   Reply With Quote
Old Apr 13, 2009, 08:38 PM // 20:38   #17
So Serious...
 
Fril Estelin's Avatar
 
Join Date: Jan 2007
Location: London
Guild: Nerfs Are [WHAK]
Profession: E/
Default

Quote:
Originally Posted by Ratson Itamar View Post
Anet probably coded in the Visual addition. The dos version was used before windows and the like. Actually c and c++ are the same, it's just easier to create and use objects with c++. It's like a super expansion of c
Hmmmmmmmm time for the lesson I guess:

C is a procedural language, you manipulate basic data structures based on "procedures" (functions in fact); created by Kernighan and Ritchie at Bell Labs about 30 years ago.

C++ is an object-oriented version of C, which revolves around the central notion of object and their members. Created by stroustrup about 10 years after C. This is of course a "superset" in the sense that all programming languages are intercompilable to a great extent, but saying that they're "the same" is showing your ignorance of advanced programming. There's a good reason why C++ is the de facto modern standard of programming.

I guess the "visual" you're referring to is "Visual Studio", which issimply an IDE (Integreated Development Environment), i.e. text editor, compiler, builder, debugger (+tester) all under one roof. C is based on an ANSI standard and is largely independent from all computing platforms.

The programming skeletons shown in this thread do not show any atom of answer to the OP question, because it's not really possible.
Fril Estelin is offline   Reply With Quote
Old Apr 13, 2009, 08:49 PM // 20:49   #18
Krytan Explorer
 
Tharg's Avatar
 
Join Date: Jun 2006
Location: Massachusetts
Guild: Omega Glory
Profession: Mo/
Default

a C++ 'object' being a record with it's own functions and procedures?
Tharg is offline   Reply With Quote
Old Apr 13, 2009, 09:06 PM // 21:06   #19
So Serious...
 
Fril Estelin's Avatar
 
Join Date: Jan 2007
Location: London
Guild: Nerfs Are [WHAK]
Profession: E/
Default

From the C++ master himself:
http://www.research.att.com/~bs/bs_faq.html#difference

In short: inheritance is what differentiates objects from records.
Fril Estelin is offline   Reply With Quote
Old Apr 13, 2009, 09:18 PM // 21:18   #20
Krytan Explorer
 
Tharg's Avatar
 
Join Date: Jun 2006
Location: Massachusetts
Guild: Omega Glory
Profession: Mo/
Default

yeah - now I remember. An object can inherit the variables, functions and procedures of another object and then you can add stuff.

I started coding in 1984 with Turbo Pascal 3.0. Ran it on my first PC (8088 - 256 KB - two 360 KB floppy drives - no hard disk). Objects were introduced by Borland with Turbo Pascal 5.0 or something, but maybe C+ or C++ had them earlier. This was all in MS DOS of course, way before Windows came out. Goes to show you how old I am - LOL. Have not coded in many, many moons...
Tharg is offline   Reply With Quote
Reply


Share This Forum!  
 
Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
dark eliminator Questions & Answers 4 Jul 02, 2006 11:22 PM // 23:22
dark eliminator Questions & Answers 1 Jul 02, 2006 09:16 PM // 21:16
New to Guild Wars...technical question isisaset Technician's Corner 13 Nov 26, 2005 07:22 PM // 19:22
Quick Technical Question jasonrunion Technician's Corner 12 Jun 16, 2005 07:55 PM // 19:55


All times are GMT. The time now is 12:54 PM // 12:54.