2D Game engine question?

Started by
7 comments, last by Sh@dowm@ncer 11 years, 11 months ago
Hi there.
This is my first time on this site so i am sorry if i am a bit lost. Me and my friends decided on making a 2d tile based game in java. We also decided on making it from scratch (no external library). I started making the engine and made some simple stuff like layers, some solid some for items... and a simple inventory. The idea is to be able to read from a simple ascii art in a text file and make maps. At least in this early phase of development. It was inspired on NetHack so we are currently using some of nethack tiles as a placeholder until we make art of our own. However we plan on making the game isometric in the future. Is the transition easy? Will we need some external 3d library or not? I've read that isometric is not that diffrent from simple 2d so the transition should not affect the gameplay right? We want to make our own stuff from scratch in order to get proper experience. Thank you in advance and sorry for english i am not a native speaker.

PS - I am attaching a a simple screenshot that might give you an idea of what i am talking about.
[attachment=8356:Engine Development.bmp]
Advertisement
The way I see it, changing the perspective is just an output thing which should not affect the data storing or interaction too much, so what you've done so far is compatible, it seems.

Of course, the simplest way of making an isometric projection is flipping the board's perspective 45 degrees. Therefore you'll need some way to rotate all the elements and place them logically. In other words, you'll have to build a rotation matrix method to flip the images, and remember that some sprites from the objects on the tiles may get in front of some others.

All this of course you must also keep in mind, as clicking a tile, for example, won't be as easy as mapping a square and link it to a tile. Even though it's internally just like that, the output becomes a rhombus, and the input (users) will act accordingly with what they see.

All in all, it's not that complicated compared to other graphic transitions, but I really recommend knowledge of Linear Algebra and 3D Vision and Projection if you want to change perspectives all by yourselves.
You certainly won't need a 3D library to make an isometric game. You may want 3D modeling/rendering software, such as Blender, to create the art assets.

I'm a little concerned about your motivation to code everything from scratch—there is plenty of valuable experience in learning to use existing libraries, and professional studios value efficient job completion over absolute self-sufficiency. I'm not necessarily telling you to use libraries, just reëvaluate your reasons and make sure they jive with your goals.

I would also caution you against focusing on the engine over the game. That's another common mistake which too often leads to unnecessary features and unfinished projects.

Best of luck to you.

You certainly won't need a 3D library to make an isometric game. You may want 3D modeling/rendering software, such as Blender, to create the art assets.

I'm a little concerned about your motivation to code everything from scratch—there is plenty of valuable experience in learning to use existing libraries, and professional studios value efficient job completion over absolute self-sufficiency. I'm not necessarily telling you to use libraries, just reëvaluate your reasons and make sure they jive with your goals.

I would also caution you against focusing on the engine over the game. That's another common mistake which too often leads to unnecessary features and unfinished projects.

Best of luck to you.


Thank you very much.
Java is a pretty easy language to use. It also has A LOT of built in classes that are very useful for game development. Our project wont be anything overly complex so learning some other game engine would only serve to slow us down. This is our first project before we move on to C++ at witch point it WILL be necessary to learn some third party game library since it is much more difficult to start from scratch there. Also we believe you cant fly before learning to walk. Good code design,documentation,ease of use comes from attempting to make something that is supposed to be used by other people. Event if we do not actually make a game we do this for the experience it will give us in programming in general not necessary in just game development.

PS: Thanks for the advice on isometric tiles. And also what you said about too much features. We have an idea to bypass features a lot and still make it pretty powerful. Not much of actual gameplay coding will exist in the engine. In fact can somebody tell me where can i post my idea too see what do people think to see is it any good or not?
Depending on the specific ideas you'd like feedback on, GD.net has a Game Programming, a General Programming, and a Game Design forum.
If your asking on a forum if you should build a game engine or not then you probably shouldn't.

It sounds like the game you want to make couldnt be built without an engine. In fact I would recommend making it without an engine if you ever want to learn to make a game engine in the future.

If you just want to make a game and dont care to learn the down and dirty rendering, collision detection, object management, resource management etc.. then I would use an engine.

Brendon Glanzer

Well so far there is no problem with collision detection. Stuff moves from tile to tile. Layers that are solid simply cant have two solid objects in the same space pretty basic stuff. Object management is also done pretty well at least i think. There is a whole package dedicated to just organizing stuff.(We don't care about CPU time) We have also pretty much given up on a real engine. Everything will be hardcoded in (all the items ,AI,NPC) since we now know what a problematic thing a scripting system would be. We also try to have everything well documented using Javas built in awesome comment documentation. It really helps when working in a team. Still i have a new question.

I know basic C++. (everything up to Template programming) and we would like to learn SDL library. How hard would it be to actually rewrite the entire thing from Java2D to C++/SDL? Or should we save that for another project?
Maybe you want to check out my Open Source 2D Engine . Its written in C++ (C with classes actually, something i wouldn't do again ^^) and uses OpenGL + a custom script engine. The code is not the most beatiful because it was the first time i approached something like this but it can teach you a lot i think. In a week or so i will also open source the level editor for it.

I can render 3000x3000 tiles on iPhone with 4 layers of tiles on 60 fps :-) do the math ^^

The link is in my sig

I open sourced my C++/iOS OpenGL 2D RPG engine :-)



See my blog: (Tutorials and GameDev)


[size=2]http://howtomakeitin....wordpress.com/


Maybe you want to check out my Open Source 2D Engine . Its written in C++ (C with classes actually, something i wouldn't do again ^^) and uses OpenGL + a custom script engine. The code is not the most beatiful because it was the first time i approached something like this but it can teach you a lot i think. In a week or so i will also open source the level editor for it.

I can render 3000x3000 tiles on iPhone with 4 layers of tiles on 60 fps :-) do the math ^^

The link is in my sig

It's awesome. This is your first time? Then i must suck.
What do you think about some of my solutions:

My animation system works by Sprites giving their current tile to be rendered by checking how much frames per second happened since the beginning of any type of animation. This allows for different speeds of animation for different objects at the cost of a little cpu time. And of course no additional threads are used.

There is no hardware acceleration (at least not guarantied). I simply use double buffering on a off screen image. So far it runs perfectly fine on 50fps with a lot of stuff on the screen. The filling of the off screen image is done by the main thread. The Screen thread is the one that simply has to draw an image across the screen every 20ms not populate it. And since they are synchronized it gives me a smooth ride so far. (Is this terrible wrong?)

I have a package of a few classes that serve the only purpose of organize/catalog 95% of everything. Basically storing references to a lot of stuff and of course having static methods to get to them. This costs memory. But Any part of the program can access any other very simply. It saves a lot of unnecessary coding and potentialy bugs all over the place. These are also very carefully synchronized. For example real time mouse coordinates are volatile integers. Since they are accessed a lot and synchronizing them would slow down the game. Of course it gives access to only PUBLIC stuff. (Am i doing something wrong here?).

There is a lot more but only as ideas so i will not ask about them until i see them in action.

This topic is closed to new replies.

Advertisement