Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Call To Power II > CtP2-Source Code Project > DESIGN/DEBUG: reconstructing file type 66
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!
CivGroups
CTP2 Source Code Project (59): Not a Member - Join

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Fromafar is offline Fromafar
Prince

May 2003
time: 06:33
  Old Post 17-01-2004 00:59
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
DESIGN/DEBUG: reconstructing file type 66 Help yourself to an AD-FREE life

If we want to be able to load scenarios - like the LOTR scenario - that have been generated with the Activision 1.1 patch, we have to support the changed file format. From the change list of the Activision patch we get
quote:
* Incremented save file version to force string reload for old games.

So, open GameFile.cpp, add a new file type 66, and try to open the LOTR scenario. Instead of directly returning to the selection screen, it really starts to load now.
Getting some Assert popups, applying some modifications, getting lots of Assert popups , thinking I should have started with something simpler than LOTR , more debugging , getting even more popups , more debugging, more popups , [ ... ] , but finally getting something recognisable on the display with only about 20 popups left to Ignore.

In the end, the difference between the file formats appears to be an inserted byte in the city data. Reading and writing it (up to now I only encountered 0 as value) is no problem, but I don't have a clue what it is supposed to do. For now, I have added a new member variable and christened it m_unknown_from_patch, but I do not consider this ripe for inclusion in the altered source file thread yet. If you want to check it out, see for the code changes, and LOTRdata.zip for some LOTR data file changes.

Any suggestions on a name and possible meaning of the new data will be appreciated!

[Edit: moved the code to the altered source code thread after testing.]

Last edited by Fromafar on 27-02-2004 at 03:14

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:33
Post  Old Post 17-01-2004 02:43 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

quote:
Originally posted by Fromafar
In the end, the difference between the file formats appears to be an inserted byte in the city data. Reading and writing it (up to now I only encountered 0 as value) is no problem, but I don't have a clue what it is supposed to do.


We know that savegames of CTP2.1 are incompartible with CTP2.0, obviously this is indeneded, inserting such a dummy byte could do the trick.

-Martin

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:33
  Old Post 17-01-2004 17:56
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Full PM-box? Change here!

If I start a new game and try to settle, the city name isn't properly displayed and I get a debug assertion at civarchive line 338. If I try to ignore it, the game crashes.

Last edited by Peter Triggs on 17-01-2004 at 18:12

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:33
  Old Post 17-01-2004 20:01
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Civilization 2

I commented out the lines you added to CityData::Serialize. This avoids the crash.

City names still aren't being displayed properly: I either get no name at all or something like " 2 Warsaw".

To test scenarios, I'm using the World Map scenario so that there's less to go wrong. I've just put in a units.txt with Settlers having 10 tiles of movement so that I'll know that it's loaded the right data.

So, now for the good news. Fromafar, you're a genius. It looks like you've just fixed one of the most annoying bugs in the game.

The reason why nobody made scenarios was because they didn't work properly. IIRC, MedMod and Cradle started out as scenarios. The problem was that you could start playing a scenario game but if you saved it and later restarted, you wouldn't get the right data files. That's why people used ModSwapper; it made sure that the right files were loaded. Now I've saved and loaded several times and my settler still has the 10 movement points. So it looks like you've fixed it by copying the scenario name into the save info. This means that we don't need ModSwapper anymore and we can use the scenario system as it was intended.

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:33
  Old Post 17-01-2004 20:06 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Lose 30 kilos (of popups)




My hat is off to you Fromafar. Great work on yet another fix.

child of Thor is offline child of Thor
Emperor
UK
Jan 2002
time: 05:33
  Old Post 18-01-2004 00:52
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton buy from Amazon

[Cot spares a few thoughts for those poor souls who made modswapper into such a friendly to use program..........i never knew that was why we used Modswapper!]

Fromafar - Thank you and i hope you're having fun!

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:33
  Old Post 18-01-2004 01:30 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

He definitely is . Almost every of his posts is either a bug fix or some valuable debug information, clearly a member of the community to be respected and remembered.

Fromafar is offline Fromafar
Prince

May 2003
time: 06:33
  Old Post 18-01-2004 21:17
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Help yourself to an AD-FREE life

quote:
Originally posted by Peter Triggs
I commented out the lines you added to CityData::Serialize. This avoids the crash.

City names still aren't being displayed properly: I either get no name at all or something like " 2 Warsaw".

To test scenarios, I'm using the World Map scenario so that there's less to go wrong.


Strange. I don't get this behaviour. Actually, I can not use the world map at all, because it has more than 32 tribes, which causes a crash when trying to access tribe 33. But that is another problem. From what I could investigate, the world map has file type 63, which is pre-patch, so the new code should not be triggered at all during loading. Did you change the world map scenario yourself and save it? This could give it a new type number.

The displacement of the name is a clear indication that some interpretation is still missing - this is how I found out about the missing byte in the city data. But it could also mean that the file is corrupt (or doesn't match the file type indicated in the file).

And, to not get unearned credit: I am not aware of having fixed any scenario paths. Maybe you have fixed this yourself, Peter.

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:33
  Old Post 21-01-2004 21:07 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Support Apolyton buy from Amazon

I thought that the problem with scenarios was that when you saved and reloaded you got all of your movement points back, plus a new turns worth of production, science, etc.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:33
Post  Old Post 22-01-2004 22:38 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

quote:
Originally posted by J Bytheway
I thought that the problem with scenarios was that when you saved and reloaded you got all of your movement points back, plus a new turns worth of production, science, etc.


The extra turn bug was another problem, well actual I don't know if it was a problem or it is still a problem.

There were also another problem but I saw it just in one game, I played with the city styles and put into a subfolder of the pictures folder some other sprites and at one time the game started to use these sprites in the subfolders instead of the original ones and finally the game crashed at loading. So you cannot be sure that the game loads the right data, well before playing mods I played on selfmade maps, obviously in that respect there is no problem as the map is also saved in the save file and no additional rhules where used.

In mind the bug also appeared not at once and I wasn't able to find a pattern behind it.

-Martin

-Martin

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:33.
Apolyton Time is 00:33.
    top of page
Rate This Thread:
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0371 seconds (89.74% PHP - 10.26% MySQL) with 36 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net