Ok I've worked on it some more. In the process I had to move to VC8, because that seemed to be the only way to edit the GUI. As a result I had to work with the source of the SF project, since I could not get Luke's code working in VC8. The result is a unstable release with a pretty stable bot. I'm sorry about that. If you want to compile the stuff yourself you can download the sources from sourceforge. Linux users don't need to bother for the bot, I've been told the GUI is windowns only. I will try to create a crossplatform GUI in the future, but right now I simply don't know how.
That said,
here is the new binary for BasicBot 0.2.1
The emulator is rather shakey at the moment (for instance, dont turn off sound... ;). The bot seems to work pretty good though, so as long as you don't try anything odd with the emulator yourself, the bot should work fine.
Changes are below. It'll be the last release for a couple of days at least. Don't know when I'll have the time to work on it again, but I will.
As said before, this is _not_ an official release! It's meant to test the bot and get feedback, bugreports and perhaps wishes FOR THE BOT...
--
Changelog 0.2.1:
Built binary is the work in progress at fceultra.sourceforge.net
No guarantuees are made that any of the other stuff actually works. In fact, I'm quite certain most of it doesn't.
This is not an official release! It's a test-release intended to test the Basic Bot part of the program, and only that.
You have been warned.
- Change - Commands - ')' now also resets hexmode and negmode.
- Change - Source - Updated the source to no longer supply arguments that I threw out the previous time.
- Change - Source - Cleaned up comments, commented entire document.
- Change - Source - Removed several redundant pieces of code.
- Change - Commands - Removed ram().
- Change - Behaviour - Previously, the goal would be reached if the result of the "end when" line would be greater then a random number between 0 and 1000 (there was actually a chance for it to be impossible to reach its goal: when that random number was 1000). I don't see the added value of the random part, you either reach your goal or you dont. If I hear any protest this can be put back in easily.
- Fixed - Commands - "stop" now works.
- Fixed - Errors - All errors now stop future attempts (until the run button is pressed again).
- Change - Source - Used defines for max frames, codelength and resultwindowsize. Now we can easily change these limits.
- Change - Source - Changed several ints to bools, when they were used as such anyways.
- Change - Behaviour - Clears debug when starting.
- Change - Source - The code lengths are currently set to 1k each. I've changed this to one variable (hardcoded), however this would mean paying attention to loading older files. Especially if we're to decreasing this size. Size will be increased in the future.
- Added - Errors - New error introduced: 1004. Thrown when the occurences of '(' is not the same as the number of ')', same for '?' and ':'. The characters () and :? always need to be pairs. The code does not explicitly check proper nesting (yet...), but I think that's done implicitly by parsing.
- Fixed - Behaviour - Negative numbers work, prefix 'n' does too. Something like "n5+6 echo" shows 1, "n5 -1" shows -6. I forgot that C has signed numbers :D
- Added - Commands - Added memw(n), which reads two bytes from the memory: ((mem(n)<<8)+(mem(n+1))), memh(n) and meml(n) read half a byte (a nibble) (they (value&0xF0)>>8 and value&0x0F the values before returning). Note that the memh() will also return values 0-15. Is there anyone who thinks memi() for 32bit numbers is really usefull?
- Added - Commands - Added j and k. j returns the loopcounter of a nested loop, k returns teh loopcounter of a nested loop inside a nested loop.
- Change - Commands - You can now nest loop() twice, so you can do: "5 loop(i loop(j loop(k echo)))". Any more loops will still result in 1002. To check: "rc(10) 5 loop(5 loop(5 loop(5 ac(10)))) c(10) echo" should be 625 (5x5x5x5).
- Change - Errors - Error 1002 is now thrown when nesting loops 3+ deep.
- Added - Commands - Added value. Completely transparent, like a nop/noop (no-operation). Can be used to use in iif's (1?500:value). Note that "value echo" is the same as "echo", value doesn't change anything, just improves readability. It is accepted as number though (unlike echo).
- Change - GUI - Redesigned it a little bit. Still not quite the way I want it though.
- Added - GUI - Refresh button. When the bot is running and you want to change parameters to see whether it improves, you can change the code in the GUI and press refresh. The bot will then refresh its internal code with the GUI.
- Added - GUI - Botmode button. Toggles "external mode" on/off.
- Added - GUI - Added some more information. It shows the score of the last attempt. There is a debug section and an error section. The averages for score and tie1-3 are shown next to them.
- Change - Source - Had to change to vc8, because I know no other way to change the GUI. As a result I can no longer compile Luke's old code, but am stuck with the SF project files. They work, but may be even more buggy.
- Added - Commands - Added "lastbutton", or "lb" short, which returns the button pressed in the previous frame. This will not work for the last frame pressed before the save-state, so at the first frame, this value is always 0.
- Change - Behaviour - BB can now compute up to 2k frames (was 1k). I intend to enlarge this number greatly, but need to check out possible memory issues before I do.
Known issues:
- Player radiobutton is not selected on load. Has no effect on the code, player 1 is set by default.
- External input button starts with "toggle" instead of its state.
- External input button text will not be updated if the external input is toggled anywhere else (currently impossible, but hey).
- Check button is disabled because it's too much code now, and will be much easier to do later.
- Load behaves like update: when the code is running and you hit load, it will put these values to the memory and the GUI. This is a designflaw, but you'll have to live with it.
- Hexmode/Negmode issue remains the same, except for ')', as mentioned.
- Old botfiles, for whoever has them anyways, will load except for the extra2 field. You'll need to paste this into the one field.
- All fields still max out at about 1k, will be enlarged in a future release.
- Code does not check for the presence of an argument for functions. If no argument is present, it will take the value 0.