ComineGL: Game Library for Learning Programming in C/C++

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
devetc
Posts: 22
Joined: Thu Nov 11, 2010 1:51 am
Contact:

ComineGL: Game Library for Learning Programming in C/C++

Post by devetc »

Hello All,

I have been working on an open source game engine based on Irrlicht to teach basic programming in C/C++. I have finished the basic elements of the system. I would really like some opinions on the project. It would really help me focus on future problems.

Project Name: ComineGL http://code.google.com/p/cominegl

An example program initializes the game engine

Code: Select all

#include <ComineGL/ComineGL.h>

int main(void)
     {
     CGLEngine engine(400,400);

     engine.GameLoop();

     return 0;
     }

I have made some tutorials on the website showing how to load
textures/nodes/meshs/sounds...


Thanks.
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

You transformed Irrlicht in a very C style library and I found this pretty harder to use :o
http://comine.com/1622/tutorial3.htm
It reminds me of a guy on Irrlicht forums who wanted to do stuff like this :

Code: Select all

void setNodeTexture(ISceneNode *node, ITexture *texture) {
node->setMaterialTexture(0, texture);
}
Which is pretty useless, I mean a very nice feature of Irrlicht is its C++ usage, isn't it ?
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

It definitely transforms the engine into something much more C-style. It reminds me of Dark GDK. Both are very easy to start out on, but because of their nature, doing complex or advanced tasks becomes very hard very quickly.
Tihtinen
Posts: 76
Joined: Fri Jan 08, 2010 3:12 pm
Location: Finland

Post by Tihtinen »

I think I can see what you are trying with this project, but if the goal is easiness of use shouldn't you instead try to wrap the engine to some scripting language, like lua? : ) Well, just wondering :D
devetc
Posts: 22
Joined: Thu Nov 11, 2010 1:51 am
Contact:

Post by devetc »

Thanks all for looking at my project and commenting about it.

The purpose of the project is


1. Offer someone who is just starting to learn C/C++ to a build graphics applications. streaming io with printf/scanf/cin/cout is pretty boring to convince someone of the fun in building software.

2. Get someone to write more code because it is fun.

3. Heavy use of classes, object pointers, templates, and other object oriented ideas does not bode well for someone just starting to learn an if statement.

4. Reduce someone's learning curve to understand graphics (ie textures,
scene graph nodes, meshs,...)

5. Introduce abstract concepts such as scene graphs tree hierarchy with scene nodes without the need to understand data structure trees.

6. Focus on large software construction and game development. By letting the game library hold the state of varied objects as integers, one can focus on writing more structure with functions and modular design. For instance, the following function is very useful for a fps style game

Code: Select all

bool FireMissileAtTarget(void)
  {
  // Reference the camera with an id and create a new
  // node for the missile and fire in that direction of what the camera
  // is looking at by adding an animator to the node.  
  //  Start a task(function) so that after 3s, the missile 
  // node is automatically unloaded.  
  // Start another task that repeats every 50ms checking if the missile
  // node is close to any target.
  }
If we did not have the library hold the state, one would end of writing container classes to keep track of different object. They would need to pass the container classes and objects globally or through excessive function arguments.

The above function could be called in and tested in a repeated task executed every 50ms which checks if the SPACEBAR is pressed and call
the above function .

Although a scripting language like lua could have been used, it would be better to expose someone to languages like C/C++ which is more likely to be in their future(...or through derivatives such as java/c#/objective C/Perl/...).


Hope my arguments make sense....
macron12388
Posts: 126
Joined: Wed Sep 29, 2010 8:23 pm

Post by macron12388 »

I like what you're doing.

Personally, I started out as a little kid with Python, Lua and BASIC, ti-basic (lol TI-83 game :P ). Obviously those have their limitations, so naturally I began to learn actual compiled languages.

I agree it can be a bit daunting to learn c++, but it really isn't that hard, especially if they have a true passion, and isn't that what we want in the big-time/indie game industry?
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

I think that's really cool. Simplifying something down to this is a really great way to get people like programming. Learning object oriented programming can be a bit daunting to begin with, but people should know that it's also a powerful process once you get used to it.
devetc
Posts: 22
Joined: Thu Nov 11, 2010 1:51 am
Contact:

Post by devetc »

Hello All,

I have just finished more updates to the ComineGL library v0.12
http://code.google.com/p/cominegl


For example, the following code will load up a quake level.

Code: Select all

#include <ComineGL/ComineGL.h>

int main(void)
	{
	CGLEngine engine(600,600);
	
	CGLZipFileAdd("map-20kdm2.pk3");
	CGLMeshLoadFile(1,"20kdm2.bsp");

	CGLNodeLoadMesh(10,1);

	CGLNodeLoadCameraFPS(0);
	CGLNodeSetPosition(0,1000,1000,1000);

	CGLNodeAnimatorAddCollisionResponse(0,10,1,5,50,-0.5);

	engine.GameLoop();
	return 0;
	}
Image


In the next example of loading a single skynode with the six textures.

Code: Select all

#include <ComineGL/ComineGL.h>


/////////////////////////////////////////////
int main(void)
	{
	CGLEngine engine(400,400);

	// Load up 6 textures (id=1-6) for sky box
	CGLTextureLoad(1,"sky_front.jpg");
	CGLTextureLoad(2,"sky_back.jpg");
	CGLTextureLoad(3,"sky_left.jpg");
	CGLTextureLoad(4,"sky_right.jpg");
	CGLTextureLoad(5,"sky_up.jpg");
	CGLTextureLoad(6,"sky_down.jpg");
	
	// Create node skybox id=100
	CGLNodeLoadSkyBox(100,1,2,3,4,5,6);

	// Load up Camera id=0
	CGLNodeLoadCameraFPS(0);

	CGLGameLoop();

	return 0;
	}


Image


There are more examples for fonts, billboards, animations(sprites), scene graphs... in the tutorials http://comine.com/1622/intro.htm. There is a video in the tutorial for configuring VS2008 for using the library.

I made the tutorials really simple. So, I hope no one is offended by their simplicity. I am trying to get people to learn C/C++ programming with the library.

I really need suggestions for the more functions and primitives to keep coding. It would really help if I knew what development platforms
(os / ide/...) that people really use. Any opinions would be really appreciated.

Thanks in advance.
[/url]
wahagn
Posts: 186
Joined: Sat Dec 06, 2008 5:11 pm
Location: Zundert (Netherlands)

Post by wahagn »

I like this very much, it's very easy

BTW Can you already use collision detection with this library??

Edit:I hope you're gonna put a forum on your site so I can ask questions beacause I'm definitely intrested and probably I'm going to use this library since I'm trying to make a game and c++ is a bit too complex for me to understand ( pointers and classes etc).
“Any code of your own that you haven’t looked at for six or more months might as well have been written by someone else.”
(Eagleson’s Law)
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

wahagn wrote:I like this very much, it's very easy

BTW Can you already use collision detection with this library??

Edit:I hope you're gonna put a forum on your site so I can ask questions beacause I'm definitely intrested and probably I'm going to use this library since I'm trying to make a game and c++ is a bit too complex for me to understand ( pointers and classes etc).
While this library is a cool tool to draw interest, I strongly recommend that if you're going to build a full game, you learn C++. While stuff like pointers and classes can be hard to understand at first, they are very powerful tools. Trying to code a whole game without them will cause you to write way more code than if you used proper OOP technique.
devetc
Posts: 22
Joined: Thu Nov 11, 2010 1:51 am
Contact:

Post by devetc »

wahagn wrote:I like this very much, it's very easy

BTW Can you already use collision detection with this library??
Tutorial7 demonstrates how to add collision detection. Sorry for not fully documenting all the functions except through the tutorials. It will take time to write up full documentation on the api.
devetc
Posts: 22
Joined: Thu Nov 11, 2010 1:51 am
Contact:

Post by devetc »

slavik262 wrote:
wahagn wrote:I like this very much, it's very easy

BTW Can you already use collision detection with this library??

Edit:I hope you're gonna put a forum on your site so I can ask questions beacause I'm definitely intrested and probably I'm going to use this library since I'm trying to make a game and c++ is a bit too complex for me to understand ( pointers and classes etc).
While this library is a cool tool to draw interest, I strongly recommend that if you're going to build a full game, you learn C++. While stuff like pointers and classes can be hard to understand at first, they are very powerful tools. Trying to code a whole game without them will cause you to write way more code than if you used proper OOP technique.
Slavik262 is correct. I agree with him. In the long run, it would be advisable to learn C++ and OOP.

But the library is not a replacement for an optimized object oriented library. The cominegl library is to get someone to start developing graphical programs quickly when they just have started to learn programming because the learning curve is way too high to really develop games in C++ from scratch.

In the ideal world, one would need to learn

1. Programming in C/C++
2. Object Oriented Programming
3. Data Structures
4. Graphic Libraries
5. Sound Libraries
6. Version Systems
....

By the time anyone has gotten to learning all of these topics, the fun for building games would have disappeared. I believe that the best ideas in software come from people just beginning to learn to program.

It would be better if people get started to build nice looking software (like games) and over several years transition to a deeper level programmer.
One of my professors once told me "little steps for little feet", and I think that is very appropriate here. You take baby steps before you begin to walk and run.

There are dozens of books on game development. But they focus on the back end of the game (The Graphics API (ie OpenGL/DirectX...). I want the library to focus on the game not the backend.

I want to
"make the cominegl game api so absurdly silly, so that one focuses on the problem(the game)"

Comments would be greatly appreciated.
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

devetc wrote:In the ideal world, one would need to learn

1. Programming in C/C++
2. Object Oriented Programming
3. Data Structures
4. Graphic Libraries
5. Sound Libraries
6. Version Systems
....

By the time anyone has gotten to learning all of these topics, the fun for building games would have disappeared. I believe that the best ideas in software come from people just beginning to learn to program.

It would be better if people get started to build nice looking software (like games) and over several years transition to a deeper level programmer.
One of my professors once told me "little steps for little feet", and I think that is very appropriate here. You take baby steps before you begin to walk and run.

Comments would be greatly appreciated.
I think all the things you listed are important to learn before you take on a full-scale game. After five years of coding, I've finally picked most of it up and am trying a full-scale game. For people starting out, I strongly suggest doing something small, like mini-games. As you gain experience, you learn more and more about why things are done in a certain way, and better ways you can do things the next time. Also, don't be discouraged. Games are a lot of work, so keep learning and developing your skills. A final piece of advice I'd give is to work with a team. The workload is so massive that you'll probably want help at some point if you want a completed project.
goody
Posts: 1
Joined: Fri Jul 17, 2009 10:34 pm
Location: Libya

Post by goody »

:shock: :shock: :shock:
man you are the greatest man i ever seen i was just wishing that
if there is just a programmer could help the ones like me you know
those who have passion about programming games in c\c++ but
cant find the easy way so i thank you again and i swere when i will
be a good programmer i will help you guys with every thing i got
... :D :D :D
wahagn
Posts: 186
Joined: Sat Dec 06, 2008 5:11 pm
Location: Zundert (Netherlands)

Post by wahagn »

Will you be able to maak 2d app's with this library ?? In the tutorials on your site there isn't a 2d part
“Any code of your own that you haven’t looked at for six or more months might as well have been written by someone else.”
(Eagleson’s Law)
Post Reply