'Under Siege 2'
Modular Sci-fi Environment
Under Siege 2
Обработка видео...
Contents:
1. Overview
2. Setup
3. Simple Gameplay (Principled)
4. Turret Fire
5. Ground
6. Drill
7. Dropper
8. Dropper's spawner, drills limit
1. Overview
'Under Siege 2' is a modular constructor (with gameplay) for creating cyberpunk sci-fi environments: station-like, tech fly islands-like etc.
Includes:
● modular sci-fi grounds;
● drill model;
● dropper (ship) model;
● 1 type animated turret (models);
● dropper gameplay: fly, search target (ground), drop paratroopers (drills);
● drill (robot) gameplay: fly, search target (ground), ground 'drilling';
● turret gameplay: search target, aim, fire;
● turret setup: fire rate, aim time, search radius (via response area);
● bullet gameplay: target hit;
● bullet setup: fly speed, damage;
● explode effect (particle based);
● drill spark effect (Unity default particle based);
● dropper, drill setup: fly speed, health (armor), damage power;
● realized gameplay a: turret fire -> enemy hit -> enemy destroy;
● realized gameplay b: find ground -> drop drills -> drilling ground;
● enemy spawner;
● utilized Unity engine physics;
● textures 4K;
● 100-5000 tris.
2. Setup
- 3d template (not Hdrp, not Universal) via Unity Hub with postprocessing effects out of the box:
- open demo scene;
- hit play.
- any other template (SRP's):
- select all materials in Materials folder, click Edit > Render Pipeline > Upgrade selected materials to your SRP;
- add default postprocessing module for your SRP;
- open demo scene;
- hit play.
3. Simple Gameplay (principled)
In order to make gameplay (out of the box) you should:
- Drag and drop to your own scene prefab ground tile 1 and ground pillar 1, stored here: \UnderSiege2\Prefab\Ground (we use these prefabs for test)
- Put ground pillar 1 on ground tile 1, something like this:
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/186fce61133279870687827c8bde2ca4.png)
- Make new empty gameobject (Ctrl+Shift+N)
- Add component USBTraffic on it:
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/3dc68d4300f862cf1b47a9cd0d2d35d7.png)
- Add drill spawner ship (Dropper) prefabs from \UnderSiege2\Prefab\Vehicles to vehicle array variety
- Right click on created gameobject - create empty:
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/b4e8fd24cb1f58f9ca762f958152f96b.png)
- Adjust direction for new (child) gameobject. Make sure this gameobject directs to tile and pillar prefabs.
- Something like this:
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/6e7626bb2a7ab03a1cde54c79397b22a.png)
- Principled action ready. Hit play for preview.
4. Turret Fire
Turrets system is a part of 'Under Siege 1' package - included in 'Under Siege 2':
- 'Under Siege 2' contains only 1 turret;
- See chapters 3, 4, 5 of 'Under Siege 1' documentation to setup:
5. Ground
Ground system uses Unity engine physics
- Note: RigidBody for ground entity created automatically on play mode;
- Note: For your own ground entity you should add collider and USBGround.cs script on your model;
- Note: layer of any ground prefab must be = 'Ground Layer' field of 'drill' prefab (see next chapter);
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/41ce9e0c5dbde214365a422cad19386a.png)
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/6826cc7947d9c79333d682490e134c0b.png)
- Ground Health - health / armor for current ground;
- Ground Mass - mass param for ground; this param used by physics engine via rigidbody;
- Damage Radius - param for 'drill'. When 'drill' becomes inside this radius it will start damage current ground. Use VisualizeDamgaeRadius checkbox to visulaize radius for setup (USDamageRadiusVisual.cs script attached to ground);
- Habitat Radius - something like 'life radius' for ground. Any ground prefab will be erased from scene after exceed this radius (for performance). By default It happens after eating by 'drill';
- Affect Gravity - uncheck this flag for all grounds used for 'stand, base, holders' on start play mode; check this flag for any 'free-falling' ground entity;
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/6b7266b121ca30563a304067edd4967e.png)
6. Drill
Drill system uses Unity engine physics
- Note: for your own model as 'drill' you should add collider, rigidbody (without gravity), USEnemyShip.cs and USBDrill.cs scripts
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/6ab14281e700a40b0ce5d5356fe0cb66.png)
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/e0699ac0d9135fcce6d996c5d6b7dcf9.png)
- Ground Layer - layer for target (ground entity);
- Speed - drill speed (speed param on USEnemyShip.cs is not affected);
- Damage - drill's eating power;
- Detect Radius Def - small radius for current drill (near ground targets);
- Detect Radius Big - big radius for current drill (first target search, long-range ground search)
- Note: Drill layer must be = turret bullet layer for interaction (also see bullet prefab);
- For more information about bullet see 'Under Siege 1' documentation
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/60ed6aa609cfd0ed30efaa6b272d494e.png)
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/f5c53eef9d7043c5e4e0d009de290aa5.png)
7. Dropper
Dropper ship is a drill's container or landing ship; It works once per its life: drops drills to ground
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/743fb5b21315e0a69e201e7c30349001.png)
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/501ed52c196668f6d616aae086f6c1dc.png)
- Ground Layer - layer for target (ground entity);
- Detect Radius - search radius (ground entity);
- Detect Ground Rate - search radius (ground entity) refresh rate;
- Exclude Zero Child - tick this flag for your own models in case your mesh is child0 gameobject (means child0 not a drill spawn point)
- Note: for your own models make any count of children gameobjects for your Dropper; each child gameobject = spawn point for drill landing; count of children gameobjects = count of drills for current Dropper
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/13e8a4d50820a73a3c2a55297571784b.png)
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/60a267540cefae03bf5edea4ae313d12.png)
8. Dropper's spawner, drills limit
- Max Droppers Count - max count of Droppers in current scene;
- Max Drills Count - max count of drills in current scene;
- Max Drills Prtcls - max count of sparks effects for drills in scene;
- Min/Max Spawn Interval - in seconds; for Droppers only
![](/uploads/s/l/z/9/lz93umvg89z0/img/autocrop/99fda69b38e15086933c52e7e30335f8.png)