Hi everyone, sorry for the noobish question, but i feel kinda lost.
I’m working on a reinforcement learning simulation, and i’m looking for ways to make a 2d representation of the neural net (basically just colored circles connected with colored lines).
The project is 3d, i’ve never worked with UI, nor with 2d elements. The idea is to click on the agent, and to have his brain displayed on a 2d panel in the upper right corner of the screen.
I’ve followed some tutorials about ui, but they all seems overly complicated for such a simple result.
any suggestion on where should i start, and what should i study to achieve my goal?
When it comes to 2D graphics in Unity, you have at least three options:
Sprites position in 3D
The component/GameObject-based UI system (originated in Unity 4.6)
UI Toolkit (this forum)
When positioning sprites in 3D you would have to implement layouting yourself to fit things into the camera’s view, so I wouldn’t recommend it. UI Toolkit is relatively new and the available documentation is not as detailed as for the older UI system. For the time being and your use-case, I would recommend looking into the regular UI system. It’s very easy to throw together panels and things with GameObjects in the scene. You can also use a RenderTexture and RawImage to display the viewport contents of any camera in the scene, for example without any scripting required. Not sure what you’re looking for exactly, but it’s also possible to position graphics drawn by the Image component via scripting and so on. Would need more information to give more advice.
thanks for you reply, i’ll try to be more specific.
I have a bunch of “3D bacteria” running around my screen, each of them has a neural net that process information from the environment, and outputs an action.
here’s an image from the NEAT algorithm paper, to let you better understand how a neural net is represented.
As you can see, i have a list of nodes (node genes) and a list of connections.
Nodes are the “circles”, they have their unique id, and a type. Sensors (inputs) go at the bottom, output are the uppermost neurons, and hidden neurons go in the middle.
Connections describe how nodes are linked together (in - out), and are depicted as lines.
My goal, is to click on a bacteria, and have his neural net topology depicted on a 2d panel onto the screen.
I can easily access data in the genome, but when it comes to position circles and lines on the panel i feel lost, and i find it way more convolute then the rest of the project.
That’s why i thought i was doing something wrong and started asking questions
Hope that explain my situation a little bit better