Improved WorldBuilder

It's not in the svn yet, feel free to add it ;)

If it works well enough and AbsintheRed is using it, then he should just upload it to the SVN. As I said, I simply don't work with the map.

I am working on new and up-to-date documentation and I was thinking of ways to add maps of Core and Normal areas as well as the maps. I thought of adding the visualization features and then taking screenshots would work great, but I can't see how to get the Settlers and Wars maps to work right.
 
In python i use the function
Code:
CyEngine().fillAreaBorderPlotAlt(plotX, plotY, iAreaBorderLayer, sColor, 1.0)
where areaBorderLayer is an integer that is different for each color. This way every color gets is own border. In C++ it is probably the same. Just make sure if you use your own areaBorderLayer constants to clear those layers manually when they are no longer needed.
In python this is done with
Code:
CyEngine().clearAreaBorderPlots(iAreaBorderLayer)
I think there are at least two versions fillAreaBorderPlot and fillAreaBorderPlotAlt. They are slightly different in how the area is colored.
 
If it works well enough and AbsintheRed is using it, then he should just upload it to the SVN. As I said, I simply don't work with the map.

I'm fine with this of course, even if it's mostly for the modders
Caliom, what's your further plans?
Do you still work with the city name maps, or with core and normal areas?
 
Finally here is the new version. I worked the whole day on it and i'm quite satisfied with it. Hope everybody will enjoy this :)

changes:
- Reworked the CityNameMap Modus (changes aren't lost when switching modes or alt-tabbing to windows. City names can be removed)
- added a new popup for city name editing. It gives a hint what the other civs city names are for the current plot (see screenshot)
- original signs (landmarks) on the map are temporarily removed when you enter the city name mode and restored when you leave it. (To ensure that all signs are restored, switch to the "choose again option" in the player dropdown before you leave the the city name mode)
- added visualization for Core and Normal Areas.
- separeted the new worldbuilder code from the original worldbuilder code. The original code is altered only minimally and the new code is easier to maintain/extend
- added setPopupHandler functions to RFCEventManager that support dynamical adding of new popups.


open issues:
- alt-tab-problem. When switching to windows and back to civilization, the worldbuilder resets to UnitEditMode.

future plans
- also add visualization to the minimap where appropriate
- clean up code
- sort the city names in the new popup alphabetically
- make core and normal areas editable ;)
 

Attachments

  • CityNamePopup.jpg
    CityNamePopup.jpg
    80.6 KB · Views: 86
Yes. I will post it today :)

And how do you want to solve core and normal areas?
I think the best would be to drop the current system of coordinates in the python
We can always create a new python file for them, for example RFCEAreas.py, and handle them the same way as settler and war maps are handled

EDIT: Ohh, crosspost
 
A few quick feedback:
You probably messed something up with the values for core areas
The last column and lowest row doesn't show up for any of the civs
The extra areas are also not shown (tExceptions in the consts.py)
Somehow I also spotted an extra tile for the Dutch (at about 5N 2E from the closest tile), which shouldn't be there according to the python file

I really think it should be easier to handle these core and normal areas as maps too
Converting those files shouldn't be that hard, and would be much easier to update and maintain them that way
I guess it would be also easier for you to make them editable

EDIT: For normal areas the rightest column and lowest row also missing
I guess it's only a small mistake in how you calculated the BL and TR coordinates
But the subtract areas are working fine :goodjob:
 
The city name maps look great, good ideas there!
One problem though: When you enter the sign mode, the original signs disappear
What if I want to put down a few for another reason than city name editing?
It doesn't that important in most cases, just want to be sure here:
Now you more or less sripped down the sign mode from it's original function, right?
So it doesn't even work like it was intended to be

EDIT: Never mind this
Problems only appear with it after you used the city name maps once
If you only use the Signs without messing with city names previously, the original function works perfectly

EDIT2: I think I noticed what's the exact issue there:
It seems that when you have original signs on the main map, and edit a civ's city name map that also has signs in that area, the original signs dissappear even after you switch back from edit mode
The other main map signs remain intact, only those ones are missing that should appear on both places
 
A few quick feedback:
You probably messed something up with the values for core areas
The last column and lowest row doesn't show up for any of the civs
Thanks. Its hard to see everything on your own. I fixed it and updated the zipfile in the previous post.

AbsintheRed said:
One problem though: When you enter the sign mode, the original signs disappear. What if I want to put down a few for another reason than city name editing?
I thought of that too. I tried to backup all signs and restore them when you leave the city name mode. It should even work, when you use alt-tab. Try it out.

AbsintheRed said:
EDIT2: I think I noticed what's the exact issue there:
It seems that when you have original signs on the main map, and edit a civ's city name map that also has signs in that area, the original signs dissappear even after you switch back from edit mode
The other main map signs remain intact, only those ones are missing that should appear on both places
Damn, you are right. That's the problem that you cannot delete a sign and add a new one to the same plot in one action. Very annoying..
I don't know how i should reasonably block an action that would leave the city name mode to include a "dummy action" that removes the city name signs first.
One thing i could do, and i already testet this, would be to use the strategic layer signs instead of the landmarks. But then i had the same problem if someone wants to use those signs. And i had to temporarily remove the landmarks anyway, because you cannot read the signs anymore if there are two on the same spot.
 
Thanks. Its hard to see everything on your own. I fixed it and updated the zipfile in the previous post.

Of course, and you did a really great job with all this!
I'm happy to help with a little feedback :)

Damn, you are right. That's the problem that you cannot delete a sign and add a new one to the same plot in one action. Very annoying..

No problem, it can even stay this way
If I understand the code correctly, everything should remain fine is you only use either the signs, or the city name maps
And that's not a too big restriction, to be honest ;)
 
If I understand the code correctly, everything should remain fine is you only use either the signs, or the city name maps
And that's not a too big restriction, to be honest ;)

It should restore all signs, when you switch to the "choose again option" in the player dropdown, before you leave the city name mode.
So i will probably leave it as it is.

Edit: I think i will add a message when signs are detected during the backup to inform the user what to do to ensure that all signs are restored.
 
As far as I can tell the respawn areas are still missing their rightest and lowest part
(with the second version you posted today)
Spawn areas work perfectly

Also, I noticed we lost the Reveal all toles and Hide all tiles option in visibility
There was no place for the icons, or it wasn't intentional?
 
It should restore all signs, when you switch to the "choose again option" in the player dropdown, before you leave the city name mode.
So i will probably leave it as it is.

Edit: I think i will add a message when signs are detected during the backup to inform the user what to do to ensure that all signs are restored.

Oh, cool.
The message sounds good to me

EDIT: You also have to switch back to Sign mode (or to switch away somewhere) before you quit worldbuilder
That's when the original signs are actually restored from memory, right?

EDIT2: No I was mistaken here, sry
Even if you quit directly from the city name mode from WB it works fine
 
As far as I can tell the respawn areas are still missing their rightest and lowest part
(with the second version you posted today)
Spawn areas work perfectly

It surely is late :sad:. Fixed it.

Also, I noticed we lost the Reveal all toles and Hide all tiles option in visibility
There was no place for the icons, or it wasn't intentional?
I removed them intentionally. Thought they where of no use. But now that i think of it i should restore them. It's no good to remove funtionality. But they will only work for the visible map. I think it makes no sense to use it for other maps too.
 
It surely is late :sad:. Fixed it.

No prob and no rush for fixing these, just pointing them out if I think I find something
Will look into the new version too ;)

I removed them intentionally. Thought they where of no use. But now that i think of it i should restore them. It's no good to remove funtionality. But they will only work for the visible map. I think it makes no sense to use it for other maps too.

I only used it for modding, and very rarely
They are not too important though, so it's not a big deal if they are left out
Anyway, if it were up to me, I would leave them in. As you said, it's usually not good to remove any functionality.

Yeah, this is only for visibility maps. No use at all in the other functions
 
Alright, everything seems fine :goodjob:
If you would like to, will upload it to the SVN tonight
(and if you don't plan any more changes for now)
 
I think i will add a message when signs are detected during the backup to inform the user what to do to ensure that all signs are restored.

I found another solution. I added a popup in between when signs are restored. this way i get two actions (screen updates). I delete the city name signs before the popup and restore the original signs after the popup.

I could do this when switching between the city name maps too. But i don't know what is more convenient. Picking a player from the dropdown twice or click on a button on a strange popup.

Edit: Another solution would be to add a button in the landmark mode that let you restore them manualy
 
I implemented a few more things

changes:
- restored the reveal/unreveall all buttons for the visible maps
- added a popup that appears when original signs on the map are restored when the city name mode is left. (This fixes the problem that not all signs may get restored)
- fixed the alt-tab-problem (at least for the new modes. They stay active now when switching to windows and back to civilization. That should make city name editing alot easier)

open issues:
- restoring of original signs does not get triggered when the save-worldbuilder-file button is clicked
- alt-tab-problem is not fixed for the unaltered worldbuilder modes

future plans
- also add visualization to the minimap where appropriate
- clean up code
- sort the city names in the new popup alphabetically
- make core and normal areas editable


@AbsintheRed: if you do not find any new bugs you may upload this version to the svn.

Edit: uploaded a fixed version
 

Attachments

  • ImprovedWorldBuilder_1.1.1.zip
    37.3 KB · Views: 40
@AbsintheRed: if you do not find any new bugs you may upload this version to the svn.

Already uploaded the last version yesterday, but will update it with this
 
Had a very strange bug
When leaving and then reentering the WB it was totally messed up
I couldn't do anything, just ALT+TAB back to windows
Will try again to check what was the exact cause

EDIT: I have signs, so my guess is that it's connected to the landmark mode
Probably to the landmark mode deactivation
 

Attachments

  • Civ4ScreenShot0050.JPG
    Civ4ScreenShot0050.JPG
    78.4 KB · Views: 94
Top Bottom