Slime-Simulation icon indicating copy to clipboard operation
Slime-Simulation copied to clipboard

Can't run project in unity 2020.3.2f1

Open inh4les opened this issue 4 years ago • 28 comments

I loaded up the project in unity, opened the slime scene, and pressed run. Black screen. I've messed around with some settings in hopes of getting it to work but to no avail. I'm not sure what i could be doing wrong here, any help would be appreciated.

inh4les avatar Apr 07 '21 00:04 inh4les

Here are some images: fresh project opening slime scene pressed play

inh4les avatar Apr 07 '21 00:04 inh4les

image Now im getting this error for some odd reason.

inh4les avatar Apr 08 '21 01:04 inh4les

For me its similar to your first few screenshots in Unity 2020.3.3f1 (after letting Unity import the project to the new version). I just get a blue background and nothing happens.

marvosyntactical avatar Apr 10 '21 01:04 marvosyntactical

Ok so I was able to resolve my problem at least: I did not select the scene Slime.unity. When I selected it before running the scene, I saw beautiful slimes.

marvosyntactical avatar Apr 10 '21 14:04 marvosyntactical

Is this a Mac problem? I'm not very familiar with Unity but I'm just getting a black screen on my Mac. It looks like compute shaders might not work well with them.

asvarga avatar Apr 11 '21 21:04 asvarga

Make sure you select the slime scene.

This seems to work for most people, just not for me.

inh4les avatar Apr 11 '21 23:04 inh4les

I've selected the scene which gives me the black screen. What OS are you on @inh4les?

asvarga avatar Apr 12 '21 00:04 asvarga

I'm getting a black screen too. I'm on windows so it seems it isn't a platform bug

amodi04 avatar Apr 12 '21 10:04 amodi04

I am on linux with black screen as well.

morgabm avatar Apr 12 '21 10:04 morgabm

Sorry to hear the project isn't working for some of you, I'm not sure what is causing this. Something to try though if you're on windows or linux (I've had one person mention that this worked for them): go into the project settings, and under Player > Other Settings, uncheck Auto Graphics API for the relevant operating system, and then add Vulkan from the drop-down list. Finally drag it to the to be the first in the list. You'll then be prompted to restart the Unity editor. Please let me know if that helps.

If you're getting any errors or warnings in the console could you also please paste them here.

SebLague avatar Apr 12 '21 14:04 SebLague

Hi Sebastian,

I tried changing the graphics API to Vulkan (am on windows) but still I get a black screen when running the slime scene. I'm also not getting any errors in the console

amodi04 avatar Apr 12 '21 14:04 amodi04

@SebLague Thanks, this fixed it for me on Linux with Nvidia.

BillPepper avatar Apr 12 '21 16:04 BillPepper

If i check Show Agents Only, I see the agents moving around

amodi04 avatar Apr 12 '21 16:04 amodi04

@BillPepper Happy that fixed it for you! @IntelligentCake04 That's interesting... I'm not sure what the cause is, but I'll try figure it out.

SebLague avatar Apr 13 '21 11:04 SebLague

@SebLague Thanks, this fixed it for me on Windows with Nvidia. image

khalosh74 avatar Apr 13 '21 13:04 khalosh74

@SebLague I tested the project on another pc and the project worked straight away on that so I'm not really sure what's going on. I hope this helps your investigation.

amodi04 avatar Apr 13 '21 14:04 amodi04

If I set the Trail Weight to 100, I can see things. I'm not sure what the cause of the inconsistency is though. Screen Shot 2021-04-13 at 12 48 17 PM

asvarga avatar Apr 13 '21 16:04 asvarga

Hi @SebLague , Thanks for sharing this wonderful code, and for the video show ! It is really appreciated !

I'm unfortunately in the same situation as @IntelligentCake04 (seeing agents moving only with the "only agent - on" and running with the vulkan API). But no slimes in the petry dishes.

I'm running the scene on a Windows 8 laptop with a GPU nvidia geforce 740M (wich technically support DX11 and shaders 5.0) To identify the source of the trouble, i could try to run an other scene that involves compute shaders. But, knowing nothing about it, i don't know where to start. Thanks again for sharing your work Cheers

Owl-In-Bowl avatar Apr 13 '21 22:04 Owl-In-Bowl

@asvarga I tried your fix but I am still having issues, so then I factory reset my pc (i know a bit extreme), but still a black screen. This could possibly mean that this is to do with hardware in which case I'm not sure what to do. @SebLague hope this helps with you're investigation.

amodi04 avatar Apr 14 '21 13:04 amodi04

My "fix" isn't quite correct, but I still think it is a concurrency issue caused by multiple threads trying to unatomically increment the sameTrailMap pixel with:

float4 oldTrail = TrailMap[int2(newPos)];
TrailMap[int2(newPos)] = min(1, oldTrail + agent.speciesMask * trailWeight * deltaTime);

Different platforms support atomicity differently, so for some of us, this causes only 1 agent to do an increment and the results to be invisible. @IntelligentCake04, does increasing "Trail Weight" fix it for you?

asvarga avatar Apr 14 '21 14:04 asvarga

@asvarga no it doesn't fix it for me. I genuinely think it could be lack of support for older hardware. For reference i am using an i7-2600k and a Nvidia GTX 770. It would be interesting to see a correlation between older hardware and this issue.

amodi04 avatar Apr 14 '21 19:04 amodi04

@IntelligentCake04 am running a GTX 760, so it's possibly a hardware issue. Right now im running into an issue where it says that the program has compilation errors? This is interesting because I was able to open the project previously. my specific issue is "the type or namespace NUnit could not be found". I tried reinstalling unity, but it hasn't fixed it. Will do some troubleshooting in the meantime.

inh4les avatar Apr 20 '21 21:04 inh4les

I'm also being thrown into safe mode when I first load the project. Running on a 2070s, so it shouldn't be a hardware problem

bootzin avatar Apr 25 '21 19:04 bootzin

@SebLague can u turn it into a exe file? It would be easier to run than

EbrahimMomin avatar Jun 22 '21 15:06 EbrahimMomin

If anyone is interested, I've recreated the project using my own custom engine here. There is an exe available in the releases with various customizable settings that you can adjust.

bootzin avatar Jun 23 '21 19:06 bootzin

Im a total beginner, but I noticed something: I can only have a limited number of actors, to be precise not more than 1048560, which is almost the amount of bytes one MB has (1048575). If I have more I also get blackscreen. (Running on a GTX 1050Ti) Then I looked into the profiler and if I increased the amount, my GC Allocated in Frame spiked. So you might get it to work on the older hardware if you reduce the number of agents and the size of the image.

ThoreHaupt avatar Aug 12 '21 22:08 ThoreHaupt

@asvarga your fix was pretty close. You were definitely correct on one possible issue. One clue is when you look at the compiled shaders, you'll see the following lines: writeonly layout(binding=1, rgba32f) highp uniform image2D TrailMap; readonly layout(binding=2, rgba32f) highp uniform image2D ReadTrailMap;

However, I still can't get it to run on my pixel tablet. So I can't be sure that this is the exact issue that's preventing it from working for others.

Update: Making this an update because I didn't want to ping anyone.

Finally going to move on. I've explored a wide variety of possibilities, refactored the code a few times. Learned a lot, but not how to get it to run properly under gles3.

For those who come after, consider attempting to leverage HDRP macros but I couldn't get them to work.

kheremos avatar Sep 09 '21 21:09 kheremos

image

I opened the sample scene Scenes/Slime and was getting the same as you guys, I noticed the camera was rendering but I just deleted the scene camera and made a new one, and it's fixed, no updates to Vulkan or any other settings needed.

image

wes-kay avatar Aug 06 '23 22:08 wes-kay