PieceOfMind's Advanced Combat Odds

I suppose at lower resolutions or when there is a lot of combat modifiers the size of the text panel could get quite tall. This is good indication that we're most definitely at the limit of how much stuff we should be adding to Everything. Perhaps for that high a detail level I will get rid of the added blank lines to reduce the likelihood of it occuring. Also, larger font sizes (eg. using Blue Marble) may cause the problem too. phungus, what resolution were you running by the way? Or can you get me a screenshot?

@Ninja2,
Nah the 3XP is just common in the examples I choose. I've been using only a handful of test battles so far for all the pictures so 3XP must have just been fairly common among them.
 
OK I've succefully baked up two functioning gamecores, one default and one of the current version of this modcomp. I'm interested in trying to add the switching details functionality. How would I go about writing this (So that by holding down shift the display changes from whatever default is set as to Everything).
Also How do I get white text to display, specifically below all the new stuff and above the default modified combat values in the pane?

One of EF's posts above had the mention of the switching detail. If the text is already up, I'm not sure whether pressing control would cause the change or whether you'd need to hold control then update by moving over the enemy unit again.

The four detail settings are achieved through setting iDetail between 0 and 3.

It is set in the XML file at the moment and at the start of the code you'll see

Code:
int iDetail = GC.getDefineINT("COMBAT_ODDS_DETAIL");
I suppose you'd need to change that to something else depending on the ctrl button.

As for adding in more white text, you could go right to the end of my block of code and you'll see
(in GameTxtMgr)
Code:
//szTempBuffer.Format(L"--------------------------------------------");
szTempBuffer.Format(L"\n");
//szString.append(NEWLINE);
szString.append(szTempBuffer.GetCString());

Change this to

Code:
//szTempBuffer.Format(L"--------------------------------------------");
szTempBuffer.Format(L" whatever text you want\n");
//szString.append(NEWLINE);//if you want a newline or use \n in with the text
szString.append(szTempBuffer.GetCString());
 
Great, how do I set where I want the text to go in the bar? I'd like it to go below everything from the modcomp, and above the left over from default modified combat strengths. Also I'm curious about how I set where in the box it goes, so how would I place some other text in the window (or move around the display so that I could shift things where they appear in the window)?
Also quick compiling question: so basically when recompile the changes, just use "codwriter's notepad" make my changes to the source code file (in this case GameTxtMgr), save them then open the original project and rebuild? I don't need to go through all the starting steps again correct?

I'll wait on EmperorFool then for more details on setting up the code to shift between detailed views by holding down shift.

As for the window getting chopped off by the top of the screen, everything is low or mid quality in terms of graphics, the size of the text looks the same as it does in your screenshots, I'm sure you'll have no problem replicating this minor bug on your end. As for fixing it, I was thinking it would work to shift the default modified combat values and modifier text to a new box, located to the right of the new advanced box. Not the most elegant solution (hope there is a better one), but it would be better then having the top chopped off.
 
Great, how do I set where I want the text to go in the bar? I'd like it to go below everything from the modcomp, and above the left over from default modified combat strengths. Also I'm curious about how I set where in the box it goes, so how would I place some other text in the window (or move around the display so that I could shift things where they appear in the window)?
Also quick compiling question: so basically when recompile the changes, just use "codwriter's notepad" make my changes to the source code file (in this case GameTxtMgr), save them then open the original project and rebuild? I don't need to go through all the starting steps again correct?

The suggestion I made in my previous post would be adding text precisely after all my detail has been presented and before the combat modifier stuff is shown. As for where the text will appear more generally, it's all done sequentially, so as you go through all my code the order that things apepar is the order they get printed. If you want to add something inside the lines I print, you'll need to find the right spot inside my code.

Regarding shifting things around, this would simply involve shifting the various blocks around. This will be tricky though because sometimes some of the things I calculate depend on earlier things, which may have already been printed. This will make it somewhat difficult to change much of the ordering of the things I have printed.

As for the compiling question, I'm a bit new to this as well so I'm probably not the best one to take advice from... My advice would be to use commenting liberally. When all the changes you make will be in one chunk to be inserted in the code somewhere, I suggest making a big comment at the start and end of your changes with your name in it. This is what I did for the changes I made in the three source files I modified. Note the amount of code I have put in GameTxtMgr now is substantial so you'll have to scroll several pages of my code.

If you have the compiler set up properly, when you modify one or two files I think when it recompiles it only needs to work the files that just got modified. I have noticed when you change a header file though, it will recompile the whole lot.

I'll wait on EmperorFool then for more details on setting up the code to shift between detailed views by holding down shift.

As for the window getting chopped off by the top of the screen, everything is low or mid quality in terms of graphics, the size of the text looks the same as it does in your screenshots, I'm sure you'll have no problem replicating this minor bug on your end. As for fixing it, I was thinking it would work to shift the default modified combat values and modifier text to a new box, located to the right of the new advanced box. Not the most elegant solution (hope there is a better one), but it would be better then having the top chopped off.

Putting another window in I'd have no idea how to do. As it is, I was simply able to take the easy method of inserting more detail into an existing object.
 
Thanks for the quick response. OK, I don't know C++, at all, and can only do some simple stuff with Python, but I'm a pretty quick learner.

What I'm thinking is, to shift things around I wold need to tell it not to print a calculated value: How do I write this in C++?
Then at a later time, where I want it shown, I need to tell it to print the value: How do I write this in C++

As an example, one of the things I would like to do is move the Defeat odds above the End of Combat HP stat bars (directly below the retreat odds), How would I go about doing this? To clarify, I'm not interested in you doing this, I would like to know how to do it, If I can see an example of this being done, I'm pretty sure I can figure out the rest of what I'd like to do.
 
Putting another window in I'd have no idea how to do. As it is, I was simply able to take the easy method of inserting more detail into an existing object.
It's a pretty lame, band aid type solution anyway. I'm sure you, or someone else will think of something better.
 
I'm having a problem where the box for the bars and part of the information is just a pink box. Any ideas?
 
I'm having a problem where the box for the bars and part of the information is just a pink box. Any ideas?
Pink box means the art isn't found. Make sure the art files in the mod are along the correct path. Should be C:...\Mods\Advanced Combat Odds v0.4\Assets\Art\ACO (inside this there should be a bunch of art files)
 
@Yesod, what phungus said. Note the mod is no longer just DLL changes. There are dependancies on these art files plus a few XML variables now (in preparation for when it will go into BUG).
 
I didn't do the mod install. Where do I need to put the individual files? The source files you have don't match anything I found in custom assets.

I copied the rest though.
 
phungus, to move the "Defeat odds" line, find this code:



Code:
szTempBuffer.Format(SETCOLR L"Defeat " ENDCOLR L": " SETCOLR L"%.2f%%"ENDCOLR L" for " SETCOLR L"%dXP" ENDCOLR L"  (" SETCOLR L"%.1fHP" ENDCOLR L")",
                                            TEXT_COLOR("COLOR_NEGATIVE_TEXT"),TEXT_COLOR("COLOR_NEGATIVE_TEXT"),100.0f*DefenderKillOdds,TEXT_COLOR("COLOR_NEGATIVE_TEXT"),
iDefExperienceKill,TEXT_COLOR("COLOR_NEGATIVE_TEXT"),(iDefenderOdds != 0 ? E_HP_Def_Defeat/(RetreatOdds+DefenderKillOdds):0.0));
szString.append(NEWLINE);szString.append(szTempBuffer.GetCString());

And move it to below the code that is enclosed by:

Code:
//START DEFENDER DETAIL HP HERE

blah blah blah

//END DEFENDER DETAIL HP HERE

Changing the order of these two sections of code shouldn't cause a problem.
 
I didn't do the mod install. Where do I need to put the individual files? The source files you have don't match anything I found in custom assets.

Yesod, the source files are not needed for the mod at all. The source files are simply there if you would like to merge the mod with your own mod, as it would require recompiling the DLL. If you do not intend to do any compiling then just ignore the .cpp and .h files. You can delete them if you want.

The Assets folder is the important one. Especially the Art/ACO folder.

If you want to put the files in CustomAssets, just copy the contents of my Assets folder directly into the CustomAssets folder. As I said earlier, you can get rid of the source files. If you find one of my XML files is already in the customassets folder because of a mod you're already running, you'll need to copy my new XML variables into the existing XML files.
 
At low resolutions, battles with many modifiers or with extremely large number of possible HP outcomes can cause the overlap to be pretty bad. The following is 1024x768 res



I will have to think of a way to reduce this problem in the next version. Maybe if there are too many HP outcomes I can combine a few of them into one if they are all less than 0.01%.
 

Attachments

  • low_res.GIF
    low_res.GIF
    271.5 KB · Views: 315
What? How could this be possible?:)

Our players think that this mod should be included in The History of Three Kingdoms. But I say since BUG team got here first, I'll let them take it first.:D

Also, one suggestion from our player:

The Great General points you get from the combat is not always equal to the experience you would gain. while GG point is not trivial in original BTS, it's much more important now in our mod. So we have a plea, would you like to consider the possibility of displaying the possible GG points that you'll gain from a combat?:worship:

I say thanks in advance, and Good JOB!:goodjob:
 
Maybe if there are too many HP outcomes I can combine a few of them into one if they are all less than 0.01%.

That was going to be my suggestion as well, but I don't think you need to worry about checking if there are "too many" outcomes. Just make the minimum 1% or something. It would be nice to show it as a range then (x-y HP)

But I say since BUG team got here first, I'll let them take it first.:D

That's your call, but this forum is about sharing. :) BUG has no special claim on the mod--I just thought it was so cool that I decided to help with some suggestions. ;)

The Great General points you get from the combat is not always equal to the experience you would gain.

If you mean that a unit with the Leadership promotion gains 2x XP, then yes, this should take that into account and display the actual XP I feel. I think I even modified DanF's original code to handle this.

If you mean something else, can you please explain? AFAIK, the XP points you earn in the battle is exactly what is applied to your total XP toward your next GG.
 
@EF

I mean pieceOfMind and your team do it first, then we steal it.:D You can do this much better than we can.

What about Imperialist trait? What about great wall? And other potential modifiers from other stuff? I don't think they are included in the XP.:)
 
What about Imperialist trait? What about great wall? And other potential modifiers from other stuff? I don't think they are included in the XP.:)

Right, neither of those affects the XP gained by the unit, only the GG points gained by the player. I don't think showing the difference belongs in the combat odds because they apply to the player and not the unit. The display is already pretty full of information, and the GG points would have to be displayed by every XP, or add a single message at the bottom:

This battle will earn you +100% GG points.​
 
Edit removed previous version.
 
Screwed up the code again... minor bug left in this version.
 
OK, this one is good to go. Sorry about the tripple post, but it wol't let you manage attachments from editing:

Got the Shift selection to work, In this version you can now set your XML default to whatever you like, (Medium is considered default), and holding down shift brings up the Everything! display.

What you all think?



 
Top Bottom