Re: Developing a game engine
Welcome to the forums :wave:
That functionality is already built into the .NET IDE - just "Build" your solution and an EXE file will be created for you.
Re: Developing a game engine
Hello Hack, and thank you.
However, I don't think that's what I need. I know I can use the Build Solution option to create a .exe of my game engine. But what I need is that my users (my users being game developers, not players) will be able to build their games using my engine and then my engine (my application, not visual studio itself) will build a .exe of their game project. Basically, my users have no access to visual studio whatsoever.
I develop a game engine --> I give it to my user --> My user creates a game with my engine --> My user asks my engine to "build" a .exe --> The resulting .exe is a game.
I don't know how to make my application compile that for the user.
Re: Developing a game engine
You can't make an .EXE unless you run source code through a compiler.
Your best bet would be to have your friends get the same version of .NET you have and they can use that to make their .EXE
Otherwise, you will have to make your own compiler for .NET and that ain't gonna be easy, if it is even possible.
Re: Developing a game engine
Hmm... but, hey... I have seen 2d game engines that do just that and all I have to do is press one button. For instance, I believe Game Maker does export to .exe file or something.
Re: Developing a game engine
I'm betting it does the export to an "or something"....not an exe file.
You can get something to export to a file (an exe is an executable set of programming code), but that is not the same as compiling source code into an executable exe.
Re: Developing a game engine
Ah, so perhaps what I should do is export to "Some piece of data" along with an application that "reads the piece of data" to produce the game? That sounds about good.
I think I know how to "compress some data" and read it from another application... but how would that work with graphics/audio? I don't want the players to be able to fiddle with them...
Re: Developing a game engine
You wan't to create something like Game Maker with VB.NET - you are kidding right :)
Re: Developing a game engine
Quote:
Originally Posted by
mitko29
You wan't to create something like Game Maker with VB.NET - you are kidding right :)
Did I say I was creating something like Game Maker with VB.NET? Really? Are you kidding me?
In any case - no. It is a game engine, but something by far simpler and mostly for learning. I am curious about the "game compilation" mechanics used in various engines like Game Maker. In fact, I only mentioned Game Maker in my last post as an example of such mechanic - in the whole rest of this thread Game Maker is never mentioned.
Re: Developing a game engine
Quote:
Originally Posted by
Solemni
Did I say I was creating something like Game Maker with VB.NET? Really? Are you kidding me?
In any case - no. It is a game engine, but something by far simpler and mostly for learning. I am curious about the "game compilation" mechanics used in various engines like Game Maker. In fact, I only mentioned Game Maker in my last post as an example of such mechanic - in the whole rest of this thread Game Maker is never mentioned.
Let just say it this way Visual Basic is not the right tool to create game or game engine,and if visual basic is your first programming language...... forget it.
Re: Developing a game engine
Quote:
Originally Posted by
mitko29
Let just say it this way Visual Basic is not the right tool to create game or game engine,and if visual basic is your first programming language...... forget it.
Whats up with the discouraging posts? Everything is possible.
Re: Developing a game engine
Quote:
Originally Posted by
Atheist
Whats up with the discouraging posts? Everything is possible.
I am not saying that is not possible , just the visual basic is not the right tool for this enterprise.
Re: Developing a game engine
It is a good tool if he were to use a nice graphical library such as DirectX or XNA. I was able to make some pretty hefty games with zero slowdown using VB6 and VB.Net.
Re: Developing a game engine
Quote:
Originally Posted by
mitko29
I am not saying that is not possible , just the visual basic is not the right tool for this enterprise.
Perhaps, or perhaps not. Whatever the case, I did make clear this was mostly for learning purposes, and we are certainly going off-topic. It was my intention to understand how this kind of compiling mechanic works (particularly in game engines) - simple as that.
Also, this is a VB.NET forum with a "Games and Graphics" category with decent activity and abundant topics within. It is plain obvious I can make games with VB.NET just fine - perhaps with more hassle than other choices, but not so dramatically.
Re: Developing a game engine
I am curious: Are you new to the .NET Framework or new to VB.NET only? I know you mentioned you are using VB.NET, though there is a way to compile an application from source in a C# application... Certainly worth mentioning?
You actually make use of the C# Code Compiler to do this, and I have a project running in an enterprise environment that makes use of this... Try the following example. Note though that I do not feel the need to comment what anything does. It is pretty straight forward if you follow the documentation on the CodeDom and CSharp assemblies in MSDN.
I know it's not quite what you were looking for, but I'm sure with a bit of logic in your "game maker" app you can actually generate the appropriate C# source file and run it through this compiler?
Code:
using System.IO;
using System.Reflection;
using System.CodeDom;
using System.CodeDom.Compiler;
using Microsoft.CSharp;
static void CompileSomething()
{
string SourceCode = new StreamReader("c:\\test.cs").ReadToEnd();
CSharpCodeProvider prov = new CSharpCodeProvider();
CompilerParameters compParam = new CompilerParameters();
compParam.ReferencedAssemblies.Add("System.dll");
compParam.ReferencedAssemblies.Add("System.Windows.Forms.dll");
compParam.TreatWarningsAsErrors = false;
compParam.GenerateExecutable = true;
compParam.GenerateInMemory = false;
compParam.OutputAssembly = "C:\\temp\\test.exe";
CompilerResults result = prov.CompileAssemblyFromSource(compParam, SourceCode);
}
The content of the "test.cs" file is basically just copied and pasted from a Windows Forms application, but to be complete, here it is anyway:
Code:
using System;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
namespace WindowsApplication1
{
partial class Form1
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
components.Dispose();
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "Form1";
}
}
}
namespace WindowsApplication1
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Re: Developing a game engine
Hi :wave: my recomendation is to denvelop the game engine into a
an access or mySql database... I did something like that for wc3 Dota
an items searcher very similar to the warcraft's game layout :afrog:
but for graphics you can use XNA FrameWork and Directx Api
when you use slq statement, you can access it from very diferents language...
C++ vb.net php and from any Operative System
Re: Developing a game engine
So... before you worry about the compilation problems... do you even have the basic code needed to create sprites yet? Having it compile into a single EXE is about step 953 on a project like this... I'm just curious if you're even at step 23 yet. If not, you really need to start smaller and simpler.
Re: Developing a game engine
Its good advice Jenner, but.. on topic I would imagine there are two ways to go
A) Compile .net as BillGeek suggests. Then you link the .net code with the game libs you need.
B) Script your game engine. Merge and compact scripts into a dat file the your Game engine exe loads and excutes. Wintermute is a great example which combines both editors and scripting and compile it into a standard game runner + a data package.
Re: Developing a game engine
Exactly, I've seen both methods.
Re: Developing a game engine
@BillGeek: thanks! I will take a look at that and report later.
Quote:
Originally Posted by
Jenner
So... before you worry about the compilation problems... do you even have the basic code needed to create sprites yet? Having it compile into a single EXE is about step 953 on a project like this... I'm just curious if you're even at step 23 yet. If not, you really need to start smaller and simpler.
Yes, I already have. As I said, it is a rather simple project - a very basic game engine. Otherwise I wouldn't be asking this.