View Full Version : Python / C++
Lord Olleus Jun 14, 2006, 11:55 AM This is a list of Everything that needs to be programed into the game for our mod. I have decided to restart everything from scratch as the previous code I had written is rather poor. Rather than coppying everything I have already done I have decided to start a new list of what needs to be done.
If you have something which you want done in either python or C++ post it here, and I will update the 'To-do list' below. Please only post below if you are absolutely sure that this should be included in the game, and also add as much detail as possible.
This is not a thread to discuss ideas, but a place to make them reality.
Lord Olleus Jun 14, 2006, 11:56 AM To do list
Add XML taggs allowing buildings to speed up specific UNITCOMBATs [on hold]
Add magic spell system [ 70% complete ]
Add magic item system [need more info on what this should do]
Add psychology (see thread entitled 'Panic!') [not started]
Change golden ages for chaos so that it gets +20% strengh to all units and is more aggressive [not started]
Give Orcs & Goblins peaceweariness [not started]
Add code for spawning Characters/Heroes. [not started]
Add 'support fire' for archers. [DONE - Thanks Gerikes]
Add civ specific improvements. [not started]
Limit wonder production to certain groups of civ. [not started]
Duke van Frost Jun 16, 2006, 10:25 AM I request the thing I did before in the old thread:
make it possible for buildings to give production bonuses to different UnitCombatTypes rather than only the Domains.
Coukld be used for Siegeworkshop, a new Archeryrange, Stables etc. etc.
Psychic_Llamas Jun 17, 2006, 11:24 PM I might post some stuff on magic items from the table top game if you like. will have to start a new thread though (there will be heaps of stuff on them)
TheLopez Jun 18, 2006, 09:56 PM Alright, here is the link to the merged mods Ploep asked me to do this morning for the WH mod: http://www.aracnet.com/~opus/Civiv/WarhammerMod.zip
It contains the:
- Merc Mod
- Great General Amped Mod
- Flying Mod
- Enhanced Tech Conquest
-Animals on Water mod
- Pirates Mod and
- Unique Babarian Mod
Ploeperpengel Jun 18, 2006, 10:10 PM Thx Lopez.
@Olleus
You just need to merge those files refering to python and C++ with your scripts for the mod and send me the files afterwards.
I will wait for the others to finish their xml and copy and paste the refering xmllines in then.(and maybe work on the textfiles).
Puh that'll be much work. But better concentrate that last step before release than scatter those files again. That means though I need the python and SDK stuff you've done so far(and merged with these) by next Friday otherwise it won't get into the next release. I want to try to upload a running version after the weekend and the playtesting bughunt can begin:)
Lord Olleus Jun 19, 2006, 09:58 AM I have only just started redoing all of the python so merging it with Lopez's code should be easy. I will do everything I can to meet the deadline, and will tell you in advance if I can't.
Ploeperpengel Jun 19, 2006, 10:05 AM I have only just started redoing all of the python so merging it with Lopez's code should be easy. I will do everything I can to meet the deadline, and will tell you in advance if I can't.
Good. If your work involves any xml you can use the vanilla files like lopez and mark the changed entries for me.
So just hope to get response from seZ and Agent about the unitstuff soon! the rest seems to be going good so far:)
Lord Olleus Jun 20, 2006, 10:26 AM I have started on point 2 as it seems that it is the most important. Lopez, you can start on point 1 if you have the time.
Ploeperpengel Jun 21, 2006, 08:49 PM I was thinking about JPs old concept of upgradeable citizenworkers and indeed I think this will be quite a good option for most of the more civilized races.
I'm planning to use JPs techtree of the reduxe as a base to work on. Workers will autoupgrade to citizen workers with the tech civil service.
We need an SDK tweak that will prevent the AI from upgrading all available citizenworkers to military units afterwards otherwise it won't have workers available. Can you put that on the list? Maybe ask Kael about that for hints. He had a similar problem with his apprentices in FFH1. Or maybe you know an easy workaround?
For the less civilized races like orcs we will include bridge techs to get around this feature if necessary and making advanced units for them available. (instead of civil service they get slavery in example)
Edit: Keal mentioned it would be possibly maybe to put a control in place so that the AI would only be able to upgrade in emergencies.
Edit 2: post 27-30 of theLopez' thread contains the details for the traits: Friendsofthewood, Barbarian_Raiders and scorched earth(this one is for chaosspawn barbarians, the old chaospawn idea should be implemented too but this has time-you can put it on the list as last). For the trait Hidden sadly we'll have to wait until it's done in FFH.
Lord Olleus Jun 22, 2006, 12:14 AM The way to do this seems to be to be to add a new UNIT_AI. This should be easy. Make it behave like a normal worker, but have it upgrade if an enemy unit is within 2 or 3 squares.
Lord Olleus Jun 22, 2006, 12:16 PM This is all of the code so far.
It includes all of TheLopez's code as well as an early version of the spell system. The spell system works like this.
A unit can cast 1 spell per UNITCOMBAT_SPELL_BOOK it carries. If it carries 3 books it can cast 3 different spells.
When a spell is cast CvSpellsInterface.onCastSpell() (in python/entrypoints) is run. Instructions on how to modify that file are included. The only XML changes I have made are in Units/MissionInfo.xml, feel free to change anything there apart from the order of the missions and their name. And in XML/BasicInfo/CvBasicInfo.xml. You can change the name of UNITCOMBAT_SPELL_BOOK, but whatever unitcombat spell books have, it MUST be at the top of the list.
My todo list
- Add a way for the player to choose a square for certain spells
- Remove all hard coded limits by XML attributes.
http://www.civfanatics.net/uploads12/New_Warhammer1.zip
TheLopez Jun 22, 2006, 10:06 PM My todo list
- Add a way for the player to choose a square for certain spells
You could always just use the sniping ability from the sniper mod and change the name of the unit combat from UNITCOMBAT_SNIPER to UNITCOMBAT_CASTER.
Ploeperpengel Jun 22, 2006, 10:16 PM Something like that I had in mind when I suggested to implement this. I just didn't think we'll need it that fast.:D Good job guys! Seems P.L.s magic thread will be soon in focus and I should make a couple of magicbook units.
@Olleus
About the castbutton. Take just any button for it now. I'll find a proper one. I just need to now how it should be named and where to put it in.
Btw Lopez the ordinary snipermod could be useful too. The empire could have sniperunits called Hochland Jaegers(ok but that' just for one unit nobody made yet)
Lord Olleus Jun 23, 2006, 12:30 AM You could always just use the sniping ability from the sniper mod and change the name of the unit combat from UNITCOMBAT_SNIPER to UNITCOMBAT_CASTER.
But does it have a range of bigger than 1 and does the AI understand it?
TheLopez Jun 24, 2006, 07:03 AM This is all of the code so far.
It includes all of TheLopez's code as well as an early version of the spell system. The spell system works like this.
A unit can cast 1 spell per UNITCOMBAT_SPELL_BOOK it carries. If it carries 3 books it can cast 3 different spells.
When a spell is cast CvSpellsInterface.onCastSpell() (in python/entrypoints) is run. Instructions on how to modify that file are included. The only XML changes I have made are in Units/MissionInfo.xml, feel free to change anything there apart from the order of the missions and their name. And in XML/BasicInfo/CvBasicInfo.xml. You can change the name of UNITCOMBAT_SPELL_BOOK, but whatever unitcombat spell books have, it MUST be at the top of the list.
My todo list
- Add a way for the player to choose a square for certain spells
- Remove all hard coded limits by XML attributes.
http://www.civfanatics.net/uploads12/New_Warhammer1.zip
LO, there is a bug in the fire method in the MercenaryUtils.py file. Here is what the method should look like (I have bolded the changes):
# Tells the mercenary that the player no longer needs their services and performs the
# necessary operations to remove the mercenary from the game and make them available to
# other players
def fire(self):
if(self.objUnit == None):
CvUtil.pyPrint("We should never reach this point, why did the player have access to this mercenary?")
return
# if the mercenary is in a group do not allow the player to fire the mercenary independantly,
# all for one and one for all, in fact, the mercenary manager should not display the individual
# mercenaries from groups in the hired mercenary list.
if(self.objMercenaryGroup != None):
CvUtil.pyPrint("We should never reach this point, mercenary groups are not implemented!!")
return
if(g_bDisplayMercenaryMessages and self.iBuilder != -1 and self.iBuilder != self.iOwner):
strMessage = self.getName() + " is no longer needed by " + gc.getPlayer(self.iOwner).getName()
# Inform the player that the mercenary has been fired.
CyInterface().addMessage(self.iBuilder, True, 20, strMessage, "", 0, "", ColorTypes(0), -1, -1, True, True)
# Set the mercenaries promotion list before removing the mercenary from the game
self.promotionList = self.getCurrentPromotionList()
# Set the mercenary's hire cost before removing the mercenary from the game
self.iHireCost = self.getHireCost()
# Set the mercenary's experience level before removing the mercenary from the game
self.iExperienceLevel = self.getExperienceLevel()
# Set the mercenary's level before removing the mercenary from the game
self.iLevel = self.getLevel()
# Set the hired flag to false before removing the mercenary from the game
self.bHired = false
tmpOwner = self.iOwner
# Set the mercenaries owner to -1 before removing the mercenary from the game
self.iOwner = -1
# Remove the unit from the game
self.objUnit.kill(true,PlayerTypes.NO_PLAYER)
# Make sure that we get rid of the reference to the unit
self.objUnit = None
TheLopez Jun 24, 2006, 07:05 AM But does it have a range of bigger than 1 and does the AI understand it?
Yes, the range is variable and yes, the AI understands how to use the sniper feature. Geez, I thought you played all my mod comps LO.
Lord Olleus Jun 24, 2006, 07:26 AM I try, I try, but I don't have the time.
Ploeperpengel Jun 29, 2006, 12:46 PM Sto:
Ok ... I've added this line into onGameStart() (i don't know if it's the better place) but that 's seem to work without problem :
CyVariableSystem().setValueString('CAMERA_MIN_DIST ANCE','400')
Here's a line that should trigger the camera to zoom in closer in game. I also found some values in the detailmanager.xml that seems to affect camera distance.
Wouldn't it be cool to have regiments and detailed models at the same time?:D
Lord Olleus Jun 29, 2006, 01:44 PM But doesn't that mean that you can see less of the map? I would rather see my surroundings than the actual models.
Ploeperpengel Jun 29, 2006, 01:47 PM But doesn't that mean that you can see less of the map? I would rather see my surroundings than the actual models.
For this you can always zoom out or not? I don't want to trigger the max distance only the mindistance. Of course we would have to playtest it how it turns out. But I really don't get your problem here:confused:
Ploeperpengel Jun 29, 2006, 04:28 PM Roger Bacon mentioned this can be changed in global defines so no need to code it in python. Nevermind:mischief:
Lord Olleus Jun 30, 2006, 01:11 PM Done a hell of a lot of work on the magic system. In now works perfectly expect for a few things:
1) The 'cast a spell' button does not tell you what spell you are casting. You have to count the number of units to work it out.
2) Tha AI has absolutely no idea on how to use this and will completely ignore it
3) You can damage people with magic without having to declare war (will fix soon)
4) The range of a spell is determined by the caster (<iAirRange> ), and not by the spell.
So far I have done the first 3 spells of the lore of fire as a demonstration. Civsman, if you could do the rest it would be greatly appreceiated as I would like to spend time refining the system and making the AI understand it.
I haven't written a read me yet on how to add new spells or how this works, but the files you need are python/entry points/CvMagicSpellsInterface.py and python/Magic/CvMagicSpells.py
It is all fairly self explanitory. Make sure to give the spell book units the correct UNITCOMBAT_. Read BasicInfo.xml for more info.
PS: I have included all of the code from theLopez.
http://www.civfanatics.net/uploads12/New_Warhammer2.zip
Ploeperpengel Jun 30, 2006, 03:04 PM Any xml changes to the former zip?
Btw I took out the Barbarians mod again for the Test Mod. After second thought it won't fit as it is. The rest of Lopez' stuff is in. So I need to know if I can just put the python and SDK files to it or if I will also have to change the xml again. Or should I wait with this?
I currently experience problems with the spellbook units. I hope to solve the problem though. Just gimme time and we'll have a proper spellbook art;)
Lord Olleus Jun 30, 2006, 03:18 PM I have made XML changes to:
Units / MissionInfo
units / UnitInfo
Units / UnitClassInfo
units / PromotionInfo
Interface / InterfaceModeInfo
BasicInfo / BasicInfo
All of my changes are commented with:
<!--Lord Olleus / Warhammer Mod / 30th June 06 -->
<!--Lord Olleus / End -->
Lord Olleus Jul 01, 2006, 11:02 AM A patch for the magic mod.
1) Fixed bug concerning 2 wizards being being selected at once and casting there spells together. A wizard can now only cast a spell if he is selected on his own.
2) The name of the spell now appears when mousing over the cast button.
3) Exported all of the internal SDK functions I made to python (see CyUnit.cpp)
The only files I have modified are:
CvGameCoreDLL.dll
CIV4GameText_Magic.xml (new)
CIV4MissionInfos.xml
CIV4InterfaceModeInfos.xml
Copy all the files here into their respective folders.
http://www.civfanatics.net/uploads12/Patch.zip
Ploeperpengel Jul 01, 2006, 11:42 AM I will integrate this all and try to upload a new wh-test mod later tonight or tommorrow. After that you could patch everything directly to the mod in the construction site.:)
Lord Olleus Jul 01, 2006, 11:51 AM Will do next time!
Now I am going to start work on the AI. It will not be easy.
Ploeperpengel Jul 10, 2006, 10:32 PM Just in case you missed post 27 and 28 of Lopez' thread. Kael posted the code for some promotions we planned to include there. Can you put that on your list too?
Duke van Frost Jul 11, 2006, 06:57 AM Another request by me:
Add XML tags that allow Resources to directly produce income (Gold).
I need that for the new "BloodBowl Tickets" they are supposed to give +1 Happiness and +? Gold.
It´s a resouce that Players get from the Wonder "Bloodweiser Stadium"
Ploeperpengel Jul 11, 2006, 09:09 AM Contra. This idea is originally mine but not really well thought of. Trading this tickets won't make sense if they generate income directly.
Sorry Duke. I imo we shouldn't change python in this case.
Ploeperpengel Jul 14, 2006, 09:24 AM As you will notice in my sig I'm trying to get some programmers to help you a bit;)
We have so much ideas but not enough manpower to realize them imo.
seZereth Jul 15, 2006, 05:45 PM As you will notice in my sig I'm trying to get some programmers to help you a bit;)
We have so much ideas but not enough manpower to realize them imo.
Well As you will realize in my sig I am triing to get people to join our project and be part of the team... but i see it from thge good side, as long no stats or python codes existiert which have to be writen in, i can optimize the graphics :eek: and as longer i can test and implement new units, redo textures and have great fun seeing my work comes to live, the less we have to go bug hunting:sniper:
hell stop me from writing http://www.world-of-smilies.com/html/images/smilies/sonstige/g056.gif :suicide:
Kael Jul 15, 2006, 10:22 PM Just in case you missed post 27 and 28 of Lopez' thread. Kael posted the code for some promotions we planned to include there. Can you put that on your list too?
I pm'ed Lord Olleus the entire FfH Source code with documentation so if there is anything that saves him time or he can use he will have easy access to it.
seZereth Jul 17, 2006, 02:00 AM thanks kael !
Ploeperpengel Jul 17, 2006, 09:10 PM Great. Thx a lot Kael!
Lord Olleus Jul 18, 2006, 09:52 AM Thanks a lot Kael, I will tear throught it shortly.
Unfortunately I am on holiday for the next 3 weeks and I can not program anything as I am unable to test it. The most I can do is a few magic spells, but any attempt at anything more complicated will almost certainly result in failure.
seZereth Jul 19, 2006, 05:20 AM take your time olleus, hope you can get the best out of keals source later ;)
Ploeperpengel Jul 27, 2006, 08:26 AM @Olleus
You still didn't respond to the promotionscodings in post 27-28 of the Lopez thread!! I asked you earlier to put that to the list(since this shouldn't need much work you could also create a small patch for that in the construction site, the xml part is already done for them!).
Also the firtstrikefix by Lunar Moongoose is vital now!! Our combat system relies heavily on firtstrikes so could you make this toppriority? Shouldn't be much work either.
Belizan Jul 29, 2006, 01:30 AM To do list
Add XML taggs allowing buildings to speed up specific UNITCOMBATs [on hold]
As in... Produce UNITCOMBAT_RECON units 25% faster? If so, easily done.
Add magic spell system [ 70% complete ]
Not enough information, but it sounds like work here is already started and ongoing.
Add magic item system [need more info on what this should do]
Ditto. Need more information.
Add psychology (see thread entitled 'Panic!') [not started]
This requires SDK modification. Not sure how difficult it is, honestly, but it sounds straightforward.
Change golden ages for chaos so that it gets +20% strengh to all units and is more aggressive [not started]
Easy, assuming "more aggressive" means reducing attitude towards other players. Really requires some sort of description of the equation you want to use as well (i.e. how much attitude loss, how quickly (and with whom)).
Give Orcs & Goblins peaceweariness [not started]
Easy in theory, but needs a specific equation. I.e. how much weariness per turn by game speed, how much unhappiness at what threshold.
Add code for spawning Characters/Heroes. [not started]
Need a description of the appearance/spawn criterion.
Add 'support fire' for archers. [not started]
Requires SDK mod. Theoretically not too difficult.
Add civ specific improvements. [not started]
Easy.
Limit wonder production to certain groups of civ. [not started]
Easy.
I was thinking about JPs old concept of upgradeable citizenworkers and indeed I think this will be quite a good option for most of the more civilized races.
I'm planning to use JPs techtree of the reduxe as a base to work on. Workers will autoupgrade to citizen workers with the tech civil service.
We need an SDK tweak that will prevent the AI from upgrading all available citizenworkers to military units afterwards otherwise it won't have workers available. Can you put that on the list? Maybe ask Kael about that for hints. He had a similar problem with his apprentices in FFH1. Or maybe you know an easy workaround?
I'm not sure I understand what you are talking about here. I seem to recall talking about this issue when Kael was doing it originally. You want to prevent manual access to an upgrade?
I wrote code for programmatic upgrades long ago.
The way to do this seems to be to be to add a new UNIT_AI. This should be easy. Make it behave like a normal worker, but have it upgrade if an enemy unit is within 2 or 3 squares.
This can be done manually quite easily.
For the less civilized races like orcs we will include bridge techs to get around this feature if necessary and making advanced units for them available. (instead of civil service they get slavery in example)
This sounds like an XML issue.
Edit: Keal mentioned it would be possibly maybe to put a control in place so that the AI would only be able to upgrade in emergencies.
Not sure about this, I'd have to look into it.
Edit 2: post 27-30 of theLopez' thread contains the details for the traits: Friendsofthewood, Barbarian_Raiders and scorched earth(this one is for chaosspawn barbarians, the old chaospawn idea should be implemented too but this has time-you can put it on the list as last). For the trait Hidden sadly we'll have to wait until it's done in FFH.
Not sure what you're referring to.
Another request by me:
Add XML tags that allow Resources to directly produce income (Gold).
I need that for the new "BloodBowl Tickets" they are supposed to give +1 Happiness and +? Gold.
Itīs a resouce that Players get from the Wonder "Bloodweiser Stadium"
As an XML tag it would require more work, but via a Python config or ini file, it's easy.
Ploeperpengel Jul 29, 2006, 02:05 AM I meant post 27-30 of this thread:
http://forums.civfanatics.com/showthread.php?t=174257
Kael posted the code and I just need some one to patch it in. The xml part is already in the mod and will be tweaked later by me I just can't do the python and SDK.
Originally Posted by Duke van Frost
Another request by me:
Add XML tags that allow Resources to directly produce income (Gold).
I need that for the new "BloodBowl Tickets" they are supposed to give +1 Happiness and +? Gold.
It´s a resouce that Players get from the Wonder "Bloodweiser Stadium"
This idea as far as I know was dumped since there would be no reason to trade the tickets anymore.
About the citizens I'm not sure I get what you don't understand. The idea is to have citizens(workers effectivly) upgrading to MilitiaUnits if and only if enemies are close by putting a city in danger. This is meant as a feature for the more civilized races developing their cities and being able to resist aggression at the same time.
As soon a Civ discovers Tech_Militia all of it's workers autoupgrade to Citizen Workers which can upgrade under the above mentioned conditions to a Military unit depending on the choice of the player, his resources and the techs he has already discovered(available Militia units are Militia-Spearman, -Archer and Swordsman; each with different prereqs in techs and resources).
This should of course be understood by the AI otherwise it wouln't make much sense.
Peacewearyness for Orcs should have the same ratio like warwearyness for other civs imo. But better wait for Olleus to respond.
Belizan Jul 29, 2006, 02:11 AM I meant post 27-30 of this thread:
http://forums.civfanatics.com/showthread.php?t=174257
Kael posted the code and I just need some one to patch it in. The xml part is already in the mod and will be tweaked later by me I just can't do the python and SDK.
Merging tasks are easy, and probably best left to Lord Olleus.
About the citizens I'm not sure I get what you don't understand. The idea is to have citizens(workers effectivly) upgrading to MilitiaUnits if and only if enemies are close by putting a city in danger. This is meant as a feature for the more civilized races developing their cities and being able to resist aggression at the same time.
As soon a Civ discovers Tech_Militia all of it's workers autoupgrade to Citizen Workers which can upgrade under the above mentioned conditions to a Military unit depending on the choice of the player, his resources and the techs he has already discovered(available Militia units are Militia-Spearman, -Archer and Swordsman; each with different prereqs in techs and resources).
This should of course be understood by the AI otherwise it wouln't make much sense.
Well, it is an simple thing to do a sweep of all the AI units at the beginning of its turn, check their surrounding fro enemies and execute some decision tree taking into account available upgrades, current cash, and nearby military units to decide whether to upgrade (and possibly some randomness). If that's sufficient, then this can be done, albeit some thought should be put into the actual weightings for the above. Also, can militia be upgraded back to workers?
Peacewearyness for Orcs should have the same ratio like warwearyness for other civs imo. But better wait for Olleus to respond.
I don't happen to know the numbers in that relationship offhand. Ironically figuring those numbers out is probably more work then writing the code for peace weariness.
Ploeperpengel Jul 29, 2006, 02:26 AM 1.Since Olleus mentioned he won't have access to civ for a couple of week I guess you could go for merging right away but I won't force you:p
2.I don't think it's needed to downgrade those units back again. It also shouldn't cost too much gold to upgrade them. But the AI should consider if the upgrade is needed or if it has enough manpower nearby to counter an attack. It would be ridiculous if it would upgrade all it's workers just because a little goblin try to get some easy money by pillaging improvements. The AI should only upgrade if a city is truly in Danger-like the combined str of the attacking units is more than 1,5 times stronger within three tiles around the city than the defenders.
3.Heh. In this case leave it to Olleus I guess he likes to do that by himself anyway since it's his idea;)
If you start your own thread I might come up with my own idea about chaosspawn again. Currently nobody's working on that I'm quite sure but it's definitly something I want to have in the mod but don't want to put it here since there's quite enough on the shedule.
But first of all I recommend you dl the current version in the connstruction site to get an idea about the current status aof the mod and hopefully get some fun outa it.
And btw welcome!
Lord Olleus Jul 29, 2006, 04:11 AM Finaly, another programmer to help me!
Most of the info for the points on the first page are (somewhere) on this forum. Feel free to do any of the things on the list, but if you want to use the SDK please use the modified files I have posted (beware, they are in 2 parts), as this will cut down on the amount of merging needed.
Don't bother doing anything on the magic spells system as I have done it all apart from the AI. Also, I would quite like to do the pyschology part as I have a few ideas on how it could be done ;).
As for peaceweariness, I think it should be exactly like war weariness but only kick in if you are at peace with everybody, and only grow at half the speed. Also, we need to make the orc AI even crazier than Montezuma so it doesn't get bogged down in unhappiness.
As a general note, try to add XML tags whenever possible, it is a lot easier for the non-programming members of this mod to use.
Psychic_Llamas Jul 29, 2006, 04:15 AM Hello Belizan, welcome to the team :D
Things are going to go fast now Olleus has a helper;)
Civmansam Jul 29, 2006, 07:41 AM I have a request as well, I need a code so that whenever a unit dies there is a 50% chance that FEATURE_CORPSE is created in that plot. I tried it myself but for some reason it doesn't work? Maybe I did some tiny thing wrong, anyway if someone could quickly do it, I think it's simple to do.
Duke van Frost Jul 29, 2006, 09:28 AM As in... Produce UNITCOMBAT_RECON units 25% faster? If so, easily done.
Yes, thatīs exactly what I need :D
And If youīre at it, you could add another tag for UNIT_BlahBlahBlah, to speed up the production of certain units (donīt know if this is really needed, but it could be a nice feature.
And make sure that we are able to apply the above mentioned things to more than one UNITCOMBAT_ and UNIT_ per building.
Belizan Jul 29, 2006, 04:24 PM Finaly, another programmer to help me!
I'm mostly just here to pick the low hanging fruit. I don't have a lot of spare time atm :/.
As a general note, try to add XML tags whenever possible, it is a lot easier for the non-programming members of this mod to use.
I don't know how to do that from Python, per se, and I don't have my SDK environment with me here (I'm on an extended business trip). What method do you all use?
Belizan Jul 29, 2006, 04:25 PM I have a request as well, I need a code so that whenever a unit dies there is a 50% chance that FEATURE_CORPSE is created in that plot. I tried it myself but for some reason it doesn't work? Maybe I did some tiny thing wrong, anyway if Belizan or Olleus could quickly do it, I think it's simple to do.
As I recall, Features are tricksy, having special rules. This would take some experimentation.
Civmansam Jul 29, 2006, 06:56 PM As I recall, Features are tricksy, having special rules. This would take some experimentation.
Probably the reason that my code isn't working, but then again I'm still a noob at Python;) :p The reason I made it a feature because then a worker could build bury without resorting to extra code. It would be like scrub fallout.
Lord Olleus Jul 30, 2006, 04:20 AM Belizan if you don't have access to the SDK, the best most important thing to do is probably the spells. I have already done the lore of fire (but only half of it is uploaded (on this thread) ). If you could just work throught the other spells (details of what they should/could do is on the magic thread). If you don't really understand how it works, I'll try to write a read me.
Sorry Civmansam, never done anything with features before.
Ploeperpengel Jul 31, 2006, 12:50 AM If I give missionaries combat abilities but no tech as prereq they will replace warrriors at the start of the game allthough they require a religion or building normally. I could use a script that fixes that.
Lord Olleus Jul 31, 2006, 08:12 AM hmmm.
I'm sure its dooable but I have no idea how it can be done. I'll come back to you on that one.
Kael Jul 31, 2006, 11:25 AM If I give missionaries combat abilities but no tech as prereq they will replace warrriors at the start of the game allthough they require a religion or building normally. I could use a script that fixes that.
The way we handle this is we removed the units entirely from the Handicap file and we grant units instead in the free unit classes in the civilization file. That way I can have the elves start with 2 scouts, the dwarves with 2 warriors, etc.
Im not a fan of letting the game pick my starting units.
woodelf Jul 31, 2006, 11:29 AM Whoa! Belizan is here? :)
Gerikes Aug 01, 2006, 11:46 PM Hey. I was just hoping to get some info on what some of these things were, just in case any of them seemed fun to do.
Add XML taggs allowing buildings to speed up specific UNITCOMBATs [on hold]
I could probably do this. On hold?
Add code for spawning Characters/Heroes. [not started]
Can you give examples of events that happen that spawn Characters/Hereos? Is it a random event, something where the user knows it will happen when they attain a goal, etc?
Add psychology (see thread entitled 'Panic!')
Sounds a bit too rich for my code blood :P
Change golden ages for chaos so that it gets +20% strengh to all units and is more aggressive.
To be clear, Chaos gets +20% to all units that are alive for the duration of the GA? Or does the bonus only get put on newly built units? Also, what is implied by "more aggressive"? Will they be more wiling to start a war, or just be more aggressive in wars they're already in?
Give Orcs & Goblins peaceweariness [not started]
I could probably work on this. If someone could provide just a bit of info on exactly what the effects of "peaceweariness" are. Is it exactly the same as the effects of Warweariness (only backwards) such that you just get more unhappy citizens? Also, how does it get accumulated? I'm not sure on this, but doesn't Warweariness accumulate due to losing units? Should Peaceweariness occur when the Civ is not at war, or do they also need to be losing units at the same time?
Add 'support fire' for archers. [not started]
Any links to how "support fire" would work?
Add civ specific improvements. [not started]
Is it possible to just make all the improvements, and replace the worker unit's list of available builds for each Race to build that improvement rather than the normal? That should just be XML, right?
Limit wonder production to certain groups of civ. [not started]
What consists of a "group of civs". Is this something that is Civ-related ("only these three civs can build this wonder") or in-game defined (This Civ made wonder X, now only it and it's allies can build wonder Y)?
Civmansam Aug 02, 2006, 04:34 AM Whoa! Belizan is here? :)
Whoa! Gerikes is here too? :)
Do you have any idea how to work with features Gerikes? This is my previous post about what I needed to do with them:
I have a request as well, I need a code so that whenever a unit dies there is a 50% chance that FEATURE_CORPSE is created in that plot. I tried it myself but for some reason it doesn't work? Maybe I did some tiny thing wrong, anyway if someone could quickly do it, I think it's simple to do.
Gerikes Aug 02, 2006, 05:35 AM Whoa! Gerikes is here too? :)
Do you have any idea how to work with features Gerikes? This is my previous post about what I needed to do with them:
Something like this during onUnitKilled:
def onUnitKilled(self, argsList):
'Unit Killed'
unit, iAttacker = argsList
player = PyPlayer(unit.getOwner())
attacker = PyPlayer(iAttacker)
# Spawn corpse start
iPercentChance = gc.getDefineINT("CORPSE_SPAWN_CHANCE")
if (iPercentChance > gc.getGame().getSorenRandNum(100, "Corpse spawn") ):
# Success. Spawn corpse
unit.plot().setFeatureType(gc.getInfoTypeForString ("FEATURE_CORPSE"), -1)
# Spawn corpse finish
if (not self.__LOG_UNITKILLED):
return
CvUtil.pyPrint('Player %d Civilization %s Unit %s was killed by Player %d'
%(player.getID(), player.getCivilizationName(), PyInfo.UnitInfo(unit.getUnitType()).getDescription (), attacker.getID()))
I haven't tried it, but that should work. Just define "CORPSE_SPAWN_CHANCE" or some like variable in the defines, and of course make the XML for the corpse feature.
The only problem with this is that you'll lose a feature on the terrain (Ice, Jungle, Oasis, Floodplains, Forest, Fallout) to be replaced by the corpse. Although there are a few ways to remedy this (making plots allow for multiple features, creating a variable in the CvPlot file to keep track of if a plot has a corpse or not, using script data, etc..), I don't know of any way to fix it without running into the problem of when and how to redraw the corpse on the screen. With multiple features, the graphics engine will only draw one of them. With a seperate variable to keep track of if a plot has a corpse, you would have to find a way to update how the corpse is drawn on the screen every time the plot rebuilds the graphics.
The only way I can see it working like this is if there is either using script data or a new variable a way to keep track if a plot has a corpse. Then, create a new terrain texture in the "art\terrain\plottextures\plottextures.dds" file, and change the CyGame::updatePlots in the HOPE that that function is called any time a plot has to be redrawn. I really don't know if that is the case or not. Even if it is, though, you run into the problem that the plottextures.dds file can only store 5 textures, so you'd be hard-pressed to make the dead not all look the same.
But if you're ok with losing the feature, then that code above should be all you need.
Duke van Frost Aug 02, 2006, 06:58 AM Sounds like the corpses need to be a resource instead of a feature, because the appearance of corpses shouldn´t destroy the present features.
Gerikes Aug 02, 2006, 07:02 AM Sounds like the corpses need to be a resource instead of a feature, because the appearance of corpses shouldnīt destroy the present features.
Hmm. I didn't think about that. That's probably a good choice. You don't get to have your 3D corpses, but I don't think that it's too important.
Duke van Frost Aug 02, 2006, 07:08 AM actually, resources are also in 3d ;)
Civmansam Aug 02, 2006, 07:11 AM Now I understand, I had done it onCombatResult, but unit killed is a better choice.
If I make it a recource, will it be like this?
def onUnitKilled(self, argsList):
'Unit Killed'
unit, iAttacker = argsList
player = PyPlayer(unit.getOwner())
attacker = PyPlayer(iAttacker)
# Spawn corpse start
iPercentChance = gc.getDefineINT("CORPSE_SPAWN_CHANCE")
if (iPercentChance > gc.getGame().getSorenRandNum(100, "Corpse spawn") ):
# Success. Spawn corpse
unit.plot().setRecourceType(gc.getInfoTypeForStrin g("RECOURCE_CORPSE"), -1)
# Spawn corpse finish
Duke van Frost Aug 02, 2006, 07:21 AM Ok, I thought about this again and if the corpses are a resource and there´s already a resource on the field, wouldn´t it also get deleted?
Or could an option be implemented that corpses can´t be "spawned" on a field where a resource is?
Gerikes Aug 02, 2006, 07:33 AM Ok, I thought about this again and if the corpses are a resource and there´s already a resource on the field, wouldn´t it also get deleted?
Or could an option be implemented that corpses can´t be "spawned" on a field where a resource is?
Wait, are we talking about the same "resources"? I thought of resources as you have Food, Production and Commerce. Now, you can add "Corpses". Only now I realize that those are "Yields", not resources. My bad :P
If you mean resources as in Bonuses, then yes, you have the same problem as with the features. You'll also have the same problem with improvements too.
I was thinking along the lines of making each corpse add to a Yield value, so you can look at the field and see your Food, Hammers, Commerce and Gravestones or something. It would be easier to implement graphically (I'm assuming, since I've never really done it but I know that you can have more than one yield value per square so I see no reason why not). The problem I see with this is that a user can't see corpses unless they turn on their yields for the whole map, which might get kind of annoying.
@ Civmansam:
Well, that won't work, since in Civ4 there are no such things as "Resources". I think Duke was talking about Bonuses, and I was talking about Yields.
Try to do it just with the setFeature like I had and see if you can get it to work that way, just to make sure that we can fill in the "setFeature" with whatever we want to later.
Duke van Frost Aug 02, 2006, 07:39 AM The corpses are meant to be raiseable (?!?) by Necromants, Liches, etc and can even come to live on their own (chances are higher if your workers try to bury them before the enemy can raise them - never disturb the dead!). So I don´t think that a yield would work, and yes, I was talking about resources as in bonuses.
Civmansam Aug 02, 2006, 07:51 AM Wait, are we talking about the same "resources"? I thought of resources as you have Food, Production and Commerce. Now, you can add "Corpses". Only now I realize that those are "Yields", not resources. My bad :P
If you mean resources as in Bonuses, then yes, you have the same problem as with the features. You'll also have the same problem with improvements too.
I was thinking along the lines of making each corpse add to a Yield value, so you can look at the field and see your Food, Hammers, Commerce and Gravestones or something. It would be easier to implement graphically (I'm assuming, since I've never really done it but I know that you can have more than one yield value per square so I see no reason why not). The problem I see with this is that a user can't see corpses unless they turn on their yields for the whole map, which might get kind of annoying.
@ Civmansam:
Well, that won't work, since in Civ4 there are no such things as "Resources". I think Duke was talking about Bonuses, and I was talking about Yields.
Try to do it just with the setFeature like I had and see if you can get it to work that way, just to make sure that we can fill in the "setFeature" with whatever we want to later.
Ahh so it would be setBonusType. I forgot that the XML calls them bonuses while the game calls them recources. I'll try both and see what I can do. Thanks for the help!
Gerikes Aug 02, 2006, 08:18 AM The corpses are meant to be raiseable (?!?) by Necromants, Liches, etc and can even come to live on their own (chances are higher if your workers try to bury them before the enemy can raise them - never disturb the dead!). So I donīt think that a yield would work, and yes, I was talking about resources as in bonuses.
That's what I assumed. Even still, it shouldn't be too hard to be able to say "changeCorpseCount" and be able to add and subtract all you want. The fact that it's graphically being shown as a yield doesn't mean that it will act like one.
Of course, finding a way to do it outside of using yields would probably be more preferred. When I'm working on whatever I end up doing today I'll see what I can make of determining when plots are redrawn. Who knows, we might even be able to make it a resource/unit/whatever and not have to attach it to a plot, but we can just place it on the map whenever the plot is drawn.
Ploeperpengel Aug 02, 2006, 08:23 AM Actually Corpes should work like Fallout (and more) see this post:
http://forums.civfanatics.com/showpost.php?p=4255868&postcount=19
I try get get some links for yor other questions too. Great to have you here Gerikes:)
Gerikes Aug 02, 2006, 08:34 AM Actually Corpes should work like Fallout (and more) see this post:
http://forums.civfanatics.com/showpost.php?p=4255868&postcount=19
I try get get some links for yor other questions too. Great to have you here Gerikes:)
That's what I like to see. Exact numbers and data! :P
But, and I just have to ask, you do realize that if you make it like fallout you run the risk of generating "corpses" that will take down forests, jungles, oases, etc.?
Ploeperpengel Aug 02, 2006, 08:39 AM Well maybe not exactly like Fallout more the way waste/pollution in civ3 works;)
Simply an overlay on the tile that disables all the production of it until it's cleared of. And those other special effects.
The normal Fallout we could still use for something like Warpenergy so no simple replacement.
Ploeperpengel Aug 02, 2006, 09:27 AM Adding xmltags on buildings for Unitcombattypeproduction increasement just is on hold cause Olleus concentrated on other stuff. We definitly need that.
Can you give examples of events that happen that spawn Characters/Hereos? Is it a random event, something where the user knows it will happen when they attain a goal, etc?
You can check the Heros thread for ideas but the design is just started maybe later.
Psychology is Olleus' baby leave it to him;)
To be clear, Chaos gets +20% to all units that are alive for the duration of the GA? Or does the bonus only get put on newly built units? Also, what is implied by "more aggressive"? Will they be more wiling to start a war, or just be more aggressive in wars they're already in?
The first. All units during the duration of GA was intended. But I'm still not sure of it. Maybe just another unitproductionboost by 50% and no buildingproduction instead-but maybe we should discuss this further.
I could probably work on this. If someone could provide just a bit of info on exactly what the effects of "peaceweariness" are. Is it exactly the same as the effects of Warweariness (only backwards) such that you just get more unhappy citizens? Also, how does it get accumulated? I'm not sure on this, but doesn't Warweariness accumulate due to losing units? Should Peaceweariness occur when the Civ is not at war, or do they also need to be losing units at the same time?
Last thing I remember it should be about half the effect of Peaceweariness and only accumulated by turns the orcplayer is not at war at all. I think as soon we have Animosity(psycholgy-chance that orcs fight themselves insteed of the enemy) it would be possible to lose units during peacetime though and I think not being at war with another civ should increase that chance drastically and then would it also be possible to have peaceweariness increased by casualties. I think we need animosity first and put this into a combined package.
Any links to how "support fire" would work?
Defensive Bombardment like in civ3 the archers had.
Is it possible to just make all the improvements, and replace the worker unit's list of available builds for each Race to build that improvement rather than the normal? That should just be XML, right?
Wrong. Highelfvillages should have a chance of spawning units i.e. like ancientforests can spawn tryants in FFH. That would just be a matter of incorporating the gamemechanic from FFH.
But other stuff may come too. Check this thread:
http://forums.civfanatics.com/showthread.php?t=178611
What consists of a "group of civs". Is this something that is Civ-related ("only these three civs can build this wonder") or in-game defined (This Civ made wonder X, now only it and it's allies can build wonder Y)?
Not settled for all civs yet. The idea is to have a bunch of wonders with similar effects like a Great Forge which can only be build like a worldwonder but should show different art and names for different civs. If the wonders is built by Elves it would be Vaults' Smithy if by Orcs: "Da big noisy ting dat makez uz da arma" in example.
Gerikes Aug 02, 2006, 09:28 AM Well maybe not exactly like Fallout more the way waste/pollution in civ3 works;)
Simply an overlay on the tile that disables all the production of it until it's cleared of. And those other special effects.
The normal Fallout we could still use for something like Warpenergy so no simple replacement.
Well, if it goes that far, you might be able to implement a stack where a corpse is pushed on top, and when it's finally popped off due to one of the ways that they are removed, then the old features takes over once again. It might be a bit weird having a forest disappear, a "corpse" placed on top, then when the corpse is gone the forest reappear again...
Ploeperpengel Aug 02, 2006, 09:33 AM Yes the forest shouldn't dissappear if possible just not give the shields.
Ploeperpengel Aug 02, 2006, 12:37 PM Another request I have is adding the combatzoom function of Roger-Bacons flying mod. Seems we have the flying only version integrated(not bad we don't need his other features) but the combatzoom while defending is a must have otherwise you don't recognize the combat with our scale.
Duke van Frost Aug 02, 2006, 12:47 PM Didn´t know that there was a nmod for this out there, bug that bugged me also.
Ploeperpengel Aug 03, 2006, 01:05 PM One more small thing:
unitclass_scout and unitclass_explorer needs to be enabled to build camps. Currently they need some billion turns to do it that's kind of slow imo. It should be the normal rate of workers. another way could be to sacrifice them to build a camp(even outside of your borders) whatever is easier. If's only xml please tell me where to look. Thx
Lord Olleus Aug 03, 2006, 01:08 PM thats an xml only thing I believe. Isn't there n wml tage in Civ4UnitInfos.xml that does this?
Ploeperpengel Aug 03, 2006, 01:12 PM I can make entries for units to build improvements there however it seems the nr. of turns isn't calculated correctly. I thought maybe the unitclass_worker is somewhere linked to mission build with more details to define that.:confused:
Maybe this?
CvEnums.h-
Ploeperpengel Aug 03, 2006, 01:21 PM Ah no your right there is a tag iworkrate just found sorry:mischief:
Ploeperpengel Aug 05, 2006, 09:14 PM I included the code for Homelandpromotion/Defender-trait in CvEventmanager onunitmove.
Make sure that doesn't get lost as soon you guys work on that file(uploading with version 8 of the WH test-mod).
Gerikes Aug 05, 2006, 10:55 PM Defensive Bombardment like in civ3 the archers had.
Just checking on this, 'cuz I can't remember exactly:
How does this work for a stack of units? If there is more than one unit with the "Support Fire" ability defending, do they all do their support fire, or only one? If another unit attacks that plot, can that same unit do another support fire, or does another support fire unit have to take up the task. Likewise, if a plot already had one unit use it's support fire option, can any other unit use the support fire option that turn? Finally, what represents a turn? Is it a player's turn, or the unit's player's turn. In other words, if player1 gets attacked by player 2 and unit X uses support fire, then on player3's turn the same plot is attacked, can unit X still use support fire?
Any other scenarios I should know about? Really, the battle mechanisms are the part I still haven't dug deep into, so this would be an interesting challenge.
Ploeperpengel Aug 05, 2006, 11:34 PM Just checking on this, 'cuz I can't remember exactly:
How does this work for a stack of units? If there is more than one unit with the "Support Fire" ability defending, do they all do their support fire, or only one? If another unit attacks that plot, can that same unit do another support fire, or does another support fire unit have to take up the task. Likewise, if a plot already had one unit use it's support fire option, can any other unit use the support fire option that turn? Finally, what represents a turn? Is it a player's turn, or the unit's player's turn. In other words, if player1 gets attacked by player 2 and unit X uses support fire, then on player3's turn the same plot is attacked, can unit X still use support fire?
Any other scenarios I should know about? Really, the battle mechanisms are the part I still haven't dug deep into, so this would be an interesting challenge.
In civ 3 I think it works like this(If not I'd like it like this-but as suggestion):
Every unit that has the ability gets exactly 1 supportfire shot per turn. A turn would be one gameturn from the players turnstart to his next turnstart. Support fire is a reaction to an attack. Every attack causes one unit in a stack to give support fire and uses it up for the rest of the turn. That means the max support fire one unit can have is 1 from the end of its move until its next movephase.
Hope this helps.
Gerikes Aug 06, 2006, 08:23 AM In civ 3 I think it works like this(If not I'd like it like this-but as suggestion):
Every unit that has the ability gets exactly 1 supportfire shot per turn. A turn would be one gameturn from the players turnstart to his next turnstart. Support fire is a reaction to an attack. Every attack causes one unit in a stack to give support fire and uses it up for the rest of the turn. That means the max support fire one unit can have is 1 from the end of its move until its next movephase.
Hope this helps.
Ok, one more question!
Is a support fire shot an automatic hit, or should it work just like any first strike shot with a chance to miss?
Edit: I lied. Can a unit retreat during the support fire shot round?
Ploeperpengel Aug 06, 2006, 08:28 AM In civ it works like bombardment. A firststrike won't do much difference in WH since so many units have them. I think here too it should work like bombardment.
Gerikes Aug 06, 2006, 09:00 AM In civ it works like bombardment. A firststrike won't do much difference in WH since so many units have them. I think here too it should work like bombardment.
Ah. That's possible too. I was thinking that it works like a first strike but one that automatically hits, and the other unit can't respond to. But I think collatoral damage would be more fun :P
I'll throw in some other XML values so that it works just like the collateral damage XML values work, but you won't be giving archers collateral damage like normal artillary units. Maybe I'll even find time to spell collateral correctly on my first attempt.
Ploeperpengel Aug 06, 2006, 09:20 AM Heh, yeah collateral damage that was what I thought of too. Archers could cause some but much less than artillery of course:D
seZereth Aug 07, 2006, 07:59 AM Heh, yeah collateral damage that was what I thought of too. Archers could cause some but much less than artillery of course:D
in my eyes you need a huge amount of ancient artillery to inflict as much collateral damage as one or 2 regiments of Archers can do in the same time ;) but thats not what we want to discuss :p
Gerikes Aug 07, 2006, 08:14 AM Just for completion's sake, a thread dedicated to Support Fire can be found here (http://forums.civfanatics.com/showthread.php?t=181187).
Lord, could you please update your second post? Thanks.
Lord Olleus Aug 08, 2006, 07:20 AM Updated it. Do you think you will still have much work on it, graphics/debugging wise?
And thanks for taking so;e of the workload off me ;)
Gerikes Aug 08, 2006, 07:35 AM Updated it. Do you think you will still have much work on it, graphics/debugging wise?
And thanks for taking so;e of the workload off me ;)
Thanks for that.
I don't think I'm going to do the graphics, since it's so much work and so much chance of causing crashes for such a little thing. The fact that you get a big, red message and even a pointer to the plot I think should be good enough.
Lord Olleus Aug 08, 2006, 07:41 AM OK, thats fine for me. Just needed to know for the first page.
Duke van Frost Aug 08, 2006, 07:44 AM I don´t know what the others think about this, but I think it would be good that way, so it has some similarities to the Support-Fire concept. That would keep the whole mod more simple and one wouldn´t have to get used to too much new and complex systems.
Gerikes Aug 08, 2006, 08:13 PM So, wha'ts the plan going to be for file merging for the SDK? Now that there are multiple programmers doing SDK work, any strategy to stop from stepping on others toes?
Ploeperpengel Aug 08, 2006, 08:19 PM I will open a thread for the Cvgamecoredll. In the first post will be the current file any adds should be merged to that in following posts. This way we can keep track of working versions and preserve them for anyone if problems occur.
Ploeperpengel Aug 08, 2006, 08:53 PM Ok the thread is there think it could work this way?
Gerikes Aug 08, 2006, 09:01 PM I would think so. The only problem is if say I were to make a large change, then upload it, then the next person has been making changes all along to their sources and now have to merge my own. However, no matter what you'll have this problem. A program like CVS or SVN could handle many of the merges for you, but I think for the majority of the time we're probably going to be staying out of everyone's way. Lord's mostly creating new code for the spells, which I'm staying away from.
I say see how it goes for now. Also, it's probably important to keep the sources up to date with the DLL's too.
Ploeperpengel Aug 08, 2006, 09:16 PM I could upload the C++ folders also no problem but I'm not sure if I am up to date with those too. I only received the dll lately but no sources I think it's best you guys upload what you have each time you change anything there too.
And don't hesitate to open another programmers only thread where you explicitly make us python-is-a-snake-idiots shut up to debate problems with the coding:p
El Loco Mono Aug 09, 2006, 07:27 PM Give Orcs & Goblins peaceweariness [not started]
I'm intrigued by this idea and wouldn't mind have a look into getting it working if it hasn't been lined up by anyone else yet.
Would the Peaceweariness be like the reverse of warweariness and creates unrest when at peace (so we would have to have a race trait that reduces warweariness by -100% or else no one is ever happy) or gives happiness when at war?
Also what triggers would affect it? (e.g. WW has if UNIT KILLED, WW increases, is there going to be similar triggers for PW?).
Gerikes Aug 09, 2006, 07:52 PM Hey El Loco Mono. I like the Fur thing, hopefully it will add a little spice to the early game. I've always tried to put myself next to an animal but in a very well defendable position, but now it will be more worthy to actually attack, so it opens up some decisions for the player. I think this might have been able to be done in python (using the onCombatResult python callback). I know you said you were worried that you might go overboard on the SDK stuff :P
I'm wondering if we might be able to make that hardcoded 7 something that can be set in the global defines, that way people can change it without having to recompile.
I'm intrigued by this idea and wouldn't mind have a look into getting it working if it hasn't been lined up by anyone else yet.
Would the Peaceweariness be like the reverse of warweariness and creates unrest when at peace (so we would have to have a race trait that reduces warweariness by -100% or else no one is ever happy) or gives happiness when at war?
Also what triggers would affect it? (e.g. WW has if UNIT KILLED, WW increases, is there going to be similar triggers for PW?).
Here's what Ploe was saying when I asked earlier:
Last thing I remember it should be about half the effect of Peaceweariness and only accumulated by turns the orcplayer is not at war at all. I think as soon we have Animosity(psycholgy-chance that orcs fight themselves insteed of the enemy) it would be possible to lose units during peacetime though and I think not being at war with another civ should increase that chance drastically and then would it also be possible to have peaceweariness increased by casualties. I think we need animosity first and put this into a combined package.
What I gathered from that was that the idea hasn't been fully developed yet to be coded :P
El Loco Mono Aug 10, 2006, 01:17 AM Hey El Loco Mono. I like the Fur thing, hopefully it will add a little spice to the early game. I've always tried to put myself next to an animal but in a very well defendable position, but now it will be more worthy to actually attack, so it opens up some decisions for the player. I think this might have been able to be done in python (using the onCombatResult python callback). I know you said you were worried that you might go overboard on the SDK stuff :P
Cheers for the feedback Gerikes,
Hmmm, indeed, I might look at the python and see if I can shift out the function work as I would like to keep my work tidy and inline with the mod design (wahoo my first python code ever maybe...), but your right, this is the type of thing (changing the SDK instead of the python ) I'm liable to do at the moment. Is the general rule, if no new functions are needed, it can be done in Python?
I agree on the constant in the global defines file - I just got the SDK a few days ago and haven't got round to looking at all the files and how to link changes together yet (including this one - I only get 2 or 3 hours max to look into the mod stuff a day), it's why I was looking for a decent chuck of work to "explore" the code with.
So we are waiting on animosty - may I ask if this is being done by anyone yet? As long as I know the idea of how it will work I'm quite happy to go for it.
Ploeperpengel Aug 10, 2006, 06:52 AM @E.L.M.
I would be happy if you gave it a start.:)
I think Olleus wanted to do most of the psychology but that didn't inlude animosity yet.
It would be cool to have animosity as a boolean tag in the promotions xml. With another tag there to set the percentage chance for it to take effect. And a third to define single units(unit_goblinarcher and unit_goblinspearman etc.) that could provoke animosity for the unit which has that promotion.
Promotions info because: I can define a lot of changes on unit combats, firststrikes there etc.
The game should check each turn onunitmove if one of the units defined are in an adjacted square. If yes the percentage chance should be checked and if the result is true the promotion should get active(only there all of the boni/mali defined in the promtionxml should apply) and the unit affected by animosity does the following by chance:
1.)1-80% stand immobile this turn(a message in the log about the internal squabble should pop up)
2.)81-90% the unit attacks the friendly unit that caused animosity.(Get'em!)
3.)91-100% the unit immediatly attacks the nearest enemy unit(or just rushed towards it if cannot reach) receiving an additional +1Movement during this process.(We'll show 'em!)
This chances could be modified to:
1.)1-80%(Squabbling)
2.)81-100%(Get'em!)
if the civ is at peace with everyone.
Edit: btw thx for the animals and stacks- included in the latest patch. I'm going to test now:)
seZereth Aug 10, 2006, 08:58 AM ... just wanted to say, that i am very very happy, that we have you programmers on board, now the mod will get some more uniqueness in an even shorter amount of time than i ever dreamed of!!!
keep on the good work!!!
El Loco Mono Aug 10, 2006, 04:15 PM I'm wondering if we might be able to make that hardcoded 7 something that can be set in the global defines, that way people can change it without having to recompile.
I set up the constant in the Global defines folder, by I won't upload the changes until I've got the basic Animosty code working (is about 40% done - but I should get some testplaying on v9 done first, that was what my orinal input was supposed to be ;) ). The changes were small so if anyone is interesting there here:
In CvPlot::isUnitSpace function
ORIGINAL :: if (iNumUnits >= 7)
NEW :: if (iNumUnits >= (GC.getDefineINT("STACK_SIZE_MAX")))
Also in the Global Defines
<!-- Controls the stack size limit -->
<Define>
<DefineName>STACK_SIZE_MAX</DefineName>
<iDefineIntVal>7</iDefineIntVal>
</Define>
Why is there a maximum stack size?
Sorry Lord Olleus, it was a continued discussion from the test feedback. In retrospect I should have posted the plans in this thread first and waited for some feedback. But with the Global define you could set a stupid huge number so it wouldn't matter. And yes, the domain (sea, air, land) is taken into consideration when counting the units in the stack (so you could have 7 galleys each with 7 units in the same plot)
Gerikes Aug 10, 2006, 04:38 PM But with the Global define you could set a stupid huge number so it wouldn't matter.
Perhaps maybe just for arguments sake that someone might have a stupid huge number of units we can make a value of -1 mean no limit?
:P
Ploeperpengel Aug 11, 2006, 12:31 AM @E.L.M.
I like that new type of "playtestfeedback":D
@Olleus
1.)Why should a stacklimit make collateral damage unattractive? I think on the contrary you really get a chance to wype a stack out.
2.)A city has 8 tiles surrounding it and this gives a maxnumber of 56 units being able to attack in one turn(not counted cavalry that can pass tiles after some units of the stack were killed-not to mention elves). I have no doubt capturing a city should be possible with this.;)
Gerikes Aug 11, 2006, 01:12 AM @Olleus
1.)Why should a stacklimit make collateral damage unattractive? I think on the contrary you really get a chance to wype a stack out.
2.)A city has 8 tiles surrounding it and this gives a maxnumber of 56 units being able to attack in one turn(not counted cavalry that can pass tiles after some units of the stack were killed-not to mention elves). I have no doubt capturing a city should be possible with this.;)
I thought LO was talking more about how collateral damage and SF will make stacks unattractive already without having to implement a stack limit.
Personally, I don't like the idea of a stack limit, since I think capping a stack is a pretty drastic change. I think that if people want to have a SOD, then let them have it, but make sure that a player that has better management of their units by properly spreading them out and flanking and such will have an easier time. I think you'd be alienating all your hardcore SOD players by disallowing them to exist, when all you really want to do it make it tougher for them.
Ploeperpengel Aug 11, 2006, 07:01 AM Ah ok misunderstood the first point then it seems. Still it's a good way to make the AI spreading out its forces imo.
Well whatever it will be configurable and I can write how to change the stacklimit into the mod's readme that should be enough don't you think?
Duke van Frost Aug 11, 2006, 05:27 PM The idea of Stack-limitations brings me to another idea (and it´s really just an idea):
What about limiting the units on one plot to WH like Armies?
This would, as far as my opinion is concerned, not mean to limit one plot to a maximum number of units, but maybe limit one plot to percentages of units like they are defined in WH (Core, Special, Rare etc.) this may include a new tag for UnitInfos.xml like "<WHUnitType>Core</WHUnitType>"
That way we could maybe actually implement the idea of "Special, rare..." units?
Ploeperpengel Aug 11, 2006, 05:38 PM Hm I think this would be to complicated for the player. He would be wondering all the time why he can't stack certain units and we'd get a lot of stupid bugreports.
But we indeed need a concept more flexible than national units to restrict building of certain units in general. I prefer seeing all troops of a player as the army (not a single stack) where rare and special choices should get a percentage count to trigger their buildability.
Duke van Frost Aug 11, 2006, 06:04 PM In this case we should make sure, that the units that are most-permanently stationed in the players cities are not only counting towards the core units (like only stationing Archers [which might be core-units] in cities) but also towards either special- or rare-units. So a player can´t only attack with those special- rare-units like Silverhelms, Seaguard etc.
But I got no clue how we could do this?!?
Ploeperpengel Aug 11, 2006, 06:11 PM Huh? Wasn't my intention to restrict the units you can attack with just restrict their buildability(just the idea of the old thread)
Duke van Frost Aug 11, 2006, 06:26 PM yepp, I think you didn´t really understand me here.
let´s say A player builds 100 units - 10 % are rare - 20 % are special - 5 % are champions, heroes, whatever.
So he has 35% "unique" units.
65% of his units are core.
but 40% of his total units are stationed in his cities permanently (keeps them there for defence, happyness, reserve, whatever). But almost all of those units are Archer-types (because they are the best for city-defense).
Then the total % of "unique" units that the player actually uses on the battlefield/frontline will drastically increaese (because the normal units aren´t used for warfare but only for city defense)!
Gerikes Aug 11, 2006, 06:44 PM yepp, I think you didnīt really understand me here.
letīs say A player builds 100 units - 10 % are rare - 20 % are special - 5 % are champions, heroes, whatever.
So he has 35% "unique" units.
65% of his units are core.
but 40% of his total units are stationed in his cities permanently (keeps them there for defence, happyness, reserve, whatever). But almost all of those units are Archer-types (because they are the best for city-defense).
Then the total % of "unique" units that the player actually uses on the battlefield/frontline will drastically increaese (because the normal units arenīt used for warfare but only for city defense)!
Perhaps we need a new thread on this? I think it also kind of ties in the discussion of stack limits as well.
Ploeperpengel Aug 11, 2006, 07:52 PM Yes seems better. Maybe we also should have seperate threads on every single gamechange that involves SDK and Pythonchanges. This thread is getting long already and it seems easy to miss things.
Ploeperpengel Aug 12, 2006, 09:13 AM @E.L.M.
Stacks of 7 units can't be attacked any more can you fix that asap?
Gerikes Aug 12, 2006, 10:54 AM @E.L.M.
Stacks of 7 units can't be attacked any more can you fix that asap?
Elm doesn't appear to be online, so I'll upload a fix. It'll also include the stack limit put into the GlobalDefinesAlt.xml file.
Ploeperpengel Aug 12, 2006, 11:17 AM thx, Gerikes!
El Loco Mono Aug 12, 2006, 03:25 PM Sorry, I was away with work and didn't access to Civ or the code. Cheers Gerikes for putting the define and the fix in.
OK, should get some testing feedback tomorrow but first some comments on Animosity:
It would be cool to have animosity as a boolean tag in the promotions xml. With another tag there to set the percentage chance for it to take effect. And a third to define single units(unit_goblinarcher and unit_goblinspearman etc.) that could provoke animosity for the unit which has that promotion.
Promotions info because: I can define a lot of changes on unit combats, firststrikes there etc.
The game should check each turn onunitmove if one of the units defined are in an adjacted square. If yes the percentage chance should be checked and if the result is true the promotion should get active(only there all of the boni/mali defined in the promtionxml should apply) and the unit affected by animosity does the following by chance:
1.)1-80% stand immobile this turn(a message in the log about the internal squabble should pop up)
2.)81-90% the unit attacks the friendly unit that caused animosity.(Get'em!)
3.)91-100% the unit immediatly attacks the nearest enemy unit(or just rushed towards it if cannot reach) receiving an additional +1Movement during this process.(We'll show 'em!)
This chances could be modified to:
1.)1-80%(Squabbling)
2.)81-100%(Get'em!)
if the civ is at peace with everyone.
Results so far: I've got Squabbling working fine. Get'em works OK, but I've got a couple of issues when 2 stacks of 2 units or more are near each other, as after the First Get'Em, another unit trys to attack where the old unit was. Doesn't crash but in a debug popup you get an unknown C++ exception. Show'Em hasn't been started because I wanted some more info. All animosity actions force a finishmoves() on a unit
Questions:
Show'em - Should there be a limit of how far away a unit is for Animosity unit to charge it? Say, max moves + animosity bonus move + 1?
If that unit is in a neutral territory, do we attack and declare war against the neutral?
Notes:
I set the Animosity trigger to be based off Promotion rather than unit class, or else an Orc would only be affected by that exact same type of orc (Axemen would ignore non Axmen)
Also, I don't trigger Animosity for units in the same plot as attacking the square you are in is a problem at the moment
I'm triggering the animosity check for everyunit on every turn (made a custom event on CvUnit::doTurn), as a unit that is not moving should still have to "roll" for animosity no? Also trigggering at onUnitMove (unless someone can tell me) gives me problems finding out where the unit came from to send back on a Squabble action.
This took a bit longer than I wanted (wanted to finish it today) but I'm trying to get most of it in Python and I ran into quite a few beginer errors in my First Every Python Script. Especially finding out onBeginPlayerTurn is in fact at the end of the last turn :crazyeye:
Anyway, any feedback will be highly appreciated. I'll post an upload once I have the kinks out of the Get'em Effect if everyones happy. The Show'em can come later.
Psychic_Llamas Aug 12, 2006, 06:56 PM Well, i really love those animosity ideas, they are all exactly whats in the orcs armybook, but i think that there should also be a chance to get a good result from animosity, say the affected unit get a temporary 'enraged' promotion which lasts untill he next attacks. this gives that unit some % of extra strength, or a blitz like ability. this promotion would mean that the animosity trait for orcs wont deter people from playing them, becaue thier units wont ALWAYS be arguing amongst them.
Which brings me to another point: when do orcs get affected by animosity? is it only during peace time? only during war? or all the time? i wold way only during peace, as it would make them more war like.
(i apologiseif thats already been said, i think it has, but oh well. :p)
@E.L.M. great work there, keep it up:thumbsup:, i think Show'em should only allow the unit to charge nay enemy in thier line of sight. so if the can see an enemy unit 4 squares away, and that is the only one they can see, they will charge that. but if there is another one, 2 squares away, they will charge that one instead because it is closer.
El Loco Mono Aug 13, 2006, 01:20 AM Well, i really love those animosity ideas, they are all exactly whats in the orcs armybook, but i think that there should also be a chance to get a good result from animosity, say the affected unit get a temporary 'enraged' promotion which lasts untill he next attacks. this gives that unit some % of extra strength, or a blitz like ability. this promotion would mean that the animosity trait for orcs wont deter people from playing them, becaue thier units wont ALWAYS be arguing amongst them.
Which brings me to another point: when do orcs get affected by animosity? is it only during peace time? only during war? or all the time? i wold way only during peace, as it would make them more war like.
Thanks for that feedback PL.
Curious though, if we only trigger animosity during peace time, whats the use of a Positive Bonus like +% str or blitz? You can't use it against anyone, also we couldn't use the Show'em, as there would be no one to attack. What do people think? limit to peace time or all time animosity checks?
Another easy effect is to code is to disband the unit from animosity as well (fit with - only in peace time idea), but since it wasn't in the list i haven't done it. If we do add a promotion during animosity, can I request a uniuqe promotion? It will be easier to remove on the next turns animosity check if ther is a set of ANIMOSITY_TYPE promotions I can load in a check list
EDIT: Also, do we want a "Quell Animosity" unit ability / promotion ability. For example, on promotion of combat 3, unit is now immune to Animosity or because unit is in adjacent square unit is immune to animosity
Duke van Frost Aug 13, 2006, 07:07 AM My opinon is that animosity should be active all the time (during peace and war).
Orcs got the Whaagh!, which makes their units even stronger, to compensate for animosity.
A promotion like "Highly Disciplined" would be a good idea, that negates effects of animosity, but that should be an extra promotion and only available after the unit has some other promotions already and is at a very high level.
Psychic_Llamas Aug 13, 2006, 07:36 AM :lol: very good points E.L.M. i didnt think about not being able to use the promotion or 'Show'em' during peace, and i forgot about the Whaaagh!, so therefore i change my vote from 'peace only' to 'constant animosity':p.
I like the idea of orcs being able to get a 'highly Disciplined' promotion (though i think a more orcy name would be better;)) to make them immune to animosity. perhaps make combat 3 and Whaaagh! 1 prerequisits. also make some unique units start with this promotion such as the Black orcs.
perhaps also give the orcs a special building which reduces animosity in units fortified in cities, call it the Dueling Arena. and it could also decrease peace wearyness somewhat.
Duke van Frost Aug 13, 2006, 07:44 AM The idea about the building for orcs is a realy good one! I like it very much.
could be the "'eadbutt Gathering" or something like this, if you want to go for orcy names ;)
Psychic_Llamas Aug 13, 2006, 07:47 AM Yay! now its my turn for a good idea!;)
howabout 'eadsmashin' pit' or 'eadbutt arena' or 'eadbutt gallery'? :D
Ploeperpengel Aug 14, 2006, 08:24 AM Ok guys please switch the debate on animosity here:
http://forums.civfanatics.com/showthread.php?t=182191
This thread gets to big.;)
Ploeperpengel Aug 14, 2006, 01:01 PM @Olleus, Gerikes or E.L.M.
Can one of you please integrate the Lopez updated version of the Water Animals mod?
The version gives control about how much Kraken get spawned so we can finally have early seafaring and Kraken the same time.
And please also someone integrate the camerazoom from Rogerbacons combined Flying mod and the Firststrikefix from Lunar Moongoose!!!
This is all needed asap. Rest can wait until after release.
El Loco Mono Aug 14, 2006, 02:25 PM I know we don't want this thread to grow too much, but while I was doing the animosity I was thinking about the idea of Routeing (sp?). My idea was, if a unit is killed in an adjacent tile, then on the unit killed trigger, do the "panic" role for each of the surrounding units based on a new leadership unit tag of the highest unit on that plot, and try to move away from the nearest enemy (this may put them closer to another enemy but hard luck). Routeing during a fight, I'm not too sure of yet. I think I need to understand updatecombat() a little more first. Also, we might need to give them a promotion "Panic" that effects them until the end of the next turn - no moves, or lower strength, etc. We could also us the GreatGeneral mod to give leadership bonus promotions instead of the first strike and strength promotions it gives now. Or maybe both. Triggering panic from panic might be a bit more interesting. Just throwing ideas really.
Ploeperpengel Aug 14, 2006, 02:38 PM Sounds nice to me I'm all for it. However this probably is better off in the panicthread;)
Duke van Frost Aug 23, 2006, 01:05 PM I keep on wondering why I do not get Gold when I succesfully defend against animals. It seems like one only gets the money if he succesfully attacks.
Seems not too logical to me, you can also get the fur from the animal if you got attacked - I think we should change that.
El Loco Mono Aug 23, 2006, 01:36 PM I keep on wondering why I do not get Gold when I succesfully defend against animals. It seems like one only gets the money if he succesfully attacks.
Seems not too logical to me, you can also get the fur from the animal if you got attacked - I think we should change that.
Yeah, i fixed that in the latest code upload. The money was actually going to the Barbs for sacrificing the animal - whoops
Ploeperpengel Aug 23, 2006, 06:40 PM @Olleus, Gerikes or E.L.M.
Can one of you please integrate the Lopez updated version of the Water Animals mod?
The version gives control about how much Kraken get spawned so we can finally have early seafaring and Kraken the same time.
And please also someone integrate the camerazoom from Rogerbacons combined Flying mod and the Firststrikefix from Lunar Moongoose!!!
This is all needed asap. Rest can wait until after release.
Bump:bump:
Gerikes Aug 23, 2006, 06:50 PM Bump:bump:
I might have some time tomorrow to do those.
Also, I was wondering what your thoughts are on the conversion to Warlords. I know you said that it was probably in the mod's best interest as it seems to be able to support higher number of units better, but just realize that this means that the SDK will need have all the changed code brought over to the Warlords SDK. I'm not sure exactly what that entails, not having Warlords, but I think it would be a better idea to do it earlier rather than later if that is a definite plan.
Ploeperpengel Aug 23, 2006, 06:54 PM Thx Gerikes.:)
Conversion to Warlords is top priority indeed. I want to go for that asap as well. But we will definitly have to wait until all you pythonwizards have it;)
Gerikes Aug 24, 2006, 04:02 PM Thx Gerikes.:)
Conversion to Warlords is top priority indeed. I want to go for that asap as well. But we will definitly have to wait until all you pythonwizards have it;)
Here's my problem. I don't see the point of putting any more code that modifies the game into the SDK (such as these fixes) if we're going to have to do them all over again. Things like the SF, animosity and the spell system are fine to work out, because the spell system is all python or seperate functions (it'll just be a matter of finding the right place in the new system for the calls to those new functions), and ELM has done a great job making it all seperate python as well, which will help greatly when the conversion takes place. But as for taking lines of code from here and there and putting them in, then testing to make sure it all works, it's all going to have to be done all over again anyway. So long as they're are not show-stoppers, I don't see the reason to put them in now.
Ploeperpengel Aug 24, 2006, 04:51 PM Here's my problem. I don't see the point of putting any more code that modifies the game into the SDK (such as these fixes) if we're going to have to do them all over again. Things like the SF, animosity and the spell system are fine to work out, because the spell system is all python or seperate functions (it'll just be a matter of finding the right place in the new system for the calls to those new functions), and ELM has done a great job making it all seperate python as well, which will help greatly when the conversion takes place. But as for taking lines of code from here and there and putting them in, then testing to make sure it all works, it's all going to have to be done all over again anyway. So long as they're are not show-stoppers, I don't see the reason to put them in now.
Ah ok makes sense I'm not aware how much code is involved for those. Thought them to be just a couple of lines copypaste work and recombiling.:mischief:
If's more complicated ok agreed let's put it into the warlordsversion then;)
Gerikes Aug 24, 2006, 05:11 PM Ah ok makes sense I'm not aware how much code is involved for those. Thought them to be just a couple of lines copypaste work and recombiling.:mischief:
If's more complicated ok agreed let's put it into the warlordsversion then;)
Well, I'm sure it is. The problem is that that one line is somewhere within a bunch of lines of code of the mod, and it's not the matter of putting the code in and recompiling as much as
A.) Finding what the code actually is that needs to be changed,
B.) Testing and making sure it works.
That, along with the fact that it's one more thing that everyone else who is working on the code needs to remember to put into their revision next time they post a reply to the DLL thread (of course, that could be solved by using some sort of code-managemnt system like CVS or SVN).
Ploeperpengel Aug 24, 2006, 05:21 PM Ok I leave this to you programmers to decide if it's worth the effort or not. I don't really mind if we get it into vanilla first or not. Since I'm not planning to release WH seperately for vanilla AND Warlords the only thing that really matters for me is that we get those features into the Warlords version;)
I will probably start working on the conversion as soon I'm back home(-> next wednesday)
Gerikes Aug 24, 2006, 05:25 PM Ok I leave this to you programmers to decide if it's worth the effort or not. I don't really mind if we get it into vanilla first or not. Since I'm not planning to release WH seperately for vanilla AND Warlords the only thing that really matters for me is that we get those features into the Warlords version;)
I will probably start working on the conversion as soon I'm back home(-> next wednesday)
Which reminds me... aren't you on vacation! Take a break!
As for the rest, I guess that would be Lord Olleus' call.
Ploeperpengel Aug 24, 2006, 05:42 PM Which reminds me... aren't you on vacation! Take a break!
As for the rest, I guess that would be Lord Olleus' call.
Heh, can't stop.:D I'm currently using the internet of a friend I'm visiting which gives me the opportunity to be here a couple of hours.
I think we should switch to Warlords asap. Since it's not only python and SDK that will produce double work otherwise but also xml(the unitinfos alone will be a real pain already, making any other files bigger for the vanilla mod will only increase the suffering imo).
Let's use the current release to hunt the remaining bugs but switch to warlords for all improvements we undertake. I notice there are still some ctds reported obviously not fixed yet. Let's concentrate on debugging those and afterwards start new workthreads for Warlords.
@Olleus
Especially this pythonthread is getting way too long imo the Warlordsconversion would be a good reason to start a new one really only for discussing problems with the code this time and switching all discussion for special requests to special threads like Animosity and Magic. Don't you agree?
Lord Olleus Aug 25, 2006, 04:27 AM I agree with you. About the warlord conversion I have stated my stand on it in your thread so we should talk about it there instead of here.
Lord Olleus Aug 25, 2006, 04:28 AM I know we don't want this thread to grow too much, but while I was doing the animosity I was thinking about the idea of Routeing (sp?). My idea was, if a unit is killed in an adjacent tile, then on the unit killed trigger, do the "panic" role for each of the surrounding units based on a new leadership unit tag of the highest unit on that plot, and try to move away from the nearest enemy (this may put them closer to another enemy but hard luck). Routeing during a fight, I'm not too sure of yet. I think I need to understand updatecombat() a little more first. Also, we might need to give them a promotion "Panic" that effects them until the end of the next turn - no moves, or lower strength, etc. We could also us the GreatGeneral mod to give leadership bonus promotions instead of the first strike and strength promotions it gives now. Or maybe both. Triggering panic from panic might be a bit more interesting. Just throwing ideas really.
See thread entitled 'psychology'.
|
|