Vectorial 2D Platformer

Started by
5 comments, last by shadowisadog 10 years, 8 months ago

Hello all,

I'm very new to game development and I was interested in building a 2D Platformer.

I have built a 2D game before but it was a tile based game. I want to create a game where I can have hills and different slopes that the user can climb on. Similar to what the game Braid has.

I was doing my research and I have found that the technique is "vectorial". How would one start to look into creating a game like this? Most 2D tile games have a tile editor like Tiled that you can use. How would you build a map editor for such a game? What type of format should the data be in since it's probably going to be points connecting to paths. Also, how would one determine what sprite or image to use for a path?

I am really interested in this technique. If anyone could give me a good push in the right direction it would be greatly appreciated.

I am most likely going to use SFML 2.1 or MonoGame to create it. Still trying to decide whether or not I want to do it in C++ or in C#.

Thank you in advance.

Kidaj

Advertisement

There is a good tutorial on how to implement 2D platformers here on GameDev. Here http://www.gamedev.net/page/resources/_/technical/game-programming/the-guide-to-implementing-2d-platformers-r2936 you can find it, there is also explained the vectorial method that you speak of.

Thank you for the link to that article.

I know have a better understanding of the higher-level design and what type of work I need to put in to get something like this working.

What would be the best way to store and retrieve the data for map?

Like I mentioned earlier, in a tile editor, something like x == 'grass tile' would work. But with the vectorial technique, how would the data structure look like? Would it be something like:

{
     sprite: "path to sprite .png", 
     vectorPath: [{x: 1, y: 1}, {x: 2, y:2}]
}

>>> How would one start to look into creating a game like this?

Probably you'd want to work out how the physics would work. You could use a physics engine such as the (hugely popular) Box2d (of Angry Birds fame)

>>> Most 2D tile games have a tile editor like Tiled that you can use. How would you build a map editor for such a game?

You'd use a SVG editor such as inkscape, or some other vector tool which exports into a convenient format.

>> What type of format should the data be in since it's probably going to be points connecting to paths.

It's going to be a number of polygons with some metadata attached (concerning behaviour, appearance etc).

>>> Also, how would one determine what sprite or image to use for a path?

That would have to be part of the metadata. Presumably you'd draw a texture-mapped polygon and set texture coords appropriately for its shape (I'm pretty sure that's what Angry Birds does).

- Mark

A simple idea.
Have you ever considered using the Unity engine?

What does the Unity engine have to do with this? He was asking how to implement 2D vector math. Please don't answer specific questions with completely unrelated general advice.

Anyway, vector algebra is a huge subject and will take most people some time and effort to fully comprehend. The good news is that once you have a solid understanding of vector math, you've also covered most of the math concepts required for 3D applications.

This website contains tutorials on programming vectors, and it has interactive examples to clarify the different concepts: http://www.tonypa.pri.ee/vectors/tut01.html

There are a number of options for generating the data. I second Markr's suggestion to use Inkscape or some other similar program to create the level data. You could then process the SVG to something more game specific through a script or XSLT . You could choose to store such data in a number of formats such as XML or JSON. There is even a commercial solution called Corona for the SVG approach.

You could alternatively develop a level editor using C#, PySide, Qt, Java, ect. This route would be significantly more time consuming then using an existing vector graphics program though.

This topic is closed to new replies.

Advertisement