Jump to content


Photo

WeiDU request


  • Please log in to reply
21 replies to this topic

#1 Potencius

Potencius
  • Member
  • 114 posts

Posted 02 November 2002 - 01:53 PM

Since I'm constantly writing, changing, fixing, compiling, and recompiling my .d files, it would be extremely helpful to have a feature similar to STRING_SET in TP2 files available in .d file source.

For example, let's say I write this for a part of my source...

IF ~True()~ THEN BEGIN BLOCK01
SAY ~Yep, htis is block #1.~
IF ~~ THEN EXIT
END

...and I compile it without fixing the typo (which is highly possible given my .D files are very large a lot of the time).

So I fix it, and change "htis" to "this." Now, I think it would be much easier, instead of adding a new strref to the end of the TLK since this new and correct one won't be found, to have a command that allows you to specify a strref to overwrite. This way, I wouldn't have a useless duplicate strref in my TLK just taking up space.

My solution to this would be to utilize some kind of new syntax like...

IF ~True()~ THEN BEGIN BLOCK01
SAY ~#4567~ ~Yep, this is block #1.~
IF ~~ THEN EXIT
END

...and if ~#4567~ was not written, then just to write the new text to a new strref.

//--------------------------------------------------------//

On the same line of thought as this... to make it easy for people to overwrite these strrefs without having to search for each strref# manually in the dialog.tlk, an on-compile option could be to create another .d file with all ~#STRREF~ before strings.

What do you think? Possible? Useful?

Thanks. :)
The Glory of Istar - A Dragonlance Total Conversion

I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. - Umberto Eco

The truth of #meeting:
KenTeamBG: a/s/l
Deano: 14/f/in ur heart
* KenTeamBG it's getting hot so i remove my jacket
Daxziz: Oooh
* Echon, MaxTeamBG and Hlidskialf all get naked.
* SimDing0 has joined #meeting
SimDing0: Eew.
* SimDing0 has left #meeting
* KenTeamBG sets mode: +b SimDing0

#2 weimer

weimer
  • Member
  • 1569 posts

Posted 02 November 2002 - 04:22 PM

If you are worred about your DIALOG.TLK taking up too much space (which is only a problem for you, the developer, since you will fix most of these mistakes before they get to the user) ... you should consider getting a new hard drive. Seriously now. You're saving about 32 bytes in this example.

Keep a backup copy of your original dialog.tlk (if you don't have one, grab one from my "old" folder). When you want to start again with a clean slate, copy the backup over the original and re-install all mods.

My pre-ascension dialog.tlk is 8692747 bytes. After installing a huge number of mods over and over again replete with multiple spelling errors (trust me on this, I'm pretty sure I have more mods up in the air in more languages than just about any other developer), it has grown to the incredible size of ... 9950663. That's right, we've sucked up 1.3 megabytes here. Bearing in mind that BG2 requires that you have around 300 megabytes free just for temp space, this is the king of small potatoes. Clear your web browser cache if you're running out of room. :-) The return on investment here is miniscule.

Are you familiar with Amdahl's Law?

Quote

On the same line of thought as this... to make it easy for people to overwrite these strrefs without having to search for each strref# manually in the dialog.tlk, an on-compile option could be to create another .d file with all ~#STRREF~ before strings.


I'm afraid that I have no idea what this paragraph is talking about.

Have you considering using a TRA file? In my experience that makes it very easy to keep spelling errors and coding errors separate.

You should never have to talk about a strref# manually in WeiDU (unless you are one of three people in the universe making a mod that fixes spelling errors in the base game, etc.). I'm not sure what you're trying to do, but you just shouldn't have to do it. :-) Don't modify string references directly. It's just bad news (aside from those three exceptions).

#3 Potencius

Potencius
  • Member
  • 114 posts

Posted 02 November 2002 - 06:28 PM

My concern is not my TLK size (which now, stripped, is 2.7 MB), but nearly-duplicate texts appearing in it. It's messy and makes navigating the TLK manually difficult. It's annoying, when correcting dialogs and other types of strrefs, to look through 5 or so different strrefs before finding the right one.

As for backups of the dialog.tlk... I have 6; three are from different stages of development, 1 from SoA, 1 from ToB, and 1 current backup at all times.

Quote

You should never have to talk about a strref# manually in WeiDU (unless you are one of three people in the universe making a mod that fixes spelling errors in the base game, etc.). I'm not sure what you're trying to do, but you just shouldn't have to do it. :-) Don't modify string references directly. It's just bad news (aside from those three exceptions).


Since WeiDU doesn't do it for me, I've been modifying strrefs directly with the TLK Editor (which takes a little bit more time since I have to search for the proper text and all). It is much cleaner than simply adding new text each time I make a slight change. All I want to know is if WeiDU would be able to make such a thing easier... if not, oh well.

As for my paragraph... well, don't worry about it, I suppose. If you're not into the idea in the first place, then you wouldn't be into implementing a feature that would make it easier.
The Glory of Istar - A Dragonlance Total Conversion

I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. - Umberto Eco

The truth of #meeting:
KenTeamBG: a/s/l
Deano: 14/f/in ur heart
* KenTeamBG it's getting hot so i remove my jacket
Daxziz: Oooh
* Echon, MaxTeamBG and Hlidskialf all get naked.
* SimDing0 has joined #meeting
SimDing0: Eew.
* SimDing0 has left #meeting
* KenTeamBG sets mode: +b SimDing0

#4 weimer

weimer
  • Member
  • 1569 posts

Posted 02 November 2002 - 08:40 PM

To make this a bit clearer -- as many people will attest, I have added many features to WeiDU that I did not personally feel excited about. However, I do insist on at least understanding what is going on and why people want said features.

#5 weimer

weimer
  • Member
  • 1569 posts

Posted 02 November 2002 - 08:49 PM

Some sources indicate that you may be working on a Dragonlance mod for BG2 where you replace a bunch of Faerun strings with their Ansalon counterparts. That sounds like a worthy goal (and could probably inspire me to add this feature that you want) ... but I'd still like to understand more of what is going on and how you are actually spending your time, so that I know best what to do with this feature.

#6 -jcompton-

-jcompton-
  • Guest

Posted 02 November 2002 - 09:30 PM

weimer, on Nov 3 2002, 12:40 AM, said:

To make this a bit clearer -- as many people will attest, I have added many features to WeiDU that I did not personally feel excited about.

This is my cue to whistle and act innocent, right?

#7 -Sim-

-Sim-
  • Guest

Posted 03 November 2002 - 04:38 AM

Yup, that would be the Dragonlance Total Conversion.
We (Po primarily) are using WeiDU for many system dialogs, such as the spell system and herbal feature; these are very large dialogs, and what Po is suggesting is the ability to easily recompile fixed versions of them without recreating strrefs unnecessarily, since as he said, numerous unneeded strrefs are messy and can become confusing.

#8 Potencius

Potencius
  • Member
  • 114 posts

Posted 03 November 2002 - 06:27 AM

I guess I'll explain that paragraph again (step by step).

Here's what I would want:

I start my dialog from scratch not using any ~#STRREF~ commands since I want all my strrefs to be new and added on to the dialog.tlk.

I'm ready to compile, so I use my usual command: "weidu file.d --tlkout dialog.tlk --out override." What I'd like to be an option here is something to output another .d file, which is a copy of the one I just compiled... except, it has the strrefs before each piece of text.

Here's an example.

My original source:

IF ~True()~ THEN BEGIN SOURCE01
SAY ~This is my original source.~
IF ~~ THEN REPLY ~No, it's not!~ EXIT
IF ~~ THEN REPLY ~Of course it is.~ EXIT
END

When I compile, I'd like another source file to be created that looks like this:

IF ~True()~ THEN BEGIN SOURCE01
SAY ~#71345~ ~This is my original source.~
IF ~~ THEN REPLY ~#71346~ ~No, it's not!~ EXIT
IF ~~ THEN REPLY ~#71347~ ~Of course it is.~ EXIT
END

This way, any changes I make to the dialog can be put into the same strref, not wasting any or creating any duplicates if I make a typo or decide that I want to change what it says.

That a little bit more understandable?
The Glory of Istar - A Dragonlance Total Conversion

I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. - Umberto Eco

The truth of #meeting:
KenTeamBG: a/s/l
Deano: 14/f/in ur heart
* KenTeamBG it's getting hot so i remove my jacket
Daxziz: Oooh
* Echon, MaxTeamBG and Hlidskialf all get naked.
* SimDing0 has joined #meeting
SimDing0: Eew.
* SimDing0 has left #meeting
* KenTeamBG sets mode: +b SimDing0

#9 -Avenger-

-Avenger-
  • Guest

Posted 03 November 2002 - 06:46 AM

The problem with an always growing .tlk is the following:
DLTC (or even TDD) has not just a bunch of .dlg files which could be recompiled from scratch everytime a typo has been found. They contain 100+ .dlg files, 100+ item files, creatures, and other special string references in various .2da etc. It is impossible to reimport all this stuff. Therefore recycling of string refs is a must. Once a string reference has been allocated, it shouldn't move.
When i tried to get rid of the typos in TDD's .tlk file, i found dozens of similar strings, it made my work a nightmare. The same would happen if someone tries to translate a game. Unless they always reimport ALL objects.
I suppose Max would like a feature (option) which outputs his original source file with ~#~ included in his source (or another copy) whenever one got allocated the first time.

#10 Potencius

Potencius
  • Member
  • 114 posts

Posted 03 November 2002 - 06:54 AM

Quote

I suppose Max would like a feature (option) which outputs his original source file with ~#~ included in his source (or another copy) whenever one got allocated the first time.


I'd also like the text directly following ~#strref~ to be added to that strref on compiling. ;)
The Glory of Istar - A Dragonlance Total Conversion

I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. - Umberto Eco

The truth of #meeting:
KenTeamBG: a/s/l
Deano: 14/f/in ur heart
* KenTeamBG it's getting hot so i remove my jacket
Daxziz: Oooh
* Echon, MaxTeamBG and Hlidskialf all get naked.
* SimDing0 has joined #meeting
SimDing0: Eew.
* SimDing0 has left #meeting
* KenTeamBG sets mode: +b SimDing0

#11 -Sim-

-Sim-
  • Guest

Posted 03 November 2002 - 07:35 AM

Perhaps using a similar technique, all our *!*s could be put to good use too? :)

#12 oopsilon

oopsilon
  • Member
  • 32 posts

Posted 03 November 2002 - 08:49 AM

Avenger, on Nov 3 2002, 04:46 PM, said:

I suppose Max would like a feature (option) which outputs his original source file with ~#~ included in his source (or another copy) whenever one got allocated the first time.

Don't know if this is what you're looking for, but the  "weidu --text (dialogue).dlg" command will emit a .d file that includes the string ref number of each line in comments next to the dialogue itself.

#13 -jcompton-

-jcompton-
  • Guest

Posted 03 November 2002 - 08:55 AM

...why not spell-check your TRA files BEFORE you commit them to the master .tlk build?

Better still, learn TP2, so that when you send out a test build, you can always apply the latest changes to the core stripped-down .tlk?

And yes, Oopsilon is right, what you should do is simply decompile your .DLGs to get the StrRefs back.

#14 Potencius

Potencius
  • Member
  • 114 posts

Posted 03 November 2002 - 09:06 AM

Quote

Don't know if this is what you're looking for, but the "weidu --text (dialogue).dlg" command will emit a .d file that includes the string ref number of each line in comments next to the dialogue itself.


It's close, but not exactly what I'm looking for. True, it would give me the strrefs in comments and could be useful for editing the TLK directly, but what I want is WeiDU to add in the given string at the specified strref.

Quote

...why not spell-check your TRA files BEFORE you commit them to the master .tlk build?


This is only part of the issue, JC. What if I decide I want to change a text block or add in a word or two? My biggest point in this is that I had made about 100 normal dialogs for DLTC. Then I came to a decision that I wanted to use the PST format with quotes and actions. Yes, I am changing the strings slightly, but I see no reason for them to be added on to the TLK while the others "dead" strrefs are left there needlessly.

Quote

Better still, learn TP2, so that when you send out a test build, you can always apply the latest changes to the core stripped-down .tlk?


I don't think you can honestly believe that this would be easier than modifying it straight in the .D file. I have thousands upon thousands of different strings in hundreds of different dialogs mixed in with still hundreds of spell and item texts. Making and updating a TP2 with each strref would be tedious, and is unnecessary if this one feature would be implemented.
The Glory of Istar - A Dragonlance Total Conversion

I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. - Umberto Eco

The truth of #meeting:
KenTeamBG: a/s/l
Deano: 14/f/in ur heart
* KenTeamBG it's getting hot so i remove my jacket
Daxziz: Oooh
* Echon, MaxTeamBG and Hlidskialf all get naked.
* SimDing0 has joined #meeting
SimDing0: Eew.
* SimDing0 has left #meeting
* KenTeamBG sets mode: +b SimDing0

#15 weimer

weimer
  • Member
  • 1569 posts

Posted 03 November 2002 - 11:02 AM

Potencius, on Nov 3 2002, 08:27 AM, said:

When I compile, I'd like another source file to be created that looks like this:

IF ~True()~ THEN BEGIN SOURCE01
SAY ~#71345~ ~This is my original source.~
IF ~~ THEN REPLY ~#71346~ ~No, it's not!~ EXIT
IF ~~ THEN REPLY ~#71347~ ~Of course it is.~ EXIT
END

This way, any changes I make to the dialog can be put into the same strref, not wasting any or creating any duplicates if I make a typo or decide that I want to change what it says.

That a little bit more understandable?

Yes, I understand what you are asking for. However, you can already get it with this sequence of commands:

copy dialog.tlk dialog.bak
weidu myfile.d --tlkout dialog.tlk --out override
notice typeo ; edit myfile.d
weidu myfile.d --tlkout dialog.tlk --out override
notice typeo ; edit myfile.d ; all typos now gone
copy dialog.bak dialog.tlk
weidu myfile.d --tlkout dialog.tlk --out override

Quote

DLTC (or even TDD) has not just a bunch of .dlg files which could be recompiled from scratch everytime a typo has been found. They contain 100+ .dlg files, 100+ item files, creatures, and other special string references in various .2da etc. It is impossible to reimport all this stuff.


I'm not sure I agree, but let's just accept this as true for now.

Quote

Therefore recycling of string refs is a must.


WeiDU will already recycle duplicate string refs, but that's not what you want.

Quote

Once a string reference has been allocated, it shouldn't move.


OK.

Quote

When i tried to get rid of the typos in TDD's .tlk file, i found dozens of similar strings, it made my work a nightmare.


:-) The Ascension Translation guys had a similar problem. I highly recommend TRA files for this sort of thing. You could probably also make a utility that scans all in-game files and clear all unused strrefs.

Quote

The same would happen if someone tries to translate a game.


In fact, it already has.

Quote

Unless they always reimport ALL objects. I suppose Max would like a feature (option) which outputs his original source file with ~#~ included in his source (or another copy) whenever one got allocated the first time.


I could do it. I just still don't understand. What is the model here?

Is it that: You already have a KEY/BIFF mod installed and deployed for many users. You notice some typos. You want to put out a WeiDU "patch" that fixes those typos?

Is it that: You are still developing in-house. You have a big KEY/BIFF mod ... but you are also using WeiDU ... I can't guess.

My apologies if I'm appearing dense here. I can see how to add this feature to WeiDU. Since there are two of you who want it, it should get in ... assuming that it is actually necessary/useful. Why is what I suggested (just restore a good pre-dialogues dialog.tlk before your final DLG compilation or before you add any new items, etc.) not sufficient?

By the way, do you have a webpage for your project?

#16 -Sim-

-Sim-
  • Guest

Posted 03 November 2002 - 11:31 AM

The Dragonlance TC Site
You can find quite a bit of info on the forum as well as the site.

The current situation is that the TC is still being developed 'in-house', and WeiDU is being used for DLGs (although the final distribution will not be a WeiDU one).

#17 -jcompton-notathome-

-jcompton-notathome-
  • Guest

Posted 03 November 2002 - 12:03 PM

Quote

This is only part of the issue, JC. What if I decide I want to change a text block or add in a word or two?


Here's three suggested solutions:

1. You use STRING_SET in TP2.

2. You stop worrying about the size of your .tlk file. Honestly. You're talking about distributing a game that you think is going to be, what, a gigabyte? And you're worried about the size of a .tlk file that achieves at least 66% compression with RAR? As Wes tried to imply, this should be the least of your concerns.

3. You don't commit strings to your .tlk file until you're ready to release. You create a TP2 for "DL-Alpha Build" and when you're putting it together, you run Setup-DLAlpha.exe atop the core stripped down .tlk.

Quote

My biggest point in this is that I had made about 100 normal dialogs for DLTC. Then I came to a decision that I wanted to use the PST format with quotes and actions.


This is precisely why you shouldn't be committing strings to your .tlk file so early in development.

Quote

I don't think you can honestly believe that this would be easier than modifying it straight in the .D file.


No, it's not. You want to change the diction of your dialogue, you go back to your .d (or your .tra) and change it, then compile that in.

My point is that clearly, especially if you're so worried about the size of your .tlk file bloating (for some reason I don't quite understand), you shouldn't be making "undoable" changes to your .tlk file at this phase. You should be building a series of .d files and a TP2 that prepares your test builds.

It seems to me like you are running into the precise reason you shouldn't be building the .tlk "as you go"... if you don't want any spurious references in there, it's hard to undo that.

#18 weimer

weimer
  • Member
  • 1569 posts

Posted 03 November 2002 - 12:16 PM

OK, thanks for the link.

I still don't really understand what is going on, but I have implemented your feature anyway. You may now include "forced" string references in a D file.

Imagine that sola.d contains:

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY ~And now I stand before you in an abyssal plane. Wonders and terrors abound: I must admit I am not quite sure what to make of things.~ /* #74966 */
  IF ~~ THEN GOTO 5
END

And then we run: weidu --forceify sola.d --dout sola2.d

Now sola2.d contains:

IF ~~ THEN BEGIN 1 // from: 0.0
  SAY !74966 ~And now I stand before you in an abyssal plane. Wonders and terrors abound: I must admit I am not quite sure what to make of things.~ /* #74966 */
  IF ~~ THEN GOTO 5
END

When !NUM ~String~ is compiled, it forces the NUMth entry in dialog.tlk to be set to ~String~. For ease-of-parsing reasons I couldn't use your suggested syntax, sorry.

I did a few simple tests and everything seems to work, but since I don't really know what is supposed to be going on you will have to tell me if it works or not.

#19 Potencius

Potencius
  • Member
  • 114 posts

Posted 03 November 2002 - 12:36 PM

Thank you, Weimer. :)

Quote

You stop worrying about the size of your .tlk file. Honestly. You're talking about distributing a game that you think is going to be, what, a gigabyte? And you're worried about the size of a .tlk file that achieves at least 66% compression with RAR? As Wes tried to imply, this should be the least of your concerns.


I said it before, JC. The issue is not the size of the TLK file, but the *cleanliness*.

Quote

It seems to me like you are running into the precise reason you shouldn't be building the .tlk "as you go"... if you don't want any spurious references in there, it's hard to undo that.


With the command implemented now (thanks again, Weimer), there shouldn't be any more spurious references.

Anyway, I'm not going to argue my point any more since the command is implemented and I'm happy. :)
The Glory of Istar - A Dragonlance Total Conversion

I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. - Umberto Eco

The truth of #meeting:
KenTeamBG: a/s/l
Deano: 14/f/in ur heart
* KenTeamBG it's getting hot so i remove my jacket
Daxziz: Oooh
* Echon, MaxTeamBG and Hlidskialf all get naked.
* SimDing0 has joined #meeting
SimDing0: Eew.
* SimDing0 has left #meeting
* KenTeamBG sets mode: +b SimDing0

#20 -Sim-

-Sim-
  • Guest

Posted 03 November 2002 - 12:39 PM

Thanks for your help :)