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 Classic Chat / AgkSharp for Windows - General Questions And Feedback

Author
Message
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 12th Feb 2021 21:49 Edited at: 12th Feb 2021 21:50
the app may look closed, but the process still exists...

I waited over 10 minutes and the app with it' pid is still there...

I remember there were so many instance of them in task manager back then...
but now they are invisible some how?

Anyway, I'll test it again on final release...
Maybe it is fix?

Also, will there ever be a AgkWriteLong() & Agk.WriteDouble() function?

Agk basic does not seem to support 64 bit int and float, but c# do?

Would be great if there is!
MadBit
Valued Member
Gold Codemaster
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 13th Feb 2021 10:13
As you can see in the gif. Everything is normal.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 13th Feb 2021 16:33
I know it disappeared from task manager, but visual studio is still claiming the process is opened...
That is what I mean...

I will test it in the coming weeks...
Ortu
DBPro Master
13
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 13th Feb 2021 17:05
I haven't noticed any issues with the process ending. Seems fine on my end
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 14th Feb 2021 07:57 Edited at: 15th Feb 2021 06:30
Unable to copy file "obj\Debug-64\xxx.exe" to "bin\xxx.exe". The process cannot access the file 'bin\xxx.exe' because it is being used by another process. xxx
Could not copy "obj\Debug-64\xxx.exe" to "bin\xxx.exe". Exceeded retry count of 10. Failed. The file is locked by: "xxx.exe (14060)" xxx

This happen by hitting the X on the top right...
It has been over 30 minutes...

The build in red square button terminate the process forcefully, so it work fine...

I end up using the old core.cs because it prevent it from happening 99/100 of the times?
It might still happen with the old core.cs...

If there is a bug, it still happen back then...


You can't even find it in task manager, but even for any .exe file, as long as it is opened, you can't even copy and override them..


I also have the following code after the core.loopAGK() while loop


Environment.Exit(1);
System.Windows.Forms.Application.Exit();

Sometime it end properly, sometime it just hang there until force terminate


EDIT: you might have to keep the app open for maybe 30 minutes to serveral hours before this issue will happen...
If you open the app and close it within a few minutes, it tend not to have this issue!

Did it open a file somewhere and did not close it on exit?

It could be one of the thread not terminating...

opening the .exe again, will just open another app, it is impossible to tell unless you try copying another .exe to override it... or delete it...


Update: due to a lack of reply... I assume you have found something?
MadBit
Valued Member
Gold Codemaster
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 15th Feb 2021 13:15 Edited at: 15th Feb 2021 13:17
No, unfortunately not.
Just have some things to do (AgkSharp, FileExplorer and Nuklear Plugin).
Now I am at my work so can not test it.
When I get home, I will run a program overnight to see what happens.

Does it occur only in debug or also in release?
How is the program started from VS or directly via the exe?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 15th Feb 2021 17:39 Edited at: 15th Feb 2021 18:02
in mode debug64 and release64.

If the app is left on for a while, the process did not fully terminate?
After a few seconds of hitting 'f5' to build and run the app, if you hit the 'x', it will terminate perfectly...
...But there is no way a game app or any app is meant to only run for a few seconds at a time.
Something is still running in the background, if task manager is not reporting the app...
It might be a sub thread somewhere...
There should be over 50?
Not necessary user created as there is none...

I will try a thread terminate loop before it truly hit application.exit...

UPDATE: even after you press 'x' and then press 'f5', it may still work, open and close a few of them, then wait a few minutes and all of a sudden, it will complain about how the app is lock by itself...

Does it need some time after closing to end up locking itself?

UPDATE 2: actually,it might be my fault... it could be SpeechSynthesizer.dispose() not being called on termination... let me test it for a day or two nd get back to this forum...
Ortu
DBPro Master
13
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 17th Feb 2021 01:27
To be fair, i removed/ replaced much of the default core.cs - i don't bother passing hardware input through to agk, i handle all of that in the c# layer
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
MadBit
Valued Member
Gold Codemaster
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 17th Feb 2021 10:56
Ok I have tested it so far could not find any such problems.
Neither in the task manager nor when overwriting the executable file, I could notice abnormalities.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 17th Feb 2021 15:15 Edited at: 17th Feb 2021 15:42
I think it is indeed microsoft SpeechSynthesizer that is not cleaning up properly...

After adding:

SpeechSynthesizer.dispose();

to the end of the code, before Core.Cleanup();, it seem to end properly now...

using the following 2 line of code:

Environment.Exit(1);
System.Windows.Forms.Application.Exit();

does nothing to end it...
...or at least once in a blue moon it does not?
Any thread opened with the program should have been forcefully terminated on calling those 2 line...
But it did not... sometime?

Might be a .net or microsoft problem...

Anyway, Thank You and Sorry!

Also, Is those annoying Agk.writeSomething appending NULL at the end of every string and line, part of the dll?
It is mention in the document, so I end up creating my own namespace for read/write/exists and such...
MadBit
Valued Member
Gold Codemaster
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 18th Feb 2021 17:37
Chmava wrote: "Also, Is those annoying Agk.writeSomething appending NULL at the end of every string and line, part of the dll?
It is mention in the document, so I end up creating my own namespace for read/write/exists and such...
"

The behaviour of the Agk.Write... functions is the same as in Agk-Basic.

However, I recommend using the IO methods of C#. You have to get used to them, but they are more flexible.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Ortu
DBPro Master
13
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 19th Feb 2021 01:18
Agreed, use the benefits c# provides for anything that doesn't directly involve the AppGameKit unique features like graphics or physics etc.
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 19th Feb 2021 12:28 Edited at: 19th Feb 2021 12:29
I did... I have to end up creating my own class and namespace...
Even the graphic and elements of agk required some... 'optimization'... to get over 60 fps...
baxslash
Valued Member
Bronze Codemaster
14
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 4th Mar 2021 15:12
Hi MadBit, I am having problems with sprites and I have no idea why.
I am running through a list of sprites, checking if they exist and if they do I am getting their X, Y and angle.
Stepping through the code I notice that I am getting a 1 for Agk.GetSpriteExists(spr);
Then for:
var x = Agk.GetSpriteXByOffset(spr);
var y = Agk.GetSpriteYByOffset(spr);
...and:
var ang = Agk.GetSpriteAngle(spr);

I get "NaN" or not a number...
Any clues?
Using AppGameKit V2 Tier 1
MadBit
Valued Member
Gold Codemaster
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 4th Mar 2021 19:14
No idea. I have not yet been able to reproduce this error.
I will try the following.
I will randomly generate 5000 sprites in the range of 1 and 7000.
Then read them out as you described.
Let's see what happens.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
Valued Member
Gold Codemaster
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 5th Mar 2021 08:37
So, I have now tested it but could not find anything.
This is the code I tested with.


To help further, I need more details.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
Valued Member
Gold Codemaster
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 6th Mar 2021 06:46
@all: New version to match AppGameKit 2021.02.10 is available.

Equal to AppGameKit Classic Version 2021.02.10
ADD - Agk.Assign(String zipfile) and Agk.Assign(String zipfile, String password) assign a zip file to the search paths for media. you can load media directly out of a zip file.
ADD - Agk.Unassign(String zipfile) remove a zip file from the search path list.
ADD - Agk.ClearAssign() to clear the assign list.

Download here


Description:
Additional functions for media encryption.

int AssignZip(string zipfilename);
Adds a zip archive to the search path for files. For example, if the file 'my.zip' is added with AssignZip("my.zip").
Then all commands that load assets first search for the assets in the directories provided by AGK. If nothing is
found there, the corresponding asset is searched for in the zip file. That is, if LoadImage(1, "my_image.png") does
not find anything in the usual directories. The Zip file is searched for 'my_image.png'.

There can also be a directory structure in the zip file.So that files are also loaded in this way
LoadImage(1, "images/my_image.png").

zipfilename -> The path to the zip file to assign.



int AssignZip(string zipfilename, string password);
Adds a zip archive to the search path for files. For example, if the file 'my.zip' is added with AssignZip("my.zip").
Then all commands that load assets first search for the assets in the directories provided by AGK. If nothing is
found there, the corresponding asset is searched for in the zip file. That is, if LoadImage(1, "my_image.png") does
not find anything in the usual directories. The Zip file is searched for 'my_image.png'.

There can also be a directory structure in the zip file.So that files are also loaded in this way
LoadImage(1, "images/my_image.png").

If you have encrypted your archive with a password, it is necessary to pass your password in the password parameter.It is
not recommended to pass the password directly as a parameter.Instead, it is good to store the password in a secure string and pass
it later.It is even better if the password string is composed of several chars or maybe you use an algorithm.

zipfilename -> The path to the zip file to assign.
password -> The password that was used to create the zip file.


void UnassignZip(string zipfilename);
This function removes an entry from the assignment list.The name must be the same as
the name used to assign it to the list.

zipfilename -- The name of the zip file to be removed from the list.



void ClearAssignList();
This resets the entire assignment list. All entries in the list are deleted.

Recommended workflow:
All media files you use should be located in the media folder during the development of the app.
When the app is finally published, the entire contents of the media folder can be zipped.
The directory structure created during development should be retained in the zip file.
But be careful when using the SetCurrentFolder/SetFolder command. It does not work inside a zip-file.
And you cannot write to the zip file.
Finally, this zip-file must be included with one of the Assign commands. Further changes to the code should not be necessary.

Hint:
Several zip files can also be assigned. These are then searched one after the other for the files to be loaded.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Ortu
DBPro Master
13
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 7th Mar 2021 18:31
Wow, nice!
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Mar 2021 06:02 Edited at: 10th Mar 2021 06:11
Hi,

How do you get the app to use more than ~5 - 8% of the cpu?
initially in the beginning, without any code, It was over 3000 fps, but still using about 5% - 15%...
Now it is about 60 fps at... around 5% - 8 %...

FPS is set to 'unlimited' using '0'!
and accurate is set to false...

Is there something I am missing?


UPDATE: It seems that is a problem with the forum.. it claim 'Unknow Error' or something, and it cause many duplicated post to happen! I can't remove them probably due to permission or or rank!
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Mar 2021 06:02 Edited at: 10th Mar 2021 06:11
Hi,

How do you get the app to use more than ~5 - 8% of the cpu?
initially in the beginning, without any code, It was over 3000 fps, but still using about 5% - 15%...
Now it is about 60 fps at... around 5% - 8 %...

FPS is set to 'unlimited' using '0'!
and accurate is set to false...

Is there something I am missing?


UPDATE: It seems that is a problem with the forum.. it claim 'Unknow Error' or something, and it cause many duplicated post to happen! I can't remove them probably due to permission or or rank!
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Mar 2021 06:02 Edited at: 10th Mar 2021 06:12
Hi,

How do you get the app to use more than ~5 - 8% of the cpu?
initially in the beginning, without any code, It was over 3000 fps, but still using about 5% - 15%...
Now it is about 60 fps at... around 5% - 8 %...

FPS is set to 'unlimited' using '0'!
and accurate is set to false...

Is there something I am missing?


UPDATE: It seems that is a problem with the forum.. it claim 'Unknow Error' or something, and it cause many duplicated post to happen! I can't remove them probably due to permission or or rank!
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 10th Mar 2021 06:02 Edited at: 10th Mar 2021 06:12
Hi,

How do you get the app to use more than ~5 - 8% of the cpu?
initially in the beginning, without any code, It was over 3000 fps, but still using about 5% - 15%...
Now it is about 60 fps at... around 5% - 8 %...

FPS is set to 'unlimited' using '0'!
and accurate is set to false...

Is there something I am missing?


UPDATE: It seems that is a problem with the forum.. it claim 'Unknow Error' or something, and it cause many duplicated post to happen! I can't remove them probably due to permission or or rank!
MadBit
Valued Member
Gold Codemaster
11
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 10th Mar 2021 18:57 Edited at: 10th Mar 2021 18:59
Try using Agk.SetSyncRate instead of Agk.SetVSync.

In full screen mode, you must check your driver settings. VSync must also be switched off.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Ortu
DBPro Master
13
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 11th Mar 2021 00:49
Agk is single threaded, it can only use 1 core.

On a 4 core processor that would cap out at 25%, 8 core at 13% and realistically less because your not likely to get the entire core to yourself

You can do some multithreading in an agksharp app on the c# side as long as you only handle agk data like images, objects, rendering, physics, etc on the main thread
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
blink0k
Moderator
8
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Mar 2021 00:58
Keep in mind that AppGameKit uses multi-threading for 3D physics
Chmava
7
Years of Service
User Offline
Joined: 20th Jun 2013
Location:
Posted: 11th Mar 2021 04:54 Edited at: 11th Mar 2021 05:08
Hi,

vsync is not use...

Also... not a single thread, with the program running, despite spiking over 80%... due to some clean up, i think?
Ever use more than 10 or 15% of a single thread!
There is 4 thread spiking...

hench I am asking...

The gpu is not using pass 15% either...

Also, in AppGameKit basic, that main thread is indeed a constant 70%+ usage at over 300 fps!
...and that is basic code...
On default 'new project' code, it is over 5000 fps instead of just over 3000 fps...

Hench I am confuse...
I have attached a picture to prove not a single thread is being use pass 50% by default...



Edit: is the program switching between thread... is this a OS or backend code problem?

Login to post a reply

Server time is: 2021-05-07 16:51:56
Your offset time is: 2021-05-07 16:51:56