Next Generation Emulation banner

New Feature Proposal: Triggers

1182 Views 0 Replies 1 Participant Last post by  kelvSYC
Right now I have a private implementation of a new cheat feature that I'd like to get feedback for before it goes live. It's called Triggers, and it's (to date) only available on the Mac (due to the fact that I develop on a Mac).

It's design has several purposes, all of which are possibly made redundant by further improvements to the cheat engine (and some that I have actually implemented):
* The save data for a triggers file is an XML file - meaning it has a text file and that there won't be endian issues like the current cheat file (right now, if the Mac version used the same code as the PC version for cheat file saving, the two versions would not be compatible with each other due to endian issues - that's how std::fwrite is - using it does not make portable code). The downside is that, of course, if you have lots of triggers your file will take longer to load (I've experimented with a SAX parser, but trigger editing abilities from within VBA will need a DOM parser - not to mention that the Cocoa's SAX parser does not do validation) - Pokémon fans beware.
* It can do stuff that's not possible with the current cheat engine - the triggers engine is completely independent of the current cheat engine, allowing me reasonable flexibility - for instance, MAME-style relative address cheats can be implemented with a single easy-to-write trigger, but right now, the only thing you can do is use a GameShark V3 code (and you'd have to encrypt it too...) - and that's not wroking yet afaik.

Those of you who understand how a Starcraft or Warcraft trigger works should understand how the triggers engine works: the anatomy of a triggers save is as follows: the root element is called triggers, and each triggers element contains as many trigger elements as you like. Each trigger contains three things: the name of a trigger, an extended description (for example, how to use the trigger), and a list of actions. Actions can be as simple as a memory write (WriteAction) or as complex as providing a list of items (of which only one is chosen at a time), where each item has its own set of actions (ListAction). The ConditionalAction is special, because it relies on a condition before doing stuff. Basic conditions are included (AndCondition, OrCondition), as well as a MemoryCompareCondition.

The cross-platform code is contained in a sincle cpp and h file, but XML parsing code is sold separately (the Mac version uses the NSXML DOM parser - I'm thinking other platforms may use Xerces or MSXML or something along those lines). Needless to say core changes also need to be made in order for this to work (ie. for the triggers to trigger). Again, I do have a private (and almost complete) implementation of it in my private builds, but I will give the code out to anyone who is interested.

Any feedback on this idea is appreciated, although you should make all criticisms be of the constructive kind. Remember that this is just an ancilliary feature, and that there are many more important Mac issues that need to be dealt with (such as why on my 867MHz G4 is the emulation at 50% tops, which I attribute to relatively nonportable and/or inefficient code either at the core or at the SDL level - SDL does not play nice with Cocoa).
See less See more
1 - 1 of 1 Posts
1 - 1 of 1 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.