| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
aka emperor
![]() Join Date: Apr 2004
Location: New Zealand
Posts: 6,344
|
Game-Crashing Bug: City names with % in the event log
It seems that weird and/or catastrophic things can happen when the % character is used in a city name. Specifically, the issue seems to occur when the city name is written to the event log – e.g. finishing an item in a build queue, or notifying of a nearby enemy. When the following combinations occur anywhere inside a city name which is posted to the event log, here is what happens:
% c – will clear the rest of the city name % d – will replace with a number around -1 billion % e – will replace with a number around -1*10^-290 % f – will replace with 0.000000 % g – will replace with a number around -1*10^-290 % i – will replace with a number around -1 billion % n – will immediately crash the game % o – will replace with a number around 27.7 billion % p – will replace with BF800000 % s – will immediately crash the game % u – will replace with a number around 3.2 billion % x – will replace with bf800000 I’m not a programmer so I’m not sure of what specifically is going on here, but one thing is clear: a % character in the city name causes complete havoc. It probably should have simply been disallowed as a character choice many years ago during bug testing, but apparently it was obscure enough that no-one ever noticed it. For the record, it happens in single player games as well as multiplayer games – whenever a city name which contains one of these combinations is posted to the event log, the result is madness. To see the bug in action: download the save attached below, load it up in Hotseat, change the city name to one of the combinations above (or leave it as is), press Enter to end turn twice, and watch the ensuing insanity.
__________________
Lord Parkin / emperor Read all about my adventures in the Realms Beyond Pitboss 4 game! All Leader Challenge games: ALC #26: Willem van Oranje/Dutch Sisiutil and Lord Parkin take on eight AI teams in a Multiplayer Team Game battle of wits! Member of: Team Innovia - Civ4 MTDG | Team Saturn - BTS MTDG | Team Sirius - BTS MTDG II Looking for Civilization III maps? Check out the Parkin Creations CFC Map Library. Last edited by Lord Parkin; Mar 03, 2012 at 11:41 PM. |
|
|
|
|
|
#2 |
|
AI programmer
Join Date: Oct 2005
Location: Australia
Posts: 1,460
|
I just tested and confirmed the bug.
I assume that the bug is due to the city name being fed directly into a 'formatted string' function, like sprintf. It's a silly programming mistake for a professional to make... In the formatted string, the percentage sign signals that there a variable should be inserted at that point in the text. %c represents a single character, %d represents a decimal number, and so on. The problem is, no data has been prepared to fill those place-holders; and so unpredictable things can happen. Anyway, thanks for posting it. I'm going to see if I can fix the bug in K-Mod.
__________________
K-Mod: Far Beyond the Sword |
|
|
|
|
|
#3 |
|
AI programmer
Join Date: Oct 2005
Location: Australia
Posts: 1,460
|
OK.. I've looked into this a bit, and as far as I can tell the fatal substitution of the % things is not fixable. ie. it happens somewhere in the .exe part of the game, for which we don't have the source code. However it is possible to strip the % characters out of the city names. I mean, I can't make it so that the % works correctly, but I can make it so that % is simply disallowed.
While testing this, I noticed some other related behaviour.. You can type the name of text-keys from the game and they will be substituted in as your city's name. For example, if you rename your city to "TXT_KEY_WB_EXIT", your city will be called "Exit World Builder" - in the language set in the game options. -- Most of the text key names are too long to be allowed as city names, so there isn't much fun to be had here... One thing that is kind of fun though is that if you are renaming units, special keywords are substituted into their corresponding symbols. For example, if you name your unit "[ICON_CULTURE]", then it will be called . So you can get legitimate game messages that say things like "Your has destroyed a warrior!"
__________________
K-Mod: Far Beyond the Sword |
|
|
|
|
|
#4 |
|
aka emperor
![]() Join Date: Apr 2004
Location: New Zealand
Posts: 6,344
|
Interesting stuff, thanks for the input. I like the idea of making unit names appear as icons, that seems cool. Will have to give that one a try.
__________________
Lord Parkin / emperor Read all about my adventures in the Realms Beyond Pitboss 4 game! All Leader Challenge games: ALC #26: Willem van Oranje/Dutch Sisiutil and Lord Parkin take on eight AI teams in a Multiplayer Team Game battle of wits! Member of: Team Innovia - Civ4 MTDG | Team Saturn - BTS MTDG | Team Sirius - BTS MTDG II Looking for Civilization III maps? Check out the Parkin Creations CFC Map Library. |
|
|
|
|
|
#5 | |
|
King of myself
![]() ![]() Join Date: May 2006
Location: Lisbon, Portugal
Posts: 13,818
|
Quote:
That is simply sloppy coding :/ There is no way that a user input should be able to wreck havoc like that in a multi-level aplication like Civ IV is ![]() Hopefully the damage ends there ...
__________________
" I'm the Lord of the lords, not the servant of the serfs" - D. Joćo II of Portugal My Civ lema: Qui vincit non est victor nisi victus fatetur Lonely Hearts Club Bullpen / You , Yourself and your shadow : Some lessons on isolated starts |
|
|
|
|
|
|
#6 |
|
Live 4ever! Or die trying
|
ahh - get over it. It happens
. But look at the fun that can be had. I am totally trying this out.
__________________
My Blog [Getting Old, Getting Cranky], Wife's Series! [The Prism Series - book 2 The Deeper Darkness now on sale!] BUG Mod - BtS Unaltered Gameplay [ Forum | Download | FAQ | Known Issues | Report Bugs | Troubleshooting | BUG Wiki | Modding Tutorial | BUFFY ] "I found this great mod! Have you heard of it? It gives me everything I need!" - Troy Goodfellow's wife talking about the BUG mod Spawn Busting: All the cool guys are doing it | Ruff's Oz Game is now up and seeking your input! Test your knowledge of probability quiz! My latest game report - new 3/26 |
|
|
|
|
|
#7 | |
|
Live 4ever! Or die trying
|
Quote:
.
__________________
My Blog [Getting Old, Getting Cranky], Wife's Series! [The Prism Series - book 2 The Deeper Darkness now on sale!] BUG Mod - BtS Unaltered Gameplay [ Forum | Download | FAQ | Known Issues | Report Bugs | Troubleshooting | BUG Wiki | Modding Tutorial | BUFFY ] "I found this great mod! Have you heard of it? It gives me everything I need!" - Troy Goodfellow's wife talking about the BUG mod Spawn Busting: All the cool guys are doing it | Ruff's Oz Game is now up and seeking your input! Test your knowledge of probability quiz! My latest game report - new 3/26 |
|
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|