ZGE on Mac

All topics about ZGameEditor goes here.

Moderator: Moderators

User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

ZGE on Mac

Post by VilleK »

Edit: the latest alpha build is attached here.

----

I'm looking at making the ZGE editor available on Mac. Previously only the runtime engine works on Mac but this is an attempt at making the whole editor working.

The main problem with porting the editor is that it depends on the Delphi VCL which is specific for Windows. However there is a similar library called LCL available in the open source tool Lazarus that use the Freepascal compiler, and that library is cross-platform.

Here is a screenshot at what can be described as a early alpha build. There are many features still missing: OpenGL is only working in separate window, the icons are distorted, there is no script editor yet or any sound. But at least it starts up and is operational which I consider a success for now :)

I hope to continue working on this so I can provide a download when it has reached a more stable state. The sources are in a "lcl" branch on github if anyone is interested.
Attachments
ZGameEditor.app_alpha9e.zip
(7.24 MiB) Downloaded 223 times
Skärmavbild 2022-03-09 kl. 13.27.02.png
Skärmavbild 2022-03-09 kl. 13.27.02.png (1.5 MiB) Viewed 41695 times
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: ZGE on Mac

Post by rrTea »

It already looks like ZGE! It's even kind of stylish with monotone icons :D
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: ZGE on Mac

Post by VilleK »

Here is first alpha build.

I'm posting this mostly to see if rrTea can open it at all :)

Note:
- This is very early and most things do not yet work.
- This is a Intel build so if using on M1 Mac then it requires Rosetta 2 to be installed.
- You may need to enable running applications downloaded from internet in Mac OS Settings - Security.

What works:
- Opening and saving projects.
- Using the "Project - Build Mac OS binary" option. The generated binary can be run on its own without any SDL dependency. It can read mouse input but not yet keyboard input. It doesn't fully close when closing main window so the attached terminal window needs to be closed manually.

Image shows ZGE running on M1 Macbook Air with a generated binary running CleanseCube example.
Attachments
Skärmavbild 2022-03-17 kl. 14.48.09.png
Skärmavbild 2022-03-17 kl. 14.48.09.png (2.37 MiB) Viewed 41629 times
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: ZGE on Mac

Post by rrTea »

Yes I can open and run it! I was able to load CleanseCube and run it both from ZGE and make a build. Some warnings were popping up in the process but I guess it's nothing unexpected (although one of the errors did sound a bit scary, warning me that I might end up with corrupt data). I did take screenshots of all the warnings if that's of any help.

Some of my old and super simple projects (20 lines of code) work too, while some slightly bigger projects failed to load (maybe because I was using some Windows specific features).
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: ZGE on Mac

Post by VilleK »

rrTea wrote: Thu Mar 17, 2022 4:28 pm Yes I can open and run it! I was able to load CleanseCube and run it both from ZGE and make a build. Some warnings were popping up in the process but I guess it's nothing unexpected (although one of the errors did sound a bit scary, warning me that I might end up with corrupt data). I did take screenshots of all the warnings if that's of any help.

Some of my old and super simple projects (20 lines of code) work too, while some slightly bigger projects failed to load (maybe because I was using some Windows specific features).
Great, thanks for testing!

If you get weird warnings or crashes then please let me know how to reproduce it or post screenshots.

Perhaps your larger projects that failed to load use external DLLs? Then you need to find Mac versions of those libraries. I might be able to help with that if you tell me what libraries are needed. If they don't require libraries then please send me such a project so I can investigate.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: ZGE on Mac

Post by rrTea »

I usually used SunVOX DLL for sound and Windows IME handler (to prevent Microsoft Chinese IME from grabbing focus during the game). So this should not be a problem, I'll just try to turn it off.

After I downloaded ZGE I just left it in the default Download folder and launched it from there. Should I try to move it to a particular folder instead?

Here are some errors I got while testing, let me know if any of these look like I should investigate it further:
Warnings screenshots
Warnings screenshots
ZGE00.jpg (65.73 KiB) Viewed 41619 times
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: ZGE on Mac

Post by rrTea »

I know launching programs with ZGE was not listed under "What works" (so probably too early for that) but I tried running demo projects anyway just out of curiosity, and quite a few of them work (some almost perfectly)! So that's great!
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: ZGE on Mac

Post by VilleK »

It looks like it has problems saving the settings file. This does not happen here. Maybe try moving the application to Application folder or to desktop and see if it makes a difference.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: ZGE on Mac

Post by rrTea »

ok I moved it to desktop, yes this helps!
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: ZGE on Mac

Post by VilleK »

New alpha on top:
- Fixed possible file corruption when saving projects with binary properties (such as BitmapFromFile)
- F9 now works to build and launch project

Still no keyboard support though, hope to fix that soon.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: ZGE on Mac

Post by VilleK »

Alpha 3 on top:

When generating binary then ZGE will create an application bundle for your project. This is required for an application to receive keypresses.

So if your project is named "test.zgeproj" then it will create the application bundle "test.app". This can be started in Finder as a separate application.

Note that if your binary requires any external files then you need to place those inside the bundle. Right-click on bundle in Finder and choose "Show bundle content". Then browse to Content/MacOS subfolder and place your files there.
Attachments
Skärmavbild 2022-03-23 kl. 11.17.09.png
Skärmavbild 2022-03-23 kl. 11.17.09.png (50.91 KiB) Viewed 41559 times
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: ZGE on Mac

Post by rrTea »

Just to confirm it works on my end. The initial stutter on freshly generated builds is now completely gone (at least the ones I tried) and even the builds that were causing problems (in alpha 2) are now built normally.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: ZGE on Mac

Post by VilleK »

Struggling a bit with how to avoid the detached OpenGL windows. There seems to be a problem with LCL, OpenGL and sharing contexts between views. No new alpha this week but trying again next week! :)
Imerion
Posts: 200
Joined: Sun Feb 09, 2014 4:42 pm

Re: ZGE on Mac

Post by Imerion »

Hi everyone! It was several years ago since I was here last, but I have been following ZGE on Github and noticed the Lazarus branch. Does this mean it would work on Linux too eventually? A native Linux version and I would definitely pick up working in ZGE again. :D
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: ZGE on Mac

Post by VilleK »

Imerion wrote: Wed Apr 06, 2022 4:26 pm Does this mean it would work on Linux too eventually? A native Linux version and I would definitely pick up working in ZGE again. :D
It would at least make it much easier to port to Linux, yes :). But I would need help with the details since I currently do not have a Linux environment configured.
Post Reply