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.

Newcomers DBPro Corner / DarkBASIC concerns/questions: language interoperability and profilers

Author
Message
Plutarck
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: United States
Posted: 3rd Mar 2003 20:51
Hello, everyone!

I have been looking into various languages, tools, APIs, engines, programs, and "suites" for the right combination to fit a hobby I'd like to start: actual game creation. I can't recall exactly, but I pretty well stumbled onto DarkBASIC by complete accident due to some stray comment on some bulletin board somewhere recently, and it seems like it is exactly the kind of thing I'm looking for - yet I didn't previously even know I was looking for it.

However, before getting into the ever-crucial investments of considerable time, effort, and (of course) money, I have a few remaining concerns; I'd really appreciate it if they could be addressed, so I can move forward in my decision making process.


First, language interoperability - probably the most crucial point. I am very into the idea of making a game easy to radically augment and change by interested people, even without touching a bit of the actual source code (and thus having to release it, even if I didn't otherwise want to for some unimaginable reason); to make this possible beyond variable switching in text files and such, that requires scripting and exposing parts of game code functions/interface. Having attempted to wrap my mind around JavaCC and the principles of parsing scripts and such, I am quite certain that I don't want to have anything to do with creating my own scripting language

So, logically, I want to use a pre-existing language developed and maintained by someone else: Python. If a part of the game is also too sslllloooowww or requires something not otherwise possible/easy in such higher level languages (such as, say, working directly with Direct X, or something like that), that means resorting to C and/or C++.

How can such things be done in DarkBASIC? Just being able to interact with C/C++ code/binaries would be sufficient, I would think, as Python can really just be an add-on to those languages anyway; I'm just a bit fuzzy as to how that might work, or is this just plain not an option with DarkBASIC?


Finally, my question about profilers. In short, does DarkBASIC (Pro or not)...have one? Will it be having one, and if so, when? If one needs to speed up one's program through optimization, obviously one needs to know what to optimize to make any efficient headway - and without a profiler I would imagine that one would be driven to the "breaking out into tears and balling up into a fetal position" method

Of course I have approximately never actually USED a profiler; I just want to know that if I needed one, it would be there, waiting for me


Thanks alot for any help anyone may be able to provide!
"My house has a 3D interface. I'm constantly losing crap, running into things, and it's always a mess."
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Mar 2003 22:07
Firstly, it is entirely possible to embed Python within a dll, and so call it from DB (with darkmatter) or DBPro.

Calling a Python function would then be easy, but having Python iteract directly with the DBPro runtime would be a bit harder.

Just please don't ask me to do it for you ... although it might be fun for me to learn yet another language

There isn't a profiler available for DBPro, but you could get that functionality in three ways - one from within the compiler, one provided by a pre-processor stage adding the profiling code, and one by coding it yourself with conditional compilation.

The first may never happen, although it would be the most efficient.
The second may happen - patch 4 will allow a preprocessor stage so I've heard, and it's only a matter of time before someone adds their own preprocessor. I've got a few ideas in this direction myself.
The third is what I use Believe it or not, you can already use a primitive conditional compilation in DBPro already.
Plutarck
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: United States
Posted: 4th Mar 2003 05:12
IanM: Thanks for your reply, it was quite helpful. I appreciate it

Now on to my reply to your reply:

Quote: "Firstly, it is entirely possible to embed Python within a dll, and so call it from DB (with darkmatter) or DBPro."


Ah, so you can call DLLs from within DB (note: by "DB" I just mean "some variant of DarkBASIC or DarkBASIC Pro") - I did not know that. My knowledge of computers and programming goes suddenly fuzzy in regards to DLLs - I'll have to do some more research there, I guess

But good to know, as that would certainly solve that problem.

Quote: "Calling a Python function would then be easy, but having Python iteract directly with the DBPro runtime would be a bit harder."


Excellant on the first part, and that certainly takes care of most of the issues related to Python. But if I wanted Python to call something in DB, I guess a kind of callback function could be rigged...it's just a more round-about way of doing it. Seems like it would be good enough to work, so that's cool.

Quote: "Just please don't ask me to do it for you ... although it might be fun for me to learn yet another language "


LOL, I know what you mean

But of course I never ask people to do my work for me...however if someone has already done it, I'd love to be able to take advantage of that and get on with solving something that hasn't been so solved


On the profiler:

Interesting, and just what I would expect - not available yet, but enough people are begining to have a need for it that it's only a matter of time for something similar to be worked out. The level of interaction and support from the devs is greatly encouraging, so the likelyhood of sufficient interaction between outside pioneers and devs to bring it about seems pretty good. Excellant


Very informative, and thanks alot for your help.

I wonder though, has anyone already done this sort of thing - that is, using Python with DB, or just some similar level of advanced scripting?

Finally, is there some place which records a kind of "history of DB and it's community" - I'd like to know how long all this has been going on and such, to try to gauge the level of "maturity" of developments and such? That way I'd be less likely to think trivial things - relative to the level of development of DB and the community - haven't been done yet, or expect things to have been done already that are way too advanced or involved to reasonably expect.

"My house has a 3D interface. I'm constantly losing crap, running into things, and it's always a mess."
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 4th Mar 2003 22:29
DB+Darkmatter enhancement pack allows you to access DLLs with LOAD DLL, CALL DLL and DELETE DLL. There is no way to access the DB run-time.

DBPro allows the same commands, but you can also write extensions to the language. You can (if you know what you are doing) access the run-time commands.

Unfortunately there are no call-backs available with DBPro because there is no way to get a pointer to a DBPro function. Of course there always ways to get around that.

I don't think anyone has yet done anything really adventurous with scripting yet (although I might very well be wrong here), but I know of one first go (http://underwaredesign.com/products.php - psprites library) and another just starting (can't say more at the moment).
PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 5th Mar 2003 00:51
Morrow Plutrack,

You are pretty in the same boat as me. I came here with very little knowledge of DB, and ended up buying the thing!

My comment: Go for it! C++ and Visual Basic seem like a breeze to me now!(Yes, I am at school) The syntax is very much the same!

Hope you best of luck with your decision,

cheers.


Toughest line of codecol$=asc(left(Pcol$)),1+str$(rev)+chr(80)+left(right(mid(name$),1),1)

Login to post a reply

Server time is: 2024-11-24 03:39:57
Your offset time is: 2024-11-24 03:39:57