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

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
Update: jump to post #9. It really works!

I can't do art worth a darn, but I've been mucking around with database stuff and ... I can't see what is stopping modders from adding new improvements (or possibly other art types for that matter).

OK, the first thing I tried was to replace civ5artdefines_landmarks.xml and civ5artdefines_landmarktypes.xml. Added a few new LandmarkArtInfo's. VFS=True, check! Start game. check! Start SQLite manager. check! Oh Crap! No sign of my additions in ArtDefine_Landmarks.

It's kind of weird that all the FPK xml stuff doesn't really match the Civ5DebugDatabase.db (where it all ends up). In civ5artdefines_landmarktypes.xml you have:
Code:
<LandmarkArtInfo>
    <Era>Ancient</Era>
    <State>Constructed</State>
    <fScale>1.0</fScale>
    <ImprovementType>ART_DEF_IMPROVEMENT_ACADEMY</ImprovementType>
    <LayoutHandler>SNAPSHOT</LayoutHandler>
    <ResourceType>ART_DEF_RESOURCE_ALL</ResourceType>
    <FXSXML>Assets/Buildings/Improvements/Academy/ANC_Academy.fxsxml</FXSXML>
    <bTerrainContour>True</bTerrainContour>
  </LandmarkArtInfo>
but then in Civ5DebugDatabase.db/ArtDefine_Landmarks you have Era,State,Scale,ImprovementType,LayoutHandler,ResourceType,Model,TerrainContour. It's clearly one-for-one but the names have changed.

So, the engine won't let me replace civ5artdefines_landmarktypes.xml. But really, that's not what I want to do anyway. A few simple SQL lines should do what I want:

Code:
INSERT INTO ArtDefine_Landmarks (Era,State,Scale,ImprovementType,LayoutHandler,ResourceType,Model,TerrainContour)
SELECT 'Any','Any',0.07,'ART_DEF_IMPROVEMENT_HANGING_GARDENS','SNAPSHOT','ART_DEF_RESOURCE_ALL','Assets/Buildings/Wonders/Hanging Gardens/Hanging_Gardens.fxsxml',1 UNION ALL
SELECT 'Any','Any',0.07,'ART_DEF_IMPROVEMENT_GREAT_LIBRARY','SNAPSHOT','ART_DEF_RESOURCE_ALL','Assets/Buildings/Wonders/Great_Library/Great_Library.fxsxml',1 ;

INSERT INTO ArtDefine_LandmarkTypes (Type, LandmarkType, FriendlyName)
SELECT 'ART_DEF_IMPROVEMENT_HANGING_GARDENS', 'Improvement', 'Hanging Gardens' UNION ALL
SELECT 'ART_DEF_IMPROVEMENT_GREAT_LIBRARY', 'Improvement', 'Great Library' ;

Yes, I've jammed a couple wonder .fxsxml into the database as "improvements" (I also added a couple new improvements that call these ART_DEF's, the 1st buildable by an Engineer and the 2nd by a Scientist).

Startup game again.
Start SQLite manager. Rows are added! Check!
Plop in an Engineer, start building the "Hanging Gardens". It's there! It worked!!!
Plop in a Scientist, start building the "The G. Library". It's there! It worked!!!

Well, it's not perfect. It's showing me the "incomplete" versions of each of these. But that's something.

So I've bypassed the need to overwrite civ5artdefines_landmarktypes.xml. In the above example, I called the existing Great_Library.fxsxml and Hanging_Gardens.fxsxml, which then call the base game art assets. However, you should be able to supply your own .fxsxml files and downstream art. At least I think so. I haven't done any of this art stuff yet so either 1) I'm missing something basic that someone will shortly point out (making me feel kind of stupid...but it's 4am so what the hell) or 2) I've stumbled onto something useful that others have missed (which seems strange, given that changing a few lines in the db seems more obvious than replacing whole .xml files).

So what's stopping any good artist out there from adding windmills or whatever other improvement art they want? (And is there any reason to replace civ5artdefines_units.xml and so on? Is that really what modders are doing for new unit art?)
 
So now we can add improvements onto the world map? This is a massive improvement to Civilization V Modding!!!

Where's Spatz, he'd want to read this. :p

Great job, can we get a screenshot to confirm? :)
 
Will post screenshot of multiple Hanging Gardens & G. Libraries in a little while. I'm sure I saw it, though my post last night (this morning) was was after a marathon session of IPA-fueled modding.

So now we can add improvements onto the world map? This is a massive improvement to Civilization V Modding!!!

I hope so. Since I don't have any experience with graphic modding, I don't really understand whether this was the sole inhibiting "block" or if there are other issues.
 
Well, I don't know...
ArtDefine_Landmarks links your improvement to an .fxsxml file (my experiment shows that, at least).
The theory then is that you supply your own .fxsxml file, which links to downstream art resources that you also supply. I'll try to produce this effect calling "clones" of the wonder art.

One worry I have is whether the ArtDefine column "Model" can path to the MODs folder rather than Assets. Right now I have Model= 'Assets/Buildings/Wonders/Great_Library/Great_Library.fxsxml'. Not so sure if that can point to something in the mod rather than something in Assets.
 
I believe the problem is that the landmarks.xml wouldn't actually update at all, even if you replaced it. Only the UnitArtDefines would. So, we couldn't modify the files at all, because our changes wouldn't update.
 
One worry I have is whether the ArtDefine column "Model" can path to the MODs folder rather than Assets. Right now I have Model= 'Assets/Buildings/Wonders/Great_Library/Great_Library.fxsxml'. Not so sure if that can point to something in the mod rather than something in Assets.

What if you copied Great_Library.fxsxml into your mod and ran the filepath to that instead of the one inside Assets?
 
I believe the problem is that the landmarks.xml wouldn't actually update at all, even if you replaced it. Only the UnitArtDefines would. So, we couldn't modify the files at all, because our changes wouldn't update.

What do you mean by landmarks.xml? Do you mean civ5artdefines_landmarks.xml? As far as I can tell, the only purpose of that file is to update the database. The game engine uses a database, not xml. We can't replace that particular xml (apparently), but we can update the database. (Or are you talking about some other art asset that I'm not aware of?)

@Pouakai, that's my next experiment.
 
Edit 1/29: It seems to be necessary to check the "Reload Landmark System" box in your mod properties to get this to work.

It works. I've added two "improvements" with art.

The sql file below was an OnModActivated addition. All of the other files were added to mod with VFS=true.

ArtDefines.sql:
Code:
INSERT INTO ArtDefine_Landmarks (Era,State,Scale,ImprovementType,LayoutHandler,ResourceType,Model,TerrainContour)
SELECT 'Any','Any',0.07,'ART_DEF_IMPROVEMENT_HANGING_GARDENS','SNAPSHOT','ART_DEF_RESOURCE_ALL','Paz_hanging_gardens.fxsxml',1 UNION ALL
SELECT 'Any','Any',0.07,'ART_DEF_IMPROVEMENT_GREAT_LIBRARY','SNAPSHOT','ART_DEF_RESOURCE_ALL','Paz_great_library.fxsxml',1 ;

INSERT INTO ArtDefine_LandmarkTypes (Type, LandmarkType, FriendlyName)
SELECT 'ART_DEF_IMPROVEMENT_HANGING_GARDENS', 'Improvement', 'Hanging Gardens' UNION ALL
SELECT 'ART_DEF_IMPROVEMENT_GREAT_LIBRARY', 'Improvement', 'Great Library' ;
(Note: I don't what the ArtDefine_LandmarkTypes does. I do know that both table inserts are properly added to the correct tables in Civ5DebugDatabase.db.)




Paz_hanging_gardens.fxsxml:
Code:
<Asset>
  <Mesh file="Paz_hanging_gardens.gr2" source="Max" />
  <Texture file="Paz_hb_hanging_gardens_diff.dds" source="Max" />
  <Texture file="Paz_hb_hanging_gardens_sref.dds" source="Max" />
  <Texture file="Paz_generic_grey_8.dds" source="Max" />
  <DecisionTree file="Paz_wonder_decisiontree.ddtxml" source="Tool" />
</Asset>
(Copied and modified from the original hanging_gardens.fxsxml.)



Paz_hanging_gardens.gr2
Paz_hb_hanging_gardens_diff.dds
Paz_hb_hanging_gardens_sref.dds
Paz_generic_grey_8.dds
(These four were copied from resources/Common and /DX9 folders - I only changed the name.)



Paz_wonder_decisiontree.ddtxml:
Spoiler :
Code:
<DecisionTree>
  <Selector>
    <Layers>
      <Layer>
        <Items>
          <Item type="sequence">
            <Sequence type="animation">
              <AnimationSequence ec="1000">
                <SequenceInfo duration="6.000000" speed="1.000000" loop="true" />
              </AnimationSequence>
            </Sequence>
          </Item>
          <Item type="sequence">
            <Sequence type="animation">
              <AnimationSequence ec="1000">
                <SequenceInfo duration="6.000000" speed="1.000000" loop="true" />
              </AnimationSequence>
            </Sequence>
          </Item>
        </Items> 
      </Layer>
      <Layer>
        <Items>
          <Item type="sequence">
            <Sequence type="trigger_timeline">
              <TriggerTimelineSequence ec="1000">
                <SequenceInfo duration="0.000000" speed="1.000000" loop="true" />
              </TriggerTimelineSequence>
            </Sequence>
          </Item>
          <Item type="sequence">
            <Sequence type="trigger_timeline">
              <TriggerTimelineSequence ec="1000">
                <SequenceInfo duration="0.000000" speed="1.000000" loop="true" />
              </TriggerTimelineSequence>
            </Sequence>
          </Item>
        </Items>
      </Layer>
      <Layer>
        <Items>
        </Items>
      </Layer>
    </Layers>  
  </Selector>
</DecisionTree>
(copied, just changed name; I wish I knew what this was.)



I did the same exact thing with the Great Library art files.

Screenshot below. You can see that both wonders are in the "unfinished" state. Perhaps this has something to do with decisiontree.ddtxml? Interestingly, the graphics kind of "blinked" when the GP finished making them. It looked as if it was trying to update to a new state, perhaps, but it only went from unfinished to unfinished.
 
No, I mean we can update whatever updates the Unit art info but not building/wonder art info, I guess until now....

Test it out on a custom improvement if you can (try and import a civ4 custom improvement). If it works then we're in the clear for amazing things.
 
Sadly, I've uninstalled civ4 and lost my disk. (What was I was thinking!) I haven't done any art before so I don't really know what the files are or how similar Civ4 is structured. Does it use a .fxsxml file in a similar way? If someone PM's me an interesting improvement (with art and any related xml or fxsxml files), I'll give it a try. I'd like to add windmills.

I'm so ignorant about art that I can't even re-color the gold resource to make it into copper. I can add the files and make the game see them (exactly as above). I just don't know how to manipulate the art files in any sensible way.
 
Seriously, if someone posts the Civ4 windmill assets -- all art files plus any associated xml file(s) -- I'll try a conversion. (I'm not sure if it is appropriate for me to ask for this. I guess the moderators will intervene if not. Honestly, I did own Civ4. I uninstalled it thinking I could always re-install from disk, then threw away the disk in a flurry of office cleaning. I'll probably end up buying it again just for the assets.)
 
Please dont take this as a rude reply as I mean no offense.

Can't you just download one of the custom improvements on the Civ 4 database here on CF and give it a try?

BTW - Good to see some serious progress happening on this front.
 
Well, I could mod a unit art as an improvement if it's just for "proof of principle". I want to add windmills anyway. Motivation is always a factor when one wants to do what was previously considered impossible. (Point taken about the database though. I should look through that.)
 
Just as a note, I've been playing around with Wonder art to the point where there is no question that I'm "adding" improvement art. I can turn on and off the Great Lighthouse flame and I can pillage these Wonder improvements (with the flame and smoke effects).

Unfortunately, all of these are stuck in the "under construction" graphic, which has something to do with layers. For some art, you have different states like "under construction", "constructed" and "pillaged" versions embedded in the same art files (somehow "stepped through" by DecisionTree...but I can't make heads or tails of it). For example, deer (naked), deer with camp and deer with pillaged camp all point to the same art resources with a DecisionTree somehow triggering the right graphic. For most other improvements, the ArtDefine_Landmarks has separate lines for each state calling different graphics.

So, for example, I have added a single "improvement" that has three separate graphic sets: UnderConstruction points to Great Library art, Constructed points to Hanging Gardens art, and Pillaged points to Great Lighthouse art (with or without flame). The three art sets appear as they should during and after the worker build and after the tile is pillaged. Sadly, all 3 stay in the "under construction" graphic as that seems to be internal to the art set. (This is probably trivial to anyone who has made any 3d art.)
 
The first thing that comes to mind is 'lets not look a gift horse in the mouth'. The fact that you solved this puzzle is major progress even if it means accepting static/simplifed version of improvements.

I for one would love to include trenches etc as scenario specific improvements....if only I had any clue how to work with 3d files :(
 
Actually, the Great Lighthouse has it's own animation (the flame at the top). It's set to run when state=1 in the original fxsxml file. I noticed that the flame was running while the worker was building, but then went out when completed. So then I changed it to state=2. Now it runs only after the wonder is built, not while building it. The fxsxml is just referencing another effects file (forgot extension right now) that I'm sure could be added separately. All of this stuff is downstream of the fxsxml file. There is really no issue about what core files can or can't be replaced...you don't have to replace anything. (I'm pretty sure this statement is true for units too...)

So yes, you can add animation...if you understand all this 3d stuff.
 
Top Bottom