[FEATURE TEST] Log in the Editor

Started by eri0o, 18 Mar 2022, 09:26

« previous - next »

eri0o

🚨!!Just to test log, backup things, if you are playing with this!!🚨

⚠️>Download: AGS-3.6.0-LOG_FEATURE.zip<⚠️

So, we currently have logging in the engine, and it's very nice, it has all sorts of options. You can use System.Log function for it. But currently you have to either use AGS through command line or configure it to log to a file.

See log levels at the end of page here: https://adventuregamestudio.github.io/ags-manual/StandardEnums.html#loglevel

Well, I want to add a panel so when you run it through the Editor debugger you can pick up your log messages right there. You have to enable it, in the above build, by clicking on Window -> Engine Log



For now the panel is not very pretty, it's like this:



Anyway, would this be useful to others? Is there anything in particular you want to use in such feature?

Pogwizd

I think this is a great idea. This would make my life way easier, because every single time I want to check how (or if) a variable changes I need to create a gui, add a label and then update it's text all the time. Provided it's a string, if it's float or int I have to parse it and so on and so on. So yeah, having a simple console logging function would be great.

eri0o

Play testing this feature it really shines if you have a second monitor, otherwise you need to play the game windowed - it's fine in single monitor if your game is not HD and your monitor is reasonably big though.

arj0n


Crimson Wizard

#4
By the way, this is somewhat related, but theoretically one could write a stand-alone application that either reads the engine log on the fly, from the file or stdout; or connects to the engine using same "Debugger" interface as editor uses, and then displays all messages in a window. This way one would be able to see game's log even without the editor.

Pajama Sam

Could you also include a list off to the side having all the objects and characters and their coordinates beside them as a window.The log shows where the characters go to but not where they are.
I cant remember all the times when I wished I knew where the character was exactly at a certain moment.
I know this Is a bit extra to ask.Especially since there might not be any room to place a window.

Crimson Wizard

#6
Quote from: Pajama Sam on 19 Mar 2022, 14:55
Could you also include a list off to the side having all the objects and characters and their coordinates

It's going to be a whole separate feature:
1) gather all this information inside the engine and pass it to the debugger (editor);
2) parse in the editor, and arrange as the list or table;
3) display this list somewhere.

I think it's doable though. The question is mostly which data to pass and how to organize visually in a nice way.
This has to allow for expansion, because as soon as it shows coordinates people will ask for other things too.


Otoh, if it's only about knowing where the character walked from when it starts walking, this may be just added to the existing log message.

Pajama Sam

#7
What I imagine it would look like:
The information from the current room editor would be moved to a scrollable window.The objects and characters names would be placed somewhere in the list like what the room editor has.all unused characters and objects would have their default names and have no coordinates.The used objects and characters would have  changing coordinate numbers beside them.I dont know if Im explaning what I imagine it would look like correctly or not.But of course as you said having this would mean more things people would want from it.
how would you add the characters constant position to the log wouldnt it have to be still or it would fill up the log.

Crimson Wizard

#8
Quote from: Pajama Sam on 19 Mar 2022, 15:23
how would you add the characters constant position to the log wouldnt it have to be still or it would fill up the log.

I meant, if you only need this information when character begins to move, then this information may be added to the log message that tells about character starting to walk. It will not be displayed every game frame. This is an option.

If you need to see this information every time coordinate changes, then of course it should not be printed into the log.

Pajama Sam

QuoteIf you need to see this information every time coordinate changes, then of course it should not be printed into the log.
Yes definitely.

eri0o

#10
The Engine has already log groups and log level, so I added this in the logging pane:

||

I also added a debounce, so the received logs are accumulated before showing up in the panel, it appears to work alright too!

SMF spam blocked by CleanTalk