<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.spheredev.org/index.php?action=history&amp;feed=atom&amp;title=Battle_System_Tutorial_by_Radnen</id>
	<title>Battle System Tutorial by Radnen - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.spheredev.org/index.php?action=history&amp;feed=atom&amp;title=Battle_System_Tutorial_by_Radnen"/>
	<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Battle_System_Tutorial_by_Radnen&amp;action=history"/>
	<updated>2026-11-08T01:01:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>http://wiki.spheredev.org/index.php?title=Battle_System_Tutorial_by_Radnen&amp;diff=735&amp;oldid=prev</id>
		<title>Apollolux: created from http://web.archive.org/web/20120414032626/http://www.spheredev.org/wiki/Battle_System_Tutorial_by_Radnen</title>
		<link rel="alternate" type="text/html" href="http://wiki.spheredev.org/index.php?title=Battle_System_Tutorial_by_Radnen&amp;diff=735&amp;oldid=prev"/>
		<updated>2013-06-08T00:58:48Z</updated>

		<summary type="html">&lt;p&gt;created from http://web.archive.org/web/20120414032626/http://www.spheredev.org/wiki/Battle_System_Tutorial_by_Radnen&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is ridiculously small and simple battle system tutorial. It&amp;#039;s made to get you thinking about things a certain way and applying it to great affect. It&amp;#039;s intended for those who already know how to program simple systems and want to wrap their head around how one would &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;design&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; a battle system, and then &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;implement&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; it.&lt;br /&gt;
&lt;br /&gt;
Programming Level: Beginner to Mediocre.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Design Phase==&lt;br /&gt;
In this phase you will look at the fundamental objects that make up a battle system. Since I&amp;#039;m going to keep things abstract I&amp;#039;m not going to go over the details of specific battle systems. Instead I&amp;#039;ll go over details prevalent in all battle systems. In future tutorials I&amp;#039;ll modify this tutorial to show how particular systems can be made, you can even request one from me if I haven&amp;#039;t done it already. For now it&amp;#039;s just the generic stuff.&lt;br /&gt;
&lt;br /&gt;
===Entities===&lt;br /&gt;
First we need to identify the entities that are present in our battle system. Two main entities are&lt;br /&gt;
&lt;br /&gt;
*	Players&lt;br /&gt;
*	Monsters&lt;br /&gt;
&lt;br /&gt;
Other entities can be (won&amp;#039;t cover yet):&lt;br /&gt;
&lt;br /&gt;
*	Items&lt;br /&gt;
*	Spells/Abilities&lt;br /&gt;
&lt;br /&gt;
What are the attributes that build a player entity?&lt;br /&gt;
&lt;br /&gt;
*	Health&lt;br /&gt;
*	Mana&lt;br /&gt;
*	Defense&lt;br /&gt;
*	Attack&lt;br /&gt;
&lt;br /&gt;
Other (I won&amp;#039;t cover these):&lt;br /&gt;
&lt;br /&gt;
*	Equipment&lt;br /&gt;
*	Has own inventory?&lt;br /&gt;
*	Spells/Abilities&lt;br /&gt;
*	Other attributes (strength, speed, wisdom)...&lt;br /&gt;
*	More stuff you can specify.&lt;br /&gt;
&lt;br /&gt;
What we can easily elicit here is that enemies and players are one and the same. Therefore you can build a single class that handles both.&lt;br /&gt;
&lt;br /&gt;
Now that we have defined the entities and their attributes, let&amp;#039;s continue and examine what these entities can do.&lt;br /&gt;
&lt;br /&gt;
*	Attack&lt;br /&gt;
*	Defend&lt;br /&gt;
&lt;br /&gt;
Also (I won&amp;#039;t cover these here):&lt;br /&gt;
&lt;br /&gt;
*	Level up&lt;br /&gt;
*	Equip an item&lt;br /&gt;
*	Use an item&lt;br /&gt;
*	Cast a spell&lt;br /&gt;
*	Flee&lt;br /&gt;
&lt;br /&gt;
So, as a rule of thumb when creating a new object/entity identify what it &amp;#039;&amp;#039;is&amp;#039;&amp;#039; by it&amp;#039;s attributes then identify what it can &amp;#039;&amp;#039;do&amp;#039;&amp;#039;. The things I am not covering you can figure out yourself. Also some will be covered in specific battle system tutorials, for example the &amp;quot;Flee&amp;quot; behavior may use a speed value, and would be involved in a turn based system (it may not make sense in an action system). Attack and Defend are going to be fundamental to the example, so I&amp;#039;ll cover those.&lt;br /&gt;
&lt;br /&gt;
===The Interface===&lt;br /&gt;
The interface is an abstract class, more or less that helps you control the events of things. I&amp;#039;m going to write a generic interface for this battle system and I&amp;#039;ll extend it in further tutorials.&lt;br /&gt;
&lt;br /&gt;
The interface needs to hold data pertaining to the battle. It may contain:&lt;br /&gt;
&lt;br /&gt;
*	A list of players.&lt;br /&gt;
*	A list of enemies.&lt;br /&gt;
*	For turn based, the current turn.&lt;br /&gt;
*	For turn based, turn conditionals.&lt;br /&gt;
&lt;br /&gt;
The interface controls:&lt;br /&gt;
&lt;br /&gt;
*	Turns (if turn based)&lt;br /&gt;
*	Condition that player attacks&lt;br /&gt;
*	Condition that enemy attacks&lt;br /&gt;
*	The AI of the enemy&lt;br /&gt;
*	Menus for when entities use items&lt;br /&gt;
*	Menus for spells/abilities&lt;br /&gt;
*	Other menus...&lt;br /&gt;
&lt;br /&gt;
So, again, as you can see the interface controls how the battle is played out. And depending on how you implement the interface you can have whatever kind of battle system you want.&lt;br /&gt;
&lt;br /&gt;
==Implementation Phase==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Apollolux</name></author>
	</entry>
</feed>