Adding an input/output system to open up new gameplay opportunity.
25 May 2018 (0 Comments)
I was inspired by the Unity 3D Game Template Thing to add a Create New Mission option.
It works kind of the same. You choose it, it opens a window letting you choose the name of the new mission. Then it copies a folder and opens the scene.
That's as simple as it should be, but the assets in the folder reference each other. So when we copy the folder over, the new items point to the old items. I have a function in the Rust code somewhere that copies and automatically fixes the references. There were only a few references though so I fixed it manually.
This simlifies creating a new mission into a couple of clicks, instead of explaining how to manually create a mission definition, how images are needed for backgrounds and tiles, enforcing a folder layout etc. The hope is that it makes creating new levels more accessible for FP Staff.. and if we go that route, for everyone else.
Diogo made a useful tool for Rust called VisualizeTexelDensity. It's a tool that exists in other engines, but not Unity. You can toggle it in Tub with the 0 key.
Sometimes when you make a model you make the textures 4096x4096, even though the model is only 2 inches high and you only ever see it from 10 feet away. This is obviously a waste of memory, so ideally when imported the artist would set the texture size to be like 256x256 or whatever is appropriate.
It's also a problem on environment art. It looks amateurish if the texel density on world textures are quite different. This tool visualizes this problem. If the texel density of a model is too high, it'll show red.
I've added this tool in anticipation of getting some actual models made for Tub and replacing some of the placeholders.
The success dance prefab was using the older player model with a winky.
Now it works the same as the ragdoll. It has no renderers, it copies them from the player (because they might be wearing different clothes).
There's a few things I want to do in the game that aren't currently possible. Simple things like using keys to unlock doors, fuse boards, cooking, gathering. Ideally I wanted a system as flexible as the mapping system in the Source Engine, where logic isn't hard coded to situations, but instead can be used for whatever purpose.
So I've been working on that this week. Writing, rethinking, rewriting. I'm not 100% in love with where I am right now but it's much better than where it was.
Female Socket is what it sounds like. It's a socket. That a male needs to be put into.
The options are tags. The above component is defines as, any male with the tag "key" can enter. But only makes with the tag "key.red" will trigger the bool.
Most of the IO entities are derived from the Boolean class. Which means they have a true/false state. And all of these Booleans have events for things like OnChange, OnTrue, OnFalse. So now this socket will become true if a male object with a "key.red" is put in it.
The above is using two Female Sockets, which are being watched by a BooleanTest.
This is derived from an Integer type. I'm not happy with how the integer type works right now, but it works. At the moment you set a minimum/maximum value for it, and it triggers the Boolean to true if that passes. BooleanTest sets the integer value to the count of the Booleans that pass. In this instance minimum is set to 2.
The events are set up so when it passes, it opens the door. When it doesn't, it closes the door.
So it works that when you pull the key out, it closes the door.
Overall this system feels flexible enough to do some interesting stuff, but is still kind of a load of bullshit to set up. I've got some ideas to improve things though, so will likely look at that next week.
Accepts males, but destroys them when they touch it. It's derived from an integer, so integer++'s when it consumes a male.
Use cases for this would be things you have to feed. Maybe you need to put fire out by throwing water on it, this'd work for that by disabling the fire gameobject once the integer reaches the right point.
Like Female Consumer except it doesn't destroy anything. Instead it counts the number of males inside it.
Use cases would be things like throwing rocks in water to raise the water level, sheep hearding games, or counting the number of players in an area.
Female Sockets have influence tags. The thought behind this is that some sockets would be ovens, or charging stations, and can influence the object that is inserted into them. In reality the socket has no idea what this influence means, it's up to the male object to define that.
In this example the ham as an Exchangeable component. The component takes the "cook" influence (which the socket it tagged with). The Exchanger component swaps the object out with a different one after x seconds of being influenced.
This allows making things like charging stations, which would turn a empty battery into a full battery. Then you could make it so a socket that took a full battery would turn it into an empty battery after x seconds inside.
If you want to follow this project you can sign up to the mailing list.
We'll only update you about this project, we won't spam you about other stuff or sell your email address.