2
0

ancient_main_comment.txt 12 KB

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