Jump to content

  • Log In with Google      Sign In   
  • Create Account


Finding a 2D game engine that does not require programming in their environment


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 Peppit   Members   -  Reputation: 123

Like
0Likes
Like

Posted 09 April 2014 - 06:12 PM

I'm a somewhat experienced programmer (Junior CS major in college) and when I was younger I used to be EXTREMELY into game development. However, my engine of choice was GameMaker, and as we all know that's a bit limited. After becoming a better programmer, I decided I wanted to come back and make some simple 2D games using a real language. However, I haven't been able to find a good 2D engine that lets me develop in my own environment; almost all of them require me to use their own special scripting language or require me programming most of the engine myself. What I would like in a engine is:

  1. Programming is done in my own environment (emacs, vim) in an established language (like C++ or Python)
  2. I can quickly program objects (engine handles things like collision, creation and destruction of objects and scenes, etc)
  3. I can quickly place objects and design levels (I would really like to be able to use tiled to design my levels)
  4. It handles input and is easy to integrate in objects
  5. Built-in collision detection

Bonus points for:

  1. Physics
  2. Android/iOS/HTML5 support

The closest I have found to something I would like is melonjs, however I really don't like programming in javascript and it doesn't compile to native code (not that I would expect it to).

 

In an ideal world, I would like to make a simple pong game with something like this:

import engine
import sprites
import scenes

class PlayerPaddle(engine.GameObject):
    sprite = sprites.PaddleSprite
    game = 0;

    def __init__(self, game):
        self.game = game
        game.add_object(self, 'PlayerPaddle') # could be handled by parent
        self.x = 0
        self.y = 0
        super(PlayerPaddle, self)

    def update(self):
        if (self.game.input.keyboard.up):
            self.y -= 2
        
        if (self.game.input.keyboard.down):
            self.y += 2
        super(PlayerPaddle, self)

    def draw(self):
        engine.draw_sprite(self.x, self.y, self.sprite)
        super(PlayerPaddle, self)


class ComputerPaddle(engine.GameObject):
    sprite = sprites.PaddleSprite
    game = 0

    def __init__(self, game):
        self.game = game
        game.add_object(self, 'ComputerPaddle') # could be handled by parent
        self.x = game.current_scene.width-32
        self.y = 0
        super(ComputerPaddle, self)

    def update(self):
        if (self.game.objects['ball'][0].y > y)
            self.y -= 2
        
        if (self.game.objects['ball'][0].y < y)
            self.y += 2

        super(ComputerPaddle, self)

    def draw(self):
        engine.draw_sprite(self.x, self.y, self.sprite)
        super(ComputerPaddle, self)

class Ball(engine.GameObject):
    sprite = sprites.BallSprite
    game = 0

    def __init__(self, game):
        self.game = game
        self.hspeed = 5
        self.vspeed = 5
        self.x = game.scene.width/2
        self.y = game.scene.height/2

        game.add_object(self, 'ball') # could be handled by parent
        super(Ball, self)

    def update(self):
        if (engine.collides(self, game.objects['PlayerPaddle'] or
            engine.collides(self, game.objects['ComputerPaddle']):
            hspeed = -hspeed

        if (y < 0 or y > game.current_scene.height):
            vspeed = -vspeed

        super(Ball, self)

    def draw(self):
        engine.draw_sprite(self.x, self.y, self.sprite)
        super(Ball, self)


game = engine.Game()
game.set_scene( scenes.scenes['pong'] )
while (game.is_running):
    game.update()
    game.sleep_off_frame()

I REALLY rushed through this so the python is definately wrong (and I'm not spectacular at it), but I think you get the general idea. 90% of the code is defining the behaviour of the objects, and the engine itself handles things like drawing the sprites, view locations, collisions, input, object movement, etc.

 

What I have tried so far:

  • GameMaker
    Pros: Easy to get a basic game down, handles resources for me
    Cons: I have to program in their limited language, not open source, stores projects in a way that I can only really use gamemaker with it, can't develop on linux
  • MelonJS
    Pros: Does about what I want
    Cons: I have to program in javascript which I really don't like, web only
  • Roll my own with SFML (I am actually decently far into my own game engine, but I want to actually make games now)
    Pros: Does exacly what I want
    Cons: Extremely hard, buggy, takes forever, I have to write my own algorithms for everything and develop my own tools, unfeasible
  • Unity
    Pros: Established community, good engine, compiles for everything I could want
    Cons: Can't develop on linux, basic 2D support, I have to learn how to use the entire program

I know this is a really really common question, but I still haven't found a good engine for what I want, even after reading FAQs, etc. I would really appreciate some help.


Edited by Peppit, 09 April 2014 - 06:13 PM.


Sponsor:

#2 menyo   Members   -  Reputation: 401

Like
0Likes
Like

Posted 09 April 2014 - 10:47 PM

Sorry answer: c++\sfml, this is a great library for c++. Or unity for less coding but allows c++ scripting.

Long answer comming. No time now ;)

Current Project: TechnoFlux read all about it on my

DEV BLOG


#3 theslimde   Members   -  Reputation: 123

Like
1Likes
Like

Posted 10 April 2014 - 12:11 AM

Give those a look:

 

 -  Angel http://angel2d.com engine in C++, scripting with Lua. It's main focus lays on prototyping. Supports mobile,

Win, Mac, Linux.

 - Urho2D https://github.com/urho3d/Urho3D Primarily a 3D engine, but they recently started doing some 2d stuff too. The advantage here is that you pretty much have everything covered, in my eyes it is one of the best open source engines right now. Engine is written in C++, scripting is done either vie Lua or Angelscript. Supports mobile,

Win, Mac, Linux and Raspi.

 

Cheers!


Edited by theslimde, 10 April 2014 - 12:16 AM.


#4 Truerror   Members   -  Reputation: 315

Like
1Likes
Like

Posted 10 April 2014 - 01:54 AM

Unity3D. It supports C#.

 

Or. if you're willing to pay, Unreal Engine 4 uses C++.

 

Edit: Ok, so I'm a poor reader. UE4 is 3D. But Unity can also do 2D, despite its name. Add Duality to that (it's another C# 2D engine).


Edited by Truerror, 10 April 2014 - 01:58 AM.


#5 krinosx   Members   -  Reputation: 485

Like
3Likes
Like

Posted 10 April 2014 - 08:13 AM

I suggest LOVE2D...

 

Its a really nice 2d engine... you must have to program in LUA script, but its very versatile and the 'code style' is somewhat like what you want.

 

I did use the Love2d in a GameJam this year... and.. its very friendly... have a lot o documentation, is cross platform and have a good performance.

 

Give it a try - https://love2d.org/



#6 KnolanCross   Members   -  Reputation: 1228

Like
0Likes
Like

Posted 10 April 2014 - 12:49 PM

I personaly like ORX a lot, it is a 2d engine that uses C (there is a C++ set called Scroll).

 

The whole lib is based on writting code and ini files to describe your objects. After you get the grip of it you can develop some cool effects quite fast.

 

As for the bonus:

- There is a community made Tiled exporter (the exporter works only on windows AFAIK).

- It can create binaries for linux, windows, OSX, IOS and android.

- It uses Box2d for physics.


Currently working on a scene editor for ORX (http://orx-project.org), using kivy (http://kivy.org).


#7 ferrous   Members   -  Reputation: 1615

Like
0Likes
Like

Posted 10 April 2014 - 01:32 PM

To add to the others

PyGame? It's python like you requested.

Monogame, though thats C#.

 

Unity doesn't allow C++ scripting that I know of.  (Not that I've looked hard for a way to try)


Edited by ferrous, 10 April 2014 - 01:34 PM.


#8 thade   Members   -  Reputation: 1652

Like
0Likes
Like

Posted 10 April 2014 - 02:14 PM

Unity3D. It supports C#.

Unity doesn't allow C++ scripting that I know of.  (Not that I've looked hard for a way to try)

The last I knew, you could only use the C/C++ bindings for Unity if you had the licensed version (for $3k or whatever it was) otherwise you could use C# (or Boo or Javascript I think) inside their editor...which is what the OP doesn't want I think.

Has this changed with the new licensing structure? (The update with the per/month fee?)

I was previously serratemplar; a name I forfeited to share a name with an angry rank-bearing monkey.

http://thadeshammer.wordpress.com/


#9 Truerror   Members   -  Reputation: 315

Like
0Likes
Like

Posted 10 April 2014 - 04:46 PM


The last I knew, you could only use the C/C++ bindings for Unity if you had the licensed version (for $3k or whatever it was) otherwise you could use C# (or Boo or Javascript I think) inside their editor...which is what the OP doesn't want I think.

 

Well, the OP said

 

 

  1. Programming is done in my own environment (emacs, vim) in an established language (like C++ or Python)

 

He said 'like', so I assumed what he meant 'established language' is something that is thoroughly popular, with complete documentations, and thus a huge community support. I might be wrong in my assumption, but if I'm correct, then I believe C# fits the bill.



#10 Monkan   Members   -  Reputation: 537

Like
0Likes
Like

Posted 10 April 2014 - 05:13 PM

I would recommend having a look at Moai,

http://getmoai.com/

it does everything you want, runs on all platforms imaginable, open source so you get all the C++ code.

I hadn't paid attention to it for a while and I just had another look recently and it looks like it has come a long way.
"To know the road ahead, ask those coming back."

#11 dr01d3k4   Members   -  Reputation: 402

Like
1Likes
Like

Posted 10 April 2014 - 05:27 PM

I suggest LOVE2D...

 

Its a really nice 2d engine... you must have to program in LUA script, but its very versatile and the 'code style' is somewhat like what you want.

 

I did use the Love2d in a GameJam this year... and.. its very friendly... have a lot o documentation, is cross platform and have a good performance.

 

Give it a try - https://love2d.org/

 

I too recommend Love2d.

For physics, you can write your own or it provides you with bindings to Box2d (although the tutorials on the wiki are a bit lacking I find), and for graphics you can write shaders in a slightly modified GLSL (afaik the syntax is the same but some names changed). I haven't found many tutorials, but there is good documentation on their wiki and example code (including a Tiled map loader). I also don't know about running it on mobile or the web, but it runs on windows, mac and linux and you can code in any editor. Love2d was also used in this awesome game, Mari0.

 

Lua's also a pretty good language. Quite fast and lightweight compared to other scripting languages like Python, but its standard library is quite small. I personally prefer to use Moonscript though (it compiles into Lua).


Edited by dr01d3k4, 10 April 2014 - 05:29 PM.

Falling block colour flood game thing I'm making: http://jsfiddle/dr01d3k4/JHnCV/


#12 reflect   Members   -  Reputation: 102

Like
0Likes
Like

Posted 11 April 2014 - 03:12 AM

Have you looked at Duality? Granted the language is C#, but a cursory glance at its features suggests it might fit your needs.

 

Edit: Actually it seems to have been made with Visual Studio in mind, but perhaps there's a way to bypass that and just build with compiler?


Edited by reflect, 11 April 2014 - 03:17 AM.


#13 Karsten_   Members   -  Reputation: 1510

Like
0Likes
Like

Posted 11 April 2014 - 06:03 AM

  1. Programming is done in my own environment (emacs, vim) in an established language (like C++ or Python)

 

You transcend the editor wars by using both... thats awesome ;)

 

I highly recommend SDL 1.2 (with C or C++) because you can also use the Emscripten compiler to output it to HTML5.

 

If you plan to do very intensive 2D games, then SDL with OpenGL will also work great as a desktop application or web via Emscripten.


Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS