#tfl@irc.freenode.net logs for 1 Nov 2008 (GMT)

Archive Today Yesterday Tomorrow
tfl homepage


[01:14:47] --> wizardrydragon has joined #TFL
[01:14:47] --- ChanServ gives voice to wizardrydragon
[01:19:57] * wizardrydragon pokes Marzo
[01:43:12] --- Marzo_away is now known as Marzo
[01:43:21] <Marzo> Wow
[01:43:26] <Marzo> Wow
[01:43:31] * Marzo rubs eyes
[01:43:50] <Marzo> Look who is back from the dead! :-)
[01:44:01] <wizardrydragon> Haha
[01:44:23] <wizardrydragon> No gaurantees I'll stick around, my internets been pretty spotty here. But I'm here for the moment.
[01:44:34] <Marzo> I have replied to your last e-mail already, BTW
[01:45:03] <Marzo> (or to your last *two* e-mails, to be strict...)
[01:45:59] <wizardrydragon> Ive had to put GMail into the plain mode for it to work at all for me these days, and its still kinda all grr
[01:47:50] <Marzo> The tendency is to get worse with the current worldwide crisis, but I hope it won't be *too* worse
[01:49:14] <wizardrydragon> On more on topic sidenote, sadly, I'll probably have to wrestle with the UCC some. I had coded a lot of usecode on and off ... maybe the last three months or so. Thing is I never actually really tested it, soooo ... it'll be fun when I go to compile everything I'm sure.
[01:49:39] <Marzo> Well, part of all problems are my fault
[01:50:00] <Marzo> I made some massive changes in UCC that caused some incompatibilities
[01:50:27] <Marzo> You will likely see a hundred or so warnings and a similar number of errors because of that
[01:50:30] <wizardrydragon> I haven't even tried yet.
[01:50:33] <wizardrydragon> I'm afraid to :\
[01:51:07] <Marzo> On the plus side, UCC is a lot better now :-)
[01:51:50] <wizardrydragon> Can I typecast yet?
[01:51:52] * wizardrydragon hopes
[01:51:56] <Marzo> (I feel your pain; trying to compile Keyring and TFL was scary)
[01:52:03] <Marzo> In some cases
[01:52:08] <wizardrydragon> Woo
[01:52:14] <Marzo> Integers can
[01:52:25] <Marzo> Compatible classes can
[01:52:33] <Marzo> Structs in some cases
[01:52:43] <Marzo> Oh, yes: we have structs now
[01:52:54] <Marzo> They are rather thin wrappers around arrays, though
[01:53:08] <wizardrydragon> Well I remember having a huge pain back with some random generation code for the guilds code I was writing ... way back in '06 when you couldn't type cast period and UCC kept thinking integers were strings and such.
[01:53:28] <Marzo> You mean for dialogs?
[01:54:05] <Marzo> You can't typecast like that yet, but avoiding the use of '+' with strings and numbers help a lot
[01:55:04] <wizardrydragon> That requires perhaps a bit of explanation. I'd mentioned it way back then but it was a while ago :-) I wanted to have a handful of small quests that were fairly randomised, and I had an issue back then with tyring to pass numbers as strings. For example "2" in string form instead of integer. Can't quite remember the specifics of the issue, it was a while ago. I'm sure if it's still an...
[01:55:06] <wizardrydragon> ...issue you'll hear about it soon enough, though.
[01:55:43] <Marzo> Possibly
[01:57:02] <wizardrydragon> I remember it being an issue because I would, for example, have a quest to collect such and such a number of a certain item, say 10 swords, and it was trying to add 10 to the string, instead of combine it to form a string.
[01:59:12] <Marzo> Ah, so I guessed right above
[01:59:39] <Marzo> One of the things I did was reformat usecode to combine strings with commas instead of plusses
[01:59:52] <Marzo> It fixes this kind of error in particular
[01:59:54] <wizardrydragon> I have no words for how happy this makes me.
[02:00:09] <Marzo> :-)
[02:00:45] <Marzo> For example: using
[02:00:46] <Marzo> say("Total: ", 10, " swords");
[02:00:50] <Marzo> instead of:
[02:00:56] <Marzo> say("Total: " + 10 + " swords");
[02:01:01] <wizardrydragon> Yeah
[02:01:17] <wizardrydragon> I proposed just & like a lot of things do but whatever works.
[02:01:37] <wizardrydragon> C-like variable substitution in strings was on my UCC wish list too.
[02:01:43] <Marzo> The commas were already there, but working in a spotty way
[02:02:00] <wizardrydragon> Ie say("Total %i swords.", num_swords)
[02:02:51] <Marzo> Something like this could be done, but in all likelyhood, I would use something other than "say" -- avoid confusion with the existing commas
[02:03:19] <Marzo> At least for printing to stdout, there is an intrinsic that does that
[02:03:40] <wizardrydragon> Whatever works, just saying.
[02:03:49] <Marzo> (although it puts the contents of UCC vars, and accepts only -- I think -- %s for all)
[02:04:02] <Marzo> This intrinsic could probably be adapted for that
[02:04:25] <Marzo> (or a similar intrinsic)
[02:04:45] <wizardrydragon> Oh, I know it could, really. The real question is, is how feasible that is, and if it's really worth the effort.
[02:05:09] <Marzo> Particularly since you can already do it in another way, right?
[02:05:22] <wizardrydragon> It would be a convience rather than a necessity.
[02:05:31] <wizardrydragon> As, yes, we can do this in another way already.
[02:05:55] <wizardrydragon> So if it's something that can be easily done, by all means. But if it'd need some junking around, it's probably not worth it.
[02:06:43] <Marzo> The biggest problem of formatting functions is how easy is to botch them in a way that makes buffer overruns possible
[02:06:44] <wizardrydragon> Can never hurt to probe around though.
[02:06:49] <Marzo> (I found one in BG
[02:06:58] <Marzo> and SI)
[02:07:01] <wizardrydragon> Yes, this is true. But uh, this is true for the original intrinsics too.
[02:07:06] <Marzo> (accidentally hit enter)
[02:07:16] <wizardrydragon> I'm sure you've come across a few examples in SI Fixes programming.
[02:07:48] <Marzo> While monkeying with usecode in the originals, too
[02:08:00] <wizardrydragon> I've been fiddling with how feasible it is to try to combine the SI and BG usecode, to try to merge them in the way I intend to do sooner or later for TFL.
[02:08:11] <Marzo> (the display_runes intrinsic can be used to execute arbitrary code in the machine)
[02:08:56] <Marzo> One thing that might work (whenever it is finished) is the usecode decompiler I am toying with
[02:09:04] <wizardrydragon> The problem I keep coming across in this, is there's no easy way to do this that doesn't respect copyrights.
[02:09:28] <Marzo> Indeed
[02:09:45] <wizardrydragon> I can easily build down the old SI usecode, and merge it into the one I'm using for TFL. The problem with this is then you can't gaurantee that the person has the original SI, which is a legal minefield I'd rather not step into.
[02:10:06] <Marzo> One thing which could be done (but is a lot of work):
[02:10:41] <wizardrydragon> The easiest fix (easy is relative) is two fold:
[02:10:42] <Marzo> the installer (and installer scripts, in Linux) check for the presence of the SI usecode and rebuilds the TFL usecode
[02:11:05] <wizardrydragon> First you'd need a way to merge the two files in memory. Second, you'd need something to tell Exult which mods want this
[02:11:27] <wizardrydragon> Of course there's all sorts of tangential issues stemming from both, the former most.
[02:11:52] <Marzo> Something like this is already done for vga files
[02:12:13] <wizardrydragon> Aye.
[02:12:24] <wizardrydragon> Thing is. Usecode files are just a -little- trickier.
[02:12:24] <Marzo> What would be needed is a way to load and remap the usecode functions to other IDs
[02:12:31] <wizardrydragon> Yes.
[02:12:39] <Marzo> It is not that hard
[02:13:39] <Marzo> (as I said, shape files already do that: can import single shapes from other files and remap them to alternate shape numbers)
[02:13:54] <wizardrydragon> I'm not sure. The issue I see is conflicts. For example, SI's show_portrait intrinsic uses different parameters and functions a little differently.
[02:13:54] <Marzo> s/can/they can
[02:13:59] <wizardrydragon> Effectively what you'd need to do
[02:14:10] <wizardrydragon> is figure a way to make UCC able to 'overload' functions
[02:14:19] <wizardrydragon> Or at least Usecode, internally
[02:15:01] <Marzo> This is why I had the idea of the installer rebuilding the TFL usecode, combining with the (rebuilt) SI usecode
[02:15:43] <Marzo> Internally, usecode just uses numbers for intrinsics; having to track what function needs to use which intrinsic table would be a pain
[02:16:03] <Marzo> Not to mention that call imports would have to be remapped too
[02:17:06] <wizardrydragon> If you can write a utility the installer could run that would do that, this could be acceptable as long as Exult functioned properly with the calls.
[02:17:17] <Marzo> Hm. And scripts that call usecode... urgh. The rebuilding is a lot easier. No questions about it...
[02:19:01] <Marzo> The utility would likely have a translation table (i.e., "this function gets remapped to this") and a disassembly part, which looks for call imports and (delayed_)execute_usecode_array calls to see if the arrays have function calls in them (which also would get remapped)
[02:19:14] <wizardrydragon> As I said, if you could make a utility that could do that in such a way that Exult would still function properly with the usecode, that would be fine. I sense that degenerating into a heap of addressing issues though.
[02:19:33] <Marzo> Not really
[02:19:40] <Marzo> It would be rather easy, in fact
[02:20:07] <Marzo> Coding the disassembler would be slightly harder than the actual translator/rebuilder
[02:20:13] <wizardrydragon> Well then go for it :)
[02:22:00] <Marzo> "easy" is a relative term, though; I see some potential difficulties
[02:22:14] <Marzo> Although to be honest, I don't think that they ever happen in SI usecode
[02:24:38] <Marzo> brb
[02:38:19] <Marzo> back
[02:39:25] <wizardrydragon> Welcome back :)
[02:39:52] <Marzo> There are indeed some cases that may make the utility a little harder than I thought
[02:40:23] <Marzo> For example: if there is the following code in a function:
[02:40:35] <Marzo> script item { call var000; };
[02:40:45] <Marzo> and var000 is a parameter
[02:41:01] <Marzo> (I think this happens in SI usecode)
[02:42:01] <wizardrydragon> Not quite; there are a few times when they call using a variable containing the name of the function they want to to.
[02:42:08] <wizardrydragon> *to call to, pardon me
[02:43:03] <Marzo> These would actually be numerical constants (the function ID)
[02:43:37] <wizardrydragon> I can think of a couple instances when it's a variable.
[02:44:02] <Marzo> I know it happens in Keyring, but I don't know if it happens in original BG or SI
[02:44:06] <wizardrydragon> As opposed to constant.
[02:44:11] <Marzo> I am checking it now
[02:44:33] <wizardrydragon> I'm not sure if it does in BG, but I am fairly certain it does in SI (albeit in usecode I don't think they actually used)
[02:44:48] <wizardrydragon> There are, incidentally, a lot of SI tidbits if you decompile the usecode file.
[02:45:07] <Marzo> I have a full dump of BG and SI usecode
[02:45:31] <Marzo> Made to look slightly better by an utility I had in ESGuides
[02:45:34] <wizardrydragon> Aye as do I, I got mine the hard way.
[02:45:45] <wizardrydragon> No utility though. Link? :(
[02:46:07] <Marzo> It is not available anywhere on the web, but I think I still have it
[02:46:30] <Marzo> (as I made it, at the very least I should have the source)
[02:46:46] <wizardrydragon> Ah. Well let me know.
[02:47:57] <Marzo> Indeed, I have the source still
[02:48:12] <Marzo> I will compile it and make the exe available
[02:48:34] <wizardrydragon> Neat. If you send me the executable somehow, I can host it on the TFL site if you want.
[02:48:36] <Marzo> (if my VB dev environment is still working... it is a VB utility)
[02:48:48] <Marzo> (a VB *command-line* utility)
[02:49:00] <wizardrydragon> ... that's so counterpurposes it's funny.
[02:49:18] <Marzo> The irony amused me back then too :-)
[02:50:43] <Marzo> I must warn, though, that it botches some functions
[02:51:38] <Marzo> Its code-flow analysis algorythm is rather simplistic and optimistic; it is still good enough for over 95% of the usecode
[02:52:21] <wizardrydragon> Well what made it difficult for me to decrypt (so to speak) some functions is the fact I'm looking at raw, unedited, unformated usecode.
[02:52:29] <Marzo> Two cases where I know it fails: Lord British in FoV and that guy in BG that tells jokes and steals gold
[02:52:55] <Marzo> I also remember that you need to have some special ucxt data files
[02:53:29] <wizardrydragon> Oh?
[02:53:52] <Marzo> I am looking to check that
[02:55:36] <Marzo> Bah, given the neat freak I am, I just *have* to make it output the new UCC constants; hold on
[02:57:13] * wizardrydragon also pokes Marzo to add TFL to the links on the Exult page, in an act of questionable virtue and complete self-gratification.
[02:57:31] <Marzo> Aye, I must do that too
[02:57:53] * wizardrydragon thinks he's lost an Eighth, but isn't sure. Hawkwind time!
[03:00:26] <wizardrydragon> Also, sorry if I see a bit vacant, I'm trying to salvage the UCC code for TFL.
[03:00:44] <Marzo> k
[03:01:38] <wizardrydragon> Thankfully the virtue code seems alright. It may be nice to prettify it with the new conventions, but it works, which is good. I've already had to rewrite that thing several times.
[03:03:58] <wizardrydragon> Also, Marzo, did you make any significant additions to the services code across the past 6-months ish?
[03:05:03] <Marzo> That I recall, the latest change I did to them was October 6 2007
[03:08:42] <wizardrydragon> Oooohkay so a long time ago.
[03:09:39] <Marzo> Urk. In the "call var" front: I will have to deal with telekinesis
[03:10:23] <Marzo> (telekinesis the intrinsic)
[03:10:42] <Marzo> In one function, SI uses the shape number (as in "get_item_shape") for the script call
[03:11:12] <Marzo> (I actually think it is ignite all and douse all)
[03:11:45] <Marzo> And create food
[03:11:59] <Marzo> s/food/ammo
[03:12:14] <wizardrydragon> Yes that's what I was thinking of, because the shape number in usecode is the constructor, so to speak.
[03:24:37] --- Marzo is now known as Marzo_away
[03:29:09] --- Marzo_away is now known as Marzo
[03:29:33] <Marzo> Well, I am off to bed; will finish updating the UCXT pretifier tomorrow
[03:29:43] <wizardrydragon> Alright, sleep well.
[03:29:53] <Marzo> (also, a thunderstorm is brewing, and I don't want to risk my computers)
[03:30:06] <Marzo> Good night
[03:30:21] <-- Marzo has left IRC ("Marzo vanishes suddenly.")
[03:42:31] <-- wizardrydragon has left IRC ("ChatZilla 0.9.83 [Firefox 3.0.3/2008092417]")
[13:39:46] --> wizardrydragon has joined #TFL
[13:39:46] --- ChanServ gives voice to wizardrydragon
[13:51:44] --> Marzo has joined #tfl
[13:51:44] --- ChanServ gives voice to Marzo
[13:52:28] <wizardrydragon> Why hello there.
[13:52:38] <Marzo> Hi
[13:54:07] <wizardrydragon> How goes?
[13:54:18] <Marzo> Well
[13:54:51] <wizardrydragon> Good :)
[13:54:57] <Marzo> You?
[13:55:17] <wizardrydragon> Tired, but I can't really go back to sleep. Have work in a couple hours.
[13:55:36] <Marzo> Aye, I know how that feels
[14:01:40] <wizardrydragon> Hrmhrm
[14:01:58] <Marzo> ?
[14:02:41] <wizardrydragon> Some of the 'clipping' issues with things up against walls irritate me.
[14:15:04] --- Marzo is now known as Marzo_away
[14:48:14] --- wizardrydragon has changed the topic to: Ultima VII: The Feudal Lands - the official channel | This channel is publicly logged! Use ?log to get the url | Website available at http://lfs.lfhost.com/u7tfl
[17:03:34] <-- wizardrydragon has left IRC (Read error: 110 (Connection timed out))
[17:12:21] --- Marzo_away is now known as Marzo
[17:28:12] --- Marzo is now known as Marzo_away
[17:31:10] --- Marzo_away is now known as Marzo
[17:41:11] --- Marzo is now known as Marzo_away
[23:42:52] --- Marzo_away is now known as Marzo
[23:52:53] --- Marzo is now known as Marzo_away