What's the generic term for a series of bits?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
King Author
Posts: 736
Joined: Sun Apr 12, 2009 12:30 pm UTC
Location: Pennsylvania, USA

What's the generic term for a series of bits?

Postby King Author » Fri Apr 02, 2010 8:41 am UTC

So I've been playing Diablo 2 recently, and for those who don't know, it's a hack and slash PC game. You keep items either in your inventory or a Stash in town. Items in your inventory or Stash are safe, however if you leave items out on the ground, they may disappear. They'll definitely disappear if your save and quit. Well, I accidentally saved and quitted while I had some pretty valueable loot on the ground (my inventory was full so I just left the stuff on the ground for the time being). This lead me to search for a character editor, to see if I could hack my save file to give my character back what I'd lost.

Well, I was successful, and the editor I got (UdieToo) is lightyears ahead of the rest (more popular ones like Hero Edit and Shadowmaster) because it actually lets you edit the raw code of the items and character properties and stuff in the editor. Not only that, the code is highlighted and labeled in sections to make hacking even easier.

All that said, I'm no coder, I'm no programmer, yet I'm trying to talk to some people IRL about what I've been doing with this editor (pretty cool stuff considering it's the first time I've ever looked at code). It's difficult because I know absolutely no lingo. So, can somebody tell me the technical term for a series of bits that act as a discrete unit of data, regardless of the number of bits? I've heard of the whole word/doubleword/quadword type stuff but that's all specific to the number of bits.

See, Diablo 2 uses some weird (I presume) coding. For example, the code to add a +X to Skill bonus to a weapon is a series of seven bits to identify the property of Skill bonus itself, then three bits which determine which specific skill is being added, and then eight bits to both further determine the specific skill and determine the amount of bonus (the X in +X). Seven, three, eight -- what can I call all these? Strings? I've been using "strings." Though, hell, I don't even know if "bit" is correct. By "bit" I mean "a one or a zero in a specific place in the code."

So is "string" acceptable?
I have signitures disabled. If you do, too...you can't read this, so nevermind >_>

User avatar
Aaeriele
Posts: 2127
Joined: Tue Feb 23, 2010 3:30 am UTC
Location: San Francisco, CA

Re: What's the generic term for a series of bits?

Postby Aaeriele » Fri Apr 02, 2010 8:59 am UTC

"Binary string" would generally be acceptable, yes. Or bit-string, string of bits, bit-sequence, et cetera.
Vaniver wrote:Harvard is a hedge fund that runs the most prestigious dating agency in the world, and incidentally employs famous scientists to do research.

afuzzyduck wrote:ITS MEANT TO BE FLUTTERSHY BUT I JUST SEE AAERIELE! CURSE YOU FORA!

User avatar
Berengal
Superabacus Mystic of the First Rank
Posts: 2707
Joined: Thu May 24, 2007 5:51 am UTC
Location: Bergen, Norway
Contact:

Re: What's the generic term for a series of bits?

Postby Berengal » Fri Apr 02, 2010 1:51 pm UTC

Bit-field, bit-vector, binary or just bits is also used.
It is practically impossible to teach good programming to students who are motivated by money: As potential programmers they are mentally mutilated beyond hope of regeneration.

Leibnix
Posts: 9
Joined: Thu Apr 01, 2010 10:24 am UTC

Re: What's the generic term for a series of bits?

Postby Leibnix » Fri Apr 02, 2010 2:02 pm UTC

"Bit field" is often used for smaller sequences (less than wordsize). 'Byte' can also be used, though this will usually be interpreted as 'octet'. 'Bit vector' commonly denote longer sequences.

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: What's the generic term for a series of bits?

Postby Earlz » Fri Apr 02, 2010 4:55 pm UTC

Berengal wrote:Bit-field, bit-vector, binary or just bits is also used.


I second bitfield. That's what I've always used to refer to such a thing. My question is how does that pertain to what you are trying to do?
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: What's the generic term for a series of bits?

Postby You, sir, name? » Fri Apr 02, 2010 5:00 pm UTC

I'd say bit-string or bit-sequence if it's just bits in general, or bit-field if it's bits in some memory structure (if it's not a multiple of 8 bits, and/or not aligned properly).
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
Xanthir
My HERO!!!
Posts: 5413
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: What's the generic term for a series of bits?

Postby Xanthir » Sat Apr 03, 2010 12:33 am UTC

Bit-string or bit-sequence seems fine.

King Author wrote:See, Diablo 2 uses some weird (I presume) coding. For example, the code to add a +X to Skill bonus to a weapon is a series of seven bits to identify the property of Skill bonus itself, then three bits which determine which specific skill is being added, and then eight bits to both further determine the specific skill and determine the amount of bonus (the X in +X).

It's possible the coders actually did use something that weird, but it seems more likely that this is just an automatic bit-packing of what was an ordinary structure in the real code.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
TheChewanater
Posts: 1279
Joined: Sat Aug 08, 2009 5:24 am UTC
Location: lol why am I still wearing a Santa suit?

Re: What's the generic term for a series of bits?

Postby TheChewanater » Mon Apr 05, 2010 10:30 pm UTC

I'd call each statement a binary vector or binary array.
ImageImage
http://internetometer.com/give/4279
No one can agree how to count how many types of people there are. You could ask two people and get 10 different answers.

Agent_Irons
Posts: 213
Joined: Wed Sep 10, 2008 3:54 am UTC

Re: What's the generic term for a series of bits?

Postby Agent_Irons » Thu Apr 08, 2010 8:42 am UTC

The c++ template library has a class called a bitset, which is exactly what you're describing. Most people use a vector of booleans instead, of course.

cogman
Posts: 112
Joined: Sun May 18, 2008 2:17 pm UTC

Re: What's the generic term for a series of bits?

Postby cogman » Fri Apr 09, 2010 3:05 pm UTC

half word, word, double word, and quad word... Are specific examples of series of bits.

User avatar
TheChewanater
Posts: 1279
Joined: Sat Aug 08, 2009 5:24 am UTC
Location: lol why am I still wearing a Santa suit?

Re: What's the generic term for a series of bits?

Postby TheChewanater » Fri Apr 09, 2010 6:36 pm UTC

cogman wrote:half word, word, double word, and quad word... Are specific examples of series of bits.

Yep. And "icdouyfghoidufygoi" is also a specific example of a series of bits.
ImageImage
http://internetometer.com/give/4279
No one can agree how to count how many types of people there are. You could ask two people and get 10 different answers.

User avatar
King Author
Posts: 736
Joined: Sun Apr 12, 2009 12:30 pm UTC
Location: Pennsylvania, USA

Re: What's the generic term for a series of bits?

Postby King Author » Sat Apr 10, 2010 10:06 am UTC

Alright, thanks everyone. Bitfield or bitset it is, then. I still like "string" though.

Earlz wrote:
Berengal wrote:Bit-field, bit-vector, binary or just bits is also used.


I second bitfield. That's what I've always used to refer to such a thing. My question is how does that pertain to what you are trying to do?

Just wanna use proper terminology.

Xanthir wrote:Bit-string or bit-sequence seems fine.

King Author wrote:See, Diablo 2 uses some weird (I presume) coding. For example, the code to add a +X to Skill bonus to a weapon is a series of seven bits to identify the property of Skill bonus itself, then three bits which determine which specific skill is being added, and then eight bits to both further determine the specific skill and determine the amount of bonus (the X in +X).

It's possible the coders actually did use something that weird, but it seems more likely that this is just an automatic bit-packing of what was an ordinary structure in the real code.

Check for yourself. Google UDIE2. I can even send you my character's save files via PM so you can poke around in the code (instead of having to generate a character yourself). Though if you don't have D2 installed, it might not work, because it seems probable to me that the editor uses the installed files for images and so forth.
I have signitures disabled. If you do, too...you can't read this, so nevermind >_>


Return to “Coding”

Who is online

Users browsing this forum: Qaanol and 7 guests