[MOD] Italy 500BC

pavelk
Kubat Software
Kubat Software
Posts: 2467
Joined: Mon May 16, 2016 4:27 pm

Re: [Modding]A first scenario and little bit of modding

Post by pavelk » Tue Aug 28, 2018 12:13 pm

I just tried Battle over Rhyne scenario (with Holland Mod indeed).

I remove the whole resources collection from scenario.ag file to be like this:
hollandScenario.png
Holland scenario file structure
hollandScenario.png (59.93 KiB) Viewed 2136 times
I left mod.ag file as it was before (untouched), like this:
hollandMod.png
Holland mod file structure
hollandMod.png (69.13 KiB) Viewed 2136 times
and this is how it looks like:
hollandResources.png
Battle over Rhyne resources
hollandResources.png (67.71 KiB) Viewed 2136 times

SO I am not sure what is the problem. Can you please check that you have it setup this way as well? Resources should not be part of scenario for sure.

Cablenexus
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1691
Joined: Mon Jan 04, 2016 7:09 pm

Re: [Modding]A first scenario and little bit of modding

Post by Cablenexus » Tue Aug 28, 2018 12:27 pm

Hi guys,

Yes this is an error that was introduced by me. Not the game s fault.

For one reason I added the resources (all resources) to my scenario file (probably copied from mod to scenario instead of mod to mod).

Resources ARE NOT part of the scenario file. Delete the whole resource element in scenario file (not just the ones you added new) and it will work if they are in mod file.

Chris36
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 50
Joined: Mon Mar 10, 2014 8:44 pm

Re: [Modding]A first scenario and little bit of modding

Post by Chris36 » Tue Aug 28, 2018 12:46 pm

Hanging at adding new terrain. I made 2 new entries with 2 new IDs like this:
<TerrainPropertiesMemento id="11" name="Terrains.MEDITERRAN_HILLS" .......
<TerrainPropertiesMemento id="12" name="Terrain.MEDITERRAN_PLAIN" .......

I copied the whole original entries of hills and plains, changed the IDs, Name and production for each terrain. But i dont have access to the new terrain in the editor. I guess i have to copy/edit more entries to include new terrain into the game? I found terrainbehaviour of the original 10 terrains for each unit as an example. Thats quite interesting how all things work together.

When the terrain works i will start with the full map next to setting up Players/cultures and changing the building blacksmith to marketplace.

edit:
i see 2 new posts while i was writing my one, looking through them now :)
Last edited by Chris36 on Tue Aug 28, 2018 12:53 pm, edited 1 time in total.

Chris36
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 50
Joined: Mon Mar 10, 2014 8:44 pm

Re: [Modding]A first scenario and little bit of modding

Post by Chris36 » Tue Aug 28, 2018 12:51 pm

Cablenexus wrote:
Tue Aug 28, 2018 12:27 pm
Hi guys,

Yes this is an error that was introduced by me. Not the game s fault.

For one reason I added the resources (all resources) to my scenario file (probably copied from mod to scenario instead of mod to mod).

Resources ARE NOT part of the scenario file. Delete the whole resource element in scenario file (not just the ones you added new) and it will work if they are in mod file.
Ok.

edit:
works like a charm!

Chris36
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 50
Joined: Mon Mar 10, 2014 8:44 pm

Re: [Modding]A first scenario and little bit of modding

Post by Chris36 » Tue Aug 28, 2018 1:12 pm

Cablenexus wrote:
Tue Aug 28, 2018 12:27 pm
Hi guys,

Yes this is an error that was introduced by me. Not the game s fault.

For one reason I added the resources (all resources) to my scenario file (probably copied from mod to scenario instead of mod to mod).

Resources ARE NOT part of the scenario file. Delete the whole resource element in scenario file (not just the ones you added new) and it will work if they are in mod file.
Cablenexus, i Just checked again the scenario editor and the resources are always saved into the new scenario ag file from the resources of the actual mod which is loaded ingame.

Still, if you want to add resources and always put the full resource list into the mod.ag file, it works.

pavelk
Kubat Software
Kubat Software
Posts: 2467
Joined: Mon May 16, 2016 4:27 pm

Re: [Modding]A first scenario and little bit of modding

Post by pavelk » Tue Aug 28, 2018 2:26 pm

Chris36 wrote:
Tue Aug 28, 2018 1:12 pm
i Just checked again the scenario editor and the resources are always saved into the new scenario ag file from the resources of the actual mod which is loaded ingame.
Hmm interesting I will check that.

pavelk
Kubat Software
Kubat Software
Posts: 2467
Joined: Mon May 16, 2016 4:27 pm

Re: [Modding]A first scenario and little bit of modding

Post by pavelk » Tue Aug 28, 2018 2:27 pm

Chris36 wrote:
Tue Aug 28, 2018 12:46 pm
Hanging at adding new terrain. I made 2 new entries with 2 new IDs like this:
<TerrainPropertiesMemento id="11" name="Terrains.MEDITERRAN_HILLS" .......
<TerrainPropertiesMemento id="12" name="Terrain.MEDITERRAN_PLAIN" .......
Adding new terrain types is not such an easy task. It is eaasier to replace an existing one rather then create a new one (there are more things connected to it like all the terrain behaviors of all the unit models, etc).
Also you should look into the bitmaps.dds file to see where these textures are located

Cablenexus
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1691
Joined: Mon Jan 04, 2016 7:09 pm

Re: [Modding]A first scenario and little bit of modding

Post by Cablenexus » Tue Aug 28, 2018 2:32 pm

Chris36 wrote:
Tue Aug 28, 2018 1:12 pm
Cablenexus wrote:
Tue Aug 28, 2018 12:27 pm
Hi guys,

Yes this is an error that was introduced by me. Not the game s fault.

For one reason I added the resources (all resources) to my scenario file (probably copied from mod to scenario instead of mod to mod).

Resources ARE NOT part of the scenario file. Delete the whole resource element in scenario file (not just the ones you added new) and it will work if they are in mod file.
Cablenexus, i Just checked again the scenario editor and the resources are always saved into the new scenario ag file from the resources of the actual mod which is loaded ingame.

Still, if you want to add resources and always put the full resource list into the mod.ag file, it works.
Very nice you doublechecked this yourself.
I see they are added in my other scenario files (I have an Atlantis mod in development) as well.

pavelk
Kubat Software
Kubat Software
Posts: 2467
Joined: Mon May 16, 2016 4:27 pm

Re: [Modding]A first scenario and little bit of modding

Post by pavelk » Tue Aug 28, 2018 2:41 pm

Perfect guys, you found a bug!

Will be fixed in the first patch. By then, please remove the resources collection from exported scenarios.

Chris36
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 50
Joined: Mon Mar 10, 2014 8:44 pm

Re: [Modding]A first scenario and little bit of modding

Post by Chris36 » Tue Aug 28, 2018 3:36 pm

pavelk wrote:
Tue Aug 28, 2018 2:27 pm
Chris36 wrote:
Tue Aug 28, 2018 12:46 pm
Hanging at adding new terrain. I made 2 new entries with 2 new IDs like this:
<TerrainPropertiesMemento id="11" name="Terrains.MEDITERRAN_HILLS" .......
<TerrainPropertiesMemento id="12" name="Terrain.MEDITERRAN_PLAIN" .......
Adding new terrain types is not such an easy task. It is eaasier to replace an existing one rather then create a new one (there are more things connected to it like all the terrain behaviors of all the unit models, etc).
Also you should look into the bitmaps.dds file to see where these textures are located
Ok for this scenario it should work with replacing 2 existing ones. I will always have open ears for the infos how deep it is implemented to create new ones :) . Maybe at some time after release.

pavelk
Kubat Software
Kubat Software
Posts: 2467
Joined: Mon May 16, 2016 4:27 pm

Re: [Modding]A first scenario and little bit of modding

Post by pavelk » Tue Aug 28, 2018 4:31 pm

Chris36 wrote:
Tue Aug 28, 2018 3:36 pm
Ok for this scenario it should work with replacing 2 existing ones. I will always have open ears for the infos how deep it is implemented to create new ones :) . Maybe at some time after release.
There are two things a bit more "difficult" when creating new terrains. First is that you have to define the terrainbehavior for all the unit types - basically all defense and attack bonuses, movements points for that terrain, etc. It is pretty time consuming.

The second thing is the actual texture. When you look at bitmaps.dds the textures are in the first "row" and it is full. You can still replace the last four ones, but they are used for beaches (coast from the land side), cliffs and coasts (from the see side). If you replace it with your own,you would need to remove one of these. For example if you remove the last one (which is used as a texture of "coast from the land side) for terrains like forests, jungles, etc. you would have to set it up so this texture is not used for them on coast. You can still do it, it will just need some changes and the coast might not look that nice (however you can use the sandy beach for forest as well if you want to).

I hope that it is understandable at least a bit:)

Chris36
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 50
Joined: Mon Mar 10, 2014 8:44 pm

Re: [Modding]A first scenario and little bit of modding

Post by Chris36 » Sun Sep 02, 2018 6:11 pm

Thx pavel. Just to make it easier i decided not to use terrain instead i use new resource buildings like mines and use them on existing terrain.
Still alot to check by files but the scenario made progressions. Completed the map and researched/added the first cultures while figuring out how the blacksmith and cities work by script, which are the most interesting units functional wise to observe for implementing the marketplace idea.

Another thing and maybe an idea for an additional scenario:
while editing the map and to figure out how the map and mapsize is included in the scenario file, i tried to increase the original map of the mediterran Scenario first on the Y-axis by 24 tiles and it worked.
I would really love to continue on this idea next to my Italy-scenario just to get more experience in modding. But thats alot of stuff to do and maybe someone is interested to join up ?
I would first complete the map in terrain-detail and try to add some X tiles to the east to regain the territorial balance(maybe up to the border of today Iraq/Iran). Of course if you increase the map size there are coming areas into the game never came into action during the time of the scenario. I would exclude those regions by making the tiles like a static terra incognita/unusable terrain by filling those regions full of mountains or something like that.
Theres no need to edit in scripting, the scenario would be a copy of the original one with some edits like new nations with their flags, starting cities/units, the territorial names of Gallia, Germania and Britain.
Would be great if someone joins up :)

Thats what i edited so far
Unbenannt.jpg
Unbenannt.jpg (579.23 KiB) Viewed 2094 times

Cablenexus
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1691
Joined: Mon Jan 04, 2016 7:09 pm

Re: [Modding]A first scenario and little bit of modding

Post by Cablenexus » Mon Sep 03, 2018 2:41 pm

Chris36 wrote:
Sun Sep 02, 2018 6:11 pm
Thx pavel. Just to make it easier i decided not to use terrain instead i use new resource buildings like mines and use them on existing terrain.
Still alot to check by files but the scenario made progressions. Completed the map and researched/added the first cultures while figuring out how the blacksmith and cities work by script, which are the most interesting units functional wise to observe for implementing the marketplace idea.

Another thing and maybe an idea for an additional scenario:
while editing the map and to figure out how the map and mapsize is included in the scenario file, i tried to increase the original map of the mediterran Scenario first on the Y-axis by 24 tiles and it worked.
I would really love to continue on this idea next to my Italy-scenario just to get more experience in modding. But thats alot of stuff to do and maybe someone is interested to join up ?
I would first complete the map in terrain-detail and try to add some X tiles to the east to regain the territorial balance(maybe up to the border of today Iraq/Iran). Of course if you increase the map size there are coming areas into the game never came into action during the time of the scenario. I would exclude those regions by making the tiles like a static terra incognita/unusable terrain by filling those regions full of mountains or something like that.
Theres no need to edit in scripting, the scenario would be a copy of the original one with some edits like new nations with their flags, starting cities/units, the territorial names of Gallia, Germania and Britain.
Would be great if someone joins up :)

Thats what i edited so far
Unbenannt.jpg
Hi Chris,

Looks great so far what you achieved. I'm really curious what you did to make the larger map. Can you share some more detail please?
I'm looking forward to the first Workshop scenario about Italy.

for your second plan, I suggest really not to edit the original mod and scenario files, but use the prototype modding. That means that you only copy the parts you change.
This is not scripting yet, this is just copy the right elements in your .ag file with notepad++ or XML editor.
I don't want to promiss to join for that bigger project for now, but I promiss I can give advice and help you to create what you want.
(for example if you have difficulties with the prototyping).

Great work so far and sorry for my slow respons, I already forget about the beta forum.
For me it's good to keep this thread open, but I want to invite you to enter the Steam Workshop/Slitherine Workshop and/or Discord thread as well.

Chris36
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 50
Joined: Mon Mar 10, 2014 8:44 pm

Re: [Modding]A first scenario and little bit of modding

Post by Chris36 » Mon Sep 03, 2018 8:23 pm

Hey Cablenexus,

Im not 100% sure now but i think i did protoype modding. I used my own mod and scenario file, created for that a new mod folder and bound the scenario/save game to the new mod. Any new stuff, additions or changes would come into that new mod file except for the map changes where i currently use the save game.

Okay and for the map, to edit its size i did the following:
1. Made a savegame of Ancient Mediterranean in turn 1
2. I checked how the tiles are saved in the scenario files. If you dont know how:
they are saved in a 2 dimensional array where the Y-axis is saved in the first dimension and the x-axis in the second dimension for example like this: tile[2][10], meaning the tile at y=2 and x=10.

In the scenario file this mechanic is implemented this way:
You will have to look for the <chart> entry. Subordinate to <chart> you will find as many <ArrayOfChartSquareMemento> entries as the map's size in Y. So the Ancient Mediterranean scenario will have 44 entries of <ArrayOfChartSquareMemento>, as its total size is y=44 and btw x=88.
It is saved in the order as it is presented in game, meaning the first entry of <ArrayOfChartSquareMemento> is the first top row of the map.
Now if you open the first <ArrayOfChartSquareMemento> in the scenario file you will see a list of all 88 Tiles of the first top row of the map. ( where each tile's informations are saved in <ChartSquareMemento> ). So the complete map got 44 <ArrayOfChartSquareMemento> entries each with 88 entries of <ChartSquareMemento>

3. Knowing about how the map is implemented i made a new map in the scenario editor 88 tiles wide(the important number here) with water( you can use any terrain you want, i wanted to add only water tiles to the XL scenario)
So i saved the water scenario, opened it in notepad++ and copied some of it's <ArrayOfChartSquareMemento> entries, and pasted them into my XL scenario file right in front of all other <ArrayOfChartSquareMemento> entries. I then loaded the scenario and those water tiles were added to the top of the map. I tested a little time how many Y i would need to include France and Britain. At the end i copy-pasted 24 elements.

4. Then there was a problem: I only wanted to expand the Ancient Mediterranean scenario and not build it complete new. BUT with the new map additions at the TOP of the map all original Y-positions of units, cities and mines were obsolete e.g. a city in the original scenario at y 10 and X10 would be on my map on a water tile. Meaning all units are 24 Y positions off their intented positions. And there comes the last point.

5. So if you want to change the map size of a scenario but keep all units, cities and mines, you will need to adjust the Y positions of all units in the scenario file. To be said, you dont have to do that, if you add new map parts at the bottom of the map! As just for info, if you want to add map to the left or right on the X-axis, you wont need to adjust the X positions of units if you add it to the most right of the map. You need to adjust it if you add map on any other position.

Never the less, a crazy task to adjust the Y value of all units on the map, if you would do it manually one by one. :shock:
Im sure there are easier ways to do this but to make it a fast task i created a temporary xml file and copied ALL <UnitMemento> entries into it. Not anything else.
I then started to use the find and replace function and had in mind to replace ALL original Y values by its original value +24, to get all units back into its intented position on the map. Because the old map got an Y value of 44, all units must be within this range and i only need to search and replace within this range. But i had to start within the range between 24 and 44 to avoid adding up the y-Postion of units between 0 and 22 twice during the process of finding and replacing.
It looked as an example like this: Find " y=24" and replace with " y=48" .
When all units Y positions were corrected, i copy pasted the <UnitMemento> entries back to the scenario files and all units are back in its intented positions.

edit: i just noticed after loading the scenario as a game i have to edit some more values. I will add this info when im done.
edit2: I had to adjust the playervisibility as well by adding 24 lines before each players <visibility> entry. I guess winningpoints as well, i will do that tomorrow.



Alright, i will enter the steamworkshop/discussion forum for mods on steam then. Thanks for offering help, or even joining at some time :) .
This is what i did today: i finished the total terrain for france but had to decrease the height of the north borders of france/germany, poland. The old borders let the countries be too big but now its scaled better. Next i need to research the biggest celtic tribes for France and Britain. I found some maps but there are just too many small tribes, too much for the scenario. Maybe in total +4 tribes in France and England....... If i remember right in a Total War game you could select the Britons as the tribe to play in england. This and maybe Picts in scotland may be a solution for England. Any knowledge or ideas are welcome :) . Of course theres google, but up to now i had no real catches.

Chris36
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 50
Joined: Mon Mar 10, 2014 8:44 pm

Re: [Modding]A first scenario and little bit of modding

Post by Chris36 » Tue Sep 04, 2018 8:26 am

I will move then to steam but continue posting here as well.

Cablenexus
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1691
Joined: Mon Jan 04, 2016 7:09 pm

Re: [Modding]A first scenario and little bit of modding

Post by Cablenexus » Tue Sep 04, 2018 8:33 am

Chris36 wrote:
Tue Sep 04, 2018 8:26 am
I will move then to steam but continue posting here as well.
Hi Chris,

I read your previous post. You are really advanced in understanding the files. That's really great.

If Pavel allows us I request one of the moderators to bring our mod topics to the mod section of the main Slitherine forum.
I agree that keeping those topics open to discuss is much better and I think the possibilities in the Slitherine forum offers more (easy to put screenshots, better overview etc).

Chris36
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 50
Joined: Mon Mar 10, 2014 8:44 pm

Re: [Modding]A first scenario and little bit of modding

Post by Chris36 » Tue Sep 04, 2018 11:23 am

News to the scenario XL: So far i could even bring the scenario XL to work in a game and let some turns bypassing.
Before the game crashed right in turn 1. But now after adjusting the winningConditions it works. Also the positions of the ambient units had to be adjusted in their Y-positions.
Current map size: 5984 tiles

I got some ideas for the scenario:
* adding 6(less or more) new celtic tribes based on the celtic tribe in northern italy:
- 2 in Norhtern italy: Venetians and Ligurians -> removing the celtic tribe there
- 2 in France: not yet researched
- 2 in Britain: not yet researched( Picts, Britons maybe? )

* adding 2(less or more) germanic tribes: not yet researched

IF this works fine performance wise there could be added map parts to the east, first to restore the land balance and to bring in horse heavy nations like Parthians/Scythians and give them a special unit set with better stats for cavallry. But, somewhere i read theres a performance limit of 6400 tiles so theres not much room if you follow that. As i said, great parts of the map(in the east) wont be used, maybe theres is a way to take them out performance wise?

To Do:
* adding detailed terrain and rivers to Germany/Britain
* adding resources to all new map parts
* researching and adding new factions(celtic and germanic tribes)
* adding a kind of terra incognita to map parts not interesting in that time frame, maybe all east of germany.

Maybe you guys got some infos to the celtric and germanic tribes. So far i only found a map with just too many tribes on it. Werent there any main tribes in that time frame?

Current map:
europe.jpg
europe.jpg (618.9 KiB) Viewed 2037 times
Last edited by Chris36 on Tue Sep 04, 2018 11:45 am, edited 2 times in total.

Chris36
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 50
Joined: Mon Mar 10, 2014 8:44 pm

Re: [Modding]A first scenario and little bit of modding

Post by Chris36 » Tue Sep 04, 2018 11:33 am

To get a short overview over this thread:
it contains 2 Mods in work.

1. A mod about Italy starting at 500 BC. All infos are in the first post of the thread
2. A mod thats just expanding the vanilla "Ancient Mediterranean" scenario to "Ancient Mediterranean XL". All infos in the last posts

I will open up a new thread to split the Mods.

Cablenexus
Sr. Colonel - Battleship
Sr. Colonel - Battleship
Posts: 1691
Joined: Mon Jan 04, 2016 7:09 pm

Re: [Modding]A first scenario and little bit of modding

Post by Cablenexus » Tue Sep 04, 2018 11:40 am

Chris36 wrote:
Tue Sep 04, 2018 11:33 am
To get a short overview over this thread:
it contains 2 Mods in work.

1. A mod about Italy starting at 500 BC. All infos are in the first post of the thread
2. A mod thats just expanding the vanilla "Ancient Mediterranean" scenario to "Ancient Mediterranean XL". All infos in the last posts

I will open up a new thread to split the Mods.
Good idea to split it.

I'm looking forward to the Italy scenario itself the most. I like to see more content in the Workshop and I like your marketplace idea to see how it works out.
Also the scenario seems doable in a normal timeframe.

The XL scenario (please respect the game standards a bit regarding to size :P since not everyone has power pc's).
I'm doing a project myself now (Atlantis) and it's also a gift for one of the Kubat team (Helimadora) so I can not go in detail yet for suggestions for your mega scenario.
I hope to jump in later if I have a good start with the Atlantis scenario (with a lot of modifications).

Chris36
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 50
Joined: Mon Mar 10, 2014 8:44 pm

Re: [Modding]A first scenario and little bit of modding

Post by Chris36 » Tue Sep 04, 2018 11:51 am

yea right, performance is a very important one. I just read some minutes ago about the limit of 6400 tiles and thats im coming with the new map additions very near to: 5984 tiles. Even this needs to be tested on some machines. I got an "older" PC but still with a CPU and ram(4790k and 16 GB) that can easily take on intense applications but it would be interesting how it performes on machines with a lower profile.

One question to Pavel: is there a way to exclude tiles performance wise with impassable terrain or something like that? The whole east of germany should be terra incognita.

Post Reply

Return to “Aggressors Modding”