Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Porting EO on more recent BASIC dialect


darkhog
 Share

Recommended Posts

I didn't know where to put it, so I've put this here.

While I know why you decided on using VB (it is easy and anyone can pick up EO codebase quickly, thanks to that), let's say this: VB6 is old and very, very legacy. It has currently same status like Eclipse Stable ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png).

It is already a chore to get to INSTALL VB6 on Windows 7, probably more with W8 (and guess what may happen when Win9 will came around? W10? At this point, VB6 will be as supported as DOS games/apps are supported on Win7 without hacks like DOSBox), not to mention shady legal aspect of it ([more info on the subject](http://www.vb6.us/tutorials/vb6-download)).

So how about porting EO on more modern BASIC dialect, like FreeBASIC, GAMBAS, heck even more recent version of VB? This won't have to be complete rewrite either, as FreeBASIC and recent VB versions are (mostly) compatible in terms of syntax and features, not sure about GAMBAS though.

Doing it in FB (FreeBASIC, not Facebook ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png)) has also this advantage that if you'll do drawing either using internal FB drawing library or OpenGL, you can also achieve compatibility with other operating systems supported by FreeBASIC, such as Linux or MAC (and if game's author wouldn't be interested in compiling for Linux/Mac, there will be at least compatibility at Wine level).

Of course this won't be easy task, even if complete rewrite wouldn't be needed (and it probably won't be, at least in case of FB and recent VB), and frankly I wouldn't do it myself, but I just know that it has to be done at some point. The sooner, the better.

Also I'm not talking about Eclipse.NET as .NET sucks and is more memory hog that Java is (Minecraft with lots of mods eats about 2.5GB, while vanilla Manic Digger, .NET clone which has limited world size (10000x256x10000, but it is dependant on config), eats sometimes even 3.2GB), and it isn't as compatible as Java in terms of platforms. Yes, there's Mono, yes, there's MonoGame, but both projects are inferior to .net (Mono lacks a lot of features found in "official" .NET runtime).
Link to comment
Share on other sites

Do you have any idea how much time and effort it requires to reprogram such a thing? The idea has been widely discussed mind you, it's just not as simple as people tend to assume.

I see you posting on this, and asking people to do things that're simply not possible for the current language and I wonder, are you not expecting too much from a free tinkertoy that people just work on for fun?

EDIT: I looked at FreeBasic, and to get an ORPG engine to run in it you'd need to make two versions still: Linux and Windows, since it uses API commands rather than its own library for such things. Again, it isn't as easy as one might imagine. It lacks a lot of functionality that'd be required for something like this and the way it is handled as well. So, a complete rewrite would be required.

And enlighten me, what version(s) of VB that are recent are not .NET based?
Link to comment
Share on other sites

> probably more with W8

Nope.

Also, after researching it a bit I came across the fact that VB.NET is actually 20% slower than VB6\. Yes, it is more supported, but there's no real point in upgrading if what you're doing is downgrading.
Link to comment
Share on other sites

For the record, I have had zero trouble getting it to work on Win7 and Win8, just need to know the trick of manually restarting the setup. ;]

Anyway, don't get me wrong. A more recent programming language would be beneficial. BUT, would you write a complete game engine for free just for the hell of it? Or would you be willing to teach everyone here to work with a new language? Not to mention, such projects have been worked on in the past, Java, C++, C# and various incarnations of these languages. But the sheer amount of work required puts people off and makes them stop, not to mention most of this community is too greedy to even appreciate part of the effort it takes to write something from scratch.
Link to comment
Share on other sites

> Nope.
>
> Also, after researching it a bit I came across the fact that VB.NET is actually 20% slower than VB6\. Yes, it is more supported, but there's no real point in upgrading if what you're doing is downgrading.

This is complete and utter hearsay. Provide evidence or cite non-hearsay sources. Just because person A decides to write inefficient code in VB.NET and declares it slower than what they wrote in VB6 does not constitute VB.NET (and thus the CLR) being slower than VB6\. There are two possible reasons (and only two that I'm aware of) why Vb.NET will run slower than VB6:

1) Debug/JIT. .NET's debugger is FAR more complex and processes a hell of a lot more than VB6's. Also, "start with debugging" will run inherently slower due to the JIT/CLR debugging the app at run-time; this is honestly a no brainer.

2) Inefficient code. Yes, please nest If/Then/Else statements and make API calls incorrectly.

If you're still not sold, we'll have a contest: Write an application, in VB6, that iterates through an array with 250,000 NULL indexes on a non-UI thread; time the operation and print it to a label on the form. I'll do the same in VB.NET and we'll compare times in milliseconds.
Link to comment
Share on other sites

I'm not talking about different LANGUAGE, but different BASIC DIALECT. BASIC will be still BASIC, just some syntax elements are different (but not much).

The only things that would really change is compiler being used and/or some of the codebase.

I'm not talking about making it Shit++ (seriously, using pointers in method calls when simple variable would be sufficent? Oh, come on!), or even Java/Pascal.

Just. Use. Modern. BASIC. Damn. It.

> For the record, I have had **zero** trouble getting it to work on Win7 and Win8

> just **need to know the trick** of manually restarting the setup. ;]

![](http://www.google.pl/url?source=imglanding&ct=img&q=http://cdn.memegenerator.net/instances/250x250/9869953.jpg&sa=X&ei=nFidUNiIGoT5sgaorYHIDw&ved=0CAkQ8wc&usg=AFQjCNGiAQZkOkKLgKIBjYxl4fGdhNd70g)

And guess what? With time more and more "tricks" will be needed to get it to work.

With modern BASIC dialect, such as FreeBASIC, those issues will be minimal, if any.

> (…)after researching it a bit I came across the fact that VB.NET is actually 20% slower than VB6\. Yes, it is more supported, but there's no real point in upgrading if what you're doing is downgrading.

That what I was talking about, not only it is slower but it is also more memory-inefficient.

> EDIT: I looked at FreeBasic, and to get an ORPG engine to run in it you'd need to make two versions still: Linux and Windows, since it uses API commands rather than its own library for such things.

I'd might agree, but there are lot of crossplatform libraries that will make them just to recompile on Linux. GUI? QT/GTK. Graphics? 2D OpenGL calls (yes, DX subsystem would have to be rewritten to be OGL subsystem, but vast majority of engine - map format, chat functions, collision routines won't), Audio? OpenAL, Allegro, etc.

> Again, it isn't as easy as one might imagine. It lacks a lot of functionality that'd be required for something like this and the way it is handled as well. So, a complete rewrite would be required.

You're jumping to the conclusions here. While I ***agree***, that it won't be easy task, it by no means would require COMPLETE rewrite. Just some refactoring.

Also FreeBASIC isn't "tinkertoy to play with", as you wrote. True, it lacks good IDE (there are some FB IDEs out there, but we have yet to see something that would be for FreeBASIC same thing what Lazarus is for FreePascal), but other than that it's powerful and useful language.
Link to comment
Share on other sites

> Also FreeBASIC isn't "tinkertoy to play with", as you wrote. True, it lacks good IDE (there are some FB IDEs out there, but we have yet to see something that would be for FreeBASIC same thing what Lazarus is for FreePascal), but other than that it's powerful and useful language.
>
> I meant Eclipse.
>
> > And guess what? With time more and more "tricks" will be needed to get it to work.
> >
> > Because restarting the setup is hardcore and tricky right?
> >
> > And are you even reading what nonsense you're spouting about not having to rewrite it? have you even LOOKED into the programming languages you've suggested? They are nothing alike aside from the way IF -> END IF works. There is no easy porting it over, it's rewriting the entire thing in a new language under the same theories. Just because it has BASIC in the name does not mean you can copy/paste the code and make minor adjustments to make it work. VB6 and FreeBasic for example have near to nothing that makes them similar, forms, standard API libraries and a lot of direct calls to Windows subset commands as well as a whole bunch of graphical methods are completely different or non existant.
> >
> > If you think it's so similar and must not be hard, what's stopping you?
Link to comment
Share on other sites

Just to put this VB.NET vs. VB6 debate into a grave and to throw some dirt on it, here's the results via a screenshot and the code..

**NOTE**: This is ran from the compiler while debugging. Also, I'm declaring and instantiating before performing the arithmetic; all of it is included in the timed result. ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png) Also forgot to mention that this is done on a WPF form.. lulz.

Imports System.ComponentModel

Imports System.Timers

Class MainWindow

Private WithEvents bgWorker As New ComponentModel.BackgroundWorker

Private Sub bgWorker_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles bgWorker.DoWork

Dim startTime As Date = Date.Now

Dim x(250000) As Integer

For i = 1 To 250000

x(i) += 1

Next

Dim endTime As Date = Date.Now

Dim execTime As TimeSpan = endTime.Subtract(startTime)

e.Result = execTime.Duration.TotalMilliseconds.ToString()

End Sub

Private Sub StartTimer_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles StartTimer.Click

bgWorker.RunWorkerAsync()

End Sub

Private Sub bgWorker_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bgWorker.RunWorkerCompleted

TimerResult.Content = "Result in Milliseconds: " & e.Result.ToString()

End Sub

End Class

Thanks for playing. Now on to the topic of discussion: I wouldn't advise writing anything graphically persistent in any language aside from what is highly documented, supported (by and without third-party assemblies), and used. Stick to .NET (C#, VB.NET) or C++.
Link to comment
Share on other sites

> Stop arguing about Vb6 and .NET altogether.
>
> We all know C is better choice.

If you like memory leaks, then yes (although this is problem of .NET too)

Also this alone: [http://www.vb6.us/tu…ls/vb6-download](http://www.vb6.us/tutorials/vb6-download) should be reason to move on to different BASIC dialect. I bet most of EO devs (maybe except main ones, but… who knows?) got VB6 out of torrents. Yes, I did too, and yes, if there would be possibility to buy vb6 license, I'd do that.
Link to comment
Share on other sites

> If you like memory leaks, then yes (although this is problem of .NET too)
>
> Also this alone: [http://www.vb6.us/tu…ls/vb6-download](http://www.vb6.us/tutorials/vb6-download) should be reason to move on to different BASIC dialect. I bet most of EO devs (maybe except main ones, but… who knows?) got VB6 out of torrents. Yes, I did too, and yes, if there would be possibility to buy vb6 license, I'd do that.

#facepalm
Link to comment
Share on other sites

> If you like memory leaks, then yes (although this is problem of .NET too)
>
> Also this alone: [http://www.vb6.us/tu…ls/vb6-download](http://www.vb6.us/tutorials/vb6-download) should be reason to move on to different BASIC dialect. I bet most of EO devs (maybe except main ones, but… who knows?) got VB6 out of torrents. Yes, I did too, and yes, if there would be possibility to buy vb6 license, I'd do that.

I own a legitimate copy of Visual Basic 6.0 Professional; still packaged in the original box along with the MSDN cd. I refuse to install it.
Link to comment
Share on other sites

[background=transparent]I decided to run a test for vb6 and I get 3ms from the compiler.[/background][background=transparent] Also this is not an even comparison because I have a 2.60ghz processor so unless you have similar specs then its just a guessing game.[/background]

Here is my code.

```
Private Declare Function timeGetTime Lib "winmm.dll" () As Long

Private ArrayLoop(250000) As Integer

Sub runTest()

Dim x As Long

Form1.lblStartTime.Caption = timeGetTime

For x = 1 To 250000

ArrayLoop(x) = 1

Next

Form1.lblEndTime.Caption = timeGetTime

Form1.lblResult.Caption = Form1.lblEndTime.Caption - Form1.lblStartTime.Caption

End Sub
```
Link to comment
Share on other sites

> He didn't just do a loop, he did randomising for each array index, and then sorted the whole array by acsending or descending order.
>
> EDIT: Oh nvm. Lol - I know Budweiser and Exception was doing the benching and obviously, VB6 is slowz when put to a larger test.

Randomizing and putting the array in order is a different ball game then you will have different search algorithms that could impact the speed.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...