Jump to content
ScreaminAbdabs

Array out of range errors and How high is a Cim in blender units in Cities Skylines?

13 posts in this topic Last Reply

Highlighted Posts

Hi,

I am sure this must have been asked thousands of times, except I cant find a quick answer. There are tantalising mentions of using 'the cim model' which I guess is this one? https://forum.paradoxplaza.com/forum/index.php?threads/resource-max-obj-file-of-male-cim-to-get-better-sense-of-scale-when-modeling.874872/ however this is for 3Dmax and I'm using Blender (and having never used Max don't know if the units match).

My problem is that the replacement monorail station building I am working on is 1.37metres high in blender, and gets imported into city skylines at 12* scale sometimes, but sometimes this causes an array out of range (or something similar) error and I have to go up to 14 times. I have no idea why I get this error, nor why changing the scale fixes it, but its driving me nuts. My .fbx export scale is 1. If it imports ok at 12 times then the pedestrian routes all line up as do the platforms (which is nice) but they don't at 14 times, and the monorail platforms are the wrong height.

I'm wondering if this array error is due to me getting the scale just wrong so city skylines cannot do 'something' and maybe if I knew the actual height of a cim I could work backwards and fix this issue. Then again I could just be wrong.

In addition the station has stairs and I want to add a handrail onto these, but I'm stumped as to how high to make it as I cannot figure out how tall a cim is. If I do some simple maths my building is 16.44m (at 12*) or 19.18m tall (and wrong at 14 times).

Can someone point me at a simple solution?

Massive thanks in advance.

(Oh if anyone's interested the Metro I have been working on is now testing in some saves of mine, so far it looks good).

Share this post


Link to post
Share on other sites
  • Original Poster
  • Hi again,

    Well I couldn't solve that Array subscript error at all, then it became permanent, in other words changing the scale while importing didn't fix it (whatever it actually is) so I had to throw a lot of work away and go back to a much earlier mesh. On the plus side I had learnt quite a bit about blender putting the failed idea together so it wasn't that much of a problem and here is a very alpha model in game...

    However as you can see I am trying to make a glass dome and there are no semi transparent textures in game, leas I don't think they are? The alpha is a 1 bit deal on or off. I had hoped that giving the 'glass' a high specular would work, but it looks like the alpha overrides everything.

    I keep tripping over posts mentioning the Rotor shader, but so far haven't been able to locate one telling me how to use this. I have found posts saying that if you use it then internal lights don't show though the building's glass. Then I found this one - <Scroll to the end of the post> which has a car park that looks like it solves this issue.

    Thing is being new to this modding game I really don't understand the explanation as to how its been done.

    Could someone point me at a simple tutorial on the Rotor shader and a simple explanation as to how the trick with the carpark might of been achieved?

    Oh one final thought, if I do use the Rotor shader will my asset require anyone using my monorail station to have it as well, or are the textures baked at the import stage?

    Many thanks as always.

     

    (Model is over 4000 tris, ugh, so the lod is going to have to be a good one...)

     

    new monorail.jpg

    Share this post


    Link to post
    Share on other sites

    Hello ! 

    @Ronyx69 I just wanted to say thank you again... Everything you provide is so helpful for every new guy, like me, who starts doing some things for the game ! :)

    @SreaminAbdabs  I am still a new guy as well, but I did some rotor shader assets already ... so, if you have any specific question or need a more detailed answer with some special tips, you could write me a pm. I ' ve done a lot of things in the way of trial and error, and  of course, I ve  read a lot of things in this forum.  So there is the possibility that i am able to help you a bit  ... ;)

     

    Cheers ... 

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Many thanks both,

    Also thanks for the offer @Clus I tend not to PM as I hope that anyone answering my pitiful pleas for help can also help others who will not need to make them.

    The initial link that @Ronyx69 posted has got me a bit confused on UV mapping though. It says in one section ' You are allowed to UV map outside the 0-1 area (main tile), so you can tile the entire texture multiple times on a single face. '  But in the LOD section ' The UV mapping must be within the 0-1 area (main tile) of the UV map, no tiling is allowed. ....'

    However I am not sure what the 0-1 area of a UV is. I've attached a screenshot of Blender showing my v alpha uv map, could someone tell me where this 0.1 area is?

    Also thanks for the video link, though its somewhat quick for my addled mind to take in. Apologies if these are obvious questions that are answered in it.

    1. My Monorail has 2 skins for the dome, it -I think - needs this as the normals have to face outwards for the external faces, but inwards for the internal ones otherwise they are invisible. Blender allows for 2 sided faces, but I am not sure about .fbx files, or CS. As a result I have an outside dome and an inside dome (one of the reasons the tris are so large - 2 domes for the price of 2 domes). The video states that the Rotors shader renders in reverse so far objects appear closer than they should. I have a feeling this will make my building look v odd as if its trying to turn itself inside out. The vid states that you need sub buildings to fix this.

    However...

    I have had huge problems with scaling up until now, just getting the mesh to be a size so that when its imported the platforms are the right height has been a real pain. The asset editor seems to pick a random scale based on some unknown dimension. How can I make sure that the two domes I need will be the same scale as the main building?

    Or... Can I use double sided faces in CS without hammering performance and so that the inside and outside of the dome are visible with one set of faces?

    Will people wanting to use my asset have to subscribe to the sub buildings as well, or would these get pulled in automatically?

    2. How do I run the script? I've downloaded it but where do I need to put it so that I can access it in the Asset editor, and how do I access it once its there?

    Looking at the script it appears to be searching for something in Custom/Vehicles/Vehicle/Rotors, where is this, and what,if anything, do I need to place there?

    3. What if anything do I need to do to my mesh, UV etc so that the Rotors shader knows what bits to affect? The Video mentions vertex painting, which is something I have not done at all. Can I just provide a png of the areas I want to be translucent? The Vid shows just an .fbx being imported.

    Sorry for sooo many questions, however at present I remain Yours Truly , confused,N10. (with apologies to Mr Davis and Mr Holland).

    blender uv unwrap.jpg

    Share this post


    Link to post
    Share on other sites

    @ScreaminAbdabs

    1. The 0 -1 area is your "UV - Map" .... for examaple the 1024² texture or whatever size you choose.

    2. Double sided faces are not supported by the unity engine I think ... but at least they are not supported by Cities Skylines.

    3. You need mod tools activated in the editor, then push F7 to open the console and just paste the script in, after that just hit the "run" buttoon... thats all ;)

    4. The shader affects the whole mesh, that means the whole object. If you want to have some parts transparent (rotor shader) you have to import a separate model and

        then you have to run the script. Or you could use an object as a template that is already done with the rotor shader.

    5. And there is no need to subscripe to sub buildings. They are saved within your main object ...

     

    Some short answers ... cheers ;)

     

     

    btw. Why don´t you just change the "unit" settings in blender in to metres ? Then you can model everything in the right dimensions and you don´t have

    to worry about the scaling during the import process in to the game.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Hi @Clus,

    Many thanks for the help. Your 4 has me going eugh... I think this means that I need 2 glass domes, 1 for the inside, one for the outside, 2 domes for the glazing bars (again inside and outside)... I'm beginning to see why no-one has done this yet... The tri count is just spiralling here. I had hoped that the Rotor shader would work a bit like the _a (alpha) texture but more intelligently - so convert the channel to translucency. I'm guessing its not possible in CS, it may be that I'll just put out a Monorail with the standard reflective windows - it would be great to do a fully transparent one, but the count would be 2768 just for the domes or just over 5.6k for the full build.

    Unfortunately using Blender set to Metres hasn't helped with the scaling issue as it appears everything has a different scale in game. Small houses are one scale, larger buildings a different one. Monorails are just odd, (about 41.5 metres long?) skyscrapers are a much smaller scale. I have a feeling that lining everything up is going to be very hard.

    Thing is that triangles count... Is it too big for a 'common' building?

    Share this post


    Link to post
    Share on other sites

    @ScreaminAbdab

    You´re welcome ... :) There is no need for two domes. You can just copy the faces (shift-d) and then flip the normals (ctrl - n) ... btw I think that the tris count is totally ok. 

    But I am a little bit confused regarding your scaling "problem" ... I haven´t had any issues with the scaling so far. 

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • 22 minutes ago, Clus said:

    @ScreaminAbdab

    You´re welcome ... :) There is no need for two domes. You can just copy the faces (shift-d) and then flip the normals (ctrl - n) ... btw I think that the tris count is totally ok. 

    But I am a little bit confused regarding your scaling "problem" ... I haven´t had any issues with the scaling so far. 

    Hi,

    Oh I thought I'd get z fighting if I just copied and flipped, but thinking about this I guess not as the normals are inverted(?). What about z fighting with the rotors glass and the glazing bars? The glass has to be one mesh and the bars have to be another. If I just copy, won't I get a z-fight unless one's slightly larger as the game will be trying to render the glass and the bars at the same point(?).

    The scaling drove me nuts while I was trying to get things to line up. I've probably been doing this wrong - I'm still learning after all -but I built my station and placed it in the asset ed with props etc collected from the in game monorail. This showed me how high I needed to make my station so the platforms lined up with the tracks, (couldn't find this info) but also stated that it needed to be scaled to say 10*. I'd then rescale my station but when I put it back in the asset ed the import would say, ahh I need to scale this to 6*. If I did then the station was too small, so I'd try again at the original 10* only to find that it was too large but 9* was too small - and you cannot do 9.5. So Id rescale in Blender try again and the import would say ahh 7*, I'd ignore this and it would still be wrong so I'd rescale again and ... you can see where this is going. It took far too long to get the platforms to match the rails. I guess the monorail is the only asset where this is an issue? Maybe the ports? But these depend on the height of the coast to a greater extent.

    There a few monorail stations already on the Workshop so there must be an easier way to do this.

    Share this post


    Link to post
    Share on other sites

    Moin Moin ...

    I havent´t had any issues regarding z-fighting with the rotor shader so far. It works with the "real - glass - parts" totally ok when you just copy and flip the faces. But you could just

    test it yourself. Create some faces, load them in to the asset editor, apply the shader and just look for yourself. ;) Then you can decide if you´re ok with the result or not. A way arround the issue, if it would appear, is, to move the copied and flipped faces just one cm away from the other ones. With that method there shouldn´t be any clipping issues. At least for me that "walkarround" works just fine.

     

    I would do the bars separately. It is possible to do them together with the glass parts and simply change the "visibilty" of them with your alpha texture, but I think that it would look "better" when you do them with a "normal - shader" as part of the main model or another "sub - model". But that might be a personel design choice ... I did it together within my elevated

    glass station and at first I thought that it was "ok" ... but I won´t do it anymore.

     

    Regarding the scaling ... i am sorry, but i am still confused. There is a really usefull asset in the workshop you could use to get the "sizes" of objects in the game: https://steamcommunity.com/workshop/filedetails/?id=1339439093

    Load a vanilla station into the game or asset editor and have a look with it ... ;)

     

    Secondly you can change the scaling size during the import of assets. Just model the asset at the right scale, import it and change the scaling back to 1, if it is changed to another number.

    That should prevent any issues ....

    The platforms are normally 1m above the tracks for the trains or metros (with MOM). The platforms for the trams are at 30 cm above the tracks. I think with monorails it´s just the same as with the trains.

     

    Cheers ...

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Hi,

    Huge thanks for the pointer to the Ruler, it might just enable my stupid brain to understand scaling, at present its still a black art. For example -  I scaled my model 12 times in Blender so that its now 41 metres long in Blender. However when I import it into the game I still need to scale it 12 times. Wouldn't that make a building 67 metres long? I've attached the .blend and the .fbx in case anyone would like to figure out what I'm doing wrong. I've almost given up trying to figure it out. CS wants to import at 12 times so that's what I'll do.

    I am however having problems running the rotors script.

    I have attached a screen print of the debug window, its complaining that there are already local variables called shader and asset defined.

    I installed mod tools by subscribing via Steam, starting CS, activating mod tools in the content editor, closing CS and the restarting CS.

    This is the script I tried to copy and past in.

    //building

    var shader = Shader.Find("Custom/Vehicles/Vehicle/Rotors");

    var asset = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo;

    if(asset.m_material != null) asset.m_material.shader = shader;

    if(asset.m_lodMaterial != null) asset.m_lodMaterial.shader = shader;


     

    //prop

    var shader = Shader.Find("Custom/Vehicles/Vehicle/Rotors");

    var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo;

    if(asset.m_material != null) asset.m_material.shader = shader;

    if(asset.m_lodMaterial != null) asset.m_lodMaterial.shader = shader;

     

    Its just the standard Rotors script, I haven't changed anything.

    There are errors when mod tools starts up and I have attached these in the second screen print.

    Anyone any ideas what I've done wrong?

     

     

    monorail.blend

    monorail10.fbx

    debug errors.jpg

    mod tools startup error.jpg

    Share this post


    Link to post
    Share on other sites

    Moin ....

    I am no modder ... but it seems to me that you have tried to run the shader to a model that has no textures. At least you need to import the model with its diffuse and alpha texture.

    Without those textures you won´t get any restults simply by changing the models shader. Ronyx69 provided his source files of his Apple - Store building.... you´ll find them here:

    https://drive.google.com/drive/folders/0B6Ccf1N5h5f7cmwzd09MdE9nQkk

     

    Your blend file contains the whole model. If you want to have the dome as "glass - part" you have to separate it from the rest and create a new object with the separeted mesh.

    Unwrapp that new object, create your textures, import it all in to the asset editor and run the script. That should do the trick....

     

    Cheers ...

    Share this post


    Link to post
    Share on other sites

    Sooo ... I´ve imported the model and there wasn´t any issue regarding the scale of it. The size/measurement is exactly the same as it is in blender.

    I don´t know how experienced you are with blender, so don´t be offended ... but you could activate some "mesh info" like the length of the egeds or angles etc. That could

    help you a lot ... (activate the menu with "N", then under "Mesh info" --- "Edge info" just tick "length" ... )

    Share this post


    Link to post
    Share on other sites

    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 to join our friendly community. It's easy!  

    Register a New Account

    Sign In  

    Already have an account? Sign in here.

    Sign In Now


    • Similar Content

      • By AmiPolizeiFunk
        Hi Simtropolians,
         
        I'm building my home town, Berlin, with the help of your many mods and assets (I am using 70+ mods and 600+ assets). I started playing Cities:Skylines about 2 months ago and I'm enthused by the activity happening here and in the Steam Workshop. Thank you guys! 
         
        I'm endeavoring to add some of my own custom assets to the Workshop, but I'm new to the entire process. I'm good at photoshop, but I suck at Blender! I booted blender for the first time last week, so I'm at the rough end of a steep learning curve. You guys have been very helpful to get me over a few stumbling points. Now I'm getting ready to publish a couple of items and I'd like to run them by you first. I'm trying to start simple, but even simple objectives seem to morph into week-long efforts. Please let me know how my work can be improved.
         
        I've got a Checkpoint Charlie cooking (check my screenshot stream on steam or on twitter, if you're interested), but let's start with the Rosinenbomber from the Deutsches Technikmuseum:

         
        I found a DC-3 model by Giovanni E and lifted it to the top of the stock library with some prop anarchy:

        I was happy to find a DC-3, but the model has some texture problems (the illumination map is always fully on) because it's an old model and was probably made before After Dark. In wanting to fix the lighting problem, I wound up re-texturing the entire model to specifically be the famous Berlin C-47 "Rosinenbomber," as well as adding some propellers.

        It's starting to look decent in-game, but I still have some shadowing issues that I'm working on around the windows.

        I'd like to improve the body texture so that it looks more silvery and less white in the sun (I'm using PhotoReal3 LUT and Daylight Classic mods).

        Here are my current diffuse and spec maps:

         
        How would I go about improving the look of the body surface? I'd like it to be more shiny and silvery.
         
        My next question is, what is a good approach to make the LOD model?
         
        Thx for looking & thx in advance for your suggestions.
        -Ami
      • By Lee Towers
        Hey all! I've been following this forum for a while now and all your amazing creations inspired me to start building assets myself. The first building is almost finished - a 3 track train station, as seen below (props for the person to recognise the station it's based on). I still have a few problems with it though, so bear with me:
        1. The game is creating floors inside the building on its own. There's not even a vertex with the same z-coordinate where it's creating an xy plane inside the building. Is this something that's generated on purpose by the game? The floors are assigned the same textures as the roof of the building. They can be seen through the windows and are positioned about halfway behind the windows.
        2. My sims are not using the third platform. I'm using the single station track with a platform on the left side of the track (relative to the direction it was laid). I thought it had to do with the pedestrian connections that I've laid down, but they are using the second platform which is accessed by the same pedestrian connection.
        3. Speaking of pedestrian connections... I'd much prefer a rendered underground tunnel to the half-assed building I have there now but the game isn't letting me (it pushes the whole model upwards). How do I go about doing that? I know Joak uses them in his train stations, how did he do that?
        Any help regarding one of these questions would me much appreciated! Feedback on the model is also welcome by the way... it's my first time using blender and gimp. The textures aren't final either (mainly the roof and supports need work) but I've yet to learn how to use bump maps.

      • By ScreaminAbdabs
        Hi,
        I am having problems exporting my 1st model from Blender 2.79b into city skylines. I have followed various you tube tutorials and have prepared the model as follows.
        UV unwrapped.
        Created a basic texture and saved as building_d (model is building.fbx)
        Have set the model origin to the base of the object
        Have set transform, Rotation and Scale with Location,Rotation and Scale all ticked.
        On fbx export I have 2 options FBX 7.4 binary and FBX 6.1 Ascii, I select FBX 7.4 binary.
        In main I have selected objects ticked and a scale of 800, apply scale is all local, forward is -Z forward and up is Y up.
        However, in all the videos I have seen the Apply transform is ticked and just says 'Apply Transform' in 2.79b it is marked !Experimental! Apply Transform ...
        In Geometry I have Apply Modifiers and Use Modifiers Render Setting ticked, smoothing is set to Normals Only, loose edges is unticked as is tangent space.
        In armatures both only deform bones and add leaf bones are unticked. Primary Bone is Y  axis, Secondary is X axis and Armature is Null.
        For Animation I have all options ticked and have no idea if this is needed or not.
        My problem is that when I try and import the model into the Asset Editor in City Skylines I can see the file, but when I click on it there is no picture and I cannot import.
        Clearly I have goofed somewhere, but I do not know where.
        The UV map has separate non-overlapping islands.
        The model is made up of quads and triangles only and had 225 tris (a bit over the recommendation, prob due to its curved roof). If I can get this thing into the game I will be adding a simplified lod.
        I have uploaded the .blend file.
        Have I goofed in the model, can City skylines accept quads or do all faces have to be triangles? The videos make no mention of this.
        Have I goofed on the export? Or is there an issue with the fact that 2.79b has marked the Apply Transform as !Experimental!
        Hope someone can suggest, thanks in advance
         
         
         
        building.blend
      • By dennodk
        I have a performance issue which I suspect might be due to my own custom made roads for the game, made using Blender and the new in-game road editor.   First, my system specs:     Windows 10 Home i7-8700K 16 GB DDR4 RAM GTX 1080 Ti
        This system should be able to handle basically anything I throw at it. Yet, the game slows down dramatically when I approach 20 000 inhabitants in the game. I tried removing all mods. I tried reinstalling the game. I tried start a new map without any mods, but still using my custom roads. And the problem persisted. But, as soon I replaced all my custom roads with the standard built-in roads the problem disappeared.   I am new to making custom assets, but I would argue that the roads are designed within reasonable specifications. Most of them are with <100 tri with 1024x1024 images for close-ups and 128x128 images for lod.   So my question is: Are there any performance hits related to custom roads I should be aware of, and what are the steps I can take to mitigate them?   Another question: Many of my roads have an emphasis on bikes, and I can see I have A LOT of bikes around the city. Could the sheer number of bikes affect the performance, even though the city is still relatively small?
    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis relies mainly on member donations to continue operating. Without your support, we just would not be able to be entering our 15th year online!  You've really help make this a great community.

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running, so that we can help keep bringing SimCity players together to share our creations.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Echange.
    Make a donation and get one or all three discs today!

    stexcollection-header.png

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections