• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

drakblod

Corporal
3 Badges
Feb 9, 2015
48
7
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
Program: SketchUp

Hi, I do need your help again...
I'm still very new to modding so there is still much for me to figure out. A week ago I had problems with my 3d-model when it didn't load in the asset editor. I got this errormsg Array index is out of range. [System.IndexOutOfRangeException]

I had a suspicion that I had hit a tris-limit which kinda got confirmed by a modder. I re-created my model and it started to load into the game as it should.

Now I'm around 50% in the baking-process when suddenly my model stops loading again. I get the same errormsg Array index is out of range So my question to you guys is if the baking in anyways affects my 3d-models tris count, size or anything and if so, why?

Thanks!
 
I'm assuming it's not just triangle count, but all coordinates (vertexes, and UV as well).

What is the polycount of the model? If you're hitting such a limit it's likely far, far, far too high poly. The highest it should be for your average tall building should be around 1000 triangles, which in the grand scheme of video games is quite low, so if the engine can't even load your model because of the coordinate count then you have some serious work to do reducing the count.
 
I'm assuming it's not just triangle count, but all coordinates (vertexes, and UV as well).

What is the polycount of the model? If you're hitting such a limit it's likely far, far, far too high poly. The highest it should be for your average tall building should be around 1000 triangles, which in the grand scheme of video games is quite low, so if the engine can't even load your model because of the coordinate count then you have some serious work to do reducing the count.

Well last time I checked it was far above 30k triangles, so it's way above recommended. I really have to check if there's something I can do to decrease this even further. Because I do want some segments so the building doesn't start to look to bad.
But as i said, I did some cleaning which almost decreased the poly-count to half and that made my building load in the asset editor again.

But what you're saying is that the vertexes and UVs get affected by positioning my textures so that they fit, and that increaseas the overall size of the building?

Btw, thanks for the answer
 
I could be completely wrong about this, but I believe I read that in Unity (probably more engines as well) when a vertex has multiple UV coordinates (basically any vertex at the edge of a uv island) it splits it. So if it's for example on an edge you get two vertices and on a corner you get three. So when your UV map has a lot of UV islands this could seriously increase your vertex count.
 
  • 1
Reactions:
As far as I know every UV tile you change adds 3 to 4 'vertices' to the count. Those can contain texturing info, but also normal and smoothing settings. So even a simple cube can have a higher tris count then what you might see in your software.

I agree with Ryno, I'm not sure what kind of building you are working on, but 30k does sound very high. That's not to say a building can't have that many vertices, but 99% of the time it's not necessary. With that tris count, you are also giving yourself a lot more work during texturing.

On a related note, Sketchup is not exactly the best program for modelling. It's fine for rough blockouts, but it wouldn't surprise me if your model ends up showing more issues. Power to you though if you can make it work!
 
I could be completely wrong about this, but I believe I read that in Unity (probably more engines as well) when a vertex has multiple UV coordinates (basically any vertex at the edge of a uv island) it splits it. So if it's for example on an edge you get two vertices and on a corner you get three. So when your UV map has a lot of UV islands this could seriously increase your vertex count.

Okay, so if I understood this correctly, I could benefit from a map with a larger resolution because it would create less uv-islands? I used 1024x1024 for this model, so maybe 2048x2048 would be better for a large model?
 
As far as I know every UV tile you change adds 3 to 4 'vertices' to the count. Those can contain texturing info, but also normal and smoothing settings. So even a simple cube can have a higher tris count then what you might see in your software.

I agree with Ryno, I'm not sure what kind of building you are working on, but 30k does sound very high. That's not to say a building can't have that many vertices, but 99% of the time it's not necessary. With that tris count, you are also giving yourself a lot more work during texturing.

On a related note, Sketchup is not exactly the best program for modelling. It's fine for rough blockouts, but it wouldn't surprise me if your model ends up showing more issues. Power to you though if you can make it work!


Yeah, you and acc3ss Violation seem to have the same idea on how changing UV-tiles works, so you're probably right.

Regarding the building, it's a 350 meters tall skyscraper that has many round edges which has made it pretty hard to keep the tris-count down, especially for me who is very new to creating 3d buildings. Hopefully I've inserted a picture of it in this post.
So it's probably a combination of inexperience and a pretty complex building. I know for example that I could make 5-6 floors as one section instead of every floor seperatly, although I don't think that will be enough.
I have made every circle in the building with for example 8 segments instead of 15 etc. But as I said, I'm afraid the building will look a bit crappy if i decrease this even more.

I really wish I knew how to work with other 3d-softwares like Blender, but when I've imported my .obj to blender and uv-unwrapped, the uv's are just a mess.
But I've made a couple of skyscrapers ( not including a custom LOD ) so it's definitely possible to make things in SketchUp, altohugh as you say, the models will most certainly be less heavy if I make it with a "real" 3d-software.
 

Attachments

  • al_attar_sketchup.png
    al_attar_sketchup.png
    56 KB · Views: 79
I have to say that's a very impressive looking building, I would love to see it fully textured! :D Is it an existing building?

Could you possibly post a close up wireframe or vertex mode? The areas with columns and window extrusions may still be pushing it up. If you want to I can have a look at the obj to see if theres any areas that could be optimized.
 
  • 1
Reactions:
I have to say that's a very impressive looking building, I would love to see it fully textured! :D Is it an existing building?

Could you possibly post a close up wireframe or vertex mode? The areas with columns and window extrusions may still be pushing it up. If you want to I can have a look at the obj to see if theres any areas that could be optimized.

That would be lovely if you could check the obj, should I pm it to you? and also are there any special settings that is needed before i export the .obj?

It's a tower in Dubai called Al attar. It's not built yet so it's based on sketches and pictures.

This is about how far I came in my testing before the errormessage started to appear..
There are also some thing that I need to do with the maps before I feel happy with the model, like increasing the reflections in the specular map, colors etc.

But I'd really appreaciate if you have a couple of minutes to check out the model. I'm not quite if it works, but if you find anything unnecessary and you can delete it, it would be even more awesome.
 

Attachments

  • snipp_al_attar.jpg
    snipp_al_attar.jpg
    211,6 KB · Views: 63
Try combining floors together by removing the horizontal lines between them wherever possible. This should reduce your vert and tris count pretty significantly.

I was going to suggest this as well - there's no need to have separate poly structures for each and every floor.

Also, SkethUp isn't designed for video games, so you have little control over the polygons it makes - especially when it comes to round areas. You'd be better off manually making it from a few flat segments (say, maybe 5 segments total) to create the round sides instead of making it with a curve in SketchUp - it's probably loaded with polygons and its far too 'round.' You have to remember that this is a videogame, and there are limits.

Also - 30K polys? I don't know about Unity's values specifically, but every engine has a limit on the number of verts for each individual object within it, and taking 30k from one object, plus all the UV and normals information, I wouldn't be surprised if that was north of 100-150k in the engine. For reference, the custom engine built for Assetto Corsa (a racing sim) has a limit of a little over 60k per object. Unity's may be higher, but still.
 
Thanks for the tips Acc3ss & Ryno917. I'll try both combining floors and making the circles manually and see how much that affects the outcome.

Around +30k tris is in-game with a bit less than half of the texturing done. I used the Mesh info plug-in in Cities Skylines to get those values. So I guess the base model from SketchUp should be a bit less tris than that.

Also I found some lines on the inside of the model. I'm not sure if this affects the tris-count when these surfaces are hidden?
Gray surface in SketchUp means it doesn't get rendered
 

Attachments

  • lines_inside.png
    lines_inside.png
    250,9 KB · Views: 59
Last edited:
I don't know how you are importing your models, but Sketchup creates really bad models with lots of extra vertices.

How to optimize a SketchUp model with Blender:

  • Import your model in blender. Select it and press TAB to go into Edit Mode.
  • Now press W and select "Remove doubles" from the popup menu (you will see how many doubles were removed in a status box at the top)
  • For UV-Mapping in Blender, it might also be useful to merge faces which are next to each other. Sometimes it might reduce the vertex count. You can do that with Mesh > Clean Up > Limited Dissolve).
  • Press TAB to go back to object mode. Select your model and press CTRL + A, select "Location" from the popup menu. Then press the keys again and select "Rotation & Scale". This fixes invalid scale factors set by blender.
  • After that, export your model with Blender. You can choose fbx or obj (fbx seems to be broken in latest Blender version).
  • Use these export settings for .obj files:
HF4k9wv.png
 
  • 2
  • 1
Reactions:
I don't know how you are importing your models, but Sketchup creates really bad models with lots of extra vertices.

How to optimize a SketchUp model with Blender:

  • Import your model in blender. Select it and press TAB to go into Edit Mode.
  • Now press W and select "Remove doubles" from the popup menu (you will see how many doubles were removed in a status box at the top)
  • For UV-Mapping in Blender, it might also be useful to merge faces which are next to each other. Sometimes it might reduce the vertex count. You can do that with Mesh > Clean Up > Limited Dissolve).
  • Press TAB to go back to object mode. Select your model and press CTRL + A, select "Location" from the popup menu. Then press the keys again and select "Rotation & Scale". This fixes invalid scale factors set by blender.
  • After that, export your model with Blender. You can choose fbx or obj (fbx seems to be broken in latest Blender version).
  • Use these export settings for .obj files:
HF4k9wv.png

Thanks, I'll try this and see how much this cleans up my model.

For exporting I used Thomthom's Cities Skylines tool which was great when it both gave me the correct tile-grid and the ability to export with the correct settings.
I was trying to be stubborn and only use SketchUp for the whole process (creating, baking, exporting ), but now when I see how inefficiently it is for 3d-games and that it's impossible to make a LOD with the 0-1 UVs, I'll most certainly just use it for the base of my model in the future.

There's alot that I'll have to figure out in Blender, but in the long run it will certainly be worth it.
 
Just upload or pm me the model how you can. I'll have a quick look as stated above there's likely a lot of unneeded polygons and overlapping verts.
Really appreciate it.
I'll try all the tips I've gotten so far by everyone and see if this makes my model more suitable for Cities Skylines.
If not, I'll upload it here for inspection.

I'm not sure what my goal should be with the tris-count. Is around 1000 triangles as Ryno917 suggested a reasonable/possible goal for my model? I guess this means 1000 triangles before I've textured it which will end with around 4k-8k with the textures?
 
Just upload or pm me the model how you can. I'll have a quick look as stated above there's likely a lot of unneeded polygons and overlapping verts.

I was experimenting with my a bit model and it turns out that the baclonies for just one side are generating around 9k tris, which is around 300 triangles per balcony.
So I guess I have to make all circles in SketchUp to rectangles as you guys have suggested earlier and see if that works.

Here's a link to the obj-file if you want to take a look and see if there is anything more I can do to reduce the tris-count.
http://speedy.sh/dnt3w/al-attart.obj
 

Attachments

  • al_attar_balcony.png
    al_attar_balcony.png
    98,2 KB · Views: 43
  • al_attar_balcony_full.png
    al_attar_balcony_full.png
    39,5 KB · Views: 45
I think you are on the right track with the balconies. I just imported the model and it clocks in at about 42K, which is still quite high.



I do believe you'll want to switch to other software sooner or later. For a simple model this might work, but some issues are gonna be hard or impossible to fix in sketchup. Here are some examples...


/\ Software will use dozens of triangles where 1 polygon would have been enough.


More triangulation because all these polygons are connected to the same verts. Below is an example of how this could be just 1 or 2 long vertical polygons. That could be done for practically the whole building saving maybe 60-80% on tris count. It can be balanced out with good size uv tiles.


347 polys here for the top of one spike:


Also sketchup loves adding stuff that shouldnt be there:

That's where wireframe comes in handy.


Some smoothing problems (this may be an import thing on my side using 3ds)

These things can all be fixed but for a building this size it will be a timeconsuming process.
Hope you don't take this as negative critisism! I think the model looks very good but you are being limited by the software you're using.
I would recommend trying Boformers suggestion, to take some steps back and switch to Blender.
 
I think you are on the right track with the balconies. I just imported the model and it clocks in at about 42K, which is still quite high.



I do believe you'll want to switch to other software sooner or later. For a simple model this might work, but some issues are gonna be hard or impossible to fix in sketchup. Here are some examples...


/\ Software will use dozens of triangles where 1 polygon would have been enough.


More triangulation because all these polygons are connected to the same verts. Below is an example of how this could be just 1 or 2 long vertical polygons. That could be done for practically the whole building saving maybe 60-80% on tris count. It can be balanced out with good size uv tiles.


347 polys here for the top of one spike:


Also sketchup loves adding stuff that shouldnt be there:

That's where wireframe comes in handy.


Some smoothing problems (this may be an import thing on my side using 3ds)

These things can all be fixed but for a building this size it will be a timeconsuming process.
Hope you don't take this as negative critisism! I think the model looks very good but you are being limited by the software you're using.
I would recommend trying Boformers suggestion, to take some steps back and switch to Blender.

Wow, your examples really proves why SketchUp almost is unusable for larger, more detailed buildings.
Critisism is what makes you better, so I do nothing but appreciate everything you've said and showed me.
Have to admit that I'm a bit sad I didn't realize sooner how bad sketchup is for these kind of 3d-models.

most of the examples you showed will indeed be pretty impossible to fix.Although I might be able to get a pretty healthy tris-count by just making the baclonies and circular windows into rectangles as you showed in one of your pictures.

I tried what boformer suggested and that deleted 49 verticales, which in this case doesn't really make my model that much better.

Really, really appreciate that you've taken some time to help me out with this. I do enjoy making 3d-models very much, and I really hope I can start sharing my models with the community soon.
So thanks alot!
 
  • 1
Reactions: