    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: Windows Waffle</title>
        <link>https://members.accu.org/index.php/articles/1439</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>




<div class="xar-mod-head"><span class="xar-mod-title">Design of applications and programs + Overload Journal #4 - Feb 1994</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c13/">Topics</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c67/">Design</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c78/">Overload</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c233/">04</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/c67-233/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/articles/c67+233/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;Windows Waffle</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 01 February 1994 08:58:00 +00:00 or Tue, 01 February 1994 08:58:00 +00:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<p>When computers are mentioned in conversation outside of the working
environment, the next question asked is invariably &quot;is it a Sega or
Nintendo?&quot;. The vast majority of non-programmer/professional user seem
to think that games consoles are the only form of computers that people
own. To a certain extent, I'm sure this is caused by the overwhelming
attraction that computer games have to some people. So I ask myself,
can this be harnessed to assist programmers learn new skills?</p>
<p>I think it can. Games present a format that is easy to visualise the
end-result. There is also a degree of magnetism to the idea of being
able to modify the internal workings of a game - as well as the kudos
of demonstrating your complete mastery of the game.</p>
<p>To this end, I am going to use a game to demonstrate the life-cycle
development of a project using OOA/D and OOP using OMT (Rumbaughs
Object Modelling Technique) and C++ respectively.</p>
<p>The game will run under MS-Windows, and three versions (OWL 1.0, OWL
2.0 and MFC 2.0) will be written. The source code will be on disk, only
the outline and rationale will be in the magazine. No previous
knowledge of Windows programming is required, as a consequence, it may
start a little slow for more advanced programmers. I hope they will not
ignore these articles as I hope they will participate in providing
ideas and improvements to the project. The project is not intended to
be a work of art that tries to say &quot;this is the way to do it&quot;, far from
it, any blind-alleys or methods that don't work well, will be
documented. Learning from design and coding mistakes can prove just as
useful as those that work, and should provide some chance of avoiding
similar mistakes in the future.</p>
<p>A sad confession; at this moment, I do not know exactly what the
game will be. I suspect that it will evolve as the design becomes more
complete. What I would like to do is to play against real opponents.
This will require two (or more) PC's to be connected and for the game
information to be passed between them. It seem that to achieve this I
will have to write a small communications program. I really am letting
myself in for a lot of work, but I do hate computer opponents, so I
will have to pay the price.</p>
<p>So what's the game?</p>
<p>After much cogitation the best idea that I have come up with (that
is both achievable and instructive) is a game of battleships (not the
game with squares and guessing A-4 etc). Further suggestions will be
considered, but I need to know soon. I will start by getting the comms
classes built first and these will be of use for any multi-player game.</p>
<p>The type of game means that each player will only be informed of
what can be seen. This means that reconnaissance will be essential. One
of the complexities with a multi-machine game is the co-ordination and
synchronisation. To achieve this, one of the PC's will be nominated as
the master, and will be responsible for such tasks as map generation
and timing controls.</p>
<p>The first of these articles (Issue 5) will concentrate on the design
and coding of the low level communications classes, as well as the
principles of passing information between all the machines involved.
The method for PC-PC communication has to settled on. This must be very
flexible as it can then be used as the basis of other games.</p>
<h2>PC-PC Communication.</h2>
<p>This will be achieved by use of the PC's RS232 ports (serial ports)
and will be physically connected by means of null-modem cables (see
notes at end). It is intended that the PC's will be directly connected
to each other rather than thru modems. (perhaps someone else would like
to extend the classes!).</p>
<p>Firstly, the connection of two PC's together conceptually proves no
problem, a single cable between the machines will suffice. But how can
the system be made flexible to cope with variable numbers of PC's and
remain simple. Some of the PC's will need to use both of their serial
ports if three or more PC's are to be joined.</p>
<p>The simplest connections are as follows:<br>
</p>
<p style="text-align: center;"><img style="width: 400px; height: 104px;"
 alt="SImplest PC connections" src="/content/images/journals/ol04/windowswaffle01.png"><br>
</p>
<p>Will this work? Physically yes, but it will make for more
complicated message handling routines. Messages would have to flow in
two directions from the central PC's (B,C,D &amp; E) and only one way
from the end PC's (A &amp; F). This situation would be bearable if
messages were to be targeted at individual machines and a routing table
of how to contact each machine were mapped. I want to avoid this
situation and so propose to use a simpler method based on the idea of a
ring topology Local Area Network.<br>
</p>
<p style="text-align: center;"><img style="width: 400px; height: 123px;"
 alt="A ring of PC connections" src="/content/images/journals/ol04/windowswaffle02.png"><br>
</p>
<p>or viewed as a ring:<br>
</p>
<p style="text-align: center;"><img style="width: 400px; height: 273px;"
 alt="PC connections viewed as a ring" src="/content/images/journals/ol04/windowswaffle03.png"><br>
</p>
<p>With this method, each PC is connected to the others by two cables.
To ensure things stay simple, all messages will flow one way around the
ring, so that each machine will always receive messages on one port and
transmit on another. Messages will be &quot;broadcast&quot; and sent to all
machines. As one machine receives a message, it will first re-transmit
this message to the next machine and then action the message.<br>
</p>
<p>The keen-eyed reader will by now be saying that the message will run
around the forever. This is true, so in order to stop the message
running around the ring forever, the message must be tagged with the
originator-id and the message will not be propagated when received by
the originator.</p>
<p>Thus we have the conceptual basis for sending messages in a
controlled manner between 2 or more PC's. Between 2 PC's only one piece
of wire is needed.</p>
<p>Due to the requirement for two ports, this is going to mean that
unless you have a PS/2 type mouse, the use of the mouse is out. Thus
the game will be run on a keyboard only basis.</p>
<p>Throughout this diatribe, I will be frequently breaking off the main
flow to try and provide an understanding of a mechanism or method. The
more advanced programmers will be able to skip through these as they
are aimed at the relative newcomer.</p>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
