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 / Make an EXE that makes an EXE?

Author
Message
hotron
19
Years of Service
User Offline
Joined: 1st Oct 2005
Location: Australia
Posted: 15th Mar 2008 06:40 Edited at: 15th Mar 2008 06:48
Is it possible to make a program in DBC that can make a program?

EG
A program(1) that when you press space bar it makes another program (2) that prints "Hello"
And then is it possible using the program(1) to edit the program(2) thats made with program(1)?

simply: a game maker engine thingy.....

Thanks in advance

PS{ If you have trouble understanding what I said I can try to explain it better}

Hotron
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Mar 2008 09:25 Edited at: 15th Mar 2008 09:27
You can't replicate the compiler and run DBC code by writing a program in DBC. You could break down the bytes of an exe and write those to a file and then run that file, but you'd either have to have premade the exe or you'd have to know your way around assembly pretty well; and the number of bytes would be very high and this approach would be very impracticle except for small programs.

For a game maker engine written in DBC, you'd probably have to approach it like this:

Create an editor that writes a custom type of file that your game engine would use to create or load objects, sound, images, physics, enemies, etc.

Create a game engine that is it's own exe that runs the custom file that you create with the editor. You could combine the editor and the engine into one app, but it might create unnecessary overhead in the engine. Ultimately, you couldn't create a standalone exe from a game making exe that was created in DBC. Again, you could create the engine and an editor and have the editor create a custom file (maybe a text or binary file) that the engine can use.

Right now TDK man is working on a level maker, the thread is pretty fresh so it should be within the top 10 or so on this board. Try it out (he needs testers anyway) and see what the output file yields. You might be able to create a game engine that can utilize the level file.

Enjoy your day.
hotron
19
Years of Service
User Offline
Joined: 1st Oct 2005
Location: Australia
Posted: 15th Mar 2008 09:27
Thanks. that might work just as good.
I'll check out that level maker.

Hotron
Ed222
17
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: Calgary
Posted: 17th Mar 2008 23:15 Edited at: 17th Mar 2008 23:16
@latch

I know this may sound stupid but what if you made a dba file and put an exe that says #include then a go sub then the user can edit the dba to what ever he wanted in note pad would that work?

Tip Of The Day!: a new rouge anti-virus has risen in 2008 called xpantivirus 2008 don't download this. Please help spread the word.
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 17th Mar 2008 23:44
Ed222,

No, include files are imported into the original source code when the program is being built by the compiler.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 17th Mar 2008 23:47
Doesn't sound dumb at all. I tried it many times - and I refuse to call myself dumb - at least not entirely!

All includes are the first thing loaded and run as part of the DBA script. Trying to load a library using #include after the app has launched just won't work. Look at it like this, once the app is started, it boxes all the script it has available to it in a specifically sized container. The interpreter knows the size and the location of the container and that's where it's gonna read the code from. An #INCLUDE command actually combines the library code with the main program as soon as the main program is run, and then the container is shut.

The idea of using an engine of some sort is the only way to include dynamic data into the app. When you are moving a character around, you are not changing or adding to the program, but you are sending input through open channels designed to read that type of input and the app is programmed to interpret those.

If you really wanted to and didn't mind spending the time, you could create a custom file that had DBC commands in it. In your engine, you would have to parse the commands out (i.e. separate them into usable chunks or commands that you preprogram) and send them to routines or functions that will perform an operation based on these commands. If you sent a command like MAKE OBJECT SPHERE, you would have to have your own function that understands those words and then execute the appropriate DBC command. So basically, your engine would have to become an interpreter of it's own. You could make an engine that reads and runs a file of native DBC commands, but you'd have to program each command yourself.

In creating a game maker, you don't want to reprogram every DBC command. That just doesn't make sense. You want to create an engine that runs a certain way, maybe makes certain types of games, and you want to be able to feed it a data file that will invoke the engine into performing within a set of parameters.

Enjoy your day.
Yodaman Jer
User Banned
Posted: 23rd Mar 2008 18:31
Quote: "...include files are imported into the original source code when the program is being built by the compiler."


I've been wanting to try using those out, but haven't gotten 'round to it quite yet, unfortunately...I just don't understand enough of programming yet.


Thanks BigAdd!!

Login to post a reply

Server time is: 2025-06-04 03:13:25
Your offset time is: 2025-06-04 03:13:25