Wednesday, August 30, 2006

Attributes and Skills

I decided to reuse the skill system for the player's attributes (like strength, intelligence, ...). An attribute will be just a special skill, that has no explicit usage (it affects the use of other skills though). This method does not require any additional implementation in the back end (it will be up to the front end to distinguish between attributes and skills).

I haven't said anything about the skill system yet. I guess I need to catch up on that, since it is mostly finished.

SRPG will have a hybrid skill system. Basically it is learning-by-doing. While using your skills, you gain XP in that skill, in your main level and sometimes in an attribute. If you get enough XP in a skill/an attribute/the main level it will rise by one point.
With the main level the hybrid aspect comes into play. For each level you gain a free point, that can be used to improve a skill (or an attribute). This way the player can develop and customize his character a bit beyond skill training. Furthermore the hybrid system allows XP rewards, which does not come from using a skill. This can be used for quests and probably some other things.

Saturday, August 26, 2006

After the Release is Before the Release

The path handling routines in DScript are causing trouble again. Looks like the latest fix created another bug. Absolute paths, that contain system variables, can't be used with Path, Insert and Include instructions, though using foo$Path variables with the foo: syntax works properly.

The problem is rather easy to fix, but I don't think that it is serious enough to justify another release at this time. Instead I will focus on SRPG for a few weeks.

Tuesday, August 22, 2006

Examples

I am very close to another release of DScript. The executable is build and I'm working on documentation and examples now.

After the release of DScript 0.10 some people complained, that there were no example scripts. Probably justified. But it isn't easy to come up with a good example. A good example is simple and self explanatory. So what data can we create? It needs to be in a format very well known by lots of people. This rules out most interesting options already. So we are left with a few standard formats: DrawFile, Template, Sprite and a few others. I finally decided for DrawFiles or rather a subset of this format, since a DrawFile is pretty complicated.

While working on the examples I found two more bugs. The first one affected the @@-expression. @@ gives you the current address, but I took the address when creating the expression object, which doesn't work from within macros. Easy to fix. I am glad, that I found this bug so early.

The second bug is something I am not happy about. It is a compiler problem, one I knew about for a long time. But I didn't notice, that it affects DScript in this particular way.

It makes a program crash, when an exception is thrown (which happens a lot in DScript's error handling), but only in the release version (which is compiled with -O2). The development version is not affected, which is the reason, why it took me so long to notice the problem.

The obvious solution is to switch from the ages old 2.95 compiler to 3.4 (done that already for SRPG). That should fix the problem. But 3.4 has another problem (I wrote about it before). It makes working on SRPG a very annoying task and I simple don't want to add these kinds of trouble to another project.

For now I compiled the release version of DScript without the -O2 switch, so it will be a bit larger and a bit slower.

Monday, August 21, 2006

/me is too lazy

For some reason I didn't manage to do any RISC OS work last week. Which is rather strange, because it wasn't very busy at all. Well, I guess the title of this post says it all. I promise to do better this week.

Sunday, August 13, 2006

DScript bug fix

Finally I found the a bug, that was troubling me since the release of DScript 0.10. The Include instruction didn't work as expected and now I know why. There was a problem with handling of local paths in the foundation library. Time for another patch ...

DScript is really making great progress. If nothing unexpected goes wrong, I should be able to make another release within this month.

Thursday, August 10, 2006

Don't litter!

SRPG now has triggers, that are local to locations. So far I have only implemented a local trigger in the "drop item"-action. There is a wide field of application for this trigger. It could be used to stop the player from dropping stuff at certain locations, let's say inside a shop or even in a whole town. Or the player could be forced to pay a fine for dropping stuff on the street. Evil, isn't it?

Since DScript's error reporting mechanism is working properly now, I was able to make some improvements to the world script. It is much easier to fix a script, if you get the line number and don't have to search a 20K script file for a faulty line.

Sunday, August 06, 2006

Hunting the line counting bug

He tried to hide, he tried to evade, but finally I hunted him down and nailed him to the wall. Poor bug. Against my superior debugging skills he never had a chance.

Ok, let's get serious again. As expected the bug was in the scanner, which is a part of the foundation library. I have fixed it in version 1.12 which is used in DScript. Now I have to manually transfer the changes to 1.20. Maybe it is time to start thinking about SVN.

In between I made another addition to DScript: The Report instruction writes messages to the standard output stream. Not very spectacular, but still useful, I assume.

Thursday, August 03, 2006

Verification

Yesterday I added the verification instructions to DScript. These instructions don't generate data, but check that some conditions are meet. This is a very important addition, because it allows the writing of much more robust macros. Available instructions: ?Full, ?Align, ?HAlign, ?True, ?False

Example:

FlagByte fl
8 Flag fl 0
?Full fl ! good

NTString "draw"
?Align ! good
Table ta 2
Entry ta
?Full ta ! not good
The last instruction would produce an error message, that can be used to easily track down the bug in the script.

Or at least it would be easy, if the error reporting mechanism would be working properly. I have narrowed down the problem to lines, that contain comments. Apparently these lines confuse the line counting mechanism, but I have no idea, what is causing this. More investigation needed ...

On the SRPG front I didn't make much progress. It looks like I have to add some kind of logging to the world loading code, so I can track down problems easier. This has priority over new features.