Fallout: Tame The Wastes

I think I solved the problem. I uploaded a file containing the function CvPlayer::findStartingPlot() from CvPlayer.cpp. I had to rename it to txt for the forum to accept the file.

I made 3 blocks of changes, each starts and ends with
// vault start fix - Nightinggale

First block:
First is setup. This needs the index of FEATURE_VAULT in the xml file. As this is a bit slow I added this in the start of the function where it stores the number in a variable and use that variable whenever it's needed in the rest of the function.
The other thing is setup is the bool bNeedsVault, which tells if the civ needs a vault on the starting plot. As I haven't figured out how to check for this I ended up setting it to true for all players. I designed it like this because if somebody figures out how to make the correct check, then it will be a one line change.

Second block:
Check if a semi random plot is a valid starting location. Civs with bNeedsVault will only accept plots which can have a vault.

Third block:
The starting plot is found. If bNeedsVault is true and the plot lacks a vault, it will add it, though it will remove the feature already in the plot, if any.


I haven't tried compiling this as I haven't set up the compiler for this. However I think it will work. It should be noted that I didn't touch the python overwrite code. If there is some custom python to pick starting location, then this test should be applied to python as well. The change I made is only used when python fails to set a starting plot.
 

Attachments

  • findStartingPlot.txt
    2.6 KB · Views: 75
I'm perfectly aware of how to add files to the forum. I decided to use txt as I wanted the file to be readable without unzipping first :)

I have been thinking a bit about this. Maybe the first block should be moved down. It serves no purpose until after the python code (really minor performance issue if python sets the start location). As for how to detect which civs, which needs bunkers I say if everything else fails, the check could be made with
Code:
CivilizationInfo* kCivInfo = GC.getCivilizationInfo(getCivilizationType());
bool bNeedsVault = !strcmp(kCivInfo.getType(), "A") || !strcmp(kCivInfo.getType(), "B") || !strcmp(kCivInfo.getType(), "C");
A, B and C will then be <Type> from CivilizationInfo XML. It's likely a poor solution (hack?) and it will hardcode which civs to do this for in the DLL, but it should work. However somewhere there is code to prevent founding cities on non-vaults for some civs and it would be better to fetch output from this check, whereever it is. Ideally this would even remove the need to hardcode which civs to add vaults for as the best case scenario this would be something set in XML only.
 
ah ok, it was the way you said you had to rename the file to get it to upload threw me off.

This is the file name and the code for Vault founding, I eventually want to expand it to make it impossible for other civs to found on vaults as well, which I think is just adding something like this to the beginning of the code before the civ specific stuff, but I don't know for definate if that would work..
Spoiler :

if pPlot.getFeatureType() == gc.getInfoTypeForString("FEATURE_VAULT"):
return true


CvFuryRoadGameUtils
Spoiler :
Code:
 def cannotFoundCity(self,argsList):
      iPlayer, iPlotX, iPlotY = argsList
      pPlayer = gc.getPlayer(iPlayer)
      if pPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_ENGLAND"):
         pPlot = gc.getMap().plot(iPlotX, iPlotY)
         if pPlot.getFeatureType() == gc.getInfoTypeForString("FEATURE_VAULT"): return false
         return true
      if pPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_AMERICA"):
         pPlot = gc.getMap().plot(iPlotX, iPlotY)
         if pPlot.getFeatureType() == gc.getInfoTypeForString("FEATURE_VAULT"): return false
         return true
      if pPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_GERMANY"):
         pPlot = gc.getMap().plot(iPlotX, iPlotY)
         if pPlot.getFeatureType() == gc.getInfoTypeForString("FEATURE_VAULT"): return false
         return true
      return false
 
I moved the code around a little bit and now it should demand vaults for 3 specific civs and refuse building on vaults for any other civ.
Spoiler :
Code:
def cannotFoundCity(self,argsList):
	iPlayer, iPlotX, iPlotY = argsList
	pPlayer = gc.getPlayer(iPlayer)
	if pPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_ENGLAND") or pPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_AMERICA") or pPlayer.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_GERMANY"):
		// this civ can only build on vaults
		// possibly return pPlot.getFeatureType() != gc.getInfoTypeForString("FEATURE_VAULT")
		if pPlot.getFeatureType() == gc.getInfoTypeForString("FEATURE_VAULT"):
			return false
		else:
			return true
	else:
		// civ can't build on vaults
		// possibly return pPlot.getFeatureType() == gc.getInfoTypeForString("FEATURE_VAULT")
		if pPlot.getFeatureType() == gc.getInfoTypeForString("FEATURE_VAULT"):
			return true
		else:
			return false

I changed the C++ code to fit this new scenario.

Block 1:
Moved down a little bit in order not to slow down python start plot selection.
cache FEATURE_VAULT
cache is civ is one of those, which needs a vault. It checks for CIVILIZATION_ENGLAND, CIVILIZATION_AMERICA and CIVILIZATION_GERMANY just like the python code.

Block 2:
Loops though a bunch of potential plots to find the best starting one in the area.
A plot is ignored if:
- Civ needs a vault and the plot can't have one. It doesn't matter if it has one or not, it just have to have terrain etc to allow one.
- Civ doesn't need a vault and the plot has one

Block 3:
unchanged from previous version.
adds a vault if civ needs it and the plot lacks one. Block 2 ensures that it can be added.


Gahhh... now I did it anyway. I promised myself not to do anything for more mods. I'm already coding for Religion and Revolution (on and off), Medieval Conquest and Colonization 2071 (all colo mods). As if I didn't do enough already I just wrote code for a BTS mod :eek:

Now in an ideal world Tame The Wastes would do the same as Colonization 2071, which is to ditch the DLL and stated to use the one from Medieval Conquest. That way it is possible to code new features for multiple mods at the same time. It wouldn't be bad for the Fallout universe as it has some interesting stuff, such as armor. You can switch armor on your soldiers and then they get new properties/promotions. Other non-vanilla features such as a tech tree are interesting too, not to mention wagon trains would be brahmin caravans. However before we dream too much I must say that moving a mod from bts to col would likely be an epic tasks. I think it would more or less be starting over and only reuse graphic, audio, leaderheads and stuff like that. Units and buildings are too different for a reuse. We can still dream though :sleep:
 

Attachments

  • findStartingPlot_2.txt
    3.1 KB · Views: 123
Yeah I tried modding col once, didn't like it.. Plus the off map
market doesn't fit all that well, I had discussions with some peeps once upon a time about a col mod, but I prefer bts.
Good point. I didn't think of the "Export to Europe" economy. That's a total no for a fallout universe. Medieval Conquest some features to get around that and in the very near future it could be completely ok not to go to "Europe" and it can even be disabled in XML. However the AI is still hardcoded to export everything to Europe, which is an unsolved issue. Even worse it's hardcoded to export from port cities only meaning the AI is hardcoded to place the first city next to ocean. Something tells me I will look at whole lot more at the AI code eventually :crazyeye:
 
Yeah, AI really is the 'great wall' to modding, there are a lot of cool ideas of modifications made, but then the AI is not taught how to use it so it becomes a total exploit for the player which sort of ruins the feature, as the AI has no way to fight back! We are currently looking at what we need to code to get one of our features working with the AI, which will probably not be a great fix, but I hope if we can modify a few features of the component then we will be able to put the player and computer on a more or less level playing field, there will probably be some exploits open to the player, but I hope I will be able to minimise the strength of these exploits using other limiting factors that force the player to walk slightly closer to the ai's code restrictions, BUT keep the whole thing feeling 'realistic' and 'reasonable' to the fallout world.

Going on the Col topic, one mod proposal was a 'Vault Dweller' mod, where you take on the role of leading a vault expedition out into the world and Europe becomes your 'Home Vault' and the King becomes the 'Overseer' and the mechanic would be something like the Westward Ho! Capital City system, where there was a city on the map that you travelled to to gain access to 'Europe' The mod was actually one of my favourites, mostly because of the Trains (For some reason I get a real kick out of trains in Col...) Unfortunately the mod had some CTD bugs and was abandoned some time ago..

This Concept could certainly be developed to more or less include the 'historical' origins of BoS, NCR, Enclave, Super Mutants, Vault City and maybe some others that I cannot think of.

Like I said I had real problems trying to mod col, and I abandoned my efforts fairly early on...

I think the Medieval mod would be a good potential starting place, as it has a lot of different trade options, and is moving towards the core concepts of col being different, where you are birthing a European Nation, rather than it's colonial efforts, and like you say the tech tree and the different weapons and armour system, could be expanded and adapted to fit very nicely with a Fallout system. Going beyond the quick things you suggested, you could include concepts like train networks (F3NV NCR) Vertibirds for transportation, you have 'natives' in the form of tribals, raiders etc. the Vassal system would work quite nicely, especially if it was expanding to provide 'recruits' a bit like 'Native Conversion'.. As well as the concept of the 'Different Invasions' depending what team you play, as the standard 'Independence' Scenario doesn't really make a lot of sense in Fallout (It could work but I think it would be rather a 'crowbar' solution) But a Super Mutant/Robot/Enclave Invasion could all be plausible 'End Game' Events.. I could go on and on, but my plans for FTTW are equally as ambitious. :)

I can certainly see a very fun mod being made with Fallout/Col, and I would certainly be willing to contribute to one (I would certainly be willing to offer my talents as a creative Director :p), but I would want other people to volunteer to do the boring stuff like coding it :p (Mostly because my brief efforts led to a lot of explosions :p) and I have put so much work into FTTW (Just look at the .dll mod list for starters, not to mention all the Total Conversion content we have already done) to ever abandon FTTW for a Col Mod Project.

FTTW was a concept I started many years ago, and for the first time since then the mod we have now is the closest I have come to really seeing the idea in my head come out into the real world, and now with the GREAT team of guys (I never thought I would attract and keep such a team) that have felt the call of the Waste and joined me, I really hope and feel we have the potential for a very strong mod that I hope people will eventually enjoy as much as some of the other great Civ mods, and maybe even see it as the GREATEST EVER FALLOUT STRATEGY GAME!! Then we get given loads of money and make a real FTTW game and the world hails it as a benchmark and revolution and the single greatest achievement of games design in the 21st century :p

Like you say... We can Dream! :D hehehe
 
Yes! Soonish is a good estimate, basically we bit off a larger job than first thought in integrating a mod-comp, which has delayed the release of the next version. Basically what we hoped was a complete version of a mod comp...wasn't and our new super coder has had to actually write parts of the missing code from scratch (It is all very impressive!) and he has nearly completed it now, last weekend he showed me a screen shot of the functioning component, he just needed to do some tweaking to get it working in the way it is supposed to, not just simply working. Then we have some ai fixes and a feature fix to help the ai keep a level playing field a bit better, plus integrate some mapscript fixing code supplied by Nightinggale, plus any other content we manage to get in, I have some plans on the table for a collection of new units. Then the Version will be ready, but I think it will definately be worth the wait, as aside from these components we will have a new unit population cost system (to stop unit spammming) as well as the first (hopefully) fully stable version of the mod, no more CTDs!
 
Just for anyone who is interested, we are really close to the finish line for Alpha3.

We have one last glitch/bug that starts messing up the turn alerts in the mid game, a python exception that cannot find a tag that no longer exists and we thought we had gotten rid of completely.. but some sneaky part persists..

It doesn't really 'break' anything it is just a pain in the Power Armour Rear Flap...
 
I'm having a really annoying problem with this mod. It resets my options, all of them for all of civ4 not just this mod. Every time I start it up. I never have this problem with any other mod. So I looked into it. It seems you have an option set that makes the game load options from xml or something. Is there a good reason for this? Am I ok disabling that?

Like I said its really annoying having it mess up my resolution etc everytime I play this mod.
 
Really? Honestly I don't know.. We have some custom player options, but.. That shouldn't be the same thing.. Can you tell me more of what you discovered, and we will take a closer look, this certainly is not by design..

Has anyone else experienced this issue?

I know I have had some odd problems once in a while where my .ini file seems to randomly change it's settings, but I don't think I have ever had it change the resolution..

Also that avatar pic is freaking awesome!
 
Ok guys fingers crossed you will have Alpha3 Available to buy(only joking) by the weekend!

I Fixed the iprod bug (my blindness was so embarassing I am not even going to mention it...damn too late!)

I am now just waiting on a new release .dll to be compiled (because my version of the software is too old and is not compatible with the new project file..) and shazam!

I have even started working on the news and download stuff to make it as ready as possible for when that all important .dll lands in my lap!
 
Top Bottom