-
Content Count
7 -
Joined
-
Last Visited
Community Reputation
2 RecognisedAbout mcegla
-
Rank
Freshman
-
Importing real-world database directly to game environment
mcegla replied to mcegla's topic in Cities: Skylines Modding - Open Discussion
As I said in other thread, I have basically rewritten whole mod. Updated/Rewritten version is now on github (https://github.com/mcegla/GeodataLoaderPL-test) It can be used in game and in map editor, but placed in game and not zoned, buildings will disappear. I will soon release it on steam workshop I just wish that i had some more data for testing :/ Anyway I hope that my new version will be useful for someone, as TDB (BDOT10k) might soon be available for free. New screen without fog etc.: -
[Help] Removing despawn logic from code-placed buildings.
mcegla posted a topic in Cities: Skylines Modding - Open Discussion
Since pandemic started I found myself having too much time, so I returned to my master thesis mod to make it usable. I have basically rewritten all of it and now whole parsing is done with XML.LINQ in other process. I’m trying to use it in game (not in map editor as before), but buildings placed by my code are not really cooperating with Plop The Growables, and No Abandonment mods. Is there some simple way to disable zone check, abandoning etc. for those buildings on current patch? I want to keep buildings interactive (when placed in map editor, they will remain in one place, but will not have interactive popup windows, will not be “clickable” etc.). Here’s simple code snippet that I use for buildings creation: public class BuildingFactory { private static int temp = 0; public void Create(Vector2 point, float angle, string BuildingType) { if (temp < BuildingManager.MAX_BUILDING_COUNT) { int length = 0; BuildingInfo building = PrefabCollection<BuildingInfo>.FindLoaded(BuildingType); if (building == null) { Debug.LogError($"Building could not be found: {BuildingType}"); } else { SimulationManager.instance.AddAction(AddBuilding(point, angle, length, building)); temp++; } } else Debug.Log($"MAX_BUILDING_COUNT reached"); } private static IEnumerator AddBuilding(Vector2 point, float angle, int length, BuildingInfo building) { ushort buildingNum; var coordZ = Singleton<TerrainManager>.instance.SampleRawHeightSmoothWithWater(new Vector3(point.x, 0, point.y), false, 0f); BuildingManager.instance.CreateBuilding(out buildingNum, ref SimulationManager.instance.m_randomizer, building, new Vector3(point.x, coordZ, point.y), angle, length, Singleton<SimulationManager>.instance.m_currentBuildIndex); Singleton<SimulationManager>.instance.m_currentBuildIndex += 1u; yield return null; } } And this is what I’m talking about: Thanks -
Importing real-world database directly to game environment
mcegla replied to mcegla's topic in Cities: Skylines Modding - Open Discussion
I made a 2-stage button and it works. I'll not release it on steam; as it's probably buggy and unoptimised (as I tested it only on one area). Repo: https://github.com/mcegla/GeodataLoaderPL-test as i said before this version needs "Privacy Fence" asset: https://steamcommunity.com/sharedfiles/filedetails/?id=1394735871 I made some (excessive) comments, on my parts of code ... sorry :| just one more screen: -
Importing real-world database directly to game environment
mcegla replied to mcegla's topic in Cities: Skylines Modding - Open Discussion
Update: it kinda works Thanks to my friend DTM is now imported directly during run time (RAM usage up to 8GB, as 1m DTM is pretty big :|), though it miiight not be the best way to do it. Problem is … I don’t know how async works in here (as if I know anything about async), and I can’t load it at the same time … maybe other button just for it? Resources (NaturalResourceManager) added as textures, but it’s not enough as pavement etc. should be also placed … I just couldn’t make it work with that TerrainManager/Modify, and used prop pavement which looks silly, as it is placed over any other objects :| Fences were eating props / nets (with use of “Privacy Fence” asset) like crazy I needed to limit their range to 7 squares. All this time I was using Polish BDOT10k (.xml/gml) and PUWG 1992 (coordinate system). After I clear and refactor this code (it’s a mess) I’ll place some github repo link here or smth. If anyone would like to use it, it’ll still need to be customised to your own .xml structure / coordinate system (ofc if you won’t use Polish ones). Ortophoto from geoportal.gov.pl WMTS service and DTM inserted manually for comparison: Picture with river regulated manually after loading: some errors: -
Importing real-world database directly to game environment
mcegla replied to mcegla's topic in Cities: Skylines Modding - Open Discussion
Update: 2700 lines later dictionary was created (also some smaller classes added) Screens (already in game, not in map editor - as small sources were added for swamps etc.): Probably some texturing of fields, rocks, plazas is needed... I don't know how to do it yet. I don't know if I'll import data about bridges etc., might try ... (it's not a lot of work, but update method or smth for segments is not existing) DTM - WIP -
Importing real-world database directly to game environment
mcegla replied to mcegla's topic in Cities: Skylines Modding - Open Discussion
Thanks! I think that i've seen Moveit! though i might skipped it somehow. I'll have a look. Well, that's disappointing but not unexpected :| I'll stick with auto-generated models of those gml files for now, but I guess if it ever will be released, I should try and do it that way. btw small update (all buildings created mostly with same object... I'm writing dictionary for it, I use only base game + 2 first dlc models for now): -
Importing real-world database directly to game environment
mcegla posted a topic in Cities: Skylines Modding - Open Discussion
Hey, everyone! First of all, I would like to thank the entire simtropolis community, and especially B0former for his tutorials. And now getting to the point… I’ve been working for some time (with some codding help from my friend) on modification that uses .xml(gml) files to create in-game objects. The goal was to create whole city / village / whatever with single press of the mouse button, even if it won’t be perfect at first. I’ve seen stuff like Cimtographer (and rebuild), Terrain Generator, Rainfall, and it’s been quite a helpful reading (though I did not understand everything). This is how it looks right now (it already takes around 1,5 min to generate everything): ,as you probably can see it has some problems (where are the building?, why so flat? etc.), and I would like to ask you some questions connected to some of them: 1. Do you know is there a possibility to successfully use System.Xml.Linq inside of the game / Unity? (from 25 lines parser blow out to 25000 because of this little thing) 2. I have access to 1x1m DTM (digital terrain model), but I can’t use it fully – 1081x1081 etc., do you know about any way to bypass that limitation (though I’ve heard that it might be hard to achieve)? (Any insight about import of DTM with code also appreciated) 3. I do know how to place and delete most of the objects, but there are 2 things that don’t like to cooperate with me: deletion of net segments (roads) and water sources, any help appreciated. 4. I’ve been testing and trying to use other mods like: Plop the Growables, No Abandonment, Disable Zone Check to stop code placed growables from disappearing; no success so far (Guess I need to read into and maybe incorporate it some way). Is there working solution? 5. TBH any tips and tricks, connected in some way to objects placement. I'm currently working on buildings placement and that DTM import, but it still needs some polishing. Thanks!
