On Wednesday, 10 October 2012 06:11:59 UTC+10, Michał Bieliński wrote:
> Once upon a time, Daniel wrote thus:
>
> > Okay... I've finished the first pass on the source files and they
> > compile without any messages with Delphi XE2 and only a couple with
> > Free Pascal.
>
>
> Great! Good job. Is it available for checking out? I am curious how
> much Moria and BOSS differ.
I'm presently adding colour (for the Windows platform only at the moment) so that might be of particular interest.
The player stuff is largely different, as are the creatures and objects. I like the way a player character is generated in BOSS. I intend to change it in Moria to be somewhat similar.
I want to add a difficulty setting, too. Like in Baldur's Gate/Neverwinter Nights so that the player isn't affected by things too badly in normal and easy. It would only be settable from the beginning. With the way the code is now, it might also be a bit tricky to implement.
I also would like to add something like attacks of opportunity (as per AD&D) but that would require significant changes. Actually, I'm not quite sure how to do it at the moment.
I've kept all of the information about where things were meant to be stored in memory (the blah$blahblah attributes) for the routines so this will help when I get around to refactoring it all into objects.
The only way I could get it to you at the moment is via e-mail, I'm afraid.
> > Mostly anywhere I've done a change, I've kept the original code in
> > comments. I'm currently using the Classes unit because of the "master
> > file" (for save file encryption checking). I can perhaps clear all
> > this up in the second pass. There are a few todos.
>
> I dropped encryption support entirely for BOSS. Decided it was not worth
> keeping around.
I've had to drop it, too. At least, temporarily. The algorythm won't work on Unix/Linux/Windows because the encrypted data can contain the values $0A and $0D which are also required for line-break markers. On VMS, line-breaks must be stored in some other way. I have already had to change the way the dungeon floor layout is saved because of this issue. I have thought of a way to work-around it but haven't implemented it yet. I've also changed the way the version stamp is stored because using a small floating point value is too inaccurate.
> > I wasn't sure what the "<+" operator is meant to do in the routine
> > poly_monster so I translated it as per Michal in BOSS to just "<".
>
> Actually "<+" is two operators. Less than and unary plus. Original
> BOSS sources I worked on had already dropped the plus in favor of just
> the relational operator.
Hmm... Do you know what this code would have done?
"if (dist <+ obj$Bolt_range) then"
I've translated it to:
"if (dist < obj_Bolt_range)"
I know that the $ is used to mark memory storage space but not sure about the <+.
> > I'm testing the code now. Its a near impossible job to test all
> > logic paths. So far, its running but I haven't gone anywhere
> > interesting yet.
>
> Very true. Once in a while I run into an odd behavior too. The problem
> is I haven't had any prior Moria or its variants experience before
> being exposed to BOSS. Thus it is a bit difficult deciding when
> something strange happens what should be done about it. Is it a game
> peculiarity, side effect of porting the code or unfixed bug? Had to go
> with common sense once in a while.
Yes... Its quite a while ago since the code was last worked on by anyone as well. So the expert/knowledge-base is not there.
> > The save files are not compatible with the VMS version because of:
> > 1. the data encryption may be different; and 2. saving booleans is
> > presently different (saved as oridinals since this is easier).
>
> Same here. Not being able to read and write booleans easily is
> something to wish for.
Yes, the Writev routine from VMS pascal is nifty. I like it a lot. The same for Readv; very nice. I'm presently doing a whole heap of nasty work-arounds for not having a really functional sscanf in Delphi. I can only pass in actual integers and AnsiStrings for the data so have to use variables for reading the data into and then assign the data from the variables to where it needs to go. I've always meant to write an Unformat routine. I might actually get around to it but I'm not sure how to fix the issue since the type's type data is rather limited in expressing just what the pointer refers to (this is why I have the problem now).
> > I'm wondering where I should put the code. I'm thinking I may put
> > it on SourceForge or GoogleCode but I'm unfamiliar with doing so.
>
> Can't offer useful advice on that I am afraid. Putting a tarball on
> website does it for me.
Yeah, me too. Except I presently have no web hosting and can't afford it, either. Gone are the days you'd get it for free with your internet provisioning.
I'm looking at SourceForge now. Apparently Subversion is integrated into the RAD Studio XE2 IDE so that might be good... or bad.
Do you have Delphi or are you just using FPC/Lazarus?
Daniel.