- Character specification to use
- Area in which the CCS is found
- Scaling mechanics for assigning a character to a starting area after creation
- Invoking a character creation GUI for the user
- Name validation
- Changing the character specification for a character (for example, swapping from human_female to elf_male)
- Issuing appropriate events to the client system node
What problem(s) does this solve?
- Known pattern for extension of the system (a system node)
- Common game-specific functionality is easily implemented by overriding the appropriate method
- Reduces, but does not eliminate, the need to implement game-specific code
What problem(s) does this not solve?
- Does not implement your game's character creation GUI
The CCS is both Client and Server System Nodes
The $CHARACTERCREATIONSYSTEM implements an interface on the client through which GUIs may communicate with the server system node to execute code in permissible ways. Both system nodes may be extended individually, allowing each side to be overridden as needed replacing individual behaviors without requiring the implementation of a whole system.
The CCS Area is Registered as a "System Area" with the World
One of the scalability features of the CCS is that it registers, when enabled, the CCS area as a System Area which provides access to some types of data that are normally only available at the World Server. Specifically, this means area data (which area instances are currently up).
Adding game-specific functionality
As a required class/script, it is not permissible to make changes to the _characterCreationSystemClassMethods script. Instead, extension/overriding the script is accomplished by the creation of a game-specific class (and class methods script) that is GLOMmed onto the CHARACTERCREATIONSYSTEM prototype.
- Create a new class
- Create a class method script for the class
- GLOM the class onto the prototype
Create a game-specific class
Using the DOM Editor create a new (server|client) class. Our recommendation is that you use a class name that incorporates the _characterCreationSystem as a suffix to the name (ex. HJ_characterCreationSystem), this makes it easier to locate the pair of classes (the required script prefixed in _characterCreationSystem and your game-specific class).
Once you have created the game-specific class, create a new client class methods script for that class.
Adding a game-specific class
Adding your game-specific class to the CHARACTERCREATIONSYSTEM prototype is achieved using the System Node Configuration GUI or the CLI server command \mpac or client |mpac in the Console Panel. The System Node Configuration GUI is the preferred method because it handles the communication to update any instantiations of a system node to reflect the changes you have made.
Using the System Node Configuration GUI
Opening the System Node Configuration GUI requires you to access the hidden Utilities Interface toolbox, located in the top left corner of the render window with
ctrl-shift-click (or press
F5), which will open the Interface. On the Tools tab within the menu, is an option to open the System Nodes Configuration GUI.
See also: Adapting Clean Engine
Using the CLI
It is important to recognize that modification of the prototype from which a system node is instantiated will not update any instantiations that have already been made in various local GOMs. That means your changes will not take effect until the area (in the case of server system nodes) restarts, or the client (in the case of client system nodes), restarts.
\mpac CHARACTERCREATIONSYSTEM, hj_characterCreationSystem;
|mpac CHARACTERCREATIONSYSTEM, hj_characterCreationSystem;
Disable the CCS
If you do not want to take advantage of the CCS, or have implemented an alternate system that has not yet been adapted to using the CCS, you can easily disable the entire system by implementing the method described below in a game-specific override class that is GLOMmed onto the server system node.
method HE_CCSEnabled( enabled references Boolean ) as Boolean // Globally enabled/disable the CCS system // To disable the CCS system: enabled = false return true .
Change to a game-specific Character Creation GUI
The CCS launches the character creation GUI in a method on the client system node. What kind of GUI to launch is easily overridden by implementing the following method in your game-specific class on the system node.
method HE_CCSInvokeGUI( args as LookupList indexed by String of String ) as Boolean // Used by $CHARACTERCREATIONSYSTEM // // Used to invoke the character creation GUI. The args passed in are the args that where passed // to the client system node by the _CCSInvokeGUI method on the server node which could be extended/overridden // by implementing the HE_CCSInvokeGUI method on the server and adding whatever data is needed to a remote call that // the override makes to the client system node. // // return true to indicate you handled everything ie popped up your game-specific GUI return false .
Specify a game-specific area for the CCS
By default, the CCS uses a Clean Engine area named HeroEngine_CharacterCreation. As soon as your designers have created your game-specific character creation area, you will want to implement the method below to specify that area. The CSS (Character Selection System as opposed to Character Creation System) has built-in scalability. This functionality allows it to select an instance from those of the CCS Area currently running, in order to send a user there for character creation. This too may be overridden on the CSS system node.
method HE_GetCCSArea() as ID // Used by $CHARACTERCREATIONSYSTEM return <YOURCHARACTERCREATIONAREAID> .
Specify a game-specific starting area
Once a character has been created, it is sent by default to a play instance of the Clean Engine area HeroEngine_StartingArea. This should eventually be changed to your own game-specific starting area. So as soon as your designers have created your own game-specific starting area, get the Area ID of that area, and then implement the method below in order to specify that area:
method HE_GetStartingArea() as ID // Used by $CHARACTERCREATIONSYSTEM return <YOURSTARTINGAREAID> .
Specify an Instance
Though the starting area has been specified, it may also be necessary to specify which instance of that area that a new character will be placed into. By default, Clean Engine puts each new character into a random play instance of the starting area. To modify this behavior, implement the method below to specify the instance to which a player should be sent.
The _CharacterSelectionSystemClassMethods has two examples of ways you might potentially want to implement your game-specific selection of the target instance number. These are located in the methods _CSSSelectCCSAreaInstance and _CSSSelectLastAreaInstance.
The CCS area, when enabled, is registered with the world as a System Area and consequently has access to world knowledge about areas (including which area instances are up). The $WORLD system node can be used to determine the list of currently running instances.
method HE_GetStartingInstance() as ID // Used by $CHARACTERCREATIONSYSTEM return 0 // If a 0 is returned, it means to put the character into an edit instance .
Specify the default Character Specification for _CharacterAppearance
By default, the character specification used for newly created characters is determined by the (server) CHARACTERCREATIONSYSTEM system node, which has the method _CCSUseCharacterSpecificationForVisibleCharacter. The default value in Clean Engine is character_sample.
Shortly after your art team has completed their first character model, they are going to want to you swap from the Clean Engine default to your game-specific default character specification. To specify a different character specification that should be used by default for new characters, implement the method HE_CCSUseCharacterSpecificationForVisibleCharacter in your game-specific class methods script for the (server) CHARACTERCREATIONSYSTEM system node.
method HE_CCSUseCharacterSpecificationForVisibleCharacter( character as NodeRef of Class character_class, characterSpecification references String ) as Boolean // Used by $CHARACTERCREATIONSYSTEM // // characterSpecification = "GameSpecificCharacterSpecificationName" return true .
Request a new character type for _CharacterAppearance
If all you ever needed was a single model, then changing the default as detailed above would be sufficient. However for most games the user has the option of choosing a gender for their character (and perhaps even a different race). This requires that the GUI be able to request the server to change the _CharacterAppearance character type. This is done using the (client) CHARACTERCREATIONSYSTEM system node's _CCSRequestSetCharacterType method.
// Assume the GUI is created from a class that inherits obsListener // // me = The GUI $CHARACTERCREATIONSYSTEM._CCSRequestSetCharacterType( "GameSpecificCharacterType", me )
- $CHARACTERSELECTIONSYSTEM - Players are sent to the CCS by the Character Selection System.
- Adapting Clean Engine - Detailing the replacement/extension of clean engine via game-specific classes and the GUI created for that purpose.
- Connection Logic - Details the logic that runs when a character connects/logs in.
- System Nodes - Primary mechanism for enabling the extension/overriding of the required Clean Engine implementations and a game-specific implementation of a licensee.