-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPi-Mine Data Notes.txt
43 lines (34 loc) · 2.37 KB
/
Pi-Mine Data Notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
In order to allow semi-random access to the buffer each character will be expressed as a block which will then
be painted into a character and two colors before being put onto the console buffer and rendered.
An interpreter tool will be used to turn a block into a character and two colors. Then, a painter tool will
be used to convert the block data to escape codes which will then be inserted into the console as output.
Block data (size varies) Block Paint data (byte each) Console buffer (any size) Console output (No mem)
1. Commands 1. Forecolor
2. Chunks ==========> 2. Backcolor ==========> \e[0m\e[30m\e[47m... ===========> #
Interpret 3. Block shape Paint Draw
I think that the block data should be server-side which then sends it over to the client.
The client will then interpret and paint the block data onto the console buffer to draw it.
The client will send its input data over to the server in the form of commands.
The server may respond in the form of updating information, sending commands, or returning errors.
BLOCK DATA:
The block data should be 4 bytes per block: 2 bytes for the block's id and 2 bytes for the damage value.
This will provide ample room for expansion and decent file size. The damage value will be used for calculating
weapon damage, alternate blocks, and used as a pointer for items that contain an inventory (such as chests).
Note: A "pointer" in this instance is a pointer to virtual memory that is handled by the game's memory library.
Each virtual address will point to a separate Inventory object (Up to a maximum of 2^16 objects in a level).
An address with the value of 0 will not be used and will be treated as a null pointer case.
BLOCK
2 bytes: id
2 bytes: damage value, pointer, etc.
INVENTORY POINTER (2 bytes) ======================> POINTER TO INVENTORY'S MEMORY (4 bytes)
Inventory address map
CHUNKS:
I think the client should have 9 chunks loaded (a chunk being Width x Height blocks), the chunk the player
is inside as well as all of the adjacent chunks. This will be 17,280 blocks if the screen dimensions are 24x80.
-------+-------+-------
CHUNK | CHUNK | CHUNK
-------+-------+-------
CHUNK | PLAYR | CHUNK
-------+-------+-------
CHUNK | CHUNK | CHUNK
-------+-------+-------