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
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 30th Oct 2018 20:38
Sure!

Thank you very much!
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 31st Oct 2018 11:39
That's weird. I assumed I already integrated the fix in the template.

Ok, mouse and keyboard events are only sent to Agk when the panel also gets the focus. Therefore, as you already noticed, it is necessary to give the focus to the panel. In order to change the focus on the panel, we need an OnClick method to do this. Because it doesn't happen automatically on the panel like it does on a button.
Here's the modified code from Core.cs. The new keyboard codes are already in here. But not for the enumerator functions. They will only be available after the next update.
That means.
Agk.GetRawKeyPressed(257) works
Agk.GetRawLastKey() works
but
Agk.GetRawKeyPressed(EKey.SHIFTL) does not work yet
Agk.GetRawLastKeyEnum() does not work yet

With these changes you need two more assemblies. (WindowsBase and PresentationCore)
Right-click 'References' -> Add References
Folder 'Assemblies' - search and mark the required assemblies.

Core.cs

Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 1st Nov 2018 16:37
I tested out and the left shift now works as well as the panel focus. Good job! But key(17) (control) does not work, maybe some others may not work and the an interesting thing with arrowkeys. I have arrowkeys added in my project and instead of making contact in AppGameKit, makes contact with windows forms by hovering some buttons in my interface.
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 2nd Nov 2018 05:14
Keyboard codes 16, 17 and 18 (Shift, ctrl and alt) are now divided into left and right. Now you have to take the higher values. 257 - 262. See here.

That with the arrow keys is different. For these reasons I didn't loop through the keyboard input. Because in a Windows Form project the input is usually edited by the Form object.

If you want to work with the arrow keys you have to overwrite the method ProcessCmdKey from the Form object.

I can give you a codeSnippet later. I'm on my way to work now.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 2nd Nov 2018 09:54
Alright!

So the next updates procedure will be the DLL's and Core.cs?
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 2nd Nov 2018 14:06
This is bigger. I have to take a closer look. For now you can work with this method.

Copy in the application class (AgkFormTemplate).
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 3rd Nov 2018 08:18 Edited at: 3rd Nov 2018 08:29
So I think I've found an acceptable solution. Is that OK?

AgkFormTemplate.cs


EDIT:
The KeyCodes 16, 17 and 18 do not work.
use instead

16 => 257 (left) 258 (right) Shift
17 => 259 (left) 260 (right) Ctrl
18 => 261 (left) 262 (right) Alt

when I fix it. There will be an update of the DLL.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
AFA
11
Years of Service
User Offline
Joined: 29th May 2012
Location: Germany
Posted: 3rd Nov 2018 10:27
First of all I want to say how happy I am to see that you have built something this awesome.

Thanks to the step by step tutorial (Visual Studio) and the templates it really was easy to follow the steps and see how everything works. And this for somebody like me having no prior-experience with Visual Studio.

After diving into it I see great potential for this and hope that agk will officially support this.

Personally the biggest advantage of agk is the combination of simple coding without having any trouble no matter which platform it is for. Locking at Tier 2 we lose this advantage but gain processing speed, right?

So, I would like to have C sharp as a kind of "Tier 1 B" with multiple platform ablitity !
Is this technically possible for agk ?

Because somewhere agk said, OOP combined with multiple platform ability would not be possible. Where I have to say I'm not sure if and how extensive the OOP-functionality C sharp will be needed.


If I may dream once, we could have a
Tier 1 - family with our agk-basic but also C#, Python or Kotlin generating bytecode and running with the interpreter solution and a
Tier 2 - family with C++

The Tier 1 - family would then be a big competitor of Xamarin (what I do not like at all).
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 4th Nov 2018 05:19
@AFA
Thank you AFA.

AFA wrote: "Personally the biggest advantage of agk is the combination of simple coding without having any trouble no matter which platform it is for. Locking at Tier 2 we lose this advantage but gain processing speed, right?"

This is right. With c++ you can also develop for all other platforms. Templates and tutorials already exist, but the effort is much higher than in Tier 1.

AFA wrote: "Because somewhere agk said, OOP combined with multiple platform ability would not be possible. Where I have to say I'm not sure if and how extensive the OOP-functionality C sharp will be needed."

C-Sharp exists on Windows, Linux and MacOS. With Xamarin also for mobile platforms. I think that OOP (C#) is possible for multiple platforms.

@MateiSoft
After I have browsed in the Tier2 code. I came to the result that the DLL doesn't have to be updated to solve the input problem.

Here are the new Core.cs and AgkFormTemplate.cs so the keyboard input should work as expected.

AgkFormTemplate.cs


Core.cs
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 4th Nov 2018 10:46
Madbit, so glad to see a new fix! I'll come back to you, a second after I test your fix out! Can't wait!
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 11th Nov 2018 07:14
Hi,
I just updated AgkSharp (Templates + Binaries) to the current AppGameKit 2018.11.08 version.
Thanks again to MateiSoft for his persistent testing.

Download here.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 11th Nov 2018 11:11
And thank you for making such an awesome job!

Sorry for not responding regarding the fix. I couldn't pasted in. I was captured with the development of my project. The update is a must, so I will upgrade and come back.
www.alexmatei.com
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 11th Nov 2018 12:34
Upgrade just the binaries, right?
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 11th Nov 2018 12:47
For you, yes. Would be enough but I made some small changes to Core.cs. You might be able to update that as well. But it's not absolutely necessary.
All others who don't have the method ProcessCmdKey in AgkFormTemplate.cs should add it.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 11th Nov 2018 16:45
Ok, so I copied the x64 DLLs to my project and the Core.cs.

The new commands are not present and still the problem with arrowkeys persists. Maybe this time I am doing something wrong. Copied the DLLs where they where initially (near the final executables) and Core.cs near the solution file.
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 11th Nov 2018 20:22
Uhhm,
so sooooooorry!

I have only added the orders of Preben. I missed the others. Will be submitted as soon as possible.

But the keyboard commands work like in AGK-Tier1. Note this - when the last input is retrieved (GetRawLastKey), it always returns 16, 17 and 18 for the left and right side of the modification keys (Shift, Ctrl, Alt). You always only have the chance to differentiate between left and right in the direct query of the keys (GetRawKeyState). But this is also the case in Agk-Tier1.I wanted to stick to it as it is in Agk-Basic.

And remember. Before Agk can receive the inputs, the panel must first get the focus (click on it).
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 11th Nov 2018 21:37
So, I updated the Windows templates and binaries. Linux comes later.
I hope it works so far.

You can now download the new version.

Please report all bugs and other problems.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 12th Nov 2018 10:08
The new commands are present. I will test out the keys also and come back in a couple of hours.
www.alexmatei.com
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 12th Nov 2018 11:50
Question: Did you added errors when something goes wrong, like in AppGameKit Basic to literraly say the problem?
www.alexmatei.com
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 12th Nov 2018 12:21
The panel does not focus when clicked.

m_panel.focus if it was necessary in Core.cs, does not exist.

I tested out the arrowkeys and the other keys. The other keys don't work and the arrowkeys selects the buttons from the interface.
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 12th Nov 2018 13:42
Okay. That's what happens when I work with 5 systems (2 of them Linux) without git. If you still have the last version. So the first of the 2018-11-11 version. use the Core.cs from there.
When I'm at home I'll fix it again. (how embarrassing)

Oh, the general error message should also be integrated. Just like in Tier1.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 12th Nov 2018 16:56
Ok - It is done. You can download it again.

For testing maybe this



I hope it works satisfactorily now.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 12th Nov 2018 18:46
On the website the date is 11November. Is it updated though?
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 12th Nov 2018 20:05
I was too lazy to change that. I hope that doesn't bother.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 12th Nov 2018 20:39
Not at all. I thought it automatically updates and I wasn't sure it was updated.

The other keys now work without a problem even with the basic code like "agk.getrawkeypressed())" But the arrow keys are still not working. Still the interface is selecting itself (the buttons and other gadgets).
One thing that I noticed regarding Agk.Message, is that it multiplies itself when it appears, until the application crashes.
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 12th Nov 2018 21:11
Have you a Sample Code for me?
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 12th Nov 2018 21:15
I'll make one.
www.alexmatei.com
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 12th Nov 2018 21:57
Tried with a fresh project from your website and the "getrawkeypressed(38) == 1" works, for example. The command was placed on top of loop and sync command.
Don't know why on my project does not work (the same command).
It was just that code that I tested out so that's why I didn't actually made an example.
www.alexmatei.com
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 14th Nov 2018 22:42
Is the template compatible with Blend?
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 15th Nov 2018 05:43
I don't know. If you can import the template - why not?
I think you could customize the template or create a new one for Blend.

It is important that the window handle is passed to the Init function.
And the keyboard and mouse inputs are looped through to Agk.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 15th Nov 2018 10:36
By opening the project into blend is not possible. I think because it's a simple windows forms application and it must be a WFP form in order to use their designing tools
www.alexmatei.com
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 15th Nov 2018 11:47
Do you have any advice on the procedure?

I mean, I think it would be possible if core.cs would be converted for WPF
www.alexmatei.com
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 15th Nov 2018 17:35
It's hacky but you can run agk in a windows form that is hosted by a wpf control.

You can also run it in a wpf project by attaching to the main window handle directly.

I've only done bare bones basic testing of these though
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.
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 15th Nov 2018 18:50 Edited at: 15th Nov 2018 18:51
Thank you for the info!

I understand. Sorry for putting in like this but I really don't know how to do that
It does sound perfectly legit.
www.alexmatei.com
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 15th Nov 2018 18:56
I imported the Windows Forms project into the "blend" project, but from this point, question marks
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Nov 2018 10:35
I have no idea about Blend. I must confess I heard about it for the first time.

If you were able to import the project you now have to figure out how to get the handle from the Agk output window (panel).
You have to pass it to the init function.

Take a closer look at Core.cs and try to apply it step by step to your blend template.

I'm sorry I can't help you in this case.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 16th Nov 2018 14:02
Absolutely no problem!

Only, may I come back with this subject if I have some questions regarding some elements from Core.cs? (With all the explanations, of course).

Thank you!
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 16th Nov 2018 15:40
Sure, that's okay.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 16th Nov 2018 22:47
The problem with wpf if that controls don't have individual handles this is why you either have to get the main window itself which covers everything else and isn't terribly useful, or host a winforms panel via interop, this still has layering issues but can work to provide an agk "viewport" alongside other controls.

I'm also not too familiar with blend so can't help you much there sorry
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.
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 16th Nov 2018 22:58
Ortu.

Yeah, well, I will try to see if I can "convert" in Core.cs, the panel and other awesome stuff that MadBit made. I used to use Interop by "snapping" an application to a Windows Forms Panel and it was an absolute pain... I don't want to go that path ever again. Since I saw AppGameKit for C# my dreams came true.
www.alexmatei.com
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 19th Nov 2018 21:37
Is it possible to have multiple loops? If yes, how can I make them?

Thank you!
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 20th Nov 2018 13:30
It depends on what you want to achieve.

- Do you mean multiple loops in the sense of multithreading? Caution is advised. AppGameKit itself is not thread safe. Otherwise you would have the possibility to create programs with multithreading.

- Do you mean several loops that are processed depending on the state your program is in? The procedure is similar to Basic or as I did in my demo game Dust2Dust using a state manager.

Or I totally misunderstood you and need more information.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 20th Nov 2018 15:19
Multiple loops as multiple "DO SYNC LOOP".

Sorry for the lack of proper explanation.
www.alexmatei.com
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 20th Nov 2018 15:38 Edited at: 20th Nov 2018 15:41
You can program as many loops as you want. But only one loop will be active at a time. Until you instruct another loop to run. (That would be state dependent processing then.)

If several loops are to be processed simultaneously, this is multithreading.

Does that answer your question?

I feel like we're talking past each other.

Edit:
If you want to use such loops in a Form application it would be a bad idea. Since the Form object can no longer process the events.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 21st Nov 2018 20:16 Edited at: 21st Nov 2018 20:19
Hi MadBit.
Would like to ask, did you make any progress on Linux or did you hit a wall after all?
I am about to end my study with C# frameworks like MonoGame, FlatRedBall, UrhoSharp, CocosSharp, Duality I tried most C# frameworks and engines out there and had lot of fun in the process and I truly believe AGKSharp has it place because of it simplicity and easy to use commands. It is also relatively easy to embed in to Windows Form which is also a plus for me at least. It is the most simple to use among all the options for C# out there except Duality maybe. But, being Windows desktop only is a kind of deal breaker

Windows, Linux, Android trio would be nice to be able to target with AGKSharp. Is there any progress in that field or it is remain Windows only?

Thanks a lot.

Also, now that the C++ source of AppGameKit has been publicly shared, have you considered to make AGKSharp open-source too? You could still ask for donation and be the lead developer but being open-source and shared at GitHub could may be help with development. TGC could host the source if it would be a concern.
I would also put AGKSharp on itch.io at least to be more visible to search engines. At the moment AGKSharp is not really coming up in searches for C# frameworks and engines. itch.io can definitely help with that and also provide a more pleasing landing page maybe.

You told at the beginning you don't think AGKSharp can compete with frameworks like MonoGame. It might be true technically. But what I see is that most beginners are complaining about the complexity and lack of tutorials for other frameworks and it is a fact in MonoGame you do need to reinvent most of the wheels and it doesn't suit everyone especially beginners.
AGKSharp is simply a better option for those people looking for a simple yet powerful C# and .NET framework and in that regard I can't really find any better option out there, but being Windows only is a barrier for me
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 22nd Nov 2018 09:28
A Linux template has been available since the beginning of October.

Unfortunately I did not manage to create a template for the Forms interface.
I would be happy if you or anyone else could test it.

I also have the idea to make AgkSharp OpenSource. But I will wait and see how the plans of TGC are.
At the moment I am still bound to the agreement that TGC and I signed.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Zigi
14
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 23rd Nov 2018 15:46 Edited at: 23rd Nov 2018 16:07
I missed the release of the Linux template, I have tried now and it works pretty good on Ubuntu 18.04 64bit Thanks a lot!
I also tried with Forms interface and it crashes with Fatal Error the moment I'm trying to render the AGKSCreen. It is complaining about the AGKWrapper and AGKSharp libraries and throw a bunch of memory addresses in to my face that frankly I don't really understand any of that

Thanks anyway, it is really amazing to see it run on Linux
Amon
9
Years of Service
User Offline
Joined: 30th May 2014
Location: Shropshire, United Kingdom
Posted: 25th Nov 2018 07:42
I'm using the latest version of AppGameKit and VS 2017 Pro with all updates. I downloaded the templates, clicked the copyTo .bat file and it copied the templates zipped into the correct templates folder. When I open VS though I can't see the templates anywhere when I try to make a new project. Am I m issing something?
Imaginations' greatest gift is the knowledge you supply it.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 26th Nov 2018 18:28
@Zigi
Thank you for testing.

@Imagination Engineer
Since the last two releases. I didn't update the template integration anymore. Because too many changes took place directly in the template and the maintenance effort was too big.
So the templates are complete project directories which you copy and customize the names.
Just like the Tier 2 templates.

- Copy the needed directory.
- Change the directory name to the project name.
- Change project file (.csproj) to project name (xyz.csproj).
- Open the project with VisualStudio.
- Change the assembly names.

Later I will update the integration of the templates again. When everything runs smoothly.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
MateiSoft
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location:
Posted: 27th Nov 2018 13:11 Edited at: 27th Nov 2018 13:36
Hello Madbit,

Sorry for not responding. I ran into a huge problem and I don't know how to pass through it. In the middle of the development of my project, suddenly after compiling and executing the application manually from folder "bin" (so not debugging from VS), it gave me the error that is attached to this message.

Thank you!

PS: The application deletes itself after this error.
PSx2: The application can run from VS.

Edit: Found out that was the antivirus. That really is a problem. My last code lines where about loading some text from a file. Do you have any suggestions?
www.alexmatei.com

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-23 14:59:55
Your offset time is: 2024-04-23 14:59:55