--- Log opened Fri Sep 07 00:00:23 2012 20120907 00:15:31< zookeeper> shadowm, surely that wasn't a too offensive inquiry to make? :> 20120907 00:16:06< shadowm> Meh. 20120907 00:17:52< zookeeper> well, even if it was then maybe i could just claim the same in my own defense 20120907 00:18:23< zookeeper> but that guy is just... urgh 20120907 00:18:56< shadowm> Yeah, just note that this channel is publicly logged. 20120907 00:19:15< zookeeper> i know 20120907 00:26:24< skyfaller> Alarantalara: I'm around now if you're here 20120907 00:26:51< Alarantalara> I'm still here 20120907 00:27:11< skyfaller> ok, wanna play some Wesnoth? :) 20120907 00:27:32< Alarantalara> Sounds good to me 20120907 00:45:44-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has quit [Ping timeout: 252 seconds] 20120907 01:03:49-!- mattsc [~mattsc@fw.hia.nrc.ca] has joined #wesnoth-umc-dev 20120907 01:06:09-!- mattsc [~mattsc@fw.hia.nrc.ca] has quit [Client Quit] 20120907 01:47:49< skyfaller> Alarantalara: did you learn anything from that game? 20120907 01:48:08< Alarantalara> I think so. The timing of the attacks on the right was interesting 20120907 01:48:32< skyfaller> I start attacking when night is on its way, that way if you hang around to fight, your situation gets worse and worse 20120907 01:48:41< skyfaller> so I'm happy if you accept battle 20120907 01:48:50< Alarantalara> But you do not always do so 20120907 01:49:07< skyfaller> well, I start advancing to attack, I don't always commit 20120907 01:49:09< Alarantalara> The first one, you waited until night, and a later one you started in the afternoon 20120907 01:49:39< skyfaller> the first turn I had no ctk and I could only get 2 units to the front 20120907 01:49:51< Alarantalara> And the attacks grew longer as you gained more of an advantage 20120907 01:50:06< skyfaller> yes 20120907 01:50:23< skyfaller> eventually I will never bother to go home :) 20120907 01:50:45< skyfaller> but I always respect your daytime damage 20120907 01:51:29< Alarantalara> How would that change against rebels or knalgans, who don't have the same damage swing on their side 20120907 01:51:44< Alarantalara> Would it affect when you advance/retreat? 20120907 01:51:47< skyfaller> I would still advance at night, since that's when I deal the most damage 20120907 01:51:57< skyfaller> especially against Rebels, who have a significant lawful component 20120907 01:52:16< skyfaller> but I might not respect TOD as much against Knalgans 20120907 01:52:43< Alarantalara> I guess I wonder if you would have attacked longer the first night, since the danger on the retreat was not as great 20120907 01:52:53< skyfaller> my primary weapon against dwarves is poison, and HODOR can't go toe-to-toe with orcs unless played by a master 20120907 01:53:26< skyfaller> I'll usually retreat if I've gained an advantage and I want to keep it 20120907 01:53:35-!- ancestral [~ancestral@75-168-42-97.mpls.qwest.net] has joined #wesnoth-umc-dev 20120907 01:53:44< skyfaller> I like to wear my opponents down by attacking to get an advantage, then pulling back before you can properly respond 20120907 01:53:54< skyfaller> I'll even accept taking one of your villages for a turn sometimes 20120907 01:54:10< skyfaller> b/c if I keep doing that I'll come out ahead in the end 20120907 01:54:57< Alarantalara> Is that gain an advantage or have an advantage? 20120907 01:55:13< skyfaller> gain, I want to get something out of every attack 20120907 01:55:25< Alarantalara> Gain is somewhat hard to measure since all AI information could be lost between turns 20120907 01:55:28< skyfaller> if I've gotten what I wanted, no reason to risk hanging around 20120907 01:55:35< Alarantalara> so it can't be necessarily tracked 20120907 01:55:39< skyfaller> can't the AI check the game stats? 20120907 01:55:46< Alarantalara> It can check current stats 20120907 01:55:58< Alarantalara> But it doesn't have access to history 20120907 01:56:07< skyfaller> well, that's pretty problematic 20120907 01:56:21< skyfaller> there has to be a way around that 20120907 01:56:52< Alarantalara> And has no way to save information throughj save/reload (well Lua can, but I don't know if the AI has access to that part) 20120907 01:57:21< Alarantalara> There's a bunch of things that can't be done because of out of sync possibilities 20120907 01:57:40< skyfaller> it's pretty crucial for the AI to know whether it accomplished something last turn 20120907 01:57:55< skyfaller> if that isn't possible, the AI is at a huge disadvantage 20120907 01:58:10< Alarantalara> We can record that we did something 20120907 01:58:42< Alarantalara> I just don't know if we can write it into a save game. It's sort of useless if you can beat the Ai by save-loading as it forgets what it's doing 20120907 01:58:53< skyfaller> :( 20120907 01:59:09< skyfaller> then we should try to find a way to put info in a savegame, let's research that 20120907 01:59:22< skyfaller> I have to go eat, bbl 20120907 01:59:23-!- mattsc [~mattsc@fw.hia.nrc.ca] has joined #wesnoth-umc-dev 20120907 01:59:41< mattsc> skyfaller, Alarantalara: will you post a replay, please? 20120907 01:59:52< Alarantalara> ah yes, just a minute 20120907 02:00:12< mattsc> Not now, I still don't have time anyway, just sometime. 20120907 02:00:24< mattsc> Also, self.data is persistent across save/reloads. 20120907 02:00:36< Alarantalara> Really? Excellent 20120907 02:00:49< mattsc> You just need to make sure that that part of it is not deleted in my stats CA 20120907 02:01:14< mattsc> Just wanted to say that, and I'm off again. :) 20120907 02:01:43< mattsc> Oh, its content needs to be in WML variable format (vconfig or whatever it's called) though for that 20120907 02:02:03< mattsc> bye, thanks for doing this! 20120907 02:02:19< Alarantalara> All of data, or just some of it? 20120907 02:02:50< mattsc> I don't remember ... 20120907 02:02:57< mattsc> I can test that, later ... 20120907 02:03:11< Alarantalara> I suppose we'll find out when we need to know 20120907 02:03:23< mattsc> yeah 20120907 02:03:51-!- mattsc [~mattsc@fw.hia.nrc.ca] has quit [Client Quit] 20120907 02:05:41< Alarantalara> I suppose I'll write something to record start and end of turn stats (unit counts for both sides, kills, villages) 20120907 02:06:25< Alarantalara> We can calculate kills on the opponent's turn my measuring the difference in our units 20120907 02:10:05< Alarantalara> I suppose if we want real accuracy, we can record the ids of all units each turn, so we know what died 20120907 02:47:34-!- mattsc [~mattsc@d50-92-210-201.bchsia.telus.net] has joined #wesnoth-umc-dev 20120907 02:51:01-!- ancestral [~ancestral@75-168-42-97.mpls.qwest.net] has quit [Quit: i go sleeps kthxbai] 20120907 02:59:24< skyfaller> Alarantalara: would it be helpful to you to see a game against a different faction? 20120907 03:01:25-!- hulavuta1 [~Justin@68.204.185.132] has joined #wesnoth-umc-dev 20120907 03:02:37< Alarantalara> possibly 20120907 03:02:45< Alarantalara> Which would you expect to be most useful? 20120907 03:03:11< skyfaller> I'm not sure, I would assume whatever faction Fred has the most trouble with right now 20120907 03:03:15-!- hulavuta [~Justin@68.204.185.132] has quit [Ping timeout: 276 seconds] 20120907 03:03:45< Alarantalara> Judging from what mattsc said earlier, I assume that would be Knalgans or Undead 20120907 03:03:56< skyfaller> have we tried just running Fred in nogui mode against Ron and an overresourced RCA AI and getting statistics? 20120907 03:04:26< Alarantalara> We have some printed at the start of each turn, but we have to record them 20120907 03:04:27< skyfaller> I mean, maybe wait until the next release to do that, but I think that could be useful 20120907 03:04:35< mattsc> yep 20120907 03:04:56< skyfaller> I meant, just statistics on how often Fred wins against each faction with the two different AIs 20120907 03:05:07< skyfaller> anyway 20120907 03:05:08< mattsc> That's what I thought. 20120907 03:05:22< skyfaller> why don't you fire up an UD or Knalgans game so I can show you how it's done? :D 20120907 03:05:47< mattsc> Oh, no, that's Ron vs. RCA... 20120907 03:06:01< mattsc> I can tell you though, at least how it used to be., 20120907 03:06:34< mattsc> Fred vs. RCA has the hardest time against Undead and Drakes. Then Knalgan. 20120907 03:06:51< skyfaller> ok, then pick one of those and let's dance :) 20120907 03:07:07< mattsc> I'm still not around though :( 20120907 03:07:26< skyfaller> oh, sorry, I thought you were Alarantalara for a moment, I'm so confused 20120907 03:08:24< mattsc> :D I'm implementing something quickly that will let you choose which CA Fred executes, then I'll be gone again. 20120907 03:08:30< skyfaller> w00t 20120907 03:08:49< Alarantalara> Starting a game versus drakes if you have a chance later, mattsc 20120907 03:08:58< skyfaller> I'm going to kill Alarantalara's Drakes now. I guess I should be able to grunt rush them, let's see 20120907 03:09:23< mattsc> The problem of Fred vs. Drakes is that he doesn't keep them away from his leader, for the most part 20120907 03:09:38< skyfaller> ha 20120907 03:09:43< Alarantalara> So I should try blitzes? 20120907 03:09:47< Alarantalara> This is so not going to work 20120907 03:10:41< skyfaller> yeah, that won't work against me, but you can do it anyway :) 20120907 03:12:19-!- hulavuta1 is now known as Hulavuta 20120907 03:20:48< CIA-59> Wesnoth-AI-Demos: mattsc master * rb874984 / (lua/ai_helper.lua lua/grunt-rush-Freelands-S1_engine.lua): Added ai_helper.skip_CA() to help with debugging - http://git.io/zzEQSg 20120907 03:24:54< mattsc> skyfaller: ^ I'll explain tomorrow how exactly to use this to do turn-by-turn testing 20120907 03:26:42-!- mattsc [~mattsc@d50-92-210-201.bchsia.telus.net] has quit [Quit: bye] 20120907 03:32:19-!- Hulavuta [~Justin@68.204.185.132] has quit [Read error: Connection reset by peer] 20120907 04:12:24-!- loonybot [~loonybot@wesnoth/bot/loonybot] has quit [Remote host closed the connection] 20120907 04:38:57-!- ancestral [~ancestral@75-168-42-97.mpls.qwest.net] has joined #wesnoth-umc-dev 20120907 05:00:46-!- mattsc [~mattsc@d50-92-210-201.bchsia.telus.net] has joined #wesnoth-umc-dev 20120907 05:15:23< mattsc> Btw, Alarantalara, if you want to work on any of the rush or defend or whatever CAs, please do so. I have no "proprietary feelings" (can't come up with a better word right now) about that at all. 20120907 05:15:51< mattsc> The only thing I'd like to avoid is both of us working on the same CA at the same time. 20120907 05:34:16-!- shadowm_laptop [ignacio@wesnoth/developer/shadowmaster] has quit [] 20120907 05:39:52< skyfaller> Alarantalara: ok, so let's discuss my proposal for calculating when we should buy an archer instead of a grunt 20120907 05:40:20< Alarantalara> I assume we could repeat this for trolls and possibly other units 20120907 05:40:24< skyfaller> yeah 20120907 05:40:32< skyfaller> first we calculate (a) how much more damage an archer deals than a grunt to the vulnerable enemy units 20120907 05:40:54< skyfaller> wait 20120907 05:41:17< skyfaller> we should also calculate how much less damage an archer does to the other enemy units :/ 20120907 05:41:23< skyfaller> so make that (b) 20120907 05:42:02< skyfaller> multiply (a) by the vulnerable units and (b) by the resistant units 20120907 05:42:28< Alarantalara> units or their hp? 20120907 05:42:30< skyfaller> resistant should include anything that isn't vulnerable, because I assume grunts have more base damage 20120907 05:42:35< skyfaller> ooh 20120907 05:42:50< skyfaller> maybe by their HP? 20120907 05:43:08< skyfaller> but that might not work for e.g. Ghosts, which are impossible to kill with anything but an archer 20120907 05:43:15< skyfaller> but have tiny amounts of HP 20120907 05:43:38< Alarantalara> And it may not work well if units are about to die and could be killed in 1 hit from either 20120907 05:43:53< skyfaller> let's multiply by base HP 20120907 05:44:03< skyfaller> or not.... 20120907 05:44:10< skyfaller> maybe we should just make a special case for the ghost 20120907 05:44:24< skyfaller> because in all other situations calculating based on HP sounds like a solid plan 20120907 05:44:48< skyfaller> if you have a lot of fat horses, you want lots of archers to kill them 20120907 05:44:49< Alarantalara> Yeah, that still doesn't cover ghosts unless we want to modify the value based on the presence of the drain ability 20120907 05:45:27< skyfaller> that might work 20120907 05:45:38< skyfaller> I was going to say that bats are a problem for that method 20120907 05:45:53< skyfaller> b/c archers are not actually the most efficient way to kill bats 20120907 05:45:59< skyfaller> but if we are comparing to the damage a grunt can deal 20120907 05:46:01< Alarantalara> They'll take a lot more damage 20120907 05:46:11< skyfaller> a grunt deals great damage to a bat, but lousy damage to a ghost 20120907 05:46:41< Alarantalara> and if we try to estimate the amount of healing in an endless fight with a ghost, we should be fine 20120907 05:46:50< skyfaller> sounds plausible 20120907 05:48:00< skyfaller> ok, so we've multiplied (a) and (b) by the HP of vulnerable and resistant units 20120907 05:48:09< skyfaller> I think we should just use their HP and not their base HP 20120907 05:48:28< skyfaller> b/c if something has been reduced to low health, it's out of the game for a while and something else might kill it before the archer gets there 20120907 05:49:27< Alarantalara> Base would be easier if we're doing math for drain - though I suppose you could multiply the bonus hp by the current fraction 20120907 05:49:40< skyfaller> I think that's good 20120907 05:49:54< skyfaller> if the ghost is down to 1HP anything has a chance to kill it 20120907 05:50:16< skyfaller> if it recovers, we can buy an archer next turn 20120907 05:50:25< skyfaller> wait 20120907 05:50:47< skyfaller> maybe we should calculate what HP the unit is likely to have next turn, rather than its current HP 20120907 05:50:56< Alarantalara> Since I can't simulate a fight everywhere, I'll assume that all units are on flat terrain 20120907 05:51:18< skyfaller> well, can we calculate an... average terrain for this map? :/ 20120907 05:51:30< skyfaller> we are making Fred a map-specific AI 20120907 05:51:33< skyfaller> blergh 20120907 05:52:00< skyfaller> like if the ghost is sitting in a village, and we can't kill it this turn, we should expect it to have 9 HP next turn, not 1HP 20120907 05:52:26< Alarantalara> Recruitment is usually at the end of the turn, so that's probably a reasonable assumption without checking 20120907 05:52:32< Alarantalara> for a ctk 20120907 05:52:45< skyfaller> ok 20120907 05:53:00< skyfaller> but what if the leader is getting off the keep to attack or something? 20120907 05:53:03< skyfaller> then he'll recruit earlier 20120907 05:53:20< Alarantalara> okay, we can include that too 20120907 05:54:18< Alarantalara> I might as well try to identify which unit is the core unit while I'm at it and make this entirely generic 20120907 05:54:22< skyfaller> finally, we should calculate how much more an archer costs and how much less HP you get for that money 20120907 05:54:39< skyfaller> that has to factor into the decision to buy an archer over a grunt 20120907 05:55:51< Alarantalara> We need to include the number of each unit on the field already in here somewhere 20120907 05:56:15< skyfaller> oh yeah 20120907 05:56:36< skyfaller> ok, a grunt costs 12 gold and you get a base HP of 38 20120907 05:56:36< Alarantalara> Since so far we have what amounts to average damage over all enemies adjusted by survivability and cost 20120907 05:57:01< skyfaller> an archer costs 14 gold and you get a base HP of 32 20120907 05:58:06< skyfaller> what we want to know is whether buying another archer is a better deal than buying another grunt 20120907 05:58:28< skyfaller> if the enemy units are net vulnerable to archers 20120907 05:58:51< Alarantalara> Let's pick a simple example. The enemy only has spearmen and cavalrymen. 20120907 05:58:57-!- vultraz [~chatzilla@124.109.10.167] has quit [Ping timeout: 244 seconds] 20120907 05:58:57< skyfaller> then what you want to know is whether the amount of extra damage you're buying is worth the hit you take in gold and HP 20120907 05:59:08< Alarantalara> He has 4 of each 20120907 05:59:16< skyfaller> I don't know how to compare gold and HP to damage 20120907 05:59:48< Alarantalara> If you get 9 units, how do you divide them? 20120907 06:00:00< Alarantalara> Between grunts and archers 20120907 06:00:26< Alarantalara> Do enough of these and we may find some number that can be used as a threshold 20120907 06:01:06< skyfaller> hold on 20120907 06:01:14-!- csarmi [~csarmi@apn-94-44-68-219.vodafone.hu] has joined #wesnoth-umc-dev 20120907 06:01:35< skyfaller> if I want to find out how efficient my gold is at buying me HP, do I divide the unit's HP by the gold it cost? 20120907 06:01:43< Alarantalara> Yes 20120907 06:02:38< skyfaller> ok, so 38/12 is 3.16 and 32/14 is 2.28 20120907 06:02:54< Alarantalara> Damage is about 10.2 for both against spearmen and 7.56 for grunts and 12.96 for archers against cavalry 20120907 06:02:58< skyfaller> you can tell by the higher number the grunt is a better deal 20120907 06:03:10< Alarantalara> All of the above are average damage values 20120907 06:03:15< skyfaller> ok 20120907 06:03:46< Alarantalara> They're not exactly right since wesnoth rounds some of it, but it will do for now 20120907 06:03:56< skyfaller> I'm starting to get confused. I don't know how to relate these numbers to one another 20120907 06:04:19< skyfaller> but I feel like we are close 20120907 06:05:11< skyfaller> maybe dividing the HP by gold wasn't helpful 20120907 06:05:21< Alarantalara> In the case above, if I assume equal hp of cavalry and spears, we get 8.88 for grunts and 11.58 for archers 20120907 06:05:29< skyfaller> does the 2 extra gold you spend buy you enough damage to offset the 6 HP you lose? 20120907 06:06:08< skyfaller> argh, why would you assume they have the same HP? They have different base HP 20120907 06:06:25< Alarantalara> Going back to the initial question, without doing the math, how many archers would you want out of 9 units against equal strength in cavalrymen and spearmen 20120907 06:06:42< skyfaller> gosh 20120907 06:07:03< skyfaller> that's complicated, depends on how the forces are arranged 20120907 06:07:20< Alarantalara> First, they're different by only 2, so I'll assume one cavalryman has been wounded once for the purpose of this discussion 20120907 06:08:06< skyfaller> Ideally I would want 3 archers on one front, so I can kill a cav quickly and shield with grunts 20120907 06:08:30< skyfaller> but I have to spread 9 units across 3 fronts? 20120907 06:08:41< Alarantalara> Let's assume one giant front for now, since I don't want to start analyzing the battlefield yet 20120907 06:08:54< skyfaller> if they were all on the same front I'd probably go with 3 archers and 6 grunts 20120907 06:09:52< skyfaller> once I have a strong archer force I would just be using the other units to shield it while I kill cavalry with impunity 20120907 06:10:31< skyfaller> my next recruit would probably be another archer to replace any archer who gets injured and has to retreat to heal 20120907 06:10:40< skyfaller> I would try to always have 3 archers ready to fight 20120907 06:11:41< Alarantalara> So if you had 18 units, it might only be 5 and 13 instead of just multiplying by 2? 20120907 06:12:01< skyfaller> yeah, but it depends on the unit composition 20120907 06:12:16< skyfaller> if it were literally all horses I might get more archers 20120907 06:12:36< skyfaller> but assuming the same ratio of cavs to spears, yes, more like 5 and 13 20120907 06:13:15< skyfaller> doesn't do you any good to have archers that can kill horses if they don't live long enough to do their job 20120907 06:14:02< Alarantalara> So counter units suffer from diminishing returns 20120907 06:14:32< skyfaller> yeah, definitely 20120907 06:14:52< skyfaller> for example ulfs are godlike against DAs, but if you buy too many of them you can't shield them properly, and they die 20120907 06:15:23< skyfaller> and your opponent might start buying units that can't be ulfed, like skeletons and ghosts 20120907 06:15:30< Alarantalara> Now what about trolls? They actually have more hp/gold than grunts. 20120907 06:15:44< skyfaller> ooof 20120907 06:15:49< skyfaller> maybe my equation is stupid 20120907 06:16:03< skyfaller> we ignored defense and MP 20120907 06:16:20< skyfaller> and if we calculate everything, the equation will become impossibly complicated 20120907 06:16:38< skyfaller> especially since I don't know how to compare MP to HP, for example 20120907 06:17:08< skyfaller> how much is it worth to you to have a faster unit? depends on the size of the map 20120907 06:17:19< skyfaller> and whether it's terrain that your unit can travel through 20120907 06:17:25< skyfaller> gosh, we'll have to take terrain into account 20120907 06:17:35< skyfaller> otherwise we won't know when to buy water units / flying units 20120907 06:17:50< Alarantalara> So turns to enemy? We can place a test unit on the map to find out how long it will take to get to something 20120907 06:17:56< skyfaller> when do you buy a fish? when there's lots of water 20120907 06:18:26< skyfaller> ooh, turns to enemy might not be a bad idea 20120907 06:19:17< skyfaller> I would include both enemy units and enemy villages 20120907 06:19:38< skyfaller> he might be sending all of his units along the land, but leaving his water village open 20120907 06:19:49< skyfaller> and begging for fish to come and take it 20120907 06:20:16< skyfaller> writing an AI is so hard :/ 20120907 06:20:22< Alarantalara> Also, on maps that are good for fish, there's likely at least one village that a fish can get to faster than any other unit 20120907 06:20:52< skyfaller> yeah, that's true 20120907 06:21:23< skyfaller> it's very helpful if that's a water village that the fish can hold :P 20120907 06:23:13< skyfaller> with trolls you can't ignore the regen ability 20120907 06:23:23< skyfaller> you have to prefer trolls if your enemy has poison in the field 20120907 06:23:58< skyfaller> and it means that the unit's crap defense and MP is not the whole story 20120907 06:24:07< Alarantalara> Would you count it as extra health if there were no poison? 20120907 06:24:16< skyfaller> I guess so 20120907 06:24:50< skyfaller> the main thing you have to keep in mind is that it is not possible to have a troll rush 20120907 06:25:13< skyfaller> trolls cannot rush, and they don't deal enough damage to kill village-holders, unless they're undead 20120907 06:25:53< skyfaller> with any other faction trolls will never be your core damage-dealer, they're tanks 20120907 06:26:38< Alarantalara> So, we have time to enemy and villages, hp/gold ratio, damage to current field ratio adjusted by hp of enemy, and special abilities as factors 20120907 06:26:57< skyfaller> ok 20120907 06:27:19< skyfaller> have we melted down the CPU yet? :D 20120907 06:28:04< Alarantalara> time to villages, hp/gold, damage ratio without counting enemies and special abilities can be precalculated 20120907 06:28:26< skyfaller> ok 20120907 06:28:31< Alarantalara> and since mattsc has told us we can save these, it's a one time cost at game start since we can scan the enemy's recruit list 20120907 06:28:44< Alarantalara> (except on hornshark :() 20120907 06:28:53< skyfaller> lollerskates 20120907 06:29:03< skyfaller> well, we see their unit list on the first turn 20120907 06:29:18< skyfaller> they don't get any new special units 20120907 06:29:26< skyfaller> just the initial random units on the map 20120907 06:30:22< Alarantalara> and since some advancements have different resistances anyway, maybe just do units as they appear on the map 20120907 06:31:12< skyfaller> ok... we'll know what leveled units we can expect to see based on the recruit list / initial units, though 20120907 06:31:20< skyfaller> and have them pre-calculated? 20120907 06:32:40< Alarantalara> anyway, that leaves only time to enemy, and counting existing units hp as something to do each turn 20120907 06:33:04< Alarantalara> so the CPU should be fine 20120907 06:33:23< Alarantalara> we only need to recalculate distance to villages when the leader changes keeps 20120907 06:35:03< skyfaller> ok 20120907 06:36:53< Alarantalara> Okay, I have to go to sleep now, but I'll create an equation with values for all these parameters, add some constants and then fit them based off of what you think would be good numbers for various situations 20120907 06:37:06< skyfaller> ok, sounds good 20120907 06:37:07< Alarantalara> When it gets it wrong, we change the constants 20120907 06:37:08< skyfaller> gosh 20120907 06:37:14< skyfaller> I need to brush up on my game :) 20120907 06:38:02< Alarantalara> I suppose we can put a quiz on the forum and see which expert players answer 20120907 06:38:36< Alarantalara> For that, I suppose a screenshot of the enemy with none of your units on the field and asking what they would want may be ideal 20120907 06:38:44< skyfaller> yeah, sounds reasonable 20120907 06:41:46< skyfaller> I wonder what we'll have to do to adapt Fred to 2v2 or anything besides 1v1 >.< 20120907 06:43:51< Alarantalara> He'll just have more units to count 20120907 06:44:33< Alarantalara> Though I suppose that we should weight closer units more highly 20120907 06:45:04< Alarantalara> anyway, goodnight for now 20120907 06:45:08-!- Alarantalara [~Adium@CPEc0c1c09e8055-CM00252eac6d62.cpe.net.cable.rogers.com] has quit [Quit: Leaving.] 20120907 06:54:07-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20120907 07:00:22-!- mattsc [~mattsc@d50-92-210-201.bchsia.telus.net] has quit [Quit: bye] 20120907 07:44:51-!- Crendgrim [~crend@77-22-112-72-dynip.superkabel.de] has joined #wesnoth-umc-dev 20120907 08:34:18-!- vultraz [~chatzilla@124.109.10.167] has joined #wesnoth-umc-dev 20120907 08:53:31-!- ancestral [~ancestral@75-168-42-97.mpls.qwest.net] has quit [Quit: ancestral] 20120907 09:46:39-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20120907 09:49:12-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20120907 09:55:48-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20120907 10:10:45-!- csarmi [~csarmi@apn-94-44-68-219.vodafone.hu] has quit [Read error: Connection reset by peer] 20120907 10:14:45-!- zookeeper [~lmsnie@wesnoth/developer/zookeeper] has joined #wesnoth-umc-dev 20120907 12:52:52-!- loonybot [~loonybot@46.138.72.79] has joined #wesnoth-umc-dev 20120907 12:52:52-!- loonybot [~loonybot@46.138.72.79] has quit [Changing host] 20120907 12:52:52-!- loonybot [~loonybot@wesnoth/bot/loonybot] has joined #wesnoth-umc-dev 20120907 12:52:55-!- mode/#wesnoth-umc-dev [+v loonybot] by ChanServ 20120907 13:29:35-!- Alarantalara [~Adium@CPEc0c1c09e8055-CM00252eac6d62.cpe.net.cable.rogers.com] has joined #wesnoth-umc-dev 20120907 13:31:03-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20120907 13:34:28-!- noy [~Noy@wesnoth/developer/noy] has quit [Client Quit] 20120907 14:32:05< CIA-59> Wesnoth-AI-Demos: Alarantalara master * r9a1575b / lua/recruit_filter_helper.lua : Compare archers against grunts only to determine if archers are a counter - http://git.io/KAbOVQ 20120907 14:32:05< CIA-59> Wesnoth-AI-Demos: Alarantalara master * r5baec14 / lua/recruit_filter_helper.lua : Require grunts to be strictly worse, not equal or worse than archers before they're recruited - http://git.io/kF448g 20120907 14:55:53< AI0867> multiplying by HP works okay for smallfoot and the likes, and isn't very far off for elusivefoot (resists and evasion pretty much cancel out). But for drakes (lots of HP, low evade) and saurians (low HP, high evade) it doesn't 20120907 14:58:02< Alarantalara> AI0867: At the moment, I'm hoping that evaluating average damage on flat terrain compensates for this (I know it doesn't cover units that consistently move on other terrain, but it at least attempts to deal with that issue) 20120907 15:00:59< Alarantalara> Another alternative would be to evaluate each unit on its best terrain, on the assumption that players will try to place units accordingly 20120907 15:09:10-!- mattsc [~mattsc@216.123.55.165] has joined #wesnoth-umc-dev 20120907 15:22:46-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20120907 15:27:42-!- mattsc_ [~mattsc@216.123.55.165] has joined #wesnoth-umc-dev 20120907 15:27:42-!- mattsc [~mattsc@216.123.55.165] has quit [Read error: Connection reset by peer] 20120907 15:27:43-!- mattsc_ is now known as mattsc 20120907 15:31:29< Alarantalara> AI0867: That is an insane replay. Who or what is playing side 2? 20120907 15:33:15< mattsc> AI0867: interesting strategy :) 20120907 15:33:59< mattsc> My guess is it wouldn't work as well against a human player, but it might be something for Fred to try occasionally... 20120907 15:35:34< mattsc> Alarantalara: what struck me most about nelson playing the grunt rush is all the exceptions from the rules he and others have told us to teach Fred 20120907 15:36:10< AI0867> Alarantalara: me, in a crazy mood 20120907 15:37:22< Alarantalara> mattsc: What the replays really show (as well as AI0867's) is that there actually appears to be a short list of things we should actually care about: 20120907 15:37:36< Alarantalara> When to start and stop attacking 20120907 15:38:29< Alarantalara> What to recruit based on where the unit is going 20120907 15:38:59< Alarantalara> And last, how to attack once we have decided to 20120907 15:39:49< Alarantalara> Most of the advice given so far has been for the last item: how to attack, but it really looks like when and where is more important 20120907 15:40:11< mattsc> yeah... 20120907 15:40:57< mattsc> I was just going to start looking into the rush on the right for that. Unless you want to do that. 20120907 15:44:34< Alarantalara> What if instead of attacking in terms of left, center, right it was per village? 20120907 15:44:55< Alarantalara> i.e. get list of closest unowned villages each turn 20120907 15:45:26< Alarantalara> and decide wether to advance to it, retreat to an owned one or hold 20120907 15:45:32< CIA-59> Wesnoth-AI-Demos: Alexander van Gessel (AI0867) master * rdf850cc / lua/grunt-rush-Freelands-S1_engine.lua : Implement grunt_rush_FLS1:should_have_gold_next_turn - http://git.io/IUk2uA 20120907 15:45:33< CIA-59> Wesnoth-AI-Demos: Alexander van Gessel (AI0867) master * r52a1c77 / (3 files): Merge branch 'master' of github.com:mattsc/Wesnoth-AI-Demos - http://git.io/4SXyxQ 20120907 15:46:50< Alarantalara> And try to maintain unit strength based on these goals 20120907 15:47:55< Alarantalara> After all, the units that rushed on the right in AI0867's replay stopped when they reached the end of the right side. Where they should continue to the next village 20120907 15:48:29< mattsc> Alarantalara: Hmm, interesting. 20120907 15:49:41< mattsc> I wouldn't take the right rush stopping in the south too seriously, that's because of a limitation of area_rush_eval that I need to (and will) take out (essentially, it only rushes south atm) 20120907 15:49:57< mattsc> But I like that idea in general. 20120907 15:50:42< Alarantalara> Also, it suggests that the rush should be deciding if it wants to be quick in the face of light opposition to get things before there is a chance to respond, or heavy if there are large numbers of enemy forces 20120907 15:50:54< mattsc> Fortunately, with the refactoring I've done setting up goals dynamically like that is really easy. 20120907 15:52:53-!- mattsc_ [~mattsc@216.123.55.165] has joined #wesnoth-umc-dev 20120907 15:52:53-!- mattsc [~mattsc@216.123.55.165] has quit [Read error: Connection reset by peer] 20120907 15:52:54-!- mattsc_ is now known as mattsc 20120907 15:53:28< mattsc> Grrr... I'm at a coffee shop and the connection seems really unstable this morning... 20120907 15:53:53< mattsc> Alarantalara: could you have a look at lines 1930+? 20120907 15:54:16< mattsc> This is with regard to your last comment 20120907 16:00:39< Alarantalara> Sure, I'll look at that next week. 20120907 16:00:46< Alarantalara> For now, I have to leave. 20120907 16:00:51-!- Alarantalara [~Adium@CPEc0c1c09e8055-CM00252eac6d62.cpe.net.cable.rogers.com] has quit [Quit: Leaving.] 20120907 16:04:12< mattsc> Alarantalara (for when you're back): I just wanted to make a comment that I have something like that (rush depending on opponent's strength) in the code already, but made it extremely aggressive during the day. 20120907 16:04:25< mattsc> I'm currently working on this again. 20120907 16:04:39< mattsc> *during the night ^ 20120907 17:00:09-!- Alarantalara [~Adium@CPEc0c1c09e8055-CM00252eac6d62.cpe.net.cable.rogers.com] has joined #wesnoth-umc-dev 20120907 17:00:10-!- Alarantalara [~Adium@CPEc0c1c09e8055-CM00252eac6d62.cpe.net.cable.rogers.com] has quit [Client Quit] 20120907 17:04:48< CIA-59> Wesnoth-AI-Demos: mattsc master * r20c919e / lua/grunt-rush-Freelands-S1_engine.lua : Made the rush on the right less unconditional - http://git.io/pJSjxQ 20120907 17:06:33< skyfaller> mattsc: is there any downside / difference to using Fred on wesnoth 1.11.0? 20120907 17:08:17< mattsc> skyfaller: There shouldn't be. There's an incompatability between 1.10 and 1.11 Lua AI, but I am trying to write the code so that it works for both. 20120907 17:08:44< mattsc> That's what ai_helper.got_1_11() is for 20120907 17:09:32< skyfaller> cool :) 20120907 17:09:52< mattsc> There would, in fact, be some large advantages in coding it for 1.11 only, but then it wouldn't work in 1.10 at all and we'd loose most of our user community... 20120907 17:10:35< skyfaller> lol 20120907 17:10:38< mattsc> For example, you quite often ask whether an attack combo has a CTK. I cannot answer that very well in 1.10, but I could in 1.11 20120907 17:10:59< mattsc> So for the time being, we'll have to do with an approximation for that. 20120907 17:11:00< skyfaller> we have a user community? Beyond the 4 developers and Rigor? 20120907 17:11:31< mattsc> I'm always amazed by how many people actually follow this and try it out. :) 20120907 17:11:38< skyfaller> ha 20120907 17:11:56< mattsc> There might actually be 7 people total ;) 20120907 17:12:12< skyfaller> if that's literally true, then we should just ask everyone to switch to 1.11 20120907 17:12:16< skyfaller> this is an experimental AI 20120907 17:12:28< skyfaller> it won't be done at least until the next Wesnoth release 20120907 17:12:36< mattsc> No, it's much more than that 20120907 17:12:59< skyfaller> ok, it's a buttload of other AIs too 20120907 17:13:06< skyfaller> but all of them will be easier to write and maintain in 1.11 20120907 17:13:08< mattsc> But until recently, even that (switching to 1.11) wasn't an option, because it wasn't out yet 20120907 17:13:18< mattsc> yep 20120907 17:13:21< skyfaller> well, it's out, let's switch :) 20120907 17:13:31< mattsc> Anyways, so I've started to make some changes to the rush on the right 20120907 17:13:34< skyfaller> I just downloaded it to play AI0867's crazy replay 20120907 17:13:45< skyfaller> and that's the brand of insanity I like :) 20120907 17:14:54< skyfaller> I think every once in a blue moon we should have Fred do what AI0867, just to put the fear of god into his opponents 20120907 17:15:06< skyfaller> "dear lord, if he's capable of that, he could do ANYTHING at any time!" 20120907 17:15:17< skyfaller> "He's CRAAAAAZY" 20120907 17:15:17< mattsc> Agreed. 20120907 17:15:27< mattsc> :D 20120907 17:15:29< mattsc> Let's focus on the rush on the right for the moment though. 20120907 17:15:32< skyfaller> ok 20120907 17:15:36< skyfaller> talk to me :) 20120907 17:15:42< mattsc> I have about 15min left before late tonight... 20120907 17:16:15< mattsc> So, I made some changes to the rush in my last commit. It's not as all out under all circumstance any more. 20120907 17:16:32< mattsc> The next thing I really need to work on is positioning and retreating. 20120907 17:17:26< mattsc> Oh, just to be make that clear, the CAs are a bit unfortunately named at the moment (I'll clean that up too when I know what is working and what isn't) 20120907 17:17:49< skyfaller> unfortunately named? 20120907 17:18:06< mattsc> The rush CA only attacks, the hold CA does unit positioning when no attacking is possible, both advancing and retreating 20120907 17:18:24< skyfaller> ah 20120907 17:18:43< mattsc> As I said, let's figure out what works first, and then we can decide on what that should be called. 20120907 17:18:54< skyfaller> sure 20120907 17:19:00< skyfaller> so how can I help? 20120907 17:19:04< mattsc> Just wanted to make sure you know what I am talking about with 'rush' and 'hold' CA 20120907 17:19:35< mattsc> Not much yet, as I need to do the advancing/retreating thing first, and that probably won't be till the weekend. 20120907 17:20:17< mattsc> I was going to tell you how to test individual CAs, but somebody just showed up. 20120907 17:20:32< mattsc> How about we do that in ... 1.5 or 2 hours or so? 20120907 17:20:39< skyfaller> tell them to play Wesnoth until we're done talking ;-) 20120907 17:20:39< skyfaller> OK 20120907 17:20:42< skyfaller> see you then 20120907 17:20:45< mattsc> bye 20120907 17:20:59-!- mattsc [~mattsc@216.123.55.165] has quit [Quit: bye] 20120907 18:15:25< AI0867> 17:14 < skyfaller> I think every once in a blue moon we should have Fred do what AI0867, just to put the fear of god into his opponents 20120907 18:15:31-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20120907 18:16:10< AI0867> on turn 2 or 3, check if one flank is very weak. If that's the case, roll some dice to decide whether to do an all-out attack there 20120907 18:16:31< AI0867> a human might actually pull some units back, but it'll take them longer to find out what's happening 20120907 18:17:00< AI0867> of course, they might also evacuate their leader to your side 20120907 18:29:04-!- mattsc [~mattsc@fw.hia.nrc.ca] has joined #wesnoth-umc-dev 20120907 18:29:40-!- noy [~Noy@wesnoth/developer/noy] has joined #wesnoth-umc-dev 20120907 19:02:37< mattsc> skyfaller: around? 20120907 19:02:42< skyfaller> mattsc: yup 20120907 19:03:02< mattsc> should we talk quickly about how to do single-CA testing? 20120907 19:03:09< skyfaller> I just got my butt handed to me in a ladder game as orcs, I took a hit to my ELO for the team :P 20120907 19:03:18< skyfaller> so sure 20120907 19:03:27< mattsc> My condolences... 20120907 19:03:58< mattsc> Ok. Do you remember how to spawn units and change their attributes in debug mode? 20120907 19:04:04< skyfaller> not quite 20120907 19:04:36< mattsc> Ok, why don't you just start a game, and I'll walk you through. 20120907 19:04:38< skyfaller> ok 20120907 19:04:55< skyfaller> just any game? 20120907 19:05:00< skyfaller> freelands with orcs as p1? 20120907 19:05:07< mattsc> just a local MP game with you in charge of one of the sides 20120907 19:05:19< mattsc> yeah, sure 20120907 19:05:41< skyfaller> one minute 20120907 19:06:58< skyfaller> ok 20120907 19:07:03< skyfaller> mattsc: I'm ready 20120907 19:07:16< mattsc> Ok. First: activate debug mode 20120907 19:07:25< mattsc> type ':debug' 20120907 19:07:30< skyfaller> ok 20120907 19:07:47< mattsc> spawning units on the hex the cursor is on: shift-C 20120907 19:08:18< skyfaller> ok 20120907 19:08:42< mattsc> changing their side: hover cursor over them and type shift-u 20120907 19:08:58< skyfaller> ok 20120907 19:09:27< mattsc> changing their attributes, type 20120907 19:09:35< mattsc> :unit attribute_name=value 20120907 19:09:39< mattsc> example: 20120907 19:09:44< mattsc> :unit moves=99 20120907 19:09:47< skyfaller> how do you delete a unit? 20120907 19:10:06< mattsc> The easy way is to change it to your side and move it out of the way ;) 20120907 19:10:21< mattsc> If you really need it off the map, type: 20120907 19:10:33< mattsc> :lua wesnoth.put_unit(1,1) 20120907 19:10:47< mattsc> changing the coordinates to the hex the unit is on, of course 20120907 19:11:09< skyfaller> ok 20120907 19:11:29< mattsc> That's all you should need to manipulate the situation on the map 20120907 19:11:42< skyfaller> ok 20120907 19:11:51< skyfaller> now what? 20120907 19:12:19< mattsc> Umm, quick question (I forgot): 20120907 19:12:34< mattsc> If you set up a MP game like that, does it produce start-of-turn saves? 20120907 19:13:12< mattsc> Actualy, doesn't matter... 20120907 19:13:27< skyfaller> I think it does 20120907 19:13:47< skyfaller> it wouldn't if you had AIs on both sides, I believe, but if there's a human involved there are autosaves 20120907 19:13:53< mattsc> Let me just try something really quick, to make sure I am telling you the right thing (my own method is slightly different, but much more work to set up) 20120907 19:14:35< skyfaller> k --- Log opened Fri Sep 07 19:26:29 2012 20120907 19:26:38-!- lobby [~wesnoth@wesnoth/bot/lobby] has joined #wesnoth-umc-dev 20120907 19:26:38-!- Topic for #wesnoth-umc-dev: Wesnoth-UMC-Dev Project discussion and support channel | http://wesnoth-umc-dev.ai0867.net | Staff: AI0867, Espreon | Blog: http://wesnoth-umc-dev.ai0867.net/blog/ | IRC logs: http://irclogs.wesnoth.org, http://irclogs.ai0867.net 20120907 19:26:38-!- Topic set by shadowm [] [Mon Aug 27 11:27:23 2012] 20120907 19:26:38[Users #wesnoth-umc-dev] 20120907 19:26:38[@ChanServ ] [ CIA-59 ] [ iwaim_ ] [ melinath ] [ zookeeper] 20120907 19:26:38[+loonybot ] [ Crendgrim] [ janebot ] [ noy ] 20120907 19:26:38[+shikadibot] [ Espreon ] [ lobby ] [ shadowm ] 20120907 19:26:38[+wesbot ] [ esr ] [ loonycyborg] [ skyfaller] 20120907 19:26:38[ AI0867 ] [ fabi ] [ mattsc ] [ vultraz ] 20120907 19:26:38-!- Irssi: #wesnoth-umc-dev: Total of 21 nicks [1 ops, 0 halfops, 3 voices, 17 normal] 20120907 19:26:38-!- Home page for #wesnoth-umc-dev: http://wesnoth-umc-dev.ai0867.net 20120907 19:27:01-!- Channel #wesnoth-umc-dev created Mon Mar 31 16:51:24 2008 20120907 19:27:40< mattsc> You can also take the other 3 or 4 grunts of the map, if you want 20120907 19:27:47< mattsc> off 20120907 19:27:56-!- Irssi: Join to #wesnoth-umc-dev was synced in 86 secs 20120907 19:29:05< skyfaller> ok 20120907 19:29:17< skyfaller> I wish they would just let you delete units as easily as you create them 20120907 19:29:22< skyfaller> ok 20120907 19:29:42< mattsc> yeah 20120907 19:29:49< skyfaller> ok, now what? 20120907 19:29:52< mattsc> save the game under a filename that you can find again 20120907 19:30:11< skyfaller> ok 20120907 19:30:21< mattsc> Now comes and important thing: if you make a change to the lua code, you need to relaod that savegame 20120907 19:30:39-!- noy [~Noy@wesnoth/developer/noy] has quit [Quit: noy] 20120907 19:30:49< mattsc> but at least you only have to reload the save, and not go back to the beginning as you have to do for WML changes 20120907 19:31:04< skyfaller> ok 20120907 19:31:04< mattsc> So, open ai_helper.lua 20120907 19:31:23< skyfaller> ok 20120907 19:31:26< mattsc> your local version, I mean 20120907 19:31:43< skyfaller> like, the one the game is running? 20120907 19:31:47< skyfaller> or my Github repository? 20120907 19:31:50< mattsc> yes 20120907 19:31:55< mattsc> the one the game is running 20120907 19:31:58< skyfaller> ok 20120907 19:32:16< mattsc> (in my case those tow are the same) 20120907 19:32:23< mattsc> there's a new function there, skip_CA 20120907 19:33:09< mattsc> The first line in that function always returns false, so for testing, you want to comment out that line 20120907 19:33:18< skyfaller> ok 20120907 19:33:33< mattsc> Btw, I did it that way, so that I don't have to bother with WML variable or the like 20120907 19:33:50< skyfaller> I don't know what you are talking about, but go on :) 20120907 19:33:53< mattsc> then you choose which CAs to keep in the 'dont_skip' variable 20120907 19:34:17< mattsc> For the test we want to do, I suggest: 20120907 19:34:19< mattsc> local dont_skip = 'rush,hold' 20120907 19:34:28< skyfaller> ok 20120907 19:34:52< mattsc> Ok, that's all. Now when you reload and end your turn, Fred will only play through the rush and hold CAs 20120907 19:35:03< mattsc> well, and the RCA CAs afterward 20120907 19:36:11< skyfaller> ok 20120907 19:36:30< skyfaller> how can I tell? 20120907 19:36:36< mattsc> Hmm, this works, in principle, but I don't like it ... 20120907 19:37:00< skyfaller> let's disable the RCA CAs too? 20120907 19:37:35< mattsc> Yes and no, we can do that, but there's a better way, it just takes more work to set up. 20120907 19:38:14< skyfaller> ok 20120907 19:38:19< mattsc> Well, most of what you did is still the same, but I'll provide you with a better way of testing individual CAs 20120907 19:38:35< mattsc> So, all the setting up until you save the game is the same. 20120907 19:39:13< mattsc> So, how can you tell which CA is being executed (and get other debug info as well): 20120907 19:39:41< mattsc> Shut down wesnoth and open a terminal window (or an iTerm window) 20120907 19:40:04< skyfaller> k 20120907 19:40:16< mattsc> /Applications/Wesnoth-1.10.app/Contents/MacOS/Wesnoth -d 20120907 19:40:52< mattsc> The -d means you're in debug mode already. You don't need to activate it any more. 20120907 19:40:56< skyfaller> ok, cool 20120907 19:41:07< mattsc> load the game you just saved 20120907 19:41:12< skyfaller> I get a bunch of lines like this: 20120907 19:41:13< skyfaller> Sep 7 13:40:54 Vin.local Wesnoth[9723] : CGContextSetFont: invalid context 0x0 20120907 19:41:28< mattsc> Yeah, as long as nothing crashes, just ignore those 20120907 19:41:46< skyfaller> ok 20120907 19:41:58< mattsc> The end your turn and see what happens in the terminal window 20120907 19:42:19< skyfaller> can I get rid of all of those errors? They're really annoying 20120907 19:42:32< mattsc> I have not found a way to do so 20120907 19:42:43< skyfaller> do we know where they are coming from? 20120907 19:43:34< mattsc> I'm sure others do, I don't. But it has nothing to do with the AI. It's Wesnoth interacting with the System and not finding what it's looking for. 20120907 19:44:15< mattsc> Anyway, so did you see the CA messages when you ended your turn? 20120907 19:44:36< skyfaller> yeah 20120907 19:44:54< mattsc> Let's do one more thing: 20120907 19:44:57< skyfaller> we got spread_poison, then grab_villages and recruit_orcs 20120907 19:45:20< mattsc> reset skip_CA to what it was 20120907 19:45:43< mattsc> Then in ai_helper.print_eval change the false to a true 20120907 19:45:49< skyfaller> ok 20120907 19:45:59< mattsc> (only the first one) 20120907 19:46:06< mattsc> Now reload, and end your turn again 20120907 19:46:14< mattsc> and watch the terminal 20120907 19:46:28< skyfaller> ok 20120907 19:46:43< mattsc> Lots of output? 20120907 19:46:47< skyfaller> yes 20120907 19:46:50< mattsc> good. 20120907 19:47:04< mattsc> Ok, so all this is just to demonstrate how you can get to those messages 20120907 19:47:05< skyfaller> what are all of these numbers? 20120907 19:47:17< mattsc> Anything in a print() function is written to the terminal window 20120907 19:47:31< mattsc> So you can use that yourself to get additional information as you test things 20120907 19:47:40< skyfaller> is this how long it took to execute? 20120907 19:47:42< mattsc> The numbers in this case are time stamps 20120907 19:47:52< skyfaller> ok 20120907 19:48:23< mattsc> So in this case, I set this up to figure out which CAs needto long to evaluate. 20120907 19:48:40< mattsc> For you, I just meant it as a demonstration on how to get to the print() debug output 20120907 19:49:10< mattsc> So, you can go into the CA you are testing and add a line: 20120907 19:49:19< mattsc> print('hello, world') 20120907 19:49:36< mattsc> there and it will show up in the terminal when Fred gets to that part of the code 20120907 19:49:45< mattsc> You can also make it output more useful things :) 20120907 19:50:11< skyfaller> where are the CAs again? in grunt-rush-Freelands-S1_engine.lua? 20120907 19:50:16< mattsc> yes 20120907 19:50:38< mattsc> All of them have an _eval() and an _exec() function 20120907 19:50:59< mattsc> The eval() returns the score of the CA (and under no circumstances may it change the gamestate) 20120907 19:51:17< mattsc> The exec() of the CA with the highest score then does the actual action 20120907 19:51:59< mattsc> Ok, this is essentially all you need. 20120907 19:52:28< mattsc> I will set up an easier way of testing individual CAs that is closer to what I am using myself. 20120907 19:52:33< skyfaller> ok 20120907 19:53:10< mattsc> I thought the skip_CA() thing would work, and it does in a way, but it has a couple drawbacks that I didn't think about 20120907 19:53:20< skyfaller> like what? 20120907 19:53:32< mattsc> That the RCA CAs are not disabled, for example 20120907 19:54:05< mattsc> Also, it's nice to be able to only do the eval() and/or only execute the exec() once 20120907 19:55:33< skyfaller> so if I make print_eval() false again, will it still print my hello world? 20120907 19:55:33< mattsc> You can play with things already a little they way they are, but I'll provide a better way tonight 20120907 19:55:49< mattsc> Yes, print_eval() is only for those timing messages 20120907 19:56:24< mattsc> Search for print_eval inside grunt-rush-Freelands-S1_engine.lua and you'll see how it's handled 20120907 19:56:38< skyfaller> yeah, I think I get it now 20120907 19:57:15< mattsc> It's a bit of a hacky way, but once you figure it out, it's actually less work than trying to deal with WML variables or the like 20120907 19:58:10< mattsc> Any more questions right now? 20120907 19:58:54< skyfaller> no, I think i got it 20120907 19:59:19< mattsc> Ok. I'll set something up then tonight that will give you a right-click menu option to execute an individual CA 20120907 19:59:29< skyfaller> great 20120907 19:59:33< mattsc> bye for now 20120907 19:59:39< skyfaller> I don't suppose you could give me a right click to delete units? 20120907 19:59:55< skyfaller> that would make me super happy 20120907 20:00:36< mattsc> Hmmm... Probably I can. Especially since I already do so in one of the other AIs. :) 20120907 20:00:44< skyfaller> hooray! 20120907 20:01:17< mattsc> I just want to make sure that it's only available in debug mode for fred, but that should be easy enough... 20120907 20:01:51< skyfaller> k 20120907 20:02:34< mattsc> Maybe I should leave that as an exercise to the student? :D 20120907 20:02:44< skyfaller> hm? 20120907 20:03:07< mattsc> How about, you try to do that, if I give you a couple pointers... 20120907 20:03:14< skyfaller> ok 20120907 20:03:35< mattsc> give me a sec 20120907 20:03:40< skyfaller> k 20120907 20:04:33< mattsc> scenarios/swarm.cfg 20120907 20:04:46-!- CIA-59 [cia@cia.vc] has quit [Ping timeout: 244 seconds] 20120907 20:05:01< mattsc> Look for "Kill unit under ..." 20120907 20:05:55< skyfaller> ok 20120907 20:06:18< skyfaller> and what file am I transplanting that into? 20120907 20:06:20< mattsc> You want to put that into the appropriate place in multiplayer/era.cfg 20120907 20:06:49< skyfaller> ok, how do I make sure it only affects Fred in debug mode? 20120907 20:06:51< mattsc> Then you could try making it show up only in debug mode, and only if there is actually a unit under the cursor. 20120907 20:07:11< mattsc> That's the part for you to figure out. Do you know where the WML documentation is on the wiki? 20120907 20:07:16< skyfaller> no 20120907 20:07:41< mattsc> Actually, I don't remember if you can check for debug mode in WML. If not, just skip that part and I'll do it later. 20120907 20:07:55< skyfaller> k 20120907 20:08:16< mattsc> http://wiki.wesnoth.org/ReferenceWML 20120907 20:08:31< skyfaller> ok 20120907 20:09:09< mattsc> I have to go now. 20120907 20:09:18< mattsc> If you don't want to do this, I'll do it later, no prob. 20120907 20:09:48< mattsc> But you've been saying that you want to do some coding too. This is WML granted, but that's all part of it. :) 20120907 20:10:11< skyfaller> ok :) 20120907 20:10:28< mattsc> We might have to convert this to Lua anyway to check for debug mode. As I said, I don't remember if WML does that. 20120907 20:10:39< mattsc> Feel free to make that conversion too 20120907 20:15:32< mattsc> Oh, it seems to be doable in WML 20120907 20:15:54< mattsc> #ifdef DEBUG_MODE 20120907 20:15:57< mattsc> .... 20120907 20:16:55< mattsc> #endif 20120907 20:17:15< mattsc> untested; and now I am really off for a while 20120907 20:22:19-!- shadowm_laptop [ignacio@wesnoth/developer/shadowmaster] has joined #wesnoth-umc-dev 20120907 20:22:40-!- CIA-59 [cia@cia.vc] has joined #wesnoth-umc-dev 20120907 20:52:08-!- mode/#wesnoth-umc-dev [+v CIA-59] by ChanServ 20120907 21:10:03<+CIA-59> wesnoth-umc-dev: vultraz * r15904 /trunk/NX-RPG/macros/unit_deaths.cfg: NX: added strings around the bonus gold floating text to shut up a pango warning 20120907 21:23:52-!- Octalot [~noct@host86-130-60-64.range86-130.btcentralplus.com] has joined #wesnoth-umc-dev 20120907 23:01:20-!- Crendgrim [~crend@77-22-112-72-dynip.superkabel.de] has quit [Quit: ...] 20120907 23:20:14<+CIA-59> Wesnoth-AI-Demos: mattsc master * r51e1e34 / lua/grunt-rush-Freelands-S1_engine.lua : Replace all self: and self. with grunt_rush_FLS1: or grunt_rush_FLS1. - http://git.io/pMi0zA --- Log closed Sat Sep 08 00:00:13 2012