• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Francisco Tufr
      Hi everyone! I'm currently working on a series of books about 2D Shader Development.

      The idea is to synthesize a bunch of techniques that are specifically useful for 2D, even if they work on 3D as well.

      I released the first book last week. It's 4.99 on Amazon or free on the series website, https://www.2dshaders.com

      This is an independent initiative, I don't work for any publisher whatsoever. The contents of the books are the result of a 4-year span where I started teaching this in Argentina and USA, always making the workshop better. Now I'm expanding it to make more sense in book form.

      I'd love to hear your opinions on the idea and if you get the book let me know what you think.

      By the way, the examples are in Unity, but the concepts from the book should be easily transferable to any graphics api/engine.

      Hope you like it!
    • By RoKabium Games
      While looking out for that pesky Terrator, our little alien is doing a bit of relaxed mining down on the new gas planet "Lelantos" this weekend.... 
      #gamedev #indiedev #madewithunity #screenshotsaturday
    • By vividgamer
      I have a native iOS game (objective c, XCode build) which I am considering to port to other platforms.
      Core gameplay is based on solely on geographical maps, and custom drawing over maps. It also has Core Data. This part is complete in development.
      What is not done yet is: monetization, gamification (leaderboards, challenges) and multiplayer functionality.
      As I think more about it, I am tempted to think if this is the right time to move to a cross platform tool such as Unity. But before dedicating time to port my 5 years side-project effort in Objective C, I really want to know if its worth it.
      - Does Unity support such plugins / assets that will fulfill all my above requirements?
      - Unity Personal seems to have only 20 concurrent users - is it too costly scaling if I decide for extending to web and android platforms?
      - What is the general workflow involved in publishing to iOS, Android, PC, and web platforms while using Unity? I mean to ask about various points of signing stuff, paying fees and getting certified.
      - How long will it really take to port my entire Objective C project into Unity? I am somewhat familiar with C# but I am finding it hard fidgeting with Unity IDE as lot of things are focused around FPS and 3D while my game is still 2d - not much action involved. I seem bit overwhelmed by the list of features I see there. All in all, I do not want to lose my momentum while still making sure its portable to everywhere.
      - Any assets I could use (for free to try basis in debug) that are relevant for my game?
      - Last but not the least, are there any costs that I need to be paying upfront to Unity, for using it (apart from their monthly subscription model)? I don't understand their costing for multiplayer in conjunction with their subscription fees - if someone could kindly elaborate.
      Thanks in advance for your time reading a newbie
    • By GytisDev
      me and few friends are developing simple city building game with unity for a school project, think something like Banished but much simpler. I was tasked to create the path-finding for the game so I mostly followed this tutorial series up to episode 5. Then we created simple working system for cutting trees. The problem is that the path-finding is working like 90% of the time, then it get stuck randomly then there's clearly a way to the objective (tree). I tried looking for some pattern when it happens but can't find anything. So basically I need any tips for how I should approach this problem.
      Use this image to visualize the problem.
    • By aymen
      please any know how can i' calculate the centroid from any number vertices
  • Advertisement
  • Advertisement
Sign in to follow this  

Unity OpenGL 2D RPG examples/source code

Recommended Posts

Hi, I'm making a 2D RPG in OpenGL and I've been looking for source code, or simply just code snippets to help myself understand how to develop my own. I've not had much luck finding any however, so I'm looking for anything that is related this community might have. Thanks!

Share this post

Link to post
Share on other sites

What exactly are you looking for?

Snippets code for an RPG game, or snippets for displaying at OpenGL?

Given the popularity of the RPG, my guess is that github has a few zillion repositories of the former. For the latter, most OpenGL tutorials start with painting an image onto triangles. Mostly for a 2D game, that's enough at first.


There aren't many snippets published as snippet, since they're basically useless. Snippets only make sense in presence of a large surrounding network of other snippets. It's much like asking for car parts to construct a car. While technically it's possible, it's not the generally recommended way of doing things.

I somewhat suspect you never programmed before, or at least not a game. If that's the case, you may want to head over to the Beginners forum, and read the FAQ for how to start programming or start programming games.

Share this post

Link to post
Share on other sites

I have experience in programming, I'm only looking for OpenGL related code for the RPG I'm making as I'm quite new to learning it. I want to see how other people handled rendering, movement, etc, by putting into practise what I've learning in tutorials I've looked through for OpenGL. 

It's really mostly for reference while I work on my game. 

Share this post

Link to post
Share on other sites

You can take a look at the Godot engine. It's only in OpenGL, and it's cross platform compatible.

There's also the Flare game which uses SDL.


Share this post

Link to post
Share on other sites

You should address the two concerns separately. First you should learn how to draw sprites and text (I assume you'll want text in your game). If you want to use OpenGL then go for it. There are many tutorials online that will help you with that. Creating a game of any kind is a different thing though. My suggestion is you keep your rendering engine abstracted away from the game logic. You can design your RPG without even knowing which library will you end up using to render sprites on screen. You can imagine having a basic IRenderer interface with methods like DrawTexture() or DrawText(). How you implement that interface won't change the design of the rest of the project in any way.

Share this post

Link to post
Share on other sites

Cocos2d-x - You can use it as a game framework or you can read its sources to understand how it works. Supports 2d and 3d but lots of code and api is for pure 2d. Has scene tree. It doe sno thave particularly good architecture or code quality, but it has lots of users and features and good performance.

OpenFrameworks, Cinder - Use it as framework or learn from their sources. They do not have scene tree. They have excellent api if you are a beginner and you want to learn about opengl 3 style of rendering. I would really suggest at least swiftly reading through api and tutorial to one of these frameworks if you want to know how proper rendering works. But have in mind, that they are missing the scene tree, so you would probably have to implementi it yourself in proper game (not that hard).

godot - Slightly older framework for 3d with scene graph. The rendering code is very easy to read and duplicate in your own rendering framework and has some great simple (tutorial-like) architecture designs in 3d rendering. The api is not perfectly prepared for modern rendering techniques but it is a good beginning for newbies.

Ogre3d  -  Slightly older framework for 3d with scene graph. I would not suggest it for 2d games. It has slightly more features and users than godot, I think. I would suggest to look into ogre3d if you want to know something about gui libraries, lots of gui libraries used in ogre3d can be used stand-alone in your application. Or you can just look at their apis and implementations to learn about gui programming.

SDL, glfw, freeglut, sfml - These are the simplest frameworks that only provide thin layer between your multiplatform c++ code and windowing system in target os. They basicaly create a window and allow you to fetch inputs form keyboard and mouse and to call opengl functions. Use them as frameworks if you want to write in opengl. Or read tutorials for them - many tutorials for these libraries are in fact good basic tutorials for basic opengl.

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  

  • Advertisement