Jump to content


Photo

BiG World Setup Revival ideas (comments and suggestions welcome)


  • Please log in to reply
50 replies to this topic

#41 neird

neird
  • Member
  • 19 posts

Posted 14 March 2012 - 03:33 AM


weidu when the LANGUAGE tag is used and is given a list of languages.  Those languages are assigned a numerical value starting with 0 and going as high as there are languages in the list.  but the order of languages is different per mod since some do not have translations in other languages or the modder listed them in a different order.


OK, so we need a list of languages that each mod support, and the numbers of theses languages, and hope that modders doesn't change the order of the languages between versions... heavy work to do.


You can extract language mapping with weidu.
weidu --nogame --list-languages setup-mod.tp2
Since there is no canonical names for languages in weidu you should also map language names (works for Linux)
weidu --nogame --list-languages setup-mod.tp2 | \
grep -E "^[0-9]+:" | tr "A-Z" "a-z" | \
sed -r -f fixlang.txt

Attached Files



#42 William Imm

William Imm

    Obsessive Penguin Lover

  • Member
  • 486 posts

Posted 14 March 2012 - 04:06 AM

Ahem - Since this is purely a topic for the BiG World Setup revival project, this dicussion about languages should be moved out of my thread. If one of the admins/mods around here would do that, that would be much appreciated.
At this point, I'm not really doing much Baldur's Gate related. More focused on Skyrim modding and the Born of Legend tabletop roleplaying game. Don't expect much activity here.

#43 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 14 March 2012 - 05:19 AM

Ahem - Since this is purely a topic for the BiG World Setup revival project, this dicussion about languages should be moved out of my thread. If one of the admins/mods around here would do that, that would be much appreciated.

i agree a detailed discussion about how languages work within weidu does not belong here.


Actually, the way I'm going to be handling translations is very similar to WeiDU - externalize the strings to seperate files for each part, and when a part of the program needs one of those strings, call a static function that displays the approiate string.

Since your earlier reply indicates that you've got language handling under control, I too think that the ability to sort by available languages for the multi-lingual would be awesome. Also the ability to restrict mods to a specific language for those who are not multi-lingual or just want a single language install for role play reasons.

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#44 freche

freche
  • Member
  • 10 posts

Posted 14 March 2012 - 06:00 AM

In the old BWS it was possible to configure what parts of different mods was going to be installed and if you had picked something that required another mod or if it had conflicts with some mod you would get a warning about it.

Will the new BWS have this feature ?

#45 William Imm

William Imm

    Obsessive Penguin Lover

  • Member
  • 486 posts

Posted 14 March 2012 - 12:27 PM

Since your earlier reply indicates that you've got language handling under control, I too think that the ability to sort by available languages for the multi-lingual would be awesome. Also the ability to restrict mods to a specific language for those who are not multi-lingual or just want a single language install for role play reasons.

I'll take that into consideration. In the linklist file I'll have a attribute for <mod> that lists the languages the mod supports. I'll also have another XML file for the actual mod installation
- with the mods linked by their id, in which I'll have a language-token tag, then tags like <english>, <spanish>, that will list the approiate language tokens. Comments on this is welcome.

By the way, here is pesudo-Java for the string selector:

public static String getTranslationFile(String transFile, int refrence) {
    // get the right file
    File tra = new File(getProp("language") + "/" + transFile);

    //get reader
    BufferedReader reader= getBufferedReader(tra);

    while (trasting = reader.read() != null) {
         if (trastring.indexOf(refrence) != -1) {
               String traArray = trastring.split(" = ");
                return traArray[1];
              }
     }
    return null;
}

In the old BWS it was possible to configure what parts of different mods was going to be installed and if you had picked something that required another mod or if it had conflicts with some mod you would get a warning about it.

Will the new BWS have this feature ?

Yes, and it will actually give reasons why it's conflicting in clearer detail.
At this point, I'm not really doing much Baldur's Gate related. More focused on Skyrim modding and the Born of Legend tabletop roleplaying game. Don't expect much activity here.

#46 i30817

i30817
  • Member
  • 611 posts

Posted 14 March 2012 - 12:43 PM

OMG man, learn about resource bundles.

In fact i'd say "learn about the netbeans application framework", but i'm afraid you'll get scared.

Netbeans framework built app (by a wizard, but still)
Posted Image

Not to discourage you or anything, but any swing app (any graphical interface app that is not strictly WYSIWYG edited really) tends to turn into a soup given enough features. Example from the main frame of one of my projects:
http://code.google.c...pplication.java

Last advice: a library you'll REALLY REALLY REALLY want to use when using tables or JLists in swing is GlazedLists

Edited by i30817, 14 March 2012 - 01:05 PM.


#47 William Imm

William Imm

    Obsessive Penguin Lover

  • Member
  • 486 posts

Posted 14 March 2012 - 01:02 PM

Well, in fainess, I never really knew about resource bundles before i30817 brought them up to me. Actually, I have used Netbeans for a while - maybe I should try that for this project?
At this point, I'm not really doing much Baldur's Gate related. More focused on Skyrim modding and the Born of Legend tabletop roleplaying game. Don't expect much activity here.

#48 i30817

i30817
  • Member
  • 611 posts

Posted 14 March 2012 - 01:09 PM

Also use glazed lists as i said above. Read the feature list; all that is things that swing doesn't give you. Swing is not a "framework". It's more of a "library", if you never learned the difference between the two, a framework is something that has convinent holes for you to plug and create your app - less flexible, but faster and easier to get good results - as long as you read the manual. A library is a set of standard components, which you can, or can not, extend and combine.

Finally, if you're thinking of saving data on the shutdown of the app (during running you can use serialization just fine though), please please use a simple database to save things instead as they are altered instead of ShutdownHook or similar (it's flaky in linux, because linux likes to kill processes a pretty strict timer - or maybe their timer is buggy or even the jdk, idk).

Sorry if preaching to the choir about this, but you really should also get this library:
https://swinghelper....debug/debug.jar

And add these two lines to the start of your main() - before starting swing:
javax.swing.RepaintManager.setCurrentManager(new org.jdesktop.swinghelper.debug.CheckThreadViolationRepaintManager(true));
org.jdesktop.swinghelper.debug.EventDispatchThreadHangMonitor.initMonitoring();

One will help you detect when you are using a Swing component outside of the EDT (a no-no)
The other will help you find on dev when you are hogging the EDT (the UI looks frozen, you need to offload the costly ops (like downloading files for instance) to outside of the EDT with swingworker).

Then on release you can comment them.
The model i like to use for the EDT stuff is the app starts up, i load whatever i need to load from files and start the EDT, and code my stuff on the frame i started, except to do something in swingworker or similar. There is another (stupider IMO) way, that is to send a edt event whenever you need to touch UI code. Since you're doing that almost all of the time...
I also don't like extension - it makes me "method overload". I prefer a wrapper over a component when i need to do a extension or even a new component.
Like this one: http://code.google.c.../ImageList.java
Notice how i have a "getView()" method that returns the JComponent Itself and the rest are "model" methods to change data or query the data? This is for me to hide everything related to plumbing inside the class, and only return something "ready to use". If i REALLY need to use something related to plumbing outside to configure, i either add a method (if used often) or use the "getView()" to acess those methods/object/subobject. Also, extending swing objects instead of composing them is almost always a bad idea because swing provides all tools for expected configuration from it's methods (except, the very lowest drawing, that you can override some methods to affect).

But i'm rambling.

Edited by i30817, 14 March 2012 - 05:03 PM.


#49 i30817

i30817
  • Member
  • 611 posts

Posted 14 March 2012 - 04:37 PM

Also you can use any class of my "util" project.

I find it useful, but to be honest it's a bit hacky.
Spoiler


Actually you shouldn't use any of that that uses files... I'd forgoten i'd ported everything to Java 8 (the new "Path" class replaces "File" so you'd have to use java 8 .

Edited by i30817, 14 March 2012 - 05:06 PM.


#50 William Imm

William Imm

    Obsessive Penguin Lover

  • Member
  • 486 posts

Posted 14 March 2012 - 05:10 PM

Thanks for the advice, i30817. I'll keep that in mind when working on the BWS. Right now, I'm busy with reinstalling Win 7 on my brothers computer (error 0x80300024 and bad burn, ugh.)
At this point, I'm not really doing much Baldur's Gate related. More focused on Skyrim modding and the Born of Legend tabletop roleplaying game. Don't expect much activity here.

#51 i30817

i30817
  • Member
  • 611 posts

Posted 14 March 2012 - 05:15 PM

Are you planning on a single order (like Big World) or on a more flexible system (liked the mlox)?

You should probably try to seperate that part (if you're going to do it) into a seperate data driven tool, with a command line (addictional) interface - because it'd be useful by itself, and because it needs to be updatable regularly by non coders.

I was thinking of doing a "mini programming language" for that, but i'm not not rock solid (kinda mushy in fact) on the theory of how mlox does things. I mean it uses a sorting process that assures termination.

And BG mods are more complex than morrowind ones : the mod sorter would need to sort components instead of mods: because most components can be installed optionally, and yet, it better minimize "movement" or components from other mods going into the middle of a sequence of another: more chances for bugs, slower (because weidu has to start again) - another complexity is that BG mods often have user input. We can put some default values there, but need a way to override those and at least in one mod the user input depends on the mods installed (Level1NPC's). Morrowind mods use a horrible "game config objects" system at play-time.

Things it would be cool for this tool to have:
The understanding and using the rule file to output a mod order (obviously)
a library of md5's of the mods versions (to detect a "new/edited" and warn (ask to the user what mod it actually IS if not recognized, because filenames are a really bad way to identify mods), to detect outdated versions and warn/ask for update)
Autoupdate rules from a shared file. Either from a wiki, or from a git repository or something.
Sharing a mod list with edited user input options and auto install of that (fool proof mode of installation).
Revert part of a install, update a mod and reinstall the rest. Not sure, weidu already does this for removal right?

Things that probably belong on the main app:
download and extract files to the bg dir (a big mess because BG modding never standardized on only one compressor tool or folder structure).
GUI for selecting the components to install; possible components queried from weidu (and that would be feed to the other tool/library).
Checking if the BG install is ready to install mods?

Questions:
What should happen if the user is using a old mod version but there is a new one on the rules. The rules may have new constraints that didn't apply to the old version, or had rules deleted that don't apply to the new version. Would this system force everyone into the "bleeding edge" or force the use of Tuples of "mod order list, rule file version) to be able to use the set of mods? And if you only want to update one mod but not another it wouldn't work? It seems a difficult problem to work out perfectlly, maybe if we introduce qualifiers to the rules:
@since version (md5 value)
@previous version (md5 value)

or something like that?

Edited by i30817, 14 March 2012 - 06:03 PM.