-
Content Count
61 -
Joined
-
Last Visited
Community Reputation
42 Rising StarAbout Elektrix
-
Rank
Sophomore
Recent Profile Visitors
-
-
tutorial Sketchup to Cities: Skylines: The Easiest Way
Elektrix replied to Elektrix's topic in Cities: Skylines Modding - Open Discussion
don't rename your sketchup model -
Cities: Skylines - Community Modding Requests
Elektrix replied to Cyclone Boom's topic in Cities: Skylines Modding - Open Discussion
@jumonjii Not entirely sure how to say this well. Have you searched the workshop at all? The first seven assets when I searched "planning" with the roads filtered are exactly what you're asking for. -
tutorial Sketchup to Cities: Skylines: The Easiest Way
Elektrix replied to Elektrix's topic in Cities: Skylines Modding - Open Discussion
it's likely that you didn't save user settings. you probably just can't find the tool, it's under the scene tab in blender 2.79. going to be updating this tutorial severely. -
tutorial Sketchup to Cities: Skylines: The Easiest Way
Elektrix replied to Elektrix's topic in Cities: Skylines Modding - Open Discussion
you have too many polygons, the tool is overloaded and will produce bad results. use a planar decimate modifier until you're well under 20k tris. -
tutorial Sketchup to Cities: Skylines: The Easiest Way
Elektrix replied to Elektrix's topic in Cities: Skylines Modding - Open Discussion
enable texture atlas plugin. -
Modding - net segments, net nodes & other
Elektrix replied to Strdate's topic in Cities: Skylines Modding - Open Discussion
All right, cool! I'm still really enjoying using the mod, and the elliptical roundabouts are a nice touch! I'm currently testing the new version out on a savegame, here are some things that I noticed: Easy to fix: Decimal +/- (On the digit row on top of the keyboard) do not increase the radius of the circle but the numpad (far right) +/- do. If the window is open over a node when you click on one of the roundabout types (or anything else for that matter), the node under the window is selected whether you like it or not. This can be fixed by restricting what mouse positions are open to raytracing. If the mouse is over the UI window, simply don't allow the tool to be used. One can select pedestrian path nodes even though roundabouts don't work properly on them. Pressing "back" on Step 2/3 of the elliptic roundabout generator goes back to the very beginning, not to the previous step, and there's no clear way to return to the previous step. Easy to fix: The window does not disappear when you enter cinematic camera mode. Parenting the window to something that does disappear should resolve the issue. If the radii on the ellipse are equal to each other, then normal circle mode should be used (if that's not being done already). In my opinion, holding a modifier key while pressing +/- should allow you to change the major/minor radii of the ellipse instead of increasing both at once. (Not really a bug report, but something I wished I had while using the mod)- 8 Replies
-
- 1
-
-
- cities skylines
- modding
-
(and 3 more)
Tagged with:
-
Very Bad Graphics Problem
Elektrix replied to willham's topic in Cities: Skylines Technical Help Q&A
After industries, my graphics settings reset to "low" for all settings; make sure that they're set correctly. You can use mods like Dynamic Resolution to get rid of a few of the jagged edges, and Tree LOD Fix should help with the blurry trees. As for the roads looking ugly when looked at from grazing angles, use Sharp Textures on higher settings to fix this effect for the most part. -
Roundabout Builder Mod
Elektrix replied to ghosty20's topic in Cities: Skylines Modding - Open Discussion
Ain't it cool? It was made by @Strdate. I've already used it several times in my game and it works like a charm! It is way better than the faulty method I was using before. I'd definitely recommend subscribing to it. -
Modding - net segments, net nodes & other
Elektrix replied to Strdate's topic in Cities: Skylines Modding - Open Discussion
Before I begin, are you using ILSpy? If so, are you aware of the Analyze feature? Right click on any method, property, or field you're not sure about and it should bring you back to its declaration. (I just realized that I responded to this post backwards, sorry ) 4. UI is honestly a pain in the rear and I always have had at least one issue with it for both of my current mods. I'd suggest using ModTools to get field values of UI that you want to "copy", and since you mentioned boformer's tutorials I'd suggest looking at SamsamTS' UIUtils that is mentioned briefly in Tutorial 4 to get a better idea of the inner workings of the stuff. I'm not really sure how the Unity GUI specifically works with this game, though-- I've always found ColossalFramework.UI to differ from generic UnityUI in very subtle and annoying ways. 3. MAX_SEGMENTS_PER_NODE is 8, although netNode.GetSegment() with a higher number should return 0 anyway, so you're fine to keep it as 12 if you don't feel like updating it, since you're already doing a nullcheck. 2. Lol, I'm happy to help wherever I can. As for the tangent function, I haven't personally tried it out, but the first overload: public Vector2 Tangent(float t) at t=0f should give you the first of the two directional vectors. Beziers are basically just a graph of a parametric curve function with respect to time on the interval 0 to 1, so I'd make an educated guess and say that the same function at t=1f should give you the second directional vector. If that doesn't give you the correct directional vectors, try instantiating new vectors based on the control points of the Bezier curves (so one vector from Bezier.a to Bezier.b and the other from Bezier.d to Bezier.c) and using those as directional vectors. The vectors may or may not need to be normalized as well. (I honestly have no idea.) Otherwise, I have no idea, sorry 1.Awesome, I'm going to use that a ton! Have you considered adding the ability to change what road is used, like a dropdown or something?- 8 Replies
-
- 1
-
-
- cities skylines
- modding
-
(and 3 more)
Tagged with:
-
tutorial Sketchup to Cities: Skylines: The Easiest Way
Elektrix replied to Elektrix's topic in Cities: Skylines Modding - Open Discussion
The reason why exporting straight from Blender tends to have less tris is because Sketchup tends to create duplicate vertices when exporting .dae or .obj models (for unknown reasons, but I think it's likely because of the way texturing works internally). If I remember correctly, all you have to do to get the tris down after exporting is just to hit Remove Doubles in edit mode after you've re-mapped the shape, although that process may need to occur slightly sooner in the process as I haven't done it in a while. From one format to another I believe the difference is negligible and would be resolved with Remove Doubles anyway. I use .dae here because it's in the free version of Sketchup, but the process could be used with .obj or .fbx exports as well. As for texturing, I've found that if models I make in Blender that I UV map manually tend to look best and are optimized well at 2nx2m pixels, then typically a Sketchup version created with my plugin looks best and is best optimized at 2n+2x2m+2 pixels, and the larger texture size is typically passable, in terms of RAM consumption. I rarely have textures (2K or 4K for personal use) that are much greater in size than maybe 2 MB. But ultimately, the objectively best texturing work and UV mapping (at least at this stage of the tools available to us) is done by hand. Sorry for the hurried response, I'm between classes currently -
Elektrix: Net Picker Tool, Segment Slope Smoother Mod, and more!
Elektrix replied to Elektrix's topic in Cities: Skylines Modding - Open Discussion
What I currently have (which neither works nor even compiles) is this: ushort segmentId = m_hover; NetInfo prefab = m_netInfo; Type SegmentDataManager = m_networkSkinsAssembly.GetType("NetworkSkins.Data.SegmentDataManager"); object networkSkins = Activator.CreateInstance(SegmentDataManager); var segmentData = SegmentDataManager.GetField("SegmentToSegmentDataMap").GetValue(networkSkins)[segmentId]; MethodInfo m = SegmentDataManager.GetMethod("SetActiveOptions"); m.Invoke(networkSkins, new object[] { prefab, segmentData }); My main issue is getting the segment data. I'm honestly not sure how to get at it. I've tried the above method (which doesn't compile) and I also tried casting the SegmentToSegmentDataMap to something other than a generic object, but I wasn't quite sure what to cast it to, since its actual type is SegmentData[] which is a class from Network Skins. I feel like I'm probably doing the whole thing wrong, as I'm honestly not really familiar with reflection at all. In other news, I'm trying to merge Segment Slope Smoother with Quboid's new version of Move It, which is going much better overall; it's nearly done, and I'll probably submit a PR by the weekend. -
Modding - net segments, net nodes & other
Elektrix replied to Strdate's topic in Cities: Skylines Modding - Open Discussion
You can find out if a segment is straight arbitrarily by using NetSegment.IsStraight() with no parameters. That will save a lot of calculation. Net segments can also be defined as a cubic bezier with the middle points (bezier.b and bezier.c) being found by the function NetSegment.CalculateMiddlePoints, so you're in luck, because you don't have to use much complex math. I tried to explain how to do at least the intersection process, but I couldn't even understand my own explanations, so here's some code that roughly finds the intersection point and places to split each NetSegment: // First segment data NetSegment yourSegmentHere; Bezier3 bezier; // Second segment data NetSegment yourSecondSegmentHere; Bezier3 secondBezier; // Turn the segment data into a Bezier2 for easier calculations supported by the game bezier.a = NetManager.instance.m_nodes.m_buffer[yourSegmentHere.m_startNode].position; bezier.d = NetManager.instance.m_nodes.m_buffer[yourSegmentHere.m_endNode].position; bool smoothStart = (Singleton<NetManager>.instance.m_nodes.m_buffer[yourSegmentHere.m_startNode].m_flags & NetNode.Flags.Middle) != NetNode.Flags.None; bool smoothEnd = (Singleton<NetManager>.instance.m_nodes.m_buffer[yourSegmentHere.m_endNode].m_flags & NetNode.Flags.Middle) != NetNode.Flags.None; yourSegmentHere.CalculateMiddlePoints(bezier.a, yourSegmentHere.m_startDirection, bezier.d, yourSegmentHere.m_endDirection, smoothStart, smoothEnd, out Vector3 bezier.b, out Vector3 bezier.c); Bezier2 xz = Bezier2.XZ(bezier); // Second segment: secondBezier.a = NetManager.instance.m_nodes.m_buffer[yourSecondSegmentHere.m_startNode].position; secondBezier.d = NetManager.instance.m_nodes.m_buffer[yourSecondSegmentHere.m_endNode].position; bool smoothStart = (Singleton<NetManager>.instance.m_nodes.m_buffer[yourSecondSegmentHere.m_startNode].m_flags & NetNode.Flags.Middle) != NetNode.Flags.None; bool smoothEnd = (Singleton<NetManager>.instance.m_nodes.m_buffer[yourSecondSegmentHere.m_endNode].m_flags & NetNode.Flags.Middle) != NetNode.Flags.None; yourSegmentHere.CalculateMiddlePoints(secondBezier.a, yourSecondSegmentHere.m_startDirection, secondBezier.d, yourSecondSegmentHere.m_endDirection, smoothStart, smoothEnd, out Vector3 bezier.b, out Vector3 bezier.c); Bezier2 xz2 = Bezier2.XZ(secondBezier); if(!xz.Intersect(xz2, out float t1, out float t2, 5)){ // can adjust final parameter "to taste". 5-8 should probably be fine although I haven't tested this to find out. return; } Vector2 intersectionPoint = xz.Position(t1); // you will now have two time-based variables, t1, and t2, that are the parametric intersection times for the respective beziers. Then you can split the beziers at their respective points using Bezier2.Divide and create new NetSegments based on the resulting data. // you also have the coordinates of the place where the segments intersect. The rest would be relatively simple, but I don't want to write your mod for you Psst! I'd suggest taking a look at NetTool.CreateNode for physically placing the new node and segments. Happy modding, I'm excited to see what you make!- 8 Replies
-
- 1
-
-
- cities skylines
- modding
-
(and 3 more)
Tagged with:
-
Elektrix: Net Picker Tool, Segment Slope Smoother Mod, and more!
Elektrix replied to Elektrix's topic in Cities: Skylines Modding - Open Discussion
I'm not quite sure how to programmatically detect when specific networks should be "hidden" or not; else, I would have already included a checkbox that enables "dev mode" so that normal people won't have access to these offending prefabs. On the other hand, I would hate to not be able to select MoM tracks anymore, because they're technically hidden too. If I can find a way to do that, I will make said update because I've already received a few very questionable bug reports on both mods. Ultimately I agree with AmiPolizeiFunk though. That's the caveat with using many mods: they introduce the probability of breaking your game that the vanilla game is specifically fine-tuned not to offer. If users refuse to live with the fact that one can very possibly break something when using an (in-some-cases-advanced) mod in an advanced or unintended fashion, then they should probably go back to the vanilla game or use mods that don't offer said experience. Anyway, as for Network Skins compatibility, I too would be interested in that; I suppose I misunderstood how it worked internally (although I didn't take a look at the source so I didn't really educate myself well enough). I'll take a look at it soon and hopefully make an update of some sort (I really need to figure out making the icon draggable anyway). -
Elektrix: Net Picker Tool, Segment Slope Smoother Mod, and more!
Elektrix replied to Elektrix's topic in Cities: Skylines Modding - Open Discussion
Yeah, that's more or less what I have now: public NetInfo FindDefaultElevation(NetInfo info){ for (uint i = 0; i < PrefabCollection<NetInfo>.LoadedCount(); i++) { NetInfo prefab = PrefabCollection<NetInfo>.GetLoaded(i); if((AssetEditorRoadUtils.TryGetBridge(prefab) != null && AssetEditorRoadUtils.TryGetBridge(prefab).name == info.name) || (AssetEditorRoadUtils.TryGetElevated(prefab) != null && AssetEditorRoadUtils.TryGetElevated(prefab).name == info.name) || (AssetEditorRoadUtils.TryGetSlope(prefab) != null && AssetEditorRoadUtils.TryGetSlope(prefab).name == info.name) || (AssetEditorRoadUtils.TryGetTunnel(prefab) != null && AssetEditorRoadUtils.TryGetTunnel(prefab).name == info.name) ){ return prefab; } } return info; } Additionally, I didn't get the promotional pictures done in time to release in 40 minutes and I'm honestly super tired from some other work, so I'll have to do them tomorrow (or later today depending on where one may live), and I'll release it later. Also, happy 2019. On an unrelated note, I've discovered a weird quirk when loading external .dll libraries alongside mod executables: if you return to the main menu and turn off a mod that uses the same external .dll library in a different place, the library is turned off for the other mods too. I got super confused when I saw the no-icons fallback version of the mod on my screen after reloading. January 1 edit: I can't upload anything to the Steam workshop. Whenever I try to upload, the workshop makes 30 blank and permanently hidden assets on my profile. I looked up the issue to see if anyone else had it, and other people do. I'm not really sure how to fix this, as I tried uploading it manually through the ModTools console and still came up with blank assets. Rats!
