DLL coding thread

I managed to write a script to generate a spreadsheet of professions. I added the option to generate a table for the forum as well. Looking at this overview I spotted one error (copy paste error?) and marked it in blue. However to gain full benefit of the new system we should move PROFESSION_SKIRMISHER2 and PROFESSION_HEAVY_SKIRMISHER_PLATE into sub professions in PROFESSION_SKIRMISHER1 and stuff like that.

Spoiler :
Description|Type|Parent|iPower|Tech
Peasant|PROFESSION_COLONIST||0|CIVIC_BEAR_ARMS
Monk|PROFESSION_MISSIONARY||0|MEDIEVAL_TECH_MONASTICISM
Worker|PROFESSION_PIONEER||0|
Huntsman|PROFESSION_HUNTSMAN||50|MANORIALISM
Armed Peasant|PROFESSION_ARMED_PEASANT||75|
Armoured Peasant(leather)|PROFESSION_ARMOURED_PEASANT_LEATHER|PROFESSION_ARMED_PEASANT|100|
Merchant|PROFESSION_MERCHANT||0|TRADING_MARKET
Peddler|PROFESSION_PEDLER||0|
Tax Collector|PROFESSION_TAX_COLLECTOR||0|
TXT_KEY_PROFESSION_SCOUT|PROFESSION_SCOUT||50|
Heavy Knight|PROFESSION_KNIGHT_PLATE||150|FUEDALISM
Knight|PROFESSION_KNIGHT_MAIL||150|FUEDALISM
Heavy Calvary|PROFESSION_HEAVY_CALVARY||150|STIRRUP
Heavy Cavalry(Mail)|PROFESSION_HEAVY_CAVALRY_MAIL|PROFESSION_HEAVY_CALVARY|175|STIRRUP
Horseman|PROFESSION_CALVARY||150|MONARCHY
Horseman(leather)|PROFESSION_CALVARY_LEATHER|PROFESSION_CALVARY|175|MONARCHY
Archer|PROFESSION_MISSLEMAN||100|
Archer(leather)|PROFESSION_ARCHER_LEATHER|PROFESSION_MISSLEMAN|125|
Longbowman|PROFESSION_MISSLEMAN2||100|LONGBOW
Longbowman(leather)|PROFESSION_LONGBOWMAN_LEATHER|PROFESSION_MISSLEMAN2|125|LONGBOW
Skirmisher|PROFESSION_SKIRMISHER1||100|METALCASTING
Skirmisher(Scale)|PROFESSION_SKIRMISHER_SCALE|PROFESSION_SKIRMISHER1|125|METALCASTING
Heavy Skirmisher|PROFESSION_SKIRMISHER2||100|FUEDALISM
Heavy Skirmisher(Scale)|PROFESSION_HEAVY_SKIRMISHER_PLATE|PROFESSION_SKIRMISHER2|125|FUEDALISM
Crossbowman|PROFESSION_SKIRMISHER3||100|CROSSBOW
Crossbowman(Mail)|PROFESSION_CROSSBOWMAN_MAIL|PROFESSION_SKIRMISHER3|125|CROSSBOW
Infantry|PROFESSION_INFANTRY1||100|
Crossbowman(Mail) |PROFESSION_INFANTRY_MAIL|PROFESSION_INFANTRY1|125|
Heavy Infantry|PROFESSION_INFANTRY2||100|MAILARMOR
Heavy Infantry(Mail)|PROFESSION_HEAVY_INFANTRY_MAIL|PROFESSION_INFANTRY2|125|MAILARMOR
Pikeman|PROFESSION_INFANTRY3||100|PLATEARMOR
Pikeman(Plate)|PROFESSION_PIKEMAN_PLATE|PROFESSION_INFANTRY3|125|PLATEARMOR
Warrior|PROFESSION_BRAVE||0|
Bowman|PROFESSION_NATIVE_ARCHER||100|
Heavy Warrior|PROFESSION_ARMED_BRAVE||100|
Mounted Scout|PROFESSION_MOUNTED_BRAVE||50|
Mounted Warrior|PROFESSION_ARMED_MOUNTED_BRAVE||150|
Heavy Mounted Warrior|PROFESSION_HEAVY_MOUNTED_NATIVE||150|
Marauder|PROFESSION_MARAUDER||100|
Raiding Marauder|PROFESSION_MARAUDER_SEA||100|
 
Each digit works together with one array and the settings for the arrays can be set individually. This mean any 3 digit combo of 0, 1 and 2 can be used.

Ah, ok, I understand now.

It is creative and fundamentally not bad. However getting full professions to play with is superior to alt equipment and it will not confuse the AI. It's a good idea, which became obsolete by a better idea. Kind of like how steam ships were a great improvement, but aren't used anymore because something even better came along.

I agree, and I would that I thought of that first :) I would not have come up with a system as clean as yours but I would have managed something. Brilliant additions. Don't tell anyone but I would love for this mod to eventually rival some of the best here on CivFanatics... FFH who?

Once we have the overview we can rename/move/change professions like we want.

One thing about this part we don't all have to agree on all the states, names, and stuff as that part of the mod is easy to change. I know some words or phrases sound strange when you translate into another language. I really notice this in DoANE and would love to go through there and change it all up to read better for native English speakers. I really don't want to touch that mod though, they kinda upset me how they want share their source code. I mean, maybe 10 people in the whole wide world would even care, right?

Nice Overview by the way, dude you got skills:goodjob: I'll look it over more thoroughly when I can. I know we should move Heavy Knight into a Sub-profession of Knight, and it even works better now that we can change up the Combat Gears.

Hooray!

Now... To Flight!! :P

hehe

Let's go bro!!
 
AI would not have come up with a system as clean as yours but I would have managed something.
I don't think I would have come up with this solution if it wasn't because I wanted to get rid of the issues with alt equipment. In that sense it was a needed step to go through even though it's history.

Don't tell anyone but I would love for this mod to eventually rival some of the best here on CivFanatics... FFH who?
I haven't set a goal to beat anybody else (except maybe on performance :lol:). My goal is to make a mod, which is enjoyable to play. If my goal was to beat somebody else, then I wouldn't write code for RaR.

Beating the great mods could be tricky due to the fact that we seriously lack manpower.

I really don't want to touch that mod though, they kinda upset me how they want share their source code. I mean, maybe 10 people in the whole wide world would even care, right?
I don't get the point in hiding the source code either. When I started modding the biggest problem was getting access to any source code. A little lack of determination and I would have vanished again. I suspect the closed source codes is a major factor in why colo modding is close to being non-existing. Putting M:C on github seems to have gathered all would-be modders around this one mod, making it the only (publicly) active one at the moment. I don't think we would have been able to do most of the 2.0 stuff if we wanted to hide the source code.

dude you got skills:goodjob:
Is that something you didn't notice until today :eek:
 
When I started modding the biggest problem was getting access to any source code.

Yeah, I remember you wanting the M:C source code. It just took me so long to get that last release done is all that held up your access. If I had realized how awesome of a coder/modder you was I would have put more effort into it:crazyeye::goodjob:
 
Yeah I used to do language fixing for the english version of DoANE a few versions ago, I think the problem is not so much words as grammar, as everything flips around in english compared to other languages, which makes sentence structures and such look strange. There are also a lot of new concepts in DoANE and thus a lot of complex text, which highlights the difference in language more and more.

Yeah I would love for FTTW and World History to get to the same levels as FFH and C2C and the like, right now FTTW is stalled till my code maestro comes back and fixes it or helps me decide to roll it back.. I have no business touching code! :D

Yeah that crossbowman would have been a missed text, I think though it should only be the description that needs to change, so at least it doesn't break code! :D

Yeah I had not touched the knight code, because the messages about it got a little muddled so I just left it alone! As far as I could tell it had no alt settings, so for the exterminatus goal it was not a problem! :)

That table system is nice :D it would have been nice to be able to do that with the techs for my Design sheet, save me having to input it all by hand! :D Although I used pop up notes in open office, so it probably would have had to be very different :D

Anyway the job is done so now I can get on with the 'Fun?!?' stuff of adding in content for Ancient, Classical, Renaissance/Imperial, Industrial and Modern Eras, and changing the Medieval content to fit with the expanded design!! :D
 
Yeah I used to do language fixing for the english version of DoANE a few versions ago, I think the problem is not so much words as grammar, as everything flips around in english compared to other languages, which makes sentence structures and such look strange. There are also a lot of new concepts in DoANE and thus a lot of complex text, which highlights the difference in language more and more.

Right. One other thing about that, pretty much anything they can do we can do. I've already considered a bartering system for Natives, I didn't really feel a need for that for the M:C mod so I never went there but for World History it would probably fit. I am not sure what it would take but I am thinking it wouldn't take much. You can already, say, place a Natives goods on the table, which it then automatically removes goods from the players table. Should be an easy fix to keep them both on the table and just use the gold value of each instead of actual gold.

Yeah I had not touched the knight code, because the messages about it got a little muddled so I just left it alone! As far as I could tell it had no alt settings, so for the exterminatus goal it was not a problem! :)

Anyway the job is done so now I can get on with the 'Fun?!?' stuff of adding in content for Ancient, Classical, Renaissance/Imperial, Industrial and Modern Eras, and changing the Medieval content to fit with the expanded design!! :D

I fixed the incorrect name on Infantry and I fixed up the Heavy Knight to be a sub of Knight. I love how the pedia can switch between them. I'll push those changes when I get out of bed in a couple hours.

Is that something you didn't notice until today :eek:

Nope;), its just my way of showing appreciation. With this new Profession system I am eager to do some quick reskins. How should we go about doing graphic and sound updates for the Git version. Up till now it has been very little. I have already intergrated orlanth's Monk sounds into the mod, I stashed the changes however, so that I could check out the Subprofessions first. But, now when you pull up a Monastery screen you can hear the monks:) Although, when you quick link click to switch to another city the Monk sounds remain, and vice versa, so I need to figure out how that can be reloaded when you switch.
 
Yeah, I remember you wanting the M:C source code. It just took me so long to get that last release done is all that held up your access. If I had realized how awesome of a coder/modder you was I would have put more effort into it:crazyeye::goodjob:
It isn't like it is the first time we had that issue :sad:
http://forums.civfanatics.com/showthread.php?p=10999748#post10999748

That table system is nice :D it would have been nice to be able to do that with the techs for my Design sheet, save me having to input it all by hand! :D Although I used pop up notes in open office, so it probably would have had to be very different :D
The table is build based on setup in XML, not in the plan. This mean it is as much XML coding check as it is planning (presumably mostly check).

I already wrote code for techs: http://forums.civfanatics.com/showpost.php?p=13053429&postcount=473
I guess I could make a table for techs as well. However it is only useful for people using git and have perl installed :p
Having Graphviz installed would also help.

If you feel that a table or graph would be useful, then please tell me. It isn't like it's tricky to make scripts like that now that I have a sort of template to make those.

Nope;), its just my way of showing appreciation. With this new Profession system I am eager to do some quick reskins. How should we go about doing graphic and sound updates for the Git version. Up till now it has been very little. I have already intergrated orlanth's Monk sounds into the mod, I stashed the changes however, so that I could check out the Subprofessions first. But, now when you pull up a Monastery screen you can hear the monks:) Although, when you quick link click to switch to another city the Monk sounds remain, and vice versa, so I need to figure out how that can be reloaded when you switch.
The whole city screen is far from perfect. You mentioned at one time that we should split it out of main interface as that will allow us to init it during the game. Or was it only the yield bar, which should be split out? Either way I wouldn't mind having all city stuff in one file and only city code.
 
A table based on XML will (unlike a normal spreadsheet) never go out of sync with the data the game sees. This mean it is more like a check to see if you entered the data correctly rather than planning. Making a graph is also useful to see if you connected the tech tree like you think you have.

Also do use a prefix in type names, like TECH_ or INVENTION_. Kailric forgot this and I will likely end up having to write a script to fix that as we will run into problems eventually. You can't use the same type in two otherwise unrelated XML files, which is why prefixes come in handy.

Also if you have such a plan, why not put it on github? It would be beneficial to start your commit log as early in the process as possible as it helps to go back and see what you did earlier. It also reveals your plan to other people and you could end up with feedback.
 
Hehe... still can't work github! :D Makes my head hurt too much! Everything in life quickly makes my head hurt...

I plan to post the spreadsheet in World History Conversation when it is done, I haven't done anything code wise yet, just figuring out numbers of techs, tech names, places, unlocks etc. while also working out how the various aspects of the game work in coding, like production and yeilds and such..

But Yes I will probably end up using the TECH preface, as that is how it is done in Civ.
 
Also do use a prefix in type names, like TECH_ or INVENTION_. Kailric forgot this and I will likely end up having to write a script to fix that as we will run into problems eventually. You can't use the same type in two otherwise unrelated XML files, which is why prefixes come in handy.

I have actuallly started to fix this, went through a few of them already and added TECH_ or something like that, so maybe I can finish today, let me see how many is left... wow, like nearly 40, yeah a script may work best :) I started using the naming scheme MEDIEVAL_TECH_. On the Trading Techs I just used TRADING_.


It isn't like it is the first time we had that issue :sad:
Nor will it be the last;)


The whole city screen is far from perfect. You mentioned at one time that we should split it out of main interface as that will allow us to init it during the game. Or was it only the yield bar, which should be split out? Either way I wouldn't mind having all city stuff in one file and only city code.

I think we referred to the whole city screen, If there would be an advantage in working in some of our desires then maybe we should split it out. At the moment its not an issue, at least from what I am working on.

You didn't answer my question (I didn't put a question mark at the end is maybe why) on how we should go about doing graphic and sound updates to Git? Should I just post and Announce a Update Zip file and then if someone don't notice it they will figure it out when the game doesn't act right?
 
I have actuallly started to fix this, went through a few of them already and added TECH_ or something like that, so maybe I can finish today, let me see how many is left... wow, like nearly 40, yeah a script may work best :) I started using the naming scheme MEDIEVAL_TECH_. On the Trading Techs I just used TRADING_.
I have plans for a script, where you give it two arguments, like COMPASS MEDIEVAL_TECH_COMPASS. It will then go through all XML files and replace ">COMPASS<" with ">MEDIEVAL_TECH_COMPASS<". This isn't tech specific and can be used to rename lots of stuff, like profession names (I imagine we will rename quite a number of those in the near future).

I also came up with the idea to add FALSE = 0 and TRUE = 1 to DLL. This way we can use those when setting bools in XML. Maybe we should have ENABLE = 1 and DISABLE = -1 as well as it makes civics more readable. I will likely have to look into the bool loading code to get this working though. Also I will likely have to make it actually load an int and then set the bool to int ==1 as it will then be false even if somebody messes up and writes DISABLE instead of FALSE.

Nor will it be the last;)
Hopefully it is the last. If not, then I will lose access to the source code. How would that even happen now that it's on github :crazyeye:

I think we referred to the whole city screen, If there would be an advantage in working in some of our desires then maybe we should split it out. At the moment its not an issue, at least from what I am working on.
My work regarding yield row(s) completely stalled due to issues with this. Also I still have problems figuring out this file as it has so many different things joined together seemingly random in a huge mess. The whole file is a planning disaster.

You didn't answer my question (I didn't put a question mark at the end is maybe why) on how we should go about doing graphic and sound updates to Git? Should I just post and Announce a Update Zip file and then if someone don't notice it they will figure it out when the game doesn't act right?
I was like "you wrote something about that and I need to answer it. Now which thread was it...." and then I failed to find it again :crazyeye::lol:

I haven't really figured out what to do about those. I noticed that while I was on a jerky internet connection (wifi had low signal strength and high package loss) that making a new clone can take quite a while. Currently M:C 136 MB on github.

At one time we planned on adding the files to git and then purge them when they are released the next time. I'm not sure I like that idea anymore as it seems like a lot of work. Maybe the best solution is to use DropBox and make the Art directory shared somehow meaning if person A adds a file, it automatically adds for person B. Kind of like git, but without history. Sounds might be dealt with in the same manner (if it's easy), but we can survive not being up to date with sounds at all time. It's harder with graphics.

The one big issue with dropbox is that I haven't really figured out how to use it. I never really had the need to do so yet. This mean I don't know how to set it up in a way where the game can see it and play, just like we do with git.

Github has some reading on this issue:
https://help.github.com/articles/what-is-my-disk-quota
 
I have plans for a script, where you give it two arguments, like COMPASS MEDIEVAL_TECH_COMPASS. It will then go through all XML files and replace ">COMPASS<" with ">MEDIEVAL_TECH_COMPASS<".

Visual 2010 Express, does this for the most part. Just click Quick Replace, and select
All Opened Documents, in the "Look in:" drop down. You can find all relevant files doing a solution search, open each one, then quickly replace them all. I was doing this with the ones I did replace. It is still time consuming. I tell you what else is time consuming, talking on the forums:lol:



I'll check into this ASAP.
 
Visual 2010 Express might do it, but then you have to open all XML files and stuff like that. A script can do it without human interaction. Imagine a batch file with 20 changes. It's just 20 lines (which might even be autogenerated) and the script executes 20 times without any human interaction. In fact that batch file could be an in script edit to make it easier for the user.
 
Drop box may work like this, it is just a harddrive that auto updates everyone via the web, I am not sure what the file string would be though.

I would suggest just making a normal graphic download like there is now, put the link in the same place as the link to github, with a date of release. As long as you are not updating the sound and graphics every five minutes, but instead in big chunks it won't be an issue. wit hdropbox you have to share access to everyone and it can be deleted accidentally by anyone with access, which makes it lkess secure. I use DB to host FTTW among the dev team, so it does work, but it is only really worth everyone setting up an account if you plan on doing lots of constant little updates, if you are going to do big ones, you may as well just make a download link like you have now.
 
I made my first reskin of Archer Leather...

attachment.php


I figured out (or remembered) that the Main Menu Pedia uses the Veteran Unit of the First Civ to "Clothe" with the new professions. So, in order to test my guys in the Main Menu pedia I'll have to make sure the Veteran Unit has the new profession Art. Or, set up perl to run that auto script. I think I'll look into perl sometime soon.:crazyeye:

I should start a new thread about Unit/Profession graphics and Explain the New Subprofession system as well, too keep track of things.
 

Attachments

  • ArcherLeather.jpg
    ArcherLeather.jpg
    48.8 KB · Views: 177
I made my first reskin of Archer Leather...
That looks great. I have no idea how you did that though :lol:

I figured out (or remembered) that the Main Menu Pedia uses the Veteran Unit of the First Civ to "Clothe" with the new professions. So, in order to test my guys in the Main Menu pedia I'll have to make sure the Veteran Unit has the new profession Art. Or, set up perl to run that auto script. I think I'll look into perl sometime soon.:crazyeye:
Right now subs use the same graphics as parent. I plan on writing a script to alter graphics of a specific profession like profession X now uses graphics string Y. It's more complex as just replacing because archer graphics shouldn't be changed.


Drop box may work like this, it is just a harddrive that auto updates everyone via the web, I am not sure what the file string would be though.

I would suggest just making a normal graphic download like there is now, put the link in the same place as the link to github, with a date of release. As long as you are not updating the sound and graphics every five minutes, but instead in big chunks it won't be an issue. wit hdropbox you have to share access to everyone and it can be deleted accidentally by anyone with access, which makes it lkess secure. I use DB to host FTTW among the dev team, so it does work, but it is only really worth everyone setting up an account if you plan on doing lots of constant little updates, if you are going to do big ones, you may as well just make a download link like you have now.
Are you saying that DropBox doesn't support public read only access? Somehow I find that hard to believe.

As for accidental deletion: only give write access to a select few (1-3 people) and the problem should be solved. I execute a script each time my computer boots. I could extend that one into making a backup meaning we will likely get a backup at least once a day.
 
Back
Top Bottom