Sign in to follow this  
LostSnow25

What should a 2D game engine have?

Recommended Posts

Quote:
Original post by LostSnow25
I know that, but what if it was intended for others to be able to use it as well? Like a free 2D engine libary?
Creating a general 2-D or 3-D game engine/library/toolset is one of the more difficult projects one can undertake, and requires a considerable amount of experience with both game development and software design. Furthermore, it's already been done many times over.

I'm not saying you shouldn't pursue it, but it might be a good idea to first ask yourself what your end goal is, and why you think developing a game engine is a good idea.

Is this a school assignment? Do you have a particular game in mind and feel that writing an engine would be a good first step towards creating that game? Do you just want to contribute something to the community? If you can tell us a little more about your goals, we'll be better able to offer useful advice.

Share this post


Link to post
Share on other sites
Because you have to ask what a 2d engine should include, and you are doing so in the "For Beginners" section it seems to me you would benefit from this advice.

Make games, not engines.

You'll thank yourself for doing so and you'll be well on your way to beginning an engine based off the experience you gain making your games.

Share this post


Link to post
Share on other sites
Right now, I just want to focus on making an engine so I can use it to test things out for my game. I prefer engines over games or rather I love making tools and effects rather than the game itself.

Sorry if my first post was misleading, I did not meen for it to sound like I wanted to create a libary from scratch like SDL or DirectX or anything else. What I ment was how do I fully go about creating an engine from scratch. The engine that Im messing with is the one that comes with the book Advanced 2D Game Development. But it's in DirectX and I want to stay away from that for awhile in tell I am good enough to now what all the g_Engine->ect... do's and why they are good to use.

Question 2:
Also, I was wondering how to create a lib file? Since my engine so far creates 2 obj files and I need to have my program output a lib file so I can link to it.

Share this post


Link to post
Share on other sites
So how many games have you made already? Games and engines require the same thing; the same kind of code doing the same kinds of things. The difference is that engines are more generalized (usually) than any given game. So the way you learn to write engines is to write games.

If you've written a few games already, go look over their code and start to identify common aspects and refactor them out into a base framework. Rinse, repeat.

Share this post


Link to post
Share on other sites
Quote:
Original post by LostSnow25
Question 2:
Also, I was wondering how to create a lib file? Since my engine so far creates 2 obj files and I need to have my program output a lib file so I can link to it.


Don't worry about linking to your engine in this way until the design is done and you are ready to produce a game with it. The reason is because it adds more complexity to the debugging and development process of the engine. What you should be doing is just develop the engine in its own set of source and header files and including them in your project.

When you are ready to make a library file, all you do is create a new Static Library project in Visual Studio, make sure it is an Empty project, and then simply copy the source and header files of the engine into the project. When you build the engine, you will get a .lib. You will have to use the header files along with the .lib in another program as well. Easy, right?

If you wait until the engine is done and the API is solid and ready to use, then actually making the .lib is really simple. If you try developing the engine as a library, you will run into nothing but trouble, especially if you have never made a library before.

Good luck on your project!

Share this post


Link to post
Share on other sites
Quote:
Original post by jpetrie
So how many games have you made already? Games and engines require the same thing; the same kind of code doing the same kinds of things. The difference is that engines are more generalized (usually) than any given game. So the way you learn to write engines is to write games.

If you've written a few games already, go look over their code and start to identify common aspects and refactor them out into a base framework. Rinse, repeat.


I have limited experience but I have to agree with everyone who says write games not engines.

When I started working on little graphical games I was making classes to handle all the stuff like text, graphics, sound, etc...then I realized I was pretty much creating the "engine" as it was reusable, flexible (for small and simple stuff:) ) I realized that as you make the games the engines almost write themselves.

Share this post


Link to post
Share on other sites
What I personally did is this, I coded a small game which did basic things such as collision, movement and drew out the map. Then right after I completed this small task I coded the engine for how It would need to work to obtain the same result based on what I learned. So yes, you should make games but at the same time making engines can allow you to make a game a lot easier, not to mention it's a great learning experience.

The engine I've been working on is now able to take anything I make in my map editor and run in the engine as a game. So for example in Pac Man, I would just have to place every object I would like, such as points you collect and my engine would check if that object is present then act accordingly. However my engine was designed for Maze type games. Making General Engines is a far bigger task then specific ones. For example making a complete 2D Engine that makes, RPG, Maze Games, Platformers, Shooters, all in one would be a lot harder then making an engine just for one type.

I don't believe in making just games, I believe in making game engines so you can reuse as much as you coded to make other games of the same type. That's not to say you couldn't program a space shooter and use that same code to make a different type of a space shooter. However I wouldn't want to go through an entire game and spend hours changing everything to make a different type of game from it, that's going backwards. However, it would be easier to design a space shooter engine which handles all of your basic tasks but isn't designed for any one specif game, such as asteroids over a side-scroller.

Then all you need to do is get your source code, copy it and build a game using your engine without having to worry about spending all the time programming collisions, key mapping, graphic drawing, map loading and anything else you added.

Different people have different opinions. I personally am glad I went down the engine route because I can make playable Maze levels in less then two minutes and instantly run them in the engine without having to code what each item was supposed to do, or if this tile should not allow a player to pass, ect...

Best of luck with whatever you choose.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this