[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 2
  • 1
  • 2
  • »
Forum moderator: Daddio, Cichor  
Forum » Cossacks I » Modding » First steps in Modding (I need help:))
First steps in Modding
BzikDate: Monday, 28/November/2011, 10:20 PM | Message # 1
Baron
Group: Checked
Messages: 43
Awards: 0
Reputation: 0
Status: Offline
Hi!

Its my first post so I want to welcome everybody!

Well, after long years i decided to play again in Cossacks and (again:) I imediately fall in love with this great game.
7,8 years back there was no info of how alternate annoying things in gameplay, so you played it as it was. Now, after reading articles about modding (big hugs to Angel, GREAT work), I decided to change and add few things.
The basis for my MOD is Imperia engine, which is IMO big step forward and real gameplay boost for C1 series.
The basic modifications with NDS or MD files works well. The problem occured when I completely removed Sapper unit from Poland (edited only Poland.NDS file).
First, there was no errors in Editor mode. When I played as Poland, I made all improvements from 17th to 18th and then to 19th century. Imperial Caserne works well even without posibility to create Sapper and I played without problems against AI.
But when I choose Poland for computer, when AI made town hall upgrade to XVIII century, each and everytime game crashes with comment: "TryUnit: invalid <UnitType>".
What is cause for that crash, anybody know?
Thanks in advance for any help!

Cheers!
bzik

PS. I read about Multiplayer problems with Imperia. I'm making this MOD mainly for future matches with my friend on LAN.
Do any of you encountered any problems while playing Imperia 1x1 on LAN? I'm planning to put lot of effort in this Mod,
so I want to be sure that my time won't be lost.
 
EbelAngelDate: Tuesday, 29/November/2011, 1:20 PM | Message # 2
Site Administrator
Group: Administrators
Messages: 996
Awards: 7
Reputation: 12
Status: Offline
Quote (Bzik)
But when I choose Poland for computer, when AI made town hall upgrade to XVIII century, each and everytime game crashes with comment: "TryUnit: invalid ".


Hi and welcome to the forum.

It is mostlikely because the ai is trying to build that unit but can't find the unit anymore in the . NDS file.
Which units the ai will attempt to build in specified in the AI\Poland.dll file.

I suppose there are ways around this problem, though i must say i havent modded CI for some time now and I forget rapidly how the files are all related.
Alternatively, write a new ai.dll for the nation.


 
CichorDate: Tuesday, 29/November/2011, 1:56 PM | Message # 3
Earl
Group: Moderators
Messages: 232
Awards: 4
Reputation: 3
Status: Offline
Quote (EbelAngel)
Alternatively, write a new ai.dll for the nation.


But how? Last AI programmer from Poland was [FeI]Jarema Wiśniowiecki (made AI for 17th c Historical Hardcore Mod) but he gone a few years ago.

@Bzik,

If you need help in Polish, visit http://kozacy.org/


I apologize for my english.



Uploaded with ImageShack.us

http://www.kozacy.org/
http://forum.kozacy.org/
 
EbelAngelDate: Tuesday, 29/November/2011, 2:07 PM | Message # 4
Site Administrator
Group: Administrators
Messages: 996
Awards: 7
Reputation: 12
Status: Offline
Quote (Cichor)
But how? Last AI programmer from Poland was [FeI]Jarema Wiśniowiecki (made AI for 17th c Historical Hardcore Mod) but he gone a few years ago.


With this ( http://cossacksworld.ucoz.co.uk/load....1-0-112) one should be able to create new ai.dll files. they contain the source files . Ofcourse c++ and knowledge off it are required.


 
EbelAngelDate: Tuesday, 29/November/2011, 3:21 PM | Message # 5
Site Administrator
Group: Administrators
Messages: 996
Awards: 7
Reputation: 12
Status: Offline
I was a bit short in my answers to both off you earlier on. Let me explain in more detail the things to consider, choices and decisions to make...

Let's start with this one:
Quote (Bzik)
PS. I read about Multiplayer problems with Imperia. I'm making this MOD mainly for future matches with my friend on LAN.
Do any of you encountered any problems while playing Imperia 1x1 on LAN? I'm planning to put lot of effort in this Mod,
so I want to be sure that my time won't be lost.


First off all, before anything else, if your main goal is to make a mod that you can play online with your friend based on the imperia engine, then you should try to play a game with your friend online with imperia. If that works for you both, then you can proceed with your initial intention. Ensure that the both off you have the same installation off imperia, so no synchronisation errors appear.

If you are indeed just making this mod for future matches with your friend on LAN, then the issue you are having :
Quote (Bzik)
But when I choose Poland for computer, when AI made town hall upgrade to XVIII century, each and everytime game crashes with comment: "TryUnit: invalid ".

becomes irrelevant, because I assume when you play online , it will be against your friend and not against the AI. So you dont really need the AI.

Now as to the problem itself:

Quote
"TryUnit: invalid "

As i'v said earlier, you have made changes to the Poland NDS file and the AI(nation).dll in imperia will try to build that unit, but no longer can find it in the NDS file, since you have deleted that unit.

So what can you do:

- Since you are focussed on multiplaying with your friend, rather than against an AI ,you could get away with it, by letting the AI keep the current Poland.NDS as its source to build its nation on (as defined in AI\AI.dat ) and you and your friend could play with a new Poland.NDS, that means you will in effect make a new nation. This will require changes to the names used in the NDS, nations.lst and any related files needed to duplicate a nation (http://cossacksworld.ucoz.co.uk/index/0-150). There is a small downside to this method, that is that you will have 2 polands (old and new) in your nation dropdownlist to play with. I suggest you move the old one to the bottom so you dont pick the wrong nation to play with.

- About this one I'm not 100 % sure, as I have never tried it out, but rather than deleting the sapper completely from your NDS file, just dont allow it to be visible in the barracks for players. ( [FIXED_PRODUCE] section ) . There is a possibility that the AI will still be able to build the unit then and not give you the error. But one should test this because I havent tried it.

- If however you do want the AI to be able to play , with the new changes you are doing to your NDS file, then there is but one option and that is to make a new AI.dll.
The link I posted earlier ( http://cossacksworld.ucoz.co.uk/load....-0-112 )

To elaborate on this:

Quote (Cichor)
But how?


First off all, that AI source is an updated version for the Art off War ( which works on Back to war aswell, except for the new nations in BTW). You have to look at this source as a example or a starting point. It beats having to create an ai.dll from scratch.
Since you are building on Imperia, none off the imperia units are registered in this AI and none off the new upgrades nor will it attempt to build any.
But you have an example off how an AI runs. Adding more ( new) units and upgrades comes down to copy - pasting existing lines and changing the unit (monster description ~MD names) to the new ones.

It will be a lot off work, but since you actually managed to make modifications to poland and get it to work in game already just by reading the few things I wrote about modding CI here on the site, gives me the impression that you are capable.

I just tried out the source files for the AI, just to see that they actually can be compiled. I managed to compile Austria.dll successfully without errors , just a few warnings. Those can be ignored.
To be more specific: the source files were created in Visual C ++ version 6.0.
It is therefor highly suggested you also attempt any changes in this workspace. You may get away with it in Visual 7.0 ( 2003 version) but it will ask you to convert and possible errors may start to appear.
For Visual C++ 6.0 you will require Windows XP ( in dual boot or separate) on your computer, because it is not compatible with Windows Vista or Windows 7.

I hope that gives you enough information to make any necessary decisions towards your mod and determine wether to spend any time on it.

Ofcourse , if you have any more questions or problems, dont hesitate asking.

Best Regards

E.A.


 
BzikDate: Tuesday, 29/November/2011, 11:17 PM | Message # 6
Baron
Group: Checked
Messages: 43
Awards: 0
Reputation: 0
Status: Offline
EbelAngel, Cichor thanks for replies.

Cichor, thanks for link, I will check this site.

EbelAngel, it will be fun if I could play against AI with my modifications. To be honest Im not "computer guy", but I learn fast, so creating this mod is my little next life challenge:) I want to add some new buldings and change tech tree, so If I want to play against computer It looks like I need to tweak AI files. Its not my priority right know, but I look carefully at this topic.

Quote
- About this one I'm not 100 % sure, as I have never tried it out, but rather than deleting the sapper completely from your NDS file, just dont allow it to be visible in the barracks for players. ( [FIXED_PRODUCE] section )

If I remember correct, this was the first thing I tried to do, but deleting only one line shows error in Editor or other modes. All entries are somehow connected, so you need to delete everything. But I try again to be sure and report results.

Quote
It will be a lot off work, but since you actually managed to make modifications to poland and get it to work in game already just by reading the few things I wrote about modding CI here on the site, gives me the impression that you are capable.

Well, you described a LOT of valuable informations, without it I would not even think about one single change.
Once again thanks for answers.

Cheers,
Bzik

Added (29/November/2011, 11:17 PM)
---------------------------------------------

Quote
just dont allow it to be visible in the barracks for players. ( [FIXED_PRODUCE] section

Just tried, great tip, AI works fine:)

I want to mess a little with terrain options in random map: make plateus bigger (eg. in random map plateus are to small tu build there fortress etc), create "forests" instead of few small group of trees and stones here and there (more room for buildings in one place, city more "tight"). Ive found some dat files with terrain data, height, angle etc. will check it.
Do some of you ever changed .smp files? If im thinking right, these are graphic files of trees, stones. Cant find any software to open these files and check what is what.

Regards,
Bzik
 
EbelAngelDate: Wednesday, 30/November/2011, 9:33 AM | Message # 7
Site Administrator
Group: Administrators
Messages: 996
Awards: 7
Reputation: 12
Status: Offline
Quote (Bzik)
Just tried, great tip, AI works fine:)


Good, at least that error is solved then.

Quote (Bzik)
I want to mess a little with terrain options in random map: make plateus bigger (eg. in random map plateus are to small tu build there fortress etc), create "forests" instead of few small group of trees and stones here and there (more room for buildings in one place, city more "tight"). Ive found some dat files with terrain data, height, angle etc. will check it.
Do some of you ever changed .smp files? If im thinking right, these are graphic files of trees, stones. Cant find any software to open these files and check what is what.


If you want to change existing terrain, then there are 3 main files involved if i recall correctly: .dat, .msp and .smp (sample) files.

You can go to the editor, create a piece off terrain and then you can create your own samples (.smp )by outlining an area and pressing ctrl + c to copy a sample. Use ctrl +v to paste and or see a list off existing ones.

These samples are stores in the UserPieces folder. But you will have to use identical names ( in other words , proper replacement) because these samples are being called upon from the .dat or .msp files.

The .dat files can be edited with notepad.

As to the .msp files I dont remember how. I'd have to think about it, but somehow I doubt those can be easily edited as they can in Cossacks 2.

In short: i think you can change forrests ,stones , mines and textures ( .smp) but I doubt you can change terrain (.msp)

Regards.

E.A.


 
BzikDate: Friday, 02/December/2011, 7:32 PM | Message # 8
Baron
Group: Checked
Messages: 43
Awards: 0
Reputation: 0
Status: Offline
Hi!

Thanks for ideas. I will check today all listed files.
Also I'll try to import some graphics (ACFB? C2?). First I want to change grass texture, I never liked it. Probably lot of work but I want to give new look to good old Cossacks game:)

Added (02/December/2011, 7:32 PM)
---------------------------------------------
Hello,

I've managed to import some trees and stones textures from ACFB to Cossacks. Unfortunately this textures are very small, at least 5 times smaller in Cossacks than in ACFB. Whats interesting, textures are tiny already after extraction from main game file "ALL". Same apply for wildlife. Any idea how to fix the size of objects?
EbelAngel, I know that youre modding C2, so maybe you know in which files grass textures are stored? Maybe in C1 its similiar location. Looks like its not .GP files. Also do you ever tried to convert textures from C2 to C1? I see tutorial in C2 modding section, but I need help in reverse conversion:)

Regards,
Bzik

 
EbelAngelDate: Saturday, 03/December/2011, 1:10 PM | Message # 9
Site Administrator
Group: Administrators
Messages: 996
Awards: 7
Reputation: 12
Status: Offline
Quote (Bzik)
I've managed to import some trees and stones textures from ACFB to Cossacks. Unfortunately this textures are very small, at least 5 times smaller in Cossacks than in ACFB. Whats interesting, textures are tiny already after extraction from main game file "ALL". Same apply for wildlife. Any idea how to fix the size of objects?


Just to be clear: we are talking about stones.gp and trees.gp here right? You find the sprites in there much smaller than the one's from AC? Do you find them looking smaller ingame or just by looking at the extracted .bmp files?
Because I imported both Cossacks 1 and AC stones into Cossacks 2 and I don't find them to be much smaller ingame. I could show you, the small stones look just a tad bit smaller than the AC stones, the single stones that is, ofcourse AC also has these larger stones as in C2.
Have you tried them in game yet? And if you still find them too large, because agreed, most things in AC and C2 look oversized compared to C1, then I see 2 options:
- Manually resize them in photoshop, (canvas size), which could turn into a bit off work, unless you set up a photoshop script to repeat your actions on all sprites (or)
- Try out the scaling options in Megapack. That is, you "repack" the AC stones first with scaling options, its by default set to 1/2, 1/4, 1/5,... so its instantly resized by half or more. When you have done that, extract them again, compare to see if it matches the C1 stone/ tree sprites , and only then add them to the C1 stones / trees and pack up ( otherwise you will also resize the C1 stones sprites if you add them immediately, but you know that happy )

Quote (Bzik)
so maybe you know in which files grass textures are stored? Maybe in C1 its similiar location. Looks like its not .GP files. Also do you ever tried to convert textures from C2 to C1?

Yes.No.Indeed.No

Grass textures ' and the rest off them are drawn from 1 file: tiles3.bmp . There is also tiling.txt and textures.lst

What you see is what you get with this file. I did try to add more textures to this file in C2 and as I'v learned its size is fixed,it seems directed from the engine. What you can do however is replace this file with a new one. I suppose its no different in C1. But I could be wrong, because I dont fully understand how tiling.txt works, so maybe there is another way to add more (new )textures.

In other words, all the textures are in this file, if you want to change one, you will have to paste a new texture over the existing one. But I must say , you will have to be very precise, if the new texture is off by one pixel you will see it in game. May I suggest a decent image software for this, rather than using paint.

Let me know how it works out for you.

Regards.

E.A.


 
BzikDate: Saturday, 03/December/2011, 3:44 PM | Message # 10
Baron
Group: Checked
Messages: 43
Awards: 0
Reputation: 0
Status: Offline
Angel,

Take a look at this screen:

Stone and tree from left are imported from ACFB. As you see its tiny compared to third tree which is original Cossacks sample. I'm interested in big trees, just like in AC. Last two trees are edited in photoshop. 4 is tree enlarged inside photo, 5 is whole bmp file enlarged. Despite softeing/sharpening the quality is poor. Whats more, there is other problem - pikeman is colliding with sprite of tree.
Maybe you have some ACFB samples properly extracted in some pack? I checked for sample pack in C1 modding download section, but link is dead.
Quote
Try out the scaling options in Megapack

Like I said: trees, stones and wildlife gp's extracted from ALL.gsc are already tiny. For example in GP View pikemans are ok, but stones are small. Maybe there is some error with software? Who knows...

I figured out tiles3.bmp yesterday, I tried to import beautifull grass texture from C2 to tiles3, but result was poor looking. The samples in tiles3 are to small in comparison to GRASS1.bmp in Ground folder of C2. Ehhh, its my dream to see real grass in C1:)
Its strange that in ACFB editor mode "grass" is simple texture like in Cossacks. But in any game mode, you have pretty samples of grass, flowers (for example: GROUND+TEX6.BMP). Do you maybe know what file is responsible for using this bmp textures in playable modes? Anyway I will seek for other answers today.
Thanks for help and good luck with your mod.

Bzik
 
Forum » Cossacks I » Modding » First steps in Modding (I need help:))
  • Page 1 of 2
  • 1
  • 2
  • »
Search: