<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://springrts-wiki.p2004a.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Visionm</id>
	<title>Spring - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://springrts-wiki.p2004a.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Visionm"/>
	<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/wiki/Special:Contributions/Visionm"/>
	<updated>2026-11-08T18:12:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Kernel_Panic&amp;diff=10067</id>
		<title>Kernel Panic</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Kernel_Panic&amp;diff=10067"/>
		<updated>2023-03-07T05:31:53Z</updated>

		<summary type="html">&lt;p&gt;Visionm: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;[http://timblokdijk.nl/spring/Kernel%20Panic/logo/kernel0_hd.png https://springrts.com/mediawiki/images/f/fc/Kernel_Panic_Alpha_Title_Half.png]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview:==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;For the latest news and/or assistance, try the [http://springrts.com/phpbb/viewforum.php?f=43&#039;&#039;&#039;KP forum&#039;&#039;&#039;] or go to #kp when you log onto the lobby.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Kernel Panic&#039;&#039;&#039; is a game about computers. Systems, Hackers and Networks wage war in a matrix of DOOM! The only constraints are time and space; unlike other real time strategy games, no resource economy exists in KP. &lt;br /&gt;
&lt;br /&gt;
All units are free in this game, every factory built will be spamming units at all times. You can build more factories, but only on pre-defined areas (geothermal vents). All that remains is pure strategy and tactics. &lt;br /&gt;
&lt;br /&gt;
KP makes for a frantically fast-paced, action-oriented game, with a very unique graphical style.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Download links:==&lt;br /&gt;
&lt;br /&gt;
Current Version of Kernel Panic is 4.9&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;u&amp;gt;Newcomers:&amp;lt;/u&amp;gt;&lt;br /&gt;
** If you run &#039;&#039;&#039;Windows&#039;&#039;&#039; (2000,XP,Vista,7,8,10):&lt;br /&gt;
*** Here you can get a complete installer:&lt;br /&gt;
**** https://web.archive.org/web/20230203212632/http://zwzsg.ddns.net/kp/installers/Kernel_Panic_4.9_Including_Spring_105.0_Installer39.exe&lt;br /&gt;
**** Mod DB mirror: https://www.moddb.com/games/kernel-panic/downloads/kernel-panic-49-installer-39&lt;br /&gt;
*** Use it to install both Spring and Kernel Panic in one go.&lt;br /&gt;
*** Then use the shortcuts created in your Start Menu or Desktop.&lt;br /&gt;
** If you run &#039;&#039;&#039;Linux&#039;&#039;&#039;:&lt;br /&gt;
*** Get a Linux static build of the Spring engine from https://springrts.com/wiki/Download&lt;br /&gt;
*** Get and unzip that file: https://web.archive.org/web/20230203213815/http://zwzsg.ddns.net/kp/zips/Kernel_Panic_4.9.zip&lt;br /&gt;
*** Unzip both in the same folder, so that Kernel_Panic_4.9_Launcher_Linux is next to spring executable&lt;br /&gt;
*** Run Kernel_Panic_4.9_Launcher_Linux&lt;br /&gt;
*** Alternatively, running spring directly would bring a greenish menu once ingame&lt;br /&gt;
*** For multiplayer or advanced options, run SpringLobby&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;u&amp;gt;Experienced Users:&amp;lt;/u&amp;gt;&lt;br /&gt;
** If you have already the Spring engine (or prefer to install it yourself): Here you can get a zip with the mod file, the maps, and a tiny executable for single player frontend. Unzip into your Spring root folder: https://web.archive.org/web/20230203213815/http://zwzsg.ddns.net/kp/zips/Kernel_Panic_4.9.zip&lt;br /&gt;
** If you are certain you have all the maps and just need a quick link to the mod file itself: https://web.archive.org/web/20230203214135/http://zwzsg.ddns.net/kp/mods/Kernel_Panic_4.9.sd7&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Media:==&lt;br /&gt;
&lt;br /&gt;
===Youtube Videos:===&lt;br /&gt;
&lt;br /&gt;
[http://youtube.com/watch?v=doF7owZ0blk&amp;amp;fmt=18 http://i.ytimg.com/vi/doF7owZ0blk/default.jpg] &lt;br /&gt;
[http://youtube.com/watch?v=Ug1c19yaZac http://i.ytimg.com/vi/Ug1c19yaZac/default.jpg] [http://youtube.com/watch?v=GAZQhRlt5bU http://i.ytimg.com/vi/GAZQhRlt5bU/default.jpg]&lt;br /&gt;
[http://www.youtube.com/watch?v=3q48ys5hFtI&amp;amp;fmt=18 http://i.ytimg.com/vi/3q48ys5hFtI/default.jpg]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Still shots:===&lt;br /&gt;
&lt;br /&gt;
[http://tof.canardpc.com/view/076c8061-5505-44a1-96f4-1bb68e6b7ae5.jpg http://tof.canardpc.com/preview/076c8061-5505-44a1-96f4-1bb68e6b7ae5.jpg] [http://tof.canardpc.com/view/4e607ea7-c428-4ca3-8b70-b12cbf44c18c.jpg http://tof.canardpc.com/preview/4e607ea7-c428-4ca3-8b70-b12cbf44c18c.jpg] [http://tof.canardpc.com/view/23b958ce-d5c9-4b66-b3f9-684db81f9683.jpg http://tof.canardpc.com/preview/23b958ce-d5c9-4b66-b3f9-684db81f9683.jpg]&lt;br /&gt;
&lt;br /&gt;
[http://tof.canardpc.com/view/44f4804f-ec99-40f9-a2e2-c3dc0b7617b8.jpg http://tof.canardpc.com/preview/44f4804f-ec99-40f9-a2e2-c3dc0b7617b8.jpg] [http://tof.canardpc.com/view/e5184baf-6c95-4c90-8469-b00a4f092054.jpg http://tof.canardpc.com/preview/e5184baf-6c95-4c90-8469-b00a4f092054.jpg] [http://tof.canardpc.com/view/cbe6dae0-a696-450a-bf22-236043d76511.jpg http://tof.canardpc.com/preview/cbe6dae0-a696-450a-bf22-236043d76511.jpg]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==License:==&lt;br /&gt;
Extracted from the &amp;lt;code&amp;gt;Kernel_Panic_readme.txt&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
========--------------------------------------------&lt;br /&gt;
License:&lt;br /&gt;
--------&lt;br /&gt;
- The content of the /mods/Kernel*.sd7 is Public Domain, save:&lt;br /&gt;
  /LuaUI/Widgets/kp_buildbar.lua&lt;br /&gt;
  /LuaRules/Gadgets/autohold.lua&lt;br /&gt;
  /LuaRules/Gadgets/Burrow.lua&lt;br /&gt;
  /LuaRules/Gadgets/game_spawn.lua&lt;br /&gt;
  which are GPL, taken from http://www.caspring.org or http://springrts.com&lt;br /&gt;
- The maps Marble Madness and Direct Memory Access are Public Domain&lt;br /&gt;
- The maps Major Madness and Speed Balls 16 Way status are unknown&lt;br /&gt;
- The maps Central Hub, Corrupted Core, Dual Core, Quad Core were CC BY-NC-SA and are now CC-BY-SA&lt;br /&gt;
   https://springrts.com/phpbb/viewtopic.php?f=43&amp;amp;t=21331&amp;amp;p=401680#p397471&lt;br /&gt;
   https://springrts.com/phpbb/viewtopic.php?f=43&amp;amp;t=27499&amp;amp;start=6&lt;br /&gt;
- The Spring engine is GPL, available from http://spring.clan-sy.com&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Game Modes:==&lt;br /&gt;
By default the aim is to destroy the homebase and all the minifacs of all opposing teams.&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Other &amp;quot;mod options&amp;quot; available are:&lt;br /&gt;
* &#039;&#039;&#039;King Of The Hill :&#039;&#039;&#039; Keeps control of the map center for a given time to win.&lt;br /&gt;
* &#039;&#039;&#039;O.N.S. :&#039;&#039;&#039; Adds shields to buildings, preventing homebase rush.&lt;br /&gt;
* &#039;&#039;&#039;Save Our Mem :&#039;&#039;&#039; Unit leave &amp;quot;leaks&amp;quot; that must be reclaimed.&lt;br /&gt;
* &#039;&#039;&#039;Color Wars :&#039;&#039;&#039; Whoever controls the most territory when timer elapse wins.&lt;br /&gt;
* &#039;&#039;&#039;Heroes of Mainframe :&#039;&#039;&#039; You only control a very buffed up but single unit. Best used with &amp;quot;Pre-placed Minifacs&amp;quot;.&lt;br /&gt;
* &#039;&#039;&#039;Rebalancing formula :&#039;&#039;&#039; Let you change the stat of any units of weapons without the hassle of making a mutator. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
For details, read [https://web.archive.org/web/20230203212631/http://zwzsg.ddns.net/kp/Kernel_Panic_readme.txt &amp;lt;code&amp;gt;Kernel_Panic_readme.txt&amp;lt;/code&amp;gt;] or click [?] next to each mod option in your lobby.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Units and Buildings:==&lt;br /&gt;
&lt;br /&gt;
===System units:===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/5/54/96x96Kernel.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;The Kernel:&#039;&#039;&#039; You start with one of these. It can build all mobile units in the game. Has rapid auto-heal and lots of health.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/b/b2/96x96Socket.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;The Socket:&#039;&#039;&#039; The socket is a factory which can only be built on a geothermal vent. It can solely build bits, and slower than the kernel can. It autoheals, and has a decent amount of health.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/8/8c/96x96Terminal.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;The Terminal:&#039;&#039;&#039; This is a new structure that gets placed on geovents. It can dispatch a nuclear bomber once every 90 seconds that will deal about 16000 damage to a large target area, i.e. it destroys everything except factories. It does much less damage to the kernel and hole. The bomber can strike any position on the map, there is no defense.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/1/1e/96x96Assembler.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;The Assembler:&#039;&#039;&#039; The assembler is a construction unit. It can build sockets, but it cannot assist-build. Slow, little health. Equipped with a radar to detect mines and other cloacked units.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/0/0a/96x96Bit.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;The Bit:&#039;&#039;&#039; Your basic attacking unit. Cheap, fast, small, not very much health. Is armed with a SPARCling laser. Can be built by a kernel or a socket.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/e/e3/96x96Byte.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;The Byte:&#039;&#039;&#039; A large, strong, and slow attacking unit. Can holds it&#039;s own against many bits, as it has lots of health and a powerful gun. More armored when closed. Can plow through bad blocks. The byte has an alternate firing mode, the mine launcher, which throws 5 mines at the cost of much health.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/5/51/96x96Pointer.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;The Pointer:&#039;&#039;&#039; An artillery unit. Its normal shot is not so useful against moving units, but can kill kernels and sockets pretty quickly. Is slow and has little health, so it needs protection. The pointer has an alternate firing mode, the NX Flag, which set a wide area ablaze for a minute, causing constant damage to all units, or buildings within it&#039;s range.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Hacker units:===&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/7/7f/96x96NewHoleLow.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Security Hole:&#039;&#039;&#039; The Hacker kernel equivalent.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/7/70/96x96Window.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Window:&#039;&#039;&#039; The Hacker socket equivalent.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/f/fb/96x96Obelisk.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Obelisk:&#039;&#039;&#039; This building is a stationary artillery weapon, it can fire an infection shot every 40 seconds (the obelisk has a pink fire on top when it&#039;s ready to shoot) that will cover a large area in poison. The poison does a bit of damage (about 1000) and turns any enemy that dies inside the cloud into a Virus. The weapon&#039;s range is fairly limited. Best used against stationnary herds of Bits/Bugs.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/c/c5/96x96NewTrojan.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Trojan:&#039;&#039;&#039; This unit is your constructor as well as radar platform (needed for detecting mines and cloaked units), just like the assembler. It builds all the same stuff as the assembler, except it has the window instead of the socket and the obelisk instead of the terminal.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/9/94/96x96Virus.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Virus:&#039;&#039;&#039; A crappy little swarm unit. It cannot be built but is produced when killing enemy units with certain weapons. Namely, the Virus, the Worm, and the Obelisk.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/f/ff/96x96NewBug.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Bug:&#039;&#039;&#039; The Hacker spam unit. The Bug is weaker than the Bit but can sense movement outside of its LOS. It has a stronger weapon and more range but cannot shoot at things behind it or through friendly units and won&#039;t take much damage before dying. The mine ability of the old bug has been removed. Instead it can now morph into the Exploit with the deploy button, or the bombard button.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/c/c4/96x96Exploit.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Exploit:&#039;&#039;&#039; This is the new name for the bug cannon. It&#039;s a building the Bug morphs into with the deploy or bombard command. The Exploit is a stationary artillery emplacement that does more damage the further the target is away. Even more frail than the Bug, so don&#039;t let any foe come near.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/4/40/96x96NewWorm.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Worm:&#039;&#039;&#039; The worm is a sneaky assassin, travelling cloacked, then surfacing only to kill many bits at once with its large area of effect weapon, which turn any slain units into virus. The worm large splash damage will damage your own units. However, it does practicaly no damage against other worms or virus. When cloacked, the worm does not automatically attack, you have to give attack orders manually. If you&#039;d rather have your worms auto-attack even when cloacked, set autohold to off. The autohold setting of new worms is inherited from the Security Hole.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/f/f4/96x96DoS.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Denial of Service:&#039;&#039;&#039; Not an artillery, but close: fire a beam that stun units. For bigger targets it&#039;ll take longer to stun them so perform a DDoS (use multiple) to stun them fast. Once the DoS stops firing the target will quickly unfreeze. It moves faster than the pointer but causes a particle trail that can be seen from far away.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Network units:===&lt;br /&gt;
The network faction is built around mobility, its small factories (Ports) don&#039;t produce units openly but instead increment a virtual counter (the Buffer). Packets in the Buffer can be materialized at any teleporter unit (currently that means the Port and the Connection), it&#039;s also possible to dematerialize the Packets back into the Buffer by making them enter a teleport.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/7/76/96x96Carrier.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Carrier:&#039;&#039;&#039; The base building, like a Kernel or Security Hole.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/4/46/96x96Port.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Port:&#039;&#039;&#039; The production building. It puts Packets into the Buffer, to materialize them select the Dispatch command. Dispatch will send 12 Packets if available, you can hold ALT when giving the order to make the Port dispatch until the Buffer is empty.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/8/83/96x96Firewall.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Firewall:&#039;&#039;&#039; This building can cover units (affects friendly units in a certain radius around the target location) in a protective shield for 20 seconds. The shield halves all damage the unit receives and throws the other half back at the attacker.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/6/6c/96x96Gateway.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Gateway:&#039;&#039;&#039; The constructor. It is lightly armed to help against enemy raids.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/8/8b/96x96Packet.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Packet:&#039;&#039;&#039; The basic light spam unit, it&#039;s weaker in combat than both competitors but much faster.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/2/26/96x96Connection.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Connection:&#039;&#039;&#039; Mostly a mobile teleporter (i.e. can dispatch Packets and let them enter like a Port). The Connection has decent armor and an arc beam that can do a lot of damage to single targets and has good range. It can defeat most large units one on one but engaging Bytes will probably result in pointer fire which the Connection cannot withstand and the arc beam is not optimal for engaging swarms.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/0/01/96x96Flow.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;Flow:&#039;&#039;&#039; An air unit. The Flow moves fairly slowly but can of course cross any terrain. It&#039;s equipped to attack light targets (spam units and fire support) but it&#039;s highly vulnerable to return fire. If you want to use them in open combat give them a meatshield and hope the enemy doesn&#039;t field long range units, Pointers, DoSes and Connections make short work of Flows if they hit.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===All side Units:===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/9/98/96x96BadBlock.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;The Bad Block:&#039;&#039;&#039; A tiny wall, built by Assembler/Trojan/Gateway. Blocks small units movement. Do not block shots however. Easily removed by the Debug or simply crushing them with a Byte or Connection.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/a/a4/96x96Mine.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;The Logic Bomb:&#039;&#039;&#039; A mine that can be built by the Assembler/Trojan/Gateway. And also launched by Bytes. It takes out Bits &amp;amp; Bugs in a single blow, has a decent damage radius, and doesn&#039;t chain explode. Use with care, as the blast hurts your own units too. Limited to 32.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;td&amp;gt;https://springrts.com/mediawiki/images/3/35/96x96MineBlaster.png&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&#039;&#039;&#039;The Debug:&#039;&#039;&#039; An easy way to clear an area of all mines and walls, this is a one shot weapon built by the Assembler/Trojan/Gateway.&amp;lt;/td&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Playing Guide for System:==&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
&lt;br /&gt;
Attention all editors: Try and improve this playing guide to make less assumptions about the setup, and allow for team maps, larger maps, and generally teach more general strategy &lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Playing Kernel Panic is fairly simple and quickly learned, but can be hard to master and can be very complex. It is recommended that beginners start with play the System faction, as they can be considered the least &amp;quot;gimmicky&amp;quot; of the factions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
Maybe it might be a good idea to move this to after the next two paragraphs.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
One rather effective general strategy for a duel on small maps is to send three to five bits to destroy your enemy&#039;s early game units, and, to a lesser degree, for scouting purposes. This is most effective if they started with construction units, as this will likely cripple their plans for an early expansion, and gives you a slight head start. After the initial attack, if your scouting shows that your enemy started with offensive units, build a byte for defense, and place it between your Kernel and the hill. After that, build an assembler and use it to build a socket on one the three closest building locations, which should automatically start producing bits. After this, you should order your assembler to build more sockets on free spots close to it. It is crucial that all sockets&#039; rally points are below them, as bits turning inside a socket will stall production until it is able to exit the factory. It is sometimes wise to repeat the prior process with one or two other assemblers. After this is done, construct about ten bits from your factor, and set your kernel to alternate between building bytes and pointers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
 A section on the uses of the faction&#039;s special units, and buildings (sigterm, pointer&#039;s fire, and byte&#039;s mine layer) could be useful, and these paragraphs might need modification.&lt;br /&gt;
&lt;br /&gt;
Making them flow better, and more coherent will help.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
What units you build at your kernel, and what you use them for, is an important factor in winning. As buildings can&#039;t be resumed, sending in groups of bits to kill construction units creating buildings can be very effective at stopping expansion attempts. Building too many pointers, will result in them being destroyed by connections, bits and especially worms, due to their stealth. Also, bytes are easily destroyer by and pointers, and exploits. A good general purpose ratio seems to be to queue one byte and one pointer, but this will need adapting as the game develops, and depending on the enemy&#039;s play style. &lt;br /&gt;
&lt;br /&gt;
Scouting is important too, as many enemies will leave their factories undefended, and knowing their build, and general unit use can help you in adapting the units you use to better fight them. Note that the Network can instantly spawn packets at any of their ports, or connections with their buffer system, meaning that all their factories should be considered defended. Single bits can be used to scout to find the enemy&#039;s current expansion attempts. &lt;br /&gt;
&lt;br /&gt;
When attacking a Byte or Connection with bits, it is important to overwhelm it with large numbers of bits. For bytes, try to exploit a byte&#039;s blind spot directly under it, by moving bits into that area. If your byte is under attack, moving it backwards to keep the attacking units in it&#039;s shooting arc can help repel the attack. It is not recommended to engage a worm with bits, as it&#039;s attack will convert your bits to viruses on the worm&#039;s owner&#039;s side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
Might reposition this section. Feel free to add map specific paragraphs for other maps as well. In fact, this will be very helpful to newcomers, I bet.&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
On Marble Madness, there are two main ways paths to victory. The simplest one is to control the hill and use pointers stationed on the hill to destroy the enemy&#039;s factories, and kernel. Gaining control of the hilltop will likely not be without resistance, because it requires a decent amount of time for units to reach the top of the hill, meaning most units involved will be spam units from your factories on it, and the fact that it will likely be highly contended. However, if you control it, you have a large advantage over the enemy as you can shell your opponents home base with ease. The other way is around the hill, which can be very effective if you control terrain you can use pointers to great effect. In both strategies, using pointers is the crucial factor. While they are hard to use correctly, they are game-winners as they destroy home bases and enemy units with ease.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Credits:==&lt;br /&gt;
- Original concept by Boirunner&amp;lt;br&amp;gt;&lt;br /&gt;
- About all the work done by KDR_11k&amp;lt;br&amp;gt;&lt;br /&gt;
- Sounds by Noruas&amp;lt;br&amp;gt;&lt;br /&gt;
- Maintenance by zwzsg&amp;lt;br&amp;gt;&lt;br /&gt;
- Maps by Boirunner, Runecrafter, zwzsg, and TradeMark&amp;lt;br&amp;gt;&lt;br /&gt;
- Some Lua interface upgrade based of jK and trepan code&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
Back to [[Games]]&lt;br /&gt;
[[Category:Games]]&lt;/div&gt;</summary>
		<author><name>Visionm</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=The_Complete_Guide_To_Making_A_Spring_Game&amp;diff=18239</id>
		<title>The Complete Guide To Making A Spring Game</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=The_Complete_Guide_To_Making_A_Spring_Game&amp;diff=18239"/>
		<updated>2022-11-19T06:13:00Z</updated>

		<summary type="html">&lt;p&gt;Visionm: update getting spring springfiles urls&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= The Complete Guide to Making a Spring Game =&lt;br /&gt;
&lt;br /&gt;
by PTSnoop. Everything you could want to know about making games for the Spring engine, all on one page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
TODO:&lt;br /&gt;
Make a separate download for all the resources, instead of forcing people to use the example mod.&lt;br /&gt;
Split it up into multiple pages.&lt;br /&gt;
Fix some of the wiki formatting.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Downloads ==&lt;br /&gt;
 &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;ATTENTION: Engine changes mean the games/examples &amp;lt;br/&amp;gt;below DO NOT WORK 100% CORRECT ANYMORE:&amp;lt;/span&amp;gt; &lt;br /&gt;
For exampe {{forumlink|topic=31015|title=no start units are spawned.}} Instead try [[SpringTutorialGame|SpringTutorialGame]]&lt;br /&gt;
----------&lt;br /&gt;
[https://springfiles.springrts.com/files/games/empty_mod.sdz Empty Game] - the basic folder structure, and the files you need to get one cube model in game.&lt;br /&gt;
&lt;br /&gt;
[https://springfiles.springrts.com/files/games/empty_mod_plus_tank.sdz Empty Game Plus Tank] - the basic folder structure, plus one working tank unit.&lt;br /&gt;
&lt;br /&gt;
[https://springfiles.springrts.com/files/games/example_mod.sdz Example Game] - a very simple example game. Contains a Factory, Tank, Builder, and Energy Tower.&lt;br /&gt;
&lt;br /&gt;
== Ideas ==&lt;br /&gt;
&lt;br /&gt;
Presumably you already have some of these. If not, just wait around on the forums until someone makes a &amp;quot;this would be a great game can someone make it plz&amp;quot; thread.&lt;br /&gt;
&lt;br /&gt;
It&#039;s probably worth sketching out some unit designs, concept art, game mechanics, and so forth, at this point, before you learn what can and can&#039;t be easily done with the engine. This way, you&#039;ll probably end up with a much more original game at the end of the process. Just bear in mind that you&#039;ll have to change around a lot of these ideas once you start finding out what works and what doesn&#039;t.&lt;br /&gt;
&lt;br /&gt;
== Getting Spring ==&lt;br /&gt;
&lt;br /&gt;
On Windows: Go to the [[Download]] page and download the installer. Install it.&lt;br /&gt;
&lt;br /&gt;
On Linux: Depends on your distro. There&#039;s a [https://launchpad.net/~spring/+archive/ppa ppa] for Ubuntu, and [[SetupGuide | various guides]] for various other distros.&lt;br /&gt;
&lt;br /&gt;
This&#039;ll give you the engine and lobby, but no games or maps. It&#039;s probably best if you download the [https://springfiles.springrts.com/files/games/example_mod.sdz basic example mod] and a [https://springfiles.springrts.com/files/maps/small_supreme_battlefield_v3.sd7 smallish map], and put them in your /games and /maps folder respectively (for Windows, those&#039;ll be in C:\Users\YOURUSERNAME\My Documents\My Games\Spring ; for Linux, ~/.spring . You may have to create some folders.) Then load up SpringLobby and start a game against a computer RAI to make sure it&#039;s working fine.&lt;br /&gt;
&lt;br /&gt;
== Tools Used in this Tutorial == &lt;br /&gt;
*Texture Editing&lt;br /&gt;
**[https://www.gimp.org/downloads/ Gimp]&lt;br /&gt;
*Modeling&lt;br /&gt;
**[http://www.wings3d.com/ Wings 3D]&lt;br /&gt;
*Coding&lt;br /&gt;
**[https://notepad-plus-plus.org/ Notepad++]&lt;br /&gt;
&lt;br /&gt;
== Making a 3D Model ==&lt;br /&gt;
&lt;br /&gt;
There are [http://www.wings3d.com/?page_id=676 far] [https://wiki.beyondunreal.com/Legacy:Wings3D/Getting_Started better] [https://tutorial-index.com/index.php/site/site_category/tut_wings_3d/ tutorials] for learning Wings3D than this one I&#039;m about to write. I suggest you go through a few of them rather than this one. Having said that, I&#039;m still going to rush through the basics here. Because otherwise, it wouldn&#039;t really be a &amp;quot;Complete Guide&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you want to skip this bit, I&#039;ve put the complete untextured model inside the [https://www.springfiles.com/show_file.php?id=2821 Example Mod]; just extract it as a zip file and look inside /objects3d.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve opened up Wings3D, it&#039;ll look something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings1.png]]&lt;br /&gt;
&lt;br /&gt;
Click your middle mouse button, and move your mouse around. The screen should rotate. Left click to escape rotation mode.&lt;br /&gt;
Roll the middle mouse button to zoom in and out.&lt;br /&gt;
While in rotation mode, drag your middle mouse button to pan around.&lt;br /&gt;
&lt;br /&gt;
Right click on the background; it&#039;ll give you a menu.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings2.png]]&lt;br /&gt;
&lt;br /&gt;
Click the square to the right of the word &amp;quot;Cube&amp;quot;. It&#039;ll give you some more options (namely, the dimensions of the cube). Choose 20x20x20, and click OK.&lt;br /&gt;
(If you&#039;d just clicked on the word &amp;quot;Cube&amp;quot; rather than the square, it&#039;d have just given you a 2x2x2 cube.)&lt;br /&gt;
&lt;br /&gt;
You should have a fairly large cube. (You may have to zoom out to see it properly.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings3.png]]&lt;br /&gt;
&lt;br /&gt;
At the top of the screen, you&#039;ll notice four buttons:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings4.png]]&lt;br /&gt;
&lt;br /&gt;
These are for selecting vertices, edges, faces, and bodies. Play around with each of them; you&#039;ll soon figure out how they work. You&#039;ll notice clicking on one thing doesn&#039;t deselect the last thing; to deselect, you&#039;ll have to click on the thing again, or press space to deselect everything.&lt;br /&gt;
&lt;br /&gt;
These four buttons also have keyboard shortcuts v, e, f, b. These are really useful, and worth getting used to.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice the cube is half-submerged in the ground. To move it above ground, select the whole cube body, and right-click.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see a new bunch of options. Click &amp;quot;Move&amp;quot;. You&#039;ll see some more options. Click &amp;quot;Y&amp;quot;.&lt;br /&gt;
( The Y axis points upwards; the X and Z point to the side and front of your unit, respectively. )&lt;br /&gt;
&lt;br /&gt;
The cube will start moving as you move your mouse left and right. The number in the top left hand corner tells you how much it&#039;s moving by. To place the cube in a new position, left-click; to snap it back to where it was originally, right-click instead.&lt;br /&gt;
&lt;br /&gt;
To move in fixed units, rather than just continuous up/down, hold down the shift key while moving. This is useful for positioning things carefully, and for knowing where things are later on. Ctrl and Ctrl+Shift move in tenths and hundreds of units. Try to put the cube such that it&#039;s 10 units above where it was before (the undo button may be useful here).&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings5.png]]&lt;br /&gt;
&lt;br /&gt;
Choose Face mode, and select the top face of the cube. Right click, and select &amp;quot;Scale Uniform&amp;quot;. Scale the face to 50% (Ctrl will help here) and click.&lt;br /&gt;
Now right click again, and move this face down 10 units in the same way you moved the whole box before.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings6.png]]&lt;br /&gt;
&lt;br /&gt;
Okay, now let&#039;s create another cube for the turret. There&#039;s no need for the options here, so just click on the word &amp;quot;Cube&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings6.png]]&lt;br /&gt;
&lt;br /&gt;
Oh noes! Where&#039;s the new cube gone?&lt;br /&gt;
&lt;br /&gt;
Okay, don&#039;t panic. Click on &amp;quot;Window&amp;quot; (on the File Edit View... row), and open up the Outliner. Then repeat for the Geometry Graph.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings7.png]]&lt;br /&gt;
&lt;br /&gt;
These are useful windows, since they show you everything in your model. Drag and resize these windows to somewhere sensible.&lt;br /&gt;
&lt;br /&gt;
From the geometry graph, you can select specific pieces of your model. Pick the top one by clicking on its grey cube.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings8.png]]&lt;br /&gt;
&lt;br /&gt;
Deselect this piece, then select the other one. Then right click anywhere and try to move it upwards.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings9.png]]&lt;br /&gt;
&lt;br /&gt;
It should appear out of the top of the other shape. Put it 12 units above where it was before, so it hovers above the other shape.&lt;br /&gt;
&lt;br /&gt;
Now select the face pointing in the Z direction, towards the front of the unit. The blue letter Z should show the right face.&lt;br /&gt;
Right-click and move this face a reasonably long way in the Z direction.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings10.png]]&lt;br /&gt;
&lt;br /&gt;
Now create a sphere, with radial x and y values of 10 and 10, and move it up to the top of the model.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings11.png]]&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s give this incredibly ugly tank some tracks. Pick the edge tool, and select two edges along one side. &lt;br /&gt;
&lt;br /&gt;
[[Image:Wings12.png]]&lt;br /&gt;
&lt;br /&gt;
Press C. A new edge should appear, connecting the previous two.&lt;br /&gt;
Now select the face that&#039;s now the lower half of that side (not both halves!), right-click, extrude, X. Extrude it out 2 units.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings13.png]]&lt;br /&gt;
&lt;br /&gt;
Do the same for the other side.&lt;br /&gt;
&lt;br /&gt;
Now extrude the fronts and backs of the tracks, forwards and backwards in the Z direction.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings14.png]]&lt;br /&gt;
&lt;br /&gt;
And there we have our first tank model!&lt;br /&gt;
&lt;br /&gt;
Now at this stage, before we texture anything, it would be a good idea to use the edge tool, to select all the edges of the cube blocks (you can do this from the geometry graph), and right-click set Hardness to Hard. This makes all those edges orange.&lt;br /&gt;
&lt;br /&gt;
But when you click on this button here:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings15.png]]&lt;br /&gt;
&lt;br /&gt;
Then it gives you a more rendered look, blurring soft edges together and keeping hard edges clean and distinct. It doesn&#039;t look that amazing at this stage (especially without textures) but once your properly-modelled original units are in game, the proper hard/soft edges make them look that bit better. (Actually, you could do this later on in the process if you want, at any point before exporting to 3ds later on. But this seemed like a good time to mention it.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings16.png]]&lt;br /&gt;
&lt;br /&gt;
So now we have a fairly basic clunky tank, ready for texturing. I think it&#039;s worth stressing at this point that it&#039;s worth going through lots more modelling tutorials and/or playing around with all the options to see what they do; also, when making models for real, it&#039;s worth bearing in mind that it&#039;s much better to make your own intriguing creative shapes than to just bolt cubes together. It takes longer, and isn&#039;t as good for easy tutorials, but it&#039;s worth it.&lt;br /&gt;
&lt;br /&gt;
== UVMapping and Texturing a 3D Model ==&lt;br /&gt;
&lt;br /&gt;
This section is based loosely on the tutorial  [https://springrts.com/phpbb/viewtopic.php?t=10612 here].&lt;br /&gt;
&lt;br /&gt;
Okay, so we have a clunky tank model, but it&#039;s all grey. It needs texture.&lt;br /&gt;
&lt;br /&gt;
To do this, we&#039;ll need to UVMap the model. What this means is to take the surface of the model and map it onto a 2d surface, so you can edit the 2d surface (in an image editor) and then it&#039;ll wrap around the model nicely. In theory.&lt;br /&gt;
&lt;br /&gt;
At the moment, the model is in three parts; the base, the sphere turret, and the barrel. If we dived straight in and started uvmapping now, we&#039;d end up with three texture files, which at the moment the engine can&#039;t cope with. We need to combine the parts into one body.&lt;br /&gt;
&lt;br /&gt;
Using the body tool (shortcut b), select all the pieces, right-click, select &amp;quot;Combine&amp;quot;. You should end up with one body.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_1.png]]&lt;br /&gt;
&lt;br /&gt;
With the body selected, right-click, then right-click on &amp;quot;UV Mapping&amp;quot;. A new window will appear; once you zoom out in the new window, it should look something like this.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_2.png]]&lt;br /&gt;
&lt;br /&gt;
To uvmap this model, you&#039;ll need to split it up into faces. There are three main ways you can do this.&lt;br /&gt;
&lt;br /&gt;
1) You can select edges, right click &amp;gt; &amp;quot;Mark edges for cut&amp;quot;. The computer will cut along these edges, and leave you with a pretty decent net. This gives you control over which faces end up next to each other, on what sides.&lt;br /&gt;
&lt;br /&gt;
2) You can select faces, right click, and mark them as different colours. The computer will take each side separately, keeping same-coloured faces together. This gives you control over which faces end up grouped together.&lt;br /&gt;
&lt;br /&gt;
3) You can right click &amp;gt; &amp;quot;Segment by&amp;quot; &amp;gt; &amp;quot;Projection&amp;quot;. The computer does all the work, and leaves you with a bunch of coloured faces. This is the cheating way, gives you not much control over what goes next to what, and gives you some pretty strange results sometimes. But it&#039;s soooooo much faster. This is what I normally use, occasionally with a bit of neatening-up of colours afterwards.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_3.png]]&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve got all your edges or faces marked, right click, and Continue, Unfolding. The computer will give you something like this.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_4.png]]&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s probably worth moving and resizing your windows (with the bottom right hand corner) so you can see both your model and your texture.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_5.png]]&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice the computer&#039;s given you a default letter-number texture. This is quite useful, since it shows you what kind of level of detail you can get with your model. Smaller letters means more detail.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice the uvmap has quite a lot of duplicated shapes. For example, there&#039;s one trapezoid for the left-hand-side tracks, and a different one for the right-hand-side tracks. We may as well just use the same texture for both, so let&#039;s move one onto the other.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do this is to select both trapezoids, right-click &amp;gt; Move To &amp;gt; Center, then right-click &amp;gt; Move and move them to where you want them.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_6.png]]&lt;br /&gt;
&lt;br /&gt;
Do this for all the duplicated shapes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_7.png]]&lt;br /&gt;
&lt;br /&gt;
You may have to rotate or flip some shapes to get them to line up. These tools are fairly self-explanatory.&lt;br /&gt;
&lt;br /&gt;
Now if you look at the barrel of the main gun, then you&#039;ll probably have some sides have letters running from the turret to the end, and some have the end to the turret (if that makes any sense.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_8.png]]&lt;br /&gt;
&lt;br /&gt;
The final model&#039;ll probably look better if we have them all running the same direction. In the 3d model window, select the faces running the wrong direction, then flip them in the 2d texture window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_9.png]]&lt;br /&gt;
&lt;br /&gt;
Now if you look at the texture window, you&#039;ll see a lot of wasted space. We can scale each shape to use some of that space, and allow for more detailed textures.&lt;br /&gt;
&lt;br /&gt;
(Beware: if you have multiple shapes overlapping, and you click on them, you&#039;ll just select the top one. To select multiple shapes in the same place, drag a box over some of the shape, and it&#039;ll pick all layers.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_10.png]]&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice I&#039;ve made the main body texture pieces much larger, since they&#039;re going to have the most important texture on them. You&#039;ll also notice I&#039;ve made the underside texture piece quite a lot smaller, since it&#039;s not really going to be seen by anyone unless they flip your tank over. Also, I&#039;ve left slight gaps between each piece; otherwise, texture from one might bleed into the other.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also notice there&#039;s still a lot of unused space; if I spent more time on this I could tighten it up a bit more. But I&#039;d much rather get on with writing this tutorial.&lt;br /&gt;
&lt;br /&gt;
Now the UVMapping is finished, you can create a texture for it. Right-click in the 2D window, click Create Texture.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_11.png]]&lt;br /&gt;
&lt;br /&gt;
First of all, click Delete Unused Pass. This should leave you with a background and a &amp;quot;draw edges&amp;quot;; have a look at the options for each. Check the colour of the background; make sure it&#039;s got A (alpha) set to 1.0 rather than 0.0 (some versions of Wings3D handle this differently).&lt;br /&gt;
&lt;br /&gt;
There are options for texture size. The general rule for texture size is that the more of this type of unit your players are going to be using, the smaller the texture. 256x256 is a good number for normal units; you might give your end-of-game epic unit of doom something closer to 1024x1024.&lt;br /&gt;
&lt;br /&gt;
Click OK, and you should get something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_12.png]]&lt;br /&gt;
&lt;br /&gt;
Now you can close down the 2d uv-editor window, and look at your Outliner. You should see your black-and-white square texture in there. Select it, right-click on it, click &amp;quot;Make External&amp;quot; and save it somewhere as a .tga file.&lt;br /&gt;
&lt;br /&gt;
Okay, now you can minimise Wings3D and open up the .tga file in an image editor. I&#039;ll be using GIMP here. Keep Wings3D open, though; we&#039;ll need it later on.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_13.png]]&lt;br /&gt;
&lt;br /&gt;
GIMP is easy enough to use, so I&#039;m not going to cover it in very much detail here. Start out with just bucket fill and pencil with different brush sizes, then have a look at the Pattern Fill tool option for bucket fill, and you should be able to get something like:&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_14.png]]&lt;br /&gt;
&lt;br /&gt;
...or hopefully much better and more interesting. I&#039;m rushing here, hence the flat-colour areas (generally a bad idea) and generic blobby camoflage.&lt;br /&gt;
&lt;br /&gt;
One thing that isn&#039;t very clear from the screenshots is that I&#039;ve gone around the edge of a few areas with more colour. If you just go with the black lines you&#039;ve been given, then white borders may start to bleed into your final textures. If you paint over the white around things, then this won&#039;t happen.&lt;br /&gt;
&lt;br /&gt;
Now we can move back into Wings3D, where I&#039;ve turned more-rendered-mode back on again.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_15.png]]&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice the old texture is still in place. To bring the new texture in, right-click on the white square texture, and Refresh.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_16.png]]&lt;br /&gt;
&lt;br /&gt;
And now everything looks so much more textured!&lt;br /&gt;
&lt;br /&gt;
(In practice, leaving this step until the end is a bad idea. It&#039;s best to flick between Wings3D and Gimp, trying things out.)&lt;br /&gt;
&lt;br /&gt;
Now the model&#039;s been textured, we&#039;ll need to separate out those pieces we combined together before. If everything&#039;s in one body, then the turret won&#039;t be able to move independently of the base, etc. Using the body tool, select the tank, then right click &amp;gt; Separate.&lt;br /&gt;
&lt;br /&gt;
Everything&#039;ll split back into constituent parts, with fairly generic names (cube2_sep7). You might want to rename these back to something sensible in the Geometry Graph at this point (right click &amp;gt; Rename). I&#039;ve gone for &amp;quot;body&amp;quot;, &amp;quot;turret&amp;quot; and &amp;quot;gun&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
And there we have the completed textured model. It&#039;s looking very blockish and plain, but hopefully you&#039;ll be able to do better once you start modelling properly.&lt;br /&gt;
&lt;br /&gt;
(This finished textured model can be found in the Example Mod.)&lt;br /&gt;
&lt;br /&gt;
Don&#039;t close GIMP just yet; we&#039;ll need it for the next part.&lt;br /&gt;
&lt;br /&gt;
== Preparing a Model for the Engine ==&lt;br /&gt;
&lt;br /&gt;
The original tutorial this part is based on can be found [https://springrts.com/phpbb/viewtopic.php?f=14&amp;amp;t=13034 here]. Thanks, Pressure Line!&lt;br /&gt;
&lt;br /&gt;
Okay, so we&#039;ve got our model in Wings3D, uvmapped and textured. But at the moment, all the texture is fixed; there isn&#039;t anywhere for team colours. For that, switch back to GIMP.&lt;br /&gt;
&lt;br /&gt;
In Spring, the main texture for each model uses the Alpha channel for teamcolour. Most programs use Alpha for transparency, so this may make your image previews slightly odd. But it&#039;ll all look fine once it&#039;s in game. In the alpha channel, white is teamcolour, black is no teamcolour, and greys in between are in between. If this doesn&#039;t make sense, just keep reading and hopefully it&#039;ll all be fine once we&#039;ve finished.&lt;br /&gt;
&lt;br /&gt;
(I say &amp;quot;main texture&amp;quot; because Spring also allows for secondary textures, which use red for glow, green for reflectivity, and alpha for transparency. I won&#039;t cover these here in any detail; play around with these if you want to learn more.)&lt;br /&gt;
&lt;br /&gt;
In GIMP, collapse everything into one layer if you&#039;ve got more than one. Right click on the layer, and click Add Alpha Channel if it&#039;s available. (If it&#039;s not, you&#039;ve probably already got an alpha channel.)&lt;br /&gt;
&lt;br /&gt;
Click Colors &amp;gt; Components &amp;gt; Decompose. This&#039;ll give you a box; set it to RGBA and press OK.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_2.png]]&lt;br /&gt;
&lt;br /&gt;
This should give you a second GIMP window, with greyscale and four layers. These are your Red, Green, Blue and Alpha channels. You&#039;ll notice the Alpha channel is completely white; we don&#039;t want this, because it&#039;ll make your whole unit teamcoloured instead of the grey-and-camoflage that we want for most of it.&lt;br /&gt;
&lt;br /&gt;
Copy one of the other layers into the Alpha layer, so you can see where things are. Then make everything black, except for the texture for the turret at the top; make that white.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_3.png]]&lt;br /&gt;
&lt;br /&gt;
Then select Colors &amp;gt; Components &amp;gt; Recompose, and swap back to your first image. You&#039;ll see that most of it&#039;s vanished, except for the part you want in teamcolour. Don&#039;t panic; it&#039;s still there, it&#039;s just transparent. Save this as TGA.&lt;br /&gt;
&lt;br /&gt;
(Alternatively, at this point, you could save it as DDS (you&#039;ll want DXT3 or DXT5, and lots and lots of mipmaps). I personally use TGA, because I&#039;ve never got round to getting the GIMP DDS plugin working on my machine. If you use DDS, you&#039;ll get better performance.)&lt;br /&gt;
&lt;br /&gt;
You can close GIMP down at this point, unless you&#039;re going to be still tweaking things.&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll need to get the model out of Wings3D and into [[Upspring]]. Swap back to Wings3D, click File &amp;gt; Export, and click on the box next to 3D Studio (3ds). This&#039;ll give you some options.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_4.png]]&lt;br /&gt;
&lt;br /&gt;
You want &amp;quot;Swap X and Y axes&amp;quot; off, Export normals and UV coords both on, and default texture file type set to Targa (tga). Click OK, and save it somewhere you&#039;ll remember.&lt;br /&gt;
&lt;br /&gt;
(At this point, if you wanted to, you could use OBJ instead of 3DS; there&#039;s no real difference for [[Upspring]] as far as I can tell.)&lt;br /&gt;
&lt;br /&gt;
Now open up [[Upspring]]. You should see something like this.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_5.png]]&lt;br /&gt;
&lt;br /&gt;
Click File &amp;gt; Open, browse to your folder,  tell it to look for 3ds files, open the file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_6.png]]&lt;br /&gt;
&lt;br /&gt;
It&#039;ll ask you what you want to do with the multiple meshes. Tell it 2) Load all objects as childs (children?) of an empty root object.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_7.png]]&lt;br /&gt;
&lt;br /&gt;
There&#039;s your model, looking small and untextured. On the right, choose the Objects tab.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_8.png]]&lt;br /&gt;
&lt;br /&gt;
You&#039;ve got a hierarchy of model pieces. These determine what moves when what piece moves. We want the gun to move when the turret moves, and we want both of those to move when the whole body moves, so use the cut and paste buttons above to arrange things more like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_9.png]]&lt;br /&gt;
&lt;br /&gt;
I&#039;ve also renamed the root piece to &amp;quot;base&amp;quot;, because it looks better.&lt;br /&gt;
&lt;br /&gt;
Next, we need to move the origin for each piece, to define the points that things rotate around. Zoom in so you can see things properly (by dragging with the right mouse button), then select the &amp;quot;only move origin&amp;quot; option, and select the turret in the hierarchy.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_10.png]]&lt;br /&gt;
&lt;br /&gt;
The X pos, Y pos and Z pos options specify the position of the origin. By default everything&#039;s at (0,0,0). Now at this point, you could move into Wings3D, look at the actual height, and put it in the box. Or you can do what I do, and type guesses into the Y pos box until I get the red dot in what looks like the right place. (0,12,0) looks fine.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_11.png]]&lt;br /&gt;
&lt;br /&gt;
Now, interestingly, the gun origin will automatically have moved to (0,-12,0) to stay at the same place. This is because, when we set the origin of the turret, all pieces below the turret in the hierarchy will now measure their positions relative to that piece. Set the turret value to (0,0,0) so the origin&#039;s in the same place as the turret.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll need another piece later on, to mark the end of the barrel of the gun, so bullets know where to fire from. To do this, select the gun, click &amp;quot;Add empty&amp;quot;, call it &amp;quot;flare&amp;quot;.Position it just in front of the end of the barrel. (0,0,15) looks good to me.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_12.png]]&lt;br /&gt;
&lt;br /&gt;
Now move onto the Model tab. This gives you options for model centre and radius (this defines the hitsphere), and model height (this defines where the health bar goes). Again, you can measure these carefully in Wings3D, or just guess. There are Estimate buttons, but they often need a bit of adjusting afterwards.&lt;br /&gt;
&lt;br /&gt;
To see what your numbers are doing, click on the &amp;quot;3D&amp;quot; to the top left hand corner of the 3D view, and tell it &amp;quot;Draw model radius and height&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_13.png]]&lt;br /&gt;
&lt;br /&gt;
Now all the unit needs is the texture. Click over to the Mapping tab, click Browse for Texture 1, and load your texture from before.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_14.png]]&lt;br /&gt;
&lt;br /&gt;
And there we have the texture, with a teamcolour turret. If you&#039;ve got a second texture for reflectivity and so on, you can put that as Texture 2.&lt;br /&gt;
&lt;br /&gt;
Now if you&#039;re using TGA textures rather than DDS, you&#039;ll need one extra step. Click Texture Mapping &amp;gt; Show UV Mapping. It&#039;ll show your texture; click Edit &amp;gt; Flip UVs. Close the UV editor.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_15.png]]&lt;br /&gt;
&lt;br /&gt;
Now your texture looks strange and mangled. In fact, this is what your unit would have looked like if you&#039;d put it in game without flipping UVs like that. Once it&#039;s in game, it&#039;ll be fine. This strange texture-flipping is a consequence of the way DDS files measure coordinates, I think. If you&#039;re using DDS, you won&#039;t need to do this step. &lt;br /&gt;
&lt;br /&gt;
One last thing: click on Object &amp;gt; Recalculate vertex normals, 3d0 style &amp;gt; All objects, then OK. This&#039;ll sort out some normals or something, I&#039;m not too sure what it does but it makes your textures look better.&lt;br /&gt;
&lt;br /&gt;
Now all you need to do is save the model as an s3o file.&lt;br /&gt;
&lt;br /&gt;
And there we have our finished model and texture! Now to get them in game.&lt;br /&gt;
&lt;br /&gt;
== Putting the Unit in a Game ==&lt;br /&gt;
&lt;br /&gt;
The Spring engine uses .sdz or .sd7 files to load game content. In practice, these are just .zip and .7z files with renamed suffixes; to open up any mod, just rename it and extract it. Also, the Spring engine lets you just put all your game files in a folder in your /games directory, as long as it ends in .sdd .&lt;br /&gt;
&lt;br /&gt;
The best place to get started here is to download the [https://springfiles.com/spring/games/empty-mod Empty Mod], extract it to a folder called EmptyMod.sdd in your /games directory. This is basically the bare minimum to get a unit in game.&lt;br /&gt;
&lt;br /&gt;
Open up SpringLobby; if you&#039;ve put it in the right place and everything else&#039;s correct, you should see an entry for &amp;quot;Empty Mod&amp;quot; in your games list. (You might need to tell it to Tools &amp;gt; Reload Maps/Games first.) If you try playing it, it&#039;ll put a blank immobile cube at your start point.&lt;br /&gt;
&lt;br /&gt;
To get the tank unit in game, you&#039;ll need as bare minimum an s3o file in /objects3d, a texture file in /unittextures, and a unitdef in /units. You already have two out of three; put them in the right folders.&lt;br /&gt;
&lt;br /&gt;
Next, you&#039;ll need to make a unitdef. There are two ways of doing this: the old TA-ish way or the new lua way. You can write an FBI file, which is a text file with a list of variables, or you can write a lua file, which is a text file with a list of variables with slightly different syntax. In general, older tutorials and a fair bit of documentation will talk about FBI, but I&#039;m going to use lua instead because it&#039;s more flexible and (I vaguely remember) slightly faster. Here&#039;s an example lua unitdef:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local unitName  =  &amp;quot;tank&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local unitDef  =  {&lt;br /&gt;
--Internal settings&lt;br /&gt;
    BuildPic = &amp;quot;filename.bmp&amp;quot;,&lt;br /&gt;
    Category = &amp;quot;TANK SMALL NOTAIR NOTSUB&amp;quot;,&lt;br /&gt;
    ObjectName = &amp;quot;tank3.s3o&amp;quot;,&lt;br /&gt;
    name = &amp;quot;Generic Tank&amp;quot;,&lt;br /&gt;
    Side = &amp;quot;TANKS&amp;quot;,&lt;br /&gt;
    TEDClass = &amp;quot;TANK&amp;quot;,&lt;br /&gt;
    UnitName = &amp;quot;tank&amp;quot;,&lt;br /&gt;
    script = &amp;quot;tankscript.lua&amp;quot;,&lt;br /&gt;
    &lt;br /&gt;
--Unit limitations and properties&lt;br /&gt;
    BuildTime = 1000,&lt;br /&gt;
    Description = &amp;quot;A generic tank unit.&amp;quot;,&lt;br /&gt;
    MaxDamage = 800,&lt;br /&gt;
    RadarDistance = 0,&lt;br /&gt;
    SightDistance = 400,&lt;br /&gt;
    SoundCategory = &amp;quot;TANK&amp;quot;,&lt;br /&gt;
    Upright = 0,&lt;br /&gt;
    &lt;br /&gt;
--Energy and metal related&lt;br /&gt;
    BuildCostEnergy = 100,&lt;br /&gt;
    BuildCostMetal = 0,&lt;br /&gt;
    &lt;br /&gt;
--Pathfinding and related&lt;br /&gt;
    Acceleration = 0.15,&lt;br /&gt;
    BrakeRate = 0.1,&lt;br /&gt;
    FootprintX = 2,&lt;br /&gt;
    FootprintZ = 2,&lt;br /&gt;
    MaxSlope = 15,&lt;br /&gt;
    MaxVelocity = 2.0,&lt;br /&gt;
    MaxWaterDepth = 20,&lt;br /&gt;
    MovementClass = &amp;quot;Default2x2&amp;quot;,&lt;br /&gt;
    TurnRate = 900,&lt;br /&gt;
    &lt;br /&gt;
--Abilities&lt;br /&gt;
    Builder = 0,&lt;br /&gt;
    CanAttack = 1,&lt;br /&gt;
    CanGuard = 1,&lt;br /&gt;
    CanMove = 1,&lt;br /&gt;
    CanPatrol = 1,&lt;br /&gt;
    CanStop = 1,&lt;br /&gt;
    LeaveTracks = 0,&lt;br /&gt;
    Reclaimable = 0,&lt;br /&gt;
    &lt;br /&gt;
--Hitbox&lt;br /&gt;
--    collisionVolumeOffsets    =  &amp;quot;0 0 0&amp;quot;,&lt;br /&gt;
--    collisionVolumeScales     =  &amp;quot;20 20 20&amp;quot;,&lt;br /&gt;
--    collisionVolumeTest       =  1,&lt;br /&gt;
--    collisionVolumeType       =  &amp;quot;box&amp;quot;,&lt;br /&gt;
    &lt;br /&gt;
--Weapons and related&lt;br /&gt;
    BadTargetCategory = &amp;quot;NOTAIR&amp;quot;,&lt;br /&gt;
    ExplodeAs = &amp;quot;TANKDEATH&amp;quot;,&lt;br /&gt;
    NoChaseCategory = &amp;quot;AIR&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return lowerkeys({ [unitName]  =  unitDef })&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth looking through this and understanding what each entry does. Most are fairly self-explanatory; for the ones that aren&#039;t, there&#039;s [[Gamedev:UnitDefs | this page]].&lt;br /&gt;
&lt;br /&gt;
Put this file in your /units folder, then open up /gamedata/sidedata.lua and change &#039;startunit = &amp;quot;cube&amp;quot;&#039; to &#039;startunit = &amp;quot;tank&amp;quot;. Then start up the mod in Spring.&lt;br /&gt;
&lt;br /&gt;
[[Image:Mod_2.png]]&lt;br /&gt;
&lt;br /&gt;
We should now have a model in game! You should be able to select it, and right-click it around the place. It can&#039;t attack anything yet, but one step at a time.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to make this tank shoot small orange blobs. For this we need three things: a small orange blob image for it to fire, a weapon entry in the unitdef, and a unit animation script.&lt;br /&gt;
&lt;br /&gt;
For the small orange blob image, I&#039;m going to use flame.tga from Evolution RTS (it&#039;s a good game, with models and textures under CC-BY-NC-ND and almost everything else under a do-whatever-you-want license; well worth checking out).  It&#039;s in the /bitmaps folder of the example mod; put it in your own /bitmaps folder. Next, we need to open up /gamedata/resources.lua and tell the engine we&#039;ve got a flame texture; just put a line &amp;quot;flame = &#039;flame.tga&#039; &amp;quot; in the projectiletextures brackets (or comment out the one I&#039;ve already left in there).&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the lua unitdef from before, with the new weapon data in place:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local unitName  =  &amp;quot;tank&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local unitDef  =  {&lt;br /&gt;
--Internal settings&lt;br /&gt;
    BuildPic = &amp;quot;filename.bmp&amp;quot;,&lt;br /&gt;
    Category = &amp;quot;TANK SMALL NOTAIR NOTSUB&amp;quot;,&lt;br /&gt;
    ObjectName = &amp;quot;tank3.s3o&amp;quot;,&lt;br /&gt;
    name = &amp;quot;Generic Tank&amp;quot;,&lt;br /&gt;
    Side = &amp;quot;TANKS&amp;quot;,&lt;br /&gt;
    TEDClass = &amp;quot;TANK&amp;quot;,&lt;br /&gt;
    UnitName = &amp;quot;tank&amp;quot;,&lt;br /&gt;
    script = &amp;quot;tankscript.lua&amp;quot;,&lt;br /&gt;
    &lt;br /&gt;
--Unit limitations and properties&lt;br /&gt;
    BuildTime = 1000,&lt;br /&gt;
    Description = &amp;quot;A generic tank unit.&amp;quot;,&lt;br /&gt;
    MaxDamage = 800,&lt;br /&gt;
    RadarDistance = 0,&lt;br /&gt;
    SightDistance = 400,&lt;br /&gt;
    SoundCategory = &amp;quot;TANK&amp;quot;,&lt;br /&gt;
    Upright = 0,&lt;br /&gt;
    &lt;br /&gt;
--Energy and metal related&lt;br /&gt;
    BuildCostEnergy = 100,&lt;br /&gt;
    BuildCostMetal = 0,&lt;br /&gt;
    &lt;br /&gt;
--Pathfinding and related&lt;br /&gt;
    Acceleration = 0.15,&lt;br /&gt;
    BrakeRate = 0.1,&lt;br /&gt;
    FootprintX = 2,&lt;br /&gt;
    FootprintZ = 2,&lt;br /&gt;
    MaxSlope = 15,&lt;br /&gt;
    MaxVelocity = 2.0,&lt;br /&gt;
    MaxWaterDepth = 20,&lt;br /&gt;
    MovementClass = &amp;quot;Default2x2&amp;quot;,&lt;br /&gt;
    TurnRate = 900,&lt;br /&gt;
    &lt;br /&gt;
--Abilities&lt;br /&gt;
    Builder = 0,&lt;br /&gt;
    CanAttack = 1,&lt;br /&gt;
    CanGuard = 1,&lt;br /&gt;
    CanMove = 1,&lt;br /&gt;
    CanPatrol = 1,&lt;br /&gt;
    CanStop = 1,&lt;br /&gt;
    LeaveTracks = 0,&lt;br /&gt;
    Reclaimable = 0,&lt;br /&gt;
    &lt;br /&gt;
--Hitbox&lt;br /&gt;
--    collisionVolumeOffsets    =  &amp;quot;0 0 0&amp;quot;,&lt;br /&gt;
--    collisionVolumeScales     =  &amp;quot;20 20 20&amp;quot;,&lt;br /&gt;
--    collisionVolumeTest       =  1,&lt;br /&gt;
--    collisionVolumeType       =  &amp;quot;box&amp;quot;,&lt;br /&gt;
    &lt;br /&gt;
--Weapons and related&lt;br /&gt;
    BadTargetCategory = &amp;quot;NOTAIR&amp;quot;,&lt;br /&gt;
    ExplodeAs = &amp;quot;TANKDEATH&amp;quot;,&lt;br /&gt;
    NoChaseCategory = &amp;quot;AIR&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
    weapons = {&lt;br /&gt;
        [1] = {&lt;br /&gt;
            def = &amp;quot;orangeblob&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local weaponDefs = {&lt;br /&gt;
    orangeblob = {&lt;br /&gt;
    name = &amp;quot;Orange Plasma Cannon&amp;quot;,&lt;br /&gt;
    weapontype = &amp;quot;Cannon&amp;quot;,&lt;br /&gt;
    accuracy = 10,&lt;br /&gt;
    areaofeffect = 100,&lt;br /&gt;
    avoidfeature = false,&lt;br /&gt;
    avoidfriendly = true,&lt;br /&gt;
    canattackground = true,&lt;br /&gt;
    collidefriendly = true,&lt;br /&gt;
    collisionsize = 8,&lt;br /&gt;
    commandfire = false,&lt;br /&gt;
    craterboost = 0,&lt;br /&gt;
    cratermult = 0,&lt;br /&gt;
    edgeeffectiveness = 0.1,&lt;br /&gt;
    explosionspeed = 128,&lt;br /&gt;
    impulseboost = 0,&lt;br /&gt;
    impulsefactor = 0,&lt;br /&gt;
    intensity = 1,&lt;br /&gt;
    noselfdamage = true,&lt;br /&gt;
    size = 4,&lt;br /&gt;
--        soundstart = &amp;quot;tank_fire&amp;quot;,&lt;br /&gt;
--        soundhit = &amp;quot;explo01&amp;quot;,&lt;br /&gt;
    range = 250,&lt;br /&gt;
    reloadtime = 1.5,&lt;br /&gt;
    rgbcolor = &amp;quot;1.0 1.0 1.0&amp;quot;,&lt;br /&gt;
    turret = true,&lt;br /&gt;
    texture1 = &amp;quot;flame&amp;quot;,&lt;br /&gt;
    weaponvelocity = 400,&lt;br /&gt;
--		explosiongenerator = &amp;quot;custom:TANKGUN_FX&amp;quot;,&lt;br /&gt;
    damage =&lt;br /&gt;
    {&lt;br /&gt;
        default = 55,&lt;br /&gt;
    },&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    unitDef.weaponDefs = weaponDefs&lt;br /&gt;
    return lowerkeys({ [unitName]  =  unitDef })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the animation script. This tells the unit what things to move when firing, moving, exploding etc. All we really want at this point is for the turret to rotate and pitch to the right angle. &lt;br /&gt;
&lt;br /&gt;
Again there are two ways of doing this: the old TA-style method, and the new lua method. You&#039;ve got the choice of writing the animation script in BOS, then compiling it into COB using Scriptor; this is the best-documented method, but it needs the compiler, and it isn&#039;t as flexible. The other method is to write the animation script in lua; this lets you reload scripts mid-game without needing to recompile anything, and allows for the whole lua api in your animation scripts (more on lua later). The only real reason for using COB at the moment is &amp;quot;I already have a working game with vast hordes of COB animations, and it would take a long time to change them all&amp;quot;. If you&#039;re starting out a new game, then lua is really the best option.&lt;br /&gt;
&lt;br /&gt;
here&#039;s an example animation script to go in /scripts/tankscript.lua :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local base = piece &amp;quot;base&amp;quot;&lt;br /&gt;
local body = piece &amp;quot;body&amp;quot;&lt;br /&gt;
local turret = piece &amp;quot;turret&amp;quot;&lt;br /&gt;
local gun = piece &amp;quot;gun&amp;quot;&lt;br /&gt;
local flare = piece &amp;quot;flare&amp;quot;&lt;br /&gt;
-- declares all the pieces we&#039;ll use in the script.&lt;br /&gt;
&lt;br /&gt;
local SIG_AIM = 2&lt;br /&gt;
&lt;br /&gt;
local RESTORE_DELAY = Spring.UnitScript.GetLongestReloadTime(unitID) * 2&lt;br /&gt;
-- picks a sensible time to wait before trying to turn the turret back to default.&lt;br /&gt;
&lt;br /&gt;
function script.Create()&lt;br /&gt;
    return 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function RestoreAfterDelay(unitID)&lt;br /&gt;
    -- defines a local funtion to wait a bit, then move the turret back to how it was originally.&lt;br /&gt;
	Sleep(RESTORE_DELAY)&lt;br /&gt;
	Turn(turret, y_axis, 0, math.rad(35))&lt;br /&gt;
	Turn(gun, x_axis, 0, math.rad(30))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.AimWeapon(weaponID, heading, pitch)&lt;br /&gt;
	Signal(SIG_AIM)&lt;br /&gt;
	SetSignalMask(SIG_AIM)&lt;br /&gt;
    -- each time the Signal is called, all other functions with the same SignalMask will stop running. This makes sure the tank isn&#039;t trying to fire at something, and restore the turret position, at the same time.&lt;br /&gt;
	Turn(turret, y_axis, heading, math.rad(35))&lt;br /&gt;
	Turn(gun, x_axis, -pitch, math.rad(30))&lt;br /&gt;
	WaitForTurn(turret, y_axis)&lt;br /&gt;
	WaitForTurn(gun, x_axis)&lt;br /&gt;
	StartThread(RestoreAfterDelay)&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.FireWeapon(weaponID)&lt;br /&gt;
	EmitSfx(flare, 0)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.QueryWeapon() return flare end&lt;br /&gt;
-- The piece that the bullet/laser/whatever comes out of.&lt;br /&gt;
&lt;br /&gt;
function script.AimFromWeapon() return gun end&lt;br /&gt;
-- The unit looks from this piece down the QueryWeapon piece, to see whether it&#039;s aiming at anything.&lt;br /&gt;
&lt;br /&gt;
function script.Killed(recentDamage, maxHealth)&lt;br /&gt;
	return 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.HitByWeapon(x,z,weaponDef,damage)&lt;br /&gt;
    -- This stops the unit taking damage until it&#039;s been built.&lt;br /&gt;
	if GetUnitValue(COB.BUILD_PERCENT_LEFT)&amp;gt;2 then return 0&lt;br /&gt;
	else return damage&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now all these files are in the right folders, start the game. You should now have a small tank, able to drive around and shoot at things!&lt;br /&gt;
&lt;br /&gt;
You&#039;ll probably have noticed two things. Firstly, the explosion from being hit by an orange blob isn&#039;t very dramatic. Secondly, there&#039;s no sound. Let&#039;s fix the sound first.&lt;br /&gt;
&lt;br /&gt;
First of all, you&#039;ll need an explosion sound. I&#039;m using Explosion3 from https://www.partnersinrhyme.com/soundfx/PDsoundfx/gunsbombs.shtml, chopped around a bit in Audacity: again, you can get it from the Example Mod.  Put it in /sounds .&lt;br /&gt;
&lt;br /&gt;
Next, we&#039;ll need to tell the engine about the sound file. Open up /gamedata/sounds.lua , and add in a new entry, so it looks something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local Sounds = {&lt;br /&gt;
	SoundItems = {&lt;br /&gt;
		--- RESERVED FOR SPRING, DON&#039;T REMOVE&lt;br /&gt;
		IncomingChat = {&lt;br /&gt;
			file = &amp;quot;sounds/incoming_chat.wav&amp;quot;,&lt;br /&gt;
			 rolloff = 0.1, &lt;br /&gt;
			maxdist = 10000,&lt;br /&gt;
			priority = 100, --- higher numbers = less chance of cutoff&lt;br /&gt;
			maxconcurrent = 1, ---how many maximum can we hear?&lt;br /&gt;
		},&lt;br /&gt;
		MultiSelect = {&lt;br /&gt;
			file = &amp;quot;sounds/multiselect.wav&amp;quot;,&lt;br /&gt;
			 rolloff = 0.1, &lt;br /&gt;
			maxdist = 10000,&lt;br /&gt;
			priority = 100, --- higher numbers = less chance of cutoff&lt;br /&gt;
			maxconcurrent = 1, ---how many maximum can we hear?&lt;br /&gt;
		},&lt;br /&gt;
		MapPoint = {&lt;br /&gt;
			file = &amp;quot;sounds/mappoint.wav&amp;quot;,&lt;br /&gt;
			rolloff = 0.1,&lt;br /&gt;
			maxdist = 10000,&lt;br /&gt;
			priority = 100, --- higher numbers = less chance of cutoff&lt;br /&gt;
			maxconcurrent = 1, ---how many maximum can we hear?&lt;br /&gt;
		},&lt;br /&gt;
		--- END RESERVED&lt;br /&gt;
&lt;br /&gt;
--WEAPONS&lt;br /&gt;
&lt;br /&gt;
		orangeblob_explo = { &lt;br /&gt;
            file = &amp;quot;sounds/Explosi3.wav&amp;quot;, &lt;br /&gt;
			rolloff=3, dopplerscale = 0, maxdist = 6000,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
			priority = 10, --- higher numbers = less chance of cutoff&lt;br /&gt;
			maxconcurrent = 4, ---how many maximum can we hear?&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		--[[DefaultsForSounds = { -- this are default settings&lt;br /&gt;
			file = &amp;quot;ThisEntryMustBePresent.wav&amp;quot;,&lt;br /&gt;
			gain = 1.0,&lt;br /&gt;
			pitch = 1.0,&lt;br /&gt;
			priority = 0,&lt;br /&gt;
			maxconcurrent = 16, --- some reasonable limits&lt;br /&gt;
			--maxdist = FLT_MAX, --- no cutoff at all&lt;br /&gt;
		},&lt;br /&gt;
		--- EXAMPLE ONLY!&lt;br /&gt;
		MyAwesomeSound = {			&lt;br /&gt;
			file = &amp;quot;sounds/booooom.wav&amp;quot;,&lt;br /&gt;
			preload, -- put in memory!&lt;br /&gt;
			loop,  -- loop me!&lt;br /&gt;
			looptime=1000, --- milliseconds!&lt;br /&gt;
			gain = 2.0, --- for uber-loudness&lt;br /&gt;
			pitch = 0.2, --- bass-test&lt;br /&gt;
			priority = 15, --- very high&lt;br /&gt;
			maxconcurrent = 1, ---only once&lt;br /&gt;
			--maxdist = 500, --- only when near&lt;br /&gt;
		},]]&lt;br /&gt;
	},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return Sounds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to tell the unitdef what sound to use. Open it up, and in the weapondef, add the line&lt;br /&gt;
&lt;br /&gt;
    soundhit = &amp;quot;orangeblob_explo&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
Now, if you try the game in Spring, you should get an explosion sound every time an orange blob hits something. To add a sound on firing, do the same, but add&lt;br /&gt;
&lt;br /&gt;
    soundstart = &amp;quot;whatevername&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
to the weapondef instead. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Note: If SpringRTS displays errors when loading the sound, try using OGG format instead. See this [https://springrts.com/phpbb/viewtopic.php?f=52&amp;amp;t=36920 thread for more error details].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now for the explosion. For particle effects like this, there are two ways (the old TA-style way and the new lua way, again). You can write a CEG tdf file defining what sprites and particles go where and do what, or you can use LUPS (Lua Particle System). Now, this time I&#039;m going to recommend the old TA-style way, because it&#039;s well documented and I know how to use it (whereas I don&#039;t have a clue how to use LUPS, or where to find out how to use it), but more importantly because it doesn&#039;t work on some ATI graphics cards. LUPS is much more flexible, but for now it&#039;s best only used for aeroplane trails and other effects that people won&#039;t complain about if they&#039;re missing.&lt;br /&gt;
&lt;br /&gt;
To use CEG, first you&#039;ll need to put a tdf file like this one in the /gamedata/explosions folder:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[TANKGUN_FX]&lt;br /&gt;
{&lt;br /&gt;
[groundflash]&lt;br /&gt;
   {&lt;br /&gt;
      flashSize = 45;&lt;br /&gt;
      flashAlpha = 0.9;&lt;br /&gt;
      circleGrowth = 3;&lt;br /&gt;
      circleAlpha = 0.3;&lt;br /&gt;
      ttl = 30;&lt;br /&gt;
      color = 1, 0.5, 0;&lt;br /&gt;
air=1;&lt;br /&gt;
     ground=1;&lt;br /&gt;
      water=1;&lt;br /&gt;
}&lt;br /&gt;
[heatcloud_MED_EXPLOSION_FX01]&lt;br /&gt;
   {&lt;br /&gt;
class=heatcloud;&lt;br /&gt;
      [properties]&lt;br /&gt;
      {&lt;br /&gt;
texture=explodeheat;&lt;br /&gt;
      heat = 30;&lt;br /&gt;
      maxheat = 30;&lt;br /&gt;
      heatFalloff = 1;&lt;br /&gt;
      size = 30;&lt;br /&gt;
      sizeGrowth = -0.3;&lt;br /&gt;
      sizemod = 0;&lt;br /&gt;
      sizemodmod = 0;&lt;br /&gt;
      speed = 0, 1.5, 0;&lt;br /&gt;
      pos = 0, 5, 0;&lt;br /&gt;
      }&lt;br /&gt;
air=1;&lt;br /&gt;
      water=1;&lt;br /&gt;
      ground=1;&lt;br /&gt;
      count=1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[MOREDOTS]&lt;br /&gt;
  {&lt;br /&gt;
class=CSimpleParticleSystem;&lt;br /&gt;
&lt;br /&gt;
   [properties]&lt;br /&gt;
   {     &lt;br /&gt;
   alwaysVisible=1;&lt;br /&gt;
   Texture=randdots;&lt;br /&gt;
&lt;br /&gt;
   colorMap = 1.0 1.0 1.0 0.05   0.2 0.9 0.5 0.01  0.1 0.8 0.1 0.00;&lt;br /&gt;
&lt;br /&gt;
   pos      = 0, 2, 0;&lt;br /&gt;
   gravity     = 0, -0.1, 0;&lt;br /&gt;
   emitVector  = 0, 1, 0;&lt;br /&gt;
   emitRot     = 45;&lt;br /&gt;
   emitRotSpread  = 32;&lt;br /&gt;
&lt;br /&gt;
   sizeGrowth  = 0.5;&lt;br /&gt;
   sizeMod     = 1;&lt;br /&gt;
&lt;br /&gt;
   airdrag        = 0.8;&lt;br /&gt;
   particleLife      = 5;&lt;br /&gt;
   particleLifeSpread   = 7;&lt;br /&gt;
   numParticles      = 16;&lt;br /&gt;
   particleSpeed     = 8;&lt;br /&gt;
   particleSpeedSpread  = 3;&lt;br /&gt;
   particleSize      = 20;&lt;br /&gt;
   particleSizeSpread   = 0;&lt;br /&gt;
&lt;br /&gt;
   directional    = 1;&lt;br /&gt;
   useAirLos      = 0;&lt;br /&gt;
   }&lt;br /&gt;
air=1;&lt;br /&gt;
ground=1;&lt;br /&gt;
count=1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need some more explosion images (also shamelessly stolen from EvoRTS), again available in the Example Mod.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll need to put these in /bitmaps, then name them in /gamedata/resources.lua . Also in the weapondef, you&#039;ll need to put&lt;br /&gt;
&lt;br /&gt;
    explosiongenerator = &amp;quot;custom:TANKGUN_FX&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
And now, in game, you should have a working moving tank that shoots things! Congratulations!&lt;br /&gt;
&lt;br /&gt;
== Other Small Things ==&lt;br /&gt;
&lt;br /&gt;
In SpringLobby, you&#039;ll notice a &amp;quot;Side: 1&amp;quot; option whenever you mouse over one of the players. It&#039;s easy enough to change the &amp;quot;1&amp;quot; to something a bit more descriptive of your side, by putting a 16x16 bmp in /sidepics . If your faction is called &amp;quot;TANK&amp;quot; in sidedata.lua, then call it /sidepics/tank.bmp .&lt;br /&gt;
&lt;br /&gt;
Once you have construction units, it&#039;ll help if players have pictures of whatever it is they&#039;re building. Put these in /unitpics, and put lines in the unitdefs like&lt;br /&gt;
    BuildPic = &amp;quot;filename.bmp&amp;quot;,   &lt;br /&gt;
&lt;br /&gt;
== Structure of a Game ==&lt;br /&gt;
&lt;br /&gt;
Before moving on to factories, builders, and other types of unit, I think it&#039;s worth going through the structure of what folder means what in a mod file.&lt;br /&gt;
&lt;br /&gt;
* /bitmaps - This contains the .tga files for explosions, lasers, and so on. Each image here needs to be named in /gamedata/resources.lua before it can be used.&lt;br /&gt;
** /bitmaps/loadpictures - Any jpg files in here will be shown while the game is loading.&lt;br /&gt;
&lt;br /&gt;
* /gamedata - Lua files defining game information.&lt;br /&gt;
** gamedata/armordefs.lua - defines different armour groupings. More information: [[Armordefs.lua]].&lt;br /&gt;
** /gamedata/explosions - TDF files for CEG explosions.&lt;br /&gt;
** /gamedata/messages.lua - messages given whenever a team loses the game. More information:  [[Messages.lua]]&lt;br /&gt;
** /gamedata/modrules.lua - various parameters for your game, like flanking bonuses, rate at which experience is gained, etc. Have a look at existing games to see what they do. More information: [[Modrules.lua]]&lt;br /&gt;
** /gamedata/movedefs.lua - defines different types of movement (hovercraft, tank, ship etc). More information: [[Movedefs.lua]].&lt;br /&gt;
** /gamedata/resources.lua - all the bitmaps in /bitmaps, with names and what they do (are they for projectiles, groundflares, etc)&lt;br /&gt;
** /gamedata/sidedata.lua - defines the different factions, and what unit they start off with. In theory, you could do all this with a lua gadget (more on this later), but sidedata.lua works pretty well anyway.&lt;br /&gt;
** /gamedata/sounds.lua - defines all the sound files, with values for volume, priority, doppler effect, etc.&lt;br /&gt;
&lt;br /&gt;
* /LuaRules - contains gadgets. These are scripting files that change gameplay; more info later.&lt;br /&gt;
** /LuaRules/Gadgets/spawnPlayer.lua - creates a starting unit at the beginning of the game, depending on /gamedata/sidedata.lua . In theory, you could adapt this to generate random units, create whole bases at the start of games, etc.&lt;br /&gt;
** /LuaRules/Gadgets/unit_script.lua - this is needed for lua animation scripts to work, for some reason.&lt;br /&gt;
* /LuaUI - contains widgets. These are scripting files that change the user interface; more info later.&lt;br /&gt;
&lt;br /&gt;
* /music - contains music for the music widget.&lt;br /&gt;
* /sounds - contains sound.&lt;br /&gt;
&lt;br /&gt;
* /objects3d - contains all the s3o models.&lt;br /&gt;
* /scripts - contains all the unit animation scripts.&lt;br /&gt;
* /units - contains unit definitions.&lt;br /&gt;
* /unittextures - contains textures for the s3o models.&lt;br /&gt;
&lt;br /&gt;
* /unitpics - pictures for each unit, shown on build mens.&lt;br /&gt;
* /sidepics - pictures for each faction, shown in lobby.&lt;br /&gt;
&lt;br /&gt;
* /[[modinfo.lua]] - defines the mod name, description, and if it requires any pre-existing content.&lt;br /&gt;
* /EngineOptions.txt - exactly what it says on the tin. Look at different games to see what they do.&lt;br /&gt;
&lt;br /&gt;
== Other Types of Unit ==&lt;br /&gt;
&lt;br /&gt;
At the moment, you&#039;ve got a tank unit. This is useful, but for your game, you&#039;ll probably need some factories, builders, buildings, and so on (depending on how unconventional your game is). I think the best way to show how to make these units is by example, so here&#039;s a basic mod with about one of each:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Load up a game against RAI (that AI works for pretty much any mod, as long as your lua isn&#039;t too strange). Then extract it open (it&#039;s really just a .zip file), look through the code and see what the scripts and unitdefs are like.&lt;br /&gt;
&lt;br /&gt;
== Lua Gadgets and Widgets ==&lt;br /&gt;
&lt;br /&gt;
Now this is where things start getting really interesting. Gadgets are small lua script files that let you add things to the basic Spring gameplay. And by &amp;quot;things&amp;quot;, I mean &amp;quot;anything&amp;quot;. Want units that morph into other units? Lua. Want tech trees and unit prerequisites? Lua. Want units that fire other units? Lua. Want meteor strikes and random dinosaurs to spawn out of the map and attack players? Lua. Want napalm? Lua. Want time travel? Well, [https://achrongame.com/ maybe a separate engine designed for RTS time travel would help you better here], but presumably it can be done with enough Lua.&lt;br /&gt;
&lt;br /&gt;
And because it&#039;s so versatile, for now I&#039;m just going to point you to [[Lua Scripting | the lists of callouts and callins]] and stand back. Maybe I&#039;ll come back to this bit and write a basic gadget tutorial at a later date, but for now the forums are your friend.&lt;br /&gt;
&lt;br /&gt;
It&#039;s not very big yet, though, so for more examples just look at the [https://github.com/Balanced-Annihilation/Balanced-Annihilation/tree/master/luarules/gadgets Balanced Annihilation gadget source code].&lt;br /&gt;
&lt;br /&gt;
Widgets are like Gadgets, but instead of changing gameplay they change the user interface. So if you want to add a bunch more buttons along the right hand side, or glowing outlines around certain types of unit, you&#039;d probably use a widget. You can also add widgets to your local copy of Spring that aren&#039;t in the mod file itself; this can be useful to give yourself debug information that other players won&#039;t have, but bear in mind that it&#039;s pretty likely other players will also be using their own array of widgets to enhance their gaming abilities when playing against you.&lt;br /&gt;
&lt;br /&gt;
Have a look at the [https://github.com/Balanced-Annihilation/Balanced-Annihilation/tree/master/luaui/Widgets_BA Balanced Annihilation widget source code] for some examples.&lt;br /&gt;
&lt;br /&gt;
== Maps and Missions ==&lt;br /&gt;
&lt;br /&gt;
Okay, so you&#039;ve got a working multiplayer game. Now how about single player?&lt;br /&gt;
&lt;br /&gt;
There aren&#039;t really any Spring games at the moment with a single player campaign. All the tools are in place, but no-one&#039;s actually used them yet. Now, I&#039;m willing to bet that if you manage to give your game a decent SP campaign, and the multiplayer and graphics aren&#039;t too bad, it could quickly be adopted as the Spring engine&#039;s flagship game. No, I&#039;m serious here.&lt;br /&gt;
&lt;br /&gt;
To make some maps, see [https://springrts.com/wiki/Mapdev:Main Map Development]&lt;br /&gt;
&lt;br /&gt;
For single player missions, there&#039;s a [https://springrts.com/phpbb/viewtopic.php?f=14&amp;amp;t=24278 Mission Editor] &amp;lt;s&amp;gt;with a [https://code.google.com/p/zero-k/wiki/MissionEditorTutorial good tutorial] of its own, so I don&#039;t need to write one&amp;lt;/s&amp;gt;. Enjoy!&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Dev]]&lt;/div&gt;</summary>
		<author><name>Visionm</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=The_Complete_Guide_To_Making_A_Spring_Game&amp;diff=18238</id>
		<title>The Complete Guide To Making A Spring Game</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=The_Complete_Guide_To_Making_A_Spring_Game&amp;diff=18238"/>
		<updated>2022-11-19T04:44:13Z</updated>

		<summary type="html">&lt;p&gt;Visionm: update useful downloads urls&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= The Complete Guide to Making a Spring Game =&lt;br /&gt;
&lt;br /&gt;
by PTSnoop. Everything you could want to know about making games for the Spring engine, all on one page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
TODO:&lt;br /&gt;
Make a separate download for all the resources, instead of forcing people to use the example mod.&lt;br /&gt;
Split it up into multiple pages.&lt;br /&gt;
Fix some of the wiki formatting.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Downloads ==&lt;br /&gt;
 &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;ATTENTION: Engine changes mean the games/examples &amp;lt;br/&amp;gt;below DO NOT WORK 100% CORRECT ANYMORE:&amp;lt;/span&amp;gt; &lt;br /&gt;
For exampe {{forumlink|topic=31015|title=no start units are spawned.}} Instead try [[SpringTutorialGame|SpringTutorialGame]]&lt;br /&gt;
----------&lt;br /&gt;
[https://springfiles.springrts.com/files/games/empty_mod.sdz Empty Game] - the basic folder structure, and the files you need to get one cube model in game.&lt;br /&gt;
&lt;br /&gt;
[https://springfiles.springrts.com/files/games/empty_mod_plus_tank.sdz Empty Game Plus Tank] - the basic folder structure, plus one working tank unit.&lt;br /&gt;
&lt;br /&gt;
[https://springfiles.springrts.com/files/games/example_mod.sdz Example Game] - a very simple example game. Contains a Factory, Tank, Builder, and Energy Tower.&lt;br /&gt;
&lt;br /&gt;
== Ideas ==&lt;br /&gt;
&lt;br /&gt;
Presumably you already have some of these. If not, just wait around on the forums until someone makes a &amp;quot;this would be a great game can someone make it plz&amp;quot; thread.&lt;br /&gt;
&lt;br /&gt;
It&#039;s probably worth sketching out some unit designs, concept art, game mechanics, and so forth, at this point, before you learn what can and can&#039;t be easily done with the engine. This way, you&#039;ll probably end up with a much more original game at the end of the process. Just bear in mind that you&#039;ll have to change around a lot of these ideas once you start finding out what works and what doesn&#039;t.&lt;br /&gt;
&lt;br /&gt;
== Getting Spring ==&lt;br /&gt;
&lt;br /&gt;
On Windows: Go to the [[Download]] page and download the installer. Install it.&lt;br /&gt;
&lt;br /&gt;
On Linux: Depends on your distro. There&#039;s a [https://launchpad.net/~spring/+archive/ppa ppa] for Ubuntu, and [[SetupGuide | various guides]] for various other distros.&lt;br /&gt;
&lt;br /&gt;
This&#039;ll give you the engine and lobby, but no games or maps. It&#039;s probably best if you download the [https://springfiles.com/spring/games/example-mod basic example mod] and a [https://springfiles.com/spring/spring-maps/smallsupremebattlefieldv2 smallish map], and put them in your /games and /maps folder respectively (for Windows, those&#039;ll be in C:\Users\YOURUSERNAME\My Documents\My Games\Spring ; for Linux, ~/.spring . You may have to create some folders.) Then load up SpringLobby and start a game against a computer RAI to make sure it&#039;s working fine.&lt;br /&gt;
&lt;br /&gt;
== Tools Used in this Tutorial == &lt;br /&gt;
*Texture Editing&lt;br /&gt;
**[https://www.gimp.org/downloads/ Gimp]&lt;br /&gt;
*Modeling&lt;br /&gt;
**[http://www.wings3d.com/ Wings 3D]&lt;br /&gt;
*Coding&lt;br /&gt;
**[https://notepad-plus-plus.org/ Notepad++]&lt;br /&gt;
&lt;br /&gt;
== Making a 3D Model ==&lt;br /&gt;
&lt;br /&gt;
There are [http://www.wings3d.com/?page_id=676 far] [https://wiki.beyondunreal.com/Legacy:Wings3D/Getting_Started better] [https://tutorial-index.com/index.php/site/site_category/tut_wings_3d/ tutorials] for learning Wings3D than this one I&#039;m about to write. I suggest you go through a few of them rather than this one. Having said that, I&#039;m still going to rush through the basics here. Because otherwise, it wouldn&#039;t really be a &amp;quot;Complete Guide&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you want to skip this bit, I&#039;ve put the complete untextured model inside the [https://www.springfiles.com/show_file.php?id=2821 Example Mod]; just extract it as a zip file and look inside /objects3d.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve opened up Wings3D, it&#039;ll look something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings1.png]]&lt;br /&gt;
&lt;br /&gt;
Click your middle mouse button, and move your mouse around. The screen should rotate. Left click to escape rotation mode.&lt;br /&gt;
Roll the middle mouse button to zoom in and out.&lt;br /&gt;
While in rotation mode, drag your middle mouse button to pan around.&lt;br /&gt;
&lt;br /&gt;
Right click on the background; it&#039;ll give you a menu.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings2.png]]&lt;br /&gt;
&lt;br /&gt;
Click the square to the right of the word &amp;quot;Cube&amp;quot;. It&#039;ll give you some more options (namely, the dimensions of the cube). Choose 20x20x20, and click OK.&lt;br /&gt;
(If you&#039;d just clicked on the word &amp;quot;Cube&amp;quot; rather than the square, it&#039;d have just given you a 2x2x2 cube.)&lt;br /&gt;
&lt;br /&gt;
You should have a fairly large cube. (You may have to zoom out to see it properly.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings3.png]]&lt;br /&gt;
&lt;br /&gt;
At the top of the screen, you&#039;ll notice four buttons:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings4.png]]&lt;br /&gt;
&lt;br /&gt;
These are for selecting vertices, edges, faces, and bodies. Play around with each of them; you&#039;ll soon figure out how they work. You&#039;ll notice clicking on one thing doesn&#039;t deselect the last thing; to deselect, you&#039;ll have to click on the thing again, or press space to deselect everything.&lt;br /&gt;
&lt;br /&gt;
These four buttons also have keyboard shortcuts v, e, f, b. These are really useful, and worth getting used to.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice the cube is half-submerged in the ground. To move it above ground, select the whole cube body, and right-click.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see a new bunch of options. Click &amp;quot;Move&amp;quot;. You&#039;ll see some more options. Click &amp;quot;Y&amp;quot;.&lt;br /&gt;
( The Y axis points upwards; the X and Z point to the side and front of your unit, respectively. )&lt;br /&gt;
&lt;br /&gt;
The cube will start moving as you move your mouse left and right. The number in the top left hand corner tells you how much it&#039;s moving by. To place the cube in a new position, left-click; to snap it back to where it was originally, right-click instead.&lt;br /&gt;
&lt;br /&gt;
To move in fixed units, rather than just continuous up/down, hold down the shift key while moving. This is useful for positioning things carefully, and for knowing where things are later on. Ctrl and Ctrl+Shift move in tenths and hundreds of units. Try to put the cube such that it&#039;s 10 units above where it was before (the undo button may be useful here).&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings5.png]]&lt;br /&gt;
&lt;br /&gt;
Choose Face mode, and select the top face of the cube. Right click, and select &amp;quot;Scale Uniform&amp;quot;. Scale the face to 50% (Ctrl will help here) and click.&lt;br /&gt;
Now right click again, and move this face down 10 units in the same way you moved the whole box before.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings6.png]]&lt;br /&gt;
&lt;br /&gt;
Okay, now let&#039;s create another cube for the turret. There&#039;s no need for the options here, so just click on the word &amp;quot;Cube&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings6.png]]&lt;br /&gt;
&lt;br /&gt;
Oh noes! Where&#039;s the new cube gone?&lt;br /&gt;
&lt;br /&gt;
Okay, don&#039;t panic. Click on &amp;quot;Window&amp;quot; (on the File Edit View... row), and open up the Outliner. Then repeat for the Geometry Graph.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings7.png]]&lt;br /&gt;
&lt;br /&gt;
These are useful windows, since they show you everything in your model. Drag and resize these windows to somewhere sensible.&lt;br /&gt;
&lt;br /&gt;
From the geometry graph, you can select specific pieces of your model. Pick the top one by clicking on its grey cube.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings8.png]]&lt;br /&gt;
&lt;br /&gt;
Deselect this piece, then select the other one. Then right click anywhere and try to move it upwards.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings9.png]]&lt;br /&gt;
&lt;br /&gt;
It should appear out of the top of the other shape. Put it 12 units above where it was before, so it hovers above the other shape.&lt;br /&gt;
&lt;br /&gt;
Now select the face pointing in the Z direction, towards the front of the unit. The blue letter Z should show the right face.&lt;br /&gt;
Right-click and move this face a reasonably long way in the Z direction.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings10.png]]&lt;br /&gt;
&lt;br /&gt;
Now create a sphere, with radial x and y values of 10 and 10, and move it up to the top of the model.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings11.png]]&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s give this incredibly ugly tank some tracks. Pick the edge tool, and select two edges along one side. &lt;br /&gt;
&lt;br /&gt;
[[Image:Wings12.png]]&lt;br /&gt;
&lt;br /&gt;
Press C. A new edge should appear, connecting the previous two.&lt;br /&gt;
Now select the face that&#039;s now the lower half of that side (not both halves!), right-click, extrude, X. Extrude it out 2 units.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings13.png]]&lt;br /&gt;
&lt;br /&gt;
Do the same for the other side.&lt;br /&gt;
&lt;br /&gt;
Now extrude the fronts and backs of the tracks, forwards and backwards in the Z direction.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings14.png]]&lt;br /&gt;
&lt;br /&gt;
And there we have our first tank model!&lt;br /&gt;
&lt;br /&gt;
Now at this stage, before we texture anything, it would be a good idea to use the edge tool, to select all the edges of the cube blocks (you can do this from the geometry graph), and right-click set Hardness to Hard. This makes all those edges orange.&lt;br /&gt;
&lt;br /&gt;
But when you click on this button here:&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings15.png]]&lt;br /&gt;
&lt;br /&gt;
Then it gives you a more rendered look, blurring soft edges together and keeping hard edges clean and distinct. It doesn&#039;t look that amazing at this stage (especially without textures) but once your properly-modelled original units are in game, the proper hard/soft edges make them look that bit better. (Actually, you could do this later on in the process if you want, at any point before exporting to 3ds later on. But this seemed like a good time to mention it.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Wings16.png]]&lt;br /&gt;
&lt;br /&gt;
So now we have a fairly basic clunky tank, ready for texturing. I think it&#039;s worth stressing at this point that it&#039;s worth going through lots more modelling tutorials and/or playing around with all the options to see what they do; also, when making models for real, it&#039;s worth bearing in mind that it&#039;s much better to make your own intriguing creative shapes than to just bolt cubes together. It takes longer, and isn&#039;t as good for easy tutorials, but it&#039;s worth it.&lt;br /&gt;
&lt;br /&gt;
== UVMapping and Texturing a 3D Model ==&lt;br /&gt;
&lt;br /&gt;
This section is based loosely on the tutorial  [https://springrts.com/phpbb/viewtopic.php?t=10612 here].&lt;br /&gt;
&lt;br /&gt;
Okay, so we have a clunky tank model, but it&#039;s all grey. It needs texture.&lt;br /&gt;
&lt;br /&gt;
To do this, we&#039;ll need to UVMap the model. What this means is to take the surface of the model and map it onto a 2d surface, so you can edit the 2d surface (in an image editor) and then it&#039;ll wrap around the model nicely. In theory.&lt;br /&gt;
&lt;br /&gt;
At the moment, the model is in three parts; the base, the sphere turret, and the barrel. If we dived straight in and started uvmapping now, we&#039;d end up with three texture files, which at the moment the engine can&#039;t cope with. We need to combine the parts into one body.&lt;br /&gt;
&lt;br /&gt;
Using the body tool (shortcut b), select all the pieces, right-click, select &amp;quot;Combine&amp;quot;. You should end up with one body.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_1.png]]&lt;br /&gt;
&lt;br /&gt;
With the body selected, right-click, then right-click on &amp;quot;UV Mapping&amp;quot;. A new window will appear; once you zoom out in the new window, it should look something like this.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_2.png]]&lt;br /&gt;
&lt;br /&gt;
To uvmap this model, you&#039;ll need to split it up into faces. There are three main ways you can do this.&lt;br /&gt;
&lt;br /&gt;
1) You can select edges, right click &amp;gt; &amp;quot;Mark edges for cut&amp;quot;. The computer will cut along these edges, and leave you with a pretty decent net. This gives you control over which faces end up next to each other, on what sides.&lt;br /&gt;
&lt;br /&gt;
2) You can select faces, right click, and mark them as different colours. The computer will take each side separately, keeping same-coloured faces together. This gives you control over which faces end up grouped together.&lt;br /&gt;
&lt;br /&gt;
3) You can right click &amp;gt; &amp;quot;Segment by&amp;quot; &amp;gt; &amp;quot;Projection&amp;quot;. The computer does all the work, and leaves you with a bunch of coloured faces. This is the cheating way, gives you not much control over what goes next to what, and gives you some pretty strange results sometimes. But it&#039;s soooooo much faster. This is what I normally use, occasionally with a bit of neatening-up of colours afterwards.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_3.png]]&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve got all your edges or faces marked, right click, and Continue, Unfolding. The computer will give you something like this.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_4.png]]&lt;br /&gt;
&lt;br /&gt;
At this point, it&#039;s probably worth moving and resizing your windows (with the bottom right hand corner) so you can see both your model and your texture.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_5.png]]&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice the computer&#039;s given you a default letter-number texture. This is quite useful, since it shows you what kind of level of detail you can get with your model. Smaller letters means more detail.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice the uvmap has quite a lot of duplicated shapes. For example, there&#039;s one trapezoid for the left-hand-side tracks, and a different one for the right-hand-side tracks. We may as well just use the same texture for both, so let&#039;s move one onto the other.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do this is to select both trapezoids, right-click &amp;gt; Move To &amp;gt; Center, then right-click &amp;gt; Move and move them to where you want them.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_6.png]]&lt;br /&gt;
&lt;br /&gt;
Do this for all the duplicated shapes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_7.png]]&lt;br /&gt;
&lt;br /&gt;
You may have to rotate or flip some shapes to get them to line up. These tools are fairly self-explanatory.&lt;br /&gt;
&lt;br /&gt;
Now if you look at the barrel of the main gun, then you&#039;ll probably have some sides have letters running from the turret to the end, and some have the end to the turret (if that makes any sense.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_8.png]]&lt;br /&gt;
&lt;br /&gt;
The final model&#039;ll probably look better if we have them all running the same direction. In the 3d model window, select the faces running the wrong direction, then flip them in the 2d texture window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_9.png]]&lt;br /&gt;
&lt;br /&gt;
Now if you look at the texture window, you&#039;ll see a lot of wasted space. We can scale each shape to use some of that space, and allow for more detailed textures.&lt;br /&gt;
&lt;br /&gt;
(Beware: if you have multiple shapes overlapping, and you click on them, you&#039;ll just select the top one. To select multiple shapes in the same place, drag a box over some of the shape, and it&#039;ll pick all layers.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_10.png]]&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice I&#039;ve made the main body texture pieces much larger, since they&#039;re going to have the most important texture on them. You&#039;ll also notice I&#039;ve made the underside texture piece quite a lot smaller, since it&#039;s not really going to be seen by anyone unless they flip your tank over. Also, I&#039;ve left slight gaps between each piece; otherwise, texture from one might bleed into the other.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also notice there&#039;s still a lot of unused space; if I spent more time on this I could tighten it up a bit more. But I&#039;d much rather get on with writing this tutorial.&lt;br /&gt;
&lt;br /&gt;
Now the UVMapping is finished, you can create a texture for it. Right-click in the 2D window, click Create Texture.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_11.png]]&lt;br /&gt;
&lt;br /&gt;
First of all, click Delete Unused Pass. This should leave you with a background and a &amp;quot;draw edges&amp;quot;; have a look at the options for each. Check the colour of the background; make sure it&#039;s got A (alpha) set to 1.0 rather than 0.0 (some versions of Wings3D handle this differently).&lt;br /&gt;
&lt;br /&gt;
There are options for texture size. The general rule for texture size is that the more of this type of unit your players are going to be using, the smaller the texture. 256x256 is a good number for normal units; you might give your end-of-game epic unit of doom something closer to 1024x1024.&lt;br /&gt;
&lt;br /&gt;
Click OK, and you should get something like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_12.png]]&lt;br /&gt;
&lt;br /&gt;
Now you can close down the 2d uv-editor window, and look at your Outliner. You should see your black-and-white square texture in there. Select it, right-click on it, click &amp;quot;Make External&amp;quot; and save it somewhere as a .tga file.&lt;br /&gt;
&lt;br /&gt;
Okay, now you can minimise Wings3D and open up the .tga file in an image editor. I&#039;ll be using GIMP here. Keep Wings3D open, though; we&#039;ll need it later on.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_13.png]]&lt;br /&gt;
&lt;br /&gt;
GIMP is easy enough to use, so I&#039;m not going to cover it in very much detail here. Start out with just bucket fill and pencil with different brush sizes, then have a look at the Pattern Fill tool option for bucket fill, and you should be able to get something like:&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_14.png]]&lt;br /&gt;
&lt;br /&gt;
...or hopefully much better and more interesting. I&#039;m rushing here, hence the flat-colour areas (generally a bad idea) and generic blobby camoflage.&lt;br /&gt;
&lt;br /&gt;
One thing that isn&#039;t very clear from the screenshots is that I&#039;ve gone around the edge of a few areas with more colour. If you just go with the black lines you&#039;ve been given, then white borders may start to bleed into your final textures. If you paint over the white around things, then this won&#039;t happen.&lt;br /&gt;
&lt;br /&gt;
Now we can move back into Wings3D, where I&#039;ve turned more-rendered-mode back on again.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_15.png]]&lt;br /&gt;
&lt;br /&gt;
You&#039;ll notice the old texture is still in place. To bring the new texture in, right-click on the white square texture, and Refresh.&lt;br /&gt;
&lt;br /&gt;
[[Image:Uv_16.png]]&lt;br /&gt;
&lt;br /&gt;
And now everything looks so much more textured!&lt;br /&gt;
&lt;br /&gt;
(In practice, leaving this step until the end is a bad idea. It&#039;s best to flick between Wings3D and Gimp, trying things out.)&lt;br /&gt;
&lt;br /&gt;
Now the model&#039;s been textured, we&#039;ll need to separate out those pieces we combined together before. If everything&#039;s in one body, then the turret won&#039;t be able to move independently of the base, etc. Using the body tool, select the tank, then right click &amp;gt; Separate.&lt;br /&gt;
&lt;br /&gt;
Everything&#039;ll split back into constituent parts, with fairly generic names (cube2_sep7). You might want to rename these back to something sensible in the Geometry Graph at this point (right click &amp;gt; Rename). I&#039;ve gone for &amp;quot;body&amp;quot;, &amp;quot;turret&amp;quot; and &amp;quot;gun&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
And there we have the completed textured model. It&#039;s looking very blockish and plain, but hopefully you&#039;ll be able to do better once you start modelling properly.&lt;br /&gt;
&lt;br /&gt;
(This finished textured model can be found in the Example Mod.)&lt;br /&gt;
&lt;br /&gt;
Don&#039;t close GIMP just yet; we&#039;ll need it for the next part.&lt;br /&gt;
&lt;br /&gt;
== Preparing a Model for the Engine ==&lt;br /&gt;
&lt;br /&gt;
The original tutorial this part is based on can be found [https://springrts.com/phpbb/viewtopic.php?f=14&amp;amp;t=13034 here]. Thanks, Pressure Line!&lt;br /&gt;
&lt;br /&gt;
Okay, so we&#039;ve got our model in Wings3D, uvmapped and textured. But at the moment, all the texture is fixed; there isn&#039;t anywhere for team colours. For that, switch back to GIMP.&lt;br /&gt;
&lt;br /&gt;
In Spring, the main texture for each model uses the Alpha channel for teamcolour. Most programs use Alpha for transparency, so this may make your image previews slightly odd. But it&#039;ll all look fine once it&#039;s in game. In the alpha channel, white is teamcolour, black is no teamcolour, and greys in between are in between. If this doesn&#039;t make sense, just keep reading and hopefully it&#039;ll all be fine once we&#039;ve finished.&lt;br /&gt;
&lt;br /&gt;
(I say &amp;quot;main texture&amp;quot; because Spring also allows for secondary textures, which use red for glow, green for reflectivity, and alpha for transparency. I won&#039;t cover these here in any detail; play around with these if you want to learn more.)&lt;br /&gt;
&lt;br /&gt;
In GIMP, collapse everything into one layer if you&#039;ve got more than one. Right click on the layer, and click Add Alpha Channel if it&#039;s available. (If it&#039;s not, you&#039;ve probably already got an alpha channel.)&lt;br /&gt;
&lt;br /&gt;
Click Colors &amp;gt; Components &amp;gt; Decompose. This&#039;ll give you a box; set it to RGBA and press OK.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_2.png]]&lt;br /&gt;
&lt;br /&gt;
This should give you a second GIMP window, with greyscale and four layers. These are your Red, Green, Blue and Alpha channels. You&#039;ll notice the Alpha channel is completely white; we don&#039;t want this, because it&#039;ll make your whole unit teamcoloured instead of the grey-and-camoflage that we want for most of it.&lt;br /&gt;
&lt;br /&gt;
Copy one of the other layers into the Alpha layer, so you can see where things are. Then make everything black, except for the texture for the turret at the top; make that white.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_3.png]]&lt;br /&gt;
&lt;br /&gt;
Then select Colors &amp;gt; Components &amp;gt; Recompose, and swap back to your first image. You&#039;ll see that most of it&#039;s vanished, except for the part you want in teamcolour. Don&#039;t panic; it&#039;s still there, it&#039;s just transparent. Save this as TGA.&lt;br /&gt;
&lt;br /&gt;
(Alternatively, at this point, you could save it as DDS (you&#039;ll want DXT3 or DXT5, and lots and lots of mipmaps). I personally use TGA, because I&#039;ve never got round to getting the GIMP DDS plugin working on my machine. If you use DDS, you&#039;ll get better performance.)&lt;br /&gt;
&lt;br /&gt;
You can close GIMP down at this point, unless you&#039;re going to be still tweaking things.&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll need to get the model out of Wings3D and into [[Upspring]]. Swap back to Wings3D, click File &amp;gt; Export, and click on the box next to 3D Studio (3ds). This&#039;ll give you some options.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_4.png]]&lt;br /&gt;
&lt;br /&gt;
You want &amp;quot;Swap X and Y axes&amp;quot; off, Export normals and UV coords both on, and default texture file type set to Targa (tga). Click OK, and save it somewhere you&#039;ll remember.&lt;br /&gt;
&lt;br /&gt;
(At this point, if you wanted to, you could use OBJ instead of 3DS; there&#039;s no real difference for [[Upspring]] as far as I can tell.)&lt;br /&gt;
&lt;br /&gt;
Now open up [[Upspring]]. You should see something like this.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_5.png]]&lt;br /&gt;
&lt;br /&gt;
Click File &amp;gt; Open, browse to your folder,  tell it to look for 3ds files, open the file.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_6.png]]&lt;br /&gt;
&lt;br /&gt;
It&#039;ll ask you what you want to do with the multiple meshes. Tell it 2) Load all objects as childs (children?) of an empty root object.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_7.png]]&lt;br /&gt;
&lt;br /&gt;
There&#039;s your model, looking small and untextured. On the right, choose the Objects tab.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_8.png]]&lt;br /&gt;
&lt;br /&gt;
You&#039;ve got a hierarchy of model pieces. These determine what moves when what piece moves. We want the gun to move when the turret moves, and we want both of those to move when the whole body moves, so use the cut and paste buttons above to arrange things more like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_9.png]]&lt;br /&gt;
&lt;br /&gt;
I&#039;ve also renamed the root piece to &amp;quot;base&amp;quot;, because it looks better.&lt;br /&gt;
&lt;br /&gt;
Next, we need to move the origin for each piece, to define the points that things rotate around. Zoom in so you can see things properly (by dragging with the right mouse button), then select the &amp;quot;only move origin&amp;quot; option, and select the turret in the hierarchy.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_10.png]]&lt;br /&gt;
&lt;br /&gt;
The X pos, Y pos and Z pos options specify the position of the origin. By default everything&#039;s at (0,0,0). Now at this point, you could move into Wings3D, look at the actual height, and put it in the box. Or you can do what I do, and type guesses into the Y pos box until I get the red dot in what looks like the right place. (0,12,0) looks fine.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_11.png]]&lt;br /&gt;
&lt;br /&gt;
Now, interestingly, the gun origin will automatically have moved to (0,-12,0) to stay at the same place. This is because, when we set the origin of the turret, all pieces below the turret in the hierarchy will now measure their positions relative to that piece. Set the turret value to (0,0,0) so the origin&#039;s in the same place as the turret.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll need another piece later on, to mark the end of the barrel of the gun, so bullets know where to fire from. To do this, select the gun, click &amp;quot;Add empty&amp;quot;, call it &amp;quot;flare&amp;quot;.Position it just in front of the end of the barrel. (0,0,15) looks good to me.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_12.png]]&lt;br /&gt;
&lt;br /&gt;
Now move onto the Model tab. This gives you options for model centre and radius (this defines the hitsphere), and model height (this defines where the health bar goes). Again, you can measure these carefully in Wings3D, or just guess. There are Estimate buttons, but they often need a bit of adjusting afterwards.&lt;br /&gt;
&lt;br /&gt;
To see what your numbers are doing, click on the &amp;quot;3D&amp;quot; to the top left hand corner of the 3D view, and tell it &amp;quot;Draw model radius and height&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_13.png]]&lt;br /&gt;
&lt;br /&gt;
Now all the unit needs is the texture. Click over to the Mapping tab, click Browse for Texture 1, and load your texture from before.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_14.png]]&lt;br /&gt;
&lt;br /&gt;
And there we have the texture, with a teamcolour turret. If you&#039;ve got a second texture for reflectivity and so on, you can put that as Texture 2.&lt;br /&gt;
&lt;br /&gt;
Now if you&#039;re using TGA textures rather than DDS, you&#039;ll need one extra step. Click Texture Mapping &amp;gt; Show UV Mapping. It&#039;ll show your texture; click Edit &amp;gt; Flip UVs. Close the UV editor.&lt;br /&gt;
&lt;br /&gt;
[[Image:Upspr_15.png]]&lt;br /&gt;
&lt;br /&gt;
Now your texture looks strange and mangled. In fact, this is what your unit would have looked like if you&#039;d put it in game without flipping UVs like that. Once it&#039;s in game, it&#039;ll be fine. This strange texture-flipping is a consequence of the way DDS files measure coordinates, I think. If you&#039;re using DDS, you won&#039;t need to do this step. &lt;br /&gt;
&lt;br /&gt;
One last thing: click on Object &amp;gt; Recalculate vertex normals, 3d0 style &amp;gt; All objects, then OK. This&#039;ll sort out some normals or something, I&#039;m not too sure what it does but it makes your textures look better.&lt;br /&gt;
&lt;br /&gt;
Now all you need to do is save the model as an s3o file.&lt;br /&gt;
&lt;br /&gt;
And there we have our finished model and texture! Now to get them in game.&lt;br /&gt;
&lt;br /&gt;
== Putting the Unit in a Game ==&lt;br /&gt;
&lt;br /&gt;
The Spring engine uses .sdz or .sd7 files to load game content. In practice, these are just .zip and .7z files with renamed suffixes; to open up any mod, just rename it and extract it. Also, the Spring engine lets you just put all your game files in a folder in your /games directory, as long as it ends in .sdd .&lt;br /&gt;
&lt;br /&gt;
The best place to get started here is to download the [https://springfiles.com/spring/games/empty-mod Empty Mod], extract it to a folder called EmptyMod.sdd in your /games directory. This is basically the bare minimum to get a unit in game.&lt;br /&gt;
&lt;br /&gt;
Open up SpringLobby; if you&#039;ve put it in the right place and everything else&#039;s correct, you should see an entry for &amp;quot;Empty Mod&amp;quot; in your games list. (You might need to tell it to Tools &amp;gt; Reload Maps/Games first.) If you try playing it, it&#039;ll put a blank immobile cube at your start point.&lt;br /&gt;
&lt;br /&gt;
To get the tank unit in game, you&#039;ll need as bare minimum an s3o file in /objects3d, a texture file in /unittextures, and a unitdef in /units. You already have two out of three; put them in the right folders.&lt;br /&gt;
&lt;br /&gt;
Next, you&#039;ll need to make a unitdef. There are two ways of doing this: the old TA-ish way or the new lua way. You can write an FBI file, which is a text file with a list of variables, or you can write a lua file, which is a text file with a list of variables with slightly different syntax. In general, older tutorials and a fair bit of documentation will talk about FBI, but I&#039;m going to use lua instead because it&#039;s more flexible and (I vaguely remember) slightly faster. Here&#039;s an example lua unitdef:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local unitName  =  &amp;quot;tank&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local unitDef  =  {&lt;br /&gt;
--Internal settings&lt;br /&gt;
    BuildPic = &amp;quot;filename.bmp&amp;quot;,&lt;br /&gt;
    Category = &amp;quot;TANK SMALL NOTAIR NOTSUB&amp;quot;,&lt;br /&gt;
    ObjectName = &amp;quot;tank3.s3o&amp;quot;,&lt;br /&gt;
    name = &amp;quot;Generic Tank&amp;quot;,&lt;br /&gt;
    Side = &amp;quot;TANKS&amp;quot;,&lt;br /&gt;
    TEDClass = &amp;quot;TANK&amp;quot;,&lt;br /&gt;
    UnitName = &amp;quot;tank&amp;quot;,&lt;br /&gt;
    script = &amp;quot;tankscript.lua&amp;quot;,&lt;br /&gt;
    &lt;br /&gt;
--Unit limitations and properties&lt;br /&gt;
    BuildTime = 1000,&lt;br /&gt;
    Description = &amp;quot;A generic tank unit.&amp;quot;,&lt;br /&gt;
    MaxDamage = 800,&lt;br /&gt;
    RadarDistance = 0,&lt;br /&gt;
    SightDistance = 400,&lt;br /&gt;
    SoundCategory = &amp;quot;TANK&amp;quot;,&lt;br /&gt;
    Upright = 0,&lt;br /&gt;
    &lt;br /&gt;
--Energy and metal related&lt;br /&gt;
    BuildCostEnergy = 100,&lt;br /&gt;
    BuildCostMetal = 0,&lt;br /&gt;
    &lt;br /&gt;
--Pathfinding and related&lt;br /&gt;
    Acceleration = 0.15,&lt;br /&gt;
    BrakeRate = 0.1,&lt;br /&gt;
    FootprintX = 2,&lt;br /&gt;
    FootprintZ = 2,&lt;br /&gt;
    MaxSlope = 15,&lt;br /&gt;
    MaxVelocity = 2.0,&lt;br /&gt;
    MaxWaterDepth = 20,&lt;br /&gt;
    MovementClass = &amp;quot;Default2x2&amp;quot;,&lt;br /&gt;
    TurnRate = 900,&lt;br /&gt;
    &lt;br /&gt;
--Abilities&lt;br /&gt;
    Builder = 0,&lt;br /&gt;
    CanAttack = 1,&lt;br /&gt;
    CanGuard = 1,&lt;br /&gt;
    CanMove = 1,&lt;br /&gt;
    CanPatrol = 1,&lt;br /&gt;
    CanStop = 1,&lt;br /&gt;
    LeaveTracks = 0,&lt;br /&gt;
    Reclaimable = 0,&lt;br /&gt;
    &lt;br /&gt;
--Hitbox&lt;br /&gt;
--    collisionVolumeOffsets    =  &amp;quot;0 0 0&amp;quot;,&lt;br /&gt;
--    collisionVolumeScales     =  &amp;quot;20 20 20&amp;quot;,&lt;br /&gt;
--    collisionVolumeTest       =  1,&lt;br /&gt;
--    collisionVolumeType       =  &amp;quot;box&amp;quot;,&lt;br /&gt;
    &lt;br /&gt;
--Weapons and related&lt;br /&gt;
    BadTargetCategory = &amp;quot;NOTAIR&amp;quot;,&lt;br /&gt;
    ExplodeAs = &amp;quot;TANKDEATH&amp;quot;,&lt;br /&gt;
    NoChaseCategory = &amp;quot;AIR&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return lowerkeys({ [unitName]  =  unitDef })&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s worth looking through this and understanding what each entry does. Most are fairly self-explanatory; for the ones that aren&#039;t, there&#039;s [[Gamedev:UnitDefs | this page]].&lt;br /&gt;
&lt;br /&gt;
Put this file in your /units folder, then open up /gamedata/sidedata.lua and change &#039;startunit = &amp;quot;cube&amp;quot;&#039; to &#039;startunit = &amp;quot;tank&amp;quot;. Then start up the mod in Spring.&lt;br /&gt;
&lt;br /&gt;
[[Image:Mod_2.png]]&lt;br /&gt;
&lt;br /&gt;
We should now have a model in game! You should be able to select it, and right-click it around the place. It can&#039;t attack anything yet, but one step at a time.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to make this tank shoot small orange blobs. For this we need three things: a small orange blob image for it to fire, a weapon entry in the unitdef, and a unit animation script.&lt;br /&gt;
&lt;br /&gt;
For the small orange blob image, I&#039;m going to use flame.tga from Evolution RTS (it&#039;s a good game, with models and textures under CC-BY-NC-ND and almost everything else under a do-whatever-you-want license; well worth checking out).  It&#039;s in the /bitmaps folder of the example mod; put it in your own /bitmaps folder. Next, we need to open up /gamedata/resources.lua and tell the engine we&#039;ve got a flame texture; just put a line &amp;quot;flame = &#039;flame.tga&#039; &amp;quot; in the projectiletextures brackets (or comment out the one I&#039;ve already left in there).&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the lua unitdef from before, with the new weapon data in place:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local unitName  =  &amp;quot;tank&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local unitDef  =  {&lt;br /&gt;
--Internal settings&lt;br /&gt;
    BuildPic = &amp;quot;filename.bmp&amp;quot;,&lt;br /&gt;
    Category = &amp;quot;TANK SMALL NOTAIR NOTSUB&amp;quot;,&lt;br /&gt;
    ObjectName = &amp;quot;tank3.s3o&amp;quot;,&lt;br /&gt;
    name = &amp;quot;Generic Tank&amp;quot;,&lt;br /&gt;
    Side = &amp;quot;TANKS&amp;quot;,&lt;br /&gt;
    TEDClass = &amp;quot;TANK&amp;quot;,&lt;br /&gt;
    UnitName = &amp;quot;tank&amp;quot;,&lt;br /&gt;
    script = &amp;quot;tankscript.lua&amp;quot;,&lt;br /&gt;
    &lt;br /&gt;
--Unit limitations and properties&lt;br /&gt;
    BuildTime = 1000,&lt;br /&gt;
    Description = &amp;quot;A generic tank unit.&amp;quot;,&lt;br /&gt;
    MaxDamage = 800,&lt;br /&gt;
    RadarDistance = 0,&lt;br /&gt;
    SightDistance = 400,&lt;br /&gt;
    SoundCategory = &amp;quot;TANK&amp;quot;,&lt;br /&gt;
    Upright = 0,&lt;br /&gt;
    &lt;br /&gt;
--Energy and metal related&lt;br /&gt;
    BuildCostEnergy = 100,&lt;br /&gt;
    BuildCostMetal = 0,&lt;br /&gt;
    &lt;br /&gt;
--Pathfinding and related&lt;br /&gt;
    Acceleration = 0.15,&lt;br /&gt;
    BrakeRate = 0.1,&lt;br /&gt;
    FootprintX = 2,&lt;br /&gt;
    FootprintZ = 2,&lt;br /&gt;
    MaxSlope = 15,&lt;br /&gt;
    MaxVelocity = 2.0,&lt;br /&gt;
    MaxWaterDepth = 20,&lt;br /&gt;
    MovementClass = &amp;quot;Default2x2&amp;quot;,&lt;br /&gt;
    TurnRate = 900,&lt;br /&gt;
    &lt;br /&gt;
--Abilities&lt;br /&gt;
    Builder = 0,&lt;br /&gt;
    CanAttack = 1,&lt;br /&gt;
    CanGuard = 1,&lt;br /&gt;
    CanMove = 1,&lt;br /&gt;
    CanPatrol = 1,&lt;br /&gt;
    CanStop = 1,&lt;br /&gt;
    LeaveTracks = 0,&lt;br /&gt;
    Reclaimable = 0,&lt;br /&gt;
    &lt;br /&gt;
--Hitbox&lt;br /&gt;
--    collisionVolumeOffsets    =  &amp;quot;0 0 0&amp;quot;,&lt;br /&gt;
--    collisionVolumeScales     =  &amp;quot;20 20 20&amp;quot;,&lt;br /&gt;
--    collisionVolumeTest       =  1,&lt;br /&gt;
--    collisionVolumeType       =  &amp;quot;box&amp;quot;,&lt;br /&gt;
    &lt;br /&gt;
--Weapons and related&lt;br /&gt;
    BadTargetCategory = &amp;quot;NOTAIR&amp;quot;,&lt;br /&gt;
    ExplodeAs = &amp;quot;TANKDEATH&amp;quot;,&lt;br /&gt;
    NoChaseCategory = &amp;quot;AIR&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
    weapons = {&lt;br /&gt;
        [1] = {&lt;br /&gt;
            def = &amp;quot;orangeblob&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local weaponDefs = {&lt;br /&gt;
    orangeblob = {&lt;br /&gt;
    name = &amp;quot;Orange Plasma Cannon&amp;quot;,&lt;br /&gt;
    weapontype = &amp;quot;Cannon&amp;quot;,&lt;br /&gt;
    accuracy = 10,&lt;br /&gt;
    areaofeffect = 100,&lt;br /&gt;
    avoidfeature = false,&lt;br /&gt;
    avoidfriendly = true,&lt;br /&gt;
    canattackground = true,&lt;br /&gt;
    collidefriendly = true,&lt;br /&gt;
    collisionsize = 8,&lt;br /&gt;
    commandfire = false,&lt;br /&gt;
    craterboost = 0,&lt;br /&gt;
    cratermult = 0,&lt;br /&gt;
    edgeeffectiveness = 0.1,&lt;br /&gt;
    explosionspeed = 128,&lt;br /&gt;
    impulseboost = 0,&lt;br /&gt;
    impulsefactor = 0,&lt;br /&gt;
    intensity = 1,&lt;br /&gt;
    noselfdamage = true,&lt;br /&gt;
    size = 4,&lt;br /&gt;
--        soundstart = &amp;quot;tank_fire&amp;quot;,&lt;br /&gt;
--        soundhit = &amp;quot;explo01&amp;quot;,&lt;br /&gt;
    range = 250,&lt;br /&gt;
    reloadtime = 1.5,&lt;br /&gt;
    rgbcolor = &amp;quot;1.0 1.0 1.0&amp;quot;,&lt;br /&gt;
    turret = true,&lt;br /&gt;
    texture1 = &amp;quot;flame&amp;quot;,&lt;br /&gt;
    weaponvelocity = 400,&lt;br /&gt;
--		explosiongenerator = &amp;quot;custom:TANKGUN_FX&amp;quot;,&lt;br /&gt;
    damage =&lt;br /&gt;
    {&lt;br /&gt;
        default = 55,&lt;br /&gt;
    },&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    unitDef.weaponDefs = weaponDefs&lt;br /&gt;
    return lowerkeys({ [unitName]  =  unitDef })&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the animation script. This tells the unit what things to move when firing, moving, exploding etc. All we really want at this point is for the turret to rotate and pitch to the right angle. &lt;br /&gt;
&lt;br /&gt;
Again there are two ways of doing this: the old TA-style method, and the new lua method. You&#039;ve got the choice of writing the animation script in BOS, then compiling it into COB using Scriptor; this is the best-documented method, but it needs the compiler, and it isn&#039;t as flexible. The other method is to write the animation script in lua; this lets you reload scripts mid-game without needing to recompile anything, and allows for the whole lua api in your animation scripts (more on lua later). The only real reason for using COB at the moment is &amp;quot;I already have a working game with vast hordes of COB animations, and it would take a long time to change them all&amp;quot;. If you&#039;re starting out a new game, then lua is really the best option.&lt;br /&gt;
&lt;br /&gt;
here&#039;s an example animation script to go in /scripts/tankscript.lua :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local base = piece &amp;quot;base&amp;quot;&lt;br /&gt;
local body = piece &amp;quot;body&amp;quot;&lt;br /&gt;
local turret = piece &amp;quot;turret&amp;quot;&lt;br /&gt;
local gun = piece &amp;quot;gun&amp;quot;&lt;br /&gt;
local flare = piece &amp;quot;flare&amp;quot;&lt;br /&gt;
-- declares all the pieces we&#039;ll use in the script.&lt;br /&gt;
&lt;br /&gt;
local SIG_AIM = 2&lt;br /&gt;
&lt;br /&gt;
local RESTORE_DELAY = Spring.UnitScript.GetLongestReloadTime(unitID) * 2&lt;br /&gt;
-- picks a sensible time to wait before trying to turn the turret back to default.&lt;br /&gt;
&lt;br /&gt;
function script.Create()&lt;br /&gt;
    return 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function RestoreAfterDelay(unitID)&lt;br /&gt;
    -- defines a local funtion to wait a bit, then move the turret back to how it was originally.&lt;br /&gt;
	Sleep(RESTORE_DELAY)&lt;br /&gt;
	Turn(turret, y_axis, 0, math.rad(35))&lt;br /&gt;
	Turn(gun, x_axis, 0, math.rad(30))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.AimWeapon(weaponID, heading, pitch)&lt;br /&gt;
	Signal(SIG_AIM)&lt;br /&gt;
	SetSignalMask(SIG_AIM)&lt;br /&gt;
    -- each time the Signal is called, all other functions with the same SignalMask will stop running. This makes sure the tank isn&#039;t trying to fire at something, and restore the turret position, at the same time.&lt;br /&gt;
	Turn(turret, y_axis, heading, math.rad(35))&lt;br /&gt;
	Turn(gun, x_axis, -pitch, math.rad(30))&lt;br /&gt;
	WaitForTurn(turret, y_axis)&lt;br /&gt;
	WaitForTurn(gun, x_axis)&lt;br /&gt;
	StartThread(RestoreAfterDelay)&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.FireWeapon(weaponID)&lt;br /&gt;
	EmitSfx(flare, 0)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.QueryWeapon() return flare end&lt;br /&gt;
-- The piece that the bullet/laser/whatever comes out of.&lt;br /&gt;
&lt;br /&gt;
function script.AimFromWeapon() return gun end&lt;br /&gt;
-- The unit looks from this piece down the QueryWeapon piece, to see whether it&#039;s aiming at anything.&lt;br /&gt;
&lt;br /&gt;
function script.Killed(recentDamage, maxHealth)&lt;br /&gt;
	return 0&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.HitByWeapon(x,z,weaponDef,damage)&lt;br /&gt;
    -- This stops the unit taking damage until it&#039;s been built.&lt;br /&gt;
	if GetUnitValue(COB.BUILD_PERCENT_LEFT)&amp;gt;2 then return 0&lt;br /&gt;
	else return damage&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now all these files are in the right folders, start the game. You should now have a small tank, able to drive around and shoot at things!&lt;br /&gt;
&lt;br /&gt;
You&#039;ll probably have noticed two things. Firstly, the explosion from being hit by an orange blob isn&#039;t very dramatic. Secondly, there&#039;s no sound. Let&#039;s fix the sound first.&lt;br /&gt;
&lt;br /&gt;
First of all, you&#039;ll need an explosion sound. I&#039;m using Explosion3 from https://www.partnersinrhyme.com/soundfx/PDsoundfx/gunsbombs.shtml, chopped around a bit in Audacity: again, you can get it from the Example Mod.  Put it in /sounds .&lt;br /&gt;
&lt;br /&gt;
Next, we&#039;ll need to tell the engine about the sound file. Open up /gamedata/sounds.lua , and add in a new entry, so it looks something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local Sounds = {&lt;br /&gt;
	SoundItems = {&lt;br /&gt;
		--- RESERVED FOR SPRING, DON&#039;T REMOVE&lt;br /&gt;
		IncomingChat = {&lt;br /&gt;
			file = &amp;quot;sounds/incoming_chat.wav&amp;quot;,&lt;br /&gt;
			 rolloff = 0.1, &lt;br /&gt;
			maxdist = 10000,&lt;br /&gt;
			priority = 100, --- higher numbers = less chance of cutoff&lt;br /&gt;
			maxconcurrent = 1, ---how many maximum can we hear?&lt;br /&gt;
		},&lt;br /&gt;
		MultiSelect = {&lt;br /&gt;
			file = &amp;quot;sounds/multiselect.wav&amp;quot;,&lt;br /&gt;
			 rolloff = 0.1, &lt;br /&gt;
			maxdist = 10000,&lt;br /&gt;
			priority = 100, --- higher numbers = less chance of cutoff&lt;br /&gt;
			maxconcurrent = 1, ---how many maximum can we hear?&lt;br /&gt;
		},&lt;br /&gt;
		MapPoint = {&lt;br /&gt;
			file = &amp;quot;sounds/mappoint.wav&amp;quot;,&lt;br /&gt;
			rolloff = 0.1,&lt;br /&gt;
			maxdist = 10000,&lt;br /&gt;
			priority = 100, --- higher numbers = less chance of cutoff&lt;br /&gt;
			maxconcurrent = 1, ---how many maximum can we hear?&lt;br /&gt;
		},&lt;br /&gt;
		--- END RESERVED&lt;br /&gt;
&lt;br /&gt;
--WEAPONS&lt;br /&gt;
&lt;br /&gt;
		orangeblob_explo = { &lt;br /&gt;
            file = &amp;quot;sounds/Explosi3.wav&amp;quot;, &lt;br /&gt;
			rolloff=3, dopplerscale = 0, maxdist = 6000,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
			priority = 10, --- higher numbers = less chance of cutoff&lt;br /&gt;
			maxconcurrent = 4, ---how many maximum can we hear?&lt;br /&gt;
		},&lt;br /&gt;
&lt;br /&gt;
		--[[DefaultsForSounds = { -- this are default settings&lt;br /&gt;
			file = &amp;quot;ThisEntryMustBePresent.wav&amp;quot;,&lt;br /&gt;
			gain = 1.0,&lt;br /&gt;
			pitch = 1.0,&lt;br /&gt;
			priority = 0,&lt;br /&gt;
			maxconcurrent = 16, --- some reasonable limits&lt;br /&gt;
			--maxdist = FLT_MAX, --- no cutoff at all&lt;br /&gt;
		},&lt;br /&gt;
		--- EXAMPLE ONLY!&lt;br /&gt;
		MyAwesomeSound = {			&lt;br /&gt;
			file = &amp;quot;sounds/booooom.wav&amp;quot;,&lt;br /&gt;
			preload, -- put in memory!&lt;br /&gt;
			loop,  -- loop me!&lt;br /&gt;
			looptime=1000, --- milliseconds!&lt;br /&gt;
			gain = 2.0, --- for uber-loudness&lt;br /&gt;
			pitch = 0.2, --- bass-test&lt;br /&gt;
			priority = 15, --- very high&lt;br /&gt;
			maxconcurrent = 1, ---only once&lt;br /&gt;
			--maxdist = 500, --- only when near&lt;br /&gt;
		},]]&lt;br /&gt;
	},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
return Sounds&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to tell the unitdef what sound to use. Open it up, and in the weapondef, add the line&lt;br /&gt;
&lt;br /&gt;
    soundhit = &amp;quot;orangeblob_explo&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
Now, if you try the game in Spring, you should get an explosion sound every time an orange blob hits something. To add a sound on firing, do the same, but add&lt;br /&gt;
&lt;br /&gt;
    soundstart = &amp;quot;whatevername&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
to the weapondef instead. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Note: If SpringRTS displays errors when loading the sound, try using OGG format instead. See this [https://springrts.com/phpbb/viewtopic.php?f=52&amp;amp;t=36920 thread for more error details].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now for the explosion. For particle effects like this, there are two ways (the old TA-style way and the new lua way, again). You can write a CEG tdf file defining what sprites and particles go where and do what, or you can use LUPS (Lua Particle System). Now, this time I&#039;m going to recommend the old TA-style way, because it&#039;s well documented and I know how to use it (whereas I don&#039;t have a clue how to use LUPS, or where to find out how to use it), but more importantly because it doesn&#039;t work on some ATI graphics cards. LUPS is much more flexible, but for now it&#039;s best only used for aeroplane trails and other effects that people won&#039;t complain about if they&#039;re missing.&lt;br /&gt;
&lt;br /&gt;
To use CEG, first you&#039;ll need to put a tdf file like this one in the /gamedata/explosions folder:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[TANKGUN_FX]&lt;br /&gt;
{&lt;br /&gt;
[groundflash]&lt;br /&gt;
   {&lt;br /&gt;
      flashSize = 45;&lt;br /&gt;
      flashAlpha = 0.9;&lt;br /&gt;
      circleGrowth = 3;&lt;br /&gt;
      circleAlpha = 0.3;&lt;br /&gt;
      ttl = 30;&lt;br /&gt;
      color = 1, 0.5, 0;&lt;br /&gt;
air=1;&lt;br /&gt;
     ground=1;&lt;br /&gt;
      water=1;&lt;br /&gt;
}&lt;br /&gt;
[heatcloud_MED_EXPLOSION_FX01]&lt;br /&gt;
   {&lt;br /&gt;
class=heatcloud;&lt;br /&gt;
      [properties]&lt;br /&gt;
      {&lt;br /&gt;
texture=explodeheat;&lt;br /&gt;
      heat = 30;&lt;br /&gt;
      maxheat = 30;&lt;br /&gt;
      heatFalloff = 1;&lt;br /&gt;
      size = 30;&lt;br /&gt;
      sizeGrowth = -0.3;&lt;br /&gt;
      sizemod = 0;&lt;br /&gt;
      sizemodmod = 0;&lt;br /&gt;
      speed = 0, 1.5, 0;&lt;br /&gt;
      pos = 0, 5, 0;&lt;br /&gt;
      }&lt;br /&gt;
air=1;&lt;br /&gt;
      water=1;&lt;br /&gt;
      ground=1;&lt;br /&gt;
      count=1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[MOREDOTS]&lt;br /&gt;
  {&lt;br /&gt;
class=CSimpleParticleSystem;&lt;br /&gt;
&lt;br /&gt;
   [properties]&lt;br /&gt;
   {     &lt;br /&gt;
   alwaysVisible=1;&lt;br /&gt;
   Texture=randdots;&lt;br /&gt;
&lt;br /&gt;
   colorMap = 1.0 1.0 1.0 0.05   0.2 0.9 0.5 0.01  0.1 0.8 0.1 0.00;&lt;br /&gt;
&lt;br /&gt;
   pos      = 0, 2, 0;&lt;br /&gt;
   gravity     = 0, -0.1, 0;&lt;br /&gt;
   emitVector  = 0, 1, 0;&lt;br /&gt;
   emitRot     = 45;&lt;br /&gt;
   emitRotSpread  = 32;&lt;br /&gt;
&lt;br /&gt;
   sizeGrowth  = 0.5;&lt;br /&gt;
   sizeMod     = 1;&lt;br /&gt;
&lt;br /&gt;
   airdrag        = 0.8;&lt;br /&gt;
   particleLife      = 5;&lt;br /&gt;
   particleLifeSpread   = 7;&lt;br /&gt;
   numParticles      = 16;&lt;br /&gt;
   particleSpeed     = 8;&lt;br /&gt;
   particleSpeedSpread  = 3;&lt;br /&gt;
   particleSize      = 20;&lt;br /&gt;
   particleSizeSpread   = 0;&lt;br /&gt;
&lt;br /&gt;
   directional    = 1;&lt;br /&gt;
   useAirLos      = 0;&lt;br /&gt;
   }&lt;br /&gt;
air=1;&lt;br /&gt;
ground=1;&lt;br /&gt;
count=1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need some more explosion images (also shamelessly stolen from EvoRTS), again available in the Example Mod.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll need to put these in /bitmaps, then name them in /gamedata/resources.lua . Also in the weapondef, you&#039;ll need to put&lt;br /&gt;
&lt;br /&gt;
    explosiongenerator = &amp;quot;custom:TANKGUN_FX&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
And now, in game, you should have a working moving tank that shoots things! Congratulations!&lt;br /&gt;
&lt;br /&gt;
== Other Small Things ==&lt;br /&gt;
&lt;br /&gt;
In SpringLobby, you&#039;ll notice a &amp;quot;Side: 1&amp;quot; option whenever you mouse over one of the players. It&#039;s easy enough to change the &amp;quot;1&amp;quot; to something a bit more descriptive of your side, by putting a 16x16 bmp in /sidepics . If your faction is called &amp;quot;TANK&amp;quot; in sidedata.lua, then call it /sidepics/tank.bmp .&lt;br /&gt;
&lt;br /&gt;
Once you have construction units, it&#039;ll help if players have pictures of whatever it is they&#039;re building. Put these in /unitpics, and put lines in the unitdefs like&lt;br /&gt;
    BuildPic = &amp;quot;filename.bmp&amp;quot;,   &lt;br /&gt;
&lt;br /&gt;
== Structure of a Game ==&lt;br /&gt;
&lt;br /&gt;
Before moving on to factories, builders, and other types of unit, I think it&#039;s worth going through the structure of what folder means what in a mod file.&lt;br /&gt;
&lt;br /&gt;
* /bitmaps - This contains the .tga files for explosions, lasers, and so on. Each image here needs to be named in /gamedata/resources.lua before it can be used.&lt;br /&gt;
** /bitmaps/loadpictures - Any jpg files in here will be shown while the game is loading.&lt;br /&gt;
&lt;br /&gt;
* /gamedata - Lua files defining game information.&lt;br /&gt;
** gamedata/armordefs.lua - defines different armour groupings. More information: [[Armordefs.lua]].&lt;br /&gt;
** /gamedata/explosions - TDF files for CEG explosions.&lt;br /&gt;
** /gamedata/messages.lua - messages given whenever a team loses the game. More information:  [[Messages.lua]]&lt;br /&gt;
** /gamedata/modrules.lua - various parameters for your game, like flanking bonuses, rate at which experience is gained, etc. Have a look at existing games to see what they do. More information: [[Modrules.lua]]&lt;br /&gt;
** /gamedata/movedefs.lua - defines different types of movement (hovercraft, tank, ship etc). More information: [[Movedefs.lua]].&lt;br /&gt;
** /gamedata/resources.lua - all the bitmaps in /bitmaps, with names and what they do (are they for projectiles, groundflares, etc)&lt;br /&gt;
** /gamedata/sidedata.lua - defines the different factions, and what unit they start off with. In theory, you could do all this with a lua gadget (more on this later), but sidedata.lua works pretty well anyway.&lt;br /&gt;
** /gamedata/sounds.lua - defines all the sound files, with values for volume, priority, doppler effect, etc.&lt;br /&gt;
&lt;br /&gt;
* /LuaRules - contains gadgets. These are scripting files that change gameplay; more info later.&lt;br /&gt;
** /LuaRules/Gadgets/spawnPlayer.lua - creates a starting unit at the beginning of the game, depending on /gamedata/sidedata.lua . In theory, you could adapt this to generate random units, create whole bases at the start of games, etc.&lt;br /&gt;
** /LuaRules/Gadgets/unit_script.lua - this is needed for lua animation scripts to work, for some reason.&lt;br /&gt;
* /LuaUI - contains widgets. These are scripting files that change the user interface; more info later.&lt;br /&gt;
&lt;br /&gt;
* /music - contains music for the music widget.&lt;br /&gt;
* /sounds - contains sound.&lt;br /&gt;
&lt;br /&gt;
* /objects3d - contains all the s3o models.&lt;br /&gt;
* /scripts - contains all the unit animation scripts.&lt;br /&gt;
* /units - contains unit definitions.&lt;br /&gt;
* /unittextures - contains textures for the s3o models.&lt;br /&gt;
&lt;br /&gt;
* /unitpics - pictures for each unit, shown on build mens.&lt;br /&gt;
* /sidepics - pictures for each faction, shown in lobby.&lt;br /&gt;
&lt;br /&gt;
* /[[modinfo.lua]] - defines the mod name, description, and if it requires any pre-existing content.&lt;br /&gt;
* /EngineOptions.txt - exactly what it says on the tin. Look at different games to see what they do.&lt;br /&gt;
&lt;br /&gt;
== Other Types of Unit ==&lt;br /&gt;
&lt;br /&gt;
At the moment, you&#039;ve got a tank unit. This is useful, but for your game, you&#039;ll probably need some factories, builders, buildings, and so on (depending on how unconventional your game is). I think the best way to show how to make these units is by example, so here&#039;s a basic mod with about one of each:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Load up a game against RAI (that AI works for pretty much any mod, as long as your lua isn&#039;t too strange). Then extract it open (it&#039;s really just a .zip file), look through the code and see what the scripts and unitdefs are like.&lt;br /&gt;
&lt;br /&gt;
== Lua Gadgets and Widgets ==&lt;br /&gt;
&lt;br /&gt;
Now this is where things start getting really interesting. Gadgets are small lua script files that let you add things to the basic Spring gameplay. And by &amp;quot;things&amp;quot;, I mean &amp;quot;anything&amp;quot;. Want units that morph into other units? Lua. Want tech trees and unit prerequisites? Lua. Want units that fire other units? Lua. Want meteor strikes and random dinosaurs to spawn out of the map and attack players? Lua. Want napalm? Lua. Want time travel? Well, [https://achrongame.com/ maybe a separate engine designed for RTS time travel would help you better here], but presumably it can be done with enough Lua.&lt;br /&gt;
&lt;br /&gt;
And because it&#039;s so versatile, for now I&#039;m just going to point you to [[Lua Scripting | the lists of callouts and callins]] and stand back. Maybe I&#039;ll come back to this bit and write a basic gadget tutorial at a later date, but for now the forums are your friend.&lt;br /&gt;
&lt;br /&gt;
It&#039;s not very big yet, though, so for more examples just look at the [https://github.com/Balanced-Annihilation/Balanced-Annihilation/tree/master/luarules/gadgets Balanced Annihilation gadget source code].&lt;br /&gt;
&lt;br /&gt;
Widgets are like Gadgets, but instead of changing gameplay they change the user interface. So if you want to add a bunch more buttons along the right hand side, or glowing outlines around certain types of unit, you&#039;d probably use a widget. You can also add widgets to your local copy of Spring that aren&#039;t in the mod file itself; this can be useful to give yourself debug information that other players won&#039;t have, but bear in mind that it&#039;s pretty likely other players will also be using their own array of widgets to enhance their gaming abilities when playing against you.&lt;br /&gt;
&lt;br /&gt;
Have a look at the [https://github.com/Balanced-Annihilation/Balanced-Annihilation/tree/master/luaui/Widgets_BA Balanced Annihilation widget source code] for some examples.&lt;br /&gt;
&lt;br /&gt;
== Maps and Missions ==&lt;br /&gt;
&lt;br /&gt;
Okay, so you&#039;ve got a working multiplayer game. Now how about single player?&lt;br /&gt;
&lt;br /&gt;
There aren&#039;t really any Spring games at the moment with a single player campaign. All the tools are in place, but no-one&#039;s actually used them yet. Now, I&#039;m willing to bet that if you manage to give your game a decent SP campaign, and the multiplayer and graphics aren&#039;t too bad, it could quickly be adopted as the Spring engine&#039;s flagship game. No, I&#039;m serious here.&lt;br /&gt;
&lt;br /&gt;
To make some maps, see [https://springrts.com/wiki/Mapdev:Main Map Development]&lt;br /&gt;
&lt;br /&gt;
For single player missions, there&#039;s a [https://springrts.com/phpbb/viewtopic.php?f=14&amp;amp;t=24278 Mission Editor] &amp;lt;s&amp;gt;with a [https://code.google.com/p/zero-k/wiki/MissionEditorTutorial good tutorial] of its own, so I don&#039;t need to write one&amp;lt;/s&amp;gt;. Enjoy!&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Dev]]&lt;/div&gt;</summary>
		<author><name>Visionm</name></author>
	</entry>
</feed>