History
As you know, BUG started as a collection of other people's mini-mods. Typically, we reviewed and improved the code as we folded it into BUG (120% of the improvement was due to EF, -20% of the improvement was due to Ruff). Neither of us had the burning desire to fold in the 1000 or so lines of code contained in PLE. However, I liked the promo frame and some of the other do-dads (star for GG), so I lifted that code and put it into the unit plot list.
Honesty alert: I hate PLE. It is ugly, doesn't provide any benefit, the code is horrible, you have to recode tons of stuff just to get it to work and I hate it. Don't expect me to like it. If I had my way, we would
nuke it from orbit. Now that I have declared my preferences, I feel totally fine in letting my bias come through
. Feel free to tell me that I am nuts and that PLE adds X, Y or Z functionality and is really, really cool. Just expect me to totally disagree with you.
There were a few requests for PLE and we kept them at bay with the 'no time' line. That was, until a user posted a fully working, latest BUG, maininterface python file with PLE included. We (foolishly in my opinion) just grabbed it, wrapped some options around it and folded it in and thus 'broke' the vanilla unit plot list method. This was about 12 hours before a major release ... don't ask me why we did that.
Anyway, subsequent to that, we improved the graphics, re-enabled the vanilla code (PLE style check box) and left it.
Both methods suffer when you have plots with lots of units (> 100). EF postulated that this is because we are redrawing the whole screen every time. EF and I discussed how to fix and it stalled for lack of will / desire / skill / time (take your pick). Both EF and I took separate stabs at wrapping the unit plot stuff in classes, but neither of us fully finished anything (me because I don't fully understand classes and EF because he had other stuff on his plate).
Current Code Changes
So that we don't totally break the current situation, I added a 3rd method of drawing the unit plot list - the BUG method (see 'Notes on BUG method' section below). There are now 3 methods ... Vanilla, PLE and BUG. As a side aim of this, I decided to try and pull the 1000 lines of PLE code out of the maininterface file. It is my hope that the BUG method will totally replace the Vanilla method and that the ugly PLE method will remain as an alternative.
General Testing
You should test the normal stuff that you do with the unit plot list (selecting units, grouping, ungrouping, issuing orders, promoting, upgrading, etc, etc. Feel free to test this with any of the 3 methods (Vanilla, BUG and PLE). Keep in mind that we aim to replace Vanilla with BUG at some stage. If there is any differences, then the Vanilla method should win as it should reflect raw BtS the best. We want BUG and PLE to enhance the Vanilla methods so we shouldn't lose functionality when we move away from Vanilla.
You shouldn't see any speed improvements when using Vanilla or PLE. All of our current speed improvement code is in the BUG method. I would suggest that you play a normal game but with error logging enabled (including on screen pop-ups). At the end of a session, check the error log file (file name) to see if you ran into any errors. Keep in mind that we are modding a core part of the screen refresh code that is fired lots and lots of time - if you run into an error, you will probably have to Ctrl-Alt-Delete back to the task manager to kill off Civ4.
Vanilla Method Testing
Nothing really to add here as I didn't really play with the code. I did push some display methods into the PLE file but I don't think they should have caused any problems.
PLE Method Testing
As mentioned above, I pulled the PLE code out of the main interface file into its own file. I got it working but I know that I didn't test every little PLE thing - there could easily be bugs in there.
BUG Method Testing
This code is totally new and not fully functional as yet. I'll put together a list of things that this code will need and indicate if (I think) it is in there yet. I expect quiet a bit of feedback from this section of the testing (ie lots of bugs).
Notes on BUG method
The main aim of the BUG method is to utilize the core unit selection process built into the game (so that we don't need to re-write the unit selection, upgrade, etc code as per PLE) and to provide a significant speed improvement. The speed improvement comes by comparing the unit in a particular unit plot cell to the prior unit in that cell and only drawing stuff if it changes. At the moment, changing plots causes a complete redraw, so you will not see any speed improvement if you flip between 2 plots that both have 100 warriors in them. You should see speed improvement if you flip between different warriors in the same cell.
BUG Unit Plot Items Required
- unit button (done)
- selected unit yellow highlight (done)
- other player units in non enabled mode (done)
- Promo Frame (done)
- Dot information (done)
- Upgrade arrow (done)
- Mission (done)
- Health Bar (done)
- Hide Health bar if in battle (done)
- White arrows if more than x units (x changes with resolution) (outstanding)
- Number of units per row changes with resolution (done)
- City screen up (outstanding)
- Normal unit actions (issue orders, upgrade, promote, group, degroup, etc) (done)
- movement bar (really? Doesn't the dot give you that information?)
Are there others that I need to add to this list?