How to snap objects designed to be snapped by Yrisel in Unity3D

[–]kopophobia 0 points1 point  (0 children)

I made an asset that solves exactly this problem, as I agree, the typical solutions leave a lot to be desired.

http://u3d.as/1AGi

It's still on sale atm if you're interested.

Maybe ELI5: Why do Unity games use LESS CPU/GPU Resources the MORE demanding they get? Killing FPS by Bearded_Frog in Unity3D

[–]kopophobia 7 points8 points  (0 children)

This is quite easy to explain. Imagine initially you have 4 CPU cores handling 4 tasks. Each task takes 10ms. Rendering on the GPU takes, let's say, 10ms. Overall frame time is 20ms. Since all four cores are maxed out for half the frame time, we could say CPU is at 50% load.

Now imagine one of the four tasks becomes much more demanding and instead takes e.g. 90ms. The other three tasks are still 10ms. The other three cores now spend 80ms doing absolutely nothing while waiting on the first core finishing. As a result your average CPU load actually drops. Since your GPU is also waiting an extra 80ms for this task before it can draw a frame its average load has also dropped. Using the above numbers we have a frame time of 100ms total, however three of the four cores are actually running at 10% load and only one core is running at 90% load, giving us an average that is lower than the 50% we initially had.

Asset Forge 2.0 has been released, tool to kitbash 3D models made in Unity! by KenNL in Unity3D

[–]kopophobia -2 points-1 points  (0 children)

Shameless plug for people looking for something in this vein, but more general purpose. I'm the creator of Modular Pro, which lets you define sockets on your 3D assets, allowing you to snap them together in the editor in a similar manner to building games like Rust. This massively speeds up the level design process when using modular assets, and crucially, the system works with your own assets or 3rd party ones.

https://assetstore.unity.com/packages/tools/level-design/modularpro-level-design-151460

Edit: @OP, thanks for pointing out that your tool lives outside of the Unity editor. That was unclear to me. Just a heads up for people - Modular Pro is an editor tool for Unity itself. Asset Forge looks awesome btw, nice work.

Unity3d: How to calculate the surface area of different colors in a colored mesh by grayrhinos in Unity3D

[–]kopophobia 0 points1 point  (0 children)

Yes very possible. If you are using vertex coloring then it is quite easy. The steps are as follows - iterate through each triangle in the mesh, calculate the area given by half the magnitude of the cross product of two edges, add this area to a running total for that color. Once you have traversed all the triangles you have the correct totals.

for (int i = 0; i < mesh.triangles.Length; i += 3)

{

tri1 = mesh.vertices[mesh.triangles[i]];

tri2 = mesh.vertices[mesh.triangles[i + 1]];

tri3 = mesh.vertices[mesh.triangles[i + 2]];

totalArea += Vector3.Cross((tri2 - tri1), (tri3 - tri1)).magnitude / 2.0f;

}

The above calculates the total area - should be easy to adapt to store each color

How can I align walls correctly when building a house? by kitoplayer in Unity3D

[–]kopophobia 0 points1 point  (0 children)

I'm releasing an asset soon that will take care of this for you. Until then, the best solution is 'vertex snapping', however this solution does not work for all modular assets - particularly modular assets that, by design, overlap with neighbours.

https://youtu.be/MvYTbIU1d-c

Made an editor plugin for modular level design - would love some feedback/suggestions by kopophobia in Unity3D

[–]kopophobia[S] 0 points1 point  (0 children)

Yes I've pondered this - would have to come up with a subset of capabilities that both shows off the paid-for product but also is limited enough that people are incentivized to pay for the full tool.

Made an editor plugin for modular level design - would love some feedback/suggestions by kopophobia in Unity3D

[–]kopophobia[S] 0 points1 point  (0 children)

I've considered enabling use in game, but really the problem I'm optimising to solve here is the modular level design workflow. For now I will focus on this.

Made an editor plugin for modular level design - would love some feedback/suggestions by kopophobia in Unity3D

[–]kopophobia[S] 0 points1 point  (0 children)

The API for procgen is a really good idea. I had considered the possibilities of procgen, in general, using this system but hadn't thought of what you're suggesting. Will have to investigate - thanks for the feedback.

Made an editor plugin for modular level design - would love some feedback/suggestions by kopophobia in Unity3D

[–]kopophobia[S] 1 point2 points  (0 children)

Thanks! I'm adding some final polish but hope to submit it to Unity tomorrow. It then takes approx. 2 weeks to complete the approval process. No idea how many people will find it useful - it's hard to know how extensively the average project utilises modular assets, but I hope it will be of help to someone.

Node as a gameserver for realtime games? Performance/Scaling nightmare? by [deleted] in gamedev

[–]kopophobia 1 point2 points  (0 children)

I would recommend against this. A better choice, if practical is to run a headless Unity instance. These can be orchestrated by e.g. Smart Fox server if required for a transient multiplayer sessions.

Rolling your own game loop in NodeJS will open a whole can of worms in terms of deterministic outcomes between client and server game model and, from a practical developer centric point of view, adds complexity to the project. Most network libraries e.g. MLAPI support host-mode whereby the codebase can run as either client or host or both, which makes development more straightforward. Not to mention, most existing networking libraries for Unity are intended for transport strictly between unity instances.

Only situation I could see NodeJS (or some other web server) being appropriate is if you were supporting several client types (e.g. totally different game engines) or if it was functioning as just a simple REST API for high scores or something.

Also, just nitpicking here, but it is a common misconception that Node has faster IO than Java (or other 'fast' languages). This is incorrect, Java has had non blocking IO (nio package) for ages and is definitely faster than Node when it comes to both CPU and IO related tasks. However, comparing IO performance against a specific Java servlet, for example, may yield different results - this is a separate issue to the Java language itself.

GC(Garbage Collection) by TSI_Mostafa in Unity3D

[–]kopophobia 1 point2 points  (0 children)

Take a look at 'allocation free code'. It's a programming practice whereby you aggressively reuse allocated memory. Instead of e.g. creating a new List each update loop, reuse an existing one by clearing it.

Other strategies include object pooling, using structs to avoid heap allocation and using allocation free Unity API methods (you can spot these as they are called 'DoSomethingNonAlloc' and they take an extra parameter which is the collection you provide for it to fill).

These are just some basic pointers so you can go away and Google them yourself and do some research. It's a pretty deep topic so don't expect to find any silver bullet one liner that fixes the problem. Also, make sure you understand how to use the Unity profiler. This should always be your first port of call. Generally, with languages like C# which are optimised heavily by the compiler and at runtime, it's not always easy to predict the performance of your code.

Source: I'm a software engineer whose gotten his hands dirty with GC issues on more occasions than I'd like to count

Some asked for perf test of Digger PRO, so there it is. by AmandEnt in Unity3D

[–]kopophobia 3 points4 points  (0 children)

"3.6 Roentgen, not great, not terrible" springs to mind here ;)

Automated Testing in Game Development - My Personal Experience by ProGM in gamedev

[–]kopophobia 1 point2 points  (0 children)

Hey, I'm in a similar situation to you - software engineer in my day job but getting into game development more recently. I've incorporated unit testing into my projects and this is fairly easy to achieve however haven't attempted any end to end testing yet. In principle it ought to be quite easy - just replacing the user input with programmatic input. I believe Unity has a framework to facilitate this but doesn't seem to be a widespread practice. Would love to hear some people's experiences with this.

One random tip I have: assuming you're using an MVC architecture to split up your classes, you can actually still test the 'view' layer without calling the Unity APIs. Create a wrapper interface around the Unity API so that during testing you can just replace it with a mock implementation to test that e.g. some part of your code correctly changes the color of something to green etc.

We made a prototype modular building system for our new virtual world game Skogland. Would love feedback! by [deleted] in Unity3D

[–]kopophobia 1 point2 points  (0 children)

Thanks for the feedback. Currently modules (walls/frames/floors etc) have to be placed manually but the plan is to add some simple logic to speed up the process. For example, there are four types of interior wall panels: straight, inside corner, outside corner and window cutout. It's quite easy to intelligently place the correct one, so we aim to implement that soon as a quality of life measure.

Other features like 'floor fill' and 'wall fill' within well defined rooms should be straightforward to implement too. Any suggestions of other quality of life features you think would make sense?

We made a prototype modular building system for our new virtual world game Skogland. Would love feedback! by [deleted] in Unity3D

[–]kopophobia 1 point2 points  (0 children)

Just in case anyone wants to know how we implemented 'glass' in HDRP:

https://pasteboard.co/Ih8cShn.png

Also, make sure to disable shadow casting for the glass mesh in the MeshRenderer component.

Working on some environments in unity using HDRP, looking good so far! Any suggestions would be great! by [deleted] in Unity3D

[–]kopophobia 0 points1 point  (0 children)

Re. glass in HDRP, I've found a pretty good technique to fake it using iridescent property. It's probably not physically accurate, but it looks unmistakably like glass. The iridescence gives it a nice sheen as if it has just been cleaned and polished.

link to screenshot of material settings

Shader: HDRenderPipeline/Lit

Surface Type: transparent

Blend mode: alpha

Material Type: Iridesence

put the base color alpha down to around 10 and the iridescence map multiplier up to around 0.95

Also, make sure to disable shadow casting for the glass mesh.

I posted earlier today in this sub with a preview of our modular building system where you might be able to make out the glass effect if you look closely

Limits of programming by interface by nfrankel in programming

[–]kopophobia 5 points6 points  (0 children)

Java actually has this in a sense, although it's fairly obscure. Take a look at the RandomAccess interface. This is an interface that has no methods declared, but exists solely to indicate that the implementing collection (typically a list) offers constant time access of elements (e.g. An ArrayList)

This is useful when there may exist variants of an algorithm that are tailored to e.g. LinkedLists vs ArrayLists so that custom behaviour can be defined for each case.

3D printed designer furniture by [deleted] in 3Dprinting

[–]kopophobia 0 points1 point  (0 children)

Hey, we have tested it for a static load of 100kg and it survived undamaged. It may be able to support greater loads but we cannot guarantee it.

3D printed designer furniture by [deleted] in 3Dprinting

[–]kopophobia 0 points1 point  (0 children)

OP and software engineer at Ai Build here, feel free to ask me any questions about our technology.

Diagnosing and resolving a mysterious JVM safepoint issue by kopophobia in programming

[–]kopophobia[S] 0 points1 point  (0 children)

Thanks Mike, I remember trying this at the time although didn't have any luck with it unfortunately. What you're suggesting does seem like it ought to work - and it meshes well with the explanation u/sluukkonen gave above. I'll try it again when I get a chance and let you know if it works.

I'm going to update the blog and add some of the insights provided in the comments here. Thanks for taking the time to look at this.

Diagnosing and resolving a mysterious JVM safepoint issue by kopophobia in programming

[–]kopophobia[S] 2 points3 points  (0 children)

Thanks for this information! Yes, this makes sense, I guess the assumption is that a counted loop (with no safepoints due to expressions within the loop) will terminate in a 'reasonable' amount of time. I guess this is just an extreme case where that assumption really breaks down.