Design and logic for user-facing site https://exmods.org
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

116 řádky
9.2KB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta name="theme-color" content="#20c420" />
  5. <meta name="author" content="NGnius" />
  6. <meta name="keywords" content="exmods,gamecraft,modding,mod" />
  7. <meta name="og:type" content="website" />
  8. <meta name="og:title" content="Exmods Blog" />
  9. <meta name="og:description" content="Quick mod development" />
  10. <meta name="description" content="Quick mod development" />
  11. <meta name="og:image" content="../static/favicon.png" />
  12. <meta name="og:url" content="https://www.exmods.org" />
  13. <meta charset="UTF-8" />
  14. <link rel="icon" href="../static/favicon.png" type="image/x-icon"/>
  15. <link rel="shortcut icon" href="../static/favicon.png" type="image/x-icon"/>
  16. <link rel="stylesheet" href="../static/style.css" type="text/css" />
  17. <title>Exmods | Rapid Prototyping</title>
  18. </head>
  19. <body>
  20. <h3><a href="index.html" title="You know your browser has a back button, right?">Back to list</a></h3>
  21. <h1>Rapid Prototyping</h1>
  22. <div class="text-content">
  23. <p>
  24. <span class="tab"></span>
  25. In software development, creating a minimum viable product is a very popular strategy for getting to market quickly and getting customer feedback as soon as possible.
  26. Once the software has made it to market, improvements are made iteratively based on feedback and the product roadmap.
  27. This is the basis of the agile development strategy, which aims to ensure the product meets what the customer wants all throughout the development process,
  28. instead of releasing the software once it's all been finalised and hoping that the customer likes it (called "waterfall").
  29. If you're interested in how this can apply to business practices, check out <a href="http://theleanstartup.com/">The Lean Startup by Eric Ries</a>.
  30. Admittedly, it's not the most interesting book to read -- I have read about half of it,
  31. but got tired of it (which means it's one of two books I never finished, the other being Relativity by Albert Einstein -- so The Lean Startup is like Relativity?)
  32. -- but it's great for learning about how lots of tech startups think.
  33. If you want to start a company, or your own for-profit hobby project, it may be worth a read.
  34. Regardless, agile is the currently the industry-leading way of doing development.
  35. There's some useless trivia that you'll probably never need unless you want to sound smart to friends.
  36. </p>
  37. <p>
  38. <span class="tab"></span>
  39. Agile software involves short coding "sprints" -- usually one or two weeks long -- where new features are added and existing ones are changed.
  40. At the end of a sprint, the new changes are released to the customers.
  41. To complete coding sprints on time, many things have to go right.
  42. Beforehand, features and changes for a sprint have to small enough to complete in one sprint
  43. (in exceptional cases, bigger features which can't be split up sometimes span multiple sprints).
  44. During the sprint, changes have to be made to work with minimal unexpected complications.
  45. Issues often come up when multiple developers change things which are inter-dependent (Svelto.ECS tries to mitigate this).
  46. If a feature ends up taking too long, deadlines can be missed. And companies don't like missing deadlines
  47. (although construction and governments seem to do it pretty often).
  48. To reduce the risk of missing deadlines, it's helpful to create a prototype of a feature first.
  49. This allows the developers to get acquainted with the intricate details that will need to be done, which is vital to estimating the amount of work required.
  50. But the prototype has to be made quickly, otherwise the sprint can't be started and deadlines will still slip.
  51. That's why rapid prototyping is a favourite buzzword of a lot of companies.
  52. I think FreeJam also calls them mock features (there's lots of unused code which mentions "mock").
  53. </p>
  54. <p>
  55. <span class="tab"></span>
  56. Since this blog is about Gamecraft modding, I'll stop talking in generalities.
  57. Rapid prototyping for mods is actually pretty easy.
  58. For a new mod, <a href="https://git.exmods.org/modtainers/HelloModdingWorld">HelloModdingWorld</a>
  59. has a mod skeleton ready for you, so that you can avoid most of the setup and boilerplate.
  60. For an existing mod, it's easy to throw together a new feature in a new git branch or using a copy of the code without risk to the mod.
  61. I hate to shill the <a href="https://git.exmods.org/modtainers/GamecraftModdingAPI">GamecraftModdingAPI</a>, but it can really make prototype features easy to implement.
  62. Once you've got a feel for how the feature should be done properly, you can reuse code from the prototype to make it happen.
  63. Seeing a new feature working is the most rewarding part of coding, at least for me, even if it's only a prototype.
  64. Seeing a feature working after only 30 minutes of work is icing on the cake.
  65. </p>
  66. <p>
  67. <span class="tab"></span>
  68. Recently, I put my rapid prototyping experience to a test by writing a mod to expose additional graphical settings,
  69. called <a href="https://git.exmods.org/NGnius/Kompressor">Kompresor</a>.
  70. While I didn't get it working in 30 minutes, I made video recordings of every minute I spent working on it and the footage didn't come close to a full day of work.
  71. A lot of that time was spent manually associating the file's data to specific graphical settings, which was tedious and unavoidable no matter how I did it.
  72. With that in mind, and if you don't count the long time I spent editing the footage, the first sprint for Kompressor took about 6 hours.
  73. That's pretty rapid for implementing a mod that modifies most readily available graphics settings.
  74. </p>
  75. <p>
  76. <span class="tab"></span>
  77. The next Kompressor sprint, whenever I find some time to record me typing and talking to my self, should be just as quick.
  78. I'm planning on focusing on adding game save compression for that coding sprint.
  79. The file compression involved will require some runtime game patching using <a href="https://harmony.pardeike.net/">Harmony</a>, which is something that I don't mention that often.
  80. Harmony is an easy way to hijack C# function calls and run your own code before, after or instead of the original.
  81. All of that is setup while the game is booting, and removed when the game shuts down, so it's a very safe and powerful way to mod Gamecraft.
  82. Harmony also offers quite a few helpful ways to designate what to patch, which can make patching as quick as writing a couple lines of code.
  83. When rapidly prototyping, this makes running code as a consequence of vanilla Gamecraft code easy and convenient.
  84. </p>
  85. <p>
  86. <span class="tab"></span>
  87. But how do you find the function you want to patch?
  88. Well, I've saved the best (worst) for last.
  89. Finding the function takes a lot of reading code.
  90. The best tools for reading code are C# decompilers like <a href="">dnSpy</a> and <a href="">ilSpy</a>.
  91. Unfortunately, I can't offer much advice for speeding that up except that it takes common sense
  92. (CommandLine.dll does not contain block-related code) and experience (ECS does not stand of Extremely Cool Sliderule).
  93. Searching the Gamecraft codebase for what you're looking for is undeniably the biggest slowdown that you can encounter while rapidly prototyping.
  94. Depending on what you're trying to mod, you may be able to avoid it, but if you can't it's not the end of the world:
  95. Reading Gamecraft code can be quite educational, especially for someone who doesn't know a lot about C# (like me).
  96. Function-finding can be slow, but think of it as an investment for speeding up future endeavours.
  97. </p>
  98. <p>
  99. <span class=""></span>
  100. See? Modding doesn't have to involve days of yelling at your code about a missing semicolon (only hours instead).
  101. Writing a minimum viable mod is a great way to explore what you can do with mods.
  102. Write some code, give it a test run, and repeat to see where you can go.
  103. Investing a few hours could get you pretty far.
  104. You could even make your investment back by completing a mod bounty -- the cash for importing 3D objects into the game sounds pretty sweet.
  105. If you're really enthusiastic about rapid prototyping, hit me up since I've been thinking about hosting a modding hackathon (modathon?), but I'd like to have more than 2 people show up.
  106. So go try some sprinting!
  107. </p>
  108. </div>
  109. <footer>
  110. exmods.org|<a href="https://git.exmods.org/ExMods/html-site">Site Repository</a>|<a href="https://exmods.org">Home</a>|<a href="https://discord.gg/2CtWzZT">Discord</a>|<a href="https://twitter.com/GamecraftMods">Twitter</a>
  111. </footer>
  112. </body>
  113. </html>