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 / AGK for pascal missing commands

Author
Message
zog
16
Years of Service
User Offline
Joined: 13th Dec 2007
Location: Southport UK
Posted: 15th Feb 2014 06:50
Hi,
I have just bought AGK. I was delighted to find that it included support for pascal. However I have noted that the DrawLine command seems to be missing and the memblock commands, both of which are very useful. It would be very useful to be able to render stuff to bitmaps in background buffers. I also want to simulate a length of swinging rope and sprites aren't the best way to accomplish the task, the Drawline command would be an ideal way to do this.

PS I have got AppGameKit working with code typhoon on windows.

Jack

Jack Taylor
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 15th Feb 2014 08:30
The Pascal version is currently 1.706 (last official release) - those commands came later.

-- Jim - When is there going to be a release?
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 15th Feb 2014 08:37 Edited at: 15th Feb 2014 08:50
Hi zog,

AGK for Pascal is developed independently from TGC, by a single individual: Erik van Bilsen (who posts here as Neslib, I believe). I believe he has been waiting for AGKV1.8 to become stable, before adding commands that have been added since the last 'formal' release of AppGameKit (V1.076). Since version V1.819, TGC have declared the product to be out of beta again, but I haven't read any plans. Perhaps Neslib or fellow-forum member JimHawkins know more.

Edit: Jim ninja'ed me with his post. Still, it might be good to point out TGC's last post and newsletter-item declaring AppGameKit is out of beta. There's been some confusion about this, since the original announcement was written more or less as a sidenote in a thread about the beta.
zog
16
Years of Service
User Offline
Joined: 13th Dec 2007
Location: Southport UK
Posted: 15th Feb 2014 09:21
Thanks for the prompt reply. I have been using Lazarus on a number of platforms now including the raspberry pi computer. Lazarus and free pascal are truly excellent because you can compile and run your programs on just about any platform you can think of, and you get a debugger. This is saving me a load of time having to learn new stuff.

I
I guess what I could do is to render stuff using TCanvases then save it and load it in to the app game kit as sprites. I fear this approach will be too slow for rendering the rope alternatively I could represent the rope as a series of round balls - this is probably going to be the best solution.

Jack Taylor
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 15th Feb 2014 10:08
I haven't heard from Erik for quite a while, so I don't know what his plans are. It's a big and complex job - particularly for Android. I've been waiting until we have a new version before finishing a project management system that will give one-click build to Android without Eclipse and automatic upload of APK files to Dropbox etc.

-- Jim - When is there going to be a release?
BitManip
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Essex
Posted: 15th Feb 2014 10:42
Hi All

Jim is correct, it is a H U G E undertaking. It is a shame that TGC do not seem to want to either assist with this port as unlike the C++ tier, AppGameKit Pascal works, and works well!

I quite like C++, but object Pascal is such a clean OOP language which is quite complete IMHO! and of course it is free <lazarus>.

I am still not sure why TGC only use microsoft, once again, IMHO mingw libraries would have provided people with choice of IDE etc.

Also, as jim also stated Erik was waiting for a stable release. I have been using a newer one than 1.706 but i believe it is not complete or fully stable! Unfortunately, until AppGameKit provides a stable RELEASE with the latest commands, i am sure Erik will not bother, and even then it takes a big commitment so may be too busy!

It is a shame that there are not more AppGameKit pascal coders...we could form a group and even offer Erik some reward for his work....for me it would be worth it!

General thoughts on this...?

I control all the juicy in here!
The Daddy
15
Years of Service
User Offline
Joined: 13th Jan 2009
Location: Essex
Posted: 15th Feb 2014 11:09
All,

I agree with Jim! Pascal is a fantastic language which is complete, clean, powerful and easily accessible. The AppGameKit pascal port by Erik is fantastic...it worked "out of the box" which I could not say for TGC's own tier 2?

The work involved in the pascal port is HUGE and Erik was waiting for a stable release, based on past history, this will be a while....then if Erik has time, he may be kind enough to assist. He has already done a shed load of work for free!!

What would be a good idea is to start a group of pascal AppGameKit developers, we may be able to a) help Erik with the work, b) reward Erik in some way, c) help each other.....just a thought!

Also, with Jim's one click build without eclipse....did you hear that 'without eclipse'.....TGC listen to this.....here is another outlet and customer base for your engine.....AGK Pascal with One Click android deployment....and so far most of the work is done.....!

With the FREE Lazarus or DELPHI, it is a fantastic and complete development chain IMHO. Of course i use this chain so am pro this, but i think TGC are missing a trick here!!!!!

www.bitmanip.com
All the juicy you could ever dream of!
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 15th Feb 2014 11:58
As The Daddy says - I've already demonstrated one-click build. All it means is using the Android toolkit correctly: a combination of Ant and Adt will handle build, code-signing and deployment in one script.

I also agree that TGC has stumbled over releases. Alphas and betas are all very well, but the changing interfaces make yesterday's system unworkable today. And I'm sad about this, because the current version (1.076) of the Pascal is very stable and reliable. There's a big difference between fixing internal bugs (updated library release) and adding endless new "features". The former just requires a rebuild of the DLL etc - the latter requires a lot of work to include the extended command set.

I think that a user group would be a good idea!

-- Jim - When is there going to be a release?
zog
16
Years of Service
User Offline
Joined: 13th Dec 2007
Location: Southport UK
Posted: 20th Feb 2014 08:51
Hi,
I am making good progress with the app game kit in pascal. I have found that I can run the game in a standard GUI application by renaming the Application object to GAME so the naming doesn't clash with the standard Application object TApplication. Then running the TAGKApplication under its own thread

for example ( note not complete code ).



You can then use a TThreadList to send commands between the GUI environment and AppGameKit GAME. This approach is very useful for making a level editor for testing and debugging purposes.
I am interested in a user group as I think it would be useful.

Jack Taylor
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 20th Feb 2014 09:19
Excellent! I started doing that and got distracted...

How are you handling the message pump?

-- Jim - When is there going to be a release?
zog
16
Years of Service
User Offline
Joined: 13th Dec 2007
Location: Southport UK
Posted: 20th Feb 2014 11:42
Hi,
I have used a TThreadList to pass information between threads with other programs I have written. The TThreadList is thread safe so you can use it between threads. Declare the TThreadList in the implementation var section.

To pass messages between threads I create a message record type and then create a pointer to that type. You can then use the New() to generate message records which can be passed between threads. When you lock a thread safe list you get a pointer to a TList which is a list of pointers. Use the list methods to pull messages on or off the list. Don't for get to use a try finally block around the TThreadList.LockList function so if an exception occurs you can release the lock on the list , in the finally section so as you don't block the other thread.
On the GUI side use a TTimer to call a procedure to clean up any handled messages / collect data to display results from messages etc. I would also recommend that you don't try to pass pointers or objects in the messages belonging to other threads as this is asking for trouble. Use Dispose() to free the memory associated with any messages you have finished with.

I hope this helps - Jack



Jack Taylor
The Daddy
15
Years of Service
User Offline
Joined: 13th Jan 2009
Location: Essex
Posted: 20th Feb 2014 13:23
Zog, Jim

What are the benefits of running an AppGameKit application under its own thread? Could this not cause issues on phablet devices?

I understand how threads work (bit like interrupts on the C64) where you can have chosen processes to run in their own thread giving them an individual slice of processor time, hence allowing several time critical processes to run seemingly in parallel? I have not really dabbled with threads so please correct me if i am wrong

I am struggling to see how giving an AppGameKit app its own single thread is useful (i am a bit slow after all!). I could get that once a scene is created, that the player, the scrolling, the score keeping etc could benefit from having a thread each for speed, but cannot see how an entire app can benefit....would love to understand this guys!

www.bitmanip.com
All the juicy you could ever dream of!
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 20th Feb 2014 13:27
Thanks, Jack - I knew that.

What I meant was, AppGameKit wants to handle all Windows messages when it's running. So have you altered the AppGameKit Pascal implementation to avoid this problem, or are you just handling keyboard and mouse events according to which has focus(Application or AGK)?

-- Jim - When is there going to be a release?
zog
16
Years of Service
User Offline
Joined: 13th Dec 2007
Location: Southport UK
Posted: 20th Feb 2014 13:52
Hi,
First of all Mr The Daddy - the idea behind running the AppGameKit on a thread is so that you can create a level editor type program on windows. Writing a level editor allows you to speed up the development process considerably - even better you can control the GAME from outside - for example you can make it load a sprite dynamically. When you deployed the game you wouldn't want to distribute the level editor part, so you would have a slightly different executable which would contain a single thread. However threads are handy as you can cause things to execute in the background such as screen rendering and fetching stuff from the internet. Some tasks block program execution so threads are a good way to solve the blocking problem.

Mr Hawkins I have not altered the message loop in the AGKImplementation, although I have inspected it, it only processes one message which is the WM_QUIT message as far as I can tell. I have created some buttons which work when clicked with the mouse - but not until double clicked with the screen pointing device under windows 8.1. As far as I can tell because the game window is created in a separate thread there isn't an issue with the game window blocking the message que, if that's what you mean?
Also as long as you can get the window handle of the game window it should be possible to forward messages to it.

Jack Taylor
The Daddy
15
Years of Service
User Offline
Joined: 13th Jan 2009
Location: Essex
Posted: 20th Feb 2014 23:27
Zog

So i assume you have agk working on a GUI canvas/panel/paintbox? So that AppGameKit can be used for drawing tiles/ maps etc?

If so how did you get AppGameKit to access your hDC? Cool if you did it! It would allow easy level editor creation. You could always use an openglcontext /sdl / zengl but i get there would be more drawing involved...still I would like to see how you achieved it for future reference

Should be possible as AppGameKit has an opengl backend!

Well done anyhow!

www.bitmanip.com
All the juicy you could ever dream of!

Login to post a reply

Server time is: 2024-11-25 03:04:25
Your offset time is: 2024-11-25 03:04:25