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 > Project: Unit Upgrading
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
E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:37
  Old Post 27-03-2005 05:41 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
Project: Unit Upgrading Get a bigger avatar today!

I'm hoping that Upgrading units becomes part of the code (I'm sure many do)

I figure it will involve a lot of code, and I'm hoping others may be interested. I've done some initial digging and see that we'll have to add a button (like I've done under the expel boot):




Then I think we'll have to add the upgrade flag of course (I already added it to the cdb)

A CanUpgrade function that will entail if the unit is at a city, if an advance is available and (possibly) if a building is available.

Next the cost. The slic is pre-set but I think if we calculate the shield cost of the unit minus the cost of the upgrading unit times a number of Gold (is there somewhere that gives a gold to shield ratio? I didn't see it in DiffDB and thought infrastructure or capitalization would have it)

Then the upgrade paths. this may be hardest for me since I'm not sure how to get it to check if you've missed a few upgrades (say a warrior to infrantry but you didn't upgrade to pikemen)

Finally, AI. Should we make it free for the AI like the SLIC or try to teach it. I notice Civ3 isn't good at this and I tend toward giving the AI free, automatic upgrades (for the challenge factor if anything).

Please post comments and I hope some are willing to contribute (because I have to finish show on map first).

HuangShang is offline HuangShang
King
USA, SoCal, L.A.
Jul 2002
time: 21:37
  Old Post 27-03-2005 06:25
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Inflate your Upload Space

love the button idea, can it go dark if it cannot be used? like how some attacks go dark when inside a city

and if we have a button, do we want that they need to be in a city?

Maquiladora is offline Maquiladora
Emperor

Jun 2001
time: 05:37
  Old Post 27-03-2005 11:29 Visit Maquiladora's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton buy from Amazon

Units can only be upgraded within a city, a fortification or perhaps when grouped with a "supply" unit?

As for the AI, it should at least be tried to use it properly without giving it a cheat of free upgrades first. /Martin G.

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:37
  Old Post 28-03-2005 01:09 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

fortification and supply unit hmmm I guess it would just require addind an additional flag for imps and units and then a check at the position of the unit...

Yeah I'd like the AI to "think" about it to, but as my code attempts show I think AI is out of my league for now.

Last edited by E on 28-03-2005 at 08:34

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:37
  Old Post 28-03-2005 08:36 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

Just a little research as I fix (again) my code. I think the CDB may have to have something like:

code:
Struct UpgradeTo { Record Unit Unit Int Cost }

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:37
Post  Old Post 28-03-2005 22:47 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Enter the AD-FREE zone

quote:
Originally posted by E
fortification and supply unit hmmm I guess it would just require addind an additional flag for imps and units and then a check at the position of the unit...

Yeah I'd like the AI to "think" about it to, but as my code attempts show I think AI is out of my league for now.


The easiest solution to this is, to check on the BeginTurnUnit event whether the unit can be upgraded and if it can upgrade it. Of course this has nothing to do with strategic planing but is better than nothing.

quote:
Originally posted by Maquiladora
Units can only be upgraded within a city, a fortification or perhaps when grouped with a "supply" unit?


Why so restrictive? It should be up to the modder how it works, whether the unit needs to be in a city or can be upgraded on high sea.

-Martin

Last edited by Martin Gühmann on 28-03-2005 at 23:08

Maquiladora is offline Maquiladora
Emperor

Jun 2001
time: 05:37
  Old Post 28-03-2005 23:16 Visit Maquiladora's homepage!
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy Civilization: The Boardgame

Well that was my point Martin, that it should be possible with a unit (called "supply unit" as an example) with a flag present on the same tile as the unit wanting to be upgraded, a certain city improvement present in the city, a flag for tile improvements capable of it, whatever, so its all possible.

Mirimunchkin is offline Mirimunchkin

Chieftain

Jan 2005
time: 05:37
  Old Post 29-03-2005 15:21
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Support Apolyton, buy Civilization III: Complete

In the case of naval units, assuming they're being considered, I don't think that upgrading should be possible. Ships cannot be modified to the extent of the Tech leaps in CtP2. You can't really convert a Ship-of-the-Line into an Ironclad! The only item to carry over would be the crews.

Also, once Tech reaches a certain level, some upgrades won't be possible in the field, ie, Cavalry to Tank, as they are equipment specific.

HuangShang is offline HuangShang
King
USA, SoCal, L.A.
Jul 2002
time: 21:37
  Old Post 30-03-2005 08:52
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Avatar Enlargement: We've got the solution

actually you CAN "convert a Ship-of-the-Line into an Ironclad", but not into anything after ironclads...

but what if upgrade had different cost depending on situation? fort cost more than city (forts dont make extra stuff for soldiers) and then quite a jump for when grouped w/ some supply or hero unit? possible?

J Bytheway is offline J Bytheway
Emperor
England
Jul 2001
time: 05:37
  Old Post 30-03-2005 17:35 Visit J Bytheway's homepage!
Edit/Delete Message Reply w/Quote
#10 Report this post to a moderator
Support Apolyton or Terrorists Win

I should say that the struct describing the upgrade should add any other requirement. e.g. the struct could also have RequiredBuilding if a building is required, etc...

On the other hand, it would really be nice to have arbitrary logical combinations of requirements, and the only way to do this is to hand off to SLIC - perhaps some simple text-file based method like requiring a building, and then hand off to SLIC (via a new mod_ function or an appropriate event) to allow modders to do anything more complicated that they want (like supply units, etc.).

E is offline E
King
July 24,2005 Ctp2 Tiles in sig!
May 1999
time: 21:37
  Old Post 30-03-2005 21:33 Visit E's homepage!
Edit/Delete Message Reply w/Quote
#11 Report this post to a moderator
Increase Your PM Length

J,
are you recommending something like a SLICflag that in the SLIC code you could have the SLIC see if a unit has that flag and then have an operation with it. OR create a SLIC flag that you specify the slic file and if you have the unit at the start of the turn it runs the slic file?

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:37.
Apolyton Time is 00:37.
    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.0320 seconds (88.82% PHP - 11.18% 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