ERM parser

Recently I’ve uploaded some files with partial implementation of an ERM parser using boost.spirit. Please don’t touch this code (except gcc compilation fixes) - it’s a university project done by me and Tow.

I’m wondering which version of WoG/ERM you’ve been devloping the parser for. Is it the public 3.58f version or the never-released-publicly 3.59 version?

I recall that one of your team was also added to the WoG Team mailing list (while it was still active), so I think you probably had access to 3.59 files.

The reason I’m asking is because some of the 3.59 additions were pretty cool, and while not publicly released, some nifty scripts were written using 3.59 ERM by team members.

If you plan a full implementation of ERM for VCMI (eventually) it would be great to support the 3.59 additions to the code as well.

Keep up the great work on this project! :slight_smile:

  • Fnordian

I’ve written parser for ERM from WoG 3.58f. It was quite hard since the documentation is incomplete. The main problem with ERM 3.59 is that we don’t have documentation in English for it.

BTW, we are extending ERM too (it’ll be called VERM most likely). VERM will be almost fully compatible with ERM (just don’t start your comments with !) and have much better, alternative syntax.

I may have some documentation for 3.59 ERM in some format or other (maybe just text files) although I don’t remember for sure. I’ll have a look and see if I can dig anything up.

ERM was good, but due to the way it was created and then added to in little bits and pieces and without the open Heroes source code, it’s also rather clunky in many ways so alternative syntax options and simplified ways of doing some things would definitely be an improvement in many cases.

Anyway, I’ll post again after I’ve looked for 3.59 documentation and let you know if I have anything useful.

I located a text file of the compiled ERM additions/changes to 3.59. I believe it contains only my compilation of Slava’s documentation notes that he posted along with each update, so it’s unfortunately somewhat sparse in places.

I think even if you decide you’d rather not try and support the 3.59 additions directly, most of the new commands and triggers would be good to add to your extended VERM in some way or another.

I’m going to try attaching the text file here if I can.
[Edit, that doesn’t look like it attached so I’ll try copy/pasting the docs to a message instead]

BTW, regarding incomplete documentation of 3.58f commands…were there missing commands from the full HTML docs, or more to do with missing details/quirks/examples? (I don’t recall much of the former that was missing although it’s certainly possible.)
ERM_changes_WoG_359.txt (38.3 KB)

[size=92]Hi Fnord,

Was it a .txt file which failed the upload? If yes, then it’s indeed an issue on this forum… and the error message mentioning the cause is not so obvious (maybe Tow/TowDragon could check if it can be made in red and bigger fonts). But it does work if you archive it. Well, that’s for the future… we now have the content in the above post. :slight_smile:

Anyway, nice to see you’re still around. Here’s hoping that one day this project will be fully ready, but also that that day you’ll be around and having time to join in the creation and editing of new, even better scripts. :wink:

EDIT: I see Tow managed to attach the file in .txt format to your post above. I guess he either needed admin rights for that, or he simply removed the restriction for attaching .txt files to the forum. I guess he’ll clarify that in a post soon. :)[/size]

Hi Zamolxis. Yes, a plain .txt file. I didn’t notice any error message at all so you’re probably right that it was just not obvious, and good to know that in future I just need to archive it for it to work.

And thanks, yes, I’m still around and kind of following VCMI’s progress but unfortunately don’t really have time to do testing or anything much at this time. I do hope in the future to have more but who knows. I’d have to relearn ERM/VERM anyway as it’s been over four years since I’ve used it now and I’ve forgotten so much. But if there’s any obscure WoG or Heroes info anyone needs that I might have available on my computer, don’t hesitate to ask and I’ll try to dig it up. :slight_smile:

(And thank you, Tow, for attaching the file to my previous post. :slight_smile: )

The txt extension was not on the list of allowed file extensions for attachements. I’ve changed that and added the description as an attachement to your post.

Thank you for the description, I do have access to the WoG mailing list but having a ready compilation of information about changes in ERM will help us a lot in implementing 3.59 ERM elements. :slight_smile:

However I have to warn you that implementing scripting commands will take much time. We are now developing ERM interpreter module because an opportunity came to make it as an university project; however there are many other things that need to be sorted out before real script support can work. ERM concept doesn’t work well with multiplayer support and that’s an issue especially since VCMI is based on MP-like client-server architecture. [Supporting whole ERM within MP game is basically impossible, and even partial support may lead to various issues with cheating, synchronization and reactiveness. We have to tread carefully.]

So most probably we’ll prepare parser and interpreter pretty soon but support in engine for most of ERM commands will be added later and gradually (similarly to other game features).

Hi Tow. Thanks for the explanation. I figured ERM and scripting support wouldn’t be truly added for a long time, especially as there are still basic Heroes 3 features (spells, creature abilities and more) that need to be implemented, as well as AI support, to make the game properly playable. Until then, the scripting would be of little use anyway, but I think it’s great you were able to do the parsing as an approved university project.

As for the MP features–if the ERM versions can’t be fully supported that would be unfortunate, but understandable. Certainly in the MP WoG games I played online, certain ERM features in MP games didn’t work correctly or caused instability, and at worst, desyncronization and crashes.

However, being able to use scripts (including battle scripts) in MP games is still going to be a much-desired feature, obviously with anti-cheating security in mind. So if it’s technically possible to develop some sort of scripting for use in MP modes within your client-server model, I believe that will still be a sought-after feature. I expect that for tournament play, there are ways to limit the type of scripts used to the ones agreed upon, perhaps even providing transparency by a warning message if someone attempts to remotely run a script that isn’t in the agreed-upon list or perhaps the system simply would make the attempt impossible.

The WoG Team (to my knowledge) no longer exists in any active form (I haven’t seen a new post to our old mailing list in a long long time–a year perhaps?) but I think the old messages and files should still be up on Yahoo if any are needed. Quickly checking my scripts, I think I only ended up writing a few new ones that used some of the new 3.59 ERM commands but I believe a few others in the team also wrote some scripts. Further control over the spells, mouse cursors, and town buildings were probably the most useful of the new features added, and of course the introduction of support for more wogify scripts was (or would have been) important too, but the latter is outside the scope of the ERM parser anyway.

If you need any other info from WoG/ERM, I can see if it’s something I have. And on a related note, I once compiled a fairly complete Heroes 3 creature spell and ability immunity listing based on testing (which may still be up on Celestial Heavens somewhere…). I don’t know if immunity info’s needed or has already been dealt with, but just though I’d mention it. :slight_smile:

While making support for stack exprience, I stumbled upon a large number of protection abilities, such as immunity to hostile spells / receptiveness / immunity to damage or elemental spells, which seem to be more than game mechanics can handle so far. That means your info can still make some use soon.

Okay, cool. I’m not sure if I can upload an html file without archiving it first but I’ll see. I can’t guarantee this list is 100% complete (and the specific spell list isn’t but is mostly just for convenience anyway) but hopefully it will be of some use. :slight_smile:

(Okay, guess I have to archive it first.)

HoMM III Creature Immunities.zip (3.18 KB)

Actually both, and not only these. What I have encountered so far is

  1. “Universal format” tutorial is far from being complete - I think it would be worth extending with our parser rules converted to EBNF (I can provide details if you are interested in it).
  2. It’s not clearly stated which lines are considered to be comments - I once stuck at line beginning with !d!IF not knowing what does it do.
  3. There is too little about post triggers.
  4. It’s unclear if lines beginning with ~# do anything (and what).
  5. There is nothing about what does “>0” in receiver option parameter list do.
    I’m sure this list will grow as ERM interpreter is implemented.

BTW, thanks for list of post-3.58f changes.

We have been thinking about cheatproof MP - scripts interactions for months (or even years) and a lot of issues still need to be discussed. The current best-for-the-player solution is so ridiculously complicated that it surely won’t be implemented in full extent. I have never heard of a game that solves such problems so we have nothing to follow and we must struggle with this problem alone. I hope we will succeed.

Okay, I see and unfortunately it’s been so long I don’t really remember either (if I ever knew). Although I don’t think ~# does anything…most likely the ~ was just entered into some scripts to disable the command. But I could be wrong. I think a lot of ERM scripters used their own way of temporarily disabling commands and triggers and instructions by replacing a character or inserting one.

With much of ERM, I’m not even sure Slava knew exactly how all of it would work after he made new commands or formats available. Sometimes we’d discover stuff and most of what we discovered (but I’m sure not all) eventually made it into the ERM docs. There were definitely many quirks (proably including some things shouldn’t have worked quite the way they did).

I suspect you’ll never get all of WoG’s ERM to work 100% the same way in VCMI due to these quirks and issues. In some cases they’ll be unknown and in others you probably wouldn’t want to propogate them if there’s a better and more consistent way to do it. The result will likely mean some scripts will need a bit of rewriting but perhaps that’s not a totally bad thing either. And with extensions and improvements to ERM, it’s likely that many scripts could be improved and simplified too. Anyway…this is all quite far in the future I suppose.

And you’re very welcome for the ERM 3.59 notes. I hope they’ll prove to be of some use.

We have been thinking about cheatproof MP - scripts interactions for months (or even years) and a lot of issues still need to be discussed. The current best-for-the-player solution is so ridiculously complicated that it surely won’t be implemented in full extent. I have never heard of a game that solves such problems so we have nothing to follow and we must struggle with this problem alone. I hope we will succeed.

Yes, impossible to please everyone I suppose. Perhaps one way would be two different executables–one that’s very secure for tournament MP games but more limitied script-wise/mod-wise and another that’s more open for casual MP gaming where players trust each other and would rather have the full range of options.

Those two modes of script execution is actually quite old idea for us and we are going to implement it (but both in one executable). The real problem with MP-mode scripts are scripts that both affect game mechanics and need access to player’s input devices (mouse clicks, mouse position, keystrokes) - such scripts must run on server side so the delay between the moment when player does something and the moment when he sees the effect could be irritating for people with slow Internet connection.

Of course, there are further problems when simultaneous turns are considered.

In theory, the amount of data for a single action should be relatively small I think, so the delay shouldn’t be very long. And if it’s a little longer (with an hourglass on the client side of course), it will likely be tolerable. However, if the client action involves selecting from a menu and that must be run on the server side, I can see that delays could be annoying. But perhaps anything that doesn’t actually affect the game itself (such as menu display and selection) could still be safely run on a client-side script and only the game-affecting actions (ie. the results of the menu option chosen) would need to be handled by the server?

Yes, I expect there would be! But simultaneous turns sound problematic anyway, and I’m quite intrigued to see how they would be implemented for even a standard vanilla game of Heroes 3, given all the issues I can think of. I suppose this is something that you’ve already given some thought to, although likely another far-off feature.

Yes, they can, as long as there are no server-side scripts that could interfere with such actions.

Yes, we are thinking about simultaneous turns too. But you won’t see them implemented soon.