CMP to SUR Conversion Tests
-
I have some comments/questions please…
Schmackbolzen wrote:
I guess that depends on the definition about concave/convex.
Well one online definition of a concave shape is “A shape that curves or bends inward”.
The mathematical definition is probably much more scientific than this, but here is mine specific to low-poly models made of faces (triangles)… in a concave shape, a plane extrapolated on one or more faces (i.e. the plane made by pulling out the triangle to infinity in both directions) will cut into another face on the shape.
In a convex shape, no face plane will cut into another face on that shape.
There can’t be any misunderstanding of this, surely?
Schmackbolzen wrote:
Every triangle needs to have an opposite counterpart. If that is missing, you have to split it up and create one. That’s how Freelancer and my converter does it. That’s the easy part. Look at solar\misc\space_industrial.sur and you will see what I mean.
I’m not sure what you mean by “triangle”. Do you mean a face? The model you mention does have many sur parts made of only 2 triangles, they are interpreted as Type 2 and hashcode “00000000” and I’m not sure of the significance of these, it seems odd, just planes made of two faces?
Or do you mean a mesh made of triangles (faces)? And what do you mean by opposite counterpart? In the sur file? Yes, we know this, that every sur part must have a counterpart cmp group to be attached to in order to function. Is this what you mean?
If you mean triangle = face, in the sur, then I do not understand why each face must have a counterpart.
Schmackbolzen wrote:
That’s the reason for your crashes and strange behaviour. It is the root of the tree. If it’s missing Freelancer makes wrong decisions on collision calculations (for shield .sur files I have to have a look yet how it’s done there).
I thought the root sur part normally corresponds to the largest hull part in the cmp. What do you mean exactly?
But nobody has made surs with Type 5 meshes and many surs do work fine, including many of mine, for ships that should have Type 5 surs.
Schmackbolzen wrote:
Thus, theoretically the geometry should not matter. Freelancer does not know simple geometries like spheres and boxes anyway, only special triangle meshes.
Well I disagree, most of the methods described for other games collision detection do test for spherical first, in order to speed up the operation, and then if the collision box is not a sphere the triangle poly checks are done - it’s described many times.
Should FL be different? Can anyone confirm the collision detection flow/methods in FL?
It is obvious that some of FL’s collision checks fail and others are fine, depending on the shape used to construct the sur part. As I have found, spheres are always fine as sur parts, cylinders are fine only when the ends are pulled out slightly, otherwise they fail sometimes, and boxes are unreliable too.
Deformed spheres (i.e. start with a sphere and scale it in any or all axes but still ensuring it remains convex) are also always fine for my surs.
For dock walls, instead of long tall boxes I found it better to use hexagonal cylinders and ensure the side corners are slightly pulled out, still resembling long box sections but slightly convex.
But then the dock floors and ceilings that I have made of boxes are all fine all the time. So because the box is unreliable this is why it is so difficult to guess the requirements.
Schmackbolzen wrote:
The goal is indeed a complete .sur converter, but that will take time, since I will have to create some sort of group selection dialog, where you can say which group should become what and all the other options there are. And I still have to fix the tree sorting and a glitch while merging the root node with the rest of the tree.
Should the user have so much control in deciding groups? If the converter will make a sur part for each cmp group this is perfect, or do you mean something else? Some groups will be detail parts or parts of the same component but with a different texture, and not needed for a sur, this will be hard to detect I think.
What do you mean by root node, and what is the tree please, I am guessing you mean like the UTF files, but I am not familiar with this term for surs?
You did mention the Type 5 parts as the root of the tree? I don’t understand that either?
And finally -
Adoxa tried to explain that these Type 5 surs don’t need to be over the cmp groups they protect, but this does not make sense yet, how can they be used for collision/hit detection if they are at the origin or have no offset from the origin so the checker can work out collisions/ hits? Can you explain that better for me?
Thanks.
-
A picture is worth a thousand words…
-
If only I had a picture
I think we have a few misunderstandings and maybe even bad formulations by me (since I am German). Plus, I have the abstract programmers view, which could make things even more complicated.
Let me try to clarify some things:
I use the word triangle, since Freelancer does not know other polygons than that concerning the .sur files (that might apply to .cmp etc. files as well). You can also call it a face. It’s the same.
Concerning the convex/concave stuff: Yes, it is of course defined and there is no other interpretation. What I meant is, that because of the behavior of Freelancer, you concluded, that concave is “bad”. Well, the reason why it might have caused problems is, that Freelancer needs a triangle counterpart which does not exist in every geometry. Thus, convex works.
Concerning the type 5 sur parts: This defines the bounds of the object. If you use adoxas sur importer he called it “root_bounds” or something like that. You don’t need it if you only have one part (thus, the tree is only the root node).
I don’t know how Freelancer handles collision detection exactly. From my point of view right now, there might be simple geometry involved for tree navigation. But not to the point where it actually collides. Who knows if we will ever know
The way I will design the GUI for the converter will be a work in progress, depending on how I think it’s easiest to use. I can change it later anyway if something works not the way I wanted it.
I don’t think it makes sense to explain my current understanding of how Freelancer handles the sur format, until I got it working without any errors. There is still the possibility, that’s all a coincidence that it works (even if it does look really good right now). If my theory proves to be correct, you can expect a documentation from me (and probably even a picture :P).
I hope that cleared things up a little
-
Heheh, thanks for your patience, Schmackbolzen.
A small digressionary break first…
I am actually embarassed because your fluency in English is amazing, I am very proud of all of you guys whose first language is not English. It is hard to understand the slight differences in meaning or double-meanings of the same word that the English language has, that only natives will know automatically - you others have to learn them and that is hard, I know.
It is because the English language is limited. Greek has far more words that precisely describe their meaning, so there is little misunderstanding, and probably German and French are similarly rich languages? For example “sagani” and “tigani” are different types of large metal pan (the “sagani” has two metal semi-circular handles at opposite sides of the pan, like ears, so it can be put in the oven, and “tigani” is a normal frying pan with one long straight handle or sometimes having a long handle and a small supporting “ear-like” handle at the opposite side) and “saganaki” and “tiganaki” are the corresponding little pans of each type! And “souvla” is a large skewer, and “souvlaki” is a little skewer - so we know if we are having a large oven-baked dish or a large kebab, or a small oven-baked dish or a small kebab! Easy, huh!? And then the sexual double-meanings are fun - “angouri” is a cucumber, and “angouraki” is a little cucumber - most males have one of these! So don’t order “angouraki” with your salad in Greece, ask for “angouri”! lol ( but be careful, in Cyprus it’s the opposite!! )
I have often admitted that Brits are the world’s worst linguists - there were plenty of language opportunities at school - French as the main second language, then German and Spanish were all available to us - as well as both of the dead languages Latin and Ancient Greek that only Scholars would use. Ancient Greek is nothing like the Greek that I know!
What caused the problem in my time was that instead of trying to develop our language abilities at school, the others just laughed at us and derided us when we made mistakes in class, so we spoke less and less instead of more and more. To make matters worse, although I studied and very much enjoyed French for seven years, to GCE ‘A’ level ( General Certificate of Education Advanced level, the highest school certificate ) and my grammatical knowledge was very good, top of the class for several of those years, my teachers were Englishmen and after learning from them I could not speak with a correct emphasis or tone, nor understand when I was spoken to by a French person!
OK, enough of a side-track…
The only misunderstanding I have now is still this one… “Freelancer needs a triangle counterpart which does not exist in every geometry.”
I don’t understand what you mean by a triangle “counterpart” - to me this means a twin, or an associated face in another shape? And so I don’t understand what counterpart a face would need? It could mean either the next face attached to the first one, or an opposite face at the opposite side of the same shape, or it could mean a matching face in the .cmp - but none of these make sense to me so you must mean something else?
Thanks again for clarifying and for your patience, I am really keen to understand in case I can assist in any way, or learn what is causing the problems that I have made with so many surs, even fully convex ones.
One other point that I should remind us of here - Bejaymac stated that if the sur parts are exported in a single group, then only the root must be convex, and the other sur parts can be concave. If there is only one sur part then that part must be convex of course. But if the sur parts are exported in two or more groups, then each one must be convex.
I haven’t really got my head around that (means it doesn’t make sense to me) even after all this time. Because if the sur has several parts and it is exported as one group containing all parts, then all of those will probably make a concave shape when seen as a whole.
My method is to be sure that the cmp is in several groups, and I do not make more than one part per sur group, so I have ensured that each sur part is convex, and that each sur part also has a group of the same name in the cmp.
I don’t like to add dummy groups, so I simplify my sur parts and break up the ship into as many sensible groups as possible to have enough cmp groups for all of the sur parts while staying within the 18 groups ( of course this can be difficult for large ships but that has been overcome by our superstars! ).
Then I either export the sur parts as one part per group, or export the parts individually and then sur splice them. Sur splicing has been the most successful way for me until the sur builder now.
But the sur builder has problems geneating surs for some of my ships, and also I have not had the time to test the sur builder surs fully ( long time testing with NPCs vs NPCs using the sur ) - as I have said before, starting with vanilla surs I had clean overnight runs, then testing my surs one at a time, it has taken over 20 minutes to crash sometimes, but they have crashed. And so I test for a longer time.
Do you see now why I go to such long explanations as this one? It’s because the English language is limited and needs adjectives, similes, metaphors and also examples, all together, in order to clearly define one’s true meaning!
-
StarTrader wrote:
I have often admitted that Brits are the world’s worst linguistsAgreed… it seems that Britain is the only place on Earth where they do not teach English in the schools yet.
Even Google Translate cannot parse: You can’t have a proper knees-up without a Joanna.
-
bon alors en français ^^
je sais pas si tu te sentiras moins seul mais moi aussi je ne comprends pas toujours tout :lol:
c’est en effet dommage que le langage technique ne soit pas le français ou l’allemand ou le grec qui sont bien plus précis \o/
m’enfin c’est comme ça -
Je me demandais quand tu arriverais dans la discussion
-
Heh… my French is a little rusty, but here goes…
Exactement, et le problème est multiplié en traduction de l’anglais entre deux personnes qui parle des langues différentes aussi. J’avais attendu ce sur-outil depuis l’année dernière. Nous avons perdu beaucoup de membres de notre groupe parce que je ne pouvais pas reparer les problemes de notre mod.
I will also try a little German (with the help of my friend Babelfish this time)! so our German pals are not left out…
Genau, und das Problem wird beim Übersetzen von Englisch multipliziert zwischen zwei Leuten die verschiedene Sprachen sprechen. Ich habe dieses sur Tool seit letztem Jahr gewartet. Wir habe viele unsere Gruppenmitglieder verloren, weil ich nicht in der Lage gewesen bin, die Probleme in unserem mod zu regeln.
I hope this is not offensive, I know too little to correct it!
And in English:
Exactly, and the problem is also multiplied when translating from English between two people who speak different languages. I have been waiting for this sur-tool since last year, we have lost a lot of members from our group because I have been unable to fix the problems in our mod.
(Well I could have used resized surs to fix them but that was not a good solution and I thought I would not have to wait long!)
So - Come on Schmackbolzen, adoxa, BW! We will sing for you, send you images of Guinness beer or bottles of wine, or maybe even a real bottle of wine when you succeed!!
:pint: :pint: :pint:
-
StarTrader wrote:
Genau, und das Problem wird beim Übersetzen von Englisch multipliziert zwischen zwei Leuten die verschiedene Sprachen sprechen. Ich habe dieses sur Tool seit letztem Jahr gewartet. Wir habe viele unsere Gruppenmitglieder verloren, weil ich nicht in der Lage gewesen bin, die Probleme in unserem mod zu regeln.correctly it sounds like this:
Genau, und das Problem wird beim Übersetzen von Englisch gar größer zwischen Leuten, die verschiedene Sprachen sprechen. Ich habe dieses SUR-Tool seit letztem Jahr erwartet. Wir haben viele unserer Gruppenmitglieder verloren, weil ich nicht in der Lage gewesen bin, die Probleme in unserer Mod zu regeln.
sounds not too different, does it?
-
Thanks Gisteron!
BBalazs - Yep, Mavrodaphne - BlackDaphne. Yes it is very sweet, a great festival wine but not well-liked for table wine because it is heavy (strong).
In Cyprus we have a sweet sherry-type wine called Commandaria, which is also heavy and a great festival wine.
It is called that because it was first brewed by the invading Lusignans in their fortress, called the Commanderie - HeadQuarters.
-
Yes, you certainly write much text
Well, I don’t know what to say other than thank you And yes it is really hard to learn all this expressions. German has indeed more words you can use as English has and thus you often have to express yourself in an unusual way. I don’t speak French, though. Could offer some Latin, but that’s it
Back to the topic:
I am at the point where I can predict, how the tree is generated. I think I also have an idea, what the ms sur exporter does. I now have to find a way, how to implement the correct tree generation.Concerning the triangle counterpart thing: Simply put, it is the triangle which face points in the opposite direction. That means, the order of the points is the opposite (in 3D graphics, clockwise or counterclockwise determines the orientation).
If I got it working correctly I will try to explain more.
-
[offtopic]
if it is about expression possiblities, the german is pretty liberal and open to rhetorics. nevertheless, the english has about three times the amount of words due to the history of the language. many of them are unused or used only in certain circumstances but even there we see, the english has massively more levels of speach than most european languages such as spanish, french and german. latin has a few words but therefore it has nearly unlimited possibilities in sentense constellation and depending on which words you use they can have absolutely different meanings and i mean here only what i read by Caesar, not the complicated stuff of Cicero, Catullus and Seneca.
[/offtopic]hm, what about creating shapes with double sided faces, would that solve any concavity problems?
-
StarTrader wrote:
I have been waiting for this sur-tool since last yearSorry, but I do not understand what are you waiting for, StarTrader?
As far as I know, the SUR Builder is “feature complete” now. It needs some cleanup in the user interface, and maybe some memory tuning, but those are the only things on my list.
If you want something else, then make it clear. Use screen shots instead of long and convoluted text posts. Leave out the nonsense that detracts from your message… a little humor is fine, but put the silly stuff into separate posts if you want people to be able to understand you.
Here is a tip that I learned many years ago from a professional editor:
Every word, that does not improve the clarity of your main message, detracts from it.
-
Forsaken wrote:
Where can I download the latest version of SUR Builder?I will put the next version on the Forge so that it will be easier to find.
-
You are welcome, Forsaken.
I keep reading what I can find about SURs and I pick up little bits here and there, but I still find them to be half mysterious.
Also, there seem to be multiple schools of thought about what the builder should create.
If the SUR Builder needs more work (aside from the user interface) then my largest obstacle is in understanding exactly what might improve it. That is where I need help from those of you who use it.
If I could release the source then I would – this project could benefit from community review.
-
BW:
I thought you are working on resolving the problems with asymmetric sur generation with some models? e.g. the Klingon destroyer I posted earlier?
These are unusable surs, and we have seen them with several different symmetrical models, both small and large. I have rebuilt one of the models completely a couple of times but still get asymmetric surs for it - the ship has forward-swept wings, the left wing’s sur connects the left wing forward tip directly to the nose of the ship. The right wing’s sur is correct. So the ship looks like the Phantom of the Opera or Dracula from above, with its left wing holding a cape up to its nose!
So sur builder is not finished.
I will try to define that model’s problems more accurately for you and will post it up if I can find what in the model is causing the asymmetry in sur builder.
And yes I have been waiting for the darned thing since LS first revealed he was working on it, it is a very important utility for almost every FL modder.
I appreciate this is a spare-time project for anyone who takes it on.
But it’s many months of “just round the corner” for me and some others.
My verbal diarrhoea is a) to be explicit in describing my findings or queries, b) to clarify something for others, and c) to cover my frustrations with lack of progress and then with LS unexpectedly throwing in the bloody towel before the sur builder is finished.
I don’t think you would like my alternative-thoughts posts much.
So my digressions, are trying to keep some humour and at the same time indirectly egg you on to complete the darned thing without upsetting anyone too much.
If the builder’s problems will not be fixed, I am not criticising you for that, on the contrary I appreciate your abilities and your involvement and your efforts very much, and I fully understand that you may not know enough to fix the builder to where it is reliably producing good surs for more models.
- but I need to know so I don’t wait here any more for something that will not come, and I will go back to my old tedious frustrating manual methods.
At times like this I feel like that donkey, led along with a carrot on a string in front of his nose that is tied to a stick that is tied to the saddle on his back. No ROFL and no smiley for this one.