Questions about marvels and station trade routes

SaucyJ

Chieftain
Joined
Jan 14, 2016
Messages
40
Currently it seems that the marvels (hydracoral brains, floating progenitor cities, etc.) are tied to the type of planet you're playing on (frigid, fungal, aquatic, etc.).

Is there any way to randomize which marvels get placed? Based on the code I saw, the only way I could think to do this was to basically have an iteration of each marvel for each planet type (ie. have a "frigid planet" listing for the giant fungus, an "arid planet" listing for the giant fungus, all the way down the planetary line) but it seems that if I did that, the effect would be that EVERY marvel would get spawned on EVERY planet.

So is there any way to randomize which get placed (and how many) without spawning all of them all of the time?

---

My second question is regarding station trade routes. Let's say I have four cities: A, B, C, and D. Given the game's current internal trade route mechanic, I have the following routes:

A-B, A-C, A-D, B-C, B-D, and C-D.

But if I want trade routes to station S, I can only have:

A-S OR B-S OR C-S OR D-S.

Is there anywhere in the code where I can tweak it so that multiple cities can have trade routes to the same station?

Thanks in advance,

- SJ
 
/edit: Nevermind, whoward is correct!
 
Is there any way to randomize which marvels get placed?

Code:
UPDATE Marvels SET Planet=NULL;
DELETE FROM HeroLandmark_PlanetBooleans;
INSERT INTO HeroLandmark_PlanetBooleans(HeroLandmarkType, PlanetType) SELECT h.Type, p.Type FROM HeroLandmarks h, Planets p;

Not sure the first SQL statement is strictly necessary, but it won't hurt
 
Small note though: You can still get multiple Marvels on the same map. Forgot to actually remove the code from my mod after I was done testing and I just got two (non-water) Marvels.

Still too lazy to actually look at the code, but I'd assume the reason is that the code that would otherwise pick up the water marvel now picks up a random Marvel.

-----------

Increasing the amount of Trade Routes you're able to send towards a station doesn't seem to be possible.
 
Small note though: You can still get multiple Marvels on the same map.

If that's an issue (try, untested as at work)

Code:
UPDATE Marvels SET Planet=NULL;
DELETE FROM HeroLandmark_PlanetBooleans WHERE HeroLandmarkType<>'HERO_LANDMARK_WATER';

CREATE TABLE HeroLandmarks_Temp AS SELECT Type FROM HeroLandmarks WHERE Type<>'HERO_LANDMARK_WATER' ORDER BY RANDOM();
CREATE TABLE Planets_Temp AS SELECT Type FROM Planets ORDER BY RANDOM();
INSERT INTO HeroLandmark_PlanetBooleans(HeroLandmarkType, PlanetType) SELECT h.Type, p.Type FROM HeroLandmarks_Temp h, Planets_Temp p WHERE h.RowID=p.RowID;
DROP TABLE HeroLandmarks_Temp;
DROP TABLE Planets_Temp;
 
I think the normal multiple marvels is due to the hydracoral marvel proccing on how much of the map is water. If you have a mostly land primordial planet, you'll just get the crater; if it's an archipelago primordial planet, most likely you'll get the crater and the hydracoral brain.
 
Yes, the Water Marvel spawns when a map has generated a certain amount of water. I think it's 50%+, but I'm not sure where I got that number from anymore.

Anyway, whoward's solution seems to solve that "problem", and pretty elegantly, too. I guess it's really time for me to have a closer look at SQL. Randomizing Elements in tables opens up so many potential things one could play around with.:eek:
 
Randomizing Elements in tables opens up so many potential things one could play around with.:eek:

And so many new ways to crash/trash the game :lol:

Take care with this approach, as every time the game is restarted the temp tables will randomise in a different way. While this is not an issue for things like city names (where the game checks for duplicates before naming the city) and in this case (where the table is only used during map generation), trying to randomise other tables will lead to weird results.

For example, if in CivV you randomise the religion table, because a civ's religion is stored by ID and not by Type, every time the game reloads, the civ will get a differently named religion (been there, done that!)

W
 
Oh, I was mostly thinking about stuff that I can just play around with, not stuff to actually put into mods and release them - so the game crashing sounds like an okay outcome to me. :D
 
Top Bottom