Improved TOEE Console output

Discussion in 'General Modification' started by dulcaoin, Jun 6, 2005.

Remove all ads!
  1. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    This will interest the hard-core Modder. :rock:

    Through a little detective work (OK, make that a *LOT* of detective work), I found out how to "fix" output of all the python "print" statements in all the scripting in TOEE to output to the console, as one MIGHT expect it to work in the first place.

    I was in such a hurry to share this that, rather than create an entirely new patcher, I upgraded the PC Count patcher to add the functionality.

    Just download http://files.co8.org/patch/TOEE_PCCount_Patcher_2.0.zip
    then unzip the .exe and run it
    You must click on Read PC Count, and navigate to the temple.dll
    Then use the bottom two buttons to enable and disable "print" output to the console. (you need to "Read PC Count" every time you run the app, before choosing a bottom button, otherwise the buttons at the bottom won't do anything).

    PLEASE NOTE: Having these enabled means LOTS of output (no wonder they turned it off :p), and that means a slower running game. You should keep this output disabled for playing, and only enable it for development and debugging work.


    Enjoy :doublethu


    -- dulcaoin
     
  2. Morpheus

    Morpheus Mindflayer Veteran

    Joined:
    Nov 11, 2003
    Messages:
    539
    Likes Received:
    1
    Hm, that sounds very promising. Good stuff, dulcaoin! :doublethu

    This will surely help the hardcore modders among us to find out a little bit more about how the game works.

    I would prefer it if this functionality was available as a seperate download, though, to avoid confusion.
     
  3. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    It's more than "how the game works", it will allow us (Liv) to output script values, output debugging info; it's a really powerful development tool for all scripting.

    I'm at a crossroads, whether I want to issue myriad "small" patchers, or have one "Whole Enchilada" with all patches in the same app; one-stop-shopping basically. Admittedly, the existing app needs some UI work if I'm going the latter route; once I decide which way to go; I'll either move the functionality to a new app, or to a separate tab; I'll include lots more documentation in either case. Right now, I'm heading for "Whole Enchilada". There are ENOUGH places to look for patches as it is. I may try working out a way to switch this functionality (within temple.dll, not within the patcher) dependent on registry settings; that's the best route I think. We'll see...

    -- dulcaoin


    Edit: Also, need to mention: I kept both the older "1.2" version and the new "2.0" version present in the ftp area, so anyone patching for PC count via the "Fixed PC Count" thread will get a version that doesn't even mention this new functionality, and only "modders" following this thread will get the "new" version.
     
    Last edited: Jun 6, 2005
  4. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,655
    Likes Received:
    352
    OMG that is SPECTACULAR!!! I dunno if i have the capacity to really make use of it but I have SERIOUSLY longed for somehing like this!!!

    :doublethu
     
  5. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Yup, tell me about it. It's a crutial fix to helping scripters do better work. :)
     
  6. Drifter

    Drifter Established Member

    Joined:
    Dec 24, 2004
    Messages:
    118
    Likes Received:
    1
    So how does this wonder work?
    All the noob modder sees when installed this patch is some obscure numbers being spammed in the in-game console.

    That's the general problem - lack of detailed documentation about console and debugging features of ToEE. People who know a bit keep all to themselves, sometimes dropping a crumb as just to say "hah, I know and you don't, that makes me so l33t" and others just wander in darkness. Doing search about these things in this forum using different keywords produce some results, but mostly it is same things repeated over and over that everyone knows about - those basic cheat commands and so on.
    For example, it might seem that some guys do know about debug output window and debug.txt, even if it isn't enabled by default, yet I haven't found anything to describe it directly.
    I understand that peoples who find out something are too busy modding the game themselves to post faqs and stuff here, but you might wonder which would benefit everyone more.
     
    Last edited: Jun 7, 2005
  7. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0

    Wow, Drifter. You're one of the more accomplished modders here; I'm surprised you're complaining about this. There's no need to be confrontational or insulting.

    The python "print" command is sprinkled throughout the different scripts that have been supplied, especially the AI scripts. Up to now, those prints have gone into the "ether", because they were disabled en masse in the code to keep all that output processing from slowing down the application.

    By using the patch, you direct all output from "print" to the console. Which means, while you're working on a given script, you can add your own print commands and use them to debug what you're doing. In most cases, you'd want to go back and comment out those commands in the end to reduce the "noise" to the console. In fact, it would not be a bad idea for "someone" to go out and disable most of the prints in most of the scripts, for the benefit of everyone -- note I said "disable", NOT remove.

    If I knew what that series of numbers was (output from some script or other), I'd tell you. We're all still learning and working towards further knowledge. Up to now, this has been met with "excellent! let's keep up the fight!" rather than bemoaning that the knowledge isn't coming fast enough.

    I would challenge YOU to doc the specific changes you've made in your patchers, in order to further the cause you're mentioning.

    -- dulcaoin
     
  8. Drifter

    Drifter Established Member

    Joined:
    Dec 24, 2004
    Messages:
    118
    Likes Received:
    1
    Sorry if I sounded like I was bemoaning about the progress or even insulting, as I didn't mean that. I guess I should choose words more carefully, as english is not my native tongue. (Sometimes I wonder what's up with the people here, me included, who all get confrontational, as you say, at the mere sight of feedback which doesn't involve pointless hyping-up).

    But I think the lack of documentation on modding stuff is a big problem, and that's what I meant. For beginners (me included) it usually means reinventing the bicycle over and over again (if that beginner is even lucky or skillful enough to suceed in that, otherwise he's discouraged to continue modding)... Even if one doesn't know it all, just some bits, sharing with others helps in solving puzzle from all these tiny pieces of knowledge everyone has.
    Note that I don't necessarily direct all this at you personally. Nor do I blame anyone.

    Thanks for clarification about the printing to console. Now I see there's more to this than those weird numbers :)


    No. I know zilch about python and ToEE data structures, even if I know a thing or two about assembly. So definitely not accomplished and not even a modder to be honest :) Besides, maybe I wasn't speaking on my behalf, just expressing opinion of the average newb to ToEE scripting.

    Well, that is a different matter, in most cases. If these changes are not customisable (as it is the case with bugfixes), or customisation only involves turning on/off within the patcher (MaxHP or NPC stuff - besides, these are really easy, and basically involves only simple nop'ing of code, so anyone familiar with ASM would know what is what after doing fc /b), what good would be these detailed descriptions of the code changes, especially when most people do not know ASM anyway?
     
    Last edited: Jun 7, 2005
  9. Drifter

    Drifter Established Member

    Joined:
    Dec 24, 2004
    Messages:
    118
    Likes Received:
    1
    Btw, you probably know this, but maybe most do not, as my search on this forum and web didn't return any exact results... so I guess I'll just post it in case anyone would be interested.

    There is a Debug Output console window, with option to dump everything to debug.txt. It is not enabled by default of course. To enable, change system registry:
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Troika\TIG\Debug Output]
    "console"=dword:00000001
    "debugger"=dword:00000000
    "file"=dword:00000001
    "mono"=dword:00000000
    Changing "console" flag to 0/1 turns off/on Debug Output window. Run game in window mode to see it. Lots of output really, including some from python scripts - return results of game flag and variables querries and stuff. Changing "file" flag turns off/on dumping of debug output to debug.txt file in gamedir. Not sure what "debugger" is for and no idea about "mono".
     
    Last edited: Jun 7, 2005
  10. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0

    I think the main issue here is that those who have come before us have left, without leaving a trail of documentation; and I'm in complete agreement with you that that is a problem.

    By doc'ing your ASM code changes (BTW, "a thing or two about assembly" is NOT trivial, especially these days), you leave a trail for those who follow you to continue your work, should you ever become discouraged or too busy, and drift away. I guarantee you, there are and will be asm-level modders to come (I am one of the current crop, obviously), and them knowing what you've done, and using your work to build it, will help the cause immensely. The asm job is huge, and you having found the locations that do the things that you patch will save someone else from having to find those locations again.

    Finally -- and I don't mean to create further dischord here, but I want you to know what I meant by "insulting" -- I guess I was a bit irritated by your comment that people here have acted "elite", since I've found just about everyone involved in this effort to be open, helpful, and contributory to the cause; I admit that I've seem plenty of elitism on other projects in the past; but I don't feel that's overly true here.

    All that said, it's been my interest and intention to better document the issues here; and I've worked up the ability to moderate, and therefore sticky and edit the main lists, so that I can accomplish that goal. I would encourage everyone to document, as well as you can, the work you're doing, so that the knowledge grows, and doesn't need to be reinvented over and over.

    -- dulcaoin
     
  11. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Oh, nuts! I totally forgot to post about this.

    I guess you caught me, Drifter. I had knowledge I didn't share <blush>

    debugger, set to 1, sends all that output to your "system" debugger. if you're debugging using IDA, it goes there, if via Delphi, there, etc.

    mono goes WAY back to Hercules graphics days. It outputs to monochrome monitor memory.

    Also, all this stuff works under Aracanum, in case anyone cares ;-)

    -- d
     
  12. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,655
    Likes Received:
    352
    I'm going to be annoyingly agreeable and agree with both sides here: this forum IS a great place to come and is FAR more civilised than some i have seen. But... yes I have felt a tiny touch of elitism on occasions. It hasn't been aimed at me so it hasn't bothered me. I think keeping in mind we have folks from all over the world here is a good idea, what with language barriers and all.

    The info in the stickies is far from perfect but I tihnk its enough to get people started, worked for me so far. The things I don't understand (such as mobs) seem to be things that nobody has fully cracked yet. If you have, TELL US!!! ;)
     
  13. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    To me, if I see the elitism (I must say, none has been pointed at me), and I get ready to knee-jerk to it, I just repeat to myself the thought that all this work has been done for free, and shared with all. It's hard work, and so I think modders have a modicom of right to feel a TAD BIT proud of their accomplishments, as long as we keep the spirit of sharing and teamwork alive.

    We don't have .mobs down yet; still progressing. The other stickies, I plan to upgrade and improve over time (and it's a time thing, not an elitism thing)

    -- d
     
  14. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,655
    Likes Received:
    352
    Hey, I'm amazed at what has been done with the mob files, I have spent many hours fidddling them and haven't achieved a solitary thing. I was mainly backing up Drifter, I understand where he is coming from and think some of his comments hit the mark.

    Anyways, its not a big deal, lets just support each other. I think there is some real progress being made atm.
     
  15. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Well, everyone is discussing something here (elitism, mob files, or whatever else that is not stated in the topic name), so let me add something here too.

    But first I'd like to thank dulcaoin for the great thing! Great work, dulcaoin! The tool you've made will greatly support modders who write serious scripts since it could make their debugging a lot easier (finally - more feedback from the game console!)

    Now, on to unpleasant stuff...

    About things not getting updated frequently (info on mob files in particular): believe it or not, someone is constantly doing something at this site. At this very moment, I'm finishing to add some extra mob file support (things that were uncovered recently) into my upcoming editor. Things *are* being done, programs *are* being written, the thing is - ToEE isn't an easy game to mod, and writing high quality tools is not an easy task. Believe me, breaking down temple.dll to see how the game works is also not an easy task to do, even with the highest quality tools available (IDA or whatever). You may be wondering: if I got that mob file support or something else available, why don't I release it for everyone to see and use right away? So, here's the real trick: I don't want to release a tool that I didn't test thoroughly or that I didn't document well, since I'm very much aware of the fact that doing this will not benefit people, but will confuse them even more (especially newcomers), especially if it has serious bugs that prevent the program from actually working correctly. As dulcaoin said, everything on this site is done for free. We are working on file formats, tools, and whatnot whenever we have time to, since it's mostly our hobby and not our real life. Unfortunately, from my point of view, there is nothing really solid available for release, at least not until I've documented whatever I've done (at least on the basic level so people can understand how things work). There is another statement that I can add in support of this idea: ToEE sure *does* have a *WEIRD* engine functionality. It doesn't work how people suppose it should work, and that's what makes documenting things my first priority as well. I really hope to give a public update on my progress, with tool releases and all, pretty soon, but I can't promise a certain date of that. I'm sorry if I insulted someone with what I said (or if I acted "elite", or whatever) - that was not the real intention.

    By the way, if you want a perfect example of what I said above - dulcaoin and I tried to keep people updated on our progress in breaking down mob files in the past (see threads like "MOB File Format Breakdown", "MOB Format: my part", etc.) This idea proved not to work since the threads got overwhelmed with technical data, sometimes incorrect (due to incorrect suppositions) which were corrected later with even deeper technical data, ad infinitium. I bet that no one really got what we wanted to say. So THAT'S what I'm talking about - we could have kept going on and on, probably even till now, but it won't really be beneficial since it doesn't present well-structured and 100% correct, confirmed information on how to create or modify mob files. Basically speaking, a person who wanted to actually edit mob files would have to re-read and "re-structure" ALL the information in his mind, basically redoing half (if not more) of our work. In addition, he would have to write his own tool to do it (modifying mob files by hand has proven to be very tricky).

    By the way, for those seriously interested in MOB file modification: MOB files, even though they are small, are very complicated. Unintentional modification of data in a MOB file (if you are not exactly sure what you're doing) will almost surely result in a CTD without an error message (besides the memory read/write error). I'm doing my best to create a high quality MOB editor that would not corrupt data and that would allow to both create MOBs from scratch and edit existing files. The public update on my progress is coming, stay tuned.

    I'm sorry from moving away from the topic of the conversation here once again, but I think it's no biggie since the topic has already gotten out of hand and resulted in a generic rant.

    - Agetian
     
    Last edited: Jun 10, 2005
Our Host!