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.

Dark GDK / Creating Executable via code

Author
Message
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 1st Sep 2009 22:43
Hi! First off I'm not sure if this belongs here or in Programming Talk. Anyways, I know how to make an executable using the release mode in VC++ but lets say I have a game engine like FPSC. How would you give the user the option to create an executable?

P.S. This question is really just out of curiosity.

Games are like life, they should never stand still.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 1st Sep 2009 22:58
Well, you really have two options. First is to learn the assembly language of your platform (x86 for Windows, for example), and then add that in, command by boring command.

That's difficult, but if done well, it's fast.

The other option is just to figure out a file format to save your creation (in the case of a game, the level data, players, etc), and then make a program that can read and run this file. Then, you just have the same program, but a different file.

This is easier, but a bit slower. However, if you do it well, it shouldn't be too bad.
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 1st Sep 2009 23:01
Ah ok I understand, thanks!

Games are like life, they should never stand still.
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 1st Sep 2009 23:15
The other option is converting their creation into some other language, such as C++, then using someone else's compiler from within your program.

heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 1st Sep 2009 23:44
Quote: " The other option is converting their creation into some other language, such as C++, then using someone else's compiler from within your program."

Ok thanks!

Games are like life, they should never stand still.
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 2nd Sep 2009 02:40
Quote: "The other option is converting their creation into some other language, such as C++, then using someone else's compiler from within your program."

Hey, that's a great idea! never thought about this, or have something planned, but good to know...

They say it's better to burn out, than it is to fade away...
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 2nd Sep 2009 03:21
Converting the code would be a pain though. you would need a full keyword file for the language and then a converted keyword file(for each command so for dbp if it saw Sync On then it would find dbSyncOn() in the other keyword file)


among other things it's a pain lol. tried that one time

New Site! Check it out \/
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 2nd Sep 2009 03:24
Quote: "The other option is just to figure out a file format to save your creation (in the case of a game, the level data, players, etc), and then make a program that can read and run this file. Then, you just have the same program, but a different file."


A more convenient alteration on this idea is to store this file at the end of the engine EXE itself.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 2nd Sep 2009 07:52
You could also use an architecture where you have 2 standard EXE's ... eg. one for your editor and one to run the game...

Instead of generating an EXE file from your editor when a game is finished, generate a batch file of some kind, to pass you "game.exe" file the proper command line arguments to load the game data file....

Would be easier to do that than trying to generate an entire EXE... which is quite complex to do properly.

If it ain't broke.... DONT FIX IT !!!
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 7th Sep 2009 02:37
Even though i probly won't understand, but wheere can i find information on the assembly language of my pc?

New Site! Check it out \/
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 7th Sep 2009 08:59
If you have a engine like fpsc, then i think you can esaily make a button in the editor, that will copy over the engine's exe to a folder, with all data the game(editor map) needs, you could then export all data of the editor into txts. And make it readable for the engine exe, so for example for one world and posistion and scale the editor would export it like this:

world.dbo
0
0
0
100
100
100

Engine would have some sort of read system, not that difficult and export the strings into integers (atoi maybe?) and then you could use it to load up things. Like the engine would load world.dbo and place it at 0 0 0 and scale would be 100 procent.

So basicaly the engine'exe is a game itself, all he does is search and activate.

That would be my way, you can do this for all settings and events in a game.

Hope i helped a bit,

Red Eye


jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 7th Sep 2009 18:43
Be careful - I don't think you can copy a an exe which is running because it will be inaccessible. I may, of course, be wrong; it is a good idea for other reasons to have an editor exec separate from a standard engine exe.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 7th Sep 2009 19:24
Quote: "it is a good idea for other reasons to have an editor exec separate from a standard engine exe.
"


That is what i meant.
It will copy the engine exe. But you are working on he editors exe.


Login to post a reply

Server time is: 2024-10-06 05:33:37
Your offset time is: 2024-10-06 05:33:37