Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 60db9a630f5d8cf0d6f3d2c4bf2de92b > files > 11

spring-0.82.7.1-1.fc14.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>TA Spring - README</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
p {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10pt;
}
h1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14pt;
}
h2 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12pt;
}
td {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10pt;
}
hr {
	height: 1px;
	color: #000000;
}
-->
</style>
</head>

<body>
<table width="800" border="0" cellspacing="4" cellpadding="0">
  <tr>
    <td><h1>TA Spring development guidelines </h1>
      <p>This document describes important things to think about when developing code for Spring. </p>
      <h2>Spring runs synchronized on all computers</h2>
      <p>Spring's networking is built upon the assumption that all player's simulations are in sync and only send their (or their AI's) input over the network. This mean that you will have to be very careful to keep the simulation deterministic. Here is a few pointers to think about. </p>
      <ul>
        <li>There are essentially two sorts of code in spring, synced and unsynced. Which code is what is not as clear as one could wish but essentially the synced code is anything that is reached through CGame::Simframe or handlers of some network msgs, unsynced is everything else (graphic, input, sound etc). Synced code can write anything but should only read synced data. Unsynced code can read anything but must not write synced data. The rest of the points here is essentially about synced code.</li>
        <li>Always make sure to initialize variables. Even if the value doesnt seem to matter it might unsync the simulation.</li>
        <li>Be paranoid about array boundaries, reading one byte beyond an array might not crash but it will probably cause sync problems at some point.</li>
        <li>For random numbers use the CGlobalStuff::RandFloat etc functions (but never use these from unsynced code)</li>
        <li>Never compare memory block locations other than for equality. This mean for example that you shouldn't create a std::set or std::map with a pointer as index if the order might matter.</li>
      </ul>      
      <h2>Adding your own stuff</h2>
      <p>We welcome anyone to make changes to Spring but in order to get them accepted into our distribution the following can be worth thinking about.</p>
      <ul>
        <li>Spring is a game and different people might want different things from it. So if your changes change gameplay it might be a good idea to make it optional.</li>
        <li>Resources (esp. CPU time) is always in short supply for spring so make sure that you dont waste them needlessly and that your resource usage is in proportion to the impact of your changes.</li>
        <li>Ask around before starting on a change. Not only might you get tips about how to implement it in the best way but also if anyone else is working on something similar.</li>
      </ul>      
      <h1>Some example projects</h1>
      <p>Here is some stuff that we know needs improving in Spring. Of course there is about a million other things that also need improving. If you are interested in something and want to help out with the development, you can talk to the responsible person to get more information. </p>
      <h2>Game GUI (SJ)</h2>
      <p>The current GUI in Spring isnt that good however there exist a new gui that is almost finished. Unfortunally Pius that was working on it disapeared some months ago so we need someone else to finish it and generally improve the GUI.</p>
      <h2>Add console (Fnordia)</h2>
      <p>Add a game console to the game, preferably tied to some scripting language (below).</p>
      <h2>Create a map editor (SJ) </h2>
      <p>The current mapconv program is very limited and only allow compiling maps from already created data. Create a real mapeditor to allow editing of spring maps.</p>
      <h2>Improve explosion grapics (SJ) </h2>
      <p>The explosion interface has some support for adding different types of explosion graphics although there currently only exist one. Add some new types and bind certain explosions to them. This is for all you mushroom nukers out there.</p>
      <h2>Create an anticheat program (SJ)</h2>
      <p>Since Spring is opensource it will be very easy to create information cheats for it (the networking protocoll should prevent outright manipulation of data). Therefore create some sort of PunkBuster like program that only allow playing with known good exes. Either dont use any Spring code in it to go around the GPL or we will make an exception for it in order to allow it to be closed source. Sadly security through obscurity is the only thing that will work (and it only works to a degree) in this kind of situation (except calculating everything on the server and sending ready made screenshots to the clients), at least until Paladium arrives. </p>
      <p>&nbsp; </p></td>
  </tr>
</table>
</body>
</html>