What is low/hight byte?

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

What is low/hight byte?

Postby Ravick » Mon Sep 19, 2011 9:41 am

I know how to use moving cameras and stuff, but I couldn't understand waht is those values called "low byte" and "hight byte" that are used by the interpolation points.

I use the tag of the next point in the place of the low bite, and it works. And dont know what could be done with the other value.

What does those values mean?
Last edited by Ravick on Mon Sep 19, 2011 10:48 am, edited 1 time in total.
User avatar
Ravick
Do what thou wilt, since you don't bug the hell out of me!
 
Joined: 22 Aug 2010
Location: Tubarão, Brasil

Re: What is low/hight byte?

Postby InsanityBringer » Mon Sep 19, 2011 9:48 am

paramaters are restricted to 0-255 in the hexen map format. highbyte is a hack around this. I think the formula is this:

(highbyte * 256) + lowbyte

Someone correct me if I'm wrong, but basically this allows you to use more than 255 tags.
User avatar
InsanityBringer
 
Joined: 05 Jul 2007

Re: What is low/hight byte?

Postby NeuralStunner » Mon Sep 19, 2011 12:44 pm

IB is correct.

I suspect UDMF ignores high byte (or you just shouldn't use it) - It supports arguments up into tens of thousands, probably many more than you'll need.
User avatar
NeuralStunner
O'Neill with it.
 
Joined: 21 Jul 2009
Location: The Colonies

Re: What is low/hight byte?

Postby Ravick » Thu Sep 22, 2011 1:06 pm

Hum... So, if i'm using the Hexen map format, I can use it to save tags, right?

How do I use it? The camera has a tag, and then the interpolation points that follows has just this "hight byte" parameter? I dont need to fill the first one?
User avatar
Ravick
Do what thou wilt, since you don't bug the hell out of me!
 
Joined: 22 Aug 2010
Location: Tubarão, Brasil

Re: What is low/hight byte?

Postby edward850 » Thu Sep 22, 2011 6:21 pm

You're reading it wrong. It's "High Byte", not hight. Anyway, it's not about saving tags, it's about being able to use them. As the Hexen format only supports arguments up to 255, high byte is used to access tags above that.
Example, you want to access tag 516. You can't put 516 into a single argument, because that's more then 255, so you would divide it into two. Set Low Byte to 4, and High byte to 2. (2 * 256) + 4 = 516.
User avatar
edward850
An unexpected exception occured: All of them
 
Joined: 19 Jul 2005
Location: New Zealand

Re: What is low/hight byte?

Postby Ravick » Fri Jan 27, 2012 11:02 pm

(Sorry for bumping the topic; But it's my own topic, so I think it's ok...)

I'm trying to use the high bites now. I'm expanding an old Hexen format map; It had 254 tags, and now I want to add a moving camera sequence. I gave the camera the tag 255, and the interpolation point bytes 1 and 1 (1*255+1). Is it right? It didn't work at all. How can I use this feature?

Thanks in advanced.
Last edited by Ravick on Sat Jan 28, 2012 8:29 am, edited 1 time in total.
User avatar
Ravick
Do what thou wilt, since you don't bug the hell out of me!
 
Joined: 22 Aug 2010
Location: Tubarão, Brasil

Re: What is low/hight byte?

Postby disposable_username2 » Sat Jan 28, 2012 1:43 am

Ravick wrote: I gave the camera the tag 255, and the interpolation point bytes 1 and 1 (1*255+1). Is it right?
No. The formula is (highbyte * 256) + lowbyte.
disposable_username2
 
Joined: 08 Mar 2011

Re: What is low/hight byte?

Postby Gez » Sat Jan 28, 2012 4:39 am

The idea is that a byte is the smallest amount of memory a computer can use for a variable. On modern computer architectures, a byte is the same thing as an octet: 8 bits. Each can be 0 or 1, so the value can go from 0000 0000 (0) to 1111 1111 (255).

If you need to have a value higher than 255, then you need two bytes. Then the value can go from 0000 0000 0000 0000 (still 0) to 1111 1111 1111 1111 (65535).

The byte that stores the higher bits is the high byte.

To give an analogy with the decimal system we use in every day life, consider than a digit is the smallest amount of characters with which you can write a number. You have ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. So you can write a value from 0 to 9 in one character. If you want to write a higher value than that, then you'll need more characters. With two, you can write a value from 00 to 99. In that way, you have a "high" character (the first) whose value is worth ten times that of the "low" character. If you want to write ten, you'll use 10. That's 1 times ten plus zero times 1. And in the same way that 10 isn't equal to 9; 0000 0001 0000 0000 isn't equal to 1111 1111 -- instead it's one more.
Gez
 
Joined: 06 Jul 2007

Re: What is low/hight byte?

Postby Ravick » Sat Jan 28, 2012 10:07 am

Thanks for answering. I got how to make the values, but I still need some help in the practical way to use it :oops:

I was trying values of 1 and 1 because the camera tag is 255 (I forgot that the formula uses 256), so I was trying to get "256".

So, now I gave to the "Point" and "High Point" values of the camera respectively "0" and "1". Trying to get 256. But how do I declare to the game that the next interpolation point is "256"?

I tried to give the values of "1" and "1" to the next interpolation point, but it also didn't work.

I've used:

Code: Select allExpand view
ChangeCamera (255, 0, 0);


The camera shows its view but doesn't move.

Then I've expanded the sequence of the two bytes ("0,1"; "1,1", "2,1", "3,1" and "4,1") in more interpolation points, and used the ACS commands:

Code: Select allExpand view
   ChangeCamera (255, 0, 0);
   Thing_Activate (255);


And then the interpolation point with the values "2,1" showed its view and moved to the next ("3,1"), and stopped.

All this post probably sounded rather silly or dumb ( :oops: ), but i'm rly lost with this stuff.
User avatar
Ravick
Do what thou wilt, since you don't bug the hell out of me!
 
Joined: 22 Aug 2010
Location: Tubarão, Brasil


Return to Editing

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests