Skip to content

Thang Component System

Scott Erickson edited this page Aug 31, 2017 · 2 revisions

CodeCombat uses something like an Entity-Component-System architecture (read more), which is different from an old-school object-oriented game engine. The gist is that Entities are just pointers, and you compose them out of a bunch of Components which encapsulate data, and those are organized by Systems which add behavior and make the world tick.

But instead of "Entities", we call them "Thangs", since ain't no one got time for such a long, boring, irregularly pluralizable words as "Entitity". I mean, "Entity." (See?) So it's a Thang-Component-System architecture instead.

Configuring the Tharin Thang with some Components

Thangs live inside Levels, where they are configured with Components, and the levels are similarly configured with Systems. In addition to Components, Thangs point to ThangTypes, which hold all the art and sound information needed to display them--but ThangTypes have no impact on the Level's World simulation itself. You can make all the Ogres look like trees and they'll still crush the human soldiers--it'll just look hilarious when you go to play the level. For details, check the full article on Thangs.

The other big difference is that our Components include behavior. Lots of behavior. In fact, most of them are mostly behavior. Components copy their properties to their Thangs when attached, and some of these properties are methods. The Components all live in the database, so you can code them right from within the Level Editor--how cool is that? For details, check the full article on Components.

Systems are unto Levels as Components are unto Thangs--also containing configuration data and methods, also live-editable from within the Level Editor. See the full article on Systems.

Clone this wiki locally