Patch 1.0.3.18 - Main file changes

whoward69

DLL Minion
Joined
May 30, 2011
Messages
8,721
Location
Near Portsmouth, UK
Ignoring Tablet UI changes, Multiplayer UI changes, DLC scenario changes and graphics, effects and sound changes, over 310 core xml/lua UI and xml/sql database files were affected by the patch.

In addition, all core .exe and .dll files have changed.

The database changes affect the unit ArtDefine_ tables, specifically, ArtDefine_UnitInfos has 4 extra fields for unit inco/flag entries - these are used for era variations (eg worker, engineer, etc) and ArtDefine_UnitmemberCombats has an extra LastToDie field.

There is a new GAMEOPTION_NO_TUTORIAL option for disabling the tutorial system

The other file changes are given in the 9 screen shots attached - there really is no easy way to list these. Some files have moved, others have been deleted entirely, there are several new ones, but most are changes to existing core files.

EDIT: See post #18 for the source code changes
 
Most of the UI file changes relate to simplifying the code to support different UI designs for Vanilla, G&K and BNW.

When G&K came out the UI coders just duplicated most of the UI xml files and edited them for the new graphics. They appear not to be going that route for BNW (hooray!) but have created new styles so they can have one base file for the UI layout and change the style for each game version - presumably what "UI will now change based on the DLL that is active (base game, Gods and Kings, or Brave New World)" in the release notes is hinting at.

There also appears to be some work done on font sizes for various devices.

A lot of the UI decals have been moved out to styles, which means they can reuse the base code for G&K (and presumably BNW) just by changing the syles.xml file.
But this may mean that the offset of some textures need altering (certain G&K decals were originally at a different offset in the DDS file to the vanilla ones)

Was
Code:
  <Image Anchor="L,C" AnchorSide="O.I"  Offset="-19,0" Texture="Dec32x64Left.dds" Size="32.64" />
  <Image Anchor="R,C" AnchorSide="O.I"  Offset="-19,0" Texture="Dec32x64Right.dds" Size="32.64" />
Now
Code:
  <Box Style="MenuLeftSideTreatment"/>
  <Box Style="MenuRightSideTreatment"/>
Was
Code:
  <Image Anchor="C,T" Offset="0,-33" AnchorSide="O.O"  Texture="Assets/UI/Art/Controls/topframe.dds" Size="512,128" />
  <Image Anchor="C,B" Offset="0,-109" AnchorSide="O.O"  Texture="Assets/UI/Art/Controls/bottomframe.dds" Size="512,128" />
Now
Code:
  <Box Style="MenuTopTreatment"/>
  <Box Style="MenuBottomTreatment"/>
Was
Code:
  <Image Anchor="L,C" AnchorSide="O.I"  Offset="-17,0" Texture="Dec32x64Left.dds" Size="32.64" />
  <Image Anchor="R,C" AnchorSide="O.I"  Offset="-17,0" Texture="Dec32x64Right.dds" Size="32.64" />
Now
Code:
  <Box Style="PopupLeftSideTreatment"/>
  <Box Style="PopupRightSideTreatment"/>
Was
Code:
  <Image Anchor="C,T" AnchorSide="I.O" Offset="0,-27" Size="256,64" Texture="DecTop256x64.dds"  >
    <Image Anchor="C,C" Offset="0,-6" Size="80,80" Texture="NotificationFrameBase.dds"  >
      <AlphaAnim Anchor="C,C" Offset="0,0" Size="80.80"  Texture="assets\UI\Art\Notification\NotificationGenericGlow.dds"  Pause="0" Cycle="Bounce" Speed="1" AlphaStart="1" AlphaEnd=".5"/>
    </Image>
  </Image>
Now
Code:
  <Box Style="PopupNotificationTopTreatment"/>

Was
Code:
  <Label Anchor="C,T" Offset="0,20" WrapWidth="500" LeadingOffset="-4" Font="TwCenMT20" Color0="30.50.80.255" Color1="133.184.186.255" Color2="133.184.186.255" FontStyle="SoftShadow" ...
Now
Code:
  <Label Style="MenuTitleCaption" ...
Was
Code:
  ... Font="TwCenMT14" ...
  ... Font="TwCenMT16" ...
Now
Code:
  ... Style="Font14or20" ...
  ... Style="Font16or20" ...
Was
Code:
  ... Style="SelectedUp" ...
  ... Style="SelectedDown" ...
Now
Code:
  ... Style="SelectedUp32" ...
  ... Style="SelectedDown32" ...
 
ArtDefine_UnitInfos has 4 extra fields for unit inco/flag entries - these are use for era variations (eg worker, engineer, etc)

There is a new UI method to use these entries

Was
Code:
  IconHookup(info.PortraitIndex, 64, info.IconAtlas, controlTable.Icon64)
Now
Code:
  local portraitOffset, portraitAtlas = UI.GetUnitPortraitIcon(info.ID, playerID)
  IconHookup(portraitOffset, 64, portraitAtlas, controlTable.Icon64)

which will make the Great People icons change when their graphics change at the Industrial (?) Era - see the ChooseMayaBonus.lua as an example
 
All the popup priorities that were PopupPriority.eUtmost have been changed, most (but not all) to PopupPriority.InGameUtmost

Was
Code:
  PopupPriority.eUtmost
Now
Code:
  PopupPriority.InGameUtmost
 
The cynic in me says that'll just be the SDK (WorldBuilder, ModBuddy, etc) for supporting new mod options for BNW and not necessarily the up-to-date source code. But I'd love to be proved wrong!
 
ls612 was quoting one of my post mentioning the need of the source code to update the DLL mods, so I'll take the optimistic path :)
 
There was a Hotfix in the last 8 hours (from 8am GMT) that updated LoadScreen.lua - so if that's one of the files you have updated for your mod, you'll need to do it again!
 
Well, here's a mystery of the "I might be going insane" variety...

Most of my SQL files are not running to completion after the patch. They add all of the data, then crash at this line (in red) that is at the end of almost all my files:

Code:
--fixinator
CREATE TABLE IDRemapper ( id INTEGER PRIMARY KEY AUTOINCREMENT, Type TEXT );
INSERT INTO IDRemapper (Type) SELECT Type FROM BuildingClasses;
[COLOR="Red"]UPDATE BuildingClasses SET ID =	( SELECT IDRemapper.id-1 FROM IDRemapper WHERE BuildingClasses.Type = IDRemapper.Type);[/COLOR]
DROP TABLE IDRemapper;

I browsed many different mod tables and the basic problem is the same. All the data got in, but the ID renumbering failed. So IDs start at 100 or whathaveyou (it's a total conversion mod with tables mostly emptied out before being refilled).

In fact, the code doesn't even work in SQLite Manager. That's weird! How could a Civ5 update change the behavior of an external program? Is it changing the table definition somehow? (I looked at Create statement in the Structure tab and didn't see anything strange.)

I thought maybe the tables were somehow resistant to ID change, but that's not the case. "UPDATE BuildingClasses SET ID = 1 WHERE ID = 103;" works just fine.

The IDRemapper table looks exactly as I would expect (it was never dropped) with id column and Type column (the latter with data exactly matching BuildingClass Type column).

So I try to execute the statement "SELECT IDRemapper.id-1 FROM IDRemapper WHERE BuildingClasses.Type = IDRemapper.Type", and I get the error: "no such column: BuildingClasses.Type". But that makes no sense. I'm sitting here staring at a table called BuildingClasses and it definitely has a column called Type.

Tried changing id above to ID, which shouldn't matter according to the rules of SQL but of course I'm at that stage where one tries these things anyway. No help.

Tried this with four other tables that work in exactly the same way. Same problem.

This doesn't work:
SELECT * FROM BuildingClasses WHERE Type = Buildings.BuildingClass;
--> gives error: "no such column: Buildings.BuildingClass"

But this does work:
SELECT BuildingClass FROM Buildings;

So I pulled a cache folder out of my Recycle Bin from 7/2 before my game updated with the patch. Opened Civ5DebugDatabase. Yes, all my mod tables are there with nicely renumbered IDs. Tried statement above "SELECT * FROM BuildingClasses WHERE Type = Buildings.BuildingClass". Same error.

At this point I'm quite sure that I've lost my sanity...
 
I'm using similar statements in my mod, and I haven't adapted it to the new patch yet (will do it when adapting it for BNW), so perhaps I'll get the same problem...

Have you tried to replace
Code:
SELECT IDRemapper.id-1 FROM IDRemapper
with
Code:
SELECT id-1 FROM IDRemapper
 
Strange.

I'm using
Code:
-- Code's courtesy of lemmy101
CREATE TABLE IDRemapper ( id INTEGER PRIMARY KEY AUTOINCREMENT, Type TEXT );
INSERT INTO IDRemapper (Type) SELECT Type FROM Units ORDER by ID;
UPDATE Units SET ID =	( SELECT IDRemapper.id-1 FROM IDRemapper WHERE Units.Type = IDRemapper.Type);
DROP TABLE IDRemapper;
--

in the WWII mod, and it's still working, in game and in SQLite.

Your code below:
Code:
--fixinator
CREATE TABLE IDRemapper ( id INTEGER PRIMARY KEY AUTOINCREMENT, Type TEXT );
INSERT INTO IDRemapper (Type) SELECT Type FROM BuildingClasses;
UPDATE BuildingClasses SET ID =	( SELECT IDRemapper.id-1 FROM IDRemapper WHERE BuildingClasses.Type = IDRemapper.Type);
DROP TABLE IDRemapper;

does not work for me in SQLite, but output a different error:

Code:
SQLiteManager: 
UPDATE BuildingClasses SET ID =	( SELECT IDRemapper.id-1 FROM IDRemapper WHERE BuildingClasses.Type = IDRemapper.Type); [ PRIMARY KEY must be unique ]

and works when I'm executing it line by line... :confused:
 
Well, the " ORDER by ID" in line 2 really matters (now). Without it, my IDRemapper table is in some kind of arbitrary order that doesn't make much sense. Then line 3 tries to renumber game table IDs from the arbitrarily ordered IDRemapper IDs, which ends up generating non-unique IDs, which is a violation of that column's definition.

It's definitely a Patch 1.0.3.18 change because I didn't see this error on Sunday. I suspect what has happened is that the patch updated to a newer SQLite version. For whatever reason, "SELECT Type FROM Policies" does not output in ID order by default any more. It must have before, or else I would have seen this error before the patch. (Full disclosure: I had seen this error in SQlite Manager before this week. But I didn't understand it and my mod was working, so I forgot about it.)

Bottom line: Don't count on SELECT statement to output in ID order by default anymore (in case anyone other than me was doing that). Use "ORDER by ID" when you need that. I'm sure I'd find something about this in the SQLite release notes if went back and looked for it.


Edit: if they updated SQLite, I wonder if they updated Lua?

> _VERSION
Lua 5.1

Nope.
 
Yes, it was updated:

SQLite Release 3.7.17 On 2013-05-20 (3.7.17)

I didn't see my exact problem referenced in the release history. I guess it could also be some setting that was changed in the installation (was default ORDER BY ID, now it's not).
 
Well, the " ORDER by ID" in line 2 really matters (now). Without it, my IDRemapper table is in some kind of arbitrary order that doesn't make much sense. Then line 3 tries to renumber game table IDs from the arbitrarily ordered IDRemapper IDs, which ends up generating non-unique IDs, which is a violation of that column's definition.

It's definitely a Patch 1.0.3.18 change because I didn't see this error on Sunday. I suspect what has happened is that the patch updated to a newer SQLite version. For whatever reason, "SELECT Type FROM Policies" does not output in ID order by default any more. It must have before, or else I would have seen this error before the patch. (Full disclosure: I had seen this error in SQlite Manager before this week. But I didn't understand it and my mod was working, so I forgot about it.)

Bottom line: Don't count on SELECT statement to output in ID order by default anymore (in case anyone other than me was doing that). Use "ORDER by ID" when you need that. I'm sure I'd find something about this in the SQLite release notes if went back and looked for it.


Edit: if they updated SQLite, I wonder if they updated Lua?

> _VERSION
Lua 5.1

Nope.

But 5.1 is the best version. No reason to update it.
 
Source code has been posted (via the SDK Beta).

Excluding .lib, .ext, zero byte files and project build files, there are 150 changed .cpp/.h files, with approx half of those being in the G&K (expansion1) DLL source base.
 
Source code has been posted (via the SDK Beta).

Excluding .lib, .ext, zero byte files and project build files, there are 150 changed .cpp/.h files, with approx half of those being in the G&K (expansion1) DLL source base.

150! that may take awhile
 
Git has really helped for me.
 
Back
Top Bottom