map creating problems

Talk about everything related to CoCoNet or Colonial Conquest!

Moderator: Kroah

map creating problems

Postby Christine » 29 Jun 2012, 15:13

hi there,

After posting "the map editor is easy to understand" I tried to figure out how easy it would be to create a custom map. Well, it seems not easy enogh for me. :)
I used the standard scenario to start modifying a map. Its was just a idea I have had as a little child:
A standard scenario with more major powers and corrected boarders for germany and, of course, the nederlands).
I did this:

modified the german borders (berlin, prussia and added bavaria)
splited the "ottoman empire" in 3 coutrys (its a major now)
splitted spain into 3 countrys and "majorizied" it
splitted italy into 3 c. and maked it major!
...same with austria hungary as well

the new ids for the countrys are from 131 to 140.

I added the "group id" with right group areas for the new majors.
...gave them new major ids
I added some colors to the "major colors"-tag
changed the flag locations by hand (the cellx/celly attribute)
and changed the major-id tags like this:
<Name>Austria-Hungary</Name>
<DefaultFlagIndex>9</DefaultFlagIndex>
<DefaultColorIndex>9</DefaultColorIndex>
<DefaultGroupId>9</DefaultGroupId>

of course, i changed the "adjectedAreasId"-tags as well but i did NOT changeed the ZoneIDs (this is just to display the ships, or not?)

I changed the map.png and the flags.png.

Did I forgot something? The map does not work at the moment. The map editor as well as the game crashes when I try to load the map. It would be nice to have a little debug tool build into the mapeditor. ;)

Greetings
Stine
Attachments
Map Editor Exceptions.log
(25.66 KiB) Downloaded 373 times
CoCoNet Exceptions.log
(47.69 KiB) Downloaded 339 times
map.txt
the map.xml file
(67.64 KiB) Downloaded 339 times
Christine
 
Posts: 69
Joined: 31 May 2012, 11:04

Re: map creating problems

Postby Kroah » 30 Jun 2012, 14:52

Christine wrote:[code] <DefaultFlagIndex>9</DefaultFlagIndex>

Do you have added the flags to the picture "flags.png" ?
This file contains the flag sprites, the first column on the left is index=0, then index=1, etc.
You give an index of 9, so the file should contains 10 columns.

Please, provide your full custom map folder so i can help you further.

Christine wrote:It would be nice to have a little debug tool build into the mapeditor.

When a map is loaded, a validation is done to check for invalid values. There are so many things to check, we can't be exhaustive.
But we can still add new checks to give specific error messages instead of a stack dump.

For this error, a new message will explain the flag is not in the "flags.png" file:
FlagIndex is out of bound (current=9, max=5, "flags.png" contains only 6 flags).
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France

Re: map creating problems

Postby Christine » 30 Jun 2012, 15:47

Kroah wrote:
Christine wrote:[code] <DefaultFlagIndex>9</DefaultFlagIndex>

Do you have added the flags to the picture "flags.png" ?

Yes, I did.

Kroah wrote:When a map is loaded, a validation is done to check for invalid values. There are so many things to check, we can't be exhaustive.
But we can still add new checks to give specific error messages instead of a stack dump.

For this error, a new message will explain the flag is not in the "flags.png" file:
FlagIndex is out of bound (current=9, max=5, "flags.png" contains only 6 flags).


Strange. But okay, maybe its the default value of the "compression value" in gimp that couses this error. Ill test it first without compression... but png compression works afaik in an other way as the (ugly) jpeg compression. Ill reboot and test it again, bbs. ;)
Christine
 
Posts: 69
Joined: 31 May 2012, 11:04

Re: map creating problems

Postby Christine » 30 Jun 2012, 15:57

No, it wasnt the compression value. Here's the complete folder. Thanks for your help ;)
Attachments
Nieuw Standaard.zip
(78.47 KiB) Downloaded 356 times
Christine
 
Posts: 69
Joined: 31 May 2012, 11:04

Re: map creating problems

Postby Kroah » 30 Jun 2012, 20:49

Hint: look at your Italia flag and compare it to the others ;).
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France

Re: map creating problems

Postby Christine » 01 Jul 2012, 01:04

argh... well, I have a really good excusion: My glasses are in repair. 1 pixel... *argh* Well, ... I hope others wont have such problems. I really know how boring it could be to code against the "stupidity" of the users. I wont bother you with ideas for some if-questions again. ;)
Christine
 
Posts: 69
Joined: 31 May 2012, 11:04

Re: map creating problems

Postby Kroah » 01 Jul 2012, 02:46

With the new error message i explained above, if someone else does the same mistake, he will understand that something is wrong with the flag picture.
So your feedback helps in this way and isn't useless, people will thank you to have more specific error messages.
And you don't bother me either, Satuaria :wink: .
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France

Re: map creating problems

Postby Christine » 04 Jul 2012, 00:22

Oh, you know my ingame nickname. Yes, thats me. :)

Other problems I get last night are really really strange. The strangest was:
If you're using one of the colors from russia or usa (for example the darkblue from sibiria) in an other country, the game chrases while the map editor still loads the map without any problem.
Eeeerr... I mean if using these colours within the map.png. For example: My newly created italy was blue...
this was a really frustating problem.

An other strage thing is:
I created "leon" (I splitted spain for using it as a major) and leons flag was a bit more uppon the ocean then uppon the land. After conquering this province I saw the atlantic going green - but france havent had a great fleet at this moment. ;)
But after moving the leon-flag 1 field down the failture was gone. I think its just because I diddnt understand the "fill"-thing in the editor (how do I use it?). But strange is that after moving the flag over the land, the land dont gets another colour after conquering the province. So if I only dont understand the "fill" function, why figured my france empire out how to conquer the ocean? ;)


But that was just in the middle of the debuggin scenario:
the first thing I ever saw on my modifed map was: the ocean gets another color. hu? It was darkYellow like my ottoman empire.
I can remember that I fixed it while fixing the bug that the flag-coords were on an other position.
This was because the map wasnt read in correctly... Im not sure, but I think this happend because 2 countrys have had the same name? Or was it because italia was sometimes called italy and sometimes italia?
Well, whatever it was.. that was my fold but it was a little bit frustrating to figure out how to fix it.

After I fixed that, I saw the next problem:
the flag-picutres where moved by some pixels... I dont mean the flags itself, I just meaning the flags from the flags.png.
I'll fixed that after copying the original flags.png over my new flags.png (and I only used the 6 original major-graphics for copying). Maybe the compression value of the picture caused the problem. Maybe not. Whatever... Iam sure that my last problem could be fixed the same way:
the ships have an black background.


After all, I only have created 10 new countrys:
splitted spain into: madrid, catalonia, leon and build a new major uppon
splitted italy into: upper italy, rom, neaples (including sicily), maked it major
splitted the ottoman empire into turkey, mekka, iraq and mojorized it
spliited austria-hungary into austria, bohemia, serbia and maked it a major
added bavaria as german province
added netherlands as neutral
----
= 10 new country.
The amount of time used to do that was really much more than I had espected. I think it was about 2 hours or something...

the only grash I had was the crash with the colors explained above, so logfiles are included...
Attachments
CoCoNet - Client (Satuaria) - GraphicsAdapter.log
(10.32 KiB) Downloaded 339 times
CoCoNet Exceptions.log
(124 KiB) Downloaded 357 times
Christine
 
Posts: 69
Joined: 31 May 2012, 11:04

Re: map creating problems

Postby Kroah » 04 Jul 2012, 01:15

First, can you send the map(s) folder concerned by the crash(es) ?

The filling method for the original maps (standard, 1880, 1914) is not the same than custom maps (well, you could, but original method is way harder to set up).

1) Original flood fill method:
This is the well known 4x directionnal flood fill like explained in the wiki: http://en.wikipedia.org/wiki/Flood_fill
In the picture "map.png", the map is already filled with 2 colored patterns. To fill a country with a plain color, CoCoNet first fills the country with one of the color of the 2 colored pattern, then with the major color.
You can see this method in slow motion in Colonial Conquest : a country is filled with 2 consecutive colors.
Pros : simple fill method
Cons : the pattern to be filled must be hand edited so that when the first fill is done, it must remains only 1 color in the country (you can see this "hand edited" thingy by zooming at the borders of an original map). You can't use the autofill pattern implemented in CoCoNet because some pixels in the border should be hand edited.

2) New method, used by the included custom map :
The flood fills an area up to a specific color called "border", in this case RGB #010101, whatever the area contains, it will be overwritten (although you can specify a transparent color). If you let a single pixel at RGB #000000 for example, the flood will overflow and may fill the ocean.
To specify the border color in the xml: <BorderColor>#010101</BorderColor>
Pro : you don't have to hand edit the map and you can even let CoCoNet fills with computed patterns (look at the included custom map "map.png" and how patterns are generated at runtime).
Cons : none known

If you have enhanced an original map, i think you use the first method.

Concerning the "fill" tool in the editor :
Each country has a variable number of "fills" (0 to n). A "fill" is a point relative to the country flag. When a country's owner changes, every fill points for this country will be the starting point for a flood fill.
Be aware those points are relative to the country flag, ie. if you move the flag, all the fill points linked to it move too.
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France

Re: map creating problems

Postby Christine » 04 Jul 2012, 15:34

Thanks. I created some fills by hand and after some hours the scenario is nearly ready to ship. Bug theres still a bug: after some rounds the game crashes.
And: I cant find the reason why the ships-sprite isnt transparent any more (it has a black background).

Well.. I included the saved game (it will crash directly after it starts) and the hole scenario.

I could not reproduce the bug explained above (with the countrycolours), but maybe somebody will remember it than bug accours again. What ever it was... it was'nt the mapfile alone.

ps. the extension ccn is not allowed.
Attachments
Nieuw Standaard.rar
(85.85 KiB) Downloaded 400 times
AutoSave.ccn.txt
(776.04 KiB) Downloaded 345 times
Christine
 
Posts: 69
Joined: 31 May 2012, 11:04

Re: map creating problems

Postby Christine » 04 Jul 2012, 17:57

Oh, and btw .. it crashes woth the comment "area src isnt adjecent to area dst".

looks as it is my fould, but I really dont know which country is making problems here... it looks also courios because I checked all new countrys land by land. ... whatever. Maybe it isnt much work to show the user which country is src and which is dst. ;)
Attachments
CoCoNet Exceptions.log
(300.38 KiB) Downloaded 337 times
Christine
 
Posts: 69
Joined: 31 May 2012, 11:04

Re: map creating problems

Postby Christine » 04 Jul 2012, 18:40

I found out (with a little help of your cool map editor) that some provinces connected only in 1 way to other. For example:
from berlin you cant go to belgium
but from belgium, you can go to berlin.

After fixing that, the problem's gone.

But ... I dont see a real logical reason for that, but some others may want to create scenarios there country a can go to b, but b cant go to a. I've seen a lot of fantasy-scenarios in many games... someone always gets strange ideas (strange, but maybe good ones).
Christine
 
Posts: 69
Joined: 31 May 2012, 11:04

Re: map creating problems

Postby Christine » 14 Jul 2012, 11:27

This time I get an MsgBox with:
"Map/PatternDefault/@ImageIndex is mandatory.
Expected: integer value or random value '[a;b]' in range [0;+oo["

What ever the mapeditor and the game is trying to tell me, I dont understand it. Ive done much before the last save:
created new regions
edited the map (colorated some countrys)
gave the new countrys some readable names
connected zones and areas

A line number would be helpfull like it comes in some alertboxes.
But interessting is:
then I click uppon "reload map" (in the editor), the map just realoads and the new country names i've edited appearing on the map.
then I edit some links and save the map, the editor just saves it without any problem.

It would be helpfull the do the checks - witch are done by loading the map "from scratch" - in the save map and reload map function, so an editor would notice the problem much earlier (maybe directly then it appears).


EDIT:
the prob was: the "create area" button creates an fill with a "random pattern" entry. I dont use random patterns (but have the png file in the folder). This explains the ImageIndex message, but not the rest.
Christine
 
Posts: 69
Joined: 31 May 2012, 11:04

Re: map creating problems

Postby Kroah » 15 Jul 2012, 04:13

Christine wrote:But ... I don't see a real logical reason for that, but some others may want to create scenarios there country a can go to b, but b cant go to a. I've seen a lot of fantasy-scenarios in many games... someone always gets strange ideas (strange, but maybe good ones).

There is no "logical reason" behind this. Actually some parts of the ported code and the vanilla AI use both links depending on the situation. For example, if the AI wants to know if A is connected to B, it checks the first of the two links (it may be A->B or B->A).

To prevent incorrect AI and game behaviors, links should be bi-directional. It may change in the future but is not on my top priority list.
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France

Re: map creating problems

Postby Kroah » 15 Jul 2012, 04:41

Christine wrote:This time I get an MsgBox with:
"Map/PatternDefault/@ImageIndex is mandatory.
Expected: integer value or random value '[a;b]' in range [0;+oo["
[...]
A line number would be helpful like it comes in some alertboxes.

There's a mistake in the message.
The path should have been:
"Map/Settings/PatternConfig/Default/@ImageIndex is mandatory."
With this information, you could have checked the corresponding tag int the xml file (no line number is required).

As you have understood it, it's used when RandomPattern="True" in a Fill tag.
In fact, a Fill tag can include a Pattern tag, and if this one is missing, it defaults to Map/Settings/PatternConfig/Default
This information will be part of the documentation.

Christine wrote:It would be helpful the do the checks - witch are done by loading the map "from scratch" - in the save map and reload map function, so an editor would notice the problem much earlier (maybe directly then it appears).

The exact same checks are done by "loading the map from scratch" or by clicking on "Reload".
If you don't have the same behavior (like you described it). This is a bug. I may fix it if you send me the map giving this incorrect behavior.
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France

Next

Return to CoCoNet Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron