• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

[Age of Sail 2 Privateer's Bounty] Editing Discussion

RPearson

Landlubber
Hey Martes, some great pic. Funny I recently re-installed AOS2 and PB after a decade or more of not fooling with it any more. Way back I helped a guy from the UK hack parts of the sc file formats so he could put together a scenario editor for AOS2. I eventually wrote my own in Python. IIRC Sealords used them in making up the battles for their campaigns. PB came with its own editor. I think they kept using AOS2 for some reason though.

I only played solo and the AI is mostly brain dead in AOS2 but you could take control of both sides when things got too bad and help it out.

Look forward to seeing how your efforts at re doing the models turns out.
 
Do you still happen to have that script? I have the file specification for PB scenarios, and editor script would be very, very welcome.

As you can see, the AI in PB is also not the brightest, but generally you can find explanation for it's behavior.
Did you look at the model thread, there are some INI modifications I posted that make the game a little more bearable :)
 
There's no script per se. I wrote a gui app using wxpython. It was a big project for me at the time and I did it more as a learning exercise than anything else. I'd do it a bit differently now but as an amateur programmer I was happy just seeing it working. The code doesn't run in current ver of python/wx but I think the frozen copy bundled as a stand alone executable still runs in windows. That's actually why I reinstalled the games - the project was never finished and I always thought one day I would get around to it. I always liked AOS2.

Well the exe does run in win10 so if I can figure out how images are posted here I'll try to post a couple screen shots. That's another thing I was interested in but didn't pursue - PB scenario formats since they're pretty similar. AOS2 sc files worked in PB but IIRC not end right- no victories/defeats declared and ship locations with respect to land in the PB maps was off or maybe not that was long ago.
 
You can attach images by pressing "upload a file" button, and then either press to insert the image as thumbnail or as a whole, or, if you don't do anything, the image will appear as an attachment.

I think I ran AOS2 scenarios, but they were so terribly off the database, I didn't do that much.
And then I made my database, and it all became totally obsolete, so I can't say I remember any bugs.
 
Thanks, I give it a try.
The editor works with AOS2 scenario files creating new or editing existing ones. Campaign sc files are handled the same way but it can't create or modify the other campaign files. That was something I was hoping to add. It will take some effort to get it to work with current python and wx versions so can't really update anything till I get that sorted out. While the old exe runs I can't make changes to it.

general_tab.jpg

Above shows the files in the distribution package and the editor and console after you start the exe.

Here are some of the individual tabs:

shiplist_tab.jpg shipeditor_tab.jpg map_tab.jpg map1_tab.jpg shipDb_tab.jpg shipDbViewer_tab.jpg
 
Incredible. Just incredible :)
I sent you a PM, just in case.
 
Ok we'll try this. 2 zipped files. Unzip in a separate directory you have read and write access to. I think you only need to edit the caoseditor.ini with text editor like notepad to point to directory with the .exe and another directory with scenario files. There's a readme.txt you probably should read - it's designed for installation with AOS2 game installed so keep that in mind. I don't think you actually need the game installed - it only looks for .sc files ([edit] no it will look for map files too). Pointing to a directory with AOS2 scenario files (.sc) ([edit] also mapfile directory probably necessary) or just an empty one to save a new scenario file you create with the editor should work.

These are provided for evaluation purposes only and may contain bugs and other errors so use at your own risk.
 

Attachments

  • CAOSEditor061a-Part-1.zip
    1.3 MB · Views: 252
  • CAOSEditor061a-Part-2.zip
    1.3 MB · Views: 273
Last edited:
Downloaded, will try to play around.
What did you use to convert the database to your format?

Edit:
2 issues I found.

- It can't open scenarios with ships from customized database (crashes)
I might suggest that the editor could use the ships.ini and usrships.ini to create a database on load, if there is a conversion script. Also, as far as I know, PB scenarios store ship data inside themselves, if it was edited in the in-game editor.

- The PB version of the game does not have a basic map (seabattle.map) file, so it may be a root of some problems of AOS2 scenarios in PB. I could create a new scenario only if I added some other map with this name.
 
Last edited:
But nevertheless even in the current form the program is extremely useful to creating navigational maps of the in-game maps, since in PB you can't measure the depth at runtime, and do not see where the shoals are, for example. And "radar" window is too small in any case.

map_from_editor1.png map_from_editor.png
 
I used 3 sources for the database: 1) AOS2 free demo released before retail game had ships.ini in text format. 2) AOS1 IIRC had a text file with data base for ships 3) we extracted all ship data from the scenarios that came with AOS2 after we hacked enough of the .sc format. A total of 99 scenarios for the campaigns and 122 for std play after all the patches applied. The master database I put together is a composite of these 3 sources at least that's what I recall.

You need to use the database provided with the distribution or create a usr database using the editor. I think that capability is in the version I provided. I have a later update I was working on back in 2002, ver 0.70, I don't think I released it but that's the one I'm working with right now. Allowing import of other databases was something I was looking at. It won't work til I resolve the wxpython problems.

The ships database supplied with AOS2, ships.dat, is an encoded file. I don't recall if Tony Saunders or I ever decoded it back then but I can do it now with a script someone made for Seadogs files I believe. There is no ships.ini supplied with AOS2. A usrships.ini that comes in AOS2 is just an empty container.

PB has one called ships.ini that has the same kind of data but in slightly different format than in the database I use - different id nos for same ships but same number of items in each list. The data has some differences in values from my master DB but I found some differences in all the source I used for the same piece of data. I could set up the editor to read the PB ships.ini as a separate database but for now the easiest would be to convert it to the format the editor uses as a one time step.

I've looked at PB scenario files and there is additional data so the editor will not read sc files that were made in the PB editor or that came with PB. It's not that bad though as I think all the data in the AOS2 .sc files is found in the PB files but at different offsets. Once I get the editor to run again I can make any changes I need to. I can also hack the PB formats so it can read them. But that wasn't a priority for me. Both PB and AOS store ships data in the .sc files.

What database are you trying to use for the ships?

I can run AOS2 scenarios in PB that use the seabattle.map. I suspect it might be PB may default to a blank map if not known which is what the seabattle one is. The file contains only 6 bytes - 3 cr-lf pairs. The .map files are text files just add .txt to ext and double click.


[EDIT]Good to see it's working - at least that much. :cool:
 
What database are you trying to use for the ships?

The one from my post (here). I made a small database of various ship types, and in PB usually add their instances to usrships.ini (in the editor) and use them in the scenarios. They use models from modified models.ini list.

But the thing is, that since I am working on replacing models and adding various ship types, the databases are very, very fluid, and there will be little sense to make them fixed in any way.

In PB the ships.ini file is not encoded in any way, and the format is as follows:

Line 0: id, type, name, short_name, model
Line 1: num_cannons, rating, tons (hp), marines, year_launch, crew, country, fmast, mainmast, mizzen
Line 2: qd_guns, upper_deck_guns, fc_guns, qd_caliber, qd_carrs, qd_carr_cal, upper_deck_caliber, md_guns, md_cal, ld_guns
Line 3: ld_cal, fc_caliber, fc_carrs, fc_carr_caliber, speed, maneuver, gunport_height(ft = max Beaufort sea state), draught (ft)


"S010010","Ship","Queen Charlotte","Qu. Charlotte","120_gShip.shp",
118,1,2286,111,1790,765,0,650,650,650,
12,32,6,6,6,24,18,30,24,30,
32,6,2,32,7,1,6,25,

Attached you can find an example PB scenario that uses references to customized DB and shp configs. It won't work without them, but you can see how it's built from inside...
 

Attachments

  • _gun_test.zip
    526 bytes · Views: 212
Last edited:
Thanks for the file. Yes, the _gun_test scenario is for PB only. My editor and AOS2 can't read it correctly. PB scenarios have several additions to format 1st is 3F (63) extra bytes between resource map file name and start of scenario title data. I can play it in PB but AOS shows only file name in selection screen and wrong data for ships. It hangs while loading it to play.

My editor tries to calculate an effective broad side factor for the ships and it throws an exception at that point since data it reads is not correct for AOS sc file and it stops. I can probably hex edit the file so the editor will read it and I can see how it handles the database issue.

Only difference I see in the PB database is addition of "type" as 2nd item. AOS only has ships in data base so they didn't need it. All other items are included and at 1st glance they appear to be the same. My data base is simply a compressed CSV format with one line per ship and strings appear without quotes.

New types "Paddle-boat" and "Kamikadze" in the PB database appear to use same data format as "Ships" but "Balloon" and "Submarine" are different.

I can convert the PB database to the format my editor can read so I'll have a go at using any of the type "ships" in it.

[EDIT]
PS Here's the same data for the Queen Charlotte from my database. Note the different id used for the ship and a few minor differences in the data.
Code:
S010015,Queen Charlotte,Qu. Charlotte,120_gship.shp,100,1,2160,111,1790,765,0,650,650,650,12,30,4,12,6,24,12,28,24,30,32,12,2,32,7,1,5,24
 
Last edited:
I just went back and picked up the databases you pointed to in above post. Should be easy to work with them. I'll take a longer look later and maybe get something done tonight.
 
simply a compressed CSV format

Can it be opened/converted to regular csv with something? I couldn't recognize the format, unfortunately.

Also, I don't know if it may help with anything, but @kimov has compiled a database of various formats used by aos2, pb and early pirates games.
I used the scripts from there to unpack all the models and textures I otherwise had to extract using a hex editor.
 
I just went back and picked up the databases you pointed to in above post. Should be easy to work with them. I'll take a longer look later and maybe get something done tonight.

Oh, that would be great.
I just have to note that my current setup is already rather different, since I have introduced a set of models that have different .shp config names, simply because there are much more than basic types initially in the game (for example, the Belle Poule goes as 32_gfrigatefr_12.shp and 32_gfrigatefr_18.shp for both her variants, and many ships have *_g.*/ *_n.*/ *_v.* indices for georgian, napoleonic and victorian configurations respectively, and that's before fixed color settings, which I didn't do for most of the custom models yet). And it all changes all the time.
 
Can it be opened/converted to regular csv with something? I couldn't recognize the format, unfortunately.
Just append .gz to .sdb extension. It will open in any zip program that works with .gz compression. Should extract to a .txt file. You can read it into spreadsheet if you want (easier if you append .csv after extracting).

Also, I don't know if it may help with anything, but @kimov has compiled a database of various formats used by aos2, pb and early pirates games.
I used the scripts from there to unpack all the models and textures I otherwise had to extract using a hex editor.
Thanks I saw that. I wish I had it all 18 yrs ago.
 
Just remembered - "Paddle-boat" has one additional number at the end, supposedly speed under steam.
 
Back
Top