Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

remove some inaccuracies in HACKING

  • Loading branch information...
commit b937489f2d5c9139e9bce15c7b5a26c66e7040ad 1 parent 0bc427c
Chris Forbes chrisforbes authored

Showing 1 changed file with 7 additions and 19 deletions. Show diff stats Hide diff stats

  1. +7 19 HACKING
26 HACKING
@@ -3,7 +3,7 @@ HACKING
3 3 There are n main sections to OpenRA: UI, Rendering, unit behaviour, ...
4 4
5 5 All units/structures/most things in the map are Actors. Actors contain a collection of traits.
6   -Traits consist of an info class and a class that does stuff
  6 +Traits consist of an info class and a class that does stuff. There is one instance of the infoclass shared across all actors of the same type. Each actor gets its own instance of the trait class itself. Infoclasses are responsible for instantiating their corresponding trait class -- see ITraitInfo, and TraitInfo<T> for the trivial implementation of this. In some cases the trait class's constructor needs some args, in which case TraitInfo<T> can't be used. This is a limitation of C# generics.
7 7
8 8 Actor assembly is done via the mod's yaml files. A section exists for each actor type,
9 9 and within that section we list the traits the actor should have.
@@ -15,13 +15,10 @@ which are automatically loaded into the corresponding fields on the trait's ITra
15 15 as possible - all cross-trait references should be in terms of an interface from
16 16 TraitInterfaces.cs.
17 17
18   -- Things an actor can be *doing* are represented as IActivity implementations.
19   - Actor has a queue of these. There's a standard set of activities in
20   - OpenRa.Game/Traits/Activities, and mods tend to define more as they need them. (RA
21   - defines various special-infantry actions as activities).
  18 +- Things an actor can be *doing* are represented as Activity subclasses.
  19 + Actor has a queue of these. The standard set of activities are in OpenRA.Mods.RA/Activities. Ground vehicle movement is more complex, and has bits in OpenRA.Mods.RA/Move. Aircraft use different bits again, in OpenRA.Mods.RA/Air. There are some bits elsewhere for custom infantry behaviors, etc. In some cases, a trait or activity will maintain an internal subqueue of activities. This works exactly the same way as the actor's main activity queue -- its state is evolved by Util.RunActivity().
22 20
23   -- Units offer orders they can perform (given context) through traits that implement IIssueOrder.
24   - Every trait with this interface is given a chance to generate orders for the current context.
  21 +- Units offer orders they can perform (given context) through traits that implement IIssueOrder. There are two parts to this -- an Orders collection, which exposes IOrderTargeter objects, which describe orders that the actor *could* generate, and the rules for choosing which to perform when the "default action" button is pressed (RMB). The second part is IssueOrder() itself, which resolves an IOrderTargeter into an actual order object to be sent.
25 22
26 23 - For more complex things that require modal UI (like special abilities,
27 24 RA-style sell/repair buttons, etc) we have IOrderGenerator implementations. This can
@@ -52,19 +49,13 @@ containing art assets (typically .mix files), yaml files defining actor defintio
52 49 and ini files containing legacy information that have yet to be ported over to
53 50 the (relatively new) yaml system.
54 51
55   -The unit artwork itself must be defined in a Sequences file (typically Sequences.xml;
56   -check mod.yaml for a list of what the mod uses); the format is self explanatory. There is
57   -also the SequenceEditor tool to make this easy.
  52 +The unit artwork itself must be defined in one or more sequences files. These are specified in the manifest. RA puts everything in mods/ra/sequences.yaml.
  53 +check mod.yaml for a list of what the mod uses); the format is self explanatory.
58 54
59 55 Chrome artwork is similarly defined in Chrome.xml. Chrome is already mod dependent. Sortof ;)
60 56 mod-dependent *behavior* would be nice too, not just skinning. This is a property of the traits
61 57 however; once we port UI into traits this will become a non-issue.
62 58
63   -Rendering
64   -OpenRa.Game/Chrome.cs is the user interface.
65   -Three renderers (SpriteRenderer, LineRenderer, Rgba?Renderer) render most stuff. Don't forget
66   -to flush the renderer (if you want to see anything).
67   -
68 59 UserSettings stores the data loaded from settings.ini (or defaults). Eventually we need to be
69 60 able to save values changed in game into settings.ini (not yet implemented)
70 61
@@ -74,14 +65,11 @@ We also have a website at http://www.open-ra.org/ .
74 65
75 66 Our IRC channel is #openra on irc.freenode.net .
76 67
77   -As far as using git, get your own repository on github. You probably want to set up the gitbot
78   -to spam irc when you make commits (its nice to know). Push your changes into your git
79   -repository, and it will/might :P be merged into http://github.com/OpenRA/OpenRA .
  68 +As far as using git, get your own repository on github. Push your changes into your git repository, and it will/might :P be merged into http://github.com/OpenRA/OpenRA .
80 69 See http://help.github.com/ for working with GitHub and see http://progit.org/ for working
81 70 with Git.
82 71
83 72
84   -
85 73 Other things we probably want to put in here:
86 74 - A guide on how to add a generic unit via yaml using existing traits
87 75 - and then introduce some element that requires a simple trait change.

0 comments on commit b937489

Please sign in to comment.
Something went wrong with that request. Please try again.