[EDITOR BUG?] Date Time Tag and System Clock

Started by Yeppoh, Wed 02/10/2013 22:51:32

Previous topic - Next topic

Yeppoh

I've found a pretty strange behaviour while tinkering with the computer clock and compiling room scripts. This was done with the Draconian version of the AGS editor, but I suspect it is in every version past 3.0.

I was testing a feature in my game which needed to check the clock. So what I did was this :

I set my clock and date four days later than the current time the test was done. In this case I set the time at the 5th October while I did the test the 1st october (the real actual date). It worked fine. I forgot the set the date time back while I went on working on some other parts of the code.

I added a global variable in a script header and launched the compiler recompiling all the rooms, and everything worked fine. I didn't change anything in the room scripts at this stage.

I quit the editor. Backed up the game files. And I noticed I didn't set the time to the normal date, so I did put the date back to the 1st.

The next day I began working on the game again, on a room script this time. And that's when something went wonky.

When I launched the game to test what I added (room global struct instances in this case), the room script didn't work. And by didn't work, I mean the script ran without taking into account the changes. At first I was surprised. Maybe I wrote something wrong. Does the struct instances do something weird in the script? But whatever I did the script didn't seem to take into account my changes. So I tried breaking the script on purpose by writing wrong syntaxes like < thisisanotdefinedfunction{);==null >, removing variable definitions, even commenting the whole script. And to my surprise, the compiler didn't return any error and the game ran everytime. The room worked fine, but as if it was using a version that was never changed. I tested the same in the other room scripts. It was the same.

My first response to that was to "Rebuild all files" and so I did. After that was done I launched the game. Though it was recompiling all the rooms again(?), the game ran but it still didn't save my changes. So maybe the editor glitched somewhere, and I restarted it. At restarting the editor crashed, and crashed at every attempt. So suspecting something was wrong memory side, I restarted the computer.

After restarting the computer, the editor ran again and I loaded my game. Everything looked fine, so I pressed F5 to check further. And for some reasons, it was rebuilding all rooms again. Then, the horror, everytime I ran the game, everytime it was rebuilding ALL rooms AGAIN. Even if I didn't change anything, it was rebuilding all rooms. I can't stress that enough how annoying that would become. So since it was impossible to work on the game like that and suspecting I broke something, I had to use the backup I did the day earlier.

So I began working on a copy of the backup, and the problem reproduced. The room scripts didn't save the changes, while in the non-room scripts the changes were saves. Trying to figure out the reason, I discovered all the .CRM files for the room were timetagged at the 5th october; the fake date when I did the test the previous day. So I began to hypothesize : "Wait. The editor doesn't seem to save the changes I do in the room scripts. Is it possible it only looks on the dates to check if a script was changed?"

Therefore I set my date time clock at the 6th october, and lo and behold, the compiler finally saw the syntax errors and saved the changes I did in the room script again!

I guess I can tell this can be a critical bug and somewhat I can guess how AGS knows when a script had changes. Though it has a kind of convoluted way to reproduce (convoluted stuff are my thing to be honest).

I've found the solution to my problem, though I have to wait until past the 5th october before I can work on the game without breaking the editor.

monkey0506

I don't know how you posted this two days ago and I still haven't seen it till now.. Stop time travelling you fool! :=

If the behavior is reproducible then it definitely sounds like a rather serious bug. Especially considering that "Rebuild all files" didn't resolve it. I'm always very paranoid about incremental builds, but a full rebuild failing this way is serious business. :-X

I'm a bit tied up in other projects, but I'll definitely look into it when I have a chance.

SMF spam blocked by CleanTalk