-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patha2rogue-notes.txt
140 lines (100 loc) · 3.66 KB
/
a2rogue-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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
Player uses:
t_flags
hero t_pos
pstats t_stats
pack t_pack
Follup: save_throw
Deprioritized features:
Prefixing commands with number of repeats
Running
Probably not features:
Disk features: Saving game, highscore
Custom inventory names
No way features:
Wizard
Boss screen
Options
Monster feature:
Add monsters to room:
start a monster chars array
copy monsters to level (for now)
monster structs go in master array
mlist is a list of pointers
No more linked lists, statically allocated array
How many monsters to allow?
Monster struct size: 28 bytes
things are 25 bytes
new_item becomes new_monster
implement clear monsters
Renaming:
new_thing is really new object
object struct is really a beast/monster
thing struct is fine
monster struct is a beast/monster type
Questions:
How are dark rooms erased.
How does hero light up around him
Things and objects:
Facts:
There are 9 rooms
There can be 1 monster per room to start
Wanderers are spawned ~70 moves
20 monster limit? 20 * 28 bytes = 560 bytes
Hero can hold 23 items
monsters can hold 1 item
1 thing can spawn in every room
traps can spawn darts
50 thing limit? 50 * 25 bytes = 1250 bytes
2k for items and monsters?
Jan 27th:
Total space seems to be at ~22.5k (code and window data, which is big @~10k).
Some ideas to clear up space:
Don't utilize a help window, redraw it each time.
Don't utilize a monster window, look them up each time by searching a collection.
Remove terse mode.
Move window data to HIMEM
Projecting space used based on passages.c = 10bytes per line of code:
Armor = 830
command = 6500
daemon = 1900
daemons = 1600
fight 7200
Feb 20th:
Observations:
Latest size is: 28892 bytes (~16k program code, ~10k data, ~2k init code)
Greatest possible program size is: 36351 bytes
Remaining: 7459 bytes
Stack default: 2048 bytes
RAM configured to end at 38400 bytes
So: 38400 - 2051(start address) - 2048(stack) - 36351(max prog size)
Ideas to save space:
Can share items between inventory and rooms using a stack/buffer combo.
Move himem to 0xBEFF (Adds 10k, new total is 45.5k code possible )
Remove help window (saves 1-2k)
Move stack and BCC to language card (Saves ~10k)
Reduce stack size: (Adds ~1k)
Less desirable:
Reduce resolution (saves 2-4k)
Remove monster window. Lookup monsters via location instead (saves 1-2K)
Feb 27th:
Observations:
My total code size: ~13.8kb (not lib code)
My total data size: ~10.5kb
Latest total size is 28833kb
Highest memory used in main: 0x5529 (~21kb)
Free main memory: ~26.7kb
LC memory used: 0x22A7 ~8.6kb
LC free memory: ~3.4kb
Total free memory: ~30.1Kb
Discoveries:
LC is ready only. So I put code in it instead of game state.
Extending HIMEM was easy
Monsters can only hold 1 item!
Duplicate items in pack are single item with count.
When dropping items, they drop 1 at a time :(. Need more item storage
Ideas:
So, I could put object struct directly on a monster. Takes more space though.
nevermind, monster struct is also player... so pack linked list is for backpack.
Use list/stack overlaid for level/backpack objects. Reduces object
storage to (23 pack + 9 level + ? monster pack) = ~40 object?
No, dropped items pull from count first, how about 100 objects? ~2.5kb!