decorator problem

Community Forums/Developer Stations/decorator problem

jfk EO-11110(Posted 2005) [#1]
I have a problem with decorator 1.8

The map is a outdoor scene with a lot of grass between the buildings etc. There's also something like a street, that is a slightly elevated platform over the grass level. I think the Y offset is the second smallest unit that can be scaled in Maplet (zoom grid thing). Now when I want to texture the street platform with decorator, a lot of weird things happen. First of all, I cannot assign a texture to SOME triangles. Sometimes when I tried to assign a texture, there is no visible success, then I save the mesh, restart Decorator and there it is, assigned, with some missing Triangles. Then in rare cases it works nonetheless. Now after some fiddling I finally achieved a finished map and then I wanted to save the map optimized. But when I load the result in Blitz3D the couple of bad Triangles are back untextured. But they don't use the texture that was set before, but a texture that was used long time ago, but was retextured several times since then.

Then there's this very strange behaviour when I walk on this Tris: Framerate drops down to something like 4 fps. As soon as the triangle is out of the view (eg. looking up to the sky) the rate is normal again.

This is all real weird and frustrating, especially because the artefacts appear in the final app, the game engine.

Here's an image:



This slowdown thing suggests Decorator is creating multiple Triangles at the same position for some reason.

I will now try to import it in giles, convert to 3ds, optimize in 3dsmax, then convert back to b3d and reasign the lightmap in decorator, but honestly, I'm afraid this won't work.

Get this right, I love Decorator. It's only these little things that are capable of driving me crazy.

If somebody has a solution for it, please let me know!

EDIT now it seems there are in fact multiple triangles on the same place. Using decorators DEL+LMB function to delete Tris permanently allows me to reduce the polycount repeatedly on the same triangle, while the texture scaling differs after every deletion. Unfortunately it MAVs after some Deletions, probably because it tries to remove something that isn't there anymore.

EDIT 2
Ok, this is my current workaround:
-save the map as optimized mesh in decorator
-restart decorator then load the optimized mesh
-use DEL+LMB to delete the disobedient triangles
-use my Level Editor to put some scaled simple Quads onto the resulting holes

looks ok, speed is normal again.

But there's definitively something wrong in decorator. Must have something to do with the scanning steps. Maybe adjustable scanning steps would be a solution, dunno since I don't know the internals. However. neverteless I'd like to thank Lee one more time for this fantastic freeware tool.


Happy Sammy(Posted 2005) [#2]
Hi jfk,

With my little knowlege, how about you subdivide mesh or draw some rectanges or whatever at the place, so that default missing triangles could be created in Decorator?
(as we put texture on the mesh, we could not see the subdivision.)

Sammy
:)


jfk EO-11110(Posted 2005) [#3]
Thanks Sammy, that's exactly what I did. A qick'n dirty solution :) Well it's a sunny locaton wihtout shadows, so it doesn't matter that the quad isn't lightmapped. In future I'd like to prevent to get in troubles like this in the first place. A solution would be to scale things bigger in Maplet (not to use small zoom grids), but already now my map is using the max size of Maplet. Maybe I'd have to work with multiple files then.


Sledge(Posted 2005) [#4]
This is interesting - noticed some speed loss on a simple map of my own recently and stuck it on the things-to-investigate pile. Is your map broken on loading or only after optimisation?


TeraBit(Posted 2005) [#5]
Hi jfk EO-11110,

Could you send me the map and textures so I can have a go at finding out what's going on. Decorator has been around a long time, so there must be something new going on somewhere.


jfk EO-11110(Posted 2005) [#6]
Hi Lee. Thanks a lot for your attention. I think I have isolated the problem, see this thread:
http://www.blitzbasic.com/Community/posts.php?topic=54572

There are some double tris, in a 20k Triangles Mesh about 3500 where clones, unneeded Tris with some diffrent textures. When you render this (bysides the general slowdown of the known "identical tris problem" for Graphic Cards), its only karma if you see Tris 1 or 2... It has probably also something to do with the way, surfaces are not loaded in the same order every time. I'll also post my test code in the linked thread.


TeraBit(Posted 2005) [#7]
Now I have to remember how it works. :)

So, are you saving out and reloading an 'Optimised' mesh?

As I recall, So that each triangle is independantly paintable, Decorator unwelds the level at loading time. It will then save the level unwelded when you save normally.

I recommended that people should only export an 'Optimised mesh' (a rewelded one) when they've finished a level or a copy to test in a game etc.

So the duplicates are coming in when saving out a rewelded 'Optimised Level'?

Is decorator making the extra tris or is it just getting confused over existing duplicates?

[note] After looking through the Decorator source, it seems a little hacked together in places. :/


jfk EO-11110(Posted 2005) [#8]
It's making the extra tris. The original Maplet Export has exactly the same number as the one with removed duplicates. The number of tris increases repeatedly, the more you are painting, saving and restarting decorator. It seems this happens only on areas where small zoom grids where used in maplet. so I guess it must be some kind of 3D scanning step problem.

Unwelding the mesh should not alter the number of triangles, only the Vertices. Maybe you should take care of the AddTriangle Command. I don't know how Decorator works internally, but I guess when I paint a triangl with a diffrent brush, you will recreate the surface with this new Triangle. Maybe it didn't remove the old Triangle correctly somehow?

I have made this exporter now, but it's driving me crazy. Thought I have a solution, but the fact that the surfaces are loaded in random order makes it difficult to decide if I should use the original or the clones of the duplicate tris.

Well since it's a emergency tool, I probably add a constant that can be edited on the fly, IF CLONESAVE=1 THEN etc.


TeraBit(Posted 2005) [#9]
I'll have a scan though the source over the weekend to see if I can see the problem.


jfk EO-11110(Posted 2005) [#10]
Uh, don't worry too much, it's christmas a good time to join the family party. It would be nice if you try to fix it the sooner or the later. Meanwhile, I'm gonna use the optimizer tool I just posted in the other thread.


TeraBit(Posted 2005) [#11]
It seems this happens only on areas where small zoom grids where used in maplet. so I guess it must be some kind of 3D scanning step problem.


I've never used maplet. Could you send me a small map that exhibits the problem so I can test with it?


jfk EO-11110(Posted 2005) [#12]
ok, gimme some time to zip it and move it to this webconnected terminal.

EDIT ok sent.


jfk EO-11110(Posted 2005) [#13]

Maybe it didn't remove the old Triangle correctly somehow?


Maybe a "for i=1 to" vs "for i=0 to" problem.


TeraBit(Posted 2005) [#14]
I've been painting and repainting the level with each of the painting modes, saving [F9] them in sucessive generations and reloading them to continue the painting.

It kept: 7629 Vertices and 2543 triangles in each generation every time. Byte for byte the files remained the same size. :/

What version of Decorator are you using? (1.8 is the current version). [edit] I see you have 1.8... hmmm.

Are you doing anything to the levels between reloading them in Decorator?


TeraBit(Posted 2005) [#15]
Hold on... Hmmm. Keeping going in the generations.. something looks fishy... O.o

[EDIT]

No. False alarm... Still the same number of tris and verts.


TeraBit(Posted 2005) [#16]
HOLD THE PHONE...

Now it is a different story with the already damaged level you sent along with the original.

When you try to paint a surface, you get a constant stream of extra triangles and vertices.

This is because the triangle that is being displayed on the screen is different from the one that is being picked by the CameraPick.

The CameraPick sees one triangle and the Blitz3D render engine displays another (camera range doesn't seem to make a difference).

Decorator then takes the picked triangle and tries to move it to another surface. But the one it picked is not the one you see. So it picks the same one and moves it again and so on.


TeraBit(Posted 2005) [#17]
Still looking into it. I'll get back when I've got some progress to report O.o


jfk EO-11110(Posted 2005) [#18]

This is because the triangle that is being displayed on the screen is different from the one that is being picked by the CameraPick.

The CameraPick sees one triangle and the Blitz3D render engine displays another (camera range doesn't seem to make a difference).

Decorator then takes the picked triangle and tries to move it to another surface. But the one it picked is not the one you see. So it picks the same one and moves it again and so on.



Yes, that's exactly what happens. It seems you cannot paint a triangle, instead it paints a triangle that is hidden behind it's clone.
I don't use any other tools, the extra tris where generated by Decorator somehow. Probably it happens in some rare exceptional case only, but if there's once a clone, they "multiply" quickly.


TeraBit(Posted 2005) [#19]
Ok. I've been testing with a new version (1.81 - Attack on the Clones) which should cure the odd clone triangle turning up.

It should also provide a bit of a speed up when dealing with bigger geometry.

Looking through the code is like looking though a time warp, as I've changed my coding style a lot in the last few years.

I've also updated the version of BlitzSys, so it may solve the 'BlitzSys crashing' that was reported elsewhere.

You can download 1.81 here

I hope that sorts it. It still blows if you try to paint a level with the clones already in, but it should no longer create them.

Let me know how you get on.


BlackJumper(Posted 2005) [#20]
Many thanks Lee. Can I suggest that you update the link in the Toolbox section (if you are able to.)

... if not, could BRL do this. While we are at it, there was a recent thread about your TSConvert tool where the version linked to in Specs & Utils seems to be an older one than the one I have available... you might want to rename the download on your website to point at the latest version.

I plan to use the new Decorator with a games development club I am starting in the school where I teach... The kids will enjoy blasting textures onto levels much more than working with 'proper' tools.


jfk EO-11110(Posted 2005) [#21]
Thanks a lot Lee! Tho I have finished the Map works for this WIP level right now but I'll do some tests anyway. The consistency of your support is amazing. To me Decorator is much more a proper tool than many other tools with a pro looking surface and little artistic productivity.

I take it the path is the same as the one of version 1.8, so all links may remain unchanched?

Huts off and many thanks!


TeraBit(Posted 2005) [#22]
Yes, it was only a minor version update so the link is the same.

I'll look into the Convertor link being old..