[WIP]Randomized Unique Components, and Traits

Alright, I managed to test it out a bit:

For all of Tomatekh's Civs, (And any Civ splits, but I expected that) it didn't give me the prompt when generating (Think it does this whenever I see an XML and a LUA folder in the same mod).

However, more importantly, whenever I'd select the Modded Civs checkbox, it would not generate the files when clicking randomize.
 
Alright, I managed to test it out a bit:

For all of Tomatekh's Civs, (And any Civ splits, but I expected that) it didn't give me the prompt when generating (Think it does this whenever I see an XML and a LUA folder in the same mod).

However, more importantly, whenever I'd select the Modded Civs checkbox, it would not generate the files when clicking randomize.

Yeah I'm noticing what's happening with Tomatekh's mods I ran his Kieven Rus mod, and it seems he had a few building classes that were not connected to anything. That belonged to Barbarians, and Minors. I made a quick fix to that, but not much of a future proof fix.

Civ splits, and multiple civs will do that. I'm probably going to change some ways I do the file system to allow multiples, but just trying for "stable" with single civilization mods.

That's actually just weird, they don't have any connection whatsoever until randomized is hit.

Going to try a few more civilizations before I release the fixes I made.

EDIT:
Just found the biggest problem with the Auto tool. I looked for a string that's found in other lines /facepalm. So for a vast majority of mods the wrong MOD ID was given.
 
I was just guessing with the XML and LUA deal :P

And for the matter of the Modded Civs checkbox. I reinstalled version 2 and cleared what I had and that fixed the issue.

However I'm having problems with the Civ IV Traits and Cultural Diversity upon load. I'll look at it tomorrow however, along with specific Civs as well.

EDIT:

Managed to test load order, and it does indeed affect the game.

Errors with Civ IV Traits and Cultural Diversity came due to this. Resolution was to load the mods after the randomization!
 
I was just guessing with the XML and LUA deal :P

And for the matter of the Modded Civs checkbox. I reinstalled version 2 and cleared what I had and that fixed the issue.

However I'm having problems with the Civ IV Traits and Cultural Diversity upon load. I'll look at it tomorrow however, along with specific Civs as well.

EDIT:

Managed to test load order, and it does indeed affect the game.

Errors with Civ IV Traits and Cultural Diversity came due to this. Resolution was to load the mods after the randomization!

I have a update today if this fixes it at all please let me know. I can guarantee it won't fix all the civilizations, and is mostly a bunch of Bodges.

__________________________________________________

Update v0.21 :

  • Various "Fixes"(watch it break something else! :twitch: ) to the Auto Modded Civilizations.
  • Only For source : a new function for distributing components that allows any number of combinations (still keeping classes separate).
 
Mannnnnn its awesome!

Now I want to throw reality out of the window! :lol:
 
Seemed to fix the issues with Civ IV Traits and Cultural Diversity.

I did manage to test through Tomatekh's Civs

Civs that don't generate: Champa, Xia, Harappa, Sumer, Garamantes, Sioux.
Civs that loaded but caused errors: Goths
Civs that loaded: Benin, Caral, Kievan Rus, Kongo, Mali, Hittites, Timurids.

Should also state that I didn't "load" each mod and play with them. As my Windows 7 got corrupted and I had lost the key so I had to reinstall everything as well as upgrade to Windows 10. So I didn't have much time to test :P
 
Seemed to fix the issues with Civ IV Traits and Cultural Diversity.

I did manage to test through Tomatekh's Civs

Civs that don't generate: Champa, Xia, Harappa, Sumer, Garamantes, Sioux.
Civs that loaded but caused errors: Goths
Civs that loaded: Benin, Caral, Kievan Rus, Kongo, Mali, Hittites, Timurids.

Should also state that I didn't "load" each mod and play with them. As my Windows 7 got corrupted and I had lost the key so I had to reinstall everything as well as upgrade to Windows 10. So I didn't have much time to test :P

Thank you for your help with this so far. :D

Testing out the goths realized I was looking for a string that also included the version always being 1. So the ID was wrong(null) in the RandomSupport.txt.

Getting all of Tomatekh's civs to work will be problematic. As he changes barbarians, and Minor civs in the same way a civilization split does. So to the code they're essentially the same. I've been doing a lot of things eternally which makes the current source unusable right now so it's going to be a few days before another build is release with some fixes to the auto-modder.
 
How does the auto-generator determine whether a modded civ's UA is lua-based or not? Does it just check if there's a lua file in the mod? (I released a civ a couple days ago, and though its UA is lua-based, I made the script check the trait and not the civ type, specifically so that it'd work well with the randomizer.)
 
How does the auto-generator determine whether a modded civ's UA is lua-based or not? Does it just check if there's a lua file in the mod? (I released a civ a couple days ago, and though its UA is lua-based, I made the script check the trait and not the civ type, specifically so that it'd work well with the randomizer.)

It just checks if there is a file with .lua in it's name atm. There is way to many variables to truly tell if it works or not without. If you want, but it doesn't do this in the current release. Put the files it's supposed to generate in the mod folder, and the auto-generator will just pretty much make a copy of those files into the folder.

Or if you want I'll just add the latest one you made to the release folder so someone doesn't need to do it with your mod.
 
Or if you want I'll just add the latest one you made to the release folder so someone doesn't need to do it with your mod.

Nah, it's no big deal - all that has to be done is remove the "#Connected#TRAIT_KLISZ_SECRET_REPORTS" in Civilizations.txt, after all, and I've tested doing that and it works fine.
 
I have tried the mod today. Quite a lot problems I had with adding a mod (aww, not only I have 3 civs per mod, but also noticed that it doesn't read well if you have two unique units in one xml file). Then I tried cheesy way of including my traits into BNW file, however it seems like you read BuildingClass/UnitClass from database.
At last I tried "old way" and one by one I added three civs. Totally worthy it.

Unfortunately my skills doesn't allow me to help you improving this mod. :/ But I hope you are still working on it. :D
 
You do realize that people are going to repeat over and over again until they get babylon's ability, the minuteman, and the royal library, and win in five minutes.

Still the best thing I've ever seen... ever... ever... ever... ever... ever... gud mod!
 
You do realize that people are going to repeat over and over again until they get babylon's ability, the minuteman, and the royal library, and win in five minutes.

It would be fairly trivial to do that without the randomizer. Here's an example of the SQL that would be used to apply that combination of uniques to (arbitrarily chosen) the Netherlands:
Code:
DELETE FROM Civilization_BuildingClassOverrides WHERE CivilizationType = 'CIVILIZATION_NETHERLANDS';
DELETE FROM Civilization_UnitClassOverrides WHERE CivilizationType = 'CIVILIZATION_NETHERLANDS';
DELETE FROM Leader_Traits WHERE LeaderType = 'LEADER_WILLIAM';

INSERT INTO Civilization_UnitClassOverrides
	(	CivilizationType, 			UnitClassType, 							UnitType)
VALUES	(	'CIVILIZATION_NETHERLANDS', 		'UNITCLASS_MUSKETMAN',		'UNIT_AMERICAN_MINUTEMAN');
INSERT INTO Civilization_BuildingClassOverrides
	(	CivilizationType, 		BuildingClassType, 		BuildingType)
VALUES	(	'CIVILIZATION_NETHERLANDS', 		'BUILDINGCLASS_LIBRARY',		'BUILDING_ROYAL_LIBRARY');

INSERT INTO Leader_Traits
	(	LeaderType, 			TraitType)
VALUES	(	'LEADER_WILLIAM', 		'TRAIT_INGENIOUS');
 
So will the auto randomization of Modded civs be available in the next version?
 
I have tried the mod today. Quite a lot problems I had with adding a mod (aww, not only I have 3 civs per mod, but also noticed that it doesn't read well if you have two unique units in one xml file). Then I tried cheesy way of including my traits into BNW file, however it seems like you read BuildingClass/UnitClass from database.
At last I tried "old way" and one by one I added three civs. Totally worthy it.

Unfortunately my skills doesn't allow me to help you improving this mod. :/ But I hope you are still working on it. :D

Yeah, I'm still working on it. Version 3 is big, and requires a lot of reworking to allow things such as > 2 components (old code only cared about 2). I'm fairly close to the end of this school semester so there are other programs that take priority so that's why it's taking so long. Three civs per mod should be fixed with my entire rework of how the auto-modder works. It was done pretty shoddy the way it works now. Was more of a "Hey let's try this", and it worked for my own mods, but seems that it was just confirmation Bias at first.

As for help, I've been pretty bad with keeping things clean. So it's like a puzzle to figure everything out. It's not an elegant program. Also usually More Programmers = More Problems so I'd rather keep it to myself right now.

Though something I haven't done yet if someone would be willing is putting the Unique components from 3rd, and 4th unique components mod in two separate files the same way components are done for mods (Unique.txt) that would be a major help :). The way the layout works is :
Code:
Type
Class ( Improvements = Civilization Type ) 
Ex : 
IMPROVEMENT_CHATEAU
CIVILIZATION_FRANCE

UNIT_FRENCH_MUSKETEER
UNITCLASS_MUSKETMAN
You do realize that people are going to repeat over and over again until they get babylon's ability, the minuteman, and the royal library, and win in five minutes.

Still the best thing I've ever seen... ever... ever... ever... ever... ever... gud mod!

Thank you! :D

And, Knowing people are going to do that is why I have plans to add the ability to just change the random setup afterwords. With whatever you want. It's just other things take priority.

So will the auto randomization of Modded civs be available in the next version?

Maybe, I might release the next version that includes 3rd, and 4th Unique Components first. The problem with the auto-modder is Murphy's law is in full effect with it. So I actually know I need to rework it from the ground up.

Mumbo Jumbo for those who care :
Spoiler :
The biggest problem comes from the fact that coding styles are different from person to person, and so how things are handled right now different styles can screw it up.
XML : Reads the document, and creates a instance. I try, and see if this instance has Replace Unitclass, Replace Buildingclass, Civilization leadertype, Leader trait, or Civilization Leader type.
Then it takes the Values from those and stores it in a string array (Dumb idea : seemed OK at the time). This can cause problems if a value = null.

SQL : A mess. It takes it line by line, and looks for the same things as XML but then reads the lines till it finds something that sort of fits. So I need to create my own SQL Table builder from files, and use that to recreate the instance I'm looking for.
To give a example of how terrible the SQL reading is now :
Spoiler :

Would probably work :
INSERT INTO Leader_Traits
(LeaderType, TraitType)
VALUES ('LEADER_AKANE', 'TRAIT_AKANE');

Would crash ( and I know it ) :
INSERT INTO Leader_Traits
( LeaderType,
TraitType)
VALUES ( 'LEADER_AKANE',
'TRAIT_AKANE');

Why? Because it sees the INSERT INTO Leader_Traits, and goes till it sees " 'LEADER_ ", and with that reads the rest of the line for " 'TRAIT_ ". Separates the line at TRAIT_, (Which doesn't exist), and because it doesn't reading the second string of that array returns NULL crashing the whole function.

So yes poorly implemented.



So a few ideas, but will have to work at implementing that :
Make a Instance builder for SQL, and XML that I can take values from, and build off of there. It's a hard journey, but I'll know I'll get there :) ( That was cheesy ).

 
Version 3 :

  • Support for Third Unique Components Added
  • Support for Fourth Unique Components Added
  • The User can change the number of unique components (up to what's available, so the max is 4 with both Unique Components mods, but you're allowed to have 3 components given with all mods.).
  • The Auto-Modder has been reworked, and while not perfect yet should work with more mods.
  • Auto-Modder now works with mods with multiple civilizations.
  • Auto-Modder could possibly work with mods that have NO civilizations just uniques.

Known Bugs (Pretty much only the auto-modder) :
  • Some XML Files are crashing the Auto-Modder. For some reason Java is throwing : "[Fatal Error] NameOfFile.xml:3:9: The string "--" is not permitted within comments." Which is almost impossible to fix with still using the current method of reading XML files :sad:.
  • Civilization splits will sometimes create duplicates in the pool.
 
Pretty significant update. I'll try to test it out after I complete my most recent game.

Question however: Does the 3UC and 4UC only work with Vanilla civs (Edit) only and what will happen if I add modded Civs with 3UC and 4UC activated?
 
Pretty significant update. I'll try to test it out after I complete my most recent game.

Question however: Does the 3UC and 4UC only work with Vanilla civs (Edit) only and what will happen if I add modded Civs with 3UC and 4UC activated?

There's a Number of Components option now. Which will allow you to decrease the number of components per civilization. As long as there is enough Components for every civilization to have the number you specify than you'll have no problem.

Just to give some numbers :
If you have both selected, you can set number of components = 3, and that will allow you to have 3 components for up to 43 more modded civilizations.

If you were to just keep the number of components at 4 with the mods, and a few modded civs. It'll actually run in a infinite loop (just thought of this .-. ) and have to kill it in Task Manager. Probably going to limit it to 2000 tries(Completely arbitrary) before it quits, and sends you an error.

Mostly the thing is to keep this working :
Number of civilizations * Components per civilization < Number of Possible Components
 
@Yuri: (I can call Yuri, right?) So does the program randomize components of nodded civilizations by its now? I didn't quite understand your explanation... :p

(And how does it interact with alternate leaders, mods that add new components to existing civilizations and move existing components to new civilizations?)
 
Back
Top Bottom