Jump to content

Crossing the Great Divide


Recommended Posts

It only took me 30 seconds to figure out how the %tutu_var% worked, once I understood the basic concept, so I can do it on the fly if I have to. Buy why?
Eh... why not? Not sure what you're suggesting in the rest of your post, but if you end up down the road coding (for example) a separate Gavin for BGT, and you end up with a bug (gods forbid) or want to make a change to one or the other, you're going to have the devil's own time keeping the two mods in sync. It isn't any more difficult to code this way from the start - it is in fact easier for me to do so, especially when you throw BG1-compatibility into the mix along with multiple versions of a mod for each platform (I'm still trying to figure out how to crunch the code even further for that last part).
Link to comment

I fully intend on coding this way from now on. I was only talking about keeping a master list of the variables (%IMOEN_DV%, %JAHEIRA_JOINED%, etc.) open on my text editor so that I can just switch screens, copy and paste as I go. I wasn't actually talking about coding the whole thing one way, then going back and swapping it all out.

 

In fact, as my ultimate plan includes having a single download work for Tutu, BGT *and* BG2, using cross-platform variables while coding is going to make my life a lot easier.

Link to comment
In fact, as my ultimate plan includes having a single download work for Tutu, BGT *and* BG2, using cross-platform variables while coding is going to make my life a lot easier.

 

But that's several megabytes that may be totally unnecessary for BG2 users. I remember, back in the days I was a poor student who didn't have any permanent internet access(talking about studying CS in the best university of Russia, heh), it made a difference. Might still, to someone else. I know, three downloads - TUTU one, BGT one and BG2 one - might be too much disc space on the server, but I kind of think it might be the best solution.

Link to comment

Well, looking at it, the code is not really the big part of the download. If we stick to using WeiDU and .tp2 action patching to build creatures and items from the target install, it is doubtful that a mod would actually get very large - it is the addition of soundsets and areas that push the big numbers. It is doubtfull that a full version install of, say , The Compleat Xan, with installs on BG1, BG2, Tutu, and BGT (pretending that you pulled all Xan code and reworked it for independent distribution) would actually be more than 100kb (30 or so files, if small auto-tra independent sources were desired instead of one big code file) larger than a single platform implementation. That savings is compounded using this method, as right now about a 3rd (I would randomly guess... I will go look at some real file numbers) of BG1 NPC vanishes when we remove the second set of BGT files we are distributing.

 

A more frugal way (banwidth weight-wise) would be to create the core components, then have a separate download for soundsets. If you add areas instead of using existing in-game ones for both Baldurs Gate and Shadows of Amn (or again a third option in Throne of Bhaal :) )then you are right, Kulyok. Adding areas probably means that folks on slow downloads with limited space would be pushed hard with a single installable. I know The BG1 NPC Project does this, as do some current mods (There is a Saerileth Light, I think, though that is on my list of mods "not looked at but will when I finally go on to BG2"). Of course, if you are doing this kind of mod, you probably only want one soundset for the whole thing for continuity, so you have some savings there, too.

 

//EDIT: well, I looked it up, and if we want to be really accurate, what will kill BG1 NPC's bandwidth is pretty simple - support for other languages. Our .tra files weigh in at 3.97 MB. The code files weigh in at 3.34 MB (we are really, really innefficient and use lots of small files instead of a few big ones, both because of the way we are constructed and because we want to preserve easy, targeted troubleshooting), which means that the standard English-Only distribution with crossplatform variables will reuce our load from a total mod weight of 14.4 MB (SFX compressed with the .exe to about 4.63MB -- remember, .exe compression savings is not as great as the code files, which get reduces by up to 70% !! )to about 11 MB on disk, but adding Russion, German, Spanish, and Polish translations will double us to 23 MB. Of course, the BP folks thik this is a little quaint... after all, some single file folders on a BP mod will outweigh this, and that is if we are uncompressed and they are compressed!

 

So the answer for us to keep mod size small looks like having separate language distributions, not separate code distributions.

// END EDIT

 

I guess this betrays something in my assumptions about modding, and why I end up in the Tutu camp even though I see lots of people working very hard on the BP side to provide new content. I somehow assume that it is preferable to expand the existing game world with more depth and interaction than it is to add new areas to explore (go figure -- no wonder I was begging Domi to be let into BG1 NPC for apprenticeship :) ).

 

As a side note, I think Miloch's idea is cool about the BG1, Tutu, BGT, BG2 idea, but if a new modder is reading this, please understand something - the Tutu/BG2 crossover is simple. The Tutu/BGT crossover is a little more difficult, but approachable. If you start talking Baldurs Gate (BG1), you have a whole new set of problems... and currently Miloch and Baronius seem to be the folks to discuss this kind of modding with (The Grey Clan and Herbs and Potions are the only ones I know of that currently have parallel versions for BG1 and BG2 versions of the Infinity Engine). The BG1 scripting is the oldest, the most restrictive, and certainly the hardest scripting to work with. It is a nightmare contemplating even attempting to take an existing mod backwards, and is likely to end up with the same results as if you pulled the engine out of a Ferrari and hooked it up to a team of ox. (OK, perhaps too far to the negative on the analogy, but just letting you know - you will need to go find these guys and Echon, and wing their brains dry, 'cause it is quite the challenge :) ).

 

ok, enogh chatting on my part - I gotta get back to recoding because I have fallen behind on my targets (again). Just needed to get this stuff out there in a readable format 'cause it looks useful to others (and Eirik the Scald, berelinde, and Kulyok all were needing to know what the heck I was doing in all this code stuff). Feedback and discussion is welcome, and heavy duty Master Moddarz, please rip this thing apart.

Edited by cmorgan
Link to comment
(The Grey Clan and Herbs and Potions are the only ones I know of that currently have parallel versions for BG1 and BG2 versions of the Infinity Engine)

When reading this I thought Baronius released a GC version for BGII.

 

I am definitely not the person to discuss complex coding with, but the slime quest has one download for vanilla BG1, BG1+TotSC, and BGII engine, too.

I agree to everything you said about BG1 coding, especially since there are syntax differences between BG1 with and without TotSC, making it necessary to treat these two separately more than only because of area/variable names.

 

That is a very nice tutorial, cmorgan!

Edited by jastey
Link to comment
there are syntax differences between BG1 with and without TotSC
Can you give some examples of these? It would help out for the BG1 Fixpack and other mods that should be compatible whether TotSC is present or not. I know of some spell differences and things like that, but not actual syntax differences.
Link to comment

"CreateCreature" is not allowed to have the "face destination" coordinate for vanilla BG1, for example.

BG1: CreateCreature("creature",[xxx.yyy])

BG1 + TotSC: CreateCreature("creature",[xxx.yyy],z) (like for BGII)

 

IESDP only gives the BG1 + TotSC action syntax, unfortunately.

 

I will have a look whether I find some more tonight, but I think that was my only problem. I'll try to recall who gave the hint about that, and I'll let you know. I would assume Bg1-modder Zed Nocear knows these things, or at least a lot more than me, for example (sorry Zed, I hope it's OK if I post something like this).

Link to comment

Just a short question: Is there a way of checking inside a dialogue, whether the game is BG1Tutu or BGT?

 

My problem is a journal entry in Candlekeep, i.e. the prolog. As the BGII engine doesn't have journal entries for "Chapter 0", my journal entries disappear into the great unknown in Tutu. I could use McReady's syntax and do ~SetGlobal("Chapter","GLOBAL"1) AddJournalEntry(@34,Quest) SetGlobal("Chapter","GLOBAL",0)~

 

if, well, if that wouldn't make no sense for BGT.

 

So, I need something that goes

IF ~(BGTgame)~ THEN DO ~AddjournalEntry(@34,Quest)~

IF ~(Tutugame)~ DO ~SetGlobal("Chapter","GLOBAL"1) AddJournalEntry(@34,Quest) SetGlobal("Chapter","GLOBAL",0)~

 

Wait a minute - it should be working to use an AreaCheck, wouldn't it? For ~AreaCheck("FW2600")~ it's Tutu, for ~AreaCheck("AR0015")~ it's BGT. ?

EDIT: Yes, that works. Now I am happy!

 

EDIT: And, yes, I am playtesting. It's only that I noticed journal entries are working in EasyTutu (they don't in Tutu v4.) Cool stuff, Macready!

EDIT2: spelling... EDIT3: Tutu areas use FW, of course. ..

Edited by jastey
Link to comment

Yep - we add the same functionality in BG1 NPC by OUTER_SPRINT of the chapter numbers and using COMPILE EVALUATE_BUFFER.

 

So, instead of making null duplicate states;

 

/* Tutu Chapters */
OUTER_SPRINT "tutu_chapter_1" "1"
OUTER_SPRINT "tutu_chapter_2" "2"
OUTER_SPRINT "tutu_chapter_3" "3"
OUTER_SPRINT "tutu_chapter_4" "4"
OUTER_SPRINT "tutu_chapter_5" "5"
OUTER_SPRINT "tutu_chapter_6" "6"
OUTER_SPRINT "tutu_chapter_7" "7"

or if the install detects BGT,

/* BGT Chapters */
OUTER_SPRINT "tutu_chapter_1" "2"
OUTER_SPRINT "tutu_chapter_2" "3"
OUTER_SPRINT "tutu_chapter_3" "4"
OUTER_SPRINT "tutu_chapter_4" "5"
OUTER_SPRINT "tutu_chapter_5" "6"
OUTER_SPRINT "tutu_chapter_6" "7"
OUTER_SPRINT "tutu_chapter_7" "8"

 

You could extend that everywhere, so that if you detect BG1 and it has "Chapter 0", then Tutu Chapter 1 could be set to 0, etc.

 

And actually, looking at it, Chapter 1 being restet on BGT should make no difference... I think.... but anyways, if you wanted, instead of the AreaCheck

 

O_S "PrologueChapter" "0"
O_S "PrologueChapterAdvance" "1"

ELSE

O_S "PrologueChapter" "1"
O_S "PrologueChapterAdvance" "1"

IF ~condition ~ DO ~SetGlobal("Chapter","GLOBAL",%PrologueChapterAdvance%) AddJournalEntry(@34,Quest) SetGlobal("Chapter","GLOBAL",%PrologueChapter%)~

 

 

wound return

 

IF ~condition ~ DO ~SetGlobal("Chapter","GLOBAL",1) AddJournalEntry(@34,Quest) SetGlobal("Chapter","GLOBAL",0)~

 

on Tutu and

 

IF ~condition ~ DO ~SetGlobal("Chapter","GLOBAL",1) AddJournalEntry(@34,Quest) SetGlobal("Chapter","GLOBAL",1)~

 

on BGT and should result in it working with only one dialogue state.

 

 

You can use your syntax too, which is a nice workaround, but you need to check that it installs ok on other platforms. As far as I know your usage will simply pop an error message and continue, but you will need to check.

Edited by cmorgan
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...