Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Weird Studio IDE Error, a possible bug?

Years of Service
User Offline
Joined: 10th Oct 2019
Posted: 4th Jul 2021 02:00
I came back to a project after being away from it for many months. For a bit of context sometimes I might be developing in Classic other times Studio (Oh how I wish the Studio editor had the same configurability as Geany) with the same source code.

So I open the project in the Studio IDE and after fixing some issues, find that when Run as Debug, the program works as it should. But with a normal Run, it would produce a runtime error in a part of the code that I know is good. No matter what I tried, Debug worked without error, Run would not. And the line of code that was reported for the runtime error didn't really make much sense. It was a divide by zero, but I was sure the variable was non-zero because when stepping through with the Debugger it was fine.

After a lot of commenting out code to narrow down the cause without success, I looked in the folder:


And saw a file named:


with a date much earlier than today. So I delete that file and Run the code again, and it works fine. Yay. (And there isn't a new bytecode.byc created in the folder.)

For some reason, the IDE would Run this old bytecode, without first refreshing it. And what seems weird, is that now there is never a new bytecode.byc created in that folder. If the Studio IDE doesn't need that file, and seems to be working fine without it, why did the bytecode.byc file exist, and why was the IDE referencing it now? (if it is important, shouldn't it update the file before running?)

I mention this story in case it saves a bit of time (it took me over two hours to figure out what was going wrong) for someone else who comes across an error message that doesn't make sense.

Virtual Nomad
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 4th Jul 2021 02:23 Edited at: 4th Jul 2021 03:05
Quote: "C:\Users\susan\AppData\Local\AGKApps\mytestapp\media\"

that's the Write path. take a look at the Read path where there should be a current .byc file.

running that will offer different results vs debug.

after re-reading the original post, i realize that i didnt actually address your point/inquiry.
and, i don't know why it would run .byc from the write folder (first), if that was the case? but i do know Debug isn't well documented. i see "none" in Classic and a short section in the Studio user guide that doesn't mention stuff like this (much less .byc files anywhere).
[My Home] [Community Apps on]
[AGK Resource Directory] [TGC @ GitHub]
[AGK Showcase][Google Forum Search]
Years of Service
User Offline
Joined: 10th Oct 2019
Posted: 4th Jul 2021 07:06
Yes. the bytecode.byc is mysterious. By opening it in a hex viewer, I could see the includes, which made me realise that it was wrong, because I had commented out some of the includes while trying to track down the issue, but they were still there in the .byc file. I get that it is some sort of intermediate code but the way it was being executed while not refecting my edits within the IDE was really strange.

Virtual Nomad, thanks for the Github link, interesting. I will keep in mind the different temp folder when debugging if I have resources that are external from a project.

AGK Developer
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 7th Jul 2021 12:30
VN wrote: ", i don't know why it would run .byc from the write folder (first)"

In AppGameKit, the write folder takes precedence. If it isn't in the write folder, it then checks the work folder.
LynxJSA's web games/quizzes - LynxJSA's Android apps
AGK Resource Directory
"Stick to a single main loop (DO...LOOP) and loop through it every frame.
Do everything inside functions.
Use finite state machines to control your game.
Use lots and lots of source files.

Login to post a reply

Server time is: 2023-05-29 10:15:11
Your offset time is: 2023-05-29 10:15:11