briochie / wow.unity

A collection of assets to make working with wow.export easier in Unity.
MIT License
18 stars 8 forks source link

Feature Request: objects along tile borders are duplicated, don't do that #5

Open oyvind-stromsvik opened 1 year ago

oyvind-stromsvik commented 1 year ago

For example in Goldshire the inn building is right on the edge between two tiles and both tiles import the building so it appears duplicated on top of itself. The same is true for all trees along tile borders as well.

I quickly compared with Blender and it doesn't seem like this is the case when importing directly into there.

Haven't done anything towards remedying this yet apart from observing it happening :p

oyvind-stromsvik commented 1 year ago

Some objects can be duplicated as many as 4 times. I noticed I had 4 overlapping Fargodeep Mines in my scene.

I'm not sure how best to solve this. I don't know what they've done in the Blender addon to solve it. One potential solution could be to keep track of all imported objects in a static array or something, and then whenever you are about to import a new object you check against that array first. The array would contain a hash or whatnot of the object's name/id and position/rotation/scale, and if the object we are about to import is identical we skip it. But this would only work if you were importing everything at once, and maybe not even then for all I know :p

This is something I probably need to look into because I feel there too many duplicated objects to manually clean up. Since I already have imported most of what I want in this project I'm thinking about making (or finding) an editor script that will allow me to identify all prefab instances with identical transforms in the scene view so that I can delete them all in a single go. If nothing else such a solution is a decent fallback at least.

I'm thinking that ideally this is solved in wow.export. It should ensure that each object only belongs to a single tile, but I have no insights into potential limitations in working with that, or drawbacks for other use cases than my own with such an approach.

briochie commented 1 year ago

wow.export takes the data as-is from WoW and places it in the output. Stormwind, for example, is referenced across a handful of ADTs because it's so big. It makes sense border objects would also have this issue.

Unfortunately, I don't think this will be fixable as a bug, so I think you are right to call this a feature request. Maybe some kind of scene optimizer that can hunt for and disable duplicates.