Resources in Final Frontier

Thorgrimm

Senior Elder
Joined
Sep 26, 2003
Messages
2,772
Location
Expanding the Brotherhood
I tried asking in the BTS Mods FF thread but that went nowhere. So I am going to try and ask here. Does anybody know if there is any way to have resources associated and located on certain planets?

For example, a water resource located on Blue Planets, which I take to be waterworlds anyway. Since finding Oxygen and Water in an asteriod field in enough quantity to support an entire civilization is 'odd' to me. Thats why I want to know if the resources can be based on planets. :D

And can other resources be tied into buildings? For example, Deuterium and Anti-Matter with their respective Production Facilites. What I am looking to do with this is to use a variant of Duke176's adding oil, in this case anti-matter and deuterium, and have the units consume those resources as they move and fight by deducting from the reserve of deuterium and anti-matter that is produced by the production facilites. Below is a little bit of background information that will be with the techs and resources:

At the start of the Earth-Romulan War, all belligerent powers used warp-capable ships powered by fusion reactors. Although rarely used for this purpose today, fusion reactors were the sole means of power for the first century of warp flight on Earth. Fusion-powered warp reactors have decided disadvantages. Probably the most serious disadvantage, in tactical terms, is their relatively low efficiency.

To form and maintain a warp field, fusion reactors must consume deuterium at extremely high rates, which places two limitations on a ship's capabilities. First, a large percentage (70% or more) of the ship's mass is fuel, which limits nonfuel payload, such as weapons, sensors, and shuttlecraft. Second, the high rate of consumption severely limits range. The limitation of range must be addressed by frequently refueling at starbases, convoying the ship with tankers, or rendezvousing with tankers en route. Another disadvantage of fusion reactors is their low peak power output, which limits the maximum speed that can be achieved to about warp 2.5, or 15.6 c.

A concern of the Admiralty about the fleet-wide use of M/AM reactors was the availability of antimatter. As the only use for antimatter in 2157 was as a fuel for UESN starship reactors, it was produced at high cost at a small number of facilities, all on Earth. In contrast, deuterium, although consumed in large quantities by fusion reactors to achieve warp speed, had been the chief starship fuel for more than 100 years and could easily be obtained anywhere. If antimatter was to power a fleet of starships operating across the galaxy, a system for its manufacture, storage, and transport far from Earth would eventually need to be established. However, since all ships were fully fueled at the time of their launching, the need to refuel, although inevitable, was not anticipated for 1 to 2 years. Similar concerns surrounded the availability of dilithium, a newly strategic mineral not found in the Sol or Alpha Centauri systems.

So with this background I wanted the ability to tie ships to their fuel. No more unlimited range for ships. ;) So my need for the knowledge of whether or not resources can be tied to buildings and planets is critical. :D




:nuke: Cheers, Thorgrimm :nuke:
 
So does ANYBODY have any idea at all? :confused:



:nuke: Cheers, Thorgrimm :nuke:
 
The lack of answers to your querry is probably due to the fact that planets in FF are handled by the SDK - and that the SDK code for FF have not been publicly released (to my knowledge anyway).

Sadly, then this lack of sharing your code is a behaviour a few other modders have also chosen to follow, which goes against - and is counterproductive to - the entire 'open source modding' ideology of the cIV series (not to mention it being a rather asocial kind of behaviour in general as well).

Imho then making the SDK code for a mod available for download should be as natural and essential as making any other part of a mod available for download, but I guess some people don't see any problem in using code from other peoples SDKs for their own mods, while at the same time denying other people access to their own code - go figure. :rolleyes:

Of course, one can only hope that not having released the SDK code to the public is merely an oversight on the part of the modder(s) and that modders in general will not pick up on this unhelpfull and unproductive 'trend'. :)
 
The lack of answers to your querry is probably due to the fact that planets in FF are handled by the SDK - and that the SDK code for FF have not been publicly released (to my knowledge anyway).

Sadly, then this lack of sharing your code is a behaviour a few other modders have also chosen to follow, which goes against - and is counterproductive to - the entire 'open source modding' ideology of the cIV series (not to mention it being a rather asocial kind of behaviour in general as well).

Imho then making the SDK code for a mod available for download should be as natural and essential as making any other part of a mod available for download, but I guess some people don't see any problem in using code from other peoples SDKs for their own mods, while at the same time denying other people access to their own code - go figure. :rolleyes:

Of course, one can only hope that not having released the SDK code to the public is merely an oversight on the part of the modder(s) and that modders in general will not pick up on this unhelpfull and unproductive 'trend'. :)

CyberChrist, thanks for the reply and thats a damn shame. :( I suppose I could go the route of Corporations for the resource production and remove all the standard reources. I will have to study the corporation files I guess. I was hoping to be able to associate resources with planets and buildings. But I suppose the Corporate route will have to do. :)



:nuke: Cheers, Thorgrimm :nuke:
 
Another approach could be to make some new Palace buildings that gave the free resource you wanted the various civilizations to have from the start - and then assigning these new Palaces to the appropriate civs as a Unique Building (replacing the normal Palace).

Of course this wouldn't help with making resources tied to specific planet types, but I don't see why this couldn't be handled by Python checks (adding a 'free resource building' if the right planet type is detected in system) - unless there is no way to check planet types from Python (I haven't checked).
 
Sadly, then this lack of sharing your code is a behaviour a few other modders have also chosen to follow, which goes against - and is counterproductive to - the entire 'open source modding' ideology of the cIV series (not to mention it being a rather asocial kind of behaviour in general as well).
Not all of us that haven't released the source files are conspiring against the public. I haven't released my source yet because it is undergoing frequent substantial changes, however if you look around you can probably find most of my SDK changes posted as replies in various threads where people have asked for help, I've also sent code clips to several people in PMs when they asked for a specific part.

You can always ask somebody for the source code rather than assuming they're trying to hide it from you, it's entirely possible that they have a good reason for not releasing it.

As for the FF resources...

You can probably accomplish that via Python, I haven't looked at the FF files in a while but the planet types are accessible to you in Python so you can look at what planets types the player has (and if they have population on them) and use that to give them resources. Another option would be to create invisible resources and place them in the solar system (sun's tile) during map generation based on the planets but that will be limited to one resource per solar system.
 
<SNIP>
As for the FF resources...

You can probably accomplish that via Python, I haven't looked at the FF files in a while but the planet types are accessible to you in Python so you can look at what planets types the player has (and if they have population on them) and use that to give them resources. Another option would be to create invisible resources and place them in the solar system (sun's tile) during map generation based on the planets but that will be limited to one resource per solar system.

@ Seven05, Thats good news! Since one resource per system would be the right scale for the naturally occuring resources. What file would I have to modify to have the game produce the invisible resources you suggested? Not that I know what to do, but gotta start somewhere in my Python learning. :crazyeye: :D

@ CyberChrist, thats a great idea! I can assign Deuterium production to a palace-like building since Deuterium would be the initial starship fuel required to initiate a warp field. :)



:nuke: Cheers, Thorgrimm :nuke:
 
The best way would be to get a new invisible model, I would think anyway. In the meantime if you look in CIV4ArtDefines_Bonus.xml you can set the scale to 0.0 and see if that works.
 
The best way would be to get a new invisible model, I would think anyway. In the meantime if you look in CIV4ArtDefines_Bonus.xml you can set the scale to 0.0 and see if that works.

Thanks, I will give that a try and report what the effect was. :D

EDIT: Which scale should I modify?

Code:
			<fScale>0.5</fScale>
			<fInterfaceScale>1.6</fInterfaceScale>



:nuke: Cheers, Thorgrimm :nuke:
 
Thanks, I will give that a try and report what the effect was. :D

EDIT: Which scale should I modify?

Code:
			<fScale>0.5</fScale>
			<fInterfaceScale>1.6</fInterfaceScale>



:nuke: Cheers, Thorgrimm :nuke:

<fscale> is for the model on the map, <finterfacescale> is for the size of the depiction on the bottom left infoscreen when you select a unit. So you need to modify the first tag. :)

Oops, double post. :mischief:
 
I haven't released my source yet because it is undergoing frequent substantial changes
I can understand this argument as long as no version of a mod-in-progress has been released, but once the first version have been released this argument makes no sense at all.

When you release a version of a mod it comes with a compiled version of the SDK-in-progress as well (if it has any modified DLL at all of course), and it will only cost a few extra mins (5 tops?) to make a zip file of the code files along with the final compile for the release - and perhaps making it available as a seperate download (so only those that might find the inner workings of the release of interest will have to download the extra MBs).

I am of course not talking about releasing code for projects where no version of the mod have been released as yet or rewinding the clock and releasing code for previous versions.

In theory it can actually end up saving you time to automatically release the code along with the versions themselves, since it will probably reduce the amount of personal versions of the code you would have to mail out, requests for posting code bits on the forum and you might even get some automatic feedback with code suggestions of how to solve problems/bugs in your current version(s) - all in all it might save more time than it will cost to go this extra 'mile' :)
 
@Seven05 & GeoModder, that made the resources invisible. Now how would I go about associating resources with the star system and not asteriod fields? :)



:nuke: Cheers, Thorgrimm :nuke:
 
So, Seven05, or anybody else, any ideas on how to implement the idea of resources tied to the star?:confused:




:nuke: Cheers, Thorgrimm :nuke:
 
Sorry, haven't been paying attention to the C&C board... oops :)

You have to do a couple of things, depending on how you want it implimented. If you want them to appear randomly you can probably just get away with changing the BonusInfos xml file so they all are only valid on a tile with a solar system (those are features, look in the FeatureInfos xml file for the exact name).

If you want them to appear in specific solar systems you need to dig through the FF python files, one of them defines which planet types are present in the solar system, just hook into that to add bonuses to the plot. I'm pretty sure the plot class' setBonusType() method is exposed to python so you should need something like:

pPlot.setBonusType(GC.getInfoTypeForString("BONUS_IRON"))

I try to avoid using python whenever possible so you'll need to double check that for propper syntax.

Edit: Just checked the SDK and yes, setBonusType() is exposed to python :)
 
Sorry, haven't been paying attention to the C&C board... oops :)

You have to do a couple of things, depending on how you want it implimented. If you want them to appear randomly you can probably just get away with changing the BonusInfos xml file so they all are only valid on a tile with a solar system (those are features, look in the FeatureInfos xml file for the exact name).

If you want them to appear in specific solar systems you need to dig through the FF python files, one of them defines which planet types are present in the solar system, just hook into that to add bonuses to the plot. I'm pretty sure the plot class' setBonusType() method is exposed to python so you should need something like:

pPlot.setBonusType(GC.getInfoTypeForString("BONUS_IRON"))

I try to avoid using python whenever possible so you'll need to double check that for propper syntax.

Edit: Just checked the SDK and yes, setBonusType() is exposed to python :)

Thanks for that information my friend. I will try the random method and just mess with the XML files for now. Since I know absolutely nothing about python I think if I began to mess with that I would probably break something important. :lol: Eventually I want certain types of resources to appear in certain types of star systems, and if I can ever figure it out or get help with it I want to have the resources tied to types of planets. But I figure thats a long term goal. :D



:nuke: Cheers, Thorgrimm :nuke:
 
I found the following section in the CVFinalFrontierEvents.PY file, is this what I should modify to have the game add the resources to a solar system?


Code:
			# Loop through all plots, find the Solar Systems and give them randomized starting junk
			for iPlotLoop in range(CyMap().numPlots()):
				pPlot = CyMap().plotByIndex(iPlotLoop)
				
				if (pPlot.getFeatureType() == self.iFeatureIDSolarSystem):
					iYield = -1 #No preference
					pSystem = createRandomSystem(pPlot.getX(), pPlot.getY(), iYield, iPlanetQuantityTypePoor)	# Called from CvSolarSystem
					self.addSystem(pSystem)
				
		# Debug stuff
		for iSystemLoop in range(self.getNumSystems()):
			printd("System (%d, %d) Num Planets: %d" %(self.getSystem(iSystemLoop).getX(), self.getSystem(iSystemLoop).getY(), self.getSystem(iSystemLoop).getNumPlanets()))



:nuke: Cheers, Thorgrimm :nuke:
 
Not much of a start to modding, but I got the resources to associate with star systems along with asteroid fields. Certain resources are going to be limited to systems, Oxygen and Water to begin with. And when more are added, they will be added as fitting to the type of resource it is. :D Eventually I want to associate most resources with specific planet types, but I figure that is going to take SDK work. :mischief:

Now I have to get the extractor to work on a star system's square. :)


Resources.jpg





:nuke: Cheers, Thorgrimm :nuke:
 
In a test I set up some resources in a system and in an asteroid field then placed some construction ships. The ships would create the Extraction Facility in the asteroids, as is normal, but would not create the improvement in the system. But if you place the Extraction Facility there manually it works just fine and gives the civ access to the resource.

Now my question is this, I checked all the terrain and unit XML's but I found nothing that would define a solar system with resources as unworkable. So where would I have to look for that to change it so a system can be worked by a construction ship in making a extraction facility. They can 'road' it already, but the entries look the same for roads and extraction facility improvements. So I am at a loss here. Any help would be much appreciated. :confused:



:nuke: Cheers, Thorgrimm :nuke:
 
So absolutely nobody knows where to find the information at? Thats kind of hard to believe with all the unique terrains in some of these mods. Or is the reason nobody is answering something else? :confused:



:nuke: Thorgrimm :nuke:
 
Back
Top Bottom