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 > DOCUMENT: Miscellaneous source findings and thoughts
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   
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:31
  Old Post 30-10-2003 00:30 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Miscellaneous source findings and thoughts Support Apolyton, buy Civilization III: Complete

It seems to me that this information has been pretty scattered thus far, so time to put it together.

It has been discovered that there's an easter egg in the game which acts if you enter "pacman" in the Chat window. - The Big Mc

The game has a boolean g_e3Demo variable that is set to false. If true, then some parts of the interface are skipped, so that the game starts/quits without main menu, which is more of a demo mode indeed. - Dale and Solver

The sprite limit of 200 is defined as a global constant. - Immortal Wombat.

The AI won't move around its own 12-stacks because the pathfinder considers those squares to be passable, and the units keep trying to enter the square occupied by 12-stack, and fail. - Dale.

From the CtP1 space layer, the wormhole code is still in. That includes stuff for moving the wormhole each turn, for instance. - Solver

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:31
  Old Post 30-10-2003 00:42 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Re: Miscellaneous source findings and thoughts Support Apolyton or Terrorists Win

quote:
Originally posted by Solver
It has been discovered that there's an easter egg in the game which acts if you enter "pacman" in the Chat window. - The Big Mc

This was known previously, but it has no effect as far as anyone can make out.

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:31
  Old Post 30-10-2003 00:45 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton or Terrorists Win

As seen from the code, it creates a unit. Might be just that it doesn't get on the map .

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:31
  Old Post 30-10-2003 01:33 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

if(!Flag(k_UDF_PACMAN)) {
m_movement_points -= cost;
m_movement_points = max(m_movement_points, 0.0f);
ClearFlag(k_UDF_FIRST_MOVE);
}

ahenobarb is offline ahenobarb
Prince

Nov 2001
time: 05:31
  Old Post 30-10-2003 02:18
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton, buy Call to Power 2

quote:
Originally posted by Solver
As seen from the code, it creates a unit. Might be just that it doesn't get on the map .


Probably needs a specific sprite a well? One that's missing like the War Walker beta.

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:31
  Old Post 30-10-2003 02:21 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Tired of ads?

If I get it correctly, it creates a unit of type which is the second-from-end in the unit database.

Dale is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:31
  Old Post 30-10-2003 03:05
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Re: Miscellaneous source findings and thoughts Support Apolyton buy from Amazon

quote:
Originally posted by Solver
The AI won't move around its own 12-stacks because the pathfinder considers those squares to be passable, and the units keep trying to enter the square occupied by 12-stack, and fail. - Dale.


Actually, the function returns: ASTAR_BLOCKED so it's viewing it as unpassable, but then the Astar function doesn't look for another path when returned ASTAR_BLOCKED it just closes that node.

What we need to do it specific a different return like: ASTAR_OCCUPIED and when that's returned to the Astar function, make it keep the node open but try other directions from there.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:31
Post  Old Post 30-10-2003 03:12 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton

You forgot the GetNearestWater function, Solver.

-Martin

Unspeakable Horror is offline Unspeakable Horror
Emperor

Oct 1999
time: 02:31
Smile  Old Post 30-10-2003 03:52
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Avatar Enlargement: We've got the solution

Solver, you have a PM
Sorry!

@Everyone, good luck with the project!

ahenobarb is offline ahenobarb
Prince

Nov 2001
time: 05:31
  Old Post 30-10-2003 04:01
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton, buy Civilization 2

Just stepping back for a second. All this time waiting for the source code -- and we use it just so we can play Pacman!!!

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:31
Post  Old Post 30-10-2003 04:42 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

And here is a thread that describes the fix of the GLHidden flag for goods does not work bug.

I also found something else that could be interesting in the Rankingtab.cpp there is a function called GetTurnStrength, I tracked it down to the Strength.cpp and found these possible arguments for this function:

STRENGTH_CAT_KNOWLEDGE:
STRENGTH_CAT_MILITARY:
STRENGTH_CAT_POLLUTION:
STRENGTH_CAT_TRADE:
STRENGTH_CAT_GOLD:
STRENGTH_CAT_POPULATION:
STRENGTH_CAT_CITIES:
STRENGTH_CAT_GEOGRAPHICAL:
STRENGTH_CAT_SPACE:
STRENGTH_CAT_UNDERSEA:
STRENGTH_CAT_UNITS:
STRENGTH_CAT_BUILDINGS:
STRENGTH_CAT_WONDERS:
STRENGTH_CAT_PRODUCTION:

So what do want to see on the powergraph in addition.

I would like to see a pollution graph, maybe also an additional wonder graph, maybe also a geographical graph, maybe they could be displayed only if you have an embassy with the corresponding player.

-Martin

The Big Mc is offline The Big Mc
King
Of the universe / England
Oct 2001
time: 05:31
  Old Post 30-10-2003 14:42 Visit The Big Mc's homepage!
Edit/Delete Message Reply w/Quote
#12 Report this post to a moderator
Put an end to popups!

If I get it correctly, it creates a unit of type which is the second-from-end in the unit database.

if i remeber right isen that the war walker

Admiral PJ is offline Admiral PJ
Prince
Southeast England , UK
Dec 2000
time: 05:31
Thumbs down  Old Post 01-11-2003 09:42
Edit/Delete Message Reply w/Quote
#13 Report this post to a moderator
Support Apolyton or Terrorists Win

while(y < 0) {
y += g_mp_size.y;
x = (x + g_mp_size.x - (((g_mp_size.y / 2) % g_mp_size.x) - 1)) % g_mp_size.x;
}

I found this at the end of Mappoint.cpp in
function Norm2Iso -----> void MapPoint::Norm2Iso(const MapPointData &pos)

interesting coding.. probably to do with the isolinear diagonal map tile drawing. Looks pretty mad, it assumes y is 0 I think, otherwise it seems to be wasting time increasing y until it reaches 0 in g mp increments.

Just something that caught my eye.. this coder on that file seems to use whiles like If statements, whereas I rarely do.

Mr Ogre is offline Mr Ogre
Warlord
Azeroth
Jan 1970
time: 05:31
  Old Post 01-11-2003 11:30 Visit Mr Ogre's homepage!
Edit/Delete Message Reply w/Quote
#14 Report this post to a moderator
Support Apolyton buy from Amazon

quote:
Originally posted by Admiral PJ
while(y < 0) {
y += g_mp_size.y;
x = (x + g_mp_size.x - (((g_mp_size.y / 2) % g_mp_size.x) - 1)) % g_mp_size.x;
}


AAHHHHHHHHH THE HORROR!!!!!!!!!!!!!!!!!

It's for doing vertical wrap around. The math is very, very tricky for any map whose vertical size is not a multiple of it's horizontal size.

If you don't have vertical wrap turned on, you should ever hit that loop. It's only a loop, I think, in case something wraps a really long way. Normally it would only go through that once.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:31
  Old Post 01-11-2003 18:26 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#15 Report this post to a moderator
Support Apolyton, buy Civilization 2

Mr Ogre,
Completely off-topic, but I sent you a PM.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:31
Post  Old Post 01-11-2003 21:45 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#16 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

Interestingly in the Debug version there is some sort of Sprite tester, maybe an early version of a sprite editor.

-Martin

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

The code still has many referrences to the Alien victory, such as IsAlienVictoryEnabled variable, and so on. I won't be surprised if the code that worked with the Xenoform lab in CtP1 is still to be found somewhere.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:31
  Old Post 01-11-2003 22:16 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#18 Report this post to a moderator
Put an end to popups!

quote:
Originally posted by Martin Gühmann
Interestingly in the Debug version there is some sort of Sprite tester, maybe an early version of a sprite editor.


Yes, it was only alpha builds I worked with as well, but I could never get it to work: when I try to load a different sprite than the Settler, it always seems to crash (never tried too hard though).

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:31
Post  Old Post 01-11-2003 23:10 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#19 Report this post to a moderator
Support Apolyton or Terrorists Win

quote:
Originally posted by Solver
The code still has many referrences to the Alien victory, such as IsAlienVictoryEnabled variable, and so on. I won't be surprised if the code that worked with the Xenoform lab in CtP1 is still to be found somewhere.


Probably the Alien Victory is the science victory. But of course you could still find some CTP1 stuff.

-Martin

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

Yeah, I figure so, Martin, although there are separate classes to be found for the Gaia Controller items.

MrBaggins is offline MrBaggins
King

May 1999
time: 05:31
  Old Post 02-11-2003 01:41
Edit/Delete Message Reply w/Quote
#21 Report this post to a moderator
Put an end to popups!

The Veteran bug

SYMPTOM: Veteran status does not effect combat in any shape, form or way.

CAUSE: [CTP2Combat.cpp] The CombatUnit class does not include a veteran status variable, the CombatField::FillFrom function doesn't modify attack/defence strength & the CTP2Combat::ExecuteAttack doesn't attempt to look up veteran status or anything similar digging through the unit class.

SOLUTION:
Add veteran variable & populate in CombatUnit constructor. I.E. unit->IsVeteran()

Alter attack/def strength in CTP2Combat::ExecuteAttack
I.E. * g_theConstDB->GetVetCoef()

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:31
  Old Post 02-11-2003 02:15 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#22 Report this post to a moderator
Inflate your Upload Space

A good find, Mr. Baggins. I have also quickly written some additional code to the classes, but can't check whether it's working or not, so I'm not posting. But the main idea was adding the m_veteran variable to members of CombatUnit class.

MrBaggins is offline MrBaggins
King

May 1999
time: 05:31
  Old Post 02-11-2003 02:32
Edit/Delete Message Reply w/Quote
#23 Report this post to a moderator
Tired of ads?

The "not working" is a bit of a bummer. Also the fact that we are stuck with 1.0 kinda sucks. We have to reinvent the wheel a bit... but fwiw adding new SLIC functionality isn't rocket science.

MrBaggins is offline MrBaggins
King

May 1999
time: 05:31
  Old Post 02-11-2003 02:33
Edit/Delete Message Reply w/Quote
#24 Report this post to a moderator
Got spare money?

Hmmm... time to dig up the patch readme to check what we need to fix again ourselves.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:31
  Old Post 02-11-2003 02:40 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#25 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

I already did, it's doesn't offer an awfully lot of detail.

quote:
A. Multiplayer Issues
- Resolved several general issues.
- Addressed synchronization issues.
- Issues with nukes in network games have been resolved.
- Huge improvements to stability overall.
- Resolved client border update issue with captured cities.
B. Diplomacy Issues
- Embargo button on Diplomacy Manager remains enabled when confirmation is cancelled.
- Resolved some AI issues regarding diplomacy.
C. Miscellaneous
- Message occurring when a Wonder is nearly complete is now triggered earlier.
- Various general and stability issues with Scenarios have been addressed.
- Several text issues in the non-US versions of Call to Power II have been resolved.

Maquiladora is offline Maquiladora
Emperor

Jun 2001
time: 05:31
  Old Post 02-11-2003 03:16 Visit Maquiladora's homepage!
Edit/Delete Message Reply w/Quote
#26 Report this post to a moderator
Support Apolyton, buy Civilization 2

You can find all the seperate altered files in the XPatch zip file in the directory, if you need to know all the specific files that were added/changed.

Locutus is offline Locutus
ACS CTP1/2 Manager & Civ4 Co-Manager
Hengelo, The Netherlands
Nov 1999
time: 06:31
  Old Post 02-11-2003 03:37 Visit Locutus<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#27 Report this post to a moderator
Put an end to popups!

That's not very useful, we mainly want to know what changed in the ctp2.exe file, which we obviously need the source for...

Maquiladora is offline Maquiladora
Emperor

Jun 2001
time: 05:31
  Old Post 02-11-2003 04:15 Visit Maquiladora's homepage!
Edit/Delete Message Reply w/Quote
#28 Report this post to a moderator
Full PM-box? Change here!

Better than nothing

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:31
  Old Post 02-11-2003 06:15 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#29 Report this post to a moderator
Support Apolyton, buy Alpha Centauri

The rush buy bug

This particularly infamous bug seems to arise from the following dirty hack in ui\interface\NationalManagementDialog.cpp, around line 1255:

code:
g_gevManager->AddEvent(GEV_INSERT_Tail, GEV_BuyFront, GEA_City, city, GEA_End);

Which simply tells the city to rush buy no matter the circumstances, and so it is unsurprising that problems arose. I have replaced it with the following:
code:
// JJB removed the following: // g_gevManager->AddEvent(GEV_INSERT_Tail, GEV_BuyFront, GEA_City, city, GEA_End); // and replaced it with the following: if (!city.GetCityData()->AlreadyBoughtFront()) { city.GetCityData()->AddBuyFront(); } // in the hope of fixing the rush buy bug.

Which calls the routines in the city to do it, which seems like what should have been done anyway.

Because of this on line 479 an additional condition needs to be added:
code:
// JJB added this inner if so that things add up properly if (!city.GetCityData()->AlreadyBoughtFront()) { rushBuyTotal += city.GetCityData()->GetOvertimeCost(); }

so that the total cost displayed for rush buying is correct.

Brief tests suggest that this all works correctly.

Solver is offline Solver
Apolyton Duke Of Something
Latvia, Riga
Sep 2000
time: 07:31
  Old Post 02-11-2003 18:58 Visit Solver<br><img src=/forums/images/staff-icon.gif>'s homepage!
Edit/Delete Message Reply w/Quote
#30 Report this post to a moderator
Support Apolyton buy from Amazon

I wonder if anyone who gets the compiled game to actually run can test this code, which is supposed to fix the veteran bug.

CombatUnit class declaration changed to be:

code:
class CombatUnit { private: double m_offense, m_defense, m_strength, m_armor, m_ranged, m_hp; bool m_veteran; UNIT_TYPE m_type; sint32 m_preferredCol; sint32 m_priority; bool m_valid; public: bool m_alreadyExploded; bool m_alreadyAttacked; #ifdef TEST_APP uint32 m_id; #else Unit m_unit; #endif CombatUnit() { m_valid = false; } #ifdef TEST_APP CombatUnit::CombatUnit(double offense, double defense, double strength, double armor, double ranged, double hp, bool veteran, UNIT_TYPE type); //bool veteran added #else CombatUnit::CombatUnit(double offense, double defense, double strength, double armor, double ranged, double hp, bool veteran, Unit &u); //bool veteran added by solver #endif double GetOffense() { return m_offense; } double GetDefense() { return m_defense; } double GetStrength() { return m_strength; } double GetArmor() { return m_armor; } double GetRangedAttack() { return m_ranged; } UNIT_TYPE GetCombatType() { return m_type; } sint32 GetPreferredCol() { return m_preferredCol; } void SetPreferredCol(sint32 col) { m_preferredCol = col; } sint32 GetPriority() { return m_priority; } void SetPriority(sint32 pri) { m_priority = pri; } //following two added by Solver void SetAttack (double att) { m_offense = att; } void SetDefense (double def) { m_defense = def; } double GetHP() { return m_hp; } bool IsVeteran(){ return m_veteran; } void DeductHP(double amt) #ifndef TEST_APP ; #else { m_hp -= amt; if(m_hp < 0.001) { m_hp = 0; } } #endif bool IsValid() { return m_valid; } bool IsAlive() { return m_hp > 0.001; } bool IsActive() { return IsValid() && IsAlive(); } void AddKill(); void Invalidate() { m_valid = false; } };




Round line 867 in CtP2Combat.cpp, changed code to:

code:
CombatUnit newUnit(rec->GetAttack(), rec->GetDefense(), rec->GetFirepower(), rec->GetArmor(), rec->GetZBRangeAttack(), u->GetHP(), u->IsVeteran(), u);


Function CtP2Combat::ExecuteAttack now contains this code in beggining:

code:
void CTP2Combat::ExecuteAttack(CombatField *attacker, sint32 attX, sint32 attY, CombatField *defender, sint32 defX, sint32 defY) { m_noAttacksPossible = false; CombatUnit *att = &attacker->GetUnit(attX, attY); CombatUnit *def = &defender->GetUnit(defX, defY); //Solver added the following to add veteran check if (att->IsVeteran()) { double vetattack; double vetdefense; vetattack=att->GetOffense() + att->GetOffense() * g_theConstDB->GetVetCoef(); att->SetAttack(vetattack); vetdefense=att->GetDefense() + att->GetDefense() * g_theConstDB->GetVetCoef(); att->SetDefense(vetdefense); }


Finally, to CtP2Combat.cpp I added

code:
#include "ConstDB.h" //the const db for veteran extern ConstDB *g_theConstDB; //to get vetstatus


in the beggining.

I hope this fixes the bug, if I understood the way code works from my quick look at it.

 
Pages (2): [ 1   2   ]
< Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:31.
Apolyton Time is 00:31.
    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.0620 seconds (91.65% PHP - 8.35% 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