Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#3058 closed defect (fixed)

AGI: Space Trek sprite duplication

Reported by: sev- Owned by: SF/buddha_
Priority: normal Component: Engine: AGI
Version: Keywords: script
Cc: Game: AGI Fanmade

Description

In Space Trek, on the third screen (where the Borg are assimilating Earth), if you type "foo" (or anything unrecognized) and press Enter, the Borg cube and the Earth will be duplicated on the other side of the screen.

Taken from Sarien bugreports

Ticket imported from: #1659209. Ticket imported from: bugs/3058.

Change History (17)

comment:1 by fingolfin, 17 years ago

Has this been assigned to dsx on purpose? If so. then: dsx are you working on this, is there any progress? Otherwise, it should be unassigned and put back into the pool.

comment:2 by SF/dsx, 17 years ago

Owner: SF/dsx removed

comment:3 by SF/dsx, 17 years ago

Oops, didn't realise this was assigned to me. No, I'm not working on it.

comment:4 by sev-, 16 years ago

Owner: set to SF/buddha_

comment:5 by sev-, 16 years ago

Kari, please, take a look into it. It works well with other AGI implementations.

comment:6 by SF/buddha_, 16 years ago

Haven't looked into this yet but adding a thought here:

I remember that at http://www.agigames.com/agiwiki/index.php/Space_Trek there was a mention that Space Trek works correctly with some 2.4xx version of the PC AGI interpreter but not with some newer one (Don't remember what number, if it was mentioned). The AGI Wiki is currently down so that's why I try to use my fallible memory here :). Archive.org didn't help either, tried it.

comment:7 by SF/buddha_, 16 years ago

Keywords: script added

comment:8 by SF/buddha_, 16 years ago

The logic file for the third screen (i.e. when first encountering the Borg) is logic.004. I think these script commands are the culprits here:

position(o1, 205, 140); // Borg ship position(o2, 254, 150); // Earth

Those commands try to position the sprites outside of the 160x200 main screen by using horizontal positions over 160.

This isn't the only place where such high values for horizontal positions are used, I spotted at least the following command used in logic.011:

position(Ego, 225, 99);

So I see this bug as a matter of offending (i.e. wrongly written) script data.

I checked PC AGI 2.917's cmdPosition's implementation and I didn't see any clipping, saturating, clamping or anything like that done to the input coordinates there.

comment:9 by SF/buddha_, 16 years ago

Owner: changed from SF/buddha_ to sev-

comment:10 by SF/buddha_, 16 years ago

Eugene, I'd appreciate your thoughts on fixing this bug.

comment:11 by fingolfin, 16 years ago

Some questions (I know little about AGI, so excuse me if they are stupid):

* You mentioned that there were reports about older PC AGI versions (2.4xx) working correctly with those scripts. Did you check their code? Also, does the bug occur with the original engine, too (including 2.917) ? * How does NAGI handle this? Is it affected by the bug, too? * Did you try what happens if you e.g. just clamp?

comment:12 by SF/buddha_, 16 years ago

I checked PC AGI 2.440's disassembly a little and it seems that there might be some clipping done there, not sure though (I didn't have a documented disassembly of PC AGI 2.440 and the parts that I identified as cmdPosition and cmdPositionV made some function calls that made some functions calls etc so I didn't dwell that deep into them. But at least there's a lot more going on in there than in the PC AGI 2.917's cmdPosition and cmdPositionV).

Running under NAGI v2.06 this particular bug isn't reproduced but instead in the first screen the Klingon ship is nowhere to be seen.

Running under PC AGI 2.440 (Or at least I hope so as I copied all sorts of files to the directory with the data files) this bug is not reproduced either. As a sidenote the Klingon ship in the first screen gets shown in a different position than on the first run if you restart the game (e.g. using F9 & Enter).

comment:13 by SF/buddha_, 16 years ago

Owner: changed from sev- to SF/buddha_

comment:14 by SF/buddha_, 16 years ago

Status: newclosed

comment:15 by SF/buddha_, 16 years ago

Fixed in the trunk by r30190 and in branch-0-11-0 by r30192 by using a workaround that makes position and position.v-commands use coordinate clipping for Space Trek.

comment:16 by SF/buddha_, 16 years ago

Resolution: fixed

comment:17 by SF/buddha_, 16 years ago

BTW I got to the AGI Wiki's Space Trek page now by using Google's cache (Just search with these words: space trek agi wiki). It reads:

<snip> Note: This game does not work properly with 2.9 versions of the interpreter. Although the game will run, certain view resources do not appear on the screen when they are supposed to.

Interpreter version 2.440 is known to work with this game. </snip>

Note: See TracTickets for help on using tickets.