-
Feb 2nd, 2012, 11:25 AM
#1
Thread Starter
New Member
Developing a game engine
Hi there I am a bit new to VB.NET and I am planning to develop a 2d game engine.
The game engine will let you edit your own game levels (with collisions and monsters etc), using your own resources from a "Resources" folder (contains graphics and audio).
And when you finish your game, my game engine will let you compile your whole game (including the resources) into one single .exe file and will let you share the .exe file with everyone (they simply have to run the .exe and can already play the game).
I already finished my engine (in the sense of building game levels). But I have no idea how to do the compiling part.
How can I do that? How can I make a button that, when pressed, will compile a whole project into one .exe file?
What are your ideas?
-
Feb 2nd, 2012, 12:19 PM
#2
Re: Developing a game engine
Welcome to the forums
That functionality is already built into the .NET IDE - just "Build" your solution and an EXE file will be created for you.
-
Feb 2nd, 2012, 12:24 PM
#3
Thread Starter
New Member
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.
-
Feb 2nd, 2012, 01:05 PM
#4
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.
-
Feb 2nd, 2012, 01:11 PM
#5
Thread Starter
New Member
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.
-
Feb 2nd, 2012, 01:23 PM
#6
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.
-
Feb 2nd, 2012, 01:27 PM
#7
Thread Starter
New Member
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...
-
Feb 2nd, 2012, 04:03 PM
#8
Addicted Member
Re: Developing a game engine
You wan't to create something like Game Maker with VB.NET - you are kidding right
-
Feb 2nd, 2012, 08:23 PM
#9
Thread Starter
New Member
Re: Developing a game engine
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.
-
Feb 3rd, 2012, 05:52 AM
#10
Addicted Member
Re: Developing a game engine
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.
-
Feb 3rd, 2012, 06:20 AM
#11
Re: Developing a game engine
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.
-
Feb 3rd, 2012, 07:04 AM
#12
Addicted Member
Re: Developing a game engine
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.
-
Feb 3rd, 2012, 11:47 AM
#13
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.
-
Feb 5th, 2012, 11:31 PM
#14
Thread Starter
New Member
Re: Developing a game engine
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.
-
Feb 10th, 2012, 05:52 AM
#15
Hyperactive Member
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());
}
}
}
-
Feb 16th, 2012, 08:54 PM
#16
New Member
Re: Developing a game engine
Hi 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
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
-
Feb 20th, 2012, 05:06 PM
#17
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.
-
Feb 21st, 2012, 08:17 AM
#18
Lively Member
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.
-
Feb 21st, 2012, 10:09 AM
#19
Re: Developing a game engine
Exactly, I've seen both methods.
-
Feb 21st, 2012, 09:03 PM
#20
Thread Starter
New Member
Re: Developing a game engine
@BillGeek: thanks! I will take a look at that and report later.
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|