New improvement art! You don't need to replace civ5artdefines_landmarks.xml

Yes!

I managed to add a custom 3d resource graphic to the game (a recolor of copper):

Awesome! you NEED to do a comprehensive tutorial on how to do this!
 
Great! I have already been thinking to make a mod that would add some extra luxuries like Amber (recolor of pearls), Cocoa and Tea.

If I'm not wrong - the more complex luxuries, like Spices, are done with simple 2D pictures of bushes/trees, so in theory, it should be possible to make any shapes of trees to the game by simply changing the 2D art, without any 3D modeling. Maybe with further research we could even add new terrain types and features in the game somewhere in the future...
 
Awesome! you NEED to do a comprehensive tutorial on how to do this!

You read my mind - Coffee was exactly what I was thinking! Please release a tutorial for this!

It's actually quite simple once you figure it out. What I did was mostly based on Pazyryk's method for adding new landmark graphics:

The first step is to create a .sql file to add your resource to the database, and then add both a ArtDefine_LandmarkType entry for your custom resource (ArtDefine_LandmarkType entries define which resources and improvements can be used for the ArtDefine_Landmarks entries properly speaking):

Code:
INSERT INTO ArtDefine_LandmarkTypes (Type, LandmarkType, FriendlyName)
SELECT 'ART_DEF_RESOURCE_LUBORIC', 'Resource', 'Luboric' ;


Now, you have to add the ArtDefine_Landmark entries. These entries define how your resource will look when unimproved, or in each era and state (under construction, constructed and pillaged) of improvement. So now add in your .sql file the ArtDefine_Landmark entry for your unimproved resource:

Code:
INSERT INTO ArtDefine_Landmarks (Era,State,Scale,ImprovementType,LayoutHandler,ResourceType,Model,TerrainContour)
SELECT 'Any','Any',1.0,'ART_DEF_IMPROVEMENT_NONE','SNAPSHOT','ART_DEF_RESOURCE_LUBORIC','luboric.fxsxml',1 ;

Set the Scale, LayoutHandler and TerrainContour according to the resource you're basing your new resource on. We still need to add entries for your improved resource according to state and era:

Code:
INSERT INTO ArtDefine_Landmarks (Era,State,Scale,ImprovementType,LayoutHandler,ResourceType,Model,TerrainContour)
SELECT 'Ancient','UnderConstruction',1.0,'ART_DEF_IMPROVEMENT_MINE','SNAPSHOT','ART_DEF_RESOURCE_LUBORIC','hb_med_luboric_mine.fxsxml',1 ;

INSERT INTO ArtDefine_Landmarks (Era,State,Scale,ImprovementType,LayoutHandler,ResourceType,Model,TerrainContour)
SELECT 'Ancient','Constructed',1.0,'ART_DEF_IMPROVEMENT_MINE','SNAPSHOT','ART_DEF_RESOURCE_LUBORIC','med_mine_luboric.fxsxml',1 ;

INSERT INTO ArtDefine_Landmarks (Era,State,Scale,ImprovementType,LayoutHandler,ResourceType,Model,TerrainContour)
SELECT 'Ancient','Pillaged',1.0,'ART_DEF_IMPROVEMENT_MINE','SNAPSHOT','ART_DEF_RESOURCE_LUBORIC','pl_med_mine_luboric.fxsxml',1 ;

INSERT INTO ArtDefine_Landmarks (Era,State,Scale,ImprovementType,LayoutHandler,ResourceType,Model,TerrainContour)
SELECT 'Industrial','UnderConstruction',1.0,'ART_DEF_IMPROVEMENT_MINE','SNAPSHOT','ART_DEF_RESOURCE_LUBORIC','hb_ind_luboric_mine.fxsxml',1 ;

INSERT INTO ArtDefine_Landmarks (Era,State,Scale,ImprovementType,LayoutHandler,ResourceType,Model,TerrainContour)
SELECT 'Industrial','Constructed',1.0,'ART_DEF_IMPROVEMENT_MINE','SNAPSHOT','ART_DEF_RESOURCE_LUBORIC','ind_mine_luboric.fxsxml',1 ;

INSERT INTO ArtDefine_Landmarks (Era,State,Scale,ImprovementType,LayoutHandler,ResourceType,Model,TerrainContour)
SELECT 'Industrial','Pillaged',1.0,'ART_DEF_IMPROVEMENT_MINE','SNAPSHOT','ART_DEF_RESOURCE_LUBORIC','pl_ind_mine_luboric.fxsxml',1 ;

Firaxis' comments in the artdefines_landmarks.xml says that order is important - and every entry that I saw used that same order: first the unimproved entry, and then in order ancient under construction, ancient constructed, ancient pillaged, industrial under construction, industrial constructed and industrial pillaged. So, I used that same order for these entries.

While the resource .fxsxml files are similar to those of units, there seems to be some important difference in their .gr2 files, since I couldn't get a unit model to show up as a resource. As you can see, I've added one .fxsxml reference for each of those entries.

Code:
<Asset>
  <Mesh file="luboric.gr2"/>
  <Texture file="Stone_ore_Decal_H.dds"/>
  <Texture file="Generic_Grey_8.dds"/>
  <Texture file="luboric_decal_diff.dds"/>
  <Texture file="luboric_ore_diff.dds"/>
  <Texture file="Copper_ore_SREF.dds"/>
  <Texture file="Unit_Environment_Dull.dds"/>
  <Texture file="Unit_Environment_Sharp.dds"/>
  <Texture file="Unit_Irradiance.dds"/>
</Asset>

These are the contents of my luboric.fxsxml file. What I did here was, after I unpacked the game's art assets with Nexus, I copied the fxsxml for copper, and then change the reference of the mesh from copper.gr2 to luboric.gr2, and from copper_decal_diff.dds and copper_ore_diff.dds to luboric_decal_diff.dds and luboric_ore_diff.dds. Then, you have to copy the copper.gr2, copper_decal_diff.dds and copper_ore_diff.dds from the game's art assets, and then rename them accordingly. Now what I had to do was first recoloring the .dds textures, and then changing the references in the luboric.gr2 to actually make use of them.

To change the .gr2 texture references, I used the older version of IndieStone NexusBuddy which bernie14 linked to in this tutorial thread of his. Then, I opened the luboric.gr2 with it, and changed the references to copper_decal_diff.dds and copper_ore_diff.dds to their luboric counterparts. Now, this is important, the texture reference will look like this:

Code:
D:\projects\artdev\Civilzation5_DLC_Expansion\Buildings\Resources\Copper\maps\Copper_Decal_DIFF.dds

You have to replace all of that with just your custom texture's file name, in this case luboric_decal_diff.dds.

Naturally now, all you have to do to make your custom resource work is to make a .xml resource entry which makes use of the new art, and make your resource be spawned by AssignStartingPlots.lua.

Don't forget, when packing all this in your mod, to check the "Reload Landmark System" option, or the new resource art will not show up.

I hope this helps :)
 
Great! I have already been thinking to make a mod that would add some extra luxuries like Amber (recolor of pearls), Cocoa and Tea.

If I'm not wrong - the more complex luxuries, like Spices, are done with simple 2D pictures of bushes/trees, so in theory, it should be possible to make any shapes of trees to the game by simply changing the 2D art, without any 3D modeling. Maybe with further research we could even add new terrain types and features in the game somewhere in the future...

What you're saying sounds about right. This is the spices texture, for instance:



You read my mind - Coffee was exactly what I was thinking! Please release a tutorial for this!

I changed the color of the fruits of the spice texture to a coffee-like color, and made the plant be not as light as the spice plant, and these were the results:



Since in this case only the fruits suffered a significant recolor, I'm not sure if the resource graphic would be distinctive enough from the spice one.
 
You mentioned scale earlier - would it be possible to change the scale of the trees?

I haven't actually experimented with it, but I assume that changing the "Scale" setting in the ArtDefine_Landmark entries would work. One issue with that, though, is that in the case of the improved resource graphics, the scale of both the improvement and the resource would be changed.
 
You mentioned scale earlier - would it be possible to change the scale of the trees?

Sure; it's a simple change to Androrc's code. Each time he updates ArtDefine_Landmarks, you'll see the third entry is Scale (where he's placed 1.0).

EDIT:
I haven't actually experimented with it, but I assume that changing the "Scale" setting in the ArtDefine_Landmark entries would work.
Hi Androrc, you replied at the same time. I can confirm it works (you'll notice Smaller Landmarks in my sig, mentioned in post #48 of this thread--though I haven't tested it since G+K came out).

EDIT #2: It works for most of the new landmarks, but I'll put up a new version so everything is included.

EDIT #3: Updated. Now it's only three lines of SQL; I could have made it 1.
 
Would it be possible to create entirely new resources, with 3D models not based on existing ones? That would be exciting, although I have no idea how to make these excellent art assets which the community has made, and I'm limited in the amount of modding I can do on a Mac.
 
Would it be possible to create entirely new resources, with 3D models not based on existing ones? That would be exciting, although I have no idea how to make these excellent art assets which the community has made, and I'm limited in the amount of modding I can do on a Mac.

I see no reason why it wouldn't be possible.

Were you able to get your recolored copper to generate on the map? IIRC the map scripts cant handle adding new resources.

Yes, that is done through AssignStartingPlots.lua.
 
It's actually quite simple once you figure it out. What I did was mostly based on Pazyryk's method for adding new landmark graphics:...[SNIP]

i love you! :D
 
Yes, that is done through AssignStartingPlots.lua.

Slight addendum: if you want new resources to be added to a randomly generated map, then yes, you have to change AssignStartingPlots in several areas (both in creation of deposits AND the setting of quantities). WorldBuilder maps don't need this, of course.

However, your mod will be incompatible with any map that includes overrides to the resource quantity subroutines of AssignStartingPlots. In the core game, that's the Highlands, Great Plains, and Lakes maps. My own mod had this issue, since my future content includes three custom map-placed resources, so I'd made alternate versions of these three map scripts that removed the resource quantity overrides.
It's just something to keep an eye out for; most maps will still work just fine. It's just those few that have problems.
 
Slight addendum: if you want new resources to be added to a randomly generated map, then yes, you have to change AssignStartingPlots in several areas (both in creation of deposits AND the setting of quantities). WorldBuilder maps don't need this, of course.

However, your mod will be incompatible with any map that includes overrides to the resource quantity subroutines of AssignStartingPlots. In the core game, that's the Highlands, Great Plains, and Lakes maps. My own mod had this issue, since my future content includes three custom map-placed resources, so I'd made alternate versions of these three map scripts that removed the resource quantity overrides.
It's just something to keep an eye out for; most maps will still work just fine. It's just those few that have problems.

Thanks for the heads up :) What problems do those maps create? Just not placing the new resources?
 
Quick question: Are resource graphics even 3d? To me stuff like the forests look 2D to me (a very common method of developing graphics in games where you're not actively close to the objects).
 
To change the .gr2 texture references, I used the older version of IndieStone NexusBuddy which bernie14 linked to in this tutorial thread of his. Then, I opened the luboric.gr2 with it, and changed the references to copper_decal_diff.dds and copper_ore_diff.dds to their luboric counterparts. Now, this is important, the texture reference will look like this:

Ok so ive pretty much got everything for my resource done, but i cant for the life of me find a reliable download for grannyviewer, and that indiestone nexusbuddy dosnt work. anyone have an idea what i can do :confused: ???
 
ok so i found a granny 3d viewer, but it cant load textures! i downloaded blender in the hopes that there would be a gr2 plugin for it, but to no avail.

also a question about the fxsxml files, is it right that i should have 7 files for one resource? one for the unimproved resource and 6 for the various stages of improvement?

do the fxsxml files need to be VSF true? and/or should i put them in the mod actions list onModActivate UpdateDatabase?

:confused: this is far more difficult than civ 4 :/
 
ok so i found a granny 3d viewer, but it cant load textures! i downloaded blender in the hopes that there would be a gr2 plugin for it, but to no avail.

Unfortunately, the only tool that I know that can easily change the texture references in .gr2 files is IndieStoneNexusBuddy.

also a question about the fxsxml files, is it right that i should have 7 files for one resource? one for the unimproved resource and 6 for the various stages of improvement?

Correct.

do the fxsxml files need to be VSF true?

Yes. You also need to activate "Reload Landmark System" in your mod's properties.

If you upload your files, I could take a look at them.
 
do you have a working version of indiestonenexusbuddy that you could upload? because i downloaded it 3 times but it dosnt work :/

otherwise im completely at a loss as to what to do. i could upload my files fo you to look at and fix, but id still need to be able to do it myself.... i have a *lot* of resources i need to mod lol.
 
Top Bottom