Move doc/changelog.txt and doc/ancient_main_comment.txt into old/
[oweals/minetest.git] / old / ancient_main_comment.txt
1 ------------------------------------------------------------------
2 The ancient comment from the beginning of main.cpp is stored here.
3 ------------------------------------------------------------------
4
5 /*
6 =============================== NOTES ==============================
7 NOTE: Things starting with TODO are sometimes only suggestions.
8
9 NOTE: iostream.imbue(std::locale("C")) is very slow
10 NOTE: Global locale is now set at initialization
11
12 NOTE: If VBO (EHM_STATIC) is used, remember to explicitly free the
13       hardware buffer (it is not freed automatically)
14
15 NOTE: A random to-do list saved here as documentation:
16 A list of "active blocks" in which stuff happens. (+=done)
17         + Add a never-resetted game timer to the server
18         + Add a timestamp value to blocks
19         + The simple rule: All blocks near some player are "active"
20         - Do stuff in real time in active blocks
21                 + Handle objects
22                 - Grow grass, delete leaves without a tree
23                 - Spawn some mobs based on some rules
24                 - Transform cobble to mossy cobble near water
25                 - Run a custom script
26                 - ...And all kinds of other dynamic stuff
27         + Keep track of when a block becomes active and becomes inactive
28         + When a block goes inactive:
29                 + Store objects statically to block
30                 + Store timer value as the timestamp
31         + When a block goes active:
32                 + Create active objects out of static objects
33                 - Simulate the results of what would have happened if it would have
34                   been active for all the time
35                         - Grow a lot of grass and so on
36         + Initially it is fine to send information about every active object
37           to every player. Eventually it should be modified to only send info
38           about the nearest ones.
39                 + This was left to be done by the old system and it sends only the
40                   nearest ones.
41
42 NOTE: Seeds in 1260:6c77e7dbfd29:
43 5721858502589302589:
44         Spawns you on a small sand island with a surface dungeon
45 2983455799928051958:
46         Enormous jungle + a surface dungeon at ~(250,0,0)
47
48 Old, wild and random suggestions that probably won't be done:
49 -------------------------------------------------------------
50
51 SUGG: If player is on ground, mainly fetch ground-level blocks
52
53 SUGG: Expose Connection's seqnums and ACKs to server and client.
54       - This enables saving many packets and making a faster connection
55           - This also enables server to check if client has received the
56             most recent block sent, for example.
57 SUGG: Add a sane bandwidth throttling system to Connection
58
59 SUGG: More fine-grained control of client's dumping of blocks from
60       memory
61           - ...What does this mean in the first place?
62
63 SUGG: A map editing mode (similar to dedicated server mode)
64
65 SUGG: Transfer more blocks in a single packet
66 SUGG: A blockdata combiner class, to which blocks are added and at
67       destruction it sends all the stuff in as few packets as possible.
68 SUGG: Make a PACKET_COMBINED which contains many subpackets. Utilize
69       it by sending more stuff in a single packet.
70           - Add a packet queue to RemoteClient, from which packets will be
71             combined with object data packets
72                 - This is not exactly trivial: the object data packets are
73                   sometimes very big by themselves
74           - This might not give much network performance gain though.
75
76 SUGG: Precalculate lighting translation table at runtime (at startup)
77       - This is not doable because it is currently hand-made and not
78             based on some mathematical function.
79                 - Note: This has been changing lately
80
81 SUGG: A version number to blocks, which increments when the block is
82       modified (node add/remove, water update, lighting update)
83           - This can then be used to make sure the most recent version of
84             a block has been sent to client, for example
85
86 SUGG: Make the amount of blocks sending to client and the total
87           amount of blocks dynamically limited. Transferring blocks is the
88           main network eater of this system, so it is the one that has
89           to be throttled so that RTTs stay low.
90
91 SUGG: Meshes of blocks could be split into 6 meshes facing into
92       different directions and then only those drawn that need to be
93
94 SUGG: Background music based on cellular automata?
95       http://www.earslap.com/projectslab/otomata
96
97 SUGG: Simple light color information to air
98
99 SUGG: Server-side objects could be moved based on nodes to enable very
100       lightweight operation and simple AI
101         - Not practical; client would still need to show smooth movement.
102
103 SUGG: Make a system for pregenerating quick information for mapblocks, so
104           that the client can show them as cubes before they are actually sent
105           or even generated.
106
107 SUGG: Erosion simulation at map generation time
108     - This might be plausible if larger areas of map were pregenerated
109           without lighting (which is slow)
110         - Simulate water flows, which would carve out dirt fast and
111           then turn stone into gravel and sand and relocate it.
112         - How about relocating minerals, too? Coal and gold in
113           downstream sand and gravel would be kind of cool
114           - This would need a better way of handling minerals, mainly
115                 to have mineral content as a separate field. the first
116                 parameter field is free for this.
117         - Simulate rock falling from cliffs when water has removed
118           enough solid rock from the bottom
119
120 SUGG: For non-mapgen FarMesh: Add a per-sector database to store surface
121       stuff as simple flags/values
122       - Light?
123           - A building?
124           And at some point make the server send this data to the client too,
125           instead of referring to the noise functions
126           - Ground height
127           - Surface ground type
128           - Trees?
129
130 Gaming ideas:
131 -------------
132
133 - Aim for something like controlling a single dwarf in Dwarf Fortress
134 - The player could go faster by a crafting a boat, or riding an animal
135 - Random NPC traders. what else?
136
137 Game content:
138 -------------
139
140 - When furnace is destroyed, move items to player's inventory
141 - Add lots of stuff
142 - Glass blocks
143 - Growing grass, decaying leaves
144         - This can be done in the active blocks I guess.
145         - Lots of stuff can be done in the active blocks.
146         - Uh, is there an active block list somewhere? I think not. Add it.
147 - Breaking weak structures
148         - This can probably be accomplished in the same way as grass
149 - Player health points
150         - When player dies, throw items on map (needs better item-on-map
151           implementation)
152 - Cobble to get mossy if near water
153 - More slots in furnace source list, so that multiple ingredients
154   are possible.
155 - Keys to chests?
156
157 - The Treasure Guard; a big monster with a hammer
158         - The hammer does great damage, shakes the ground and removes a block
159         - You can drop on top of it, and have some time to attack there
160           before he shakes you off
161
162 - Maybe the difficulty could come from monsters getting tougher in
163   far-away places, and the player starting to need something from
164   there when time goes by.
165   - The player would have some of that stuff at the beginning, and
166     would need new supplies of it when it runs out
167
168 - A bomb
169 - A spread-items-on-map routine for the bomb, and for dying players
170
171 - Fighting:
172   - Proper sword swing simulation
173   - Player should get damage from colliding to a wall at high speed
174
175 Documentation:
176 --------------
177
178 Build system / running:
179 -----------------------
180
181 Networking and serialization:
182 -----------------------------
183
184 SUGG: Fix address to be ipv6 compatible
185
186 User Interface:
187 ---------------
188
189 Graphics:
190 ---------
191
192 SUGG: Combine MapBlock's face caches to so big pieces that VBO
193       can be used
194       - That is >500 vertices
195           - This is not easy; all the MapBlocks close to the player would
196             still need to be drawn separately and combining the blocks
197                 would have to happen in a background thread
198
199 SUGG: Make fetching sector's blocks more efficient when rendering
200       sectors that have very large amounts of blocks (on client)
201           - Is this necessary at all?
202
203 SUGG: Draw cubes in inventory directly with 3D drawing commands, so that
204       animating them is easier.
205
206 SUGG: Option for enabling proper alpha channel for textures
207
208 TODO: Flowing water animation
209
210 TODO: A setting for enabling bilinear filtering for textures
211
212 TODO: Better control of draw_control.wanted_max_blocks
213
214 TODO: Further investigate the use of GPU lighting in addition to the
215       current one
216
217 TODO: Artificial (night) light could be more yellow colored than sunlight.
218       - This is technically doable.
219           - Also the actual colors of the textures could be made less colorful
220             in the dark but it's a bit more difficult.
221
222 SUGG: Somehow make the night less colorful
223
224 TODO: Occlusion culling
225       - At the same time, move some of the renderMap() block choosing code
226         to the same place as where the new culling happens.
227       - Shoot some rays per frame and when ready, make a new list of
228             blocks for usage of renderMap and give it a new pointer to it.
229
230 Configuration:
231 --------------
232
233 Client:
234 -------
235
236 TODO: Untie client network operations from framerate
237       - Needs some input queues or something
238           - This won't give much performance boost because calculating block
239             meshes takes so long
240
241 SUGG: Make morning and evening transition more smooth and maybe shorter
242
243 TODO: Don't update all meshes always on single node changes, but
244       check which ones should be updated
245           - implement Map::updateNodeMeshes() and the usage of it
246           - It will give almost always a 4x boost in mesh update performance.
247
248 - A weapon engine
249
250 - Tool/weapon visualization
251
252 FIXME: When disconnected to the menu, memory is not freed properly
253
254 TODO: Investigate how much the mesh generator thread gets used when
255       transferring map data
256
257 Server:
258 -------
259
260 SUGG: Make an option to the server to disable building and digging near
261       the starting position
262
263 FIXME: Server sometimes goes into some infinite PeerNotFoundException loop
264
265 * Fix the problem with the server constantly saving one or a few
266   blocks? List the first saved block, maybe it explains.
267   - It is probably caused by oscillating water
268   - TODO: Investigate if this still happens (this is a very old one)
269 * Make a small history check to transformLiquids to detect and log
270   continuous oscillations, in such detail that they can be fixed.
271
272 FIXME: The new optimized map sending doesn't sometimes send enough blocks
273        from big caves and such
274 FIXME: Block send distance configuration does not take effect for some reason
275
276 Environment:
277 ------------
278
279 TODO: Add proper hooks to when adding and removing active blocks
280
281 TODO: Finish the ActiveBlockModifier stuff and use it for something
282
283 Objects:
284 --------
285
286 TODO: Get rid of MapBlockObjects and use only ActiveObjects
287         - Skipping the MapBlockObject data is nasty - there is no "total
288           length" stored; have to make a SkipMBOs function which contains
289           enough of the current code to skip them properly.
290
291 SUGG: MovingObject::move and Player::move are basically the same.
292       combine them.
293         - NOTE: This is a bit tricky because player has the sneaking ability
294         - NOTE: Player::move is more up-to-date.
295         - NOTE: There is a simple move implementation now in collision.{h,cpp}
296         - NOTE: MovingObject will be deleted (MapBlockObject)
297
298 TODO: Add a long step function to objects that is called with the time
299       difference when block activates
300
301 Map:
302 ----
303
304 TODO: Flowing water to actually contain flow direction information
305       - There is a space for this - it just has to be implemented.
306
307 TODO: Consider smoothening cave floors after generating them
308
309 TODO: Fix make_tree, make_* to use seed-position-consistent pseudorandom
310           - delta also
311
312 Misc. stuff:
313 ------------
314 TODO: Make sure server handles removing grass when a block is placed (etc)
315       - The client should not do it by itself
316           - NOTE: I think nobody does it currently...
317 TODO: Block cube placement around player's head
318 TODO: Protocol version field
319 TODO: Think about using same bits for material for fences and doors, for
320           example
321
322 SUGG: Restart irrlicht completely when coming back to main menu from game.
323         - This gets rid of everything that is stored in irrlicht's caches.
324         - This might be needed for texture pack selection in menu
325
326 TODO: Merge bahamada's audio stuff (clean patch available)
327
328 Making it more portable:
329 ------------------------
330  
331 Stuff to do before release:
332 ---------------------------
333
334 Fixes to the current release:
335 -----------------------------
336
337 Stuff to do after release:
338 ---------------------------
339
340 Doing currently:
341 ----------------
342
343 ======================================================================
344
345 */