About the UI

nossr50

Chieftain
Joined
Jun 1, 2007
Messages
27
Hello, it's been a very long time since I last posted. I've become an extremely good player at Civ4 and I am not ashamed to admit I play it religiously. There is one thing among all others that has bothered me about the game, the UI.

I would like to know just what I would need to know in order to change the UI to be to my fitting.

Example: I play Fall From Heaven a lot nowadays, and in Fall From Heaven you will end up with some units that have many promotions. I would like to have it so promotions can be displayed in a new window if you click on any of the promotions.

Here is basically what I want

I click on promotion any promotion on a unit in Civ4, or Fall From Heaven.

It opens a new window (Kind of similar to the civilopedia, trade window, or technology tree) detailing the unit in an organized fashion. I've included a crappy mock picture of what I would like this window to look like.

http://img245.imageshack.us/img245/9744/unitdetailsframeoh7.png

Note: I'm not graphically skilled, and I know next to nothing of programming. I just have a vision for what I want and a poorly put together image. Items in chevrons<> are variables/values.




I would also like to have the civilopedia improved with a -/+ sign organization (yeah I would have to make it..) for mods like Fall From Heaven, finding the spells associated with spirit is harder than it should be. And I would also like to add some kind of search function if possible


My goals probably sound grand but I don't see myself taking a break from this game anytime soon and I don't see the developers of Civ4 or the Modder of FFH redoing the UI. Although, if you're out there... IT WOULD BE REALLY AWESOME IF YOU MADE IT BETTER.

One other thing I would like is an in game option on the menu to load a save while in a game, players would receive the data and rejoin as the civ they were or click an option to be a different civilization. I do a lot of games with friends and sometimes accidents happen and we will reload a saved game, but to do this we must go to the main menu, and the host most find the save file and then tell everyone that his server is up.

Another thing I would like to do eventually is modify the AI's behavior, in Fall From Heaven which I seem to play more than the regular Civ4 it seems like the AI do not make smart decisions based on their civilization/religion/techs. I would love to see a civilization get way of the forrests if they were elves, and purposely get a disciple of the leaves of a spellcaster casting bloom all over their terrain.

So as you can see I have some minor issues I want to change (UI Improvements) and some very big ones (AI Improvements), I know that AI is one of the most complex things to program in any game. I would just like to be pointed in the right direction on any of these things, currently what I care most about is adjusting the UI.

Some other minor UI issues I would like to do

Tiles - It would be nice to have a button that showed tiles in your cities radius and highlighted them if they had no improvements, and showed icons for improvements they already have. It seems like I spent a lot of time in the game with improvements and it becomes too difficult to deal with when you get more than 6 cities because you actually have to look at the tiles to see the improvements. And it would be nice if it showed the total bonuses each tile got, and debuffs from the improvements and or civics/traits.

Settler Suggestions - The game will often suggest a location for you to place you settler to help you decide, but it doesn't tell you why it thinks that location is good, and it would be nice if when you had your settler selected and highlighted a suggestion, it would explain why it was suggested. Like, This spot provides or will provide with improvements x resource, x terrain, and x defense. (I don't actually know how the suggestions are chosen).

Improved interaction with AI - It would be nice to know if you could trust montezuma once in a while, if the demands of a civilization meant a lot to them or just a little, if asked for resources and rejected why they don't see it is a fair trade (simple, like 10 gold for fish isn't worth it...but xxx would be).

Yeah I know, I probably am in over my head, but I've got a fever and the only prescription is more cowbell-- I mean learning how to program mods XML and Python based for Civ4, and where to look!
 
Moderator Action: Thread moved. Hopefully some of your questions can be answered here.
 
To get something to popup when you click on the promotions a unit has, you'll need to first dig through CvMainInterface.py until you find where the unit info pane is drawn. One hack thing you can do is, after the info pane is drawn, draw a completely transparent button over it. Check out around line 539 in CvMainInterface.py from my Revolution mod, you'd write something very similar but draw it over the info pane when unit info was being drawn.

If you name your button "UnitPromoPopupButton1", it will create an input signal which you can intercept in the handleInput function at the bottom of CvMainInterface.py (line 3337 from my mod) by the name of ""UnitPromoPopupButton" (the 1 at the end of the button name seems to be important in making this work ... go figure). You can then call any function you like, so you could create a function in CvMainInterface.py or some other file that puts up a popup or a screen.

I'd start with just getting this basic connection going and have it launch a real simple popup:

Code:
popup = PyPopup.PyPopup()
bodStr = 'Hello World'
popup.setBodyString( bodStr )
popup.launch()

That success will probably be enough to keep you energized through figuring out how to display what you want ... hope that helps get you started at least.
 
Top Bottom