KatsBits Community

Game Editing => General Content Creation => Topic started by: ratty redemption on October 10, 2018, 07:47:18 PM

Title: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on October 10, 2018, 07:47:18 PM
Hi everyone, i've been working with kat's meshes and textures from his commercial fantasy set (https://www.katsbits.com/smforum/index.php?topic=998.0). i will be offering for free my unity prefabs here on katsbits, for anyone who purchased his set. when i've finished converting all his meshes to prefabs, including writing scripts for some of the dynamics. it's a lot of work as it's well over a 100 of them. i'm currently about 80% done.

In the meantime here's some screencaps of one of kat's dynamic levers (which i'll be adding scripts to in the near future) as well one of his static archways. the green boxes are the unity compound colliders, and are child objects of the parent container object. the mesh renderer is another child object.

The red version is just a couple of colored directional lights i use when working with the primitive colliders to help them stand out more, the original stone and wood materials are unmodified.

(https://t00.deviantart.net/foM8tUkxSmXwgzqr6bQgIQ8bgDM=/500x250/filters:fixed_height(100,100):origin()/pre00/9882/th/pre/f/2018/283/6/9/911_by_rattyreality-dcp356i.jpg) (https://www.deviantart.com/rattyreality/art/911-767731194)

(https://t00.deviantart.net/ygZmOHT7UubnK_6UO5xGAHbSeko=/500x250/filters:fixed_height(100,100):origin()/pre00/5812/th/pre/f/2018/283/0/c/872_by_rattyreality-dcp36sb.jpg) (https://www.deviantart.com/rattyreality/art/872-767733275)

(https://t00.deviantart.net/tHWGavWXjhugFLzTCDQPhHf88BQ=/500x250/filters:fixed_height(100,100):origin()/pre00/717b/th/pre/f/2018/283/a/7/870_by_rattyreality-dcp373c.jpg) (https://www.deviantart.com/rattyreality/art/870-767733672)

[EDIT] topic split from original here (https://www.katsbits.com/smforum/index.php?topic=998.0), as it deserves its own discussion. kat
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on October 10, 2018, 08:18:32 PM
if i remember correctly, the main reason for using unity's built in colliders as opposed to mesh colliders, is the physic engine is a lot slower at testing each tris in a mesh, than it is testing the primitive shapes like box, sphere and capsule, even when there are more of the latter.

so while it does work using a collision mesh exported from blender, our games should in theory run faster if we keep the mesh colliders to a minimum, for example a terrain, which would be impractical to build using primitives.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on October 11, 2018, 11:20:16 PM
this image shows a collision test i did to work out if we could use box colliders for roundish prefabs. although the results are pretty decent and performed well with my own character controller, the amount of transform rotated box colliders were too time consuming to use in production. so i'll likely use a single convex mesh collider for cases like this in the future.

(https://t00.deviantart.net/UuISoRxSlKxzxFRmZHL_qLHzpbE=/500x250/filters:fixed_height(100,100):origin()/pre00/85b5/th/pre/f/2018/284/0/c/842_by_rattyreality-dcp49jv.jpg) (https://www.deviantart.com/rattyreality/art/842-767783515)

these next three images show a light blocker sub object. this is used to fix light leaks in the real time shadows. apparently certain step, or corner shapes, in the render meshes can sometimes produce thin streaks of light where shadows should be cast.

(https://t00.deviantart.net/qWR6hMkdMDXJnhiTg0kABnIDtx0=/500x250/filters:fixed_height(100,100):origin()/pre00/f3dc/th/pre/f/2018/284/b/7/881_by_rattyreality-dcp49cr.jpg) (https://www.deviantart.com/rattyreality/art/881-767783259)

(https://t00.deviantart.net/luqLTtn69vD4FqTEt6Dog3AKj28=/500x250/filters:fixed_height(100,100):origin()/pre00/a90e/th/pre/f/2018/284/2/f/882_by_rattyreality-dcp49eb.jpg) (https://www.deviantart.com/rattyreality/art/882-767783315)

(https://t00.deviantart.net/n4Ma7cdobp20cql8omUOjle1pRk=/500x250/filters:fixed_height(100,100):origin()/pre00/f148/th/pre/f/2018/284/d/f/883_by_rattyreality-dcp49gb.jpg) (https://www.deviantart.com/rattyreality/art/883-767783387)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: kat on October 12, 2018, 12:41:45 AM
Noicely done (nicely done)!. Helps clear up the discussion under the Unity collisions video (https://www.youtube.com/watch?v=A98ZKOzmE1w&lc=UgxIsXT3pPwkWObbZXZ4AaABAg) as well.

Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on October 12, 2018, 01:05:07 AM
he he, thanks kat.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on October 12, 2018, 01:53:53 AM

although this wooden crate is not included in kat's fantasy set, it will hopefully be available in the future, along with other similar dynamic prefabs.

the first image shows the cracked parts of the crate still fitted together, which kat modeled in blender. as this was a test it's not the final version, but gives an indication of what is possible.

the various broken parts are held within a parent prefab. basically a unity empty which acts like an origin for the group of rigidbody objects. the yellow gizmos are my force points, as i call them. level designers will be able drag the tips of these around the 3d scene, in order to instruct my breakable script to apply an explosion like force in the direction of the tips.

(https://t00.deviantart.net/fOYdDdGzeMPl7OLRU9YIg6HQvbw=/500x250/filters:fixed_height(100,100):origin()/pre00/ff24/th/pre/f/2018/284/5/d/774_by_rattyreality-dcp48vo.jpg) (https://www.deviantart.com/rattyreality/art/774-767782644)

the second image is half way through the crate exploding apart. the length of the yellow gizmos don't actually affect the amount of force (speed) of each child object, instead that variable can be set as a random range within my breakable script's inspector options.

the unity console window is also printing out the results of my object pool script. which is a type of manager script that recycles dynamic objects like bullets, breakable objects, collectibles etc.

(https://t00.deviantart.net/XIsbNQyIyRLKvsGsxIK2kO9H4so=/500x250/filters:fixed_height(100,100):origin()/pre00/2ced/th/pre/f/2018/284/2/1/777_by_rattyreality-dcp48x2.jpg) (https://www.deviantart.com/rattyreality/art/777-767782694)

i'm also experimenting with the amount of damage that my health script passes to the breakable script, possibly affecting the explosion force.

so in theory if the player jumped up and down on top of a dynamic crate, then it might just crack apart after it's health runs out. whereby if the player shot the crate with a rocket, or dropped down from a significant height, then the crate might explode.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on December 15, 2018, 07:07:19 PM

i've been busy the last 3 months, mainly switching from monodevelop to visual studio for code writing. it took me while to learn and configure vs, as it's a lot more complicated than mono. i also made my own fonts and colors interface theme for it.

anyway, i'm back on track producing content again... this 1st image shows some test results of me getting gizmos cubes to rotate correctly, using a script that reads from the inspector's transform component. unfortunately this is not a feature built directly into unity's editor when it comes to gizmos, but it's very useful. especially when creating visual aids for prefab objects like spawn points. as seen in the 2nd image.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcuhmpy-c2dd7590-1474-4f14-9ae1-755358fdb53a.jpg/v1/fill/w_445,h_250,q_70,strp/955_by_rattyreality_dcuhmpy-250t.jpg) (https://www.deviantart.com/rattyreality/art/955-776805190)

my script displays a single boolean checkbox in the inspector called "is character". if ticked it will adjust the scale and positions of some of the gizmos parts.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcuhrpp-f40e1e31-fb4f-485f-9a16-e7e533b9b683.jpg/v1/fill/w_445,h_250,q_70,strp/957_by_rattyreality_dcuhrpp-250t.jpg) (https://www.deviantart.com/rattyreality/art/957-776811661)

this script doesn't actually spawn anything. it's just the visual aid for the position and rotation that a spawner script would use.

i will be releasing all the scripting and prefabs i show here in the future, unless they are superseded or prove to be unstable.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: kat on December 15, 2018, 08:22:32 PM
Very nice.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on December 15, 2018, 09:27:40 PM
thanks kat.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on December 25, 2018, 01:56:54 AM

i'm getting on well with writing a script based trigger system, to replace the in built unity one. mine does use some of the unity functions like "Physics.OverlapBoxNonAlloc" but it doesn't use "OnTriggerEnter" etc.

it has optional features like matching trigger id to colliding object's id, combined mass of colliding objects for pressure pads etc and different update speeds.

the latter can help with performance, as the "slow" option only checks one trigger volume per frame, as opposed to "fast" which loops through all triggers every frame. there is also an "auto" update speed, which dynamically switches between the the other modes, depending on what is going on in the game.

it's a manager and data system. meaning the scripts attached to the empty game objects that turn them into triggers are relatively small, as they contain very little, if any logic, and no update functions. the logic and updates are processed in the manager, after it has found and populated a list of triggers at start up. i'm also writing a series of other managers to handle different aspects of the gameplay.

below are some screencaps of this work in progress. note the verbose debug logging in the 3rd image is not displayed by default, it's just an option that level designers can toggle in the unity inspector, mainly for the purpose of tracking what the triggers are doing, if needed.

although it looks complicated, the end result should be straight forward for most level designers, as it's based on drag and drop and check box interface design. in theory it should only take a few minutes to set up, once someone follows the step by step instructions, that myself or kat will write in the future.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcv9a7g-5668200f-d948-4daf-bd59-96f01decde88.jpg/v1/fill/w_445,h_250,q_70,strp/967_by_rattyreality_dcv9a7g-350t.jpg) (https://www.deviantart.com/rattyreality/art/967-778095340)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcv9a85-e22751bd-b1e1-4a45-ad33-926c23e9b555.jpg/v1/fill/w_445,h_250,q_70,strp/968_by_rattyreality_dcv9a85-350t.jpg) (https://www.deviantart.com/rattyreality/art/968-778095365)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcv9a8o-51bdf1d0-8bb7-44b5-bd7c-ad843e5cd5e5.jpg/v1/fill/w_445,h_250,q_70,strp/969_by_rattyreality_dcv9a8o-350t.jpg) (https://www.deviantart.com/rattyreality/art/969-778095384)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on January 04, 2019, 07:37:38 PM

one of main the reasons why i wanted to write my own trigger system, albeit using one of the built in unity physics functions, was to reduce the amount of function calls. especially to the target scripts.

although my trigger manager script does read and write a lot to it's data scripts, the latter only contain a few lines of code each. so in theory this system when finished could be faster than the unity built in function "on trigger stay", possibly also the "on trigger enter" and "on trigger exit".

in the 1st image we see my trigger data script for a lever object has been set to use "activation auto". which would normally be used for  doors that don't require manual activation, other than the player or npc's walking up to them. i was just testing using the lever, but it could have been any object that can be triggered.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcw795j-1a08ac83-6911-4ba0-a69e-0a155c331443.jpg/v1/fill/w_445,h_250,q_70,strp/970_by_rattyreality_dcw795j-250t.jpg) (https://www.deviantart.com/rattyreality/art/970-779680279)

keep in mind, the unity debug logs printed in the console window, do significantly slow down the game, so most of the time we'd have them disabled. with that being said there is only a couple of function calls from my trigger manager to my lever manager, and that was due to me moving the player in and out of the trigger volume, which the data script is attached to.

compare that to the much higher "fast update index" and "collider count" logs, which are keeping track of all the dynamic collider objects inside the trigger volumes. in this case just the player, but could be lots of objects inside several different volumes, which the manager cycles through when it does it's fast or slow update.

to clarify, this system acts like the built in "on trigger stay", except it only calls the target scripts once per "enter" and "exit".

in practice, if this was an auto activated door, it would open when the player walks up to it, ie enters a trigger volume. then the door would stay open until the player had left the trigger volume, on the other side.

my trigger data scripts can also be set to "use once" in which case the manager removes them from the game after the "enter" event, so frees up some memory and cpu.

the 2nd image is similar to the previous test, except the data script is set to manual activation. that can only call the target script when a player is inside the trigger volume and using a "activate" key input.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcw794w-70797acb-5f60-4f94-8329-c02ffe0a5347.jpg/v1/fill/w_445,h_250,q_70,strp/971_by_rattyreality_dcw794w-250t.jpg) (https://www.deviantart.com/rattyreality/art/971-779680256)

there is a short timer delay between those function calls so the player can't keep spamming the input. in the future, i might make the delay an inspector variable, so level designers can choose their own values. but for now having a delay of about 1 second seems to work well. if there was no delay, then there could be 30 or 60 functions calls a second to the target script if the player held down their activation key. which would be a waste of resources, and eventually slow down the game.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on January 10, 2019, 09:46:03 PM
these images show two of kat's lever models made in blender, and being animated in unity by my lever manager script. my inspector variable "end angle x" is used in the 2nd image to limit the range the lever can rotate, so it doesn't pass through it's base.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcwprx9-5a980b0a-23ca-4ba8-9343-2a8a91c30a2d.jpg/v1/fill/w_445,h_250,q_70,strp/980_by_rattyreality_dcwprx9-250t.jpg) (https://www.deviantart.com/rattyreality/art/980-780544413)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcwpryj-5669f1b9-9f79-4c00-9608-fa48ef42dc5a.jpg/v1/fill/w_445,h_250,q_70,strp/981_by_rattyreality_dcwpryj-250t.jpg) (https://www.deviantart.com/rattyreality/art/981-780544459)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on January 11, 2019, 02:46:21 AM

after a lot of experimenting over the last couple of weeks, i've nearly finished the lever manager. the following post is related more to the code than level design...

1st image is the whole of my lever data script. these would be attached to each of the lever prefabs.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcwqaul-97dcc95f-29e0-4362-8274-e6eb35c1c476.jpg/v1/fill/w_445,h_250,q_70,strp/977_by_rattyreality_dcwqaul-250t.jpg) (https://www.deviantart.com/rattyreality/art/977-780568941)

level designers could replace the meshes and textures with different versions if they wanted, as long as the prefabs followed the hierarchical structure of the ones that i'll be releasing, hopefully in the near future. alternatively coders could edit the scripts to suit their own designs.

lines 17-20 are what we're focusing on here, as they are used to store the reference to the prefab's pivot, the start and end rotations, as well as the target rotation. the latter toggles between start and end when the lever reaches the target rotation.

2nd image is part of my start function of the lever manager script. the various managers are attached to an empty game object in the root of the scene's hierarchy window. there is only one manager of each type.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcwprum-00bbb9d4-35d3-40ab-8049-8d70be070d28.jpg/v1/fill/w_445,h_250,q_70,strp/978_by_rattyreality_dcwprum-250t.jpg) (https://www.deviantart.com/rattyreality/art/978-780544318)

lines 89-92 are assigning the initial values to the data script's variables. the most important, and difficult for me to figure out, was line 91. which is the end rotation.

to my surprise, that line didn't require at this stage, any reference to the pivot. instead it's using my inspector variable "end angle x", which defaults to 90 degrees. it also references the vertical "y" axis of the prefab parent, ie the lever base.

3rd image is part of the "fixed update" function (ie physics update) of the manager script.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcwprv1-253fa3c7-c192-415a-83ed-417f6bfd2e5e.jpg/v1/fill/w_445,h_250,q_70,strp/979_by_rattyreality_dcwprv1-250t.jpg) (https://www.deviantart.com/rattyreality/art/979-780544333)

line 126 is interpolating between the current rotation (taken from the pivot each frame) and the target rotation.

i was surprised by how high the "250" value ended up being, as that determines speed per second. normally i move or rotate objects with values between 5-25. i guess it has something to do with converting that value to degrees, but it's still weird looking. any less and it was moving too slow in my opinion.

that value could be exposed in the inspector for the lever designers, but for now i'm leaving it hard coded.

another thing which i'm still trying to comprehend, is the beginning of that line has "leverData.pivot.rotation = " which means it's not just storing the interpolated value in the data script, but also apparently applying it to the actual pivot, rather than a reference to it. i assume this has something to do with "reference types vs value types" although admittedly i'm not good at distinguishing the former.

in the past i would have done those separately. it was actually a typo that i wrote it like this, but it produced good results so i kept it.

...

a longer version of the lever manager script that i got working a couple of days ago, took a slightly different approach. in that instead of interpolating between start and end quaternions, i broke it down to interpolating a "current angle x" floating point variable, similar to the "end angle x" previously mentioned.

i then used a built in quaternion function to construct the current rotation from the "x, y, z" and applied that to the pivot.

the reason i had tried that was i wanted more control over each frame. so in effect constraining the "y" and "z" axis so there was no unwanted drift on them. turns out i didn't need to do that but it's good to know we can if need be.

in summery, it was a lot of hard work to get the levers to behave as i wanted, although i learned several very useful things in the process... there's even a couple of interpolate functions that i tested, that have acceleration and deceleration in their movement. in the end, i opted for a constant speed for these levers as that seemed more natural.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on January 11, 2019, 04:48:31 PM
forgot to mention, this type of code can also be used for tanks or turrets where the parent object is rotated in one direction and the child object faces another.

i'm currently working on the door manager, which will switch between sliding and rotating doors, depending on the door data scripts.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on January 11, 2019, 09:28:26 PM
this image shows a test room i built with 25 of kat's lever models. i didn't notice any drop in fps while they were moving, which surprised me.

take into consideration there is only one invisible trigger, and one real time light, which doesn't cast shadows. so this was really to test if the scripting and animating geometry was expensive.

if we had shadows on or more lights, it would slow down to some degree.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcwt9n1-727fc9b4-19f3-4a8f-bbfc-d522ea11522d.jpg/v1/fill/w_445,h_250,q_70,strp/982_by_rattyreality_dcwt9n1-250t.jpg) (https://www.deviantart.com/rattyreality/art/982-780707341)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on January 13, 2019, 07:27:24 PM
i've now got the rotating door code working in my door manager script. next i'll work on the sliding doors. which the manager will detect when needed.

in this image we have a script order of "trigger manager > lever manager > door manager" as well as each of them having their respective data scripts, for storing the start and updated variables in.

the order could also just be "trigger manager > door manager" as the lever scripts act as a relay, but are not required. the same principle would apply to buttons, when i've made them.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcwz5ls-4d314f05-2712-4217-ba5f-84eadae6e288.jpg/v1/fill/w_445,h_250,q_70,strp/983_by_rattyreality_dcwz5ls-250t.jpg) (https://www.deviantart.com/rattyreality/art/983-780982048)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on February 01, 2019, 05:43:22 PM
i've got the sliding doors working. so that's the door manager finished for now, i think.

i also wrote a gizmos script for doors. which detects the door type, ie rotating or sliding, and draws either a little yellow pivot for rotating doors, or a sliding direction vector for sliding doors. the latter can move up, down, left, right, forward or backwards.

we can also enter into the inspector the door's move speed.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcykjar-5cf0e97c-187e-4235-a610-ff36dff27502.jpg/v1/fill/w_445,h_250,q_70,strp/987_by_rattyreality_dcykjar-250t.jpg) (https://www.deviantart.com/rattyreality/art/987-783659187)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on February 04, 2019, 05:13:44 PM
these two images show the pairs of trigger volumes and levers for opening some doors.

note the 2nd image has unity's "scene window > gizmos menu > 3d icons" turned off. which makes it easier to see the gizmos we're working with in the foreground, but also clutters the screen with gizmos scripts attached to objects in the background. we can disable those objects and or their scripts if need be.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcyvkil-680acd74-0072-46f5-83d0-34e184b8b86f.jpg/v1/fill/w_445,h_250,q_70,strp/988_by_rattyreality_dcyvkil-250t.jpg) (https://www.deviantart.com/rattyreality/art/988-784173981)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcyvkpg-63da7f86-6657-4503-96e8-3c382be64485.jpg/v1/fill/w_445,h_250,q_70,strp/989_by_rattyreality_dcyvkpg-250t.jpg) (https://www.deviantart.com/rattyreality/art/989-784174228)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: kat on February 04, 2019, 06:20:40 PM
If you don't see comments in reply to these updates of yours just know that there isn't really much to add/comment on with these other than "good work", heh.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on February 04, 2019, 06:40:28 PM
understood. no problem my friend. i'm really enjoying producing content again. it's coming together quite smoothly, when my old laptop isn't playing up, he he.

of course, if you or anyone else has any questions about my work with your assets, feel free to ask. hopefully i can release my prefab package soon.
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on February 08, 2019, 05:52:44 PM
here's a couple of wip images of the floor buttons, using kat's models and textures.

i slightly scaled up the width of the moving parts of the buttons. as i thought the original gaps looked a little too big. thankfully we can easily do this via the transform's scale property in the inspector. the prefabs i will be releasing will have this scaling already applied. so level designers can just drag and drop the prefabs into the scene, then adjust their height depending on how much they want the prefabs sunk into the floors.

i might make separate prefabs for wall buttons, with 90 degrees rotation and possibly scaling. the scripts i'm writing will detect which direction the moving part is likely to use, as well as display an inspector variable for the distance it travels when triggered.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcz2e71-088b2c76-3d60-4074-b65d-acd944b7dd52.jpg/v1/fill/w_445,h_250,q_70,strp/997_by_rattyreality_dcz2e71-250t.jpg) (https://www.deviantart.com/rattyreality/art/997-784492381)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcz2efj-91c75703-2c53-4cab-ac96-878d60aafe83.jpg/v1/fill/w_445,h_250,q_70,strp/998_by_rattyreality_dcz2efj-250t.jpg) (https://www.deviantart.com/rattyreality/art/998-784492687)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on February 10, 2019, 05:14:24 PM
i added in a feature to the lever gizmos, allowing the level designers to offset the little blue origin for connecting lines, in case it's obscured by the models.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dcz4mk3-5611a402-b402-4e93-aa10-9c47fc53a3c0.jpg/v1/fill/w_445,h_250,q_70,strp/999_by_rattyreality_dcz4mk3-250t.jpg) (https://www.deviantart.com/rattyreality/art/999-784596531)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on February 10, 2019, 07:59:54 PM
i've updated the door manager script so it can now open the doors away from the player, if the level designers want. it's not actually detecting which side of the door the player is on, it's based on which trigger volume or lever/button is used.

we can also set the amount of rotation for each door from -135 to +135 degrees relative to their start rotation.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dczehge-3df48147-29db-4890-91d7-f8e75762cad9.jpg/v1/fill/w_445,h_250,q_70,strp/1003_by_rattyreality_dczehge-250t.jpg) (https://www.deviantart.com/rattyreality/art/1003-785056478)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dczehwv-fea559f0-0e00-45f8-b0b8-9760117610cc.jpg/v1/fill/w_445,h_250,q_70,strp/1005_by_rattyreality_dczehwv-250t.jpg) (https://www.deviantart.com/rattyreality/art/1005-785057071)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on February 23, 2019, 12:15:23 AM

these two images show unity's new prefab editing mode. which is very useful. although sometimes the models and or textures are too dark, as this mode doesn't use light objects by default. thankfully i realized we can copy and paste temporary lights into the prefabs.

i've used a couple of red directional (sun) lights as they help when i'm editing colliders, as shown in the 2nd image.

after we've finished editing the prefabs, we can delete the temporary lights.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd032lr-8b996ac2-3925-4f9b-984a-6e85c791ab2a.jpg/v1/fill/w_445,h_250,q_70,strp/1006_by_rattyreality_dd032lr-250t.jpg) (https://www.deviantart.com/rattyreality/art/1006-786203631)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0333y-8fb7e2d4-2ba3-4dfe-a071-c99d53f7a666.jpg/v1/fill/w_445,h_250,q_70,strp/1007_by_rattyreality_dd0333y-250t.jpg) (https://www.deviantart.com/rattyreality/art/1007-786204286)

Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on February 26, 2019, 12:24:20 AM
i've recently been experimenting with making some spawn/teleport textures. using the free image editor paint.net.

it's no where near as powerful as what kat uses, although it's ok for blending layers together and exporting jpg and png files. the sigils were copied from a free font called "inquit". that i downloaded from fontm.com. i'll be including my textures, unity materials and prefabs in my unity package for use with kat's assets, when it's ready.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd04gss-5e4d1ded-0e26-4b26-92da-731d7917fc45.jpg/v1/fill/w_445,h_250,q_70,strp/1019_by_rattyreality_dd04gss-250t.jpg) (https://www.deviantart.com/rattyreality/art/1019-786268684)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd04h1v-d8bb6845-9d1c-4dbe-9b4c-cd03af33023e.jpg/v1/fill/w_445,h_250,q_70,strp/1020_by_rattyreality_dd04h1v-250t.jpg) (https://www.deviantart.com/rattyreality/art/1020-786269011)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0c571-81bd5c23-b9a0-44a7-8866-69f8db20e4e1.jpg/v1/fill/w_445,h_250,q_70,strp/1021_by_rattyreality_dd0c571-250t.jpg) (https://www.deviantart.com/rattyreality/art/1021-786626893)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on February 26, 2019, 12:30:56 AM
some variations of the spawners.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0ftsl-39451334-bde9-4cc6-b705-08fc0e14ede3.jpg/v1/fill/w_445,h_250,q_70,strp/1024_by_rattyreality_dd0ftsl-250t.jpg) (https://www.deviantart.com/rattyreality/art/1024-786798741)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0ftwt-17d13e79-43e3-4659-8c5c-774057a7bf5c.jpg/v1/fill/w_445,h_250,q_70,strp/1025_by_rattyreality_dd0ftwt-250t.jpg) (https://www.deviantart.com/rattyreality/art/1025-786798893)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0pc9o-8fca2aba-447f-4296-8591-68b24fa3d0f5.jpg/v1/fill/w_445,h_250,q_70,strp/1029_by_rattyreality_dd0pc9o-250t.jpg) (https://www.deviantart.com/rattyreality/art/1029-787242588)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on February 26, 2019, 12:35:31 AM
the last of the variations.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0pcmn-e4ae865e-e0be-43c7-8853-13ab6d45cf39.jpg/v1/fill/w_445,h_250,q_70,strp/1032_by_rattyreality_dd0pcmn-250t.jpg) (https://www.deviantart.com/rattyreality/art/1032-787243055)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0pbwn-d51685c1-0752-43f0-ac2a-1fa1fa9cf9d1.jpg/v1/fill/w_445,h_250,q_70,strp/1027_by_rattyreality_dd0pbwn-250t.jpg) (https://www.deviantart.com/rattyreality/art/1027-787242119)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0pc4s-a98a021c-f53d-4ef5-849d-1d8f49ea7ccb.jpg/v1/fill/w_445,h_250,q_70,strp/1028_by_rattyreality_dd0pc4s-250t.jpg) (https://www.deviantart.com/rattyreality/art/1028-787242412)

Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on March 01, 2019, 12:31:52 AM
i've been doing some performance tests with the prefab spawners and their light objects.

considering i'm still using an old low end laptop, the performance of unity's standard material shader, using both alpha and additive blending seems pretty decent.

1st image has no light objects, only ambient lighting in the room. this is the fastest out of the 3 tests.

2nd image has a light object for each spawner decal. resulting in a lot of overlapping lights, which heavily impacts performance.

3rd has only 4 light objects, none of which overlap, and frame rate is good.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0y8fg-1ebfb63e-d6d0-400b-a502-e150234a4974.jpg/v1/fill/w_445,h_250,q_70,strp/1034_by_rattyreality_dd0y8fg-350t.jpg) (https://www.deviantart.com/rattyreality/art/1034-787657516)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0y8nr-7d56aea0-7b75-4ace-8ae6-de9108b28d0f.jpg/v1/fill/w_445,h_250,q_70,strp/1035_by_rattyreality_dd0y8nr-350t.jpg) (https://www.deviantart.com/rattyreality/art/1035-787657815)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd0y8tb-0959217c-ae37-4424-9ebc-a70bdac23d8f.jpg/v1/fill/w_445,h_250,q_70,strp/1036_by_rattyreality_dd0y8tb-350t.jpg) (https://www.deviantart.com/rattyreality/art/1036-787658015)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on March 06, 2019, 07:40:29 PM
these 2 images show some place holder cogs, built in unity not blender, being animated by my new rotating manager script.

the two small cogs are intersecting in a realistic way, i think. despite having mesh colliders, and rotating in opposite directions. normally prefabs with colliders don't intersect, unless we want them to.

i also added in a toggle for the levers and buttons so they can reverse the direction of the cogs. in the 2nd image one lever does that, the other lever turns the rotation on and off.

we can use them to build certain machines, and the cogs can be any size we want.

it took me about 3 days of research and trial and error to figure out how to rotate the cogs at arbitrary angles, like the large cog. the smaller cogs facing upwards were relatively easy.

now i have the code for all that we can rotate most things we'd want.

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd1ejfq-b7b9b308-d540-4b9f-8185-a9a7702d1c63.jpg/v1/fill/w_445,h_250,q_70,strp/1047_by_rattyreality_dd1ejfq-250t.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9NzY4IiwicGF0aCI6IlwvZlwvYjNmMDZkZWItNWZlMy00MzdhLWIwYjktYTE0ZTg1MTZjYWVjXC9kZDFlamZxLWI3YjliMzA4LWQ1NDAtNGI5Zi04MTg1LWE5YTc3MDJkMWM2My5qcGciLCJ3aWR0aCI6Ijw9MTM2NiJ9XV0sImF1ZCI6WyJ1cm46c2VydmljZTppbWFnZS5vcGVyYXRpb25zIl19.UwoEtIrjioic239P1gm55A3NCGHGHAxH490W-x0-esw) (https://www.deviantart.com/rattyreality/art/1044-788234150)

(https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/b3f06deb-5fe3-437a-b0b9-a14e8516caec/dd1ald2-2f7e2a6f-750e-4804-a518-e713d2b30ca5.jpg/v1/fill/w_445,h_250,q_70,strp/1044_by_rattyreality_dd1ald2-250t.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9NzY4IiwicGF0aCI6IlwvZlwvYjNmMDZkZWItNWZlMy00MzdhLWIwYjktYTE0ZTg1MTZjYWVjXC9kZDFhbGQyLTJmN2UyYTZmLTc1MGUtNDgwNC1hNTE4LWU3MTNkMmIzMGNhNS5qcGciLCJ3aWR0aCI6Ijw9MTM2NiJ9XV0sImF1ZCI6WyJ1cm46c2VydmljZTppbWFnZS5vcGVyYXRpb25zIl19.cuUTxMtW4pdQMGhE_2GSxQRF0Z7JRi8LcFkafWEBzrs) (https://www.deviantart.com/rattyreality/art/1047-788418278)
Title: Re: [Unity] Fantasy asset pack prefabs
Post by: ratty redemption on March 10, 2019, 08:50:45 PM
just text in this update, it's also more related to scripting...

while testing my floor button scripts, which use the "auto activation" option from the trigger manager, as opposed to "manual activation" like levers use, i manged to break several times the double doors which were connected from the floor buttons.

they would become out of sync, so one half would be open and the other closed. i suspected this was due to the trigger manger having an "auto update" speed, where it switches between fast and slow updates, to save on cpu. problem is it's apparently unreliable.

so i'm removed the slow and auto update speeds and am now only using fast. it made the manager less complicated, which is good, but it currently means all triggers in a scene would be checked every physics frame.

i might write some system in the future, which enables and disables
triggers depending on the area the player or npc's are in, so giving the trigger manager less work to do.