Goodbye

Space

Member
Licensed User
Ok. In short: I'm giving up on game programming in B4X. The progress I'm making is too slow and frustrating.


Why am I writing this here?

To vent my frustration.


First of all, a bit about me. I'm not a full-time programmer, but I have written many small things and also two big ones:

-A complete inventory management system that runs on Android, programmed in "Marmalade" (if anyone still knows that). The software is used in our company and works great.
-A CNC programming system for Fanuc lathes. It runs on Windows and is written in C++ with SDL. It has a source code size of about 70,000 lines. It is used to write all turned parts at our workplace.

So I think I'm not the stupidest.

How did I end up with B4X? I want to write a game that runs on Android and iPhone. B4X looked suitable for this at first glance.

How far have I come? The basic structure on the graphics side is written. That means I can run exactly the same program on Windows, Android, and iPhone. On Windows, everything is done via BitmapCreator. On Android, it's libGDX. And on iPhone, it's SpriteKit. The biggest challenge was using the same code for libGDX and SpriteKit. Since SpriteKit does things differently.

Why didn't use XUI2D?

I tried it. But first: there is no documentation. (No, example programs are not documentation. They are examples!) And second, it's too slow. A brief comparison with libGDX showed me: No. So really, I'm not sure if XUI2D renders on a hardware basis or, as I believe, in software.

It became clear to me on that it could only work with libGDX and SpriteKit. Speed was the main concern, but documentation was also important. If I had questions about how something worked, I could simply look it up in the official documentation and be done with it, unlike in B4X XUI2D, where there are always references to example programs. However, I had reservations about using libGDX and SpriteKit from the beginning. What would happen if they suddenly stopped working on newer operating systems? After all, they haven't been updated for a long time, and they were also integrated privately into B4X, so support cannot be assumed.

And now that I've realized that multitouch is not possible with SpriteKit, what else is there to do? I've also wasted 1.5 weeks on something like this again.

There have been so many frustrating moments where I've spent weeks trying to achieve something through trial and error.

I just want to be able to look up in the documentation how something works in principle when I have a problem. And not try to figure out what the command does and what the parameters mean through undocumented example programs in the forum.

I can't understand how on the one hand, there is a simple programming language that I really like. And on the other hand, complex code is needed for the simplest things.

For example, mouse/touch: left mouse button on Windows, no problem. Great. Then I wanted right/middle mouse button and the mouse wheel for my level editor. No chance. After two weeks, I copied together obscure code from the forum that I have no idea about.

And now that I've discovered that multitouch isn't possible with SpriteKit, what else can I do?

And what do I get from code that I somehow get to work? Great. It now works on my devices. But since you can only guess the commands through example programs, it is impossible to say whether the solution found now works universally everywhere.

That's why, after almost 2 years, I have reluctantly decided to close the chapter on B4X for game development.

Goodbye. And I wish you all health and success!
 

LucaMs

Expert
Licensed User
Longtime User
Moments of frustration happen to anyone who does programming.

I've never developed game apps that need to be fast. If XUI2D was fast enough, you could ask for good documentation to be published.

B4X is almost certainly the easiest tool to learn and use for developing cross-platform software. For this reason it would not be very smart to leave it.
 

peacemaker

Expert
Licensed User
Longtime User
Wait, is right mouse button (or long mobile tap) impossible in XUI2D ?
 

Space

Member
Licensed User
I have found some questions in the forum about XUI2d. Reference is always made to the sample programs. Additionally, XUI2d is much slower compared to SpriteKit and libGDX.

B4X as a language is easy. The surrounding environment, unfortunately,not.
 

peacemaker

Expert
Licensed User
Longtime User
XUI2d is much slower compared to SpriteKit and libGDX
Slower for making what ?

And again about mouse clicks - can you explain more detailed what in XUI2d about right clicks (irrelative the work speed)?
 

Space

Member
Licensed User
Slower for making what ?

And again about mouse clicks - can you explain more detailed what in XUI2d about right clicks (irrelative the work speed)?
For action games, draw a few hundred rotated sprites with alpha channel on a not-so-up-to-date Android phone using BitmapCreator -> slow. The same with libGDX or SpriteKit -> no problem.

I tried to check for the right mouse button back then -> didn't find anything
 

ilan

Expert
Licensed User
Longtime User
For action games, draw a few hundred rotated sprites with alpha channel on a not-so-up-to-date Android phone using BitmapCreator -> slow. The same with libGDX or SpriteKit -> no problem.
than why not using iSpritekit or Libgdx?
why are you fixed on xui2d?

game making is actually very simple. it is just a lot of work but never try to be happy only if you have the end result like when the game is exactly how you imagine it. try to set goals and step after step you will see how it become a finished product.

first create the character animation.
then movement around the screen
then create a level
then enemies and logic
after you have first level and everything is fine continue with new levels and always add more stuff to your game. but try to have low expectation at the beginning and not be only happy if the game is perfect and if not you quit!

making game take a lot of time and thinking. it is not a 3-5 days project. it can take months sometimes.
you have many tutorials on youtube and also here.

my suggestion if you want to create a very heavy game for ios then use spritekit and for android use libgdx but if it is a middle range game use xui2d

NEVER GIVE UP!
 

Johan Schoeman

Expert
Licensed User
Longtime User
Sometimes one need to peek into the "jar" to figure out what classes and methods expect what to be passed to it (setters) or what can be read from it. Not always easy but without digging in the "jars" one will never find the answer. If it is not your full time job to write games then no reason to give up - even if it is your full time job. I have tons of "project efforts" that I have buried and once in a while I am trying to revive some of them with new ideas. Even using libgdx is complicated for me and so is xui2d. I battled with just connecting to a MSSQL server for months but after about 6 months of on/off trial and error I got it working. It was an Eureka moment for me as I knew zip about networking and then trying to read data from MSSQL database on a MSSQL server hosted on a PVN. Lots of reading possible solutions on the web but figured it out and not have Onlite Tools for our company that can do a multitude of data extracted via various queries and display them in B4XTables with ability to export to Excel.

My new fancy is SithasoDaisy by Massy (Anele) and still figuring out what this clever man has done to BANANO. Will take me weeks to figure it out but that is just the way it is.

Hang in there - you will find the right answer at the right time and it will be clear to you what to use from learning experience that you can use later in a different project.
 

MichalK73

Well-Known Member
Licensed User
Longtime User
There is no point in giving up on B4X. I'm also into python and things that i can't solve in b4x, i often find a solution in python and combine them. Maybe it won't help in games, I don't know because I don't write games.
Example: creating a PDF there are several methods in B4X (libraries, solutions) but to fit my project it becomes sometimes laborious or impossible to do because something is missing. So I wrote my own python script, which has great libraries ready for this, and linked the two together. Now it works as it wants.
Staying with B4X is good but I think you need to develop in other languages to be more universal.
 

tufanv

Expert
Licensed User
Longtime User
I am still using B4X for mobile apps. For backend I switched to nodejs & php mostly.

The problem with B4X for me is:

* You are limited to created libraries. You can't do whatever you want. Making a wish on the forum is not enough obviously as nobody has time to create libraries for you. You can pay for them but sometimes you just want to try a library and you can't just wait weeks to see it or pay for it.
* If I experience a problem, I need to write here. I always get a solution on the forum but sometimes it takes up to 1-2 days to find a solution. But for common languages, you can find nearly unlimited solutions to a problem on stackoverflow etc.

Most obvious problem for me is to be not able to use latest features. If you can't use latest features available, you can't build something unique.
 

peacemaker

Expert
Licensed User
Longtime User
library and you can't just wait weeks to see it or pay for it
IMHO, it's common issue for any "wrapper" software. We always pay something for some pluses.
giving up on game programming in B4X
It's also clear - few B4X developers are game developers, so - not enough knowledge and examples. And docs.
I will have to make game development soon (such order is planned), and also know nothing yet. But cross-platforming under Android and Windows is a plus for me, for non-action game. I hope.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Don't turn this thread to a generic ranting thread. Nothing good will come out of this.
 

Marvel

Active Member
Licensed User
I understand your frustration, as I myself tried my hands at using XUI2D for game programming some months ago and I failed woefully. I was still able to get a very basic prototype though but I knew I did not have the skill/resource to get enough of B4X for game programming. I eventually switched to another open-source game programming software.

With that said, B4X is still my go-to app for cross-platform development. Game programming is just not its strongest feature. I have even used B4X to make a multiplayer jigsaw puzzle game though it's mostly just shape and image manipulation with no particle or physics system and it worked well.

In summary, there is nothing wrong with combining tools and using what is easier for you in different cases. B4X may not be the best for game programming, but it excels in many other things.
 

tufanv

Expert
Licensed User
Longtime User
Don't turn this thread to a generic ranting thread. Nothing good will come out of this.
I didn't mean to rant. I just expressed my feelings. B4X is the reason today I am living with my apps income. There are some negatives for all platforms, languages etc.. These are the negatives for me about b4x. Other than that, thanks to b4x..
 

ThiagoRodrigues

Member
Licensed User
Longtime User
I understand the difficulties you are having. But I would like to give my opinion if I may.

Even though B4A is a very nice tool (I really like it), it may not be the correct tool for game design. I´m also looking into indie game development, just out of curiosity. Being an experienced dev (I design control systems, frontend, backend), I know we need the right tools for the right job, and in this case, it would be a game engine. It has everything you need ready to use. Most of the things already in the engine, should be hard coded by you in B4A for instance.

So my suggestion is to invest some time in learning how the engines work (not to hard) instead of trying to make everything work in B4A.

Some engines are really easy to use and compile games for multiple platforms (Windows, Android, iOS) like GoDot. Light, free, easy. You can also try Unity.

Give it a try
 

Computersmith64

Well-Known Member
Licensed User
Longtime User
B4X as a language is easy. The surrounding environment, unfortunately,not.
I hear you. The lack of native support for Android & iOS SDKs / APIs is what drove me to learn Java, Kotlin, Obj-C & Swift & as a result I develop all my new apps in Android Studio & Xcode. I've also ported a few of my older apps away from B4X & while I still use B4A to maintain the apps I haven't ported, I haven't started a new project with it for several years. When I first started developing with B4A I found it to be a quick & easy way to get myself into the world of mobile app development (well, Android really because I never used B4i), but as I started to add more & more features to my apps I found that in some cases there were no B4A libraries for the functionality I wanted & in some cases where there were libraries, the functionality was incomplete or no longer worked due to changes on the Android side (not to mention the lack of documentation for some of them). I still think B4X is a fantastic tool (I use B4R for the sporadic ESP8266 development I do) & perfectly adequate for many development projects, but its lack of native support for the entire suite of Android & iOS functionality is its Achilles heel - & because of that it's not always a suitable solution.

Good luck with whatever you choose to do.

- Colin.
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Hello,

I have read the whole post and i couldn't understand what type of game you are trying to develop.

You are saying B4X is limited, so below is very simple question to ask yourself :

Let's say you want to develop a 2D game and you are going to use Android Studio, Intellij IDEA, Eclipse IDE, will you be able to do that? And this is only for the Desktop and Android part, don't forget the IOS part (XCode)

You can't use these IDEs (Android Studio, Intellij IDEA, Eclipse IDE, XCode) to develop professional games (unless you want to create a clone of flappy bird).

That's why there are game engines like Unity3D or Unreal Engine, etc....

If you want to create games then learn how to develop games the right way which is using a game engine.

---------------
1-B4X
2- Android Studio
3- Intellij IDEA
4- Eclipse IDE
5- XCode
6- .....

The above IDEs provide you with the basic and necessary tools to build an app and the rest is on you.

The beauty about B4X is it's very fixable, meaning if you can't find a library you create your own and there are thousands of posts showing you how to do it and even if you couldn't build your own library then you can use the native inline codes within B4X

Being a developer for a very very long time i know 3 things :
1- Never give up on a problem unless you solve it even if it takes years.
2- Don't blame the tools, blame your self, the tools provide you with everything you need, and the rest is on you.
3- If you can't find a solution for a certain problem then create a workaround.
 

peacemaker

Expert
Licensed User
Longtime User
4. If found a solution - share at least the key with the community
 

MarcoRome

Expert
Licensed User
Longtime User

I completely agree.
Like all languages, there are strengths and weaknesses.
In particular, it has grown a lot in recent years.
From our personal experience B4X compared with other tools is really fantastic one of the best in the market
Long live B4X and a special thanks to Erel and all the community that actively participates.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…