A Galaxy Divided Dev Diary #1 - Building the Galaxy
________________________________________________________
It is a period of frustration. With minimal map making and scripting experience Last Leviathan has set off from playing Stellaris to modding.
Entrusting help from map master Osito, he has travelled to the great archives of both shitpost and knowledge, the PARADOX FORUMS. Little does Leviathan know that much can still be learned from the Stellaris subreddit and those that lurk there...
________________________________________________________
A couple of weeks ago I decided to challenge myself with building a map of the Star Wars galaxy, which slowly turned into the learning experience of making a full mod. Not only will the dev diaries be about upcoming developments but of how I've done things, what problems I've run into and methods I've learned.
Making the Map
What drove me to start this was Retalyx's map generator, a wonderful tool, which I gave a try for a while when I started. But, I soon learned that if I had wanted to make a galaxy with over a thousand systems, it would be too difficult and accurately positioning a thousand planets by hand is simply insane. Asking around, I was invited by the great group of modders at
STNW to ask questions and their map maker Osito gave me plenty of useful advice that set the base for my map.
Using an Excel spreadsheet, I used atlas coordinates and converted them so they could be used within the 1000x1000 size of the Stellaris maps. I inputted the x and y coordinates and other pertinent information and used it to build the code I would use. By the end I would get something like this:
system = { id = "1" name = "Arami" position = { x = -351 y = 161 } [Initializer will go here]}
Not only did this save me time, but it kept it organised for easy adjustments that were needed. I started off with about 2000 systems and as I built the hyperlanes, I went through the process of removing non iconic/essential planets not found on the hyperlane routes. It took hours of looking at the map in game with my spreadsheet and code on the side, deleting planets that were sitting around and ensuring all the planets were connected. Eventually some will not be connected, such as Rakata Prime, but for a basic map I wanted everything to be usable lest someone spawns there randomly and is stuck.
It took me hours of playing around with code and bug fixing, and I ran into my fair share of issues.
Game crashing on map load because of broken hyperlane code
Often my game would crash because my hyperlane code was broken, usually because I misplaced a number and ended up with it outside of the brackets or with a classic "".
Spawning on random planets or black holes
Though my planets were all positioned nicely, my empires would spawn on random barren worlds or even a black hole once. POPs didn't seem to happy living on a Toxic world. This was fixed by adding in an event on startup that turned the capital of the empire into its ideal planet class. Which led to the next problem.
Preferred planet with no buildings
Although I got the ideal class working, no buildings were spawning. (Though space stations and such seemed to work) To fix this, I used another event on startup to spawn random tile blockers and buildings on the homeworld.
Planet Sizes
Another issue was the planet size was that of the original planet they spawned on. and add tiles for those who had smaller planets. The tile workaround is not enough, and I'll have to figure out something else eventually for random spawns.
Randomly generated AI renaming planets
This is apparently a bug no one has been able to crack, I thought I fixed it by removing the homeworld and home system names from the name_lists, but it just makes it blank.
Sol and Other Special Systems Spawning
Sol always like to force himself into the galaxy, and I fixed that by removing the game.start.1 and .2 from triggering. To remove spawns like Sanctuary, I changed it so the chance of occurrence was 0.
FEs not spawning
Another problem with the random empire generator, they also don't seem to like static galaxies.
Going from 2000 to 1000
This was time consuming, perhaps the most because I had to scour through the galaxy atlas and sources to decide what planets had no info on them or were simply too cluttered. Often times I just deleted clusters and such because there was not enough space on the map.
Hyperlanes by hand, making them with confusing code
I had to build the hyperlane routes by hand, with a large amount of add_hyperlane = { from = "y" to = "x" } which will have to be organised better once I add in initializers.
That's all for now, I'll be working on adjusting the map and making sure it's working as intended. Next I'll be working on factions and setting their static spawns.