1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

School system

Discussion in 'Civ4Col - Medieval: Conquests' started by Nightinggale, Aug 8, 2013.

  1. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    I started implementing the TAC school system, but I ran into a few issues. It's not technical difficulties, but rather what do we want from it?

    Basically the idea is that buildings and units have an int called iTeachLevel, which is set in XML. A unit can only be trained in a city if the iTeachLevel of the unit is less than or equal to the iTeachLevel of the building with the highest level built in the city in question.

    Buildings are as follows:
    1 Schoolhouse
    2 College
    3 University
    If a unit is set to level 3, then it can only be trained at universities while units at level 1 can be trained any of those 3 buildings.

    Now I start to wonder. Do we really want iTeachLevel in units? That would allow a pioneer at level 1 and a Muslim pioneer at level 3. Wouldn't it make more sense to place iTeachLevel in UnitClassInfo rather than UnitInfo?

    What should the teach level be for each unit? I looked around a bit and I'm not sure cloning the current needs would be the best. Maybe I should just finish this and deal with the actual XML settings later. Function first, then balance.

    Any other thoughts anybody would like to share before I actually code this? I want to make it right the first time, which is why I prefer inputs now rather than once I'm done with it. It's never too late, but deciding on the design is better done before I really start to code.


    Another thing. Adding iTeachLevel around 150 times to XML wasn't something I really wanted to do. I wrote a script to do it for me. I now have a script, which adds line A after lines ending with B in file C (it takes A, B and C as arguments). This adds the default value to all units within a few seconds and appears to be quite useful for any XML additions in the future. Is this a script people are interested in? If so I will clean it up and upload it somewhere. There is one catch though. It's written in bash, which mean it doesn't run natively in windows. However if I recall correctly TortoiseGit installs a bash shell.

    The same goes for the script, which I used to make XML name duplication asserts. Everything in CvXMLLoadUtilitySet.cpp is coded by a bash script. I can make this one available too if people want it.
     
  2. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,759
    Well, almost all moddable content is in unitinfos so probably best to keep everything there to avoid flipping between multiple files. (plus allows for customizability if you want a uniquely non-scholarly civ :p)
    That does sound like a useful script :cool: I downloaded XML Marker which helps with basic xml modding, but don't think you can add new tags across a file using it.
     
  3. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    Now that you mention it. It can also go the other way. There is nothing in the system, which prevents having say 5 levels of education. Having really different civs is more difficult to balance, but it can be done. Starcraft is fairly balanced even though the "civs" are anything but similar.
    Alternatively the different civ(s) could be AI only, in which case balance means something else. It's fairly common to have different rules for humans and AIs in games.

    Sounds like I should clean it up then. I should also clean up the name detecting script. I want to use it on RaRE. If somebody else wants to use it on some other mod, then it's just a bonus.
     
  4. Don Senglar

    Don Senglar Chieftain

    Joined:
    Nov 8, 2010
    Messages:
    76
    On one of the forums I read an interesting statement about the education system in Colonization. Here I made a rought translation into English (sorry for possible mistakes).

    P.S. Please, note all values are for marathon speed.
     
  5. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    4,446
    Location:
    Stuttgart, Germany
    The Education System of TAC (and RaR) works quite differently.
    The flawed system of Vanilla was replaced.

    To my opinion it is the best school system for Civ4Col that currently exists.
    (Which is probably the reason why Nightinggale wants to adapt it for M:C as well.)

    But maybe Nightinggale will come up with some further interesting improvements.
     
  6. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    The idea that some units takes longer to educate than others is not bad. However I can't figure out how that should be done in a way, which is compatible with the idea that you pick which unit to graduate when education is complete.

    Also when you quote another page, it would be good to include a link to that page. It's also incorrect to assume people here only know English. It's true for a number of people, which is why you should write in English, but skipping links because the page isn't in English is not the best choice.
     
  7. Don Senglar

    Don Senglar Chieftain

    Joined:
    Nov 8, 2010
    Messages:
    76
    Very sorry if I'm wrong but to my opinion both vanilla (1.01f) and TAC/RaR have practically the same school education system when you have to spend longer time to educate your unit to simpliest professions in School.

    The main difference between vanilla (1.01f) and TAC/RaR is the Learn by Doing system introduced in TAC/RaR. This is absolutely great addition!

    However, to my opinion LbD system has two problems. The main problem of LbD system is related to very low value of LBD_BASE_CHANCE_EXPERT that is equal to only 3%. You take into account that chance to be expert start to growth after LBD_PRE_ROUNDS_EXPERT equal to 30. As result the education process by LbD is unpredictable long. Fortunately, both parameters could be very easily changed in GlobalDefinesAlt.xml.

    The second problem of LbD is that chance_increase_expert and pre_rounds_expert in LbD are not correlated to learn_level. Of course, nobody can catch this small mistake if you study your unit by LbD during hundreds turns.

    To fix this small mistake I propose in CvCity.cpp after

    Code:
    			//get LearnLevel of profession
    			int learn_level = GC.getProfessionInfo(pLoopUnit->getProfession()).LbD_getLearnLevel();
    			// just for safety, catch possible XML mistakes which might break calculation
    			if (learn_level == 0)
    			{
    				learn_level = 1;
    			}
    to add couple lines:

    Code:
    			chance_increase_expert = chance_increase_expert / learn_level;
    			pre_rounds_expert = pre_rounds_expert * learn_level;
    Now both chance_increase_expert and pre_rounds_expert would depend on learn_level: the higher level, the longer education by LbD system.


    You are right, however, unfortunately I have only this text in my private notebook concerning a new education system in Colonization. I made this note for my personal use and never thought that somebody will be interesting to follow the source of information.

    Full text (I have in my notebook) is under spoiler:

    Spoiler :

    Новая система обучения.

    Отказ от свободного и неограниченного притока специалистов из Европы потребовал введения корректив в систему обучения в Новом Свете. Сейчас обучение возможно по трем типам:

    Тип 1: обучение колонистов среди туземцев. Эту часть я пока не трогал, она осталась практически без изменений.

    Тип 2: обучение в процессе работы.

    Это совершенно новый тип обучения и его я перенес из немецкого мода "ТАС 2.03", внеся ряд существенных дополнений и изменений.

    Логика в данном случае предельно простая. Колонист, прибывший из Европы и не имеющий никакой професии, начинает работать к примеру дровосеком. Если он занят без перерыва на этой работе, к примеру, 10 месяцев (1 ход = 1 месяц), то у него есть шанс стать профессиональным лесорубом либо сразу после непрерывного 10-месячного махания топором, либо с задержкой на 1-3 месяца. (ЗЫ, мне тоже приходилось валить лес, но нас - молодых тогда еще ребят - обучили этому делу максимум за час. Так что 10 месяцев это ооочень много, если сравнивать с реальной жизнью.)

    Если же колонист через несколько ходов занялся другой работой, стал к примеру строителем, то его счетчик обнуляется и расчет идет по новой. Если колонист меняет профессии как перчатки, то он никогда не научится никакой профессии. Если кто помнит, то таких в советское время величали "летунами".

    "Стаж непрерывной работы на данном месте" (извиняюсь за бюрократический сленг) для разных профессий различен. Он минимален для традиционных в Европе "полевых" профессиий (рыбак, лесоруб, фермер), немного больше для неизвестных европейцам "полевых" профессий (разведения табака, выращивание какао и т.д.), еще больше для "городских профессий и максимально большой для профессий высшего уровня (администратор, священник).

    Эта часть уже полностью реализована и работает коррестно.

    3 Тип: обучение в школах, колледжах, университетах.

    В данном разделе мне лишь частично удалось исправить ситуацию.

    Прежде всего простейший вопрос: о каком собственно обучении идет речь?
    Ответ: речь идет о профессиональном обучении, то есть колонист после обучения получает профессию.

    Что мы имеем в оригинальной версии игры? Для примера я возьму марафонскую скорость. Обучение в школе - 60 циклов, в колледже - 45, в университете - 30.

    НО!!!

    Школа выпускают лишь специалистов самых простейших профессий - типа рыбаков, фермеров и т.д. Но учат их 60 циклов!
    Университет же выпускает высшее сословие (администраторов, священников), но на это требуется всего 30 циклов!

    Ясно же, что система обучения стоит на голове. Я изменил логику и сейчас она более соответствует действительности.

    Обучение в школе самое короткое, но школа и дает лишь простейшие профессии, колледж - обучение длиннее, но и профессии после нее колонист получает более сложные, университет - самое длительное обучение, но зато там можно обучить самым сложным профессиям. В этом случае система обучения становится с головы на ноги.

    Нечто подобное было в прошлом. Достаточно вспомнить систему профобучения в СССР: профучилище (рабочий), техникум (мастер), институт (инженер).

    Сроки обучения в школах, клледжах, университетах легко согласовать с обучением на рабочем месте по типу 2.

    Как вариант такое соотношение:
    (первая цифра - простейшая "полевая" профессия, вторая цифра - городская профессия, третья цифра - наиболее сложная профессия)

    Обучение на рабочем месте: 10 - 30 - 90
    Обучение в учебном заведении: 15 - 30 - 45

    Из цифр следует, что учиться полевым профессиям лучше работая, а не протирая штаны за партой.

    Для городских профессий разницы нет, но необходимо наличия коллежда, а это время и деньги (стройматериалы)

    Однако колледж необходим как ступень для строительства университета, поскольку высшие по сложности профессии лучше получать именно учась, а не работая на них.

    Описанное выше также реализовано и работает корректно.

    Здесь можно было бы поставить точку, но есть небольшой ньюанс, на котором я споткнулся. Он заключается в том, что колледж и университет выпускают всех специалистов одновременно. К примеру ниверситет через 45 циклов может выпустить как простейшего дровосека, так и администратора. Если первый будет бесплатным, то за последнего придется дополнительно выложить некое количество монет.

    Но учатся-то они одинакое по продолжительности время! А, если по уму, то должны разное.

    Дровосек в университете или коллежде должен заканчивать обучение через столько же циклов, как и в школе. Если в школе у него на обучение уходит 15 циклов, то в колледже или университете у него должна быть возможность закончить обучение через те же самые 15 циклов, а не сидеть там в 2 или 3 раза дольше положенного.

    Совершенно аналогично для кузнеца. Его можно обучить только в колледже или университете, в школе - нельзя. На обучение в колледже требуется 30 циклов + некая кучка монет. Так и в университете кузнеца мы должны получить через те же самые 30 циклов + кучка монет.

    Вместо этого и дровосек, и кузнец (я взял их обоих исключительно в качестве примера) торчат в университете втрое или в коллежде вдвое дольше положенного. Я пытаюсь исправить это, но пока, увы, безуспешно...

    Что имеем на данный момент?

    В CvUnit.cpp решение об окончании обучения описывается так:
    Code:
    				if (pCity != NULL)
    				{
    					if (getYieldStored() >= pCity->educationThreshold())
    					{
    						if (isHuman())
    						{
    							CvPopupInfo* pPopupInfo = new CvPopupInfo(BUTTONPOPUP_CHOOSE_EDUCATION, pCity->getID(), getID());
    							gDLL->getInterfaceIFace()->addPopup(pPopupInfo, getOwnerINLINE());
    						}
    						else
    						{
    							pCity->AI_educateStudent(getID());
    						}
    					}
    				} Берется educationThreshold() 
    для данного города и сравнивается с накопленным количеством очков обучения getYieldStored(). Если их накоплено больше или столько же, как и необходимо, то процесс обучения заканчивается и колонист получает одну из доступных в данном городе специальностей.

    Если я не ошибаюсь, то выбор доступных специальностей идет через
    Code:
    CvPopupInfo* pPopupInfo = new CvPopupInfo(BUTTONPOPUP_CHOOSE_EDUCATION, pCity->getID(), getID()); 
    Я пробил исходные коды на "BUTTONPOPUP_CHOOSE_EDUCATION". Возможны три места, где программа составляет список юнитов, находящихся в данном городе на момент окончания образования. Это

    1. CvDLLButtonPopup.cpp
    Code:
    	case BUTTONPOPUP_CHOOSE_EDUCATION:
    		if (pPopupReturn->getButtonClicked() == GC.getNumUnitInfos())
    		{
    			CvCity* pCity = GET_PLAYER(GC.getGameINLINE().getActivePlayer()).getCity(info.getData1());
    			if (pCity != NULL)
    			{
    				gDLL->getInterfaceIFace()->selectCity(pCity, true);
    
    				CvPopupInfo* pInfo = new CvPopupInfo(BUTTONPOPUP_CHOOSE_EDUCATION, info.getData1(), info.getData2());
    				gDLL->getInterfaceIFace()->addPopup(pInfo, GC.getGameINLINE().getActivePlayer(), false, true);
    			}
    		}
    		else if (pPopupReturn->getButtonClicked() >= 0)
    		{
    			gDLL->sendDoTask(info.getData1(), TASK_EDUCATE, info.getData2(), pPopupReturn->getButtonClicked(), false, false, false, false);
    		}
    		break; 
    2. тот же самый CvDLLButtonPopup.cpp:
    Code:
    	case BUTTONPOPUP_CHOOSE_EDUCATION:
    		{
    			PlayerTypes ePlayer = GC.getGameINLINE().getActivePlayer();
    			CvCity* pCity = GET_PLAYER(ePlayer).getCity(info.getData1());
    			if (NULL == pCity || pCity->getOwnerINLINE() != ePlayer)
    			{
    				gDLL->getInterfaceIFace()->popupSetAsCancelled(pPopup);
    			}
    			else
    			{
    				gDLL->getInterfaceIFace()->lookAtCityOffset(pCity->getID());
    			}
    
    		}
    		break; 
    3. CvGameTextMgr.cpp:
    Code:
    	case BUTTONPOPUP_CHOOSE_EDUCATION:
    		{
    			CvPlayer& kPlayer = GET_PLAYER(GC.getGameINLINE().getActivePlayer());
    			CvCity* pCity = kPlayer.getCity(info.getData1());
    			CvUnit* pUnit = kPlayer.getUnit(info.getData2());
    			if (pCity != NULL && pUnit != NULL)
    			{
    				BuildingTypes eSchoolBuilding = pCity->getYieldBuilding(YIELD_EDUCATION);
    				if (eSchoolBuilding != NO_BUILDING)
    				{
    					szString += gDLL->getText("TXT_KEY_MINIMIZED_CHOOSE_EDUCATION", pUnit->getNameOrProfessionKey(), pCity->getNameKey(), GC.getBuildingInfo(eSchoolBuilding).getTextKeyWide());
    				}
    			}
    
    		}
    		break; 
    В принципе понятно, что именно программа делает. Она составляет список юнитов, находящихся в данном городе. Я подозреваю, что этот списоск есть Data2(). А когда приходит момент выбора специальности обучившимся студентом, то выдает этот список для выбора одной из профессий.

    Мне до сих пор ни разу не приходилось встречаться с Data1() или Data2() "врЕменными матрицами" (вряд ли термин верный, поэтому прошу специалистов не бить сильно ногами). По-моему, именно в них зашита та информация, которую мне нужно выправить. Пока я ищу пути как это можно сделать.

    I translated the most important parts. If I understand Russian text correctly the first moment in my previous post is already realized and is working correctly (Эта часть уже полностью реализована и работает коррестно.) The solution for the second moment is absent.

    I understand the idea such way:

    My colonist go to University.

    After 15 turns (marathon speed) I have two options:
    - OR to finish education in University and to accept one of simpliest professions (Farmer, etc.)
    - OR to continue education.

    After 45 turns I have three options:
    - OR to finish education in University and to accept one of simpliest professions (Farmer, etc.)
    - Or to finish education and to accept one of level 2 professions (Blacksmith, etc.)
    - OR to continue education.

    After 60 turns I have three options (as we have now):
    - OR to finish education in University and to accept one of simpliest professions (Farmer, etc.)
    - OR to finish education and to accept one of level 2 professions (Blacksmith, etc.)
    - OR to finish education and to accept one of level 3 professions (Statesman, etc.).

    Data2() (as a list of units/professions presented/available in the current city) was mentioned in the text as one of possible points where same changes are required.
     
  8. raystuttgart

    raystuttgart Civ4Col Modder

    Joined:
    Jan 24, 2011
    Messages:
    4,446
    Location:
    Stuttgart, Germany
    The Education Systems of Vanilla and TAC/RaR are quite different.
    (Original code of the new school system is from NetBandit.)

    Most importantly, Specialists require certain buildings and there is no diminishing returns.
    Of course not everything was changed.

    LbD is one of the first features I ever implemented for Civ4Col (TAC) but it is still one of my favorites. :)

    However, it is a feature of its own and not directly related to the Education System that Nightinggale is talking about.

    Just one sentence to your comment:
    The chances are set very low on purpose, since LbD should not make Education System uninteresting.
     
  9. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    I just had an inspiration based on the talk about education time and LbD.

    If I first implement Journeyman modcomp and then I change the school into giving journeyman training points. Basically it will become a turbo version of the normal journeyman training, which is a bit like LbD.

    Doing it this way will allow you to stop when the unit reached journeyman level. Say you are short on lumber. You may want to train one or more units to be journeyman lumberjacks and then get them to work right away with a bonus, which is less than if you wait the full time for expert lumberjacks.

    Training points needed to graduate each profession can be different for each unit, in which case the different training time will be present.

    Education and real life experience will go hand in hand meaning if a unit is already half way to become a journeyman though work experience, it will take shorter to be school trained to become one. Also changing what the unit is trained for will not make it forget the progress in the last goal meaning it's a valid candidate to go back and gain the journeyman promotion later when conditions in the game have changed. They can also just take a break from school to become extra soldiers or something temporally without forgetting their school progress.

    This will also allow expert units to be trained as journeymen for other fields.

    Sure it mean you will have to pick a goal when you start to train a unit, which will screw my teacher list, or at least the order units part of it. There are also some balance issues, which I will ignore for the time being, but make sure they can be controlled from XML.

    Maybe I should just start implementing journeyman as we already decided it should be done anyway.
     
  10. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I REALLY like this idea and it fits better with actual life. We can study a couple years and get an associates degree, couple more for a bachelor, couple more for a doctors. Each level gives us better job opportunities. This would add some strategic level as you decide should you keep training your unit on up to be a high level Dignitary or simply let him start farming.

    @Nightnggale
    As far as what XML you should put the attributes you could just do both, but the easiest is just to do the UnitInfos. I generally put a "minOccurs="0"" so that you don't have to edit each unit that will just be set to the default value.


    Right, and you don't want to over shadow the other education choices that being learning from natives or the school system. Plus you don't want everyone running around as highly educated "statesmen".
     
  11. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Yes, sounds like a good system to start from

    Jack of all trades master of none: that's me :cool:
    Yes, by all means start implementing. Having to "pick a goal" seems like a good management strategy that players could use if they want to get that detailed with it.

    Anyway, I have this one idea where each unit has a set of attributes. Kinda like I did with the Pirate Captains in my Privateer mod.

    Each unit would have a:

    • Courage: combat prowess
    • Aptitude: how fast they can educate and how many trades can they be journeymen in
    • Strength: could effect manual labor trades and how much cargo they can hold as peddlers
    • Leadership: bonus to combat experience and education
    • Intelligence: Could effect Researching ideas
    • Wisdom: effects Religious professions
    Just a few off the top of my head.

    Edit: These could also be set up as Random Promotion a unit may or may not have when it is created. It would add a certain "cool factor" where you hope you have a really unique unit. Some units could have multile promotions. Say, if your city produces a Serf that has a high Aptitude, Courage, and Leadership skills you could set a goal to get him trained up to be a great military leader and you follow him through his career and even give him a name.

    Edit: There could be negative promotions too like "Coward" or "Simpleton".
     
  12. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    DO'h!
    Do I feel stupid. I wrote a script to deal with a problem, which was only present due to my own lack of experience with the XML schema :cringe:
    The script can still be useful though. However it's not the major breakthrough I thought it was a moment ago.
     
  13. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I had a feeling that may have been the case, but sometimes you may want to change many units so the script is still of plenty use. And don't feel stupid we all done the same thing I bet, I know I did. I changed line after line when I first started modding and I hated it. I searched all over and made inquiries for programs that could do it for me and until I finally figured out you could set "minoccurs".

    I dug around in my old posts and found where I asked about this here back in 2008.

    And I never want to forget this DEBACLE of a thread!! YOU CAN NOT DIVIDE BY ZERO!!!
     
  14. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    I looked though the Journeyman code and wonder if that is the best way to do it. The really short answer is no, but the question is what should be.

    I decided to use the name Journeyman Experience. The current name is Journeyman Yield, which I find less ideal.

    I came up with the idea to use only one array for all stats for Journeyman. While the extra check for size sounds like it would decrease speed, it would most likely increase instead as it reads one array instead of two and as such would access less memory and it will have a greater chance to have the needed data in cache.

    It should be a just-in-time array as quite a number of units will never get journeyman training points, such as animals, ships, treasure etc.

    A unit becomes a journeyman when the experience reaches 100. Starting from 49 there is a chance to become one, which increases as the number gets closer to 100 (current code).

    My idea is to store journeyman promotions by setting experience to 100 when promoting. Checking if the unit is journeyman is checking for equal or larger than 100. No need for an extra bool for that.

    Training continues and once it reaches 500 the unit becomes an expert.

    Clear speciality sets experience to 400, meaning the unit is still a journeyman and can become expert again easily if needed.

    Experts are capped at 400 when training for their non-expert profession.

    100, 400 and 500 should be values from XML (not sure if those are the right numbers). 100 is hardcoded into the DLL in the modcomp.



    I haven't figured out how to deal with units, which takes longer to train. Clearly that should be set in UnitInfo, but how and how should it affect the 100, 400 and 500?

    How should marathon games affect this?

    Any ideas on those issues?
     
  15. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I wrote that code ages ago and to tell you the truth could not tell you much about it. I didn't even remember that units gained journeyman experience in each profession they worked, heh. I was only learning to write code as well so I know it needs some work.

    Ok, are you saying you have to train to 100 and once there you become a journeyman? The reason I did the "starting at 49" is because I have never liked "static" numbers. Human beings are not static. You can take 100 different people and teach them all how to knit a sweater and some are going to catch on faster than others. So, that is why I put that code in the mod to be a little more unpredictable. But if you want to code a more simpler version that is fine with me. I can change it whenever I want for my own version ;)

    Well, I would just add a "ExtraJourneymanMod" tag where if you put say 20, it would take that unit 120 experience to train to journeyman. You can apply the same thing to game speed.. just take one of the existing figures like iTrainPercent and apply it to the default of 100.
     
  16. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    So basically this is like reading vanilla code. Nobody to ask and no comments. I think I will modify even more than I originally planned.

    Sounds like a bad approach to reach that goal. I think it would be better to write how many experience points the unit would get for doing task X and then the randomness would be that it would subtract 0-50%. It should then need say 1000 points to reach Journeyman level as a higher resolution would be needed for that solution. Imagine the case where a scout gets one point. That would randomly be 0 or 1, or as I imagine how I would write something like that, it would end up being 1 or 1. Picking a random number between 5 and 10 sounds like it would be closer to the wanted result. After all the computer doesn't care if it is 100, 1000 or 7249 points. The only place where 100 would be better is in the GUI and percentage can easily be calculated there.

    File organization
    I have been wondering on how to write this. The general problem with a modcomp is that it takes ages to merge into existing files in a mod. I came up with the solution not to do so at all. I could write everything in ModJourneyman.cpp and then add one-line additions in other cpp files. Some stuff would need to go into classes in headers, which can't be avoided, but then it could be reduced to a single block in each file (two if inlined functions are in use). Granted it may not be possible to integrate it that simple in the cpp files, but we can try.

    The problem would be that stuff like CvUnit::TrainJourneyman() would be in ModJourneyman.cpp and not CvUnit.cpp like all the other CvUnit functions. It should likely be named something like CvUnit::ModJourneyman*() and then the * can be Train or whatever the function should do. That way any function starting with Mod would tell that it's in a Mod*.cpp file.

    What do you say? Would this be confusing? Would it be harder to read as class functions are spread across multiple files? Would it be easier to read as all functions for the same mod are located in the same file?
     
  17. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    I say code it how ever you want:) That's all I have to say about that:)


    Edit: no, I don't think it would be confusing. I forgot to answer that part.
     
  18. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,759
    Hmm, so if Journeyman status goes by Profession but doesn't change the original unittype, but adding further journeyman points changes the unittype to an expert, how to handle the fact that there isn't a one-to-one correspondence between a single profession and yield and a single "expert" unit like in vanilla? Ie Baker and Butcher both produce Luxury Food, some professions use multiple yields, units aren't only skilled at one Profession (Master Blacksmith, Master Weaponsmith etc). Im not sure but I guess the simplest way would be to have a tag for each profession like <ExpertUnit> in LbD RaR that sets what "master" unit you could become by practicing it.
     
  19. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,986
    I have been wondering about the same thing. Also say we have a Master Weaponsmith who is a journeyman blacksmith. What bonus should he get?

    What bonus should a journeyman blacksmith get? Text says +1, but what if you upgrade the blacksmith? Should it be that he produces 4 instead of 3 and the upgrade is "just" the double of that meaning an upgraded blacksmith allows journeymen to produce +2?

    What about pioneers and scouts? What bonus should they get?

    It's a bad solution to use units. However it sounds like a good solution if we use UnitClass instead. Unlike Unit, UnitClass can pick say hardy pioneer or Muslim pioneer depending on owner.
    In fact adding a UnitClass to ProfessionInfo is so far the only idea, which would get the job done.

    There are so many issues, which should be addressed in this. However most of those can wait, at least for me. It turns out that just copying the code from the modcomp went wrong and now I started over using small steps.

    My plan now is
    • Get the array working
    • Add a function to gain journeyman experience (in cities only at first)
    • Add display to verify previous step
    • Add load/save (maybe. This isn't really the hard part)
    • Add scout and pioneer experience gain
    • gain journeyman status
    I will not code or investigate any other stuff until those basics are working. However ideas are welcome all the time.
     
  20. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,094
    Location:
    Marooned, Y'isrumgone
    Well, historically not all professions had Journeymen so do we go with being correct according to the history of medieval journeyman or not? The journeyman status went right along with Guilds, which there was just about a guild for everything. Was there a farmers guild? We could make a rule that only professions that are not offered by native villages can have journeyman. Also, maybe the journeyman option does not come into play until you discover Guilds, which would make more sense to me.

    I would say that an Expert Weaponsmith is already a Journeyman Blacksmith that is why they get the +50% bonus to Blacksmithing that is currently in the mod. So, the code could do a check to see if the unit already has a bonus for the Profession he is working on and if so then he doesn't gain Journeyman experience.

    And yeah, adding the "ExpertUnitClass" to ProfessionInfos is the best option I can think of. I do believe that was what I was going to do but never did it :confused::mischief::)

    Edit: If a profession does not have a journeyman maybe they could learn by doing right into an Expert at some point and skip Journeyman, but take just as long. Journeyman could be a way to get your Units more versatile and not exactly as the main means to get them as Masters. This would allow the mod not to undermine the current system of Learning from Villages or Summing Units to your realm.
     

Share This Page