1. Dashboard
  2. Forum
  3. Filebase
  4. Lexikon
  5. Artikel
  6. Spieletest
  7. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  8. Zur Transport Fever Community
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Filebase-Eintrag
  • Lexikon
  • Artikel (Bewertungssystem)
  • Erweiterte Suche
  1. WiSim Welt
  2. Mitglieder
  3. eis_os

Beiträge von eis_os

  • Modifizierbarkeit von CiM2

    • eis_os
    • 21. April 2013 um 12:08

    Ein Diagramm von CIM2 wäre zu viel des guten wenn ich es hier Posten würde. C# ist mit den richtigen Tools sehr gesprächig. Leider ist Unity Bundle Laden aber im Native Code.

    nodding, Kippverhalten beim bremsen, beschleunigen würde ich sagen., ist es.

    Ein mainAsset kann der UnityEditor nicht finden, ich bekomme einfach keine GameObjekte importiert an einem Stück, die Verbindungen aller Objekte zerbröckelt immer.
    Der Bundle Lader in Unity scheint sowieso ein Sorgenkind zu sein, da er keine Fehler für den Entwickler ausgibt wenn etwas nicht funktioniert.

    Da CIM2 auch die Animationen adressiert, werden Objekte (Fahrzeuge) ohne die richtigen Animationen nicht funktionieren. Oder es gibt ein Exception im Code.
    Deswegen wäre es mir schon lieb den Unity Free Editor als Basis zum Zusammenbau der Teile zu nutzen. Denn das Teil in ein asset zu Speichern und per externen Tool in ein CIM2 Bundle zu überführen.
    Wobei mein CIM2 schon ein externes Helloworld DLL lädt :D

  • Modifizierbarkeit von CiM2

    • eis_os
    • 20. April 2013 um 21:14

    Hallo

    Auch wenn ich nicht viel neues Berichten kann, vielleicht interessiert es ja doch jemanden.

    Komplexität eines Gebäudes, ein Reise durch CIM2:

    CIM2 lädt ein Bundle mit verschiedenen Datastores:

    Ein PlaceableDataStore beinhaltet ein Array mit PlaceableInfo (s)
    PlaceableInfo beinhaltet ein Pointer zu einen PlaceableObject

    Ein PlaceableObject hat eine ID, die muss Eindeutig sein, damit CIM2 das Teil in seinen Bundles wiederfindet.
    PlaceableObject hat darüber hinaus:
    Preis
    Wie viel Elektrizität es benötigt.
    Informationen für einen Strassentyp, und die Position.
    Wartungskosten
    Children Array[] PlaceableChild(beinhaltet Position, Rotation, PlaceableObject)
    Varianten Array[] PlaceableVariation(beinhaltet PlaceableObjects)

    Dieses PlaceableObject basiert auf einen MapObject (ein Art Interface Zwischenschicht für virtuelle Mesh Funktionen), dieses beinhaltet ein ObjectData.
    ObjectData beinhaltet einen prefab, ein UnityEngine.GameObject


    Und woher kommt das Mesh? Dafür ist ein BuildingObject zuständig ist, es ist eine Ableitung von PlaceableObject das die Meshfunktionen von MapObject mit "leben" füllt.
    Darin wird eine Instanz des UnityEngine.GameObject erstellt wenn benötigt.


    Und deswegen ist das Bundles Format so verkorkst. ;(

  • Modifizierbarkeit von CiM2

    • eis_os
    • 18. April 2013 um 19:06

    Irgendwie möchte Unity nicht mehr herausgeben, hier meine letzte Version des Editor Scripts. Vielleicht kann es doch noch jemand brauchen...

    Spoiler anzeigen
    Code
    using UnityEngine;
    using System.Collections;
    using System.Text;
    using System.Collections.Generic;
    
    
    using UnityEditor;
    using UnityEditorInternal;
    using System.IO;
    using System.Reflection;
    
    
    public class eisUncompressBundle : MonoBehaviour
    {
        [MenuItem("Assets/Dump Bundle %u")]
    
        static void Unpack ()
        {
            string file = EditorUtility.OpenFilePanel ("Select bundle file to unpack", "", "bundle");
            if (file.Length == 0)
                return;
    		AssetBundle bundle;
    		var wwwoobj = new WWW ("file:///" + file);
    
    		bundle = wwwoobj.assetBundle;
    		try {
    			ProcessBundle(file, bundle);
    		} catch {
    			bundle.Unload(true);
    			throw;
    		}
    		bundle.Unload(true);
    	}
    	static void ProcessBundle(string file, AssetBundle bundle)
        {
    		string outdir = "Assets/"+Path.GetFileNameWithoutExtension(file)+"_output/";
    		Directory.CreateDirectory(outdir);
    
    		StreamWriter sw = File.AppendText(outdir+Path.GetFileNameWithoutExtension(file)+".txt");
    		sw.AutoFlush = true;
    		sw.WriteLine("===================================================\n");
    
            Object[] objs1 = bundle.LoadAll();
    		foreach (Object obj in objs1) {
    			string filename = obj.name.Replace('/', '_');
    			System.Type type = obj.GetType ();
    			string itemdata = "";
    			PropertyInfo[] properties = type.GetProperties();
    			itemdata = "Name: "+obj.name+"\n";
    			itemdata += "   Instanceid: "+obj.GetInstanceID() +"\n";
    			itemdata += "   HashCode: "+obj.GetHashCode() +"\n"; 
    			itemdata += "   Type: "+type.ToString() +"\n";
    			foreach (System.Reflection.PropertyInfo prop in properties) {
    				try {
    					itemdata += "   Prop: "+prop.Name + "= "+ prop.GetValue(obj,null).ToString() + "\n"; 
    	            } catch {
    					itemdata += "   Prop: "+prop.Name + "= ?can't reflect?" + "\n"; 
    	            }
    
    			}
    
    			sw.WriteLine(itemdata);
    
    			string outdirtype = outdir+type.Name+"/";
    			string f;
    			Object o;
    
    
    			Directory.CreateDirectory(outdirtype);
    			obj.hideFlags = 0;
    			if (type == typeof(GameObject) || (type.IsSubclassOf (typeof(GameObject)))) {
    
    				f = outdirtype + filename + ".prefab";
                    Object prefab = PrefabUtility.CreateEmptyPrefab (f);
                    if (obj == null) {
                        //Debug.LogError ("NullException");
                    } else {
                    	PrefabUtility.ReplacePrefab ((GameObject)(obj), prefab);
    				}
    			} else if (type == typeof(Material) || (type.IsSubclassOf (typeof(Material)))) {
    				f = outdirtype + filename + ".mat";
    				o = Object.Instantiate (obj);
    				AssetDatabase.CreateAsset(o, f);
    			} else if (type == typeof(Texture2D ) || (type.IsSubclassOf (typeof(Texture2D )))) {
    				/*Texture2D tex = (Texture2D)obj;
    				itemdata += "Textureformat: "+(int)tex.format+"\n";
    				var bytes = tex.EncodeToPNG();
    	        	File.WriteAllBytes(outdir+filename+".png", bytes);
    	        	*/
    				f = outdirtype + filename + ".tex";
    				o = Object.Instantiate (obj);
    				AssetDatabase.CreateAsset(o, f);
    			} else if (type == typeof(UnityEngine.Mesh)) {
    				Directory.CreateDirectory(outdir+"objs/");
    				ExportObj( (UnityEngine.Mesh)obj,outdir+"objs/"+filename+".obj");
    				try {
    					o = Object.Instantiate (obj);
    				} catch {
    					o = obj;
    				}
    				f = outdirtype + filename + ".asset";
    				AssetDatabase.CreateAsset(o, f);
    			} else {
    				try {
    					o = Object.Instantiate (obj);
    				} catch {
    					o = obj;
    				}
    				f = outdirtype + filename + ".asset";
    				AssetDatabase.CreateAsset(o, f);
    			}
    			Debug.Log(itemdata);
    			/* Object o;
    			try {
    				o = Object.Instantiate (obj);
    			} catch {
    				o = obj;
    			}
    			o.hideFlags = 0; */
    		}
    		AssetDatabase.Refresh ();
    		sw.Close();
        }
     
    
    
    	static void ExportObj(UnityEngine.Mesh m, string filename) {
    
    
    		System.IO.StreamWriter file = new System.IO.StreamWriter(filename);
    		file.WriteLine("g "+m.name);
    		file.WriteLine("# vertices");
    
    		var ver = m.vertices;
    		for(int i = 0; i < ver.Length; i++) {
    			//file.WriteLine(string.Format("#Index: {0}\n", i));
    			file.WriteLine(string.Format("v {0} {1} {2}\n",ver[i].x.ToString(),ver[i].y.ToString(),ver[i].z.ToString()));
    		}
    
    		file.WriteLine("# normals");
    		var vn = m.normals;
    		for(int i = 0; i < vn.Length; i++) {
    			file.WriteLine(string.Format("vn {0} {1} {2}\n",vn[i].x.ToString(),vn[i].y.ToString(),vn[i].z.ToString()));
    		}
    
    		file.WriteLine("# uv");
    		var uv = m.uv;
    		for(int i = 0; i < uv.Length; i++) {
    			file.WriteLine(string.Format("vt {0} {1}\n",uv[i].x.ToString(),uv[i].y.ToString()));
    		}
    
    		file.WriteLine("# uv1");
    		var uv1 = m.uv1;
    		for(int i = 0; i < uv1.Length; i++) {
    			file.WriteLine(string.Format("vt1 {0} {1}\n",uv1[i].x.ToString(),uv1[i].y.ToString()));
    		}
    
    		file.WriteLine("# uv2");
    		var uv2 = m.uv2;
    		for(int i = 0; i < uv1.Length; i++) {
    			file.WriteLine(string.Format("vt2 {0} {1}\n",uv2[i].x.ToString(),uv2[i].y.ToString()));
    		}
    
    		file.WriteLine("# colors");
    		foreach(Color c in m.colors) {
                file.WriteLine(string.Format("vc {0} {1} {2} {3}\n",c.r,c.g,c.b,c.a));
            }
    
            for (int material=0; material < m.subMeshCount; material ++) {
    		/*	file.WriteLine("#");
                file.WriteLine("usemtl "+mats[material].name);
                file.WriteLine("usemap "+mats[material].name);
     */
                int[] triangles = m.GetTriangles(material);
                for (int i=0;i<triangles.Length;i+=3) {
                    file.WriteLine(string.Format("f {0}/{0}/{0} {1}/{1}/{1} {2}/{2}/{2}\n", 
                        triangles[i]+1, triangles[i+1]+1, triangles[i+2]+1));
                }
            }
    		file.Close();
    	}
    }
    Alles anzeigen
  • Modifizierbarkeit von CiM2

    • eis_os
    • 17. April 2013 um 07:18

    Kommt, bin mir nur noch nicht sicher ob in das in C# oder in C schreiben werde,
    erst mal muss man aber die ganzen anderen Sachen verstehen und wie die Abhängigkeiten aufgelöst werden.
    (Verbindung zwischen Textur2D -> Material -> GameObject -> Mesh)

    Außerdem wird es einfacher sein ein fertiges Bundle im UnityEditor zu laden und etwaige Probleme zu sehen als immer CIM2 zu laden ;)

  • Modifizierbarkeit von CiM2

    • eis_os
    • 16. April 2013 um 21:23

    Hallo

    Die Mesh Objekte eines Bundles können nun ohne Materialien in ein Wavefront Objekt exportiert werden. 8)
    Unity 3D Bundle Mesh Exporter/Extract/UnCompressor:

    Empty Unity Projekt, Editor/eisUncompressBundle.cs

    Code
    using UnityEngine;
    using System.Collections;
    using System.Text;
    using System.Collections.Generic;
    
    
    using UnityEditor;
    using UnityEditorInternal;
    using System.IO;
    using System.Reflection;
    
    
    public class eisUncompressBundle : MonoBehaviour
    {
        [MenuItem("Assets/Dump Bundle %u")]
    
        static void Unpack ()
        {
            string file = EditorUtility.OpenFilePanel ("Select bundle file to unpack", "", "bundle");
            if (file.Length == 0)
                return;
    		string outdir = Path.GetFileNameWithoutExtension(file)+"_output/";
    		Directory.CreateDirectory(outdir);
    		AssetBundle bundle;
    		var wwwoobj = new WWW ("file:///" + file);
    
    		bundle = wwwoobj.assetBundle;
    		try {
    			ProcessBundle(file, outdir, bundle);
    		} catch {
    			bundle.Unload(true);
    			throw;
    		}
    		bundle.Unload(true);
    	}
    	static void ProcessBundle(string file, string outdir, AssetBundle bundle)
        {
    		StreamWriter sw = File.AppendText(Path.GetFileNameWithoutExtension(file)+".txt");
    		sw.AutoFlush = true;
    		sw.WriteLine("===================================================\n");
    
            Object[] objs1 = bundle.LoadAll();
    		foreach (Object obj in objs1) {
    			string filename = obj.name.Replace('/', '_');
    			System.Type type = obj.GetType ();
    			string itemdata = "";
    			PropertyInfo[] properties = type.GetProperties();
    			itemdata = "Name: "+obj.name+"\n";
    			itemdata += "   Instanceid: "+obj.GetInstanceID() +"\n";
    			itemdata += "   HashCode: "+obj.GetHashCode() +"\n"; 
    			itemdata += "   Type: "+type.ToString() +"\n";
    			foreach (System.Reflection.PropertyInfo prop in properties) {
    				try {
    					itemdata += "   Prop: "+prop.Name + "= "+ prop.GetValue(obj,null).ToString() + "\n"; 
    	            } catch {
    					itemdata += "   Prop: "+prop.Name + "= ?can't reflect?" + "\n"; 
    	            }
    
    			}
    
    			sw.WriteLine(itemdata);
    
    
    			if (type == typeof(Material) || (type.IsSubclassOf (typeof(Material)))) {
    
    
    			} else if (type == typeof(Texture2D ) || (type.IsSubclassOf (typeof(Texture2D )))) {
    
    
    			} else if (type == typeof(UnityEngine.Mesh)) {
    				ExportObj( (UnityEngine.Mesh)obj,outdir+filename+".obj");
    			} else {
    				//sw.WriteLine(StackOverflowObjectDumper.Dump(obj));
    			}
    			Debug.Log(itemdata);
    		}
    		sw.Close();
        }
     
    
    
    	static void ExportObj(UnityEngine.Mesh m, string filename) {
    
    
    		System.IO.StreamWriter file = new System.IO.StreamWriter(filename);
    		file.WriteLine("g "+m.name);
    		file.WriteLine("# vertices");
    
    		var ver = m.vertices;
    		for(int i = 0; i < ver.Length; i++) {
    			//file.WriteLine(string.Format("#Index: {0}\n", i));
    			file.WriteLine(string.Format("v {0} {1} {2}\n",ver[i].x.ToString(),ver[i].y.ToString(),ver[i].z.ToString()));
    		}
    
    		file.WriteLine("# normals");
    		var vn = m.normals;
    		for(int i = 0; i < vn.Length; i++) {
    			file.WriteLine(string.Format("vn {0} {1} {2}\n",vn[i].x.ToString(),vn[i].y.ToString(),vn[i].z.ToString()));
    		}
    
    		file.WriteLine("# uv");
    		var uv = m.uv;
    		for(int i = 0; i < uv.Length; i++) {
    			file.WriteLine(string.Format("vt {0} {1}\n",uv[i].x.ToString(),uv[i].y.ToString()));
    		}
    
    		file.WriteLine("# uv1");
    		var uv1 = m.uv1;
    		for(int i = 0; i < uv1.Length; i++) {
    			file.WriteLine(string.Format("vt1 {0} {1}\n",uv1[i].x.ToString(),uv1[i].y.ToString()));
    		}
    
    		file.WriteLine("# uv2");
    		var uv2 = m.uv2;
    		for(int i = 0; i < uv1.Length; i++) {
    			file.WriteLine(string.Format("vt2 {0} {1}\n",uv2[i].x.ToString(),uv2[i].y.ToString()));
    		}
    
    		file.WriteLine("# colors");
    		foreach(Color c in m.colors) {
                file.WriteLine(string.Format("vc {0} {1} {2} {3}\n",c.r,c.g,c.b,c.a));
            }
    
            for (int material=0; material < m.subMeshCount; material ++) {
    		/*	file.WriteLine("#");
                file.WriteLine("usemtl "+mats[material].name);
                file.WriteLine("usemap "+mats[material].name);
     */
                int[] triangles = m.GetTriangles(material);
                for (int i=0;i<triangles.Length;i+=3) {
                    file.WriteLine(string.Format("f {0}/{0}/{0} {1}/{1}/{1} {2}/{2}/{2}\n", 
                        triangles[i]+1, triangles[i+1]+1, triangles[i+2]+1));
                }
            }
    		file.Close();
    	}
    }
    Alles anzeigen
  • Modifizierbarkeit von CiM2

    • eis_os
    • 16. April 2013 um 18:51
    Code
    Name: park-props_n
       Instanceid: 5164
       HashCode: 5164
       Type: UnityEngine.Texture2D
       Prop: mipmapCount= 10
       Prop: format= DXT5
       Prop: width= 512
       Prop: height= 512
       Prop: filterMode= Bilinear
       Prop: anisoLevel= 4
       Prop: wrapMode= Repeat
       Prop: mipMapBias= 0
       Prop: texelSize= (0.0, 0.0)
       Prop: name= park-props_n
       Prop: hideFlags= 0
    Textureformat: 12
    
    
    Und hier alle Texturformate laut (Unity)MonoDevelop 
    public enum TextureFormat
    	{
    		Alpha8 = 1,
    		ARGB4444,
    		RGB24,
    		RGBA32,
    		ARGB32,
    		RGB565 = 7,
    		DXT1 = 10,
    		DXT5 = 12,
    		PVRTC_2BPP_RGB = 30,
    		PVRTC_2BPP_RGBA,
    		PVRTC_4BPP_RGB,
    		PVRTC_4BPP_RGBA,
    		PVRTC_RGB2 = 30,
    		PVRTC_RGBA2,
    		PVRTC_RGB4,
    		PVRTC_RGBA4,
    		ETC_RGB4,
    		ATC_RGB4,
    		ATC_RGBA8,
    		BGRA32,
    		ATF_RGB_DXT1,
    		ATF_RGBA_JPG,
    		ATF_RGB_JPG
    	}
    Alles anzeigen


    Nunja, brauchbar ist es nicht wenn ein Teil nicht da ist und der Exporter aus dem Unity Wiki kommt.
    An die Texturen komme ich bis jetzt nicht, da er immer meckert, kann nicht clonen oder nicht für die Scriptnutzung freigeschaltet

  • Modifizierbarkeit von CiM2

    • eis_os
    • 15. April 2013 um 22:36

    Ja, ich nutze die C# Interfaces + Reflection, d.h. ich nutze die RohDaten und die Sprachfeatures von C#.
    Unity Free kann zwar keine Bundles erstellen, laden kann es aber die Unity Basis Objekte daraus, aber eher schlecht als recht.
    Über einen Dump mit noch mehr Infos hab ich die Mesh Daten gesehen und hab Sie dann exportiert. Die Meshes konnte ich bis jetzt leider noch nicht in den Editor bringen,
    geschweige denn irgendwelche Texturen oder sonstige Objekte.

    Bei den Waverfront obj Dateien die mein Script gerade erstellt sind die Dächer alle kaputt. Hab auch mal die Vehicles.bundle getestet, selbes Problem. Autos ohne Dach.
    Irgendwie funktionieren die Verbindungen auch unter den einzelnen Objekte nicht richtig. (C# Pointer) Daher stolpert mein Script auch von einenm try catch block zum nächsten.

  • Modifizierbarkeit von CiM2

    • eis_os
    • 15. April 2013 um 19:43

    Also laut meinen Unity Script sollte die Textur eine DXT1 Format haben.

    Spoiler anzeigen
    Code
    Name: pavillion-lod1
       Instanceid: 5846
       HashCode: 5846
       Type: UnityEngine.Mesh
       Prop: vertices= UnityEngine.Vector3[]
       Prop: normals= UnityEngine.Vector3[]
       Prop: tangents= UnityEngine.Vector4[]
       Prop: uv= UnityEngine.Vector2[]
       Prop: uv2= UnityEngine.Vector2[]
       Prop: uv1= UnityEngine.Vector2[]
       Prop: bounds= Center: (0.0, 5.0, 0.0), Extents: (5.0, 5.0, 5.0)
       Prop: colors= UnityEngine.Color[]
       Prop: colors32= UnityEngine.Color32[]
       Prop: triangles= System.Int32[]
       Prop: vertexCount= 686
       Prop: subMeshCount= 1
       Prop: boneWeights= UnityEngine.BoneWeight[]
       Prop: bindposes= UnityEngine.Matrix4x4[]
       Prop: name= pavillion-lod1
       Prop: hideFlags= 0
    
    
    Name: pavilion-lod1
       Instanceid: 5858
       HashCode: 5858
       Type: UnityEngine.Texture2D
       Prop: mipmapCount= 9
       Prop: format= DXT1
       Prop: width= 256
       Prop: height= 256
       Prop: filterMode= Trilinear
       Prop: anisoLevel= 4
       Prop: wrapMode= Repeat
       Prop: mipMapBias= 0
       Prop: texelSize= (0.0, 0.0)
       Prop: name= pavilion-lod1
       Prop: hideFlags= 0
    Textureformat: 10
    
    
    Name: pavilion-lod1-Material #27
       Instanceid: 5894
       HashCode: 5894
       Type: UnityEngine.Material
       Prop: shader=  (UnityEngine.Shader)
       Prop: color= RGBA(0.000, 0.000, 0.000, 0.000)
       Prop: mainTexture= pavilion-lod1 (UnityEngine.Texture2D)
       Prop: mainTextureOffset= (0.0, 0.0)
       Prop: mainTextureScale= (1.0, 1.0)
       Prop: passCount= 1
       Prop: renderQueue= 2000
       Prop: name= pavilion-lod1-Material #27
       Prop: hideFlags= 0
    
    
    Name: pavilion-lod1_c
       Instanceid: 5868
       HashCode: 5868
       Type: UnityEngine.Texture2D
       Prop: mipmapCount= 9
       Prop: format= DXT1
       Prop: width= 256
       Prop: height= 256
       Prop: filterMode= Trilinear
       Prop: anisoLevel= 4
       Prop: wrapMode= Repeat
       Prop: mipMapBias= 0
       Prop: texelSize= (0.0, 0.0)
       Prop: name= pavilion-lod1_c
       Prop: hideFlags= 0
    Textureformat: 10
    
    
    Name: pavilion-lod1_s
       Instanceid: 5862
       HashCode: 5862
       Type: UnityEngine.Texture2D
       Prop: mipmapCount= 9
       Prop: format= DXT1
       Prop: width= 256
       Prop: height= 256
       Prop: filterMode= Trilinear
       Prop: anisoLevel= 4
       Prop: wrapMode= Repeat
       Prop: mipMapBias= 0
       Prop: texelSize= (0.0, 0.0)
       Prop: name= pavilion-lod1_s
       Prop: hideFlags= 0
    Textureformat: 10
    
    
    Name: pavillion-lod2
       Instanceid: 5840
       HashCode: 5840
       Type: UnityEngine.Mesh
       Prop: vertices= UnityEngine.Vector3[]
       Prop: normals= UnityEngine.Vector3[]
       Prop: tangents= UnityEngine.Vector4[]
       Prop: uv= UnityEngine.Vector2[]
       Prop: uv2= UnityEngine.Vector2[]
       Prop: uv1= UnityEngine.Vector2[]
       Prop: bounds= Center: (0.0, 5.0, 0.0), Extents: (5.0, 5.0, 5.0)
       Prop: colors= UnityEngine.Color[]
       Prop: colors32= UnityEngine.Color32[]
       Prop: triangles= System.Int32[]
       Prop: vertexCount= 204
       Prop: subMeshCount= 1
       Prop: boneWeights= UnityEngine.BoneWeight[]
       Prop: bindposes= UnityEngine.Matrix4x4[]
       Prop: name= pavillion-lod2
       Prop: hideFlags= 0
    
    
    Name: pavilion-lod2
       Instanceid: 5834
       HashCode: 5834
       Type: UnityEngine.Texture2D
       Prop: mipmapCount= 7
       Prop: format= DXT1
       Prop: width= 64
       Prop: height= 64
       Prop: filterMode= Trilinear
       Prop: anisoLevel= 4
       Prop: wrapMode= Repeat
       Prop: mipMapBias= 0
       Prop: texelSize= (0.0, 0.0)
       Prop: name= pavilion-lod2
       Prop: hideFlags= 0
    Textureformat: 10
    
    
    Name: pavilion-lod2-Material #27
       Instanceid: 5814
       HashCode: 5814
       Type: UnityEngine.Material
       Prop: shader=  (UnityEngine.Shader)
       Prop: color= RGBA(0.000, 0.000, 0.000, 0.000)
       Prop: mainTexture= pavilion-lod2 (UnityEngine.Texture2D)
       Prop: mainTextureOffset= (0.0, 0.0)
       Prop: mainTextureScale= (1.0, 1.0)
       Prop: passCount= 1
       Prop: renderQueue= 2000
       Prop: name= pavilion-lod2-Material #27
       Prop: hideFlags= 0
    
    
    Name: pavilion-lod2_c
       Instanceid: 5824
       HashCode: 5824
       Type: UnityEngine.Texture2D
       Prop: mipmapCount= 7
       Prop: format= DXT1
       Prop: width= 64
       Prop: height= 64
       Prop: filterMode= Trilinear
       Prop: anisoLevel= 4
       Prop: wrapMode= Repeat
       Prop: mipMapBias= 0
       Prop: texelSize= (0.0, 0.0)
       Prop: name= pavilion-lod2_c
       Prop: hideFlags= 0
    Textureformat: 10
    
    
    Name: pavilion-lod2_s
       Instanceid: 5832
       HashCode: 5832
       Type: UnityEngine.Texture2D
       Prop: mipmapCount= 7
       Prop: format= DXT1
       Prop: width= 64
       Prop: height= 64
       Prop: filterMode= Trilinear
       Prop: anisoLevel= 4
       Prop: wrapMode= Repeat
       Prop: mipMapBias= 0
       Prop: texelSize= (0.0, 0.0)
       Prop: name= pavilion-lod2_s
       Prop: hideFlags= 0
    Textureformat: 10
    
    
    Name: Pavillion
       Instanceid: 5904
       HashCode: 5904
       Type: UnityEngine.GameObject
       Prop: isStatic= False
       Prop: transform= Pavillion (UnityEngine.Transform)
       Prop: rigidbody= null
       Prop: camera= null
       Prop: light= null
       Prop: animation= null
       Prop: constantForce= null
       Prop: renderer= Pavillion (UnityEngine.MeshRenderer)
       Prop: audio= null
       Prop: guiText= null
       Prop: networkView= null
       Prop: guiElement= null
       Prop: guiTexture= null
       Prop: collider= null
       Prop: hingeJoint= null
       Prop: particleEmitter= null
       Prop: layer= 10
       Prop: active= False
       Prop: tag= Untagged
       Prop: gameObject= Pavillion (UnityEngine.GameObject)
       Prop: name= Pavillion
       Prop: hideFlags= 0
    
    
    Name: Pavillion
       Instanceid: 5826
       HashCode: 5826
       Type: UnityEngine.Transform
       Prop: position= (0.0, 0.0, 0.0)
       Prop: localPosition= (0.0, 0.0, 0.0)
       Prop: eulerAngles= (0.0, 0.0, 0.0)
       Prop: localEulerAngles= (0.0, 0.0, 0.0)
       Prop: right= (1.0, 0.0, 0.0)
       Prop: up= (0.0, 1.0, 0.0)
       Prop: forward= (0.0, 0.0, 1.0)
       Prop: rotation= (0.0, 0.0, 0.0, 1.0)
       Prop: localRotation= (0.0, 0.0, 0.0, 1.0)
       Prop: localScale= (1.0, 1.0, 1.0)
       Prop: parent= null
       Prop: worldToLocalMatrix= 1.00000	0.00000	0.00000	0.00000
    0.00000	1.00000	0.00000	0.00000
    0.00000	0.00000	1.00000	0.00000
    0.00000	0.00000	0.00000	1.00000
    
    
       Prop: localToWorldMatrix= 1.00000	0.00000	0.00000	0.00000
    0.00000	1.00000	0.00000	0.00000
    0.00000	0.00000	1.00000	0.00000
    0.00000	0.00000	0.00000	1.00000
    
    
       Prop: root= Pavillion (UnityEngine.Transform)
       Prop: childCount= 0
       Prop: lossyScale= (1.0, 1.0, 1.0)
       Prop: transform= Pavillion (UnityEngine.Transform)
       Prop: rigidbody= null
       Prop: camera= null
       Prop: light= null
       Prop: animation= null
       Prop: constantForce= null
       Prop: renderer= Pavillion (UnityEngine.MeshRenderer)
       Prop: audio= null
       Prop: guiText= null
       Prop: networkView= null
       Prop: guiElement= null
       Prop: guiTexture= null
       Prop: collider= null
       Prop: hingeJoint= null
       Prop: particleEmitter= null
       Prop: particleSystem= null
       Prop: gameObject= Pavillion (UnityEngine.GameObject)
       Prop: active= False
       Prop: tag= Untagged
       Prop: name= Pavillion
       Prop: hideFlags= 0
    
    
    Name: pavillion
       Instanceid: 5932
       HashCode: 5932
       Type: UnityEngine.Mesh
       Prop: vertices= UnityEngine.Vector3[]
       Prop: normals= UnityEngine.Vector3[]
       Prop: tangents= UnityEngine.Vector4[]
       Prop: uv= UnityEngine.Vector2[]
       Prop: uv2= UnityEngine.Vector2[]
       Prop: uv1= UnityEngine.Vector2[]
       Prop: bounds= Center: (0.0, 5.0, 0.0), Extents: (5.0, 5.0, 5.0)
       Prop: colors= UnityEngine.Color[]
       Prop: colors32= UnityEngine.Color32[]
       Prop: triangles= System.Int32[]
       Prop: vertexCount= 1216
       Prop: subMeshCount= 1
       Prop: boneWeights= UnityEngine.BoneWeight[]
       Prop: bindposes= UnityEngine.Matrix4x4[]
       Prop: name= pavillion
       Prop: hideFlags= 0
    
    
    Name: pavillion-Material #27
       Instanceid: 5918
       HashCode: 5918
       Type: UnityEngine.Material
       Prop: shader=  (UnityEngine.Shader)
       Prop: color= RGBA(0.000, 0.000, 0.000, 0.000)
       Prop: mainTexture= park-props (UnityEngine.Texture2D)
       Prop: mainTextureOffset= (0.0, 0.0)
       Prop: mainTextureScale= (1.0, 1.0)
       Prop: passCount= 1
       Prop: renderQueue= 2000
       Prop: name= pavillion-Material #27
       Prop: hideFlags= 0
    Alles anzeigen


    -edit-
    Der ObjExporter auf dem Unity Wiki erstellt keine richtigen Objekte wenn ich es mit dem UnityEngine.Mesh pavillion Objekt füttere.

  • Modifizierbarkeit von CiM2

    • eis_os
    • 15. April 2013 um 07:17

    Unity:

    Kein Wunder das sich Unity weigert mir die Daten als PNG zu extrahieren, da diese als nicht lesbar markiert sind. *grumel*
    Vielleicht hilft es den CIM2 Bundle Loader nachzubauen...
    Man kann die Daten (Objekte) in einem Bundle clonen, dabei geht bei mir aber noch die Zuordnung zwischen den einzelnen Teilen Kaputt.


    Der Unity Assets Expolorer macht aus TEX Daten Texturen, vielleicht hilft das.

  • "fatal error in gc"

    • eis_os
    • 14. April 2013 um 11:28

    Ja, die obere Hälfte ist für den Kernel reserviert.

    Dazu auch Gebbiz:
    Paradox Interactive Forums

  • Modifizierbarkeit von CiM2

    • eis_os
    • 13. April 2013 um 19:32

    Da ja hier genölt wurde, ich hätte mich mit Unity nicht auseinander gesetzt, brauchbare Ergebnisse gibt es bis jetzt nicht.

    Ein neues Unity Projekt aufmachen, ein Verzeichnis "Editor" erstellen, dort eine neue C# Datei mit diesen Inhalt:
    In UI gibt es dann einen neuen Menüpunkt, die Informationen landen in der Console.

    Code
    using UnityEngine;
    using System.Collections;
    
    
    using UnityEditor;
    using UnityEditorInternal;
    using System.IO;
    using System.Reflection;
    
    
    public class eisUncompressAssert : MonoBehaviour
    {
        [MenuItem("Assets/Dump Bundle %u")]
        static void Unpack ()
        {
            string file = EditorUtility.OpenFilePanel ("Select bundle file to unpack", "", "bundle");
            if (file.Length == 0)
                return;
    		AssetBundle bundle;
    		var wwwoobj = new WWW ("file:///" + file);
    
    		bundle = wwwoobj.assetBundle;
    
            Object[] objs1 = bundle.LoadAll();
    		foreach (Object obj in objs1) {
    			System.Type type = obj.GetType ();
    			string itemdata = "";
    			PropertyInfo[] properties = type.GetProperties();
    			itemdata = "Name: "+obj.name+"\n";
    			itemdata += "   Instanceid: "+obj.GetInstanceID() +"\n";
    			itemdata += "   HashCode: "+obj.GetHashCode() +"\n"; 
    			itemdata += "   Type: "+type.ToString() +"\n"; 
    			foreach (System.Reflection.PropertyInfo prop in properties) {
    				itemdata += "   Prop: "+prop.Name +"\n"; 
    			}
    			Debug.Log(itemdata);
    		}
    		bundle.Unload(true);
        }
     }
    Alles anzeigen
  • Modifizierbarkeit von CiM2

    • eis_os
    • 13. April 2013 um 16:01

    Nein, es ist kein Problem, das Steam System ist sehr einfach gehalten und wird das Bundle Laden kein Problem bereiten.
    Dein CIM2 lädt die DLC Daten sowieso, bauen darfst es einfach nicht. Ich kann dir auch ein Savegame geben mit einen vollen Depot ... :rolleyes:

    Der BundlesManager lädt alle Bundles, es gibt keinen Check. (bzw. nur das was die Unity Engine vielleicht macht, das habe ich noch nicht analysiert.

    -edit-
    Hmm, das Python hier mag nicht funktionieren, sagt es wäre keine UnityRaw Dateien... huh,
    Mal ein byte prefix setzen, dann geht der Check auch, ok, Python 2.7 funktioniert, hatte den falschen PATH gesetzt zu Python3


    -edit2-
    In \Unity\Editor\Data\Tools gibt es die Datei binary2text.exe die ein paar Infos zu .assets Dateien liefern kann, aber nix für bundle
    binary2text.exe funktioniert bei level* und mainData

  • Modifizierbarkeit von CiM2

    • eis_os
    • 13. April 2013 um 12:08

    Das ist das serialisierte Container Format der C# Objekte, das steckt etwas tiefer im Bundle.
    Ein Bundle wird in der Unity Engine C Code geladen. Ein riesiger Broken Code. Ich bin eigentlich daran das umhüllende Container Format zu verstehen.

    Das Bundle hat einen Header, UnityRaw, dann kommt in big endian format die Größe. Scheinbar aber nicht aligned, was mich doch sehr verwundert.
    Dann die jeweilige genutzte Unity Version. Das wird auch von Unity abgefragt, bei falscher Version meckert er mit hard codieren Strings.
    Außerdem checkt der Code auch die Custom irgendetwas Strings.

    Eine Art Header, und dann die Chunks.
    Jedes Ingame C# Objekt hat einen bestimmten Typ. Unity + CIM2 haben keine Script Schicht mehr dazwischen, alles an Daten wird in die C# Objekte geladen. Sogar die UI besteht aus solchen Komponenten.

    Unity Script Reference – search

    Deswegen kann man auch kein bundle in ein anderes Spiel laden, das geht nicht weil ja die richtigen C# Objekte zum Aufnehmen der Daten fehlen. Der Unity Free Editor sagt die Datei wäre komprimiert, was so aber auch nicht stimmen kann. (Nicht alle Bundles haben die selbe Unity Version)

    Die normalen .assert Dateien sind viel einfacher aufgebaut, haben aber nicht sehr viel interessantes. Es gibt dafür den Unity Assets Explorer.

    -edit-
    SimComet:
    Weil CO im Endeffekt das Spiel mit Unity zusammengebaut hat und sich nicht um Modifikationen gekümmert hat. CIM2 ist für CO ein monolithisches Spiel, die Drücken auf "Build" und es kommt ein komplettes CIM2 mit allen Sachen raus.
    Der geplante Rules Patch der da kommen soll wird wohl einfach nach dem Bundle Laden einfach die Statistiken überschreiben.

    -edit2-

    Die Bundle Dateien werden einfach alle geladen per BundlesManager. Kann man auch sehen wenn CIM2.exe mit -console startet :)

    -edit3-
    SimComet: Ich hab mich in die Doku eingelesen, aber wie gesagt Unity Free erstellt keine Bundles und eine Unity Pro Test Version konnte ich nicht installieren. (Bei der Aktivierung war der Punkt deaktiviert)
    Du kannst aber gerne Versuchen diese irgendwie in Unity Pro/Free zu laden.

    mainData könnte auch wichtig sein, dort ist Game.unity, Intro.unity usw. angeben.

  • Modifizierbarkeit von CiM2

    • eis_os
    • 11. April 2013 um 18:35

    Sehr komplex, wenn überhaupt machbar.
    Wie gesagt, jedes Bundle soll angeblich nur zum dem Projekt passen, wie genau so ein Bundle aufgebaut ist, konnte ich bis jetzt nicht herausfinden. UnityEngine scheint dafür extra Native Calls zu machen, das man das nicht so einfach herausfinden kann. Mal schauen ob die Unity Version eine Demo beinhaltet so das ich mal ein kleines Bundle erstellen kann um die Struktur zu erraten...

    -edit-
    Na Toll: "(disabled) Activate a free 30-day trial of Unity Pro"

    -edit2-
    CIM2.exe kann durch eine player_win.exe (Unity Player) ersetzt werden... Hmm.

  • Modifizierbarkeit von CiM2

    • eis_os
    • 11. April 2013 um 17:59

    Vielleicht schreib ich mal die nötigen Schritte eines Interfaces aus:
    Verändere CIM2 so das es eine neue .dll Datei lädt und eine Funktion in dieser Aufruft.
    Neue DLL Datei baut CIM2 im Speicher um so das fremde Objekte geladen werden können.
    -edit-
    Vielleicht versteht Ihr nun warum das nicht so einfach ist und auch Probleme mit Steam (versucht das Spiel auf Ursprung zu versetzen) geben kann.
    Das man dann eigentlich das komplette Spiel umbauen kann ist damit wohl auch ersichtlich.

  • Modifizierbarkeit von CiM2

    • eis_os
    • 11. April 2013 um 15:39

    Sorry, leider hast Du nicht verstanden welches Problem da liegt und überhaupt nicht gelesen was ich dazu geschrieben habe. Erster Punkt, Cities in Motion 2 tauscht keine Fahrzeuge aus, jeder hat alle Fahrzeuge. (auch wenn Du die nicht bauen kannst, um ein Multiplayer Partie zu spielen sind sie auf deiner HDD).
    Deswegen müssen selbst erstellte Maps ja auch auf allen Partie Rechner vorhanden sein.

    Da das Unity bundle Format nicht offen liegt, können wir es nicht nutzen. Wenn man direkt an CIM2 ansetzt,
    hat man die genannten Probleme. Wenn man einmal das System verstanden hat, gibt es keinen technischen Hinderungsgrund, da gibt es nur rechtliche und moralische Gründe.

    Wir können keine CIM2 kompatible Bundles erstellen, das würde das Unity Pro Geschäftsmodell ab absurdum führen. Außerdem Unity Bundles sind so konzipiert das Sie nur mit dem jeweiligen Spielprojekt nutzbar sind. Wir haben COs Spiel Projekt nicht. Alles was ich bis jetzt darüber lesen konnte, ist das Bundle nicht mit dem Projekt erstellt, kann ein Unity Projekt es nicht laden. Also Spiel A und Spiel B sind zwei verschiedene Projekte, kann Spiel A weder Bundle von B laden noch Spiel B ein Bundle von A.

    Wer technische Information zum Bundle Format hat kann Sie mitteilen. Bis jetzt ist dieses mein Wissenstand.

  • Modifizierbarkeit von CiM2

    • eis_os
    • 10. April 2013 um 20:28

    Ich versuche eine gewisse Rechtssicherheit zu erreichen, da es darauf hinausläuft ein eigene DLL zu schreiben, die die Objekte in die Engine lädt. (Um das Bundle Format komplett zu umgehen.

    Mir macht immer noch da ein paar Interner von CIM2 sorgen, MP Modus, Steam, Ingame Store und ob man Unity Free zum erstellen der Dateien Nutzen kann.

    Zum Beispiel MP: Zurzeit ist es ja so, das jeder CIM2 Multiplayer Spieler alle Dateien auf der Platte hat. Eine MP Session mit einer fehlenden Datei wird wohl sehr viele Probleme bzw. zum kompletten Crash führen.

  • Modifizierbarkeit von CiM2

    • eis_os
    • 9. April 2013 um 21:16

    Ich werfe mal:

    Build asset bundle .unity3d
    "- as I figured out, when asset bundle is exported, it doesn't work in other projects (as expected), but only when loaded by the one by which it is created (because of the script references, etc.)"

    Bundle Erstellung ist eine Unity Pro Feature...


    und zum anderen Thema, rechtliche...

  • Modifizierbarkeit von CiM2

    • eis_os
    • 9. April 2013 um 20:31

    Hallo

    Das was ich über die Situation von CIM2 geschrieben hat sich bestätigt, CIM2 Dateien scheinen ein Mix von serialisierten (Serialisierung – Wikipedia) Objekten und das Unity eigenes Format zu sein.
    Saves und Maps sind in einen von CO definierten Format, das Bundle Format hat ein anderes Format. Diese Bundle Format ist ja auch ein Pro Feature von Unity, ob CO da selber Einblick hat ist dann auch noch fraglich.

    Leider ist es mir nicht möglich über die CIM2 Interne generell zu schreiben, über die Gründe kann jeder spekulieren. D.h. leider kein CIM2Internals.txt.
    Soviel sei gesagt, eine Schnittstelle via Scripts ein Objekt zu definieren ist in CIM2 scheinbar nicht eingebaut, ich gehe davon aus das CO die Einstellungen eines Objekts im Unity Pro Editor eingibt...

  • Modifizierbarkeit von CiM2

    • eis_os
    • 8. April 2013 um 22:42

    Wer CIM2 beim Laden zusehen möchte, startet CIM2 mal mit cim2.exe -console :D

Twitch

  1. Datenschutzerklärung
  2. Impressum
Community-Software: WoltLab Suite™