Happy birthday Bravo1.
In response to Ter13
Ter13 wrote:
Happy birthday Bravo1.

You never told me happy birthday QQ.
In response to Akto
It's also less than a month till Hitler's birthday.

Coincidence?
In response to Popisfizzy
I think not!!
*Tries intensely to think of 'lux'(luck?) pun*

*fails*

*Tries intensely to think of 'bravo!' pun*

*fails*

merry day of your birth, bravo.


Feed:
- Finished strafe-fire for automatic weapons.
- All primary weapons are ported to the new skill setup -- specials coming up.
- Projectiles do marginally less damage, and will scale with rank.
- Misc. graphic effects.

Things are shaping up well! Combat is much more fluid with the new way skills are handled and I'm excited to see what I can do with melee weapons once I finish porting specials over. I've decided that I will bring back Feed's rank progression and scale weapon damage with player level(which will be useful for boss runs). More on this later. 2016 is the year of the Feeder! B)
In response to Kumorii
Yeah but is it your birthday though?
In response to Rushnut
Rushnut wrote:
*Tries intensely to think of 'lux'(luck?) pun*

*fails*

*Tries intensely to think of 'bravo!' pun*

*fails*

merry day of your birth, bravo.

You are silly, Rush.

"bravo1!!11! congratulations1!1!!1! you've made so many accomplishments in your life. i can foresee you achieving so much more. happy birthday, and I wish you all the lux in the world!111!1!!one
In response to Bl4ck Adam
Prime example of failing.
pfft.
failure is the key to success.
In response to Bl4ck Adam
Bl4ck Adam wrote:
failure is the key to success.

BYOND's slogan.
*Sees all the happy birthday messages*

In response to Bl4ck Adam
Bl4ck Adam wrote:

This is good. Very good.

Yut Put wrote:
http://puu.sh/o1ejD/a87a80f678.zip

Here's a link to an Xpadder setup that allows you to plug-n-play Epoch with a wired 360 controller.

It feels pretty cool and natural with the new keyboard controls. The exact controller layout I chose might not be the most optimal, though.

If you like it, make sure you donate a few to BYOND (wink wink nudge nudge 511 gamepad support)

(no that's not a confirmed thing at all but it would be cool)

also this is the most recent version of Epoch if you don't have it and want it
https://dl.dropboxusercontent.com/u/8858375/ epochv68fullversion.zip

Awesome. Built in gamepad support would be a great new feature for BYOND and I can imagine it shouldn't be too difficult to get working natively (I've been surprised before though!).

At the very least, it would do a LOT for Lux.
Taking the sum of two unsigned double-precision integers (/pif_LongInt/UnsignedDouble objects):
Add(pif_BigInt/Int)
var
// Result of addition.
pif_LongInt/UnsignedDouble/Sum = new(src)

// The two blocks of the incoming data. All other data is ingnored, as it will do
// nothing.
Int_block1 // Least significant.
Int_block2 // Most significant.

if(istype(Int))
Int_block1 = Int._GetBlock(1)
Int_block2 = Int._GetBlock(2)

/* else if(istype(Int))
// Not yet implemented.
*/


else if(istype(Int, /list))
// A left-significant list was passed.

switch(Int:len)
if(0)
Int_block1 = 0
Int_block2 = 0
if(1)
Int_block1 = Int[1]
Int_block2 = 0
if(2)
Int_block1 = Int[2]
Int_block2 = Int[1]
else
Int_block1 = Int[Int:len]
Int_block2 = Int[Int:len-1]

else if(isnull(Int))
// Treat it as zero.

Int_block1 = 0
Int_block2 = 0

else
// We assume a left-signficant args list was passed.

switch(args.len)
if(1)
Int_block1 = args[1]
Int_block2 = 0
if(2)
Int_block1 = args[2]
Int_block2 = args[1]
else
Int_block1 = args[args.len]
Int_block2 = args[args.len-1]

/*
* Now we do the actual computation.
*/


var
// Used to store the result of addition before being sent to
// the Sum object. These are the first and second bytes of
// a given block, respectively.
B1 = 0
B2 = 0

// Compute the first block.

B1 = (src.block1 & 0x00FF) + (Int_block1 & 0x00FF)
B2 = ((src.block1 & 0xFF00) >> 8) + ((Int_block1 & 0xFF00) >> 8) + ((B1 & 0xFF00) >> 8)

Sum._SetBlock(1, (B1 & 0x00FF) | ((B2 & 0x00FF) << 8))

// B2 here is the carry-over from the
// first block.
B1 = (src.block2 & 0x00FF) + (Int_block2 & 0x00FF) + ((B2 & 0xFF00) >> 8)
B2 = ((src.block2 & 0xFF00) >> 8) + ((Int_block2 & 0xFF00) >> 8)

Sum._SetBlock(2, (B1 & 0x00FF) | ((B2 & 0x00FF) << 8))

return Sum
And taking the product of two unsigned double precision integers:
    Multiply(pif_BigInt/Int)
var
// Result of multiplication.
pif_LongInt/UnsignedDouble/Prod = new(src)

// The two blocks of the incoming data. All other data is ingnored, as it will do
// nothing.
Int_block_1 // Least significant.
Int_block_2 // Most significant.

if(istype(Int))
Int_block_1 = (Int.Length() >= 1) ? Int._GetBlock(1) : 0
Int_block_2 = (Int.Length() >= 2) ? Int._GetBlock(2) : 0

/* else if(istype(Int))
// Not yet implemented.
*/


else if(istype(Int, /list))
// A left-significant list was passed.

switch(Int:len)
if(0)
Int_block_1 = 0
Int_block_2 = 0
if(1)
Int_block_1 = Int[1]
Int_block_2 = 0
if(2)
Int_block_1 = Int[2]
Int_block_2 = Int[1]
else
Int_block_1 = Int[Int:len]
Int_block_2 = Int[Int:len-1]

else if(isnull(Int))
// Treat it as zero.

Int_block_1 = 0
Int_block_2 = 0

else
// We assume a left-signficant args list was passed.

switch(args.len)
if(1)
Int_block_1 = args[1]
Int_block_2 = 0
if(2)
Int_block_1 = args[2]
Int_block_2 = args[1]
else
Int_block_1 = args[args.len]
Int_block_2 = args[args.len-1]

/*
* Computation of multiplication.
*/


/*

The idea behind this is the following. Let A and B be two integer between 0 and 2**32-1. Then
if r = 256, we may write them as,

A = r**3 a_3 + r**2 a_2 + r a_1 + a_0
B = r**3 b_3 + r**2 b_2 + r b_1 + b_0

where 0 <= a_n, b_n <= 255 for n = 0, 1, 2, 3. Ff we compute the product of A and B we have,

A*B = r**6 (a_3 b_3) + r**5 (a_3 b_2 + a_2 b_3) + r**4 (a_3 b_1 + a_2 b_2 + a_1 b_3) +
r**3 (a_3 b_0 + a_2 b_1 + a_1 b_2 + a_0 b_3) + r**2 (b_2 c_0 + b_1 c_1 + b_0 c_1) +
r (b_1 c_0 + c_0 b_1) + a_0 c_0.

Observe that, r**4 = 256**4 = (2**8)**4 = 2**32 > 2**32-1. Therefore, the terms with a coefficient
of r**4, r**5, and r**6 are too larger for a 32 bit integer. Thus, they are simply discarded, and
we instead compute only those terms whose coefficient ir r**3, r**2, r**1 == r, and r**0 == 1.

*/


var
// These are the bytes of both src and Int.

src0 = src.block_1 & 0x00FF
src1 = (src.block_1 & 0xFF00) >> 8
src2 = src.block_2 & 0x00FF
src3 = (src.block_2 & 0xFF00) >> 8

Int0 = Int_block_1 & 0x00FF
Int1 = (Int_block_1 & 0xFF00) >> 8
Int2 = Int_block_2 & 0x00FF
Int3 = (Int_block_2 & 0xFF00) >> 8

// Bytes of the final result. We will only use the first byte of each, while
// the second byte will be used as a buffer to temporarily store bits until we
// shift them to the next byte. E.g., byte_1 = XXXX FFFF, where XXXX is data that
// will be moved to the first byte of byte_2.

byte_1 = 0
byte_2 = 0
byte_3 = 0
byte_4 = 0

// A buffer used to temporarily store results of multiplication.
buffer

/// Compute the terms with a coefficient of r**0 == 1. Assuming src0 = Int0 = 0xFF--the largest integer
/// that can be stored in one byte--then byte_1 = src0*Int0 = 0xFE01. Thus, we can just throw it in here
/// and pull the buffer into byte_2.
///
/// Maximum value after this step: 00 00 FE 01

byte_1 = src0*Int0
byte_2 = (byte_1 & 0xFF00) >> 8 // Shift buffer of byte_1 var into byte_2
byte_1 &= 0x00FF // Clear out byte_1 buffer.

/// Compute the terms with a coefficient of r**1. Assuming all terms are 0xFF, the largest integer that
/// can result from src1*Int0 + src0*Int1 is 0x2*(0xFF*0xFF) = 0x2*0xFE01 = 0x1FC02. Thus, there may be
/// overflow.

// Maximum value after this step: 00 00 FE 01 + 00 FE 01 00 = 00 FE FF 01

buffer = src1*Int0
byte_2 += (buffer & 0x00FF)
byte_3 = ((buffer & 0xFF00) >> 8) + ((byte_2 & 0xFF00) >> 8)
byte_2 &= 0x00FF // Clear out byte_2 buffer.

// Maximum value after this step: 00 FE FF 01 + 00 FE 01 00 = 01 FD 00 01

buffer = src0*Int1
byte_2 += (buffer & 0x00FF)
byte_3 += ((buffer & 0xFF00) >> 8) + ((byte_2 & 0xFF00) >> 8)
byte_4 = ((byte_3 & 0xFF00) >> 8)

byte_2 &= 0x00FF // Clear out byte_2 buffer.
byte_3 &= 0x00FF // Clear out byte_3 buffer.

/// Compute the terms with a coefficient of r**2. Assuming all terms are 0xFF, the largest integer
/// that can result from src2*Int0 + src1*Int1 + src0*Int2 = 0x3*(0xFF*0xFF) = 0x3*0xFE01 = 0x2FA03.

// Maximum value after this step: 01 FD 00 01 + FE 01 00 00 = FF FE 00 01

buffer = src2*Int0
byte_3 += (buffer & 0x00FF)
byte_4 += ((buffer & 0xFF00) >> 8) + ((byte_3 & 0xFF00) >> 8)

byte_3 &= 0x00FF
byte_4 &= 0x00FF

// Maximum value after this step: FF FE 00 01 + FE 01 00 00 = (01) FD FF 00 01

buffer = src1*Int1
byte_3 += (buffer & 0x00FF)
byte_4 += ((buffer & 0xFF00) >> 8) + ((byte_3 & 0xFF00) >> 8)

byte_3 &= 0x00FF
byte_4 &= 0x00FF

// Maximum value after this step: FD FF 00 01 + FE 01 00 00 = (01) FC 00 00 01

buffer = src0*Int2
byte_3 += (buffer & 0x00FF)
byte_4 += ((buffer & 0xFF00) >> 8) + ((byte_3 & 0xFF00) >> 8)

byte_3 &= 0x00FF
byte_4 &= 0x00FF

/// And lastly, the terms with a coefficinet of r**3. Assuming all terms are 0xFF, the largest
/// integer than can result from src3*Int0 + src2*Int1 + src1*Int2 + src0*Int3 = 0x4*0xFE01 =
/// 0x3F804.

// Maximum value after this step: FC 00 00 01 + (FE) 01 00 00 00 = (FE) FD 00 00 01.
buffer = src3*Int0
byte_4 += buffer
byte_4 &= 0x00FF

// Maximum value after this step: FD 00 00 01 + (FE) 01 00 00 00 = (FE) FE 00 00 01.
buffer = src2*Int1
byte_4 += buffer
byte_4 &= 0x00FF

// Maximum value after this step: FE 00 00 01 + (FE) 01 00 00 00 = (FE) FF 00 00 01.
buffer = src1*Int2
byte_4 += buffer
byte_4 &= 0x00FF

// Maximum value after this step: FF 00 00 01 + (FE) 01 00 00 00 = (FF) 00 00 00 01.
buffer = src0*Int3
byte_4 += buffer
byte_4 &= 0x00FF

/*
* We have computed the result, so glue the bytes back together in the proper way and return the
* result.
*/


Prod._SetBlock(1, byte_1 | (byte_2 << 8))
Prod._SetBlock(2, byte_3 | (byte_4 << 8))

return Prod


Testing this by doing a large amount of multiplications is a bit awkward, but I used the code below to perform 155,000 multiplications in both pif_LongInt and in pif_BigInt.
#define DEBUG

mob
var/list/Ints = new

Login()
..()
for(var/i = 1, i <= 5000, i ++)
Ints += new /pif_LongInt/UnsignedDouble(1)

verb/Test()
for(var/pif_LongInt/UnsignedDouble/Int in Ints)
for(var/j = 0, j < 31, j ++)
Int = Int.Multiply(2)

world << "Done."


The results are as follows.
/*

pif_LongInt

Profile results (total time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------------- --------- --------- --------- ---------
/mob/verb/Test 0.213 2.733 2.733 1
/pif_LongInt/UnsignedDouble/Multiply 1.658 2.526 2.515 155000
/pif_LongInt/UnsignedDouble/New 0.175 0.734 0.700 155000
/pif_LongInt/UnsignedDouble/Set 0.421 0.560 0.547 155000
/pif_LongInt/UnsignedDouble/_SetBlock 0.128 0.131 0.168 310000
/pif_LongInt/UnsignedDouble/_GetBlock 0.125 0.135 0.161 310000
/pif_LongInt/UnsignedDouble/Length 0.013 0.016 0.041 155000

*/


/*

pif_BigInt

Profile results (total time)
Proc Name Self CPU Total CPU Real Time Calls
--------------------------- --------- --------- --------- ---------
/mob/verb/Test 0.360 9.633 9.634 1
/pif_BigInt/proc/Multiply 4.390 9.275 9.285 155000
/pif_BigInt/proc/SetSign 0.677 1.617 1.629 155000
/pif_BigInt/proc/_GetBlock 1.109 1.405 1.493 940000
/pif_BigInt/New 0.261 1.345 1.346 155000
/pif_BigInt/proc/Set 0.822 1.087 1.081 155000
/pif_BigInt/proc/_SetBlock 0.715 0.862 0.960 485000
/pif_BigInt/proc/Length 0.587 0.629 0.852 2060000
/pif_BigInt/proc/SetLength 0.326 0.506 0.512 80000
/pif_BigInt/proc/LargestBit 0.215 0.479 0.486 155000
/pif_BigInt/proc/Sign 0.138 0.143 0.160 310000
/pif_BigInt/proc/Expand 0.033 0.053 0.057 10000

*/

Thus, by unrolling the loop and fixing the size, we get a 73% increase in speed. Of course, there is the fixed-width trade-off. If I were to do 32 iterations of the inner for loop in the testing code instead of 31 iterations, it would roll over to 0 in pif_LongInt, while it would proceed without problem in pif_BigInt. There are trade-offs for everything.
Ahhh, I see. That makes sense....

*totally lost*
Yut Put wrote:
If you like it, make sure you donate a few to BYOND (wink wink nudge nudge 511 gamepad support)

(no that's not a confirmed thing at all but it would be cool)

pls


Page: 1 2 3 ... 169 170 171 172 173 ... 349 350 351