WWHC-Diaz + (NEW!) The VR Missions (help wanted!)
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
Got a cool project idea but nothing else? Put it in the project ideas thread instead!
Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.
Please read the full rules for more details.
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.
Got a cool project idea but nothing else? Put it in the project ideas thread instead!
Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.
Please read the full rules for more details.
-
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
-
- Posts: 3302
- Joined: Wed Mar 23, 2005 5:31 pm
- Location: New Jersey
Almost. ACS only supports integers. "Fixed point" is thus represented by using the high 16 bits of the integer as the integer part of the number and the low 16 bits as the decimal part of the number. Hence, 1.0 is 65536. That's why multiplying by 65536 works. It would be the same thing to multiply by 1.0. It would also be the same thing to bit shift it left by 16. In this sense, because you are limiting the digits on each side of the radix point, fixed point really is fixed point.DoomRater wrote:Making it an int and multiplying it by 65536 so that it is correctly offsetted like the fixed point is.
'fixed point' is not really fixed point per se, it is actually an int that is divided by 65536 and then displayed with a decimal point. The script entry I posted above I tested this time so it should work- input 100 for normal speed and 35 for the shouldered speed.
Code: Select all
1.0 == 65536 == 1 << 16
-
- Posts: 8265
- Joined: Wed Jul 28, 2004 8:21 am
- Preferred Pronouns: He/Him
- Location: WATR HQ
-
- Posts: 3302
- Joined: Wed Mar 23, 2005 5:31 pm
- Location: New Jersey
It is basically fixed point. There is no real focus on specific number of digits on either side of the radix point like there might be in other languages, but I've never used a language that has fixed point as a primitive type so I don't actually know how common that is/was. Anyway, the fact still remains that you are just representing a decimal number as int16.int16 and so you have no floating point.
I apologize for any confusion. The way your last post read (or more specifically, Gez's post) made it sound like there was some kind of significant difference with integer and fixed point in ACS. Of course, there isn't any difference to ACS, and I believe when working with fixed point in ACS it is actually very important to understand that fact.
I apologize for any confusion. The way your last post read (or more specifically, Gez's post) made it sound like there was some kind of significant difference with integer and fixed point in ACS. Of course, there isn't any difference to ACS, and I believe when working with fixed point in ACS it is actually very important to understand that fact.
-
- Posts: 8265
- Joined: Wed Jul 28, 2004 8:21 am
- Preferred Pronouns: He/Him
- Location: WATR HQ
-
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
@WW: One thing you can do is, instead of sending the information directly, create an array or (if the array doesn't work either) a set of if/else statements, that check the value of a variable and set the correct number accordingly, e.g., if 0 then SetActorProperty(...1.0...), if 1 then SAP (...0.35...), if 2 then SAP (...0.62...), etc.
-
- Posts: 8265
- Joined: Wed Jul 28, 2004 8:21 am
- Preferred Pronouns: He/Him
- Location: WATR HQ
-
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Frankly, I suggested that method because all this "fixed point" crap confuses and scares the shit out of me. I've been staring at the wiki entry for about five minutes now and I still can't wrap my head around just why anything would be done like this except some extremely vague, assumed notion of "computer go faster with fix point lol"...
-
- Posts: 8265
- Joined: Wed Jul 28, 2004 8:21 am
- Preferred Pronouns: He/Him
- Location: WATR HQ
-
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
-
- Posts: 8265
- Joined: Wed Jul 28, 2004 8:21 am
- Preferred Pronouns: He/Him
- Location: WATR HQ
-
- Posts: 3302
- Joined: Wed Mar 23, 2005 5:31 pm
- Location: New Jersey
Another way to think of it is on the binary level. 65536 is 2^16, so as a 32 bit binary number:Now, let's keep the data exactly the same, but change the way we look at it. Let's consider the high 16 bits separately from the low 16 bits.Now in one sense what we have a two 16 bit integers. The first one has the value 1, and the second one has the value 0. So, if we stick a decimal inbetween them when we display the value... it would be 1.0. The binary representation hasn't changed at all. It is still 65536, if you look at it in that way. With the fixed point number representation, we're just looking at the 16 high bits as the integer part of the number (to the left of the decimal) and the 16 low bits as the fractional part of the number (to the right of the decimal.)
The reason one may choose to use fixed point is because it is MUCH faster than floating point, at the cost of precision. Fixed point works with regular integer math, which is quite fast. Also, because it works with regular integer math, you don't need to have a floating point unit on your CPU to use it. If you recall, Doom was coded in 1993. Getting as much out of the computers of the day as possible was paramount, and so fixed point was probably one of the choices they made to help retain engine speed and possibility compatibility, but I'm not one to be aware of exactly how frequent floating point units were at the time so that particular point may be moot.
Code: Select all
65536 = 00000000000000010000000000000000
Code: Select all
high bits low bits
0000000000000001 0000000000000000
The reason one may choose to use fixed point is because it is MUCH faster than floating point, at the cost of precision. Fixed point works with regular integer math, which is quite fast. Also, because it works with regular integer math, you don't need to have a floating point unit on your CPU to use it. If you recall, Doom was coded in 1993. Getting as much out of the computers of the day as possible was paramount, and so fixed point was probably one of the choices they made to help retain engine speed and possibility compatibility, but I'm not one to be aware of exactly how frequent floating point units were at the time so that particular point may be moot.
-
-
- Posts: 17934
- Joined: Fri Jul 06, 2007 3:22 pm
-
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
-
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Know what might be a neat addition? An altfire that shoots a gun gangsta-style so the recoil pushes you sideways...
Also, I should note that the highest pitch (lowest number) that works properly for ZDoom is -5825, not whatever the number is on the version of HD I currently have uploaded.
Also, I should note that the highest pitch (lowest number) that works properly for ZDoom is -5825, not whatever the number is on the version of HD I currently have uploaded.