technical question bout storage space

snaek

snaek

Forge Runner

Join Date: Mar 2006

N/

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)

KemikalRx

KemikalRx

Ascalonian Squire

Join Date: Aug 2007

Passionate Kiss Of The Tiger [KISS]

Mo/

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.

Tharg

Tharg

Krytan Explorer

Join Date: Jun 2006

Massachusetts

Omega Glory

Mo/

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.

Fril Estelin

Fril Estelin

So Serious...

Join Date: Jan 2007

London

Nerfs Are [WHAK]

E/

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.

Ratson Itamar

Ratson Itamar

Lion's Arch Merchant

Join Date: Dec 2006

"Flame Shield On!"

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.

ZeAliX

Frost Gate Guardian

Join Date: Sep 2006

Norway

A/

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

Ratson Itamar

Ratson Itamar

Lion's Arch Merchant

Join Date: Dec 2006

"Flame Shield On!"

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.

ZeAliX

Frost Gate Guardian

Join Date: Sep 2006

Norway

A/

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.

TheodenKing

TheodenKing

Jungle Guide

Join Date: Jun 2008

DoA

Dark Order of Retarded Knights (doRk)

N/Me

Not sure eabout the coding... but I do know that a stack of 250 is much easier on your graphics.

Ratson Itamar

Ratson Itamar

Lion's Arch Merchant

Join Date: Dec 2006

"Flame Shield On!"

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).

Tharg

Tharg

Krytan Explorer

Join Date: Jun 2006

Massachusetts

Omega Glory

Mo/

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)

ZeAliX

Frost Gate Guardian

Join Date: Sep 2006

Norway

A/

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?

Ratson Itamar

Ratson Itamar

Lion's Arch Merchant

Join Date: Dec 2006

"Flame Shield On!"

@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.

Fril Estelin

Fril Estelin

So Serious...

Join Date: Jan 2007

London

Nerfs Are [WHAK]

E/

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).

ZeAliX

Frost Gate Guardian

Join Date: Sep 2006

Norway

A/

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).

Ratson Itamar

Ratson Itamar

Lion's Arch Merchant

Join Date: Dec 2006

"Flame Shield On!"

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

Fril Estelin

Fril Estelin

So Serious...

Join Date: Jan 2007

London

Nerfs Are [WHAK]

E/

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.

Tharg

Tharg

Krytan Explorer

Join Date: Jun 2006

Massachusetts

Omega Glory

Mo/

a C++ 'object' being a record with it's own functions and procedures?

Fril Estelin

Fril Estelin

So Serious...

Join Date: Jan 2007

London

Nerfs Are [WHAK]

E/

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

In short: inheritance is what differentiates objects from records.

Tharg

Tharg

Krytan Explorer

Join Date: Jun 2006

Massachusetts

Omega Glory

Mo/

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...

Fril Estelin

Fril Estelin

So Serious...

Join Date: Jan 2007

London

Nerfs Are [WHAK]

E/

Quote:
Originally Posted by tvalentijn View Post
yThis was all in MS DOS of course, way before Windows came out.
DOS was not (never was, never will, only passionate freelancers would go there in this prehistoric time of Windows development, unless you toyed with IBM DOS?) the OS of choice for programming, most coders were (and still are) Unix-ers. DOS shell is ridiculously simple, try cygwin on windows (or any Linux) to convince yourself of that. Objects were invented some 20 years before Borland was created, in strange (and extinct) programming languages like Simula and most importantly Smaltalk.

For history, I met people (I'm not that old ) who were punching cards to program. They'd come to the main interface of the computer once a day, with a bag literally full of punched cards and input them, waiting for punched cards to come out of the computer, then spend the rest of the day analysing the result to know whether they need to punch again .

MagmaRed

MagmaRed

Furnace Stoker

Join Date: Mar 2007

Our Crabs Know True [LOVE]

R/

We want to speculate on what to speculate on?

Fril Estelin

Fril Estelin

So Serious...

Join Date: Jan 2007

London

Nerfs Are [WHAK]

E/

Quote:
Originally Posted by MagmaRed View Post
We want to speculate on what to speculate on?
No we're trying to discuss how much we need to discuss to be convinced that we can't speculate. But programming language is way more cool than natural language.

Ratson Itamar

Ratson Itamar

Lion's Arch Merchant

Join Date: Dec 2006

"Flame Shield On!"

@Fril Estelin - I know everything that you've said, except from the history parts :P

I'm going to study Computer Programming at the university next year. All I know now is from advanced computer science at my high school, some extra studying at a collage payed by a computer company (they give back to the community to get rid of some of the taxes lol) and the rest is self learned.

I did how ever have some of my finals in C#, I know more than a lot about classes and polymorphism. According to my teacher, C# is quite similar to C++. C++ has better performance and more flexible but c# is easier to code. C# is a simple, modern, object oriented, and type-safe programming language derived from C and C++, I also know VB (and SQL of course). Basically, what I was lead to believe is that c++ is like c# but more "hands on".

BTW, this thread has gone so off-topic. Is that allowed in this section of the forum?