* * *

Author Topic: Your thoughts on best advice for cross platform graphics  (Read 4136 times)

Julius7

  • New member
  • *
  • Posts: 19
Your thoughts on best advice for cross platform graphics
« on: February 22, 2018, 07:00:31 am »


Hello everyone!

I have a three main questions on crossplatform coding.
I need some advice on which is the best choice.

a) What are the advantages and disadvantages of each of the following choices
for multiple platforms on the desktop for graphics and sound.

b) What are the advantages and disadvantages of each of the following choices
for iphone and android development in graphics and sound.

c) How would you compare each to other options?

1) OpenGL

2) SDL

3) Is ClanLib the best for 2D ?

4) OGRE 3D


5) OpenAL

6) FMOD

7) BASS

8) Finally is ODE (Open Dynamic Engine) the best choice?


Is NSIS a good choice for creating your installation program?

thks

julius7

 :)
Modify message

Handoko

  • Hero Member
  • *****
  • Posts: 2456
  • My goal: build my own game engine using Lazarus
Re: Your thoughts on best advice for cross platform graphics
« Reply #1 on: February 22, 2018, 09:22:43 am »
First of all I'm not an expert in multimedia programming. I can't give you any advice, I just want to share what I know.

OpenGL

My system is Linux, but I occasionally create Windows programs. Cross compiling OpenGL programs in Lazarus is as easy as configuring some of the project settings only. Very easy as long as you have already made your Lazarus to be able to do cross compiling. How to make your Lazarus to do cross compiling is another topic, it is relative difficult for newbies.

But if you want to cross compile to Android, that's a whole different story. Android uses OpenGL ES (1/2/3), which is similar but different and harder to learn compare to the 'common' OpenGL's API.

I can use OpenGL for Android via LAMW's (Lazarus Android Module Wizard) jCanvasES2. Unfortunately, I found some bugs in the jCanvasES2, which makes it unusable for creating games. Also, most of their OpenGL functions aren't optimized. I simply rewrote some of the functions, I gained 10% frames rate improvement.

OpenGL only process graphics, no audio support.

If you interested to try LAMW, read here:
http://forum.lazarus.freepascal.org/index.php/topic,38777.0.html
There I also provided an example code of OpenGL ES2 via jCanvasES2.

SDL

I never have any experience with SDL. But I ever know a newbie in programming, after weeks of learning SDL he can create a simple 2D desktop game using Lazarus+SDL. He was 13 years old kid only (if I remember correctly). He now uses C++ + SDL to create Android games.

SDL has audio and multiplatform supports. There was an attempt to build Lazarus tool to create Android app using SDL, unfortunately the project halted without any clear reason.

Allegro

If you don't do 3D, Allegro and SDL are easier than OpenGL. What I like about Allegro is the documentations and tutorials are very helpful. Some hours after first time learning it, I can start writing my Furious Paladin:

Furious Paladin's source:
https://forum.lazarus.freepascal.org/index.php/topic,35313.msg270638.html#msg270638

Furious Paladin's binaries:
https://forum.lazarus.freepascal.org/index.php/topic,35313.msg254588.html#msg254588

Allegro supports audio and multiplatform. For Linux and Windows, you just need to provide the proper libraries for the users. In theory Allegro supports Android but I never tried.

You can use Allegro in Pascal via Allegro.pas:
https://sourceforge.net/projects/allegro-pas/

Julius7

  • New member
  • *
  • Posts: 19
Re: Your thoughts on best advice for cross platform graphics
« Reply #2 on: February 22, 2018, 09:28:19 am »
Wow  :) Handoko thank you for your sharing your advice and experience
js

Handoko

  • Hero Member
  • *****
  • Posts: 2456
  • My goal: build my own game engine using Lazarus
Re: Your thoughts on best advice for cross platform graphics
« Reply #3 on: February 22, 2018, 09:51:31 am »
It seems you're interested in graphics/game programming. You should join the Game Contest 2018:

https://forum.lazarus.freepascal.org/index.php/topic,39495.0.html

Thaddy

  • Hero Member
  • *****
  • Posts: 6568
Re: Your thoughts on best advice for cross platform graphics
« Reply #4 on: February 22, 2018, 09:59:09 am »
I am missing OpenVG here... for 2d this is underrated... fast and cross-platform.
Ada's daddy wrote this:"Fools are my theme, let satire be my song."

Julius7

  • New member
  • *
  • Posts: 19
Re: Your thoughts on best advice for cross platform graphics
« Reply #5 on: February 22, 2018, 10:20:19 am »
Thks Thaddy  :)  I see
https://en.wikipedia.org/wiki/OpenVG
...
OpenVG is an API designed for hardware-accelerated 2D vector graphics. Its primary platforms are mobile phones, gaming & media consoles and consumer electronic devices. It was designed to help manufacturers create more attractive user interfaces by offloading computationally intensive graphics processing from the CPU onto a GPU to save energy.
...

Thaddy

  • Hero Member
  • *****
  • Posts: 6568
Re: Your thoughts on best advice for cross platform graphics
« Reply #6 on: February 22, 2018, 10:34:27 am »
Thks Thaddy  :)  I see
https://en.wikipedia.org/wiki/OpenVG
...
OpenVG is an API designed for hardware-accelerated 2D vector graphics. Its primary platforms are mobile phones, gaming & media consoles and consumer electronic devices. It was designed to help manufacturers create more attractive user interfaces by offloading computationally intensive graphics processing from the CPU onto a GPU to save energy.
...
Yes, so? <mildly grumpy>
Ada's daddy wrote this:"Fools are my theme, let satire be my song."

Handoko

  • Hero Member
  • *****
  • Posts: 2456
  • My goal: build my own game engine using Lazarus
Re: Your thoughts on best advice for cross platform graphics
« Reply #7 on: February 22, 2018, 12:35:06 pm »
Some worth mentioning free projects:

Godot Engine

You probably already know Unreal and Unity Engines but they're proprietary. In open source line, the best should be Godot Engine. It is licensed in MIT, full featured, well-documented, easy to use, multi and cross platform.

https://godotengine.org/

If you're not a Pascal-fanatic you should give it a try. I installed, download the examples and tested. Wow, simply some clicks the desktop 3D demos can run on my Android phone. I do not use it because I'm just a hobbyist, don't have much time to learn new things and I'm not willing to abandon my Pascal. But if I'm pursuing career in commercial games, I am sure to use Godot.

Castle Game Engine

If you're already have some skills in Pascal, you may want to try Castle Game Engine. I tried it some years ago, impressive. It is actively maintained and improved. This framework can be used to build non-game applications too.

https://castle-engine.sourceforge.io

ZGameEditor

This game builder is written using Delphi. It has its own scripting language, which is similar to Pascal language. I used it to create scrolling shooter game that runs on both my Android phone, Windows and Linux pc. For simple games, the size usually is less than 100 KB. Also, the result is only 1 single exe file (for Windows target).

http://www.zgameeditor.org/index.php/Main/Features

Since it started to use Delphi's generic feature, the newer versions aren't compatible with Lazarus/FPC.


Read more about graphics libraries and game engines:
http://wiki.freepascal.org/Graphics_libraries
http://wiki.freepascal.org/Game_Engine#Game_Engines

Julius7

  • New member
  • *
  • Posts: 19
Re: Your thoughts on best advice for cross platform graphics
« Reply #8 on: February 23, 2018, 08:23:20 am »

Thank you Handoko  :) I see

https://en.wikipedia.org/wiki/Godot_(game_engine)

says....

Stable release

3.0 / 29 January 2018; 19 days ago
 
 

Repository

https://github.com/godotengine/godot
Edit this at Wikidata

Development status
Active

Written in
C, C++

..
In February 2014, the source code for Godot was released to the public on GitHub under the MIT License.
...

...much improved Blender Collada exporter and a new dark theme.
...
On 22 June 2016, Godot received a $20,000 Mozilla Open Source Support (MOSS) “Mission Partners” award to be used to add Web Sockets, WebAssembly and WebGL 2.0 support.
...

Usage

Many games by OKAM Studio have been made using Godot, including Dog Mendonça & Pizza Boy, which uses the Escoria adventure game extension.[20] Additionally, it has been used in West Virginia's highschool curriculum, due to its ease-of-use for non-programmers and what is described as a "wealth of learning materials that already exist for the software".
...


I will also have a look at Castle Game Engine.


thks

js


avra

  • Hero Member
  • *****
  • Posts: 1310
    • Additional info
Re: Your thoughts on best advice for cross platform graphics
« Reply #9 on: February 23, 2018, 12:02:59 pm »
I will also have a look at Castle Game Engine.
I think you would like to know that it supports Spine and DragonBones character animations.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

lainz

  • Hero Member
  • *****
  • Posts: 2825
    • Home
Re: Your thoughts on best advice for cross platform graphics
« Reply #10 on: February 23, 2018, 01:47:19 pm »
Some worth mentioning free projects:

Godot Engine

You probably already know Unreal and Unity Engines but they're proprietary. In open source line, the best should be Godot Engine. It is licensed in MIT, full featured, well-documented, easy to use, multi and cross platform.

https://godotengine.org/

Thanks Handoko, I will give a try, since I used Unity and Unreal, and both are too expensive for me, an Open Source one will do better.

RAW

  • Hero Member
  • *****
  • Posts: 667
Re: Your thoughts on best advice for cross platform graphics
« Reply #11 on: February 23, 2018, 04:13:28 pm »
Quote
ZGameEditor

This game builder is written using Delphi. It has its own scripting language, which is similar to Pascal language. I used it to create scrolling shooter game that runs on both my Android phone, Windows and Linux pc. For simple games, the size usually is less than 100 KB. Also, the result is only 1 single exe file (for Windows target).

Interesting... have never heard of ZGE before... Thanks  :)
Windows 7 Pro (x64 Sp1) And Windows XP Pro (x86 Sp3) - LAZARUS 1.8.4 FPC 3.0.4 // 1.7 FPC 3.1.1

Handoko

  • Hero Member
  • *****
  • Posts: 2456
  • My goal: build my own game engine using Lazarus
Re: Your thoughts on best advice for cross platform graphics
« Reply #12 on: February 23, 2018, 04:35:31 pm »
@lainz

I wonder why you don't use Castle Game Engine.

It maybe not matured and full featured compare to the others, but it's improving. Many new features already added in recent years. Besides Spine and Dragon Bones as avra mentioned, it also added Physics Engine, Visual Editor and Build Tool.

I really tempted to try and use Castle Game Engine, I just can't find time to learn it. Is it any reason you personally don't use or try it?

@RAW

Can you help to make it compilable on Lazarus? I tried but failed I simply not good enough in understanding Delphi's code. The 2 main issues I found was the generic collection it uses (Delphi version) and units' names with dot. The dot name issue was solved because it is now supported in the FPC. If I remember correctly, the developer said he uses DelphiXE (or maybe XE2).

I stop using it because the developer only released beta version for years. The beta version cannot generate Linux binaries. I'm reluctant to abandon ZGameEditor because I've already written some 'nice' modules for it to be used in my games.
« Last Edit: February 23, 2018, 04:49:59 pm by Handoko »

RAW

  • Hero Member
  • *****
  • Posts: 667
Re: Your thoughts on best advice for cross platform graphics
« Reply #13 on: February 23, 2018, 11:43:08 pm »
I don't think I'm good enough to help... Anyway right now I don't have enough time for things like that. I wanted to check the differences between version 3.0 and the latest beta version, but right now there is always something else that is more important...  :)
Windows 7 Pro (x64 Sp1) And Windows XP Pro (x86 Sp3) - LAZARUS 1.8.4 FPC 3.0.4 // 1.7 FPC 3.1.1

lainz

  • Hero Member
  • *****
  • Posts: 2825
    • Home
Re: Your thoughts on best advice for cross platform graphics
« Reply #14 on: February 24, 2018, 11:59:42 pm »
@lainz
I really tempted to try and use Castle Game Engine, I just can't find time to learn it. Is it any reason you personally don't use or try it?

I like a game engine with a good and easy to use editor, plus ready to use methods for everything, to don't reinvent the wheel.

But that doesn't mean I use these construction blocks for coding, I use C# on Unity for example.

About Castle Game Engine, I can say I've not seen good 3D graphics searching on google, but at the first time I entered Godot it shows good graphics, and in the demos I already run a project with different usage of "realistic" materials.

Maybe I can't find some good graphics on Castle, or I'm missing a great demo / game made with it?
« Last Edit: February 25, 2018, 12:07:30 am by lainz »

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus