AI prompts
base on An experimental converter from Unity to Godot game engines Unity Engine to Godot Engine exporter
=======================================
This is an experimental script that allows you to convert all scenes in your Unity project into a Godot project. It is not aimed at doing everything automatically, only things that can be converted decently.
It's only a proof of concept on simple 2D games for now, and a ton of work remains to be done if it were to support everything else.
While there are always cases where conversion is ambiguous and things to do manually, it's still fun to at least have the ability to automate this to some extent.
I have other projects to work on so I won't work much on this tool for now, and I am aware that there is an abysmal amount of features it could support^^ But feel free to hack around with it and improve it if you like the idea.
How to install
---------------
Copy this repository in your Unity project, inside a folder named `Editor`, and you should see a new `Godot` menu with options in it.
Although it should not modify anything in the project, it's up to you to preserve your data if anything wrong happens :p
Some challenges
-----------------
Here is a random list of things I had to take choices, for which workarounds may or may not exist.
There may be a lot more, but you can get an idea of what this tool has to get through:
- Unity only has `Camera`, but Godot has `Camera2D` and `Camera` for 3D. Choosing which one is ambiguous, so for now I create the 2D version of the camera is orthographic AND if a hint is enabled in the exporter for 2D projects. Also, in Unity, cameras also act as viewports, which is another separate node in Godot, so I'm not sure how to even convert those. Other components are ambiguous too, such as `Light`.
- Godot has separate engines for 2D and 3D, but Unity only has 3D transforms with ortho camera. So the tool tries to guess what usage a GameObject is for by looking at its components. For example, if it has `SpriteRenderer`, or any of its children does, then the GameObject is converted to a `Node2D`. Otherwise, it becomes a `Spatial`. In some cases, it becomes a blank `Node` in cases where dimensions are irrelevant.
- Unity uses components attached to GameObjects for its functionality, but Godot uses a node tree directly. That means a single GameObject with several components may convert into one node and several child nodes. If a GameObject only has a Transform and one component, a shortcut is taken to only produce a single Godot node, eliminating the unnecessary nesting.
- Unity defines rigidbodies as components, but in Godot it is recommended to have such bodies as parent nodes because they control the position of their children, so instead of adding `RigidBodies` as a child nodes, they are have to be promoted as parent.
- Unity can have multiple scripts on the same GameObject, but Godot can only have one per node. So the converter takes the first script it finds to the root node, and create children `Nodes` for each additional script. You may have to have a manual look after conversion if you use composition a lot.
- Converting scripts is very complicated, so the tool rather creates stub scripts for each of them so it can still attach them to the proper final nodes, and attempts to preserve serialized variables. For example, when converting to GDScript, a C# script will be parsed for its variables which will be written as `export` on top of an empty GDScript, and the rest or the original source code is written as a big comment below them. This allows to keep configurations and keep track of what the script should be.
- In Sprite texture resources, Unity allows to define a scaling between pixel coordinates and world coordinates, which is 100 by default, making sprites very small. Godot uses pixels as units at all times, so the plugin attempts to undo this scaling.
- Unity can subdivide a 2D texture into sprites, so this almost always translates to Godot as `AtlasTextures`.
- Unity uses a left-handed coordinate system, and in 2D its Y axis stays upwards. In Godot, the Y axis in 2D is downwards, so the tool attempts to invert positions (not working as best as it could at the moment)
- Godot has no terrain system as of now, but a plugin exists for heightmaps which does not require recompilation. So the plugin could be packaged in the output project, and Unity terrains could be mostly converted to that format.
- Things requiring a recompilation of Godot cannot be supported, for example the Admob module needs to be integrated into Godot manually by recompiling the engine.
- Unity and Godot both support prefabs and nested prefabs, but I haven't worked in this part yet. On Unity side it should be a matter of using `PrefabUtility` to detect if a game object is actually an instance of a prefab, and it needs some research to see which delta-modifications are supported both by Unity and Godot.
- As of 3.1 Godot only saves non-default values in scene data, but this tool can't afford to know them all, so scenes generated by it may be larger than if you had created them in Godot. Saving them from Godot might get rid of the redundancy.
- Unity can imports 3D models as "fixed" prefabs, a bit like Godot does, so I am not sure if the tool should generate scenes for those, or let Godot do it
", Assign "at most 3 tags" to the expected json: {"id":"1505","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"