Changes between Version 1 and Version 2 of WikiStart


Ignore:
Timestamp:
Jul 20, 2023, 6:56:58 PM (11 months ago)
Author:
pulkomandy
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v1 v2  
    1 = Welcome to Trac
     1= Readingame
    22
    3 Trac is a '''minimalistic''' approach to '''web-based''' management of
    4 '''software projects'''. Its goal is to simplify effective tracking and
    5 handling of software issues, enhancements and overall progress.
     3My notes about rewriting an engine for the Lectures Enjeu game.
    64
    7 All aspects of Trac have been designed with the single goal to
    8 '''help developers write great software''' while '''staying out of the way'''
    9 and imposing as little as possible on a team's established process and
    10 culture.
     5This is a "choose your adventure" game (in French) designed for teaching kids how to learn.
    116
    12 As all Wiki pages, this page is editable, this means that you can
    13 modify the contents of this page simply by using your
    14 web-browser. Simply click on the "Edit this page" link at the bottom
    15 of the page. WikiFormatting will give you a detailed description of
    16 available Wiki formatting commands.
     7Some of the adventures were initially published as books by schoolchildren, and adapted into electronic versions here.
    178
    18 "[wiki:TracAdmin trac-admin] ''yourenvdir'' initenv" created
    19 a new Trac environment, containing a default set of wiki pages and some sample
    20 data. This newly created environment also contains
    21 [wiki:TracGuide documentation] to help you get started with your project.
     9I remember playing this at school as a kid, and recently I decided to take a closer look at how it works. Maybe I will get as far as rewriting an engine for it so the games can be played on modern systems?
    2210
    23 You can use [wiki:TracAdmin trac-admin] to configure
    24 [http://trac.edgewall.org/ Trac] to better fit your project, especially in
    25 regard to ''components'', ''versions'' and ''milestones''.
     11== Game files
    2612
     13Each game scenario is made of INIT.DAT, MSG.DAT, MSGGEN.DAT, CONDGALE.DAT, CONDSAL.DAT, CONDULTI.DAT.
    2714
    28 TracGuide is a good place to start.
     15All files are generally composed of chunks starting with a 16-bit size (self-including) followed by some data. A 16-bit 0 serves as a terminator chunk. The cunks do not appear to have an explicit type marker.
    2916
    30 Enjoy! [[BR]]
    31 ''The Trac Team''
     17== Message files
    3218
    33 == Starting Points
     19These two files contain the various messages that can be displayed during the adventure.
    3420
    35  * TracGuide --  Built-in Documentation
    36  * [http://trac.edgewall.org/ The Trac project] -- Trac Open Source Project
    37  * [http://trac.edgewall.org/wiki/TracFaq Trac FAQ] -- Frequently Asked Questions
    38  * TracSupport --  Trac Support
     21The messages are split by "room" chunks.
    3922
    40 For a complete list of local wiki pages, see TitleIndex.
     23The first 16-bit word indicate the "room" chunk size
     24
     25The single-page messages chunks are made of a size, followed by a NULL terminated string.
     26
     27The complex messages chunks are made of a size, followed by more sub-chunks. Each sub-chunk is itself a size + a null terminated string.
     28
     29The strings can contain various escape sequences:
     30
     31{{{
     32%p - Replaced by the player's first name
     33%b - To insert an inline button (followed by a button ID)
     34\o - Insert an "Ok" button centered on the last line. Can be followed by an ASCII-encoded digit, possibly indicating which message to show next
     35[NSome text] - Hyperlinks, where N is an identifier for the link (it's not a room number, since it can trigger other actions, picking items, moving to subrooms, ...)
     36{%f3|%m2~%m3} - Conditionals, if variable f3 is 0, show m2, else show m3
     37{%f6|%m6~\o1} - The contents of the condition doesn't have to be a message
     38{%c1|%m1|%m2|%m3~%m4} - Show message 1 if c1 is 0, message 2 if it is 1, etc.
     39}}}
     40
     41This tells us a few things:
     42
     43- %m variables refer to submessages in a complex message
     44- %f variables refer to boolean flags (such as owning or not owning an object)
     45- %c variables refer to counters (such as health points)
     46
     47MSGGEN.DAT is similar, but contains a single "room" with global ("general") messages that can be triggered from any room (such as global buttons or using objects).
     48
     49Here is a rehex script to parse these files:
     50
     51{{{
     52LittleEndian();
     53
     54// Simple string chunks are defined by a size (self-including) and a
     55// string (NULL terminated)
     56struct lenstring
     57{
     58        uint16_t len;
     59        local uint16_t realLen = len - 2;
     60        char string[realLen];
     61};
     62
     63// Room chunks have a size and are filled by string chunks
     64struct ROOM
     65{
     66        local uint16_t start = FTell();
     67
     68        uint16_t sizeInBytes;
     69
     70        struct lenstring substrings[0];
     71        while (FTell() - start < sizeInBytes)
     72        {
     73                ArrayExtend(substrings);
     74        }
     75};
     76
     77struct ROOM rooms[0];
     78
     79while(!FEof())
     80{
     81        ArrayExtend(rooms);
     82}
     83}}}