SDK
Learn what data structures you can create with our tool
Game Mechanics
Quest
Reward
Specifies the number of assets to be granted to the user atomically as a single pack. Can be given by the game engine either as a result of crafting, advancing battle pass, etc.
reward = Reward("level_clear_reward")
reward.add(GEMS, 5)
reward.add(GOLD, 1000)
reward.add(item, amount)"item" can be either:
1. Instance of BaseData subclass created with BaseData.define, and denotes some indistinguishable asset (gold, gems, blueprints etc whatever game design supposes)
2. DataModelTemplate instance
Progression ladder
The progression ladder is an implementation of "upgrade something" game mechanics. To create a progression ladder for DataModel one should call ProgressionLadder constructor.
Its arguments are:
Entity - subclass of DataModel. Model to which we should add the ladder
IsExperienceBased - we have ladders of two types. When
IsExperienceBasedis False then to upgrade the entity to the next level you should pay someCost. Otherwise generated ladder is based on the difference between experience value levels.LevelField - Name of level field in entity. Optional, "Level" by default.
ExperienceField - Name of experience field in entity. Optional, "Exp" by default.
LadderLevelData - subclass of BaseData. Contains per-level specific static data. During code generation will be augmented with Exp, Reward, and Cost fields.
Battlepass
Tournament
Craft rule 🔨
The game engine supports crafting as a first-class primitive. "Crafting" in terms of HyperEdge is exchanging a set of assets of certain types for other assets set.
Items to be spent are added to require call. Items to be granted add with produce call. Internally CraftRule has Reward and Cost instances and require is Cost.add method call and produce is Reward.add respectively
Cost 💲
Specifies the amount of assets to be spent to buy/craft/burn/etc to perform some action according to game logic
The item can be either:
- Instance of BaseData subclass created with BaseData.define, and denotes some indistinguishable asset (gold, gems, blueprints, etc.)
- DataModelTemplate
Energy
Inventory
Auxiliary Models
BaseData
BaseData — represents virtually any static chunk of data in a game from text descriptions to power levels, damage amounts, and experience ladders.
To create instance (*warning*: don“t directly call constructor of BaseData subclasses it will skip all necessary bookkeeping) use define call. All fields except those specified with optional_field should passed to the constructor. Also special parameter id should be passed which should be:
- lowercase
- contain only alphanumeric and underscore
- should start with a letter
Also as a convention, if there's Name field defined it'll be used automatically if id is omitted. Name will be split by space, then all parts will be converted to underscore if they contain CamelCase, then converted to lowercase and joined by underscore
Structures will be generated for this class. DataRef is a special type to reference instances of some other BaseData. In code, it will be represented by type-safe enumeration containing all instances of that enumeration. All data instances are serialized into GameDb table
DataModel
Represents virtually any dynamic data model in a game from heroes, equipments with upgradeable levels, and stats to some per-player scores. As in an example we can use different field types. A set of APIs and structures is generated for DataModel. All models are per-user and belong to her.
By convention Data is a special field that refers to the model's static data or meta. It is handled in a special way by the code-generation backend. There“s a special class DataModelTemplate which represents all data models initialized with certain BaseData subclass instance.
Handler
Handlers are used to express any server-side game logic. Handler class constructor takes 4 parameters:
Name - name of the request handler, should be valid C# method name
RequestClass - subclass of
_BaseModel. C# structure of the same name is generated for this model.ResponseClass - subclass of
_BaseModel. C# structure of the same name is generated for this model.Code - valid C# code for handler method body (only function body). It gets
reqparameter of the type generated forRequestClassparameter and should return an instance of the structure defined byResponseClass. This parameter is optional during construction ofHandler, as it is more convenient to initialize it later.
Storage
Last updated