sschmid / Entitas

Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
MIT License
7k stars 1.11k forks source link

Temp Setup Guide for 1.14.1 #1055

Open eterlan opened 1 year ago

eterlan commented 1 year ago

It's quite struggling for me to grasp all the infomation from issue to setup the project, maybe it's just me not smart enough but anyway. For someone who watch video and want to try this wonderful framework. Tutorial or installing guide is temproraly broken, so follow these steps instead.

  1. Create a new Unity project.
  2. Download Entitas and Jenny from releases. Copy the content inside Entitas to Assets/, then copy the content inside Jenny to project root folder. It should looks exactly like this project Sample.
  3. Paste anything
  4. In the menu bar, find Tools -> Jenny -> Preference -> Edit Jenny/properties. Copy the content from Sample Jenny.properties to override this file.
  5. Assets -> Open C# projects to open your Rider (no idea what would happens to VS or VSCode). Rider -> Terminal input: dotnet Jenny/Jenny.Generator.Cli.dll server
  6. Rider -> Terminal click "+" to open another window and type: dotnet Jenny/Jenny.Generator.Cli.dll client gen
  7. If folder structure is correct, than it should have no problems in win10, Unity2022.2.1f1

Tips:

  1. Visual Debugger doesn't work. #999
emadgh commented 1 year ago

Hi, I'm new to Entitas, the documents doesn't match the current version. I'm a little confused.

After doing all above it generates 0 files. The generator just create an empty "Generated" folder.

eterlan commented 1 year ago

@emadgh Hi, yes it's quite confused.. Did you download the sample project metioned in step 2? Can you generate file with command in that project? If that's fine (should be fine), it should be no problem if you has exactly same folder structure as that sample project has. Also, Don't use the generate button in Jenny, it's broken at this time.

Vikta5 commented 1 year ago

I will add a few comments:

It is all work in win11.

UPD: The problem with the rider's terminal was at my side (rider took local, not global PATH, where dotnet was registered)

emadgh commented 1 year ago

@Vikta5 Hi there, the sample project is working and generating code via Terminal is possible, I removed everything and start using it for learning Entitas. Thanks.

bb8bb9 commented 1 year ago

I really trying this guide, but in the end just intall the v1.13 :/

huyinings commented 1 year ago

the documents doesn't match the current version .it takes me half day to start entitas .here 's my steps.

use "dotnet --info" in cmd to make sure u install the dotnet sdks 6.

  1. download the entitas.zip and jenny.zip in the lastest releases version (like 1.14.1)

  2. unzip them in seprate folder

  3. create a new unity3d project.(for ex: 2021.3.18f)

  4. after this step, the structure like project Sample

    1. copy the whole content inside the entitas's zip to Assets/ 。 the search path in jeny properties (from Sample ) need this。
    2. copy the whole content inside the jeny's zip to project root folder .
  5. open C# Project once inside unity ,or create a empty C# script after compiled success。

  6. copy the Jenny.properties and Entitas.properties from Sample to project root.

  7. excute cmd :

    cd My/Project #which is project root,jeny is here .
    dotnet Jenny/Jenny.Generator.Cli.dll gen
  8. u will see the generated code in unity from cmd。

heavyfront commented 1 year ago

Hi. I have this issue - Specify the project file to use, as this "project path" contains several of these files. What i need to do? Help pls.

helpmoy commented 12 months ago

where is Jenny.properties and Entitas.properties? please tell me ,brother thankyou

sschmid commented 12 months ago

Sorry for the confusion! The setup with Entitas 1.14 changed a little but because I migrated to dotnet 6.0 (instead of mono).

As always, if you have any issues or trouble getting Entitas or Jenny to work, I strongly recommend having a look at the sample game:

Even when the docs are not updated yet, this sample game is always up to date and uses the latest Entitas version. It's always worth checking it.

@huyinings already shared the correct steps to do, I'll summarize them again and try to answer all questions:

Example jenny gen

dotnet Jenny/Jenny.Generator.Cli.dll gen


- you need dotnet 6.0 installed. Latest version is dotnet 7.0 now, but you also need dotnet 6 in order to run Jenny. That's not a problem, you can have multiple dotnet runtimes installed, e.g. dotnet `6.0`, `7.0`, `8.0-preview`. Get dotnet 6.0 here: https://dotnet.microsoft.com/en-us/download/dotnet/6.0
- if you're not quite sure what jenny auto-update does or how it works, don't worry, just copy the [Jenny.properties](https://github.com/sschmid/Match-One/blob/main/Jenny.properties) file from Match-One into you project folder and everything should work. Don't do jenny auto-update after you copied that file. Or at least commit it first to see the changes.
- use the terminal and `dotnet Jenny/Jenny.Generator.Cli.dll server` or `dotnet Jenny/Jenny.Generator.Cli.dll gen` to generate. Jenny uses dotnet 6.0 and roslyn which doesn't work in Unity for now. Generating in Unity while using the roslyn data providers will fail. Generating in the terminal using jenny server is the fastest way to generate, so I think it's fine for now that it does not work in Unity. Btw, I'm currently working on replacing Jenny with C# source generators which will simplify the whole Entitas setup drastically. It will also enable namespaces for contexts and components + will support multiple projects, e.g. when using multiple Unity asmdef. See #1005

If you have further issue let me know, and I'll update my post!
thenitro commented 10 months ago

it's pity that such cool project became so absurdly overcomplicated to install/update that it became absolutely unusable. I just spent whole morning trying to figure out the migration process, and still end up with Specify which project file to use because this '/MyPath/To/Project' contains more than one project file., this is way too retarded

sschmid commented 10 months ago

@thenitro sorry for the inconvenience. The initial setup caused trouble for many, but is essentially the same as previously, only using dotnet 6. I'm to blame for the lack of documentation for Jenny, I'll do better in Entitas 2.0 (by removing Jenny 😅)

For now Match One's Jenny.properties is your best friend

thenitro commented 10 months ago

nice! can't wait for Entitas 2.0. I'm currently using 0.13 for my pet city builder project and it works nicely, just wanter to give it a little bump up, anyway good job with Entitas, just don't forget about migration from older versions ))

synthetic-w commented 10 months ago

I've completed all the steps but still have an issue (screenshot attached)

image

synthetic-w commented 10 months ago

I've completed all the steps but still have an issue (screenshot attached)

image

The first line causes an exception. But without this line the generation doesn't work properly. Screenshot 2023-08-30 170532

sschmid commented 10 months ago

@synthetic-w the exception can happen when the Jenny.properties file is invalid due to wrong syntax. If you can post it we see where the problem is

GRESHNIK512 commented 7 months ago

Downloaded the project Match One on mac Unity 2022.3.13.f1 and 2021 I get an error when generating:

Unable to load shared library 'hostfxr' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libhostfxr, 1): image not found

wes-kay commented 7 months ago

If you have further issue let me know, and I'll update my post!

I've just tried to import your project through your suggestion in this thread and it's still a pain to try and get this working using the Jenny generate. image

Are there any real resources on this new update we can actually use?

I'm currently having to run the jenny server and do a 'Generate with server', is that what I'm supposed to do? And should it take this long? Generated 23 files in 192.2 seconds

GRESHNIK512 commented 7 months ago

1) Отсутствует библиотека 'hostfxr' (dotnet fatal error hostfxr.dll) Необходимо перейти в папке /usr (на MacOS через Переход-Переход в папке) и скопировать содержимое папки /local/share/dotnet/"нужная версия dotnet" в папку /local/lib 2) Не может загрузить из библиотеки 'hostfxr' (Unable to load shared library 'hostfxr') Переместить файл libhostfxr.dylib из /usr/local/share/dotnet/host/fxr/"нужная версия" в /usr/local/share/dotnet/shared/Microsoft.NETCore.App/"нужная версия" командой

sudo cp /usr/local/share/dotnet/host/fxr/"нужная версия"/libhostfxr.dylib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/"нужная версия"

Result in my Terminal:

Marat@Marat-iMac ~ % sudo cp /usr/local/share/dotnet/host/fxr/6.0.25/libhostfxr.dylib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/6.0.25

Link: https://github.com/microsoft/vscode-dotnettools/issues/120#issuecomment-1640892593