Subtle "bug" in interpreter

sonneveld (note: this is for Sierra's interpreter but I think strange things will happen in NAGI too. )

Try this code in a template game:

if (said("look")) {
move.obj(o0, 20, 100, 0, f60);
}


type in "look" and your ego will move to the left hand side of the screen where x=20. Easy hey?

now replace it with this:

if (said("look")) {
move.obj(o0, 20, 100, 0, f60);
reverse.loop(o0, f140);
}


now your ego will move to the right hand side of the screen where x=140! Same number as the end flag for reverse.loop right? What's going on here?

It's hopefully well known that you can only call one of these for an animated object at a time:

move.obj()/move.obj.v()
wander()
follow.ego()

However, reverse.loop() and end.of.loop() ALSO share the area of memory as the movement commands above.

The problem is if you set reverse.loop()/end.of.loop() on your animated object and it's moving towards something with move.obj()/move.obj.v(), it'll change its x-direction but just keep on moving. even stranger things will happen with wander() and follow.ego()

Conclusion:

If you call any of these functions, wait until they're finished or cancel them before you call another one for the same animated object:

move.obj()/move.obj.v()
wander()
follow.ego()
reverse.loop()
end.of.loop()

- Nick
smartguy240 how come i cant close NAGI very often and have to do it in the task manager? it dosent close like normal progs..and then it locks up and wont close at all...
sonneveld NAGI doesn't honour any window closing signals. I should fix that for the next upcoming version.

Any comments on the actual *sierra* bug though? :)

- Nick
Kon-Tiki How come that you found this out? It seems irrelevant to try that :P

-Kon-Tiki-
sonneveld I was looking into converting agi save games to use an xml format and came up marking up animated objects. Animated objects in sierra's interpreter have a union of data for when the object is in different modes.

Anyway, I was checking to make sure that reverse.loop/end.of.loop didn't affect move.obj (since it shares the same area) with that example code but it turns out it does.

- Nick

union: different data types can share the same space in memory.. but you can only use one at a time because the data for the other items are overwritten.
Eero R Patrick, you can close NAGI by pressing Alt-Z or quitting in game's menu...
HwM I didn't know about this bug, but there is a (kinda) similiar 'bug', in both AGI and NAGI... In Space Quest, room/logic 5; When touching the signal line, Roger get lifted up (on purpose). However, when you stop right on the signal line, Roger will be standing somewhere completely else (not really random, it's mostly upper-right/lower-right part of the screen)... It's not hard to reproduce, but it stops working (the bug, not the game) after a couple of tries (at least it seems like it)... But I haven't checked the code, so perhaps it's just some iffy programming...
Zero2003 when did you guys find this bug?????
AGI1122 Why is "when" it was found important?
SGreenslade Because fans find it amazing when they see bugs in innovative "pioneer" software that has set the precedent for thousands of future games. :P

Sort of like when someone discovers what "actually" happened in a legend.
Brian_Provinciano Interesting! I guess you'll have to leave the bug in NAGI, or make a new command line option, since fixing the bug might make Sierra's games run incorrectly.

I guess one thing now might be for you to take the current NAGI code and turn it into a second project which is an extented adventure game interpreter based off the original AGI, but with more features. Just an idea, since NAGI is complete after all.
sonneveld Well, yeah.. I'll have to modify the current nagi to keep up with this bug i've found.

I've been thinking about extensions, but there's still stuff to add and still keep within standard agi:

- xml saves, game list (+converter for older games)
- amiga screen transitions
- current agi extensions.. palette changes
- screenshots
- general cleaning up of code
- extra debugging tools
- patches for copy protection/age check
- extra amiga cmds.

- Nick