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.

DarkBASIC Discussion / DBC for Linux

Author
Message
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Jul 2013 03:33 Edited at: 9th Jul 2013 03:39
I thought I would try dbc through Wine -- a Windows emulator -- and I was surprised to find it works extremely well.

I made the icon myself. If anyone wants to do this and needs help setting it up just ask here or send me an email.

I've noted two bugs:

→ Occasionally, while running a program db.exe may crash when you try to end the program, but if you use an external editor your code wont be affected.

→ There is a strange ink colour bug: setting the secondary colour of the ink statement to zero causes nothing to be drawn. Set this to one and it works fine. I don't pretend to understand it.

Attachments

Login to view attachments
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Jul 2013 16:35
Quote: "setting the secondary colour of the ink statement to zero causes nothing to be drawn. Set this to one and it works fine."


What happens if you set the secondary ink colour to 0xFF000000 (dec. 4278190080)?

TheComet

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Jul 2013 18:50
I don't seem to be getting that bug any more.
I'll leave it there in case it comes back.
Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 11th Jul 2013 16:34
@OBese87 - How did you install directX?
which variant of linux are you using?
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Jul 2013 04:27
Ah, I use 3D so rarely I didn't think to test that. Test failed . I'll see what I do, I've managed to totally break it now but I reckon I can get it working.
Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 12th Jul 2013 15:15 Edited at: 12th Jul 2013 15:18
Thanks! well, that is very interesting. But the reason why I ask is, I would like to develope games that will run on Linux too (even with wine) but DB (DBC + DBP) do need directx. You can test the availability of 3D-features width simple code:



Please let me know when/if you can run a DBC- (or DBP-) program in a Linux environment.

Thank you for the exiperiment.

kind regards
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Jul 2013 16:55
WINE has improved a lot, can it support DBP now? Maybe OBese could shed some light on that (pretty please)

TheComet

Fluffy Rabbit
User Banned
Posted: 13th Jul 2013 07:54
Oh, God!

I have never been able to get DBC to work under Wine, and still cannot to this day, due to Linux graphics drivers being rather unpredictable.

Quote: "I would like to develope games that will run on Linux too (even with wine)"

FreeBASIC and QB64 have worked for me.

Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 13th Jul 2013 12:34 Edited at: 13th Jul 2013 13:00
@fluffy_rabbit

The idea is to write it once - deploy to multiple OS

which means that you write the game once in on language and deploy it for gamers using any operating system but are able to boot a 'life-CD'.

I think it is possible to deliver a game on a bootable medium (a.e. a DVD, a CD or a memory-stick) with a customized operating system on the medium.

It would allow to control and optimize the games environment and give the owner the right to sell the game to anyone able to boot his computer from the medium.

It would be the simplest way to make the OS a windows variant (a.e. XP with DX9c installed) but this would rise problems with the copyright industries/owners in most countries.

With the defunc of windows 8, becoming a handy/tablet operating system and the problem of the incompatibility of DX10-11 wth previous versions, it is the smartest to find another base for the games. But at the moment DB c&pro will only run on a window based system.

The possibility to use use a free OS instead of a proprietary which could deliver a customized environment to the game and can be given away free without any copyright concerns could make the game development and distribution much easier.

Developing for such a platform would be like working for a game console which offers a defined environment and the platform is included with the game tough it is not affected by upgrades. It will allow to disable features not needed in the game thus freeing resources for the game and make it faster and more powerful to provide a better experience for the gamer.

While the system of game consoles is developed to bind the client to the console producers shop, this could free the players from buying a console and to use the existing hardware for the game. If properly configured the OS from the medium would not have access to the data stored on the machines disk an thus protecting the user from stealing his data as some of the game distributors are doing it now.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 13th Jul 2013 16:47
@Atilla - Interesting idea. I don't think Ubuntu would be the best choice for this application though as it's quite memory intensive.

I had a quick search for lightweight linux distros and Puppy Linux stood out for this reason:
Quote: "Puppy Linux is a lightweight Linux distribution that focuses on ease of use. The entire system can be run from RAM, allowing the boot medium to be removed after the operating system has started.

BOOT FROM CD/DVD - Just boot using the CD/DVD and save to USB flash (you will be asked at shutdown to save or not). If you choose "Save", Puppy will create your save file and use this next time you boot so that you can continue with your previous work.

BOOT FROM USB - While booted from CD or DVD, install Puppy to USB and use it for booting (see Setup in the menu for the installer). You can then tell Puppy at shutdown to save to the same USB drive, or to your hard disk. "


It's only about 140MB so could be loaded onto a frugal USB stick with plenty of space to store data.
Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 13th Jul 2013 17:13
@Obese87

Just now I'm trying with Debian but I just managed to create a working text-only program. Next step I'll try to install DX. I'm using the original editor. While I prefer DarkEdit, I was not able until now to set the parameters in DarkEdit to run/compile the code. DarkEdit runs, but the run/compile should be available. Did you manage to do though? Which parameters did you set in Options/DarkBasic options?

The size of the distribution is widely determinated by the software which is with the distribution (Office, Gimp, SoundEditors and more). But the package manager allow to remove those programs and to minimize the needed disk volume. As long I'm under 2GB I can stay with a DVD and if/when I'm below 700 MB it will run from a CD. Knoppix (with Office) is distributed on a CD though. For a stick I assume 4 or 8GB which should be enough even for a complicated and media rich game. I'll post a "how to" when I'm able to edit/run and compile a program.

kind regards
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th Jul 2013 17:53
I find it's easier to port stuff from Linux to Windows rather than from Windows to Linux.

The idea with Puppy Linux is interesting.

For a game to be portable, you need to have some abstraction layer. Java springs to mind, because it runs on top of universal byte-code. Another one would be Flash, but that's slowly being dominated by HTML5, also a good option. If you don't mind recompiling for every target system, C++ is also an option (but horrible for beginners).

TheComet

Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 15th Jul 2013 22:02 Edited at: 15th Jul 2013 22:09
@TheComet

its is not about porting a game to different platforms, its about delivering a game on a medium that allows to run it in a defined environment.

This would allow to play the game on any computer able to boot the medium with the adapted OS and to play it.

The game could be started on any hardware support to boot and run the OS from the medium. Thus allowing to run it PC-hardware but also on Atom or even a MAC. Without porting it to the respective operating systems.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 16th Jul 2013 01:08
I wonder if there would be any legal restrictions to doing this.
Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 16th Jul 2013 01:39
When using an Open-source environment there should not be any legal problems. If the game is made for DOS we could use Freedos (http://Freedos.org) but DarkBasic needs an Windows-environment (or hopefully) will run under wine.

The FreeDos example I have done for some friends (with a bootable CD) to make old DOS games playable again, when Windows started to block all 8 & 16bit programs. They had only to boot the CD a (trara!) the Game worked. Its an easy and comfortable alternative to DOSBox though and does not need any software installation on the computer (and in some cases even worked with apple-hardware). (Well saving the stats is hard on a CD though).

If starting selling the game the rules will change, but if a game is so good to be sold, I'm sure that a agreement with the developers of the linux distribution can be reached.

In fact some game console already use linux, ouya (https://www.ouya.tv/ uses android) and valve's steam box is based on linux.
Fluffy Rabbit
User Banned
Posted: 16th Jul 2013 06:47
If cross-platform portability is your goal, DarkBASIC is not what you should be using.

Now, in terms of what works where, you have three options:

1. Provide regular binaries of the game on the CD and let the user figure out how to run them (maybe include a Windows and Linux version or whatever).

2. Use a live CD. There are two issues with this. First of all, not all hardware is supported if you are including machine-language binaries for your games (EXEs, et cetera). Secondly, the user would have to figure out how to boot the damn thing! Boot menus and command lines aren't fun for casual users.

3. Use a cross-platform system that is already in place, like Java or HTML/Flash. Python would also work, although most people don't have it installed.

Personally, I would be going for distributing under novel platorms like DOS, the Web, Java, and Linux, thereby maximizing exposure and not needing a Live CD. You talk about other platforms like Ouya, but you are forgetting that Ouya doesn't take CDs. If you are going to distribute for Linux and want to reach all hardware, you have to compile the program multiple times for the different platforms. An ARM linux program won't run on x86 without an emulation layer. I have even seen people distribute 32-bit and 64-bit programs together.

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 16th Jul 2013 21:22 Edited at: 16th Jul 2013 21:23
@OBese

Is it even possible to boot Linux while running windows, and then successfully return back to windows when Linux shuts down? I've been googling the matter and have found this:

http://www.pendrivelinux.com/run-a-live-linux-cd-from-within-windows/

@Attila

I understand, but my point was that you eventually have to do something platform specific, because no computer hardware is the same as the other. This isn't a console where you already know what hardware is in it, there are billions of variations out there, and accounting for them all at hardware level is going to be impossible.

While Puppy Linux could be able to achieve this, I think it's a little over the top to boot an entire operating system (we don't even know if this is possible to do yet), recompile a DBC executable to fit in with the Linux API, just to run a game written in a language outdated by 5 generations.

TheComet

Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 16th Jul 2013 22:33 Edited at: 16th Jul 2013 22:34
@TheComet

You are right about hardware variants, but any linux live-CD solves the problem by analyzing the system and by installing the drivers needed.
And - additionally - it is not necessary to find all the hardware - depending of the game you want to run. If the game does not need to access the network you don't need a driver for the network interface- or the wlan-card and setting the graphic resolution to 1024x768 or 800x600 will run on nearly every system.
Most systems are based on Intel (i586, Atom etc.) and can boot from an usb stick or a cd (not the mobiles though).

I'll try to create a Reactos-live-cd (www.reactos.org). Reactos is a free OpenSource) windows alternative (clone?) an should support Directx8 and most windows api. This would be even compatible as wine.

And I don't think, that booting the game in a virtual machine would be great for the user, because he would have to install virtualbox or vmware player. But shutting down, entering the medium (CD or Stick) and to power on is a thing most users should be able to handle.
Fluffy Rabbit
User Banned
Posted: 17th Jul 2013 15:25
In my vast experience, Puppy Linux is not always works with hardware graphics DBC.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Jul 2013 02:55
Quote: "Is it even possible to boot Linux while running windows, and then successfully return back to windows when Linux shuts down?"

You can run GNU/Linux in a virtual machine in Windows, yes. VirtualBox is pretty good.
Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 18th Jul 2013 12:45 Edited at: 18th Jul 2013 12:55
@OBese
That is how I test the possibilities of a bootable DarkBasic environment. But I'm using VMWare-Player instead of VirtualBox (VirtualBox belongs to ORACLE. Like OpenOffice, MySQL and Java they bought it with SUN). You will not know when they start to make cash with those products. Though I use LibrOffice instead op OpenOffice and VMWare instead of VirtualBox until now a replacement for MySQL is hard to find - most hoster offer MySQL as Database.

VMWare allows to take the vmdk-file (the 'disk') and the vmx-file (Parameter and bios of the virtual machine) and to put it on another computer. If Vmware is installed you can boot the machine with a doubleclick. Which makes the give away of the virtual computer as easy as sending a mail.
Fluffy Rabbit
User Banned
Posted: 19th Jul 2013 01:17 Edited at: 19th Jul 2013 01:18
Send me the CD and I guarantee I will not be able to run your DarkBASIC game in Linux mode. The graphics drivers for various hardware just aren't there for Linux, especially for Puppy.
Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 19th Jul 2013 13:03
@Fluffy Rabbit

Quote: "Send me the CD and I guarantee I will not be able to run your DarkBASIC game in Linux mode. The graphics drivers for various hardware just aren't there for Linux, especially for Puppy. "


1. What sense would it make to give you a CD if you are already sure not to be able to run it. Success is always a question in believing in success.

2. I do not experiment with puppy linux. I'm trying debian.
Fluffy Rabbit
User Banned
Posted: 19th Jul 2013 13:39
@Attila-

Quote: "What sense would it make to give you a CD if you are already sure not to be able to run it"


It was a figure of speech. On computers where a DarkBASIC game would run fine on Windows, the same would not be true with Wine because of DarkBASIC's dependence on DirectX.

Quote: "I do not experiment with puppy linux. I'm trying debian."


Even if you manage to run one of your DarkBASIC games off of a Debian live CD on your computer, you may not be able to get it to work that way on another computer. That's just the facts.
Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 19th Jul 2013 13:50 Edited at: 19th Jul 2013 17:36
Quote: "Even if you manage to run one of your DarkBASIC games off of a Debian live CD on your computer, you may not be able to get it to work that way on another computer. That's just the facts. "


I agree
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 19th Jul 2013 16:28
Yes, driver support is an issue with Linux unfortunately.
Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 19th Jul 2013 17:39
But when we stay with 640x480 (VGA) or 800x600 in windowed mode and without 3D, it should be possible to create a bootable game CD. When wine becomes more flexible it (hopefully) well be possible to use 3d.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 19th Jul 2013 19:12
I have to ask, why not use C in combination with SDL?

http://www.libsdl.org/

It's not dissimilar to the way DBC works (although the C-language is different), and you can EASILY make games for Linux, Windows, Windows CE, BeOS, MacOS, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX without any fuss at all.

I don't see the point with trying to get DBC to run under WINE and use an overly complex solution which requires booting an entire operating system.

TheComet

Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 19th Jul 2013 19:56 Edited at: 19th Jul 2013 19:59
C would be interesting but which C then (C#, VisualC or C++) The functions of C are depending of the operating system and often not compatible to the same function(name) on another OS. I had never heard about SDL (but of QT, which is quite expensiv) - but I'm looking into the documentation just now.
I think that porting a C-program to another OS includes recompiling and adapting the functions to those available in the selected OS. While proting to wine (its an emulater) only needs to copy the program onto the system and starting it with "] wine MyProg.exe".

A attempt to create a programming language for multible systems was Java but - its buggy, got a lot of security leaks and the worst of it: belongs to oracle.

But I started programming (a very long time ago) with FORTRAN, switched then to COBOL and later on to (C64 Basic [ugly no structure]) and then to VAX-BASIC which I did until Digital was destroyed by COMPAQ (and HP later on).

I never learned C, when I started everybody around that Pascal would be the next top programming language and the they tried to sell ADA as the "future". C was limited to amiga hacker and some SCO-unix programmers (unable to read a tape in a program).

I like DarkBasic and DarkBasicpro so much because they offer such nice commands (a.e load object, play music, sprite ...) and functions like "screen width()". And because they are an extremly easy way to program. While the object orientation and the possibility to add desktop elementsof VisualXY is often helpful. DarkBasic is strait forward and simple but gives you bunch of strong commands to create a game.

But the drawback with DB is it runs only on windows desktop and with the plans of microsofts reorganization and with win 8.x menacing at the horizont, an alternative for the OS would come handy. But staying with DB would be nice though.

Porting DB itself to the *ix operating systems would be great. But switching from DirectX to OpenGL could making the port a bit tricky - but it should be possible though. But even DBClassic (which now is free) is not OpenSource and therefore only the copyrights owner can port it and keep it alive when windows ends.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Jul 2013 01:28
I just noticed something. DBC is an interpreted language! It's compiled to byte-code and interpreted by an underlying emulator. If you really want to waste your time, you could write an emulator for another platform...

Quote: "The functions of C are depending of the operating system and often not compatible to the same function(name) on another OS."


You'll need to give me an example of this, because I can't think of a case where you have to change your C code for a different platform. For the code that does change, the library - in this case SDL - handles it for you.

And yes, you do re-compile for every target, but that's what makes it blazingly fast.

Quote: "While proting to wine (its an emulater) only needs to copy the program onto the system and starting it with "] wine MyProg.exe"."


Did you know that WINE stands for Wine Is Not an Emulator? It isn't an emulator, it translates API calls from one target system to the inequivalent API calls of another.

Quote: "Porting DB itself to the *ix operating systems would be great. But switching from DirectX to OpenGL could making the port a bit tricky - but it should be possible though. But even DBClassic (which now is free) is not OpenSource and therefore only the copyrights owner can port it and keep it alive when windows ends."


Why port an old application if SDL/SFML/Ogre3D or whatever library you choose to use does the same thing anyway? You're re-inventing the wheel.

TheComet

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Jul 2013 18:39
It might be possible to someday get DBC to run on Linux through WINE consistently. However, along the lines of what TheComet was saying, why not use something like irrlicht, which completely abstracts the rendering API from the programmer and is cross platform? Even if there isn't DirectX, OpenGL, Mesa, available, it can default to it's own software rendering engine. I mention irrlicht because I'm a little familiar with it, it has full collision, it has special effects, it has multiple 3D mesh type handling - obj, direct x, etc.

When I say use irrlicht, I mean parse out DBC commands to run irrlicht commands. Build your own cross platform DBC engine using irrlicht so you could take DBC source and run it on whatever platform.

The one to one commands would be easy(relatively) - MAKE OBJECT whatever = an irrlicht library call

The program control would be the harder part: looping, storing and managing variables, DBC function calls, jumping to labels, etc. Definitely a difficult task.

Maybe, if you ask TGC and/or Shawn from Star Wraith, you could get the DBC source. Might make things easier (or harder!).

I realize this thread is more of a passing fancy of trying to get DBC running in Linux quick dirty, so it's unlikely anyone would put in the kind of effort that would be needed to build a second engine - even with the shortcuts of using a prebuilt 3D engine.

Enjoy your day.
Attila
FPSC Reloaded TGC Backer
19
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 20th Jul 2013 20:51
@Latch

I managed to run DBC with wine but it only supported ASCII-Screen output and 2D graphics like Circle & box. But any attempt to add some sprites failed. 3D objects where simply infeasible.

For the idea to port DBC-programs to linux with wine this means propably the end.

Quote: "Maybe, if you ask TGC and/or Shawn from Star Wraith, you could get the DBC source. Might make things easier (or harder!)."


But for your idea to get the dbc-compiler interpreter to Linux/Mac (MAC is a *ix though) when I get the source I look into it to port it to Linux (I assume that the DBC-Interpreter as written in C). While I'm an old fashioned programmer, I should be able to learn C and to port the code. Though if someone at TGC is interested send me an email.

The port could be interesting for TGC because opening DB to other platforms would increase the number of possible clients
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Jul 2013 21:10
Building on what Latch is saying, it might even be possible to write a DBC compatible DLL incorporating Irrlicht. All of the rendering calls would be done through Irrlicht, which means DBC would be able to run under WINE (because it's not using any 3D commands, which is what doesn't work from what I gather). That would make it "cross platform" enough.

Then again, DBP runs perfectly under WINE, even with 3D commands. Why not use DBP? It's very similar to DBC.

TheComet

Login to post a reply

Server time is: 2024-04-19 05:04:18
Your offset time is: 2024-04-19 05:04:18