|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <!DOCTYPE html>
- <html>
- <meta charset="utf-8">
- <head>
- <link rel="stylesheet" href="../../style.css">
- </head>
- <body>
- <script data-goatcounter="https://services.opengamestudio.org:443/count" async src="//services.opengamestudio.org:443/count.js"></script>
- <div id="header">
- <div class="header2">
- <div class="menu">
- <a href="../../en/news/index.html">News</a>
- <a href="../../en/game/index.html">Games</a>
- <a href="../../en/tool/index.html">Tools</a>
- <a href="../../en/page/about.html">About</a>
- </div>
- <div id="lang">
- <a href="../../en/news/mahjong-recreation-start.html">EN</a>
- <a href="../../ru/news/mahjong-recreation-start.html">RU</a>
- </div>
- <div class="clear"></div>
- </div>
- </div>
- <h3 class="left_item_title">In the news...</h3>
- <center>
- <div class="news_item">
- <h2 class="news_item_title">
- <a href="mahjong-recreation-start.html">Mahjong recreation start</a>
- </h2>
- <p class="news_item_date">
- 2018-01-26 00:00
- </p>
- <div class="news_item_contents">
- <p><img src="../../images/2018-01-26-mahjong-recreation-start.png" alt="Spherical tiles in a Mahjong layout" /></p>
- <p>This article describes the start of Mahjong game recreation.</p>
- <p><strong>Plan</strong></p>
- <p>We started Mahjong recreation endeavour by composing a brief plan to get gameplay with minimal graphics:</p>
- <ul>
- <li>Load single layout</li>
- <li>Place tiles in layout positions</li>
- <li>Distinguish tiles</li>
- <li>Implement selection</li>
- <li>Implement matching</li>
- </ul>
- <p>Just like any other plan, this one looked fine at first sight. However, once you get down to work, new details start to come out. This plan was no exception. Below are a few problems that came out during development.</p>
- <p><strong>Problem №1: provide binary resources across supported platforms</strong></p>
- <p>Mahjong is going to be available on desktop, mobile, and web. Each of these platforms has its constraints on accessing external files:</p>
- <ul>
- <li>Desktop can access almost any file</li>
- <li>Android/iOS have limited access to file system</li>
- <li>Web does not have any file system at all</li>
- </ul>
- <p>To provide a unified way for accessing resources, we decided to include them into final executable. This decision led to the birth of <strong>mjin-resource</strong> and <strong>mahjong-data</strong> projects.</p>
- <p><a href="https://bitbucket.org/ogstudio/mjin-resource">mjin-resource</a>:</p>
- <ul>
- <li>converts binary files to C header files with the help of <strong>xxd</strong> utility</li>
- <li>generates MJIN project that contains generated headers to be compiled into static library</li>
- <li>provides C++ interface for accessing generated resources</li>
- </ul>
- <p><a href="https://bitbucket.org/ogstudio-games/mahjong-data">mahjong-data</a> is an example of such generated MJIN project that is referenced by <a href="https://bitbucket.org/ogstudio-games/ogs-mahjong">mahjong</a> project.</p>
- <p><strong>Problem №2: load PNG images across supported platforms</strong></p>
- <p>To load PNG, we use corresponding OpenSceneGraph plugin. We built it for desktop with no issues. Building for web (Emscripten) turned out to be more difficult: Emscripten provides its own version of <strong>libpng</strong>, which OpenSceneGraph build script can't detect. We had to work around several OpenSceneGraph checks to successfully build the plugin for Emscripten.</p>
- <p>Building the plugin for Android and iOS is still waiting for us. Once we get PNG plugin working across supported platforms, we are going to publish a new tutorial for <a href="https://github.com/ogstudio/openscenegraph-cross-platform-guide">OpenSceneGraph cross-platform guide</a> to cover PNG image loading. We already got a <a href="https://github.com/OGStudio/openscenegraph-cross-platform-guide/issues/4">request to describe image loading</a>.</p>
- <p><strong>Development</strong></p>
- <p><a href="lets-go.html">As you know</a>, we published OpenSceneGraph cross-platform guide to make OpenSceneGraph community stronger. We value education, and we love to share our knowledge. That's why we decided to develop Mahjong in small reproducible chunks uniquely identified by internal versions. These versions are available in <a href="https://bitbucket.org/ogstudio-games/ogs-mahjong">mahjong repository</a>.</p>
- <p>We also provide <a href="http://ogstudio.github.io/game-mahjong">version history and web releases of each internal version</a> for the following reasons:</p>
- <ul>
- <li>education: show how development looks like internally</li>
- <li>accessibility: provide older versions for comparison</li>
- </ul>
- <p><strong>Current Mahjong game status</strong></p>
- <p>As of the time of this writing, we have implemented tile selection. <a href="https://ogstudio.github.io/game-mahjong/versions/010/mjin-player.html">Try it in your browser!</a></p>
- <p>Once we finish tile matching implementation, we are going to publish the intermediate result for all supported platforms.</p>
- <p>That's it for describing the start of Mahjong game recreation.</p>
- </div>
- </div>
- <div id="disqus_thread"></div>
- <script>
- var disqus_config = function () {
- this.page.url = "https://opengamestudio.org/en/news/mahjong-recreation-start.html";
- this.page.identifier = "mahjong-recreation-start.html";
- };
- (function() {
- var d = document, s = d.createElement('script');
- s.src = 'https://opengamestudio.disqus.com/embed.js';
- s.setAttribute('data-timestamp', +new Date());
- (d.head || d.body).appendChild(s);
- })();
- </script>
- <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
- <div id="footer">
- The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
- from <a href="http://github.com/ogstudio/site-opengamestudio">this source code</a>.
- </div>
- </center>
- </body>
- </html>
|