#exult@irc.freenode.net logs for 26 Jan 2017 (GMT)

Archive Today Yesterday Tomorrow
Exult homepage


[01:24:35] <Marzo> Dominus: the shape limit is easy to get around, it is just a check if I remember it correctly
[01:25:50] <Marzo> Dominus: Regarding u7 chunks: one byte plus 2 bits is 10 bits for shape; this allows shapes up to (2^10)-1, or 1023
[01:26:54] <Marzo> So shape 1024 and up can't be represented in the stock chunk format
[01:28:25] <Marzo> Likewise for frame: the top bit is the flip flag (reflects NS to WE), and 2 bits are for shape, so there are 5 bits for frame in stock format
[01:28:41] <Marzo> This allows frame up to (2^5)-1, or 31
[01:29:26] <Marzo> If we reuse the top bit for more frames we can get frame up to (2^6)-1 or frame 63, but lose the flip property
[01:29:53] <Marzo> Exult and ES only use the new chunk format if any object in the chunk has either >= 1024 or frame >= 32
[01:44:34] <-- Dark-Star has left IRC (Ping timeout: 252 seconds)
[02:09:30] --> frob_bizaro has joined #exult
[02:12:34] <-- frob has left IRC (Ping timeout: 248 seconds)
[02:17:25] --> Dark-Star has joined #exult
[02:21:04] <-- frob_bizaro has left IRC (Remote host closed the connection)
[02:25:43] <-- Dominus has left IRC (Ping timeout: 240 seconds)
[02:25:44] --> DominusExult has joined #exult
[02:25:44] <-- DominusExult has left IRC (Changing host)
[02:25:44] --> DominusExult has joined #exult
[02:25:44] --- ChanServ gives channel operator status to DominusExult
[02:26:08] --- DominusExult is now known as Dominus
[07:22:16] --> frob has joined #exult
[07:26:25] <-- frob has left IRC (Ping timeout: 240 seconds)
[09:24:00] <Dominus> Marzo, just tested, with frames >=32 Exult still uses the "simple", 512 bytes per chunk u7chunks file
[09:25:02] <Dominus> So, I guess that really only changes to the 768bytes file when it's more >=64
[09:26:20] <Dominus> I was just wondering why we switched from the original u7chunks "formula" with our simple u7chunks one. For the extra frames?
[09:28:05] <Dominus> and can you give me an example of how the flip (NS - WE) would look like? I'm having trouble grokking the top/low bits thing but see how it is done when I see an example
[09:28:23] <Dominus> and please tell me if you don't have time for all this :)
[09:48:03] <Dominus> Marzo, another thing I tested: Exult/ES will use the "big" chunk format when shapes.vga has >= 1024 shapes. The shape doesn't need to be in the chunk
[09:48:12] <Dominus> doesn't need to be in any chunk
[09:53:57] <Marzo> Dominus: hm, I guess I was remembering the code wrong then
[09:54:23] <Marzo> Regarding the flip bit: the easiest way to see it is with NPCs or with the avatar
[09:54:44] <Marzo> If you look at the graphics, they only have poses facing north and south
[09:55:05] <Marzo> So whenever they are facing east or west, the flip bit is set
[09:55:53] <Dominus> Hmm, but I mean how do you set this in the chunk list?
[09:59:36] <Marzo> The byte will be 8X, 9X, AX, BX, DX, EX or FX (with X = any hex digit)
[10:00:03] <Marzo> If the byte was 0X, 1X, 2X, 3X, 4X, 5X, 6X or 7X
[10:00:56] <Marzo> And I forgot CX on the first list
[10:02:22] <Dominus> ok, that gives me something to work on :)
[10:02:35] <Marzo> A simple way of understanding it is: each hex digit corresponds to 4 binary digits; using the proposed c++17 notation for binary (0b), we have this:
[10:05:05] <Marzo> 0x0 = 0b0000, 0x1 = 0b0001, 0x2 = 0b0010, 0x3 = 0b0011, 0x4 = 0b0100, 0x5 = 0b0101, 0x6 = 0b0110, 0x7 = 0b0100
[10:05:06] <Marzo> 0x8 = 0b1000, 0x9 = 0b1001, 0xA = 0b1010, 0xB = 0b1011, 0xC = 0b1100, 0xD = 0b1101, 0xE = 0b1110, 0xF = 0b1100
[10:05:20] <Marzo> And similar for the top hex digit
[10:06:34] <Marzo> Each bit is one higher power of 2: the rightmost bit is bit 0 (corresponds to 2^0 = 1), the next is bit 1 (corresponds to 2^1 = 2) and so on
[10:06:41] <Marzo> The top bit is the rightmost bit
[10:07:05] <Marzo> For hex, there are two digits, and the topmost bit is the leftmost bit of the left digit
[10:08:12] <Marzo> Because of the way Intel processors handle byte ordering internally, the top bit of a 2-byte hex number will be the top bit of the *second* byte you see in the hex editor
[10:10:32] <Marzo> Hopefully the above is clearer than mud; I have been messing with binary and hex for over 25 years now, and it can become difficult explaining something that you consider extremely basic
[10:11:55] <Dominus> he he
[10:12:30] <Dominus> it's a bit clearer but still a *bit* hard to wrap my mind around
[10:32:22] <Dominus> odd, I can no longer "paint" with ES...
[10:46:05] <Dominus> grrr... I've confused paint with edit terrain
[11:00:18] <Dominus> Marzo, some more testing and some more results: a shape with 65 frames (#0 - #64). a chunk painted with frames #0-#63 will use the "simple", 512 bytes u7chunks format
[11:01:10] <Dominus> when you edit the terrain with frame #64, ES will still save the 512 bytes format but the frame it saves will be frame #0 again
[11:01:52] <Dominus> (and probably loops through the numbers again)
[11:02:13] <Dominus> so we are currently limited to 64 frames (#0-#63)
[11:09:50] <Dominus> and regarding flipping - I edited a chunk to show the red with green F in the corner, that's shape 81, frame #0. The hex in the 512 byte format is 0x51 0x00, so flipping from the chart you gave earlier would be 0x51 0x80 but that's not flipping, still showing the F correct.
[11:19:13] <Dominus> back to max frames: if you are using more shapes than 1024 -> big bytes chunk file -> you can use more than 64 frames
[11:19:36] <Dominus> but *only* if you have more than 1024 shapes in shapes.vga
[11:20:24] <Dominus> as soon as you have less than 1024 shapes, ES will save the u7chunks file to the simple format again and you lose your higher frames :(
[11:23:10] --> frob has joined #exult
[11:27:51] <-- frob has left IRC (Ping timeout: 255 seconds)
[17:06:22] --> frob has joined #exult
[19:28:40] <Marzo> Hm, maybe flats don't flip
[20:00:45] <Dominus> Marzo: maybe it's only for select few shapes/frames that they flip? Since with higher up shape numbers and frame numbers 0X AND 8X can be a valid pointer to shape and frame
[20:07:17] <Dominus> Add to that when I tried it with the flat with the 512bytes u7chunks file it just didn't display differently when I used the flip.
[20:07:42] <Dominus> With the 768bytes u7chunks, Exult would crash