Mod idea: Randomiser

PiMan

Deity
Joined
Oct 1, 2008
Messages
2,007
Location
Melbourne, Australia
I hope such a thing already exists, but I had an idea for a mod.

A randomiser that shuffles various requirements. At its most basic, it would just shuffle requirements totally randomly, for techs, units, buildings, etc. But a more complex version might keep things a bit more sane by only shuffling things of roughly the same era, or more insane by also shuffling how strong or expensive things are (etc).
The idea is inspired in part by randomisers I've seen for other (non-civ) games, and in part by a similar feature that already exists in Civ6.
In civ2, it would work by shuffling the appropriate sections of rules.txt

The same idea could work in any civ game, except maybe 1; I don't know how moddable that game is.

Does such a thing exist?

(I'd hate to be the kind of guy who spams pretty much the same thing in multiple forums, so I'll probably wait a day before asking in the civ3, then civ4, then civ5 forums.)
 
Always nice to see more fellow Aussies around here!

I'm not aware of an existing randomiser for Civ2 but there may have been.. certainly would be an interesting endevour. With Test of Time someone like @Prof. Garfield or @Dadais could probably do some interesting things in LUA but as for good old Civ2 MGE someone would need to write a batch or exe program that plays with the rules file. Although I'm pretty sure rules changes are only applied on reloads which creates an additional issue, however I remember the old Civ2 multiplayer hack programs (before the official MGE came along) used to somehow use 'on the fly' save hacking to switch players between turns without reloads but that's probably different as it didn't involve rules.txt.

Yeah space out your duplicate posts between the different forum sections over a few days and it should be fine.
.
 
Last edited:
In fact randomizing in Civ 2 was introduced with the Civ 2 expansion Fantastic Worlds (there especially the Samurai and Jules Verne scenarios). Cam Hills in the Cradle of Civilization made an interesting guide about "Alternative Files", even including a chapter about Civ2 ToT. As I was not able to find that guide any longer at the Cradle of Civilization, I add here the scan of my printed version of that guide:

Civ2 Randomization1.jpg


Civ2 Randomization2.jpg


Civ2 Randomization3.jpg
 
I hope such a thing already exists, but I had an idea for a mod.

A randomiser that shuffles various requirements. At its most basic, it would just shuffle requirements totally randomly, for techs, units, buildings, etc. But a more complex version might keep things a bit more sane by only shuffling things of roughly the same era, or more insane by also shuffling how strong or expensive things are (etc).
The idea is inspired in part by randomisers I've seen for other (non-civ) games, and in part by a similar feature that already exists in Civ6.
In civ2, it would work by shuffling the appropriate sections of rules.txt

The same idea could work in any civ game, except maybe 1; I don't know how moddable that game is.

Does such a thing exist?

(I'd hate to be the kind of guy who spams pretty much the same thing in multiple forums, so I'll probably wait a day before asking in the civ3, then civ4, then civ5 forums.)

I don't think it would be too difficult to use Lua to randomise stuff. That would involve saving data so the same randomisation is applied after each save and load, but I don't see that being too difficult. The problem I see is how to make a "valid" randomisation. Most crucial is producing a tech tree that doesn't have loops. But there are also things like the fact that having Gunpowder prevents you from building a bunch of pre-gunpowder units. The AI would also be even more incompetent than usual.
 
Thanks for the replies, everyone. Unfortunately I haven't gotten my ToT working properly yet, so I can't take advantage of what that has to offer, but it's interesting to see some of what it's capable of.
I don't think it would be too difficult to use Lua to randomise stuff. That would involve saving data so the same randomisation is applied after each save and load, but I don't see that being too difficult. The problem I see is how to make a "valid" randomisation. Most crucial is producing a tech tree that doesn't have loops. But there are also things like the fact that having Gunpowder prevents you from building a bunch of pre-gunpowder units. The AI would also be even more incompetent than usual.
Loops are definitely a concern, and some loops are probably likely if no logic is used to avoid it. In theory it should be playable without such logic, but some quality may be lost because of some techs being inaccessible.

My thought was a python ( / lua / whatever) script that would take rules.txt as an input, and then randomise the data in that and output a new rules.txt. That way, you could apply it to the base game or to most scenarios, just by inputting a different rules file.
Any finer control of what is randomised would probably warrant a basic gui.

And if you forget to keep a backup of the original rules file, you know it's on the CD.
 
Loops are definitely a concern, and some loops are probably likely if no logic is used to avoid it. In theory it should be playable without such logic, but some quality may be lost because of some techs being inaccessible.
If the tech tree isn't "adequate," the game will crash or freeze at some point. I know future tech must always be accessible to all tribes. I'm not sure about loops. Part of the issue with this idea is that the people around here who know what a "valid" rules.txt are aren't the same as those who know Lua (or another language) well enough to (easily) program the randomisation. I'm in the latter camp, and, unfortunately, this idea doesn't interest me enough to test and troubleshoot. Perhaps @Knighttime has enough knowledge of both.

My thought was a python ( / lua / whatever) script that would take rules.txt as an input, and then randomise the data in that and output a new rules.txt. That way, you could apply it to the base game or to most scenarios, just by inputting a different rules file.
The Test of Time Patch Project lets you use Lua to interact with the game rules and "board" from within the game. That's why I went to Lua and also to in-game rule modification. I have Lua code to read rules.txt files and store the information in tables. I guess it wouldn't be that difficult to spit out a new rules.txt file from that information, if anyone is interested in this project.
 
Top Bottom