#gemrb@irc.freenode.net logs for 3 Jul 2011 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage

[00:46:50] --> barra_away has joined #gemrb
[00:48:04] <-- edheldil_ has left IRC (Ping timeout: 240 seconds)
[00:50:00] <-- barra_home has left IRC (Ping timeout: 255 seconds)
[01:05:50] <-- Maighstir has left IRC (Quit: .)
[07:19:11] --> Avenger has joined #gemrb
[07:19:38] --- ChanServ gives channel operator status to Avenger
[07:19:42] <Avenger> hi
[07:20:40] <Avenger> fuzzie did you see the commits from lynx? I think we talked about two of them earlier (the trap deactivation and parsing the [ANYONE] object)
[07:36:24] <fuzzie> the [ANYONE] parsing is only used in one place now
[07:36:33] <fuzzie> so it must be good
[07:41:06] <Avenger> damn, bg1 has no getglobal clua cmd :( only setglobal
[07:42:33] <fuzzie> i didn't look at lynx's guiscript changes though
[07:43:20] <Avenger> there is indeed some 1024 limit on bg1 global variables
[07:43:47] <fuzzie> meh, no-one patched it? :P
[07:44:02] <fuzzie> pst has some limit, but easily enough fixed
[07:44:32] <Avenger> pst is easier, because of the var.var, i could easily find the limit
[07:44:47] <Avenger> but bg1 setglobal so far seems exactly the same as in bg2
[07:44:57] <Avenger> i didn't find where it bails out
[07:45:55] <Avenger> the ida debugger sucks, btw
[07:46:33] <Avenger> i cannot maximize a view without it covering all the menus
[07:47:07] <fuzzie> it is also buggy :P
[07:47:24] <Avenger> the new one didn't crash on me yet
[07:56:50] --> thyseus has joined #gemrb
[07:57:06] <thyseus> hi, when saving and loading a savegame, i am missing items. is this a know bug?
[07:57:20] <thyseus> using gemrb latest git and playing the german version of baldurs gate 2
[07:58:16] <fuzzie> no
[07:58:43] <thyseus> ok, any ideas why this happens? or someone has a cheat code handy so i can complete my quest at least? ;)
[08:00:29] <-- PixelScum has left IRC (Quit: The beer is meal.)
[08:00:37] <fuzzie> it sounds pretty .. bad? you didn't change the data (mods, etc) between the save and the load?
[08:01:34] <thyseus> no, i did not. i can reproduce it the same time over and over again, i can send you the savegame file if you have the time to debug this
[08:01:58] <thyseus> or some other core developer in here maybe ;)
[08:02:19] <fuzzie> i don't know about cheats either, ask Avenger or lynxlynxlynx (when he wakes up)
[08:02:31] <thyseus> ah ok, i will do that, thx for the hint
[08:02:32] --> Drakkar has joined #gemrb
[08:02:48] <fuzzie> and i can't look today, but i'd appreciate the savegame if no-one else helps, because it sounds bad and should be fixed, and i can look tomorrow
[08:02:59] <Avenger> i have no time for more debugging ;D
[08:03:01] <thyseus> ok, nice! i am around anyway
[08:03:26] <Avenger> i'm still working on this 1024 variable limit
[08:04:36] <fuzzie> phft, just get people to use gemrb :P
[08:05:59] --> test32894789234u has joined #gemrb
[08:09:43] <Avenger> oh hehe, i see the variable limit now
[08:09:52] <Avenger> it was here all the time
[08:10:38] <Avenger> .text:00586A1B push 400h
[08:10:40] <Avenger> .text:00586A20 mov ecx, [ebp+pGame]
[08:10:42] <Avenger> .text:00586A26 add ecx, game.globals
[08:10:43] <Avenger> .text:00586A2C call cons_variablearray
[08:11:15] <Avenger> i looked for it in setglobal and saving/loading the game, but never looked at the constructor, hehe
[08:12:14] <Avenger> they allocate 1024 * 84 bytes ALWAYS
[08:12:32] <Avenger> totally lame :)
[08:13:00] <Avenger> ok, mission accomplished
[08:13:18] <thyseus> want a next mission? ;)
[08:13:40] <Avenger> not yet, gotta get the quest rewards
[08:13:52] <thyseus> well, this was assembler code wasnt it?
[08:14:01] <thyseus> did you get that with the debugger?
[08:14:21] <thyseus> and is this stored in the .o files? ;)
[08:14:32] <thyseus> <- just a novice web developer... ;)
[08:14:52] <fuzzie> Avenger is poking at the original bg1 engine there
[08:15:46] <Avenger> yes, this is disassembly, reversed/partially marked up by ida pro from machine code
[08:16:45] <Avenger> the only number in the snippet is the number i looked for (for several days)
[08:17:41] <thyseus> is this "set 400 as hexadecimal value onto some stack"?
[08:17:56] <fuzzie> and cons_variablearray is CVariableHash::CVariableHash(long)
[08:18:37] <fuzzie> so that snippet is pushing 400h (1024) onto the stack, then calling that constructor on pGame->globals
[08:19:27] <fuzzie> come to think of it this means that bg2 must have one, there's no alternative constructor
[08:22:38] <Avenger> yes, fuzzie, this is the same in bg2
[08:22:56] <Avenger> i don't know if bg2 can somehow reallocate the memory if needed
[08:23:22] <Avenger> but originally bg2 also allocates space for 1024 variables
[08:23:47] <Avenger> it is not a hash in bg1, though
[08:23:53] <Avenger> it is just a large array
[08:23:55] <fuzzie> ah, ok
[08:24:03] <Avenger> a plain array of 1024*84 bytes
[08:24:04] <fuzzie> well, i guess they're probably chaining them, in bg2
[08:25:31] <fuzzie> i just borrow Avenger's work when i want to check anything :)
[08:30:19] <Avenger> bg2 has 200h there, so initially they have room only for 512 variables, i'm sure they grow the size later
[08:30:48] <fuzzie> well, if it's a hash, it's more likely they have 512 hash buckets instead
[08:32:43] <Avenger> doesn't seem to be a hash, bg2 also allocates the raw 200h * 54h memory :D
[08:32:52] <Avenger> 54h is the single variable struct size
[08:33:51] <Avenger> on the other hand, there are primes involved
[08:34:08] <Avenger> that means, they got some buckets for sure
[08:36:08] <Avenger> these functions are short, yet i don't understand them, i just see they use prime numbers
[08:38:23] --> edheldil_ has joined #gemrb
[08:38:26] <Avenger> the oddest thing is that bg2's pushvariable call is recursive.
[08:38:40] <Avenger> i think that's where chaining happens
[08:40:01] <Avenger> oh , i see now. if the space is not enough, it does realloc by space*2
[08:40:14] <fuzzie> that's terrible :P
[08:40:37] <Avenger> totally terrible
[08:40:55] <Avenger> it copies the original area one by one to a space*2 sized area
[08:41:25] <Avenger> totally awful, not even chaining, just allocate a twice as large area, copy the stuff one by one, then insert the new element
[08:41:27] <Avenger> lol
[08:41:32] <Avenger> absolutely lol
[08:42:23] <Avenger> i just wonder what the primes do here
[08:46:09] <Avenger> something like, multiply the characters of variable's name by primes. like c1*2+c2*3 ....
[08:46:36] <Avenger> except if they are space, spaces are ignored
[08:47:19] <Avenger> the worst thing is in the end where it does a modulo by array size (which is a 2^x value)
[08:48:21] --> lynxlynxlynx has joined #gemrb
[08:48:21] <-- lynxlynxlynx has left IRC (Changing host)
[08:48:21] --> lynxlynxlynx has joined #gemrb
[08:48:21] --- ChanServ gives channel operator status to lynxlynxlynx
[08:48:57] <Avenger> this is to find the initial position of the variable in the array.
[08:49:27] <Avenger> hi Lynx
[08:49:46] <fuzzie> that is just the hash function
[08:50:11] <Avenger> yes fuzzie, it is. but there are no buckets
[08:50:25] <Avenger> if the place is not empty, it simply goes for the next one
[08:51:05] <Avenger> it is a flat memory area
[08:51:29] <Avenger> and when it reallocates for the double size... i think everything goes wrong
[08:51:35] <lynxlynxlynx> gmornin
[08:52:14] <fuzzie> i mean, the multiplication/modulo thing is just a very dumb hash function
[08:52:16] <Avenger> only the lower place of the memory area will be filled, but the hash will change, and it will start looking in the high area half of the time
[08:52:22] <Avenger> yes it is :)
[08:53:08] <fuzzie> and your variables list is just a linearly probed hash table, so .. a very dumb hash table
[08:54:03] <fuzzie> alas :)
[08:54:21] <thyseus> morning lynx, if you have some time later, i would like to tell you a (probably) but i encountered
[08:54:30] <thyseus> s/but/bug
[08:54:45] <Avenger> well, at least i found out why bg2 doesn't choke on >1024 variables
[08:54:54] <Avenger> and why bg1 does
[08:55:10] <Avenger> ready for next mission thyseus
[08:55:58] <thyseus> yeah, ok. so, when saving and loading a savegame, i lose items. i have a savegame prepared
[08:55:59] <lynxlynxlynx> thyseus: do you have the original engine handy? (windows, wine, vm)?
[08:56:07] <thyseus> i use gemrb-git on ubuntu
[08:56:23] <thyseus> ah, yes, i have, but i would need to restart for that
[08:56:41] <thyseus> since BgMain.exe doesnt run on wine anymore (it did once, not sure why)
[08:56:48] <lynxlynxlynx> ok
[08:57:32] <thyseus> ok, just a second, i search the savegame, then i explain
[08:57:39] <lynxlynxlynx> which items is this about?
[09:00:16] <thyseus> various items. example1: in the docks of atkatla you have those harfner quest. there i pick up the amulet from the chest, save, load, and the amulet is away. example2: also the docks, thieves guild boss gives me the document to join the other's guild, save, load, document away.
[09:00:37] <thyseus> unfortunately i now only have the savegame with the item missing
[09:00:57] <thyseus> but speaking to the guild boss reveals that i already got it from him since he doesnt offer it anymore
[09:01:15] <Avenger> what if you create an item (cheat console)
[09:01:17] <Avenger> save/reload
[09:01:33] <fuzzie> well i can't remember how to create an item on console
[09:01:36] <thyseus> i try that. How does the cheat console work?
[09:01:54] <Avenger> CreateItem(1,"arow01") ?
[09:02:02] <lynxlynxlynx> did you actually see the item in the inventory?
[09:02:26] <lynxlynxlynx> if you have it full, a container will not pick it up and place it last (so you may be fooled)
[09:02:29] <thyseus> yes, i see the item before saving&loading
[09:02:35] <lynxlynxlynx> in a dialog, it would be dropped on the ground
[09:02:42] <thyseus> oh let me check !!
[09:02:44] <thyseus> ;)
[09:03:20] <fuzzie> and this is why asking lynx is always best :P
[09:03:47] <Avenger> though i didn't understand what lynx said :P
[09:04:01] <lynxlynxlynx> :P
[09:04:11] <thyseus> dammit lynx is right, i am such a fool ;)
[09:04:20] <thyseus> but afaik in the original BG there is a message, isnt it?
[09:04:24] <Avenger> well, cool, another bug fixed :D
[09:04:33] <Avenger> without actual code change
[09:04:40] <thyseus> the fix happened in my brain
[09:05:20] <thyseus> i remember a message like "your inventory is full, item is dropped on the ground" or something
[09:05:23] <Avenger> wouldn't the original engine say something like '..'
[09:05:25] <Avenger> yeag
[09:05:27] <lynxlynxlynx> we do that too
[09:05:39] <lynxlynxlynx> atleast in bg2, maybe the string is missing in bg1
[09:05:44] <lynxlynxlynx> but you're in bg2 :S
[09:06:03] <thyseus> hmm then i just was tired while playing. thanks a lot
[09:06:27] <Avenger> if it doesn't say that, then bug lynx about it :) that is definitely something we have to fix
[09:06:55] <thyseus> but: when trying to leave an area and not all party members are in range, i get that sound that says that ineed to collect my party to leave the area
[09:07:00] <lynxlynxlynx> i saw it plenty of times yesterday, but we could be missing it in some actions
[09:07:07] <thyseus> but this sound is played a hundred times simultanously, sounds like an echo in a church
[09:07:12] <thyseus> is that bug known?
[09:07:15] <lynxlynxlynx> yeah
[09:07:22] <Avenger> yep, but... meh
[09:07:32] <Avenger> the original has some delay check in it, i think
[09:07:54] <Avenger> the original engine checks if it was issued x time ago, if it was, it won't repeat
[09:08:20] <thyseus> ok, one last thing/question: is it possible that gemrb obeys closed doors, while the original did not?
[09:08:39] <Avenger> closed doors?
[09:08:48] <Avenger> i never walked past closed doors in the original
[09:08:59] <thyseus> but you could walk past open doors ! not in gemrb
[09:09:00] <thyseus> i mean:
[09:09:17] <lynxlynxlynx> the door itself?
[09:09:29] <lynxlynxlynx> the mobile part
[09:09:31] <thyseus> for example in the docks, there is a very small area. when i put 2 characters at the left of the door and "open" it, the 2 chars get stuck to the left of the "open" door
[09:09:46] <thyseus> and cant pass it
[09:10:05] <thyseus> they first can pass it when i close the door
[09:10:13] <thyseus> that is not really a bug
[09:10:18] <thyseus> just a strict collision detection
[09:10:30] <thyseus> which, afaik, isnt as strict in the original engine
[09:10:31] <Avenger> we might handle the searchmap/personal space differently
[09:10:51] <Avenger> this can cause problems
[09:11:38] <Avenger> as long as it doesn't block the gameplay, i'm fine with it
[09:11:52] <thyseus> yes, i am fine with that, too. just wanted to know
[09:12:03] <thyseus> it is even better
[09:12:23] <lynxlynxlynx> Avenger: something for you :P for 0.6.2 i added worldmap updating to movebetweenareascore. You reverted it in master and fixed it differently, but incompletely. Can we resolve this once and for all?
[09:12:27] <Avenger> there are other weird things, like morte's initial walkpath in the mortuary is different in gemrb than in the original :)
[09:13:02] <lynxlynxlynx> it was d66dff09f68d6 and then i reinstated it in the 0.6.3 release branch, but then it got forgotten
[09:13:25] <Avenger> meh, do it, i didn't like the change, but i can't think on doing it better
[09:13:29] <fuzzie> morte's initial walkpath seems random
[09:13:59] <Avenger> we do a lot of stuff wrong with moving between areas
[09:14:09] <Avenger> like, running scripts when the move is only partially done
[09:14:19] <Avenger> and then hacking it to work still :)
[09:14:36] <thyseus> how difficult is it to implement the right-click movement behavior of the bg engine? so you can rotate the formation around the mouse pointer?
[09:14:41] <thyseus> i guess 7 / 10 ? ;)
[09:14:45] <Avenger> or loading the whole tileset on area load
[09:15:28] <Avenger> we already rotate the formation based on position, so adding an offset to it isn't that tough
[09:15:50] <lynxlynxlynx> mostly trigonometry
[09:16:02] <thyseus> can you give me a hint where in the source code i find this?
[09:16:07] <Avenger> nah, the math is already done by fuzzie ;)
[09:16:15] <thyseus> most probably i wont get it, but i want to take a try
[09:17:20] <fuzzie> i'm not sure where you'd do it
[09:17:37] <Avenger> MoveToPointFormation calculates angle
[09:18:17] <Avenger> declare a new variable, add it to angle, modify it with the right click?
[09:18:26] <lynxlynxlynx> fuzzie: any idea for how to do last night cleanly? I got away with this, but it is ugly:
[09:18:28] <lynxlynxlynx> - if (target->GetInternalFlag()&IF_NOINT && (target->GetCurrentAction() || target->GetNextAction()
[09:18:28] <lynxlynxlynx> + Action *curact = target->GetCurrentAction();
[09:18:28] <lynxlynxlynx> + if (target->GetInternalFlag()&IF_NOINT && ((curact && curact->actionID != 137) || (!curact && target->GetNextAction()))) {
[09:20:15] <Avenger> meeh lynx
[09:20:23] <Avenger> don't do actionID!=137
[09:20:30] <Avenger> it is sooo IE
[09:20:43] <lynxlynxlynx> that's why i'm asking
[09:21:12] <fuzzie> do you think that is truly necessary?
[09:21:18] <lynxlynxlynx> there's this *single* use of startdialog without actionoverride
[09:21:24] <Avenger> if you really need some action id based stuff, add a flag to the action table
[09:21:28] <fuzzie> the actions don't terminate on the next frame?
[09:21:40] <lynxlynxlynx> well, without this the stuff at the end of the tree of life didn't finish
[09:21:54] <fuzzie> our dialog code is broken because we start it too early, it isn't meant to start until the next game tick
[09:22:03] <fuzzie> which includes all the IF_NOINT checks etc
[09:22:33] <lynxlynxlynx> http://log.usecode.org/gemrblog.php?log=2Jul2011 <-- see bottom
[09:23:04] <fuzzie> i did read it, not enough info :)
[09:23:05] <Avenger> that would be fixed if the dialog fires a bit later
[09:23:41] <fuzzie> it is very important because of the action clearing, which breaks various quests
[09:24:10] <fuzzie> but it's pretty tricky to do right
[09:24:14] <Avenger> there is no action override?
[09:24:43] <Avenger> hmm, then i wonder why it would be delaye
[09:24:45] <Avenger> d
[09:24:48] <fuzzie> the action override shouldn't help there anyway, if there are multiple actions queued
[09:25:01] <fuzzie> but the Dialog actions are *not* where dialog checks/init are done
[09:25:20] <Avenger> the dialog action checks first
[09:25:27] <fuzzie> i mean, in original engine
[09:26:13] <Avenger> i look at the original, there are at least some checks in the dialogue action, it doesn't just shoot a message
[09:26:15] <fuzzie> although i'm not sure whether we handle IF_NOINT properly anyway
[09:26:42] <fuzzie> Avenger: yeah, but once it worked out 'i should try starting a dialog', it doesn't happen immediately
[09:26:56] <lynxlynxlynx> something just for the release branch, i guess
[09:27:08] <Avenger> the first checks are just to see if the 'actor is there', but i thought it will check for the 'actor is busy' thing in the dialog action too
[09:27:14] <fuzzie> i don't think so
[09:27:23] <fuzzie> this is why you get the GUI 'popping' in the original
[09:28:10] <fuzzie> the only important bit for me is that the action queue clearing is done in the dialog code, *not* the action
[09:28:21] <fuzzie> so i didn't decode the original engine's action much..
[09:31:54] <Avenger> shouldn't we simply end cutscenes when a dialog starts?
[09:32:41] <fuzzie> we do, right?
[09:32:44] <Avenger> maybe that EndCutscene wouldn't even needed in the original :D
[09:33:03] <fuzzie> but the queue must stay untouched in the action
[09:33:35] <Avenger> the problem is that IF_NOINT disables the dialog, no?
[09:33:43] <fuzzie> IF_NOINT isn't about cutscenes, though
[09:33:49] <fuzzie> i mean, i don't understand why IF_NOINT is set
[09:34:14] <Avenger> don't we set it when queueing the cutscene actions?
[09:34:24] <fuzzie> we queue SetInterrupt actions
[09:34:38] <fuzzie> but again, you must not modify the queue in the action :P
[09:35:51] <fuzzie> i'm not sure IF_NOINT is even the correct thing to check
[09:36:03] <Avenger> well, IF_NOINT is set by the first SetInterrupt
[09:36:08] <fuzzie> this code is so delicate
[09:36:32] <fuzzie> but if you're asking 'should the dialog action unset IF_NOINT?', the answer is 'no'
[09:36:40] <Avenger> no
[09:36:56] <Avenger> i meant, if i initiate dialog, and i have IF_NOINT set, i should still be able to do it
[09:37:02] <Avenger> because i'm not interrupted :D
[09:37:09] <Avenger> i cannot interrupt myself
[09:37:18] <fuzzie> yeah, but another person shouldn't be able to interrupt you
[09:37:23] <Avenger> yes
[09:37:31] <Avenger> but in this case it is my dialog :D
[09:37:37] <fuzzie> oh bleh
[09:37:40] <Avenger> in the elven tree case
[09:37:41] <fuzzie> right, the swap code
[09:37:43] <fuzzie> stupid :P
[09:37:45] <Avenger> yes
[09:37:52] <fuzzie> ok i leave this to be your problems
[09:37:57] <Avenger> :(
[09:38:04] <fuzzie> i hope to finally fix stupid action queueing on monday/tuesday/something
[09:38:22] <fuzzie> but have work to do today
[09:38:55] <Avenger> the swap stuff in dialog is at the limit of my brain
[09:39:07] <Avenger> maybe already a bit beyond that
[09:39:23] <Avenger> i'm pretty sure the original does it much more elegantly...
[09:39:49] <Avenger> they have a PlayerDialog action which is different from the normal Dialog stuff
[09:40:10] <Avenger> so, i guess they don't have this swap crap
[09:40:21] <CIA-40> GemRB: 03lynxlupodian * r2c5426359522 10gemrb/gemrb/core/GameScript/GSUtils.cpp:
[09:40:21] <CIA-40> GemRB: reinstated d66dff09f68d6:
[09:40:21] <CIA-40> GemRB: MoveBetweenAreasCore: update the worldmap if needed
[09:40:21] <CIA-40> GemRB: fixes Brynlaw, Saradush and others missing from the worldmap
[09:40:23] <CIA-40> GemRB: 03lynxlupodian * r9091368a904f 10gemrb/gemrb/core/ (GameScript/GSUtils.cpp Scriptable/Actor.cpp): STR_TARGETBUSY contains a token, so set it
[09:42:20] <fuzzie> Avenger: well, i can take a look during the week, if needed
[10:13:24] <lynxlynxlynx> oh, something else Avenger
[10:13:55] <lynxlynxlynx> do you know how the activate/deactivate actions or states are supposed to work? we don't handle them properly now
[10:14:54] <lynxlynxlynx> i had to add two hacks to get windspear hills somewhat working; one for visibility and one for avoiding script updates
[10:16:17] <Avenger> no, i don't know ;)
[10:16:48] <Avenger> activate what? infopoint?
[10:17:04] <Avenger> or actor?
[10:18:13] <lynxlynxlynx> actors
[10:18:30] <Avenger> ah activate works only on actors...
[10:18:43] <Avenger> so that settles it anyway ;)
[10:18:47] <lynxlynxlynx> Activate / IF_VISIBLE
[10:19:18] <Avenger> well, if that helps, Activate action just sends a message (lets call it activate message)
[10:19:24] <Avenger> so, it is delayed
[10:19:32] <Avenger> it is not immediate
[10:20:23] <Avenger> the activate message can target non actors, but it is initiated by other actions
[10:20:30] <Avenger> so, it is irrelevant
[10:21:04] <Avenger> activated actors: lose their walkpath
[10:21:42] <Avenger> looks like their searchmap occupation is recalculated (they are placed onto the map)
[10:24:08] <lynxlynxlynx> they don't obstruct?
[10:34:14] <Avenger> not activated actors don't obstruct, yes
[10:34:27] <Avenger> deactivate 'removes' them from the map
[10:35:20] <Avenger> activate even bumps them
[10:35:36] <Avenger> so if their original place was occupied, they will be replaced
[10:36:09] <Avenger> and that's about all that happens to them
[10:38:57] <-- edheldil_ has left IRC (Ping timeout: 276 seconds)
[10:43:50] <lynxlynxlynx> soa completed :)
[10:44:00] <wjp> whee :-)
[10:44:19] <lynxlynxlynx> only two unresolved blockers this time
[10:44:41] <lynxlynxlynx> or maybe just one
[10:46:43] <-- thyseus has left IRC (Read error: Connection reset by peer)
[10:49:18] <lynxlynxlynx> excellent result actually, all the previous runs were just the main plot, this was with all the subquests i could find
[10:50:58] <Avenger> what did you change with activate?
[10:51:22] <lynxlynxlynx> nothing yet, looking at it
[10:51:57] <Avenger> afaik: activate - enable character scheduling/place it on the map
[10:52:06] <lynxlynxlynx> http://pastebin.com/vcubCqgZ <-- this was the hack
[10:52:07] <Avenger> deactivate - disable scheduling, clear walkpath
[10:52:54] <fuzzie> yeah, something like that
[10:53:04] <fuzzie> it uses STATE_DISEASED, right?
[10:53:26] <Avenger> i didnt see that
[10:53:59] <fuzzie> the state is updated in RestoreActiveAI(), based on field_2008_deactivated and !InParty
[10:54:12] <Avenger> .text:008D7938 0FC mov [ebp+pActor], ecx
[10:54:14] <Avenger> .text:008D793E 0FC mov eax, [ebp+pActor]
[10:54:16] <Avenger> .text:008D7944 0FC mov ecx, [ebp+bActivate]
[10:54:17] <Avenger> .text:008D7947 0FC mov [eax+actor.field_2C08], ecx
[10:54:27] <Avenger> 2c08 or 2008 ?
[10:55:01] <fuzzie> um, could be 2c08
[10:55:06] <Avenger> 2c04/08/0c are the scheduling flags :)
[10:55:09] <fuzzie> my handwriting is very bad :P
[10:55:15] <Avenger> i still don't know why there are 3
[10:55:24] <Avenger> but it is what we call IF_ISVISIBLE
[10:56:33] <Avenger> yep, i definitely believe that there is a separate function that flips the bit of STATE_DISEASED based on this
[10:56:34] <fuzzie> oh, it is field_20c8_activated, surely
[10:56:43] <fuzzie> erm, 2c08
[10:56:46] <fuzzie> because the script loop check is 'scheduled && 2c08 && 2c0c'
[10:56:51] <Avenger> i don't know why they had to use this crap
[10:57:26] <Avenger> ah ok, it is 3 bits then, 2c08 is the only one that gets flipped by activate
[10:57:38] <fuzzie> there's a 'if (!2c0c) CheckCutSceneStateOverride();'
[10:58:22] <Avenger> 2c04 is what i call scheduled, i think it is based on the area schedule flags
[10:58:35] <fuzzie> yes, i was just reading out of your IDB, of course
[10:58:41] <fuzzie> so mostly i trust your field names
[10:58:59] <Avenger> so 2c04 comes from the area schedule flags, 2c08 is the activate/deactivate, and 2c0c is from the stateoverride timer
[10:59:41] <fuzzie> the only thing i changed is 'cangoidle' to nDialogWait i think
[11:00:06] <fuzzie> although i named all the AI-update fields too probably
[11:00:23] <fuzzie> don't know if you care about them
[11:00:37] <Avenger> hmm cangoidle is not a bool then, but a counter?
[11:00:42] <fuzzie> yes
[11:01:04] <fuzzie> it controls the countdown after you tried initiating dialog with an actor
[11:01:15] <Avenger> LOL, so they got a counter in the actor, like our waitcount you removed?
[11:01:47] <fuzzie> sure
[11:01:52] <fuzzie> but it's only for the dialog-freezing thing
[11:02:21] <Avenger> hmm, ok, so not the same, but still, it isn't counted in the action
[11:02:29] <fuzzie> yes
[11:02:37] <fuzzie> i mean, it's on the other side
[11:02:48] <fuzzie> if the *player* initiates dialog, then the *target* gets a counter set
[11:03:15] <Avenger> hehe, yes, that is something that couldn't be put in the action
[11:03:32] <Avenger> i wonder why it was needed
[11:03:59] <fuzzie> well, you know how it works in the original, right?
[11:04:07] <Avenger> no
[11:04:11] <fuzzie> if you talk to a non-enemy, then they stop running scripts for a few seconds, to give you a chance to catch up
[11:04:12] <Avenger> i forget stuff :)
[11:04:30] <fuzzie> it is the cause of a lot of abuse, because you can 'force-talk' an enemy who hasn't turned red yet, and then kill them while they don't notice
[11:04:32] <Avenger> i didn't know
[11:04:39] <lynxlynxlynx> aha
[11:04:48] <fuzzie> it is the #1 stupid bg game exploit :P
[11:04:52] <lynxlynxlynx> or neutrals that are on their way out of the area
[11:05:12] <Avenger> i couldn't even manage to steal from kangaxx before he turns hostile :D
[11:05:28] <Avenger> so, you can just keep talking to him, and hack on him?
[11:05:35] <fuzzie> yeah
[11:05:36] <Avenger> heh
[11:05:48] <Avenger> we definitely shouldn't allow this :D
[11:05:57] <fuzzie> bg2 has a function called CheckDialogWait() in the AI update
[11:06:24] <fuzzie> which sets nDialogWait to 0 if the actor is running escapearea, or startdialog, or movetopoint, or a bunch of actions (265, 266, 267, 334) which i didn't bother decoding in my notes
[11:06:39] <fuzzie> oh, also if 293/294 is the *next* action
[11:06:52] <fuzzie> so i guess that is intended to stop abuse, only it doesn't work so well
[11:07:56] <fuzzie> ah, those are all dialog actions. makes sense.
[11:12:00] <fuzzie> lynxlynxlynx: good work on soa, btw
[11:12:59] <lynxlynxlynx> dhewg's run helped, since i didn't have to bother with all those bugs too :)
[11:13:28] <lynxlynxlynx> now just to clean up all the hacks
[11:15:27] <Avenger> then find out what got broken in other games by them :D
[11:15:44] <CIA-40> GemRB: 03lynxlupodian * r0f4a55be78f7 10gemrb/gemrb/GUIScripts/bg2/GUICG9.py:
[11:15:44] <CIA-40> GemRB: bg2::cg: redraw proficiencies on load
[11:15:44] <CIA-40> GemRB: fixes kits with no points to distribute not being able to progress further
[11:15:57] <lynxlynxlynx> a neverending spiral
[11:16:07] <Avenger> the trap deactivation stuff was just a removal of a previous hack by fuzzie
[11:16:07] <lynxlynxlynx> but the radius is ever smaller :)
[11:16:24] <lynxlynxlynx> yeah, but there was other work in between
[11:16:29] <Avenger> i see
[11:16:36] <fuzzie> well, everything is using trigger lists now, of course
[11:17:21] <Avenger> well, eventually we'll get to a point where the IE has more bugs :)
[11:21:06] <lynxlynxlynx> and now we crash right at the start of tob
[11:21:20] <Avenger> hehe
[11:21:22] <lynxlynxlynx> so much for that news entry :|
[11:21:42] <lynxlynxlynx> the assertion in GameScript::Wait fails
[11:21:52] <lynxlynxlynx> forgot to break on abort, will retry
[11:22:26] <Avenger> i don't even have assertion there
[11:22:48] <Avenger> ahh i see it
[11:24:20] <Avenger> if i use Wait(0xfffffff) in a game script, it will break the game?
[11:24:55] --> Maighstir has joined #gemrb
[11:25:11] <lynxlynxlynx> these are just 1 or 2
[11:25:15] <lynxlynxlynx> the state is -2 there
[11:25:48] <Avenger> someone set it to -1 somewhere? :D
[11:27:08] <Avenger> if (Sender->CurrentActionState == 1) {
[11:27:10] <Avenger> //this is the LastDisarmFailed field, but this is an actor
[11:27:12] <Avenger> //Sender->LastTarget = 0;
[11:27:13] <Avenger> Sender->ReleaseCurrentAction();
[11:27:15] <Avenger> } else {
[11:27:17] <Avenger> Sender->CurrentActionState--;
[11:27:19] <Avenger> }
[11:27:20] <Avenger> this seems fishy
[11:27:22] <Avenger> shouldn't it be == 0 ?
[11:27:34] <fuzzie> where's that?
[11:27:43] <Avenger> attackoneround
[11:27:49] <fuzzie> oh that's totally wrong anyway
[11:28:08] <fuzzie> but no, it is correct
[11:28:21] <fuzzie> i mean, the action is wrong, but the check is correct
[11:28:21] <Avenger> if it was 0, then -- will bring it to -1
[11:28:26] <fuzzie> yes, but it is never 0
[11:28:34] <Avenger> hehe, never say never
[11:28:36] <fuzzie> because there's a check above which sets it to something else if it's 0
[11:28:52] <fuzzie> yes, i'm pretty sure you can totally break it
[11:29:05] <fuzzie> because i bet it can get cleared somewhere in attackcore :)
[11:30:59] <Avenger> what about making that ==1 to <=1 ?
[11:31:19] <Avenger> at least, it will never go -1
[11:31:31] <fuzzie> sure
[11:31:38] <Avenger> or just add an assert there too if you want to catch the bug
[11:34:23] <lynxlynxlynx> that didn't help at all
[11:34:54] <fuzzie> that field should get cleared for new actions
[11:34:58] <fuzzie> so must be caused by script?
[11:35:10] <lynxlynxlynx> yes, a cutscene starts
[11:35:26] <lynxlynxlynx> this is the second action in it
[11:35:44] <lynxlynxlynx> cut205a
[11:36:08] <lynxlynxlynx> ok, not the second, one of those wait(2) ones
[11:37:58] <Avenger> parameters->int0Parameter is not some insane number?
[11:39:58] <lynxlynxlynx> it's 2
[11:41:55] <Avenger> if it is 2, then it wouldn't be able to become -2
[11:42:38] --> edheldil_ has joined #gemrb
[11:43:11] <Avenger> if it is 0 when it enters the action, it becomes 2*AI_UPDATE_TIME, if it is non 0, it will be just decrased. So, it should be negative before entering. Or it isn't 2 :)
[11:44:42] <Avenger> PlayDead has a different decrementing protocol than the other actions
[11:46:28] <fuzzie> yes, that one i actually fixed
[11:47:02] <fuzzie> hm
[11:47:08] <fuzzie> maybe it is not so good
[11:47:43] <fuzzie> drat.
[11:48:08] <fuzzie> that is indeed buggy
[11:48:16] <fuzzie> it must *return* after ReleaseCurrentAction
[11:48:31] <Avenger> playdead causes it to be -1, yeah
[11:48:45] <Avenger> yeah
[11:49:07] <Avenger> playdeadinterruptable too, if you are there
[11:49:21] <fuzzie> something higher level should really assert on that
[11:49:24] <fuzzie> i can't make fixes atm
[11:49:53] <lynxlynxlynx> i'm trying it now
[11:50:09] <Avenger> lynx will surely do it, i'm pretty sure if you return after releasecurrentaction, it will be ok
[11:50:10] <fuzzie> but Scriptable.cpp:505 should assert that CurrentActionTicks and CurrentActionState are 0
[11:51:50] <lynxlynxlynx> it didn't change anything :s
[11:51:59] <Avenger> meh
[11:52:06] <Avenger> you changed both instances?
[11:52:09] <lynxlynxlynx> forgot to save
[11:52:12] <fuzzie> heh :)
[11:52:15] <Avenger> O_o
[11:52:21] <fuzzie> do try the assert too, which will catch all such errors
[11:54:22] <-- Avenger has left IRC (Quit: ChatZilla 0.9.87 [Firefox 5.0/20110615151330])
[11:54:52] <lynxlynxlynx> no change
[11:56:04] <lynxlynxlynx> trying something more
[11:57:51] <lynxlynxlynx> yeah
[12:13:36] <lynxlynxlynx> ok, works fine into challenge 1, where i got killed
[12:15:00] <CIA-40> GemRB: 03lynxlupodian * rddb251b26cc4 10gemrb/gemrb/core/Scriptable/Scriptable.cpp: Scriptable::ProcessActions: added an action state sanity assert
[12:15:01] <CIA-40> GemRB: 03lynxlupodian * r956504141222 10gemrb/gemrb/core/GameScript/Actions.cpp: Wait*, PlayDead*: return after ReleaseCurrentAction()
[12:15:36] <fuzzie> thanks
[12:31:42] <lynxlynxlynx> the infopoint trigger/talk range is still off though
[12:32:35] <fuzzie> it works quite differently to how we do it
[12:32:53] <fuzzie> e.g. the spirit summony thing in ToB doesn't work atm i think?
[12:37:03] <lynxlynxlynx> yeah
[12:37:11] <lynxlynxlynx> i think you already explained it a couple of times
[12:37:37] <fuzzie> and yet have failed to implement
[12:37:50] <fuzzie> busy trying to decode government paperwork right now
[12:45:39] <lynxlynxlynx> fun
[13:07:59] <CIA-40> GemRB: 03avenger_teambg * rfb36b1f9c88b 10gemrb/gemrb/ (3 files in 2 dirs): proper implementation of hotkeys for hiding left/right panes
[14:41:59] <lynxlynxlynx> huh, magic missile doesn't have the hostile bit set
[15:42:08] <lynxlynxlynx> melf's acid arrow, flame arrow, power word kill are the same
[15:42:23] <lynxlynxlynx> fireball is the only one i found so far
[15:44:52] <fuzzie> this is SF_HOSTILE in spells?
[15:45:59] <lynxlynxlynx> yes
[15:46:36] <lynxlynxlynx> i noticed during the play that nobody is resisting magic missiles
[15:46:54] <lynxlynxlynx> source flags are 0; already in the file
[15:47:15] <lynxlynxlynx> so could be the original also checked the diced effects
[15:47:44] <lynxlynxlynx> BUT, we can't do the same since the two hp ones are there and they added selective resistance just so things like that would not be resisted
[15:49:04] <lynxlynxlynx> so i'm delving into archives
[15:49:57] <fuzzie> huh.
[16:04:47] <lynxlynxlynx> looks like mostly aoe spells have it
[16:05:27] <lynxlynxlynx> i'll change it to look at the secondary spell school
[16:05:43] <lynxlynxlynx> maybe this flag was meant to induce an ea change
[16:17:01] <-- edheldil_ has left IRC (Ping timeout: 260 seconds)
[16:58:25] --> edheldil_ has joined #gemrb
[17:33:28] --- barra_away is now known as barra_home
[17:48:45] <CIA-40> GemRB: 03lynxlupodian * r976d83a4e887 10gemrb/gemrb/ (8 files in 8 dirs): added magic resistance feedback
[17:48:46] <CIA-40> GemRB: 03lynxlupodian * r34f887bd100d 10gemrb/gemrb/core/EffectQueue.cpp:
[17:48:46] <CIA-40> GemRB: improve selective magic resistance, since most spells don't have SF_HOSTILE
[17:48:46] <CIA-40> GemRB: set (like magic missile, power word: kill)
[17:53:41] --> Avenger has joined #gemrb
[17:53:42] --- ChanServ gives channel operator status to Avenger
[17:53:59] <Avenger> lynx, why do you think the secondary school has to do anything with resistance?
[17:54:32] <lynxlynxlynx> the way it is assigned to spells
[17:54:57] <lynxlynxlynx> it matches what the ids entries for those values are
[17:55:07] <Avenger> well, it is a bg2 thing
[17:55:22] <lynxlynxlynx> yep
[17:55:58] <Avenger> i have doubts, have you tested the secondary school in the original engine?
[17:56:11] <lynxlynxlynx> no, only by looking at spells
[17:56:13] <Avenger> like change the normal healing spell to some combat specific
[17:56:25] <Avenger> i mean the spell's secondary school
[17:56:38] <Avenger> err, secondary type
[17:57:54] <fuzzie> do you have an idea about how it should work?
[18:03:25] <Avenger> yes
[18:03:38] <Avenger> there is a check_resistance callback in opcodes
[18:03:47] <Avenger> only a few of them has something special in it
[18:03:51] <Avenger> one is the damage opcode
[18:04:09] <Avenger> it checks for: mirror image
[18:04:11] <Avenger> stoneskin
[18:06:36] <Avenger> hmm i'm not entirely clear on it...
[18:07:00] <Avenger> the damage opcode also calls the original stuff which has some mirror image check in it
[18:07:04] <Avenger> weird
[18:07:29] <Avenger> what is opcode 19h?
[18:07:52] <Avenger> ah poison
[18:09:14] <Avenger> 19h and 8eh with param2=6 (poisoned icon) are also checking on mirror image/stoneskin
[18:09:23] <Avenger> but that is in the common fx code
[18:10:39] <Avenger> i guess, the question is, why healing is not resisted?
[18:10:48] <Avenger> because most spell should be resisted
[18:11:29] <Avenger> they are flagged as bypass resistance
[18:11:51] <Avenger> resist flag = 3 (actually the bit=2 what counts)
[18:12:38] <Avenger> the school has nothing to do with it
[18:12:46] <Avenger> or the secondary type
[18:13:43] <lynxlynxlynx> didn't bg1 already have these flag?
[18:14:52] <Avenger> the resist flag? yes it had
[18:15:02] <Avenger> but bg2 hacks them a bit
[18:15:17] <lynxlynxlynx> can you check the flags on cloudkill?
[18:15:22] <Avenger> if target is self, it does resist|=2
[18:15:39] <lynxlynxlynx> mine doesn't bypass resistance, but it may be the fixpack
[18:16:16] <Avenger> cloudkill has 1
[18:16:25] <Avenger> which means, doesn't bypass resistance
[18:17:03] <Avenger> though, i never understood how mirror image would protect you from a cloud :)
[18:17:12] <lynxlynxlynx> that's odd
[18:18:09] <Avenger> the hostile flag is for spells without opcode c, opcode c automatically flags for attack
[18:19:22] <Avenger> there is also a custom resistance for opcode eb (wingbuffet)
[18:19:37] <Avenger> it doesn't affect some creature anims
[18:19:49] <lynxlynxlynx> yeah, big baddies
[18:21:10] <Avenger> only 00c and 0eb call the original resistance check via chain
[18:21:22] <Avenger> this doesn't mean they are the only effects with custom resistance
[18:21:33] <Avenger> some may be not calling it at all
[18:21:39] <Avenger> but i didn't find such
[18:22:24] <lynxlynxlynx> ok
[18:22:56] <lynxlynxlynx> so i just replace that with fx->Resistance&FX_CAN_RESIST (which is 3)
[18:24:10] <Avenger> oh i see something else too
[18:24:10] <lynxlynxlynx> the "ignore the check if target==caster" part we already do
[18:24:28] <Avenger> there is a function for all opcodes, that is either { return 0;} or {return 1;}
[18:24:39] <Avenger> it is returning 1 only for opcode 0c so far
[18:24:44] <Avenger> most of them return 0
[18:25:57] <lynxlynxlynx> maybe for diced effects
[18:26:25] <lynxlynxlynx> but that would mean 11 and 12 would be in there too
[18:27:51] <Avenger> hmm, do we know param1 for death opcode ?
[18:28:17] <Avenger> if i read this stuff right, it is suppressing the efftext printing
[18:28:44] <Avenger> oh it is in iesdp
[18:28:46] <Avenger> lol
[18:31:05] <Avenger> unsummon has the same mechanism
[18:31:38] <Avenger> ok, two occurences make a rule
[18:31:42] <lynxlynxlynx> cool
[18:31:55] <Avenger> i mean, i need some code for this
[18:32:01] <lynxlynxlynx> i had to comment out the line for damage since it was so annoying
[18:32:11] <Avenger> hmm....
[18:33:12] <CIA-40> GemRB: 03lynxlupodian * rbbf134b3866c 10gemrb/gemrb/core/EffectQueue.cpp: check_resistance: make the selective magic resistance check perfect
[18:33:15] <lynxlynxlynx> we override efftext.2da
[18:33:41] <Avenger> opcode damage efftext feedback depends on this: mov ecx, [eax+game.opt_effect_text_level]
[18:34:06] <Avenger> if level&2 true, there is feedback
[18:34:29] <lynxlynxlynx> i'm not sure we need that at all
[18:34:47] <Avenger> yes, we could simply put the feedback in the effect
[18:34:56] <Avenger> since this is a bg thing anyway
[18:35:09] <Avenger> and who would mod efftext.2da anyway
[18:35:58] <Avenger> lynx: is this a perfecter or the perfectest selective magic resistance :)
[18:36:45] <lynxlynxlynx> who knows, but it is currently the perfectest possible :)
[18:37:11] <lynxlynxlynx> what i was trying to say is, that i don't think we currently miss any damage feedback
[18:37:44] <Avenger> wasn't this can resist thing in before?
[18:38:34] <Avenger> i think you can further simplify this: if ((selective_mr && (fx->Resistance&FX_CAN_RESIST)) || !selective_mr) {
[18:42:25] <Avenger> if (!selective_mr || (fx->Resistance&FX_CAN_RESIST) ) {
[18:48:10] <Avenger> also, the code earlier: if( fx->Resistance != FX_CAN_RESIST_CAN_DISPEL) {
[18:48:12] <Avenger> return false;
[18:48:13] <Avenger> }
[18:48:15] <Avenger> seems to check resistance&2 in some weird way
[18:52:45] <lynxlynxlynx> yeah, looks very odd
[18:53:36] <lynxlynxlynx> from the comment it should be checking something different
[18:53:49] <lynxlynxlynx> but i do remember these constants changing a year or two ago
[18:55:30] <-- test32894789234u has left #gemrb
[19:00:20] <lynxlynxlynx> this would explain why chromatic orb is so powerful
[19:01:02] <lynxlynxlynx> at the highest level, it has a kill effect attached, but a +6 save penalty
[19:01:16] <lynxlynxlynx> it shouldn't get that far, let me check
[19:06:05] <-- Maighstir has left IRC (Quit: .)
[19:06:59] <lynxlynxlynx> already found a perfecter solution
[19:07:07] <Avenger> didn't take long
[19:07:27] <lynxlynxlynx> took the constant too easily
[19:07:55] <lynxlynxlynx> FX_CAN_RESIST includes FX_NO_RESIST_CAN_DISPEL
[19:08:02] <Avenger> btw, i think it isn't the target type==TARGET_SELF, but the caster == target
[19:10:05] <Avenger> meh, the code here clearly checks for resist&2
[19:10:45] --> Maighstir has joined #gemrb
[19:13:12] <lynxlynxlynx> maybe it is buggy
[19:13:22] <lynxlynxlynx> if it wasn't for 3, it'd be a nice bitfield
[19:16:24] <lynxlynxlynx> FX_CAN_RESIST was unused before, FX_CAN_RESIST_NO_DISPEL is supposedly something completely different, so the code should actually be &1 -FX_CAN_RESIST_CAN_DISPEL
[19:16:46] <lynxlynxlynx> if anything, since the 3 still breaks it
[19:17:02] <lynxlynxlynx> maybe they added it later and didn't check how it was used
[19:18:26] <lynxlynxlynx> but with the preemptive check above, none of this matters
[19:18:51] <CIA-40> GemRB: 03lynxlupodian * r386935d3ce4d 10gemrb/gemrb/core/EffectQueue.cpp:
[19:18:51] <CIA-40> GemRB: check_resistance: fix check for irresistible effects
[19:18:51] <CIA-40> GemRB: fixes chromatic orb killing everyone (bypasses resistance) - the saving
[19:18:51] <CIA-40> GemRB: throw was skipped
[19:19:42] <Avenger> in gemrb: 1-Dispel/Not bypass resistance
[19:21:07] <Avenger> though 0 would mean, bypass according to dltcep... because 0 = nonmagical
[19:23:10] <Avenger> oh ok
[19:23:19] <Avenger> there are 2 checks here
[19:24:26] <lynxlynxlynx> #define FX_CAN_RESIST_CAN_DISPEL 1
[19:24:33] <lynxlynxlynx> yes
[19:33:44] <lynxlynxlynx> i've moved on and found another problem with bouncing
[19:36:43] <lynxlynxlynx> the way the system is set up, only one type of bouncing creates the feet disc vvc
[19:37:40] <lynxlynxlynx> clearly not enough, since spell turning doesn't produce it
[19:43:03] <lynxlynxlynx> looks like copy/paste :)
[19:45:27] <CIA-40> GemRB: 03lynxlupodian * re5beb1c38846 10gemrb/gemrb/core/Scriptable/Actor.cpp:
[19:45:27] <CIA-40> GemRB: pcf_bounce: check for all changes, not just BNC_PROJECTILE
[19:45:27] <CIA-40> GemRB: at minimum BNC_LEVEL_DEC needs the vvc too (spell turning)
[20:21:02] <-- Avenger has left IRC (Quit: ChatZilla 0.9.87 [Firefox 5.0/20110615151330])
[21:10:32] <CIA-40> GemRB: 03lynxlupodian * r257ac59495f2 10gemrb/NEWS: regular NEWS bump
[22:08:39] <-- lynxlynxlynx has left IRC (Read error: Connection reset by peer)
[23:01:24] <-- barra_home has left IRC (Read error: Connection reset by peer)