[SDK] Lead from Behind

Do you test your modcomp yourself before releasing it? It's bugged:

http://forums.civfanatics.com/showpost.php?p=8563430&postcount=1941


Try moving a unit with right mouse button. You will get this error (even with playing stock lead from behind).
I played through about a half-dozen large/epic games with it using AIAutoPlay, and I've been using it in my own game for probably some 30-40 hours (and I use right-click-to-move most of the time). If the problem is as easy to reproduce as it sounds, I should've hit it ... which makes me suspect it's something to do with your setup. (The obvious is if you have anything in your CustomAssets ... but aside from that, maybe some odd interaction with your OS or something).

Can anyone else verify if they've tried it in a game (especially using right-click-to-move) and if so whether they had any problems?

Looking at that link, that game is obviously using more mods - but I note you say here you get it using 'stock lead from behind'. Do you need to do anything special to get it to happen? Or just start up a new game, right-click-to-move, and it blows up?
 
It's easy to reproduce. Start a new game and move your warrior. There is no error while under AI autoplay by the way. I've noticed this error when I stopped AI Autoplay and tried to move a unit myself.

edit: gnaaaaaaaaah. now I was not able to reproduce it myself. wait a min.

edit2: okay got it.... selected the warrior and tried him to move:




This screenshot is made with your modcomp. No other additions.
 
second test with stock lead from behind (hundreds of the same error messages, cannot click them away:

 
Can anyone else verify if they've tried it in a game (especially using right-click-to-move) and if so whether they had any problems?

I've included Lead From Behind in my latest Beta test, and I've got tons of people testing it. That said, I would be hearing very very angry comments if it was that predictable of an error. Also, I just tried it, and no problems on my end.
 
I did nothing to stock civ4 bts. There MUST be an error. I've also tried German AND English.
 
3rd test: moving the starting scout works (bismarck). moving a starting warrior not (asoka).

I could move all of the starting scouts in all of my last 5 test games but none of the starting warriors.
 
I've tried a few times myself, and can't reproduce it (either with scout or warrior). And at least Afforess has verified it works for someone else as well! So I'm at a bit of a loss as to what it could be ...

It's easy to reproduce. Start a new game and move your warrior. There is no error while under AI autoplay by the way. I've noticed this error when I stopped AI Autoplay and tried to move a unit myself.
I just wonder about this comment ... you obviously merged it with AI autoplay at some point to try this ... have you been testing with my dll (from the download)? Or one you've compiled yourself (even if just with my code changes)? And if it's your own, did you do a rebuild, or a rebuild all? (If just a rebuild, that's probably the problem - try again with rebuild all).
 
this was my mod, yes. but as you can see on the screenshot, I've also tried your stock mod without any additons too. The last 10 tests were with your mod loaded. Everytime I moved the warrior I got this message. Do you have python exceptions enabled?

Try this:

; Set to 1 for no python exception popups
HidePythonExceptions = 0

I guess Afforess (and any other user) can play with this disabled. But there is a bug.


I've tried your download..... your dll, your files, your mod folder. NOTHING from me.

Same errors. See the screenshots. I did not change anything there.



The folder's date is changed cause of the creation date on my drive.


I've tried your mod and compiling a new dll with your source files. Get errors when playing both. I'm not stupid. :D I have an own 800mb mod with lots of additions and sdk changes... but this bug is in your STOCK mod. :p
 
Try the following:

Start a new custom game with your mod loaded.

Settings:








Your warrior is selected by default:





Now try to move him with right mouse button:

 
Cybah. I just did EXACTLY your directions, and I got no exceptions and my units moved fine. It's gotta be on your end. Try reinstalling BTS.
 
Are you kidding? All of my 100 mods are working. I've got a fine 3.19 installed.

Python exceptions enabled? :p
 
Are you kidding? All of my 100 mods are working. I've got a fine 3.19 installed.

Python exceptions enabled? :p

Wait, Only logging. I just checked my log. Same error as Cybah. I can corroborate, there is a bug. :(


Traceback (most recent call last):

File "CvScreensInterface", line 705, in forceScreenRedraw

File "CvMainInterface", line 733, in redraw

File "CvMainInterface", line 2866, in updateHelpStrings

RuntimeError: unidentifiable C++ exception
 
this was my mod, yes. but as you can see on the screenshot, I've also tried your stock mod without any additons too. The last 10 tests were with your mod loaded. Everytime I moved the warrior I got this message. Do you have python exceptions enabled?

Try this:

; Set to 1 for no python exception popups
HidePythonExceptions = 0
Thanks - never knew about that setting! (haven't touched Python). With that turned off, I can reproduce the error - though just moving didn't cause a problem - but if I hold down right-mouse or alt it'd crash. I'd guess it has something to do with displaying combat odds (probably specifically in the case where there's nothing to attack, so no odds to actually display).

I've tried your mod and compiling a new dll with your source files. Get errors when playing both. I'm not stupid. :D I have an own 800mb mod with lots of additions and sdk changes... but this bug is in your STOCK mod. :p
Didn't mean any offense - just trying to rule out the obvious! (aka grasping at straws :p)

Anyway, now that I can reproduce, I should be able to track it down ...
 
OK, I believe I found the problem - CvUnitAI.cpp, my new UDgetBetterAttacker method, right at the start:

Code:
	pDefender = pPlot->getBestDefender(NO_PLAYER, getOwnerINLINE(), this, !bPotentialEnemy, bPotentialEnemy);
	iOdds = getCombatOdds(pThis, pDefender);

Problem happens if pDefender is NULL - should be:

Code:
	pDefender = pPlot->getBestDefender(NO_PLAYER, getOwnerINLINE(), this, !bPotentialEnemy, bPotentialEnemy);
	if (pDefender == NULL)
		iOdds = currCombatStr(NULL, NULL);
	else	
		iOdds = getCombatOdds(pThis, pDefender);

Anyway, I'll do some more testing before I put it up, but making that change does seem to fix it. (Note that I'll probably want to do something else in the NULL case, but just getting strength worked for a quick test)
 
There's another change I've been thinking about, and as long I have to put up a new version anyway ... :p

Not exactly a bug, but still something I think should be fixed. There's a bit of an oddity when comparing multiple units - consider the following 3 units:

A - odds 700 (value-adjusted odds 550)
B - odds 600 (value-adjusted odds 350)
C - odds 500

Where value-wise, A>B>C

Compare A to B, and B would be picked (600>550)
Compare A to C, and A would be picked (550>500)
Compare B to C, and C would be picked (500>350)

Which is fine so far ... but the problem is, when all 3 units are considered, which unit ends up defending depends on the order in which the units are compared! Start with A,B and C will defend ... start with A,C and B will defend ... start with B,C and A will defend ...

The problem stems from the fact that the ranking used for B depends on who you're comparing against (600 vs A ... 350 vs C) - or in general because I only adjust the ranking for value when a unit is more valuable then the other unit.

To fix that, I'm planning to make two changes:

1) Change the way it values experience to use tiers - say 10 XP is worth 1 ... 20 XP is worth 2 ... 40 XP is worth 3 ... 80 XP is worth 4 ... etc. Alternatively I could just use level, but that would penalize units that hold off on taking a promotion. And of course, I'd need to increase the value given for general/limited/healer (I'm thinking 5/5/2) to keep XP from being overvalued.

2) Change the way value adjusted odds are calculated to use the actual value rating (instead of only adjusting if more valuable) - say odds + (odds-850)*(value/5)

That would make a units ranking independent of who you're comparing against, so the order of comparison would no longer matter.
 
I think most players won't attack with their great general led unit with odds of say 90%. They'll wait until the unit has 99+% odds. So I think those players would also prefer it if their valuable units only defended in such cases.

So maybe the value of 850 is not exactly what most players would like. A unit fighting a series of 85% odds battles wouldn't live long.
 
Top Bottom