A commercial real-time strategy game project, that uses BabylonJS to run on WebGL. The project is open for community advices and contributions!
All flags are listed in config/Types.js
Every ruler (Human, AI) can be assigned to a party, that plays a certain role in the game. The supported roles are Attacker, Defender, Neutral or None. None is used for obstacles e.g. resources, in contrary to a Neutral party that can be attacked.
Capture the Flag on spawn can be colorized by HighlightLayer or GlowLayer per party.
You can spawn (reinforce) at conquered spawn i.e. spaceship drops ground infantry or vehicles. The projection will be red if out of spawn range.
Create custom resources, that can be collected by workers and refactored by industry.
Planar foundation can be moved by mouse pointer and indicates when obstacles are intersecting by red or green color. Additionally it is possible to upgrade the level of a building.
The barracks allows to queue unit hirements.
Hover, Walk (Animated), Tracked (Dynamic UV Scaling), Flying
Idle, sprint and attack of unit is supported.
Create custom hardpoints to interact with parts of entities. An hardpoint can also be an attached model e.g. individual turrets on a spaceship. The name of the entity's main hull is expected to be 'M_H'. Hardpoints can be interactive (targetable) or not (w/o GUI). They can even be weapons i.e. turrets that aims and attacks seperately. The preview Selection Focus.
The supported types are Rectangular and Circular.
Pathfinding is realized by RecastJS, where NavMesh is created out of ground mesh. Furthermore, static entities can be added as obstacles and dynamic entities are grouped in crowds as agents. The navigation allows entities to go around each other.
The Command System offers the following commands: Move, Attack, (Re-)Gather, Craft, Patrol, Follow, Skill
All life entities got health and optionally shield. The health can be healed or repaired, while the shield charges up.
Auto-Detection of enemy entities in unit detection range as target, to auto-attack. Also parts of a entity can be locked as subtarget. Auto-Detection is skipped when Attack command is active.
The hardpoints of an entity aims automatically i.e. rotate turret and barrel towards the target and validate if projectile would cross target body.
Create multiple SolidParticleSystems. Each consisting multiple SolidParticleGroups to set custom projectiles and behaviours. The projectiles are buffered by groups to prevent performance loss in large battles.
Targets in weapon range will be attacked. The damage caused can be of different type i.e. physical that does not interact with the certain shield.
Infantry entities use death animation to fall over and structure entities can smoke, burn, explode partly and explode as a whole.
The camera can be moved by arrow keys and WASD. Rotation is apllied by EQ. The mousewheel can be used to zoom in or out. Edgescroll. The CameraSystem offers swingTo(position), to transition camera position towards given position.
The research building allows to upgrade technology, that affects damage, health and shield.
Skills can be melee e.g. whirlwind, heal or buff. While other skills are ranged i.e. physical or magical projectile. All skills are applied on area of effects.
A hero can obtain experience to increase its level, while leveling difficulty can be adjusted. The higher leveling-property of GroundSystem the slower experiencing is in general. While the levelingEnd-property reduces a low level kill experience. The required experience value of a level is determined by the heroDifficulty-property. The stats are strength, affinity and agility. The strength affects physical damage, affinity modifies magical damage and heal. While agility is multiplies to attack speed. The hero system also allows to switch to RPG game mode using a 3rd person camera and controller.
The combos make game flow into an action combat game.
Creates Ground from Heightmap as Space or Terrain and can inherit obstacles i.e. trees and rocks. Set custom constants, onMatchStart() and onMatchEnd(winnerParty). Supports TerrainMaterial and MixMaterial.
Single selection via left-click on entity, i.e. unit, building or obstacle.
Draw rectangle to select multiple groups / entities.
smoke.webm
fire.webm
Management of ParticleSystemSets e.g. smoke, fire, explosion
Set custom data for supported languages, i.e. UNIT1 to name unit of id 1. Can be accessed via Languages.EN.UNIT1.
Set custom menu i.e. title, buttons and structure.
Set custom entity info mask providing image source, text string and rgb color.
The pad allows to craft building or hire units. The queue can handle different entity types.
health bars i.e. shield and health above entity.
Supports custom tooltips.
Visual queue progress for i.e. crafting and hiring.
The isVisible-property of unallied entity roots is set by detection ranges of controlled entities.
The minimap is attached to camera position and camera rotation visualized by marker icon rotation. Click on map to swing camera to world position. Create SVG, paths as custom icons for individual entities. Use mouse wheel (scroll) to zoom in or out. Can be used to command entities. Support dynamic, static and grouped entities.
Centralized GUI and convenience settings.
Concerning materials are frozen to reduce shaders overhead. All world matrices of static entities are frozen to reduce world matrix computation. Materials and meshes are instantiated or cloned to reduce draw calls. The stencil and depth buffer clearing is skipped to reduce OpenGL clear calls. Animation ratio is used to flatten the frame rate differences. The material dirty mechanism is blocked to avoid bottleneck when various materials are used. A map of geometry ids is used to speed-up the addition and removal of Geometry in the scene. After a match ends on disposing of all meshes the active meshes and rendering groups are blocked to speed-up the removal.
Options:
- skipPointerMovePicking can be set to spare scene to pick on pointer move, though the health bars won't be shown on hover.
- onlyDetectedVisible can be set, so visibility is determined by detection range.
- Pathfinding issues if building and unit size relation too great
- 3rd Person Character Control
- Skill movements by animation frames
- Skill damaging by animation frames
- Skill Effects
- AI
- Fog of War