RFC feature editing in World Builder

Leoreth

Bofurin
Retired Moderator
Joined
Aug 23, 2009
Messages
38,061
Location
風鈴高等学校
As some of you might have noticed, merijn has started to work on exposing some RFC features (stability maps, core areas ...) to the world builder. The current ongoing pull request is here.

This thread is both for testing/discussing that implementation and trying to figure out how it should ultimately look like.
 
I'm running into Python errors as soon as I want to edit anything, see attachments if not fixed already.
 

Attachments

  • Civ4ScreenShot0054.JPG
    Civ4ScreenShot0054.JPG
    285.7 KB · Views: 189
  • Civ4ScreenShot0055.JPG
    Civ4ScreenShot0055.JPG
    283.1 KB · Views: 130
  • Civ4ScreenShot0056.JPG
    Civ4ScreenShot0056.JPG
    282.7 KB · Views: 118
  • Civ4ScreenShot0057.JPG
    Civ4ScreenShot0057.JPG
    278.2 KB · Views: 122
Could it be that I named my file which as has the functions MapDrawer.py. So you have 2 MapDrawer.py files if you have this tool installed as well?
(Then, it was stupid from me to give it the exact same name :blush:)

In that case, we have to rename my file and it should be fine.

EDIT: I'm renaming my MapDrawer.py to MapEditorTools.py. I'm fairly sure this should fix the problem.
 
General thoughts:
- I like a UI option to convert your save, but does it really belong in the world builder? Also, I will work on the DLL soon to store the current version in there, so this command cannot be executed more than once. Maybe I can even get the game to update itself automatically.
- I also like the stability overlay in the main UI, but I think as with SoI it would look better if it used the colored hatched lines (like settlers do, or you're using in the WB) and included the core area
- It looks like you're using the MapDrawer script to export maps, is that correct? That presents a number of problems. First, the script is not versioned in Git, so it will only work for people who've downloaded it (but we could add it of course). Also, it's not really geared to produce human readable output. In particular, the formatting as it is in the maps files is very important, so things like tabs should be in there as a minimum. Not sure if the CSV module that is backing MapDrawer can support that. Also, you're likely only interested in what you're trying to edit. So export should be an action specific to the civ and type of map you're editing
- not sure if editing anything other than stability/settler and war maps makes sense right now. CNM isn't in the DLL and likely never will be. And as you've noticed, core areas are still in this hybrid state where sometimes the hardcoded Python values are used, and transitioning out of that will not happen soon. So we should focus on these capabilities and not expose too much else
- not sure how universal my UI expectation tools are but I would find it more natural if I could click on a tile that I would want to edit and then select or input the new value, instead of selecting the new value first and then "painting" with it
- I think it could work to only have one universal map mode (no extra one for core and CNM). Simply color according to stability (although an extra color for unsettleable for the AI is nice and should be kept, overriding the normal orange/red), and always display city name and settler value below the coordinate display
 
Could it be that I named my file which as has the functions MapDrawer.py. So you have 2 MapDrawer.py files if you have this tool installed as well?
(Then, it was stupid from me to give it the exact same name :blush:)

In that case, we have to rename my file and it should be fine.

EDIT: I'm renaming my MapDrawer.py to MapEditorTools.py. I'm fairly sure this should fix the problem.
Oh, I see, that explains a lot. Disregard my point on that above then. Will try it again with the right file tomorrow, it's getting late :)
 
General thoughts:
- I like a UI option to convert your save, but does it really belong in the world builder? Also, I will work on the DLL soon to store the current version in there, so this command cannot be executed more than once. Maybe I can even get the game to update itself automatically.

The button doesn't need to be in the WB. I thought was that it such a button is useful, because not everyone is familiar with the python console. (Although it's easy and the instructions are clear) It was that I just found an unused button and gave it this function. Maybe a key combination like ctrl+L would work as well.

- I also like the stability overlay in the main UI, but I think as with SoI it would look better if it used the colored hatched lines (like settlers do, or you're using in the WB) and included the core area

I like it better too. By now, I only incorporated it. We can always make it better. ;)

- It looks like you're using the MapDrawer script to export maps, is that correct? That presents a number of problems. First, the script is not versioned in Git, so it will only work for people who've downloaded it (but we could add it of course). Also, it's not really geared to produce human readable output. In particular, the formatting as it is in the maps files is very important, so things like tabs should be in there as a minimum. Not sure if the CSV module that is backing MapDrawer can support that. Also, you're likely only interested in what you're trying to edit. So export should be an action specific to the civ and type of map you're editing

I created my own file which has all functions in it regarding changing the map, as well as exporting. I gave the same name. I think this caused some confusion. I've already renamed the file. (This probably caused the errors) Right now, MapEditorTools.py does the exporting and all other functional stuff.

For now, I just output similar to your MapDrawer tool. I'm aware this isn't optimal. I just wanted it to work in the first place. Optimizing it to produce useful output is something I didn't work on yet.

- not sure if editing anything other than stability/settler and war maps makes sense right now. CNM isn't in the DLL and likely never will be. And as you've noticed, core areas are still in this hybrid state where sometimes the hardcoded Python values are used, and transitioning out of that will not happen soon. So we should focus on these capabilities and not expose too much else

The CNM thing isn't really supposed to be an editor. It is just a viewer, like the old tool I created. The same can be said for the spawn zones.

- not sure how universal my UI expectation tools are but I would find it more natural if I could click on a tile that I would want to edit and then select or input the new value, instead of selecting the new value first and then "painting" with it

The ploteditor has that option. The idea with the paint tool is that you can quickly set the settlervalue of a whole bunch of tiles.

- I think it could work to only have one universal map mode (no extra one for core and CNM). Simply color according to stability (although an extra color for unsettleable for the AI is nice and should be kept, overriding the normal orange/red), and always display city name and settler value below the coordinate display

You mean the core map is put over the stability map? That would work, but I still need a button do know if you are changing the settlervalue or the core area. But the overlay can be combined into 1 for sure.
 
I know this is off topic, but the topic got me thinking.

Coming out of semi-retirement on the forum to just say how much I appreciate the hard work both of you constantly do and how you never fail to impress me so, so much.

I have hundreds upon hundreds of hours in Civ 4. It's my go to relaxing game, something I play when I need to just breathe and feel good.

Without your outstanding work, this surely wouldn't be the case.

Thanks, you guys. :)
 
The button doesn't need to be in the WB. I thought was that it such a button is useful, because not everyone is familiar with the python console. (Although it's easy and the instructions are clear) It was that I just found an unused button and gave it this function. Maybe a key combination like ctrl+L would work as well.
Yeah, actually at first I thought you had put it in the main menu (that also has a recreate map button in the case of random maps). Maybe you can figure out how to put it there.

I like it better too. By now, I only incorporated it. We can always make it better. ;)
Sure, as I said, I'm more than willing to merge an initial implementation and then iterate on it. I'm just trying to formulate my vision of what it could look like in the end so we don't diverge too much in what we're working at.

I created my own file which has all functions in it regarding changing the map, as well as exporting. I gave the same name. I think this caused some confusion. I've already renamed the file. (This probably caused the errors) Right now, MapEditorTools.py does the exporting and all other functional stuff.

For now, I just output similar to your MapDrawer tool. I'm aware this isn't optimal. I just wanted it to work in the first place. Optimizing it to produce useful output is something I didn't work on yet.
Yeah, again that is just a thought on what the final state should look like.

The CNM thing isn't really supposed to be an editor. It is just a viewer, like the old tool I created. The same can be said for the spawn zones.
Okay, but I would be careful in what the interface communicates. If there is a specific "mode" for it in the WB, it suggests that you can also edit something in it.

The ploteditor has that option. The idea with the paint tool is that you can quickly set the settlervalue of a whole bunch of tiles.
Okay, looks like I haven't discovered that yet.

You mean the core map is put over the stability map? That would work, but I still need a button do know if you are changing the settlervalue or the core area. But the overlay can be combined into 1 for sure.
Yeah, basically do the stability map, then override with the core map and the "never settled by the AI" color. That should give a good overview of the state of a specific civ. And we also don't lose anything by always displaying settler value and city name. On the contrary, the absence of a specific mode to display those further communicates that there is nothing to edit here.

And is there really a point in allowing editing the core area for now?
 
Yeah, actually at first I thought you had put it in the main menu (that also has a recreate map button in the case of random maps). Maybe you can figure out how to put it there.

That is indeed a more suitable place for that button. I never touched the main menu buttons, so I don't know if I will many. With a bit of bad luck it requires DLL changes.

Okay, but I would be careful in what the interface communicates. If there is a specific "mode" for it in the WB, it suggests that you can also edit something in it.

Yeah, basically do the stability map, then override with the core map and the "never settled by the AI" color. That should give a good overview of the state of a specific civ. And we also don't lose anything by always displaying settler value and city name. On the contrary, the absence of a specific mode to display those further communicates that there is nothing to edit here.

And is there really a point in allowing editing the core area for now?

I didn't really think about interface communication. (Out of curiousity, is this something you learn when you study for software developer?) But with the changes you suggested, it will be changed anyway.

I want to give the player the opportunity to customize there game. Some people like to customize their game by editing the map. (Better resource arrangement for example) In a similar way, they can modify cores if they prefer it.
From a modders perspective, it may not be really necessary indeed. (for now)


Another thing, I changed the PlayerInfoScreen, so you can easily modify civ specific modifiers. (Maybe you already discovered this. I added this feature only recently and it might be overshadowed by the other features)
 
That is indeed a more suitable place for that button. I never touched the main menu buttons, so I don't know if I will many. With a bit of bad luck it requires DLL changes.
Yeah, I have no idea how to do it myself. Although BUG adds an option there, and that is all Python.

I didn't really think about interface communication. (Out of curiousity, is this something you learn when you study for software developer?) But with the changes you suggested, it will be changed anyway.
I don't think it ever really was taught at uni, but I was involved in a bunch of projects with their own frontend. You usually quickly run into the problem that users expect something you didn't intend from the way you present the UI to them.

I want to give the player the opportunity to customize there game. Some people like to customize their game by editing the map. (Better resource arrangement for example) In a similar way, they can modify cores if they prefer it.
From a modders perspective, it may not be really necessary indeed. (for now)
True, I meant it more from a perspective of what actually will be changed. Since the implementation is currently inconsistently relying sometimes on the DLL and sometimes on the Python data, offering the ability to edit cores will cause inconsistency between the two, something that the naive WB user will not even be aware of. I don't think it's a good idea to let a user do that.

Another thing, I changed the PlayerInfoScreen, so you can easily modify civ specific modifiers. (Maybe you already discovered this. I added this feature only recently and it might be overshadowed by the other features)
Oh right, I've seen that and wanted to remark on it, that's really cool.
 
True, I meant it more from a perspective of what actually will be changed. Since the implementation is currently inconsistently relying sometimes on the DLL and sometimes on the Python data, offering the ability to edit cores will cause inconsistency between the two, something that the naive WB user will not even be aware of. I don't think it's a good idea to let a user do that.

My idea was a like:
"In this particular game, I want tile X to be core.
I click on the tile and it becomes core.
I play on"

The player doesn't bother if it changes something in the python or the DLL. It just want the tile to be core or not.

Only if you want to edit the core tiles permanently instead of just 1 game, it becomes an issue. But I don't think the regular player will do this.
 
I know, but that's not what happens. The CvPlot instance isn't used in every case where the core is relevant. Every time the list of all tiles in core is queried it is done so directly via Python constants, which cannot be edited right now. That is what I meant with inconsistency. You're right that the user doesn't care about Python or DLL but they do care that when they make a change it applies everywhere. Currently it wouldn't.
 
I see.

I've change the stability overview to a "settlerlike" overview. I currently have 3 possible color variants. (Personally, I like the 2nd option the most. It's the clearest of them all. I could ofcourse combine the options)

Basic colors (I use now)

Spoiler :
attachment.php


Basic colors with cyan instead of dark green for core (idea from SoI, so the core is more distinct from historical area)

Spoiler :
attachment.php


Tooltip colors. (Matches the tooltip colors in the bottom left)

Spoiler :
attachment.php
 

Attachments

  • Civ4ScreenShot0036.JPG
    Civ4ScreenShot0036.JPG
    289.9 KB · Views: 749
  • Civ4ScreenShot0037.JPG
    Civ4ScreenShot0037.JPG
    304 KB · Views: 738
  • Civ4ScreenShot0038.JPG
    Civ4ScreenShot0038.JPG
    302.7 KB · Views: 743
Dunno if this is the place for this, but...

Will this world builder also include a city name overview like RFC Europe? That was a very convenient feature just to see how the names were plotted, and to see what each civ had the name as.
 
Where are the names displayed in RFCE?
 
Oh right, forgot to reply to that. I agree that the SoI configuration looks best.
 
I looked at the next pull request and I like basically everything about it. There's still a bug with the overlay I mentioned on Github.

Also a little interface improvement: I noticed that the revert/export dialog only appears when selecting core or settlervalue. Could you make it context sensitive to whether core or settlervalue is selected? That would save two buttons and you could actually label the remaining ones simply export and revert.
 
Definitely! I haven't paid much attention to them but if editing became easier that might actually be something worthy of a revision.
 
Back
Top Bottom