xisec Posted November 4, 2019 Share Posted November 4, 2019 I am working with some xml ship design files and I am having problems to solve the meaning of some values. Let's go with an example. Ship's XML file: <?xml version="1" encoding="utf-8"?> <ship_design> <plan accumulateHealth="true" convex="false"> <item parent="-1" index="0"> <block lx="-1" ly="-1" lz="-1" ux="1" uy="1" uz="1" index="1" material="0" look="1" up="3" color="ffbfaea3"/> </item> <!-- Red, X --> <item parent="0" index="1"> <block lx="1" ly="-0.5" lz="-0.5" ux="2" uy="0.5" uz="0.5" index="61" material="3" look="3" up="5" color="ffff0000"/> </item> <item parent="1" index="2"> <block lx="2" ly="-0.5" lz="-0.5" ux="3" uy="0.5" uz="0.5" index="61" material="3" look="5" up="2" color="ffff0000"/> </item> <item parent="2" index="3"> <block lx="3" ly="-0.5" lz="-0.5" ux="4" uy="0.5" uz="0.5" index="61" material="3" look="2" up="4" color="ffff0000"/> </item> <item parent="3" index="4"> <block lx="4" ly="-0.5" lz="-0.5" ux="5" uy="0.5" uz="0.5" index="61" material="3" look="4" up="3" color="ffff0000"/> </item> <!-- loop --> <item parent="4" index="5"> <block lx="4" ly="-0.5" lz="-0.5" ux="5" uy="0.5" uz="0.5" index="61" material="3" look="3" up="5" color="ffff0000"/> </item> <item parent="5" index="6"> <block lx="5" ly="-0.5" lz="-0.5" ux="6" uy="0.5" uz="0.5" index="61" material="3" look="5" up="2" color="ffff0000"/> </item> <item parent="6" index="7"> <block lx="6" ly="-0.5" lz="-0.5" ux="7" uy="0.5" uz="0.5" index="61" material="3" look="2" up="4" color="ffff0000"/> </item> <item parent="7" index="8"> <block lx="8" ly="-0.5" lz="-0.5" ux="9" uy="0.5" uz="0.5" index="61" material="3" look="4" up="3" color="ffff0000"/> </item> <!-- loop --> <item parent="8" index="9"> <block lx="9" ly="-0.5" lz="-0.5" ux="10" uy="0.5" uz="0.5" index="61" material="3" look="3" up="5" color="ffff0000"/> </item> <item parent="9" index="10"> <block lx="10" ly="-0.5" lz="-0.5" ux="11" uy="0.5" uz="0.5" index="61" material="3" look="5" up="2" color="ffff0000"/> </item> <item parent="10" index="11"> <block lx="11" ly="-0.5" lz="-0.5" ux="12" uy="0.5" uz="0.5" index="61" material="3" look="2" up="4" color="ffff0000"/> </item> <item parent="11" index="12"> <block lx="12" ly="-0.5" lz="-0.5" ux="13" uy="0.5" uz="0.5" index="61" material="3" look="4" up="3" color="ffff0000"/> </item> <!-- Green, Y --> <!-- loop --> <item parent="0" index="14"> <block lx="-0.5" ly="0" lz="-0.5" ux="0.5" uy="1" uz="0.5" index="61" material="3" look="3" up="5" color="ff00ff00"/> </item> <item parent="14" index="16"> <block lx="-0.5" ly="2" lz="-0.5" ux="0.5" uy="3" uz="0.5" index="61" material="3" look="3" up="0" color="ff00ff00"/> </item> <item parent="16" index="17"> <block lx="-0.5" ly="3" lz="-0.5" ux="0.5" uy="4" uz="0.5" index="61" material="3" look="3" up="4" color="ff00ff00"/> </item> <item parent="17" index="19"> <block lx="-0.5" ly="3" lz="-0.5" ux="0.5" uy="4" uz="0.5" index="61" material="3" look="3" up="1" color="ff00ff00"/> </item> <!-- loop --> <item parent="19" index="20"> <block lx="-0.5" ly="4" lz="-0.5" ux="0.5" uy="5" uz="0.5" index="61" material="3" look="3" up="5" color="ff00ff00"/> </item> <item parent="20" index="21"> <block lx="-0.5" ly="6" lz="-0.5" ux="0.5" uy="7" uz="0.5" index="61" material="3" look="3" up="0" color="ff00ff00"/> </item> <item parent="21" index="22"> <block lx="-0.5" ly="7" lz="-0.5" ux="0.5" uy="8" uz="0.5" index="61" material="3" look="3" up="4" color="ff00ff00"/> </item> <item parent="22" index="23"> <block lx="-0.5" ly="8" lz="-0.5" ux="0.5" uy="9" uz="0.5" index="61" material="3" look="3" up="1" color="ff00ff00"/> </item> <!-- loop --> <item parent="23" index="24"> <block lx="-0.5" ly="9" lz="-0.5" ux="0.5" uy="10" uz="0.5" index="61" material="3" look="3" up="5" color="ff00ff00"/> </item> <item parent="24" index="25"> <block lx="-0.5" ly="10" lz="-0.5" ux="0.5" uy="11" uz="0.5" index="61" material="3" look="3" up="0" color="ff00ff00"/> </item> <item parent="25" index="26"> <block lx="-0.5" ly="11" lz="-0.5" ux="0.5" uy="12" uz="0.5" index="61" material="3" look="3" up="4" color="ff00ff00"/> </item> <item parent="26" index="27"> <block lx="-0.5" ly="12" lz="-0.5" ux="0.5" uy="13" uz="0.5" index="61" material="3" look="3" up="1" color="ffeeee00"/> </item> <!-- Blue, Z --> <item parent="0" index="28"> <block lx="-0.5" ly="-0.5" lz="1" ux="0.5" uy="0.5" uz="2" index="61" material="3" look="3" up="1" color="ff0000ff"/> </item> <item parent="28" index="29"> <block lx="-0.5" ly="-0.5" lz="2" ux="0.5" uy="0.5" uz="3" index="61" material="3" look="0" up="3" color="ff0000ff"/> </item> <item parent="29" index="30"> <block lx="-0.5" ly="-0.5" lz="3" ux="0.5" uy="0.5" uz="4" index="61" material="3" look="2" up="0" color="ff0000ff"/> </item> <item parent="30" index="31"> <block lx="-0.5" ly="-0.5" lz="4" ux="0.5" uy="0.5" uz="5" index="61" material="3" look="1" up="2" color="ff0000ff"/> </item> <!-- loop --> <item parent="31" index="32"> <block lx="-0.5" ly="-0.5" lz="5" ux="0.5" uy="0.5" uz="6" index="61" material="3" look="3" up="1" color="ff0000ff"/> </item> <item parent="32" index="33"> <block lx="-0.5" ly="-0.5" lz="6" ux="0.5" uy="0.5" uz="7" index="61" material="3" look="0" up="3" color="ff0000ff"/> </item> <item parent="33" index="34"> <block lx="-0.5" ly="-0.5" lz="7" ux="0.5" uy="0.5" uz="8" index="61" material="3" look="2" up="0" color="ff0000ff"/> </item> <item parent="34" index="35"> <block lx="-0.5" ly="-0.5" lz="8" ux="0.5" uy="0.5" uz="9" index="61" material="3" look="1" up="2" color="ff0000ff"/> </item> <!-- loop --> <item parent="35" index="36"> <block lx="-0.5" ly="-0.5" lz="9" ux="0.5" uy="0.5" uz="10" index="61" material="3" look="3" up="1" color="ff0000ff"/> </item> <item parent="36" index="37"> <block lx="-0.5" ly="-0.5" lz="10" ux="0.5" uy="0.5" uz="11" index="61" material="3" look="0" up="3" color="ff0000ff"/> </item> <item parent="37" index="38"> <block lx="-0.5" ly="-0.5" lz="11" ux="0.5" uy="0.5" uz="12" index="61" material="3" look="2" up="0" color="ff0000ff"/> </item> <item parent="38" index="39"> <block lx="-0.5" ly="-0.5" lz="12" ux="0.5" uy="0.5" uz="13" index="61" material="3" look="1" up="2" color="ff0000ff"/> </item> <!-- Yellow --> <item parent="12" index="44"> <block lx="13" ly="-0.5" lz="-0.5" ux="14" uy="0.5" uz="0.5" index="61" material="3" look="3" up="1" color="ffeeee00"/> </item> <item parent="39" index="45"> <block lx="-0.5" ly="-0.5" lz="13" ux="0.5" uy="0.5" uz="14" index="61" material="3" look="3" up="1" color="ffeeee00"/> </item> <item parent="0" index="46"> <block lx="-0.5" ly="-2" lz="-0.5" ux="0.5" uy="-1" uz="0.5" index="61" material="3" look="3" up="1" color="ffeeee00"/> </item> </plan> </ship_design> Ship: Some attributes are easy to figure out: Each block has an index number and a parent identified by its index. Block's dimensions are defined by 6 variables, upper and down values in each axis ( in Cartesian coordinates ): lx, ux, ly, uy, lz, uz. The plan's attributes, "accumulateHealth" and "convex", seems to always have the same values, "true" and "false" respectively. I don't know what could be the meaning of this neither. But the attributes whose meaning I would like to figure out, because of their importance, are, mainly, "look" and "up"; and "color" in a lesser extent. COLOR: The last 6 digits configure a RGB color format, ok. But what are the 2 first digits? They are also hex values, but it seems that they are always "ff". I have performed some test changing this digits, but it seems that nothing changes. LOOK and UP. This two attributes determine the block's orientation (if a directional thruster is working on X, Y, or Z; if a corner shaped block is "upside down", and so on). But I can not understand the relation between the values of this attributes and the block's final orientation. The possible values, for both of them, is from 0 to 5. [i have to go now, i will edit and expand my explanation] Do you have, guys, any idea of the meaning of this values? Thx for reading! See u in Avorion! Link to comment Share on other sites More sharing options...
SneakyTacts Posted November 6, 2019 Share Posted November 6, 2019 I have no idea of the meaning of the unknown values, but have you checked the relatively new documents provided by the developers of Avorion? They are to teach players to make mods. Maybe they touch on this subject? I would look for these documents in the news page here or on Steam for the update that allowed for workshop mods. Link to comment Share on other sites More sharing options...
xisec Posted November 24, 2019 Author Share Posted November 24, 2019 I have no idea of the meaning of the unknown values, but have you checked the relatively new documents provided by the developers of Avorion? They are to teach players to make mods. Maybe they touch on this subject? I would look for these documents in the news page here or on Steam for the update that allowed for workshop mods. Hmm... Do you refer to the modding API, right? I haven't seen anything about this there :-\ Link to comment Share on other sites More sharing options...
peacefighter1996 Posted December 8, 2019 Share Posted December 8, 2019 I have been busy with an Avorion XML to Object converter (For those who want to print there creations in real life). currently I have only got this working for corner blocks and standard cubes. What Look and Up has to do with the face direction of the property of the object. see faces.PNG. So For example <block lx="1" ly="-0.5" lz="-0.5" ux="2" uy="0.5" uz="0.5" index="100" material="3" look="3" up="5" color="ffff0000"/> index 100 = corner piece Look 3 means that the look direction is towards face 3 Up 5 means that the up direction is towards face 5 combinations 3-2 5-4 1-0 are in possible as these are on opposite directions. Color I think refers back to the in game colors. (not really important to me for now) What the exact up-direction and look directions are IDK yet as I have started working on this project only yesterday. keep you up to date If I find anything. Link to comment Share on other sites More sharing options...
xisec Posted December 9, 2019 Author Share Posted December 9, 2019 Hey peacefighter! Yes, you are right, I've been squeezing my brain today with this and I think that I have some results. The practical results are coherent, but the results "references" that I have figured out are a bit "weird" I think: If you edit an xml ship file introducing a wrong Up and Look combination, the design corrects it and set this default values: 5 for Look 3 for Up And, if you rotate the block over the diferent axes, the orientation values are these ( <Look>,<Up> ): Around X: 5,3 (default) -> 2,5 -> 4,2 -> 3,4 -> 5,3 (again) Around Y: 5,3 (default) -> 0,3 -> 4,3 -> 1,3 -> 5,3 (again) Around Z: 5,3 (default) -> 5,0 -> 5,2 -> 5.1 -> 5,3 (again) This leads to this default orientation references: This is a bit weird because: 1.- "Up" is down. Edit. Sorry, it can be represented like this, but the not symmetrical issue (2) is still there: 2.- The faces index are not symmetrical: lower x face = 1 upper x face= 0 ly = 3 uy = 2 lz = 4 uz = 5 <--- is inversely to the rest: higer number for upper and minor for lower. It is a bit weird but any other indexes or references does not match with my "experiments". Link to comment Share on other sites More sharing options...
xisec Posted December 9, 2019 Author Share Posted December 9, 2019 No, I can't fit it. I copied the experimental results wrong in the previous post. I have edited and corrected it there, but I will paste them again here anyway: Around X: 5,3 (default) -> 2,5 -> 4,2 -> 3,4 -> 5,3 (again) Around Y: 5,3 (default) -> 0,3 -> 4,3 -> 1,3 -> 5,3 (again) Around Z: 5,3 (default) -> 5,0 -> 5,2 -> 5.1 -> 5,3 (again) This is what I can't fit: My wrong case. In the case of rotation around Z, the results should be: 5,3 (default) -> 5,0 -> 5,2 -> 5.1 -> 5,3 (again) but with my references the result are: 5,3 (default) -> 5,1 -> 5,2 -> 5.0 -> 5,3 (again) ( References in axis X seems to be reversed) Your wrong case, peacefighter. In the case of rotation around Y, the results should be: 5,3 (default) -> 0,3 -> 4,3 -> 1,3 -> 5,3 (again) but they are: 5,3 (default) -> 1,3 -> 4,3 -> 0,3 -> 5,3 (again) ( References in axis X seems to be reversed) If I try to fix the references so the results are correct in one axis, the results become incoherent in other axis. I have checked the experimental results like 20 times, and they are right. At this point, and viewing the odd reference numbers that we get, I think that there may be some bug in game which prints wrong the xml files but at the import time it is corrected in someway. Or maybe I am missing something, but I have squeezing my brain too much and I find all results incoherents. Link to comment Share on other sites More sharing options...
xisec Posted December 9, 2019 Author Share Posted December 9, 2019 Ok, I think that I have it. I though that each face of the cuboid had an index of reference. In this case, for example, if you rotate a cuboid over the axis Z, only the Up value should change, since the Look value is in the Z axis and does not rotate. But it seems that this is not the case. The right approximation is: you have to imagine a cuboid inside a system of references. So it is like the references are in the coordinate system, the references are not in the cuboid faces. Each cuboid has a side that is the designated Look and Up face. By default, when the cube is placed wihout any rotation (default position), the face facing towards upper y (uy) is the Up, and the face facing towards lower z (lz) is the Look. For example, in the case of the cube "Ligh", the light bulb is the Up side, and the side that by default appears in lz is the Face side. In this case, if you rotate a cuboid over the axis Z, any of the Up or Look value can change, depending of the state of rotation of the cuboid. Now all numbers of the experimental data about rotations fix with the theory. Remember N1,N2 = Look, Up values. So 5,3 means look 5 and up 3. Around X: 5,3 (default) -> 2,5 -> 4,2 -> 3,4 -> 5,3 (again) Around Y: 5,3 (default) -> 0,3 -> 4,3 -> 1,3 -> 5,3 (again) Around Z: 5,3 (default) -> 5,0 -> 5,2 -> 5.1 -> 5,3 (again) Also, since default position, I have rotated the cube over X one time and I have repeated the previous movements since this position (2,5). This are the experiment numbers, which fix with the references: Around X: 2,5 (test position) -> 4,2 -> 3,4 -> 5,3 -> 2,5 (again) Around Y: 2,5 (test position) -> 2,0 -> 2,4 -> 2,1 -> 2,5 (again) Around Z: 2,5 (test position) -> 1,5 -> 3,5 -> 0,5 -> 2,5 (again) Link to comment Share on other sites More sharing options...
peacefighter1996 Posted December 9, 2019 Share Posted December 9, 2019 your latest sequence seems to correspond with what I have uncovered. However, there is a thing that I have uncovered yesterday that might be of interest to you. Watch out with rotating, as for instance, you have a block that is not equal distance. a corner piece that is 2 long 1 wide and 1 high. Don't rotate the outer point around its own centre, but rather shift them around. Otherwise, you are reshaping that block. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now