Advertisement
Guest User

Untitled

a guest
Jul 16th, 2017
635
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.94 KB | None | 0 0
  1.  
  2. //BLOB alpha v0.2
  3.  
  4. >Blob
  5.  
  6. A blob is a living thing. You are the intelligent designer, create a DNA
  7. and bring it to life!
  8.  
  9. >DNA
  10.  
  11. The DNA is the code that runs on the blob.
  12. DNA is made out of operators.
  13. DNA is stored in txts in the dna directory.
  14. An example DNA (conn 1.txt):
  15.  
  16. clone
  17. 50
  18. 5
  19. 22
  20. mdna
  21. 13
  22. 99
  23. conn
  24. 2
  25. 13
  26. reg
  27. 2
  28. 0
  29. send
  30. 2
  31. 2
  32. rec
  33. 2
  34. 3
  35. pcmin
  36. 22
  37. nop
  38. rotp
  39. pcmin
  40. 26
  41. go
  42.  
  43. Line numbers are important. If you open the DNA text file ingame or in
  44. Notepad++ you can see the line numbers. Same DNA, but with line numbers:
  45.  
  46. 1|clone
  47. 2|50
  48. 3|5
  49. 4|22
  50. 5|mdna
  51. 6|13
  52. 7|99
  53. 8|conn
  54. 9|2
  55. 10|13
  56. 11|reg
  57. 12|2
  58. 13|0
  59. 14|send
  60. 15|2
  61. 16|2
  62. 17|rec
  63. 18|2
  64. 19|3
  65. 20|pcmin
  66. 21|22
  67. 22|nop
  68. 23|rotp
  69. 24|pcmin
  70. 25|26
  71. 26|go
  72.  
  73. Suggested editor: Notepad++
  74.  
  75. >How will it work?
  76.  
  77. Each blob has its own energy. If the energy counter reaches 0,
  78. the blob dies. A new blob from left click starts with 100 enegry.
  79. Lets say we select "conn 1" form the left click menu, then click
  80. on the black background to add it. If you hit "stop" in the
  81. simulation menu, then hit "step" a few times you will be able to
  82. see each and every step.
  83.  
  84. The first command is clone. It has 3 operands:
  85. 1|clone
  86. 2|50
  87. 3|5
  88. 4|22
  89.  
  90. >Camera controls
  91.  
  92. Middle click drag: drag camera
  93. Scroll: zoom
  94.  
  95. >In game editor
  96.  
  97. You can edit blobs in the in-game editor but you wont be able to save
  98. them. Remember: you are playing a developer edition alpha build.
  99. You can grab operands and drag them into the DNA. You can click a command
  100. in the DNA to delete it. You can click an operand to edit it. Click,
  101. type numbers / backspace then hit enter.
  102.  
  103. >Program counters
  104.  
  105. Each blob has 3 program counters
  106. - actual program counter [pc]
  107. - program counter min [pc min]
  108. - program counter never [pc never]
  109. Each blob does operations between its min and never program counter,
  110. in a continuous loop. It starts from pc min and restarts the loop
  111. before it reaches pc never.
  112. A new blob from left click starts with an actual program counter of 0.
  113. The jump operands sets the program counter directly.
  114.  
  115. >Operators
  116.  
  117. Operators are the building blocks of the DNA. Each operator has an
  118. energy cost. Some operators have operands. Each operation takes
  119. one simulation tick.
  120.  
  121. operator | # of operands | E required
  122. ---------+---------------+-------------
  123. nop | 0 | 0
  124. clone | 3 | 1 + extra
  125. getE | 0 | 1
  126. rotn | 0 | 1
  127. rotp | 0 | 1
  128. go | 0 | 1
  129. conn | 2 | 1
  130. reg | 2 | 1
  131. ray | 1 | 1
  132. aoe | 0 | 1
  133. jmp | 1 | 1
  134. pcmin | 1 | 1
  135. pcmax | 1 | 1
  136. clone2 | 3 | 1 + extra
  137. send | 2 | 1
  138. rec | 2 | 1
  139. mdna | 2 | 1
  140.  
  141. - nop
  142. Does nothing.
  143.  
  144. - clone
  145. 3 operands:
  146. 1.: new blob starting E (from own)
  147. 2.: new blob pc min, new blob actual pc
  148. 3.: new blob pc max
  149. Pc min and pc max are line numbers from the DNA code.
  150.  
  151. - getE
  152. The blob gets 10 E. Chlorophyll and eating is not in the game yet and
  153. the blob has to get energy form somewhere.
  154.  
  155. - rotn
  156. The blob rotates counterclockwise.
  157.  
  158. - rotp
  159. The blob rotates clockwise.
  160.  
  161. - go
  162. The blob moves forward (towards its white line).
  163.  
  164. - conn
  165. 2 operands:
  166. 1.: connection slot [1-4]
  167. 2.: connection id
  168. If 2 blob collide with the same connection id they form a bond.
  169. If a blob has an existing connection with an other blob it wont
  170. form a 2nd connection with the same id.
  171.  
  172. - reg
  173. 2 operands:
  174. 1.: register number
  175. 2.: register new value
  176. You have 8 registers. You might want to set one not zero before you jmp.
  177.  
  178. - ray
  179. 1 operand: output reg
  180. Cast a ray (towards its white line), if it hits if flips the
  181. color bit of the hit blob and sets the output reg to 1.
  182. Else sets the output reg to 0.
  183.  
  184. - aoe
  185. Flips the color bit of the nearby alive blobs.
  186.  
  187. - jmp
  188. 1 operand: new pc
  189. Sets the actual program counter to the new value. If pcmin is not
  190. equals 0, the jmp will jump between pc min and pc never - 1.
  191.  
  192. - pcmin
  193. 1 operand: new pc min
  194. Sets the min program counter to the new value.
  195.  
  196. - pcmax
  197. 1 operand: val
  198. Sets program counter never to val + 1.
  199.  
  200. - clone2
  201. 3 operands:
  202. 1.: E to keep (remaining is the starting E of the new blob)
  203. 2.: new blob pc min, new blob actual pc
  204. 3.: new blob pc max
  205. Pc min and pc max are line numbers from the DNA code.
  206.  
  207. - send
  208. 2 operands:
  209. 1.: connection slot [1-4]
  210. 2.: output register number
  211.  
  212. - rec
  213. 2 operands:
  214. 1.: connection slot [1-4]
  215. 2.: input register number
  216.  
  217. - mdna
  218. 2 operands:
  219. 1.: dna line number
  220. 2.: line new val
  221.  
  222. >Future updates
  223.  
  224. Stuff that is essential, but I havent coded it yet:
  225. -save button
  226. -wait operator
  227. -sensing
  228. -chlorophyll
  229. -eating
  230. -att, def, hp
  231. -multiplayer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement