Name: Portals
Summary: Core gameplay concept - provides spawning of creatures, estate/village management, travel, etc
Scope: Core Content
Current Goal: Iterate! Lots of little tasks, see below (and feel free to join in)
Phase: Implementation
Curator: Cervator + anybody else interested (open invite)
Related:#276, creature definitions, ...
GUIDE
There's a big design behind this one little word, some details scattered in assorted text files, some in old wiki pages, etc, and to not lose myself in administrative work I'm going to poke at this content feature now and then, sharing the design but keeping it optional as a mod rather than make people suffer through annoying indestructible purple cubes cluttering up their constructions
Immortius - after really trying to implement something from scratch with the ES available and the modding setup initially prepared - I am impressed. I had a hell of a time way back in the pre-ES days trying to make portals fancier in this hacked together half-implementation of Artemis I was playing with. This was a piece of cake after getting over the initial understanding. Make a couple components, a prefab, a subscriber system with an update method and an event system to make portal blocks clickable with 'e' and done! It practically worked on the first try (typo'ed some stuff, as expected). Thank you for your great work - I can't wait to see what serious modders can do with that one day
Summary: Core gameplay concept - provides spawning of creatures, estate/village management, travel, etc
Scope: Core Content
Current Goal: Iterate! Lots of little tasks, see below (and feel free to join in)
Phase: Implementation
Curator: Cervator + anybody else interested (open invite)
Related:
GUIDE
- Be sure to actually enable the new mod when creating a new world ("Mod" button)
- Mod provides the portal block which you can get with /giveBlock "portal" from the console
- New portals have been added that spawn different gellies. Try the "cyanportal" or "greenportal"
- Placed portals will start as Spawners that are listed as able to spawn different categories of Gelatinous Cubes
- In addition to plain GelCubes there are also "Hoppers" (that unsurprisingly are great at jumping) and "DangerCubes" - both these types are rather poisonous and will do bad things to the player if they get too close. Thanks Esereja !
- An assortment of differently colored GelCube prefabs are included and assigned to different Spawnable categories - any Spawner able to spawn them will do so
- There's a limit on total mobs that can spawn to keep the game from slowing down. The exact details are in flux but you can likely just keep placing portals forever, to still can grind the game to a halt if you wish!
- You can activate/deactivate a portal from spawning or not by pressing the activate key ('e') when targeting a portal block (but reactivation currently only creates an empty spawner so nothing spawns - bug). Also: "Bloop".
- Destroying a portal block also correctly cleans out the Spawner
- Note: There is a non-existent "creature" in the spawn list just to highlight what happens in that case via logging. Some spawn cycles thus spawn nothing.
Bundle existing portals and gelcubes into a mod instead of living in main sourceAllow prefabs to define themselves as Spawnable and/or Spawners (portal prefab as first Spawner)Tidy up logging some more (too much going to info)- Fix that re-attached SpawnerComponents are blank - they should grab some data from somewhere
- Figure out prefab parenting (plain gelatinouscube as parent of the chromatic and metallic gellies) to cut down on clutter in groups of prefabs
- Sort out the relationship between creature definitions and spawning / portals
- Enhance Spawners to include range, probabilities / speed of spawning - partially done
- Do more with the portals themselves, like multi-block options - for instance a plain portal block can only spawn basic gelcubes, add a frame around the portal and it can spawn advanced gelcubes
- This could lead to more use of blueprints, or the grammar system Skaldarnar prepared so fancy multi-block portals can be randomly generated / placed in the world
- Can we detect, for instance, a vertical portal frame for making chromatics and a horizontal portal frame for making metallics?
- Update spawn ticking (may depend on an updated / different flavor SubscriberSystem) - partially done
- Refactor the factory for GelCubes - may not truly be needed or may be able to support more generic entities instead - partially done
- Look at doing some color constants for the gellies
- (advanced) Hook portals into other game concepts (workshops, estates, creature helpers, etc)
- (advanced) Travel-based options to move between portals
- (advanced) Region-based options on world portals (relates to notes elsewhere)
There's a big design behind this one little word, some details scattered in assorted text files, some in old wiki pages, etc, and to not lose myself in administrative work I'm going to poke at this content feature now and then, sharing the design but keeping it optional as a mod rather than make people suffer through annoying indestructible purple cubes cluttering up their constructions
Immortius - after really trying to implement something from scratch with the ES available and the modding setup initially prepared - I am impressed. I had a hell of a time way back in the pre-ES days trying to make portals fancier in this hacked together half-implementation of Artemis I was playing with. This was a piece of cake after getting over the initial understanding. Make a couple components, a prefab, a subscriber system with an update method and an event system to make portal blocks clickable with 'e' and done! It practically worked on the first try (typo'ed some stuff, as expected). Thank you for your great work - I can't wait to see what serious modders can do with that one day
I have a few more passes to do before pushing this to our organization repo so I'm tinkering with it in my personal so I can rebase away some gibberish. The commit is here - fully functional, although there is a quirky bug.
So far I've just made it so placing a portal block in the world (get some with getBlock "portal") creates an entity that is both a Portal and a Spawner (and a BlockComponent, since the portal.json block definition links it to a portal.prefab). The portal part allows it to be clickable with 'e' to toggle whether the portal spawns GelCubes or not (by removing/adding the SpawnerComponent to the entity), the spawner part hooks into a subscription system that spawns a GelCube every 5 seconds.
Here's the weirdness - when you place a single portal, you end up with two entities with SpawnerComponents, so the spawning triggers twice. Clicking the portal with 'e' removes one spawner correctly, but the other entity is unaffected. I checked using /dumpEntities and the before/after follows:
After placing a portal:
Before placing a portal there's an entity purely with an ID and the portal prefab as a parent. When placed that entity looks to have a BlockComponent added (which I filter by - must be Spawner + Block to trigger spawning). In addition a brand new entity is created that also has a Location. Not sure what that's all about but I figure only the second is a valid world object with the first some sort of phantom. Any ideas?
Final bonus round question: Can we load sound assets out of mod dirs yet?
So far I've just made it so placing a portal block in the world (get some with getBlock "portal") creates an entity that is both a Portal and a Spawner (and a BlockComponent, since the portal.json block definition links it to a portal.prefab). The portal part allows it to be clickable with 'e' to toggle whether the portal spawns GelCubes or not (by removing/adding the SpawnerComponent to the entity), the spawner part hooks into a subscription system that spawns a GelCube every 5 seconds.
Here's the weirdness - when you place a single portal, you end up with two entities with SpawnerComponents, so the spawning triggers twice. Clicking the portal with 'e' removes one spawner correctly, but the other entity is unaffected. I checked using /dumpEntities and the before/after follows:
Code:
{
"id": 1725,
"parentPrefab": "portals:portal"
},
{
"id": 1724,
"BlockItem": {
"placedEntity": 1725,
"blockFamily": "portals:portal"
},
"Item": {
"icon": "",
"stackCount": 16,
"container": 3,
"name": "Portal",
"baseDamage": 1,
"usage": "ON_BLOCK",
"renderWithIcon": false,
"consumedOnUse": true,
"stackId": "block:portals:portal"
}
},
{
"name": "portals:portal",
"persisted": true,
"Portal": {},
"Spawner": {}
}
Code:
{
"id": 1725,
"parentPrefab": "portals:portal",
"Health": {
"regenRate": 2.0,
"timeSinceLastDamage": 0.0,
"currentHealth": 3,
"maxHealth": 3,
"waitBeforeRegen": 1.0,
"fallingDamageSpeedThreshold": 20.0,
"partialRegen": 0.0,
"excessSpeedDamageMultiplier": 10.0
},
"Block": {
"position": [
9,
171,
5
],
"temporary": false
}
},
{
"id": 1724,
"BlockItem": {
"blockFamily": "portals:portal"
},
"Item": {
"icon": "",
"stackCount": 15,
"container": 3,
"name": "Portal",
"baseDamage": 1,
"usage": "ON_BLOCK",
"renderWithIcon": false,
"consumedOnUse": true,
"stackId": "block:portals:portal"
}
},
{
"id": 2854,
"parentPrefab": "portals:portal",
"Health": {
"regenRate": 2.0,
"timeSinceLastDamage": 0.0,
"currentHealth": 3,
"maxHealth": 3,
"waitBeforeRegen": 1.0,
"fallingDamageSpeedThreshold": 20.0,
"partialRegen": 0.0,
"excessSpeedDamageMultiplier": 10.0
},
"Location": {
"position": [
9.0,
171.0,
5.0
],
"scale": 1.0,
"rotation": [
0.0,
0.0,
0.0,
1.0
]
},
"Block": {
"position": [
9,
171,
5
],
"temporary": false
}
},
{
"name": "portals:portal",
"persisted": true,
"Portal": {},
"Spawner": {}
},
Final bonus round question: Can we load sound assets out of mod dirs yet?