Author Topic: C# AGI Interpreter  (Read 50848 times)

0 Members and 1 Guest are viewing this topic.

Offline Collector

Re: C# AGI Interpreter
« Reply #60 on: March 06, 2017, 11:41:28 AM »
Be sure to add it to the AGI Wiki as well.
KQII Remake Pic

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #61 on: March 06, 2017, 02:38:05 PM »
It appears that I don't have an account for either wiki at the moment. I'll email sev for the scummvm one. Can you check the AGI wiki one? I thought I had an account, in fact I have the email with the details from back in 2015, but it's saying an account by that name doesn't exist. I probably let it expire.

Edit: I've got the scummvm wiki account now, thanks to sev. Probably won't have a chance to start adding anything until mid-week, although I might surprise myself.
« Last Edit: March 06, 2017, 03:13:16 PM by lance.ewing »

Offline Collector

Re: C# AGI Interpreter
« Reply #62 on: March 06, 2017, 04:44:59 PM »
Yes, you do have an account. Perhaps you forgot your password?
KQII Remake Pic

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #63 on: March 07, 2017, 01:39:52 PM »
It seems I forgot my password and my user name. All working now. Thanks.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #64 on: March 07, 2017, 02:03:34 PM »
I'm mentally scoping out the Saved Game format page. I've noticed that David Symonds slot a link to the page in between sections 9 and 10 on the scummvm wiki:

http://wiki.scummvm.org/index.php/AGI/Specifications#Savegame_files

I think I'm going to move that as part of the work. I guess it could become a section numbered 14 for the purposes of the scummvm AGI specs.

It would be nice to keep the AGI Wiki in sync. How do you feel about incorporating sections 12 and 13 from the scummvm wiki version of the AGI specs in to your wiki and then I can put Saved Games as section 14 on both wikis? I'm in two minds about it.

I was also debating whether Saved Games lived under one of the existing sections rather than as its own section but couldn't decide what section was most appropriate. Perhaps 11.4 under Other Information?

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #65 on: March 08, 2017, 03:14:11 PM »
Be sure to add it to the AGI Wiki as well.

I notice that you've been updating the AGI specs on the AGI Wiki and have introduced a copy of the Savegame Files page from the scummvm wiki. I'll make a start tonight on filling that page out with the full details of the format.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #66 on: March 08, 2017, 06:50:28 PM »
I think I've done everything except for the Animated Objects section. That one is going to take a while and it's time to rest for this evening. Progress is here:

http://agiwiki.sierrahelp.com/index.php?title=AGI_Specifications:_Chapter_10_-_Savegame_Files

Offline Collector

Re: C# AGI Interpreter
« Reply #67 on: March 08, 2017, 11:35:56 PM »
Great! I noticed that the savegame entry on the ScummVM Wiki was little more than a stub that was stuck into the old AGI documentation without adjusting the chapter numbering, so I added the stub for you to flesh out and integrated it into the documentation better.
KQII Remake Pic

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #68 on: March 10, 2017, 06:13:47 PM »
I've completed the Animated Objects section of the saved game format page this evening. I probably need to proof read it a couple more times, and then add another section at the bottom explaining a few things that are done by the interpreter as part of the restoring of a saved game file. When I've got it to what I think is a finished state, I'll copy it over to the scummvm wiki.

Offline AGKorson

Re: C# AGI Interpreter
« Reply #69 on: March 12, 2017, 07:06:29 PM »
Lance, have you looked at Nick Sonneveld's NAGI source files? NAGI was probably the best modern interpreter ever written, and Nick's source code was really easy to follow. There might be a lot of stuff you could borrow from there to finish your C# interpreter faster.

I used his source code a lot while working on WinAGI, and I also tinkered around with it, adding support for changing color pallets and extended fonts.

He used a resource called SDL for graphics and sound, so there might be some lower level functions that won't necessarily be useful. But if you haven't looked at it, it just might make your job easier.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #70 on: March 12, 2017, 07:33:23 PM »
No, I haven't had a look at the NAGI source code yet. I've spent a long time looking at the fragments of original AGI interpreter source code though. It is really amazing that so much of the original interpreter code was found in the unused parts of a game disk. Usually what you find in the slack space on those disks is quite fragmented, but these are whole files and quite a lot of them as well. Apparently it came from an original 720K SQ2 v2.0D game disk. If you haven't yet had a look at that source, there's a post in these forums with a zip attached containing all the source that was extracted.

I've already implemented quite a high percentage of the interpreter. I don't think my rendering is 100% accurate though for some of the non-standard features that are possible. Over the past couple of weeks I've been trying all sorts of things to see what is possible, things that scummvm crashes with but the original interpreter will quite happily do. My interpreter doesn't handle them either. Haven't tried NAGI, but that would be interesting as a comparison.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #71 on: March 18, 2017, 06:04:41 AM »
I've been thinking that I should probably call this new C# AGI interpreter something different than MEKA. Originally the idea started out as being a conversion of my old C interpreter code to C#, but that's not really how it panned out. I've ended up building it from scratch pretty much but using about four different sources for the information. I did, however, call the project MEKA within the repo. So I'm now considering changing that to something else. The original M.E.K.A, although built solely by me, used the initials of the surnames of Joakim M?ller, Peter Kelly, and myself. I did that as an acknowledgement to their contribution back in the early days when it was pretty much just the three of us that split up the work of building tools and creating the AGI specs, etc. It doesn't seem appropriate for the new interpreter though. So open to some ideas about what to call it.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #72 on: March 22, 2017, 05:56:58 PM »
AGILE it is then.

Offline MusicallyInspired

Re: C# AGI Interpreter
« Reply #73 on: March 22, 2017, 06:24:53 PM »
Hey that's great! I like that. It's perfect. I couldn't think of anything.
Brass Lantern Prop Competition

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #74 on: March 26, 2017, 11:41:32 AM »
I believe I've got the saved game "restore" functionality working in a compatible way to the original games (assuming they're between 2.4XX and 2.9XX). I actually got that working before I began working on the "save" function, which I realise seems the wrong way around. The way I was testing it was to save games with the original KQ1 and then loading them in my interpreter. There are probably a few edge case bugs in there somewhere that will come out at some point, but the core restore state seems to be working.

The "save" function is coming along. I've done the first two sections, i.e. the general state vars and the animated objects. I'm now working through the inventory objects, which is leading me in to implementing the Encode method of the Objects Resource in the AGI Library. That should therefore be reusable for the IDE. It has to support an Encode in plain form and encrypted form since the saved games store it without the Avis Durgan XOR but most games store the OBJECT file with the Avis Durgan XOR. The third section of the saved game file, i.e inventory items, is basically the unencrypted OBJECT file without the 3 byte header. So for the third section, I'll just ask the AGI Library for the unencrypted form and then write out everything after the first 3 bytes.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.096 seconds with 22 queries.