Garbage Country Logbook 2018 pt.3
- Intro
- Logbook 2017
- Logbook 2018 Part 1
- Logbook 2018 Part 2
- Logbook 2018 Part 3 š You are here.
- Logbook 2019
- Gallery
Week 40
First day of October. First day of new logbook because the old one was getting sluggish in Typora. Must be all the GIFs.
Durability
I have to add a durability system I guess. What are the requirements for this?
- Creep affects durability in a deterministic and predictable fashion. Durability decreases at a maximum rate regardless of how much creep is attached.
- Durability objects are updated on a slow timer that applies the capped accumulated damage. That way, only a maximum of damage is applied each tick (perhaps 5 minutes or so)
- Blocks that are cleared of creep are repaired completely. Removing creep is the only maintenance required, no additional repairing is needed.
- Falling debris damages blocks, instantly affecting durability. Damage is automatically repaired over time (like above).
- Debris keeps a list of affected objects to prevent dealing damage to the same object twice.
Tasks For Playtest
Ā | Time | Prio | Ā |
---|---|---|---|
Core Game Loop | 1 week | High | Winning? Death? Points? |
Core Game Loop Design | 2 days | High | Ā |
Interface / Controls | 1 week | Medium | Improve build mode UI, Cursors |
Graphics | 1 week | Medium | Fog Lighting, Day/Night Cycle |
Additional Mechanics | 1 week | Medium | Durability Rubble |
Content | 1 week | Low | Additional Plants Objects |
Polish | 1 week | Low | Particles TransformUpdater interpolation |
I wrote down the tasks and split them out to figure out how much time they would cost. I hope that will keep me focused until I can launch a playtest at the end of November.
I finished an ECS system that updates the durability of objects and destroys them if the damage reaches a certain threshold. I also did a quick pass on a system for loading in the Config dynamically from a web url instead of always having to do a recompile. Not exactly essential but I think it will save me some time (over time).
Throwing objects works but looks pretty shitty because of the latency between object creation and the actual throwing:
Week 41
Made some 3d models for the splat plant. Quite cool to see it grow:
Cutting a plant should be able to yield a bunch of objects. This does mean that cutting the root will again need to iterate over every node to spawn objects. š ātis done.
Trying to decouple the plants from SpatialOS to allow a little test unity scene where I can iterate on the plant design. Created a PlantCore
class that encapsulates this functionality that will be used by the Network Sender / Receiver classes.
Possible methods for selecting a socket + template for a new node:
- Keep a list of open sockets every time a node is added or removed:
- Added: add child sockets
- Removed: Remove child sockets & add this socket
- Do a full scan for sockets periodically (when successfully added)
- add address/type tuples
- select one randomly from list
How to track the sockets:
- Keep list of socket addresses, check for templates when selected
- Keep a nested structure, for each bucket track sockets
I just need to add a little method for applying durability damage to surfaces.
- Plant can keep a list of surfaces that it touched when growing, those shouldnāt really change.
- PlantSender can iterate over list and apply damage.
- āļø Actually this is problematic because the durability damage is defined per node not globally.
- Could store the max damage while building the buckets. Damage is capped anyway.
- āļø Actually this is problematic because the durability damage is defined per node not globally.
Okay, implemented weird bucket system.
Week 43
Did some research on writing a shader that would be able to coat objects in a paint.
- https://connect.unity.com/p/getting-light-information-with-a-custom-node-in-shadergraph
- https://connect.unity.com/p/zelda-inspired-toon-shading-in-shadergraph
Improving the building to be more intuitive. Code wise I think I have to structure it as follows.
- Some method takes two points (
start
andend
) and always shows a preview as if you dragged fromstart
toend
.end
can be a real point or a point projected on some plane from the view ray. The steps to call this method are- Determine
start
from the hover (Either ray hit point or pillar top) - When button not pressed:
end == start
- when button pressed:
end
can be either- the actual hovered point (or pillar top)
- the view ray projected on some plane
- Horizontal plane for floors
- A view-aligned plane for pillars
- Determine
- Appropriately clamp the block size.
Ā | top anchor | slide axis | target bottom point |
---|---|---|---|
drag to air | clicked point snap | clicked point snap | project on plane perpendicular to slide axis |
drag up | hover point | hover point | clicked point |
drag down | clicked point | clicked point | hover point |
Week 44
Started with giving the playerās poncho some random colors. This really needs more work to look nice, but at least it will for now distinguish players from each other.
I also fixed a bug that would prevent plants from growing on soil boxes.
Made some rubble models for when buildings fall apart.
Today Iām updating the GDK to the newer version so I can dig into the terrain again.
I have to fix up the HUD code a bit to be able to add new visualisations for interaction.
- If the HUD highlights an object, and then switches state to another object, the first highlight wonāt be removed.
Week 45
Over the weekend I started on rewriting the SpatialOS Entity Template system to something more streamlined. Should make creating new object types (like the rubble from previous week) more focused in a single place. Mostly done with the core system, but I donāt think I can migrate the data neatly from the old system.
- Some loose ends remain on the technical front
- Fix the āItemSceneā script to lay out all Mesh Definitions
- Make Plants use Mesh Definitions instead of internal fields for mesh/collider size
- Make a button to create a EntityDefinition from a Mesh Definiton. That will focus activity more on the visual editor
- Then I have to create the actual entities
- Create Mesh definitions for:
- Bamboo Seed.asset
- Cement Bag.asset
- Plastic Barrel Soil Container.asset
- Plastic Barrel.asset
- Plastic Crate Soil Container.asset
- Plastic Crate.asset
- Splat Fruit.asset
- Tire Soil Container.asset
- Tire.asset
- Vine Seed.asset
- Wood Planks.asset
- Wood Soil Container.asset
- Create Mesh definitions for:
Made some progress on generating entity definitions for all objects. The engine canāt USE them yet though.
Tue: Hooked up everything into SpatialOS and itās running again now. Didnāt add a single feature but this will take away a lot of friction in the future.
Wed: Okay, small issue. The blocks canāt really alter their behaviour when moving, because their rigidbodies are kinematic, because the real movement is done by a proxy. I can fix it but I have to write some code.
The system will look like this:
But now I have some problems interfacing the DurabilityDamageSystem
with the DurabilitySender
because the latter is a MonoBehaviour.
- https://forum.unity.com/threads/whats-the-best-approach-for-hybrid-ecs.551386/#post-3648499
Thu: Working on the rubble.
https://gfycat.com/OldfashionedApprehensiveDarwinsfox
Week 46
Yesterday I fixed up the UI for sending User Reports. Itās pretty neat to just send a screenshot and a short text from inside the game. However, today I need to decide what kind of stuff Iām doing before the end of the month.
Mostly, some kind of āscoreā for how high the player could build. I have some options:
- Numbers above the playerās head indicating height. Simple high score.
- Some score related to an item built at a height.
- Flag?
- Simply the highest block placed.
- How is this reflected on the player? A high score table? A score floating above?
Taking into account that players will be able to own buildings, it makes sense to require building something to claim the highest spot. Have to take out the high plateaus on the current map as those make it too easy to claim a higher place.
Wednesday: Need to get a bug fixed related to syncing animations over the network.
After that I spent some time thinking about how to dynamically generate meshes for the objects that have variable sizes (like boards, ladders and concrete blocks). It seems really tricky if the size is really variable and not discretized into minimum chunks. And even with discretization, if the increment size is small enough, that would generate a whole bunch of āsub objectsā that might be unnecessary.
MeshPart
defines whether the part is stretchable or a cap.- Stretchable parts should define how the Vertex position maps to UVs
MeshBuilder
takes parts and assembles themMeshBuilder1D
- Top, bottom, middle (stretchable)
MeshBuilder2D
- Corner, edge (stretchable), center (stretchable2d)
Friday Experimenting with building bigger āprefabā blocks to let the player climb up easier.
But code architecture is getting in my way. Because a lot of the building behaviour is inextricably tied into dynamically-sized blocks.
I probably need to split things in smaller components that manage their own behaviour. More ECS-like. So:
DurabilityModule
addsDurabilityReceiver
/DurabilitySender
DynamicSize
Spatial Component is not added to all blocks.Pinnable
component manages pinned items.- Something else (A PhysicsModule on the EntityDefinition ) handles whether a blocks proxied or not, and whether it is anchored.
I donāt get it. Something like this:
Super stable in a sandbox scene but in the real simulation it falls apart. Why?!
Iām trying to find out why itās not stable now. If the simulation settings are different or if the Proxy Body somehow messes with things.
I can also replace the colliders by one box collider for the proxy, but since it works in a sandbox scene I want to find out what causes the difference in stability first!
Week 47
On the first two days of this week I wrote a blog post about stacking physics boxes. Found out that without ridiculous amounts of solver iterations, 12 boxes is pretty much as high as you can go. Beyond that I would need some game mechanics to mitigate the instability.
One more thing Iām going to research today is whether it helps to create wider stacks. That is something players could learn, that they have to build piramid-shaped buildings or at least support the building through side structures.
- Create a toggle in the testbed for stack width
- See if stacks can be higher than 12 when this is selected: NOPE
So, interestingly it looks like Iāll need additional mechanics to make boxes stable, okay. Thatās that then. In 2018.3 Iāll be able to split that stuff out into a separate physics world and maybe increase the iterations on that.
There is one single thing that helps stability, and that is adding Fixed joints. However, adding them to every single block in the tower makes the whole thing behave like a spring. There must be a balance between # of fixed joints, their break force, and their āmassScaleā that will make the tower more stable but still feel ārealisticā.
- Blocks live in Blocks World.
- Everything else is placed on blocks and lives in real world.
- Blocks (only) are affected by plants through durability.
- Ladders are pinned to blocks in real world.
So what can I do today?
- Make a nicer basic block.
- Be able to put plants on the basic block.
That would be a victory.
I did some measuring in the scene and discovered that a texture density of 16px per unit looks about right for this game. Some of the plants have a higher density, up to almost twice as much, and the ground texture has about half that resolution. But 16px looks nice and blocky.
To put plants on the basic prefab blocks, they have to have a Block{Receiver,Sender} component. But the Block components rely on the dynamic size. Iāll have to separate that logic.
Okay, here we go then.
- Blocks no longer have size or stairs angle
- Pinning goes to separate component
- SimpleRecipe does boxcast to find lowest placement.
- SimpleRecipe checks if Block on Definition
- Add āBoundingBoxColliderā to MeshDefinition
- Use Block components on the room blocks
- Get rid of boards (until rebuild from pinnable + resizable (meshbuilder) + climbable layer)
- LATER: Resizable gets separate component
- LATER: Possibly merge durability into > block
- BIG ASS TASK: Build board from pinnable + resizable + meshbuilder + climbable
Friday. GOALS: Create a recipe for placing & pinning the big blocks. Should be fun.
- Create BigBlockRecipe
- Does construction raycasts in the PROXY world. Except it canāt because proxy world does not exist. Shit.
- So add the proxy to the client blocks on a separate layer.
- Use that layer in MeshDefinition behaviour too
- Start by just dropping on top
- and pinning from a fixed side.
- Modifier rotates along pin angle
- Create pin property on block and create fixedjoint when it has a pin.
- Does construction raycasts in the PROXY world. Except it canāt because proxy world does not exist. Shit.
ā
Todos for later:
- Make prefab blocks 3 units high
- Build a ComponentSystem for proxies. Initialisation order between Block/ProxyBody is kind of shitty and unpredictable now
- Step One: Pull ProxyBody behaviour into BlockSender. (Except create only a single collider)
- Nuke BlockReceiver.
- Cleanup the Proxies created by
BlockSender
- If blocks lose authority, they should remove the pin.
- [ ]
- Repair Block Movement Damage
- Repair Initial Creep Growth
Week 48
Okay, letās recap what I did last week and what the next goal is.
- I made some ECS Systems to manage proxies and transform synchronization. This was necessary because the old MonoBehaviours were getting in each others way.
- This new system allows pinning blocks to each other. The new āBigBlockRecipeā does this automatically.
To wrap this up I need to:
- Remove the old TransformUpdateSenders from all prefabs
- Implement some simple snapping + axis rotation on the new recipe.
- The new recipe should somehow decide how the block is rotated (from which side it is pinned)
- BlockSender should remove pin when authority is lost
- resize to height = 3 (48px)
-
Test with the staircase model
- Create a ladder with a Resizable component and a MeshBuilder
AppearanceProvider
component.- ProvidesSize / NeedsSize
- Move functionality from
MeshDefinition
toUsageDebugger
SimpleMeshProvider
MeshBuilderProvider
ColliderProvider
- MeshBuilder1D has links to MeshDefinitions (bottom / mid / end)
- MeshBuilder1D does some live preview based on current collider size
- Other:
- āprelinkā as much data as possible (i.e. no GetComponent at runtime)
- IDataRefresh for fixing data automatically
- IValidateData for showing errors in dev scene
āļø Okay nevermind that. Resizable objects are actually wayyy complicated. I can just create a couple of fixed size ladder objects first.
New Plan for Ladders
- Create ladder model in blender
- Create MeshDef for the ladder
- Create a recipe for pinned objects
- Actually pin objects
- Pinned property is inside TransformUpdater
- While pinned
- Position is relative to pinned body
- Receiver just positions object relative to support
- Make ladders climbable
Ladder Game Loop
- Bamboo yields Bamboo material
- How to spawn created item in the right place?
- Ladders need Bamboo to build
- Make (quickly) nicer shader for cutting
- Reset buckets when plant is cut
CLEANUP
- remove old
BlockRecipe
- Clean out the BlockReceiver
FUNCTIONALITY TO REPAIR
- Creep growing on blocks.
- Blocks taking damage (from creep and movement)
- Blocks spawning rubble and rubble with particles
- MeshDefintion picks random mesh
- Use variation from Entity
Week 49
Hello week 49. So last week was good, fixed up a bunch of stuff. Now I have to decide whatās important to get back on track for a playtest.
I could:
- implement death from falling (or inhaling fog)
- rewrite the fog shader in the v2 postprocessing stack.
- create tooltips about recipe ingredients and setup blueprint items for blocks
- do the bouncy inventory just because itās fun
- fix player movement to hop on low ledges
- block durability and rubble with particles
Going to work on the fog because I need something fun to do today.
Deciding how to set up the Fog colors, as a texture or as a bunch of lerped colors.
Ā | Near Fog | Far Fog | Skybox |
---|---|---|---|
Time of Day | ā | ā | ā |
Altitude | ā | ā | ā |
- I fixed the mesh variation.
I should write more, about what is wrong and what needs doing. And in a more structured way maybe. So right now I feel like I want to ship a little playtest build but I donāt know what the goal in that game would be. What do I tell players theyāre supposed to do? Mess around and build stuff? Currently, you just spawn in the world, and you see a deserted world. If you see the tooltips you might dig around in the trash and then build some stuff.
I donāt feel like doing anything but Iām just gonna do some programming stuff to maybe feel productive again.
- Split
PlayerClient
into:- š
PlayerController
(no Spatial) . Controls movement and Camera - š
PlayerLocal
(all the spatial stuff)
- š
- Merge parts of into
PlayerVisualiser
intoPlayerAnimationHelper
- Rename
PlayerVisualiser
to šPlayerRemote
- PlayerRemote is IPlayer
- Create new Player Server prefab without any of the mesh stuff. (Just a capsule). And the
PlayerWorker
component. - Rename
PlayerWorker
toPlayerServer
- Create interface for Interactable that uses either PlayerServer or PlayerClient
- Player Client Local objects need:
PlayerClient
(IPlayer)PlayerController
PlayerVisualiser
- Player Client Remote objects need:
PlayerRemote
(IPlayer)PlayerVisualiser
Totally unrelated screenshot
Week 50
Had a kind of breakdown last week when I realised how much stuff I think the game needs versus what is actually there. In other words: itās too ambitious. Now I have to decide how to deal with that realisation. One idea that occurred to me is to drastically simplify the concept. Get rid of all āgameyā things like resource gathering and scores and focus on the idea of a 100% persistent player-built world in its most simplest form.
Sent this mail to Vitor but maybe itās relevant.
Iāve been thinking a lot and agonising a little about what to do next. I figured my options are A) quit entirely, B) half-quit or C) donāt quit; just continue with more people. And I think B) is what Iāll do. That is to say, drastically reduce the scope to something that Iāll be able to release by myself in the near-ish future. I was tempted to let it go completely and start on a smaller game without the friction of a multiplayer game. But I think there is something there, and I am still really psyched about games with real persistence. (And honestly, with all of the stuff that was broken in the little playtest, SpatialOS was not one of them! It ran like a charm)
So, plan B would consist of me building a small, free, experimental, multiplayer experience where people can build permanent stuff in a world and jump/climb around in that world. I wonāt pretend itās a game. But there can be two outcomes at that point. Either Iām happy that I finished something and I move on. Alternatively: itāll be a good demo / pitch for finding people to build the whole of āgarbage countryā with.
Week 51
Today, worked a bit on the player movement across obstacles inclucing holding ledges and sliding down surfaces.
The next thing I want to enable is for the player to seamlessly hop onto small ledges.
The first approach I tried was with a locked animation. But the problem is that this will hop the player up a slope automatically. Maybe I do need to find a way to make steps a part of natural ground movement.
Brainstorming for a new plan
- All players start in a big central area. Perhaps they spawn from some kind of devices/niches in the wall.
- Prefab blocks are spawned around the existing structure, can be carried as a single item. Holding a block prevents climbing ladders and hanging on ledges, but they can be thrown. They spin around like classic shooter pickups with some sparkly effect on them.
- Seeds are also found around the map in the same way. Vines crawl around blocks and lock them in place.
- Block placement needs some (a lot?) of work. When standing inside a block, it should be very intuitive to place another block on the side of that. When standing on top of a block: idem. Perhaps the camera should be completely unlocked from the player in placement mode.
- The preview graphics of placing a block should actually represent the block. Look into a shader swap first because thatās the only way to avoid manually creating a representation.
- Worst case I have to manually generate pins on the surfaces of blocks but Iād really rather not.
- Intro
- Logbook 2017
- Logbook 2018 Part 1
- Logbook 2018 Part 2
- Logbook 2018 Part 3 š You are here.
- Logbook 2019
- Gallery