C++, 2D cross platform engine (PC/MAC/iPhone/iPad)

Discussion in 'Indie Business' started by jcottier, Jan 23, 2012.

  1. jcottier

    jcottier New Member

    Joined:
    Jul 12, 2006
    Messages:
    1,385
    Likes Received:
    0
    Hi,

    I've been using my own c++ 2d engine since 2006 and I am seriously thinking about making it available for fellow devs... But this is still a lot of work and I would like to have a feeling about if it is worth putting the effort to it.

    Basically, my engine is dedicated to create 2D games in c++ on multiplatform. In the ideal world, you do all your work on PC with MSDEV and with a matter of minutes, you can compile and run on XCODE for Mac or iOS support. I think it is a very efficient way (yes, I like MSDEV) and it massively speed up development: it takes time to test on the device, so better only use the ios device just for play testing and not developing. Also, this way, I can create in game tools using the mouse even if my game is dedicated to ios (check this video of the tools for JumpBirdyJump)

    I have released many games on PC/Mac/iOS... and it is a dream to not have to worry about porting the whole game. Most of the time, you need to tweak and change UI stuff for iOS, but you can still make these changes on the PC version (limitting your time spent away from msdev).

    On iOS, you will not have to learn ObjC or any iOS specific stuff (unless you want to change/upgrade what the engine is doing).

    There are a lot of competition in the engine world. But I think this one really stand a chance to find it's audience: C/C++ engine dev that want to release 2D games on computers and ios. I am thinking of making the PC version free, and for the other platforms (iOS/Mac) and the src code and tools (fonts...) asking for something like $200. It is really dead cheap, even if you just wanted to use it as a learning tool (it allows you to be up and running in no times on ios).

    The engine is very simple to use and very efficient (I use to create 3d engine for AAA companies in the past). You won't have to worry about technical stuff like d3d, opengl, display resolution,... are all handle for you. I have put 26 years of game dev experience into that lib. You'll still have to code the game, but this is giving dev the foundation they need to create 2d games on multiplatforms.

    What do you think? Is there a market for this kind of lib?

    JC
     
  2. Tobias

    Indie Author

    Joined:
    Jun 13, 2006
    Messages:
    158
    Likes Received:
    0
    Perhaps. Here's how you find out: Release it. Don't put any more work into making it "releasable" until you know for sure people like to use it. If it's good, hard core coders will be able to use it without documentation.
     
  3. Applewood

    Moderator Original Member Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    3,859
    Likes Received:
    2
    Might well be a market, but a small one. For reference we have our own engine (it does 3D too) for this reason and all the other platforms are fairly well abstracted and we also do our main development on pc using msdev.

    It's the only way to be productive. The problem is, those that believe that have probably found their own solution already!
     
  4. jamesm

    jamesm New Member

    Joined:
    Jul 28, 2008
    Messages:
    48
    Likes Received:
    0
    I have been using Cocos2D-X which is a cross platform port of the Cocos2D framework.

    I have written a number of CMake files to generate all the appropriate solution files so I can develop in MSDev and then fire up the mac, regenerate the xcode project and have the new build in no time.

    The CMake scripts support Win/Linux/OSX/Android and very soon (When I get around to it) iOS.

    Works on loads of platforms and I find it very productive as I do not have to worry too much about keeping loads of different project files hanging around!
     
  5. Bmc

    Bmc New Member

    Joined:
    Dec 12, 2004
    Messages:
    1,088
    Likes Received:
    2
    There was a market for Kanji, so I'm assuming there is a market for this.

    How easy is it to change platform specific stuff? that was the big problem I had with Kanji, especially ....
     
  6. lennard

    Moderator Original Member Indie Author

    Joined:
    Jan 12, 2006
    Messages:
    2,390
    Likes Received:
    12
    Making an engine to sell for $100 to a handful of clients is brutal.

    I think a different business model might be useful. Let me develop my game on PC and then send it off to you to make it happen for Android, iOs and Mac in exchange for a cut of the profits.
     
  7. Bad Sector

    Original Member

    Joined:
    May 28, 2005
    Messages:
    2,742
    Likes Received:
    5
    I'll echo Tobias: release it and you'll see. There is no any other way around learning this, unless you ask someone who is already doing it. And even then he'll most likely be doing it differently than what you and thus will have different results.

    At the end of the day, if you make it a low priority thing, you don't have much to lose. Personally i didn't really expected that people would buy Runtime World at its finished stage, yet i already have some sales in its alpha stage - and currently the editor isn't even usable :p. That wasn't expected, especially since the program is practically free. But i decided to try it and it had some positive results. I mean, i was working on the tool for myself anyway, so why not?

    Just release it.
     
  8. jcottier

    jcottier New Member

    Joined:
    Jul 12, 2006
    Messages:
    1,385
    Likes Received:
    0
    Could you explain what you mean? Can you give me an example?

    thanks

    JC
     
  9. Jamie W

    Original Member Indie Author

    Joined:
    Apr 16, 2006
    Messages:
    1,211
    Likes Received:
    0
    I'm in the same boat as you JC, have my own engine (iOS and desktop), very wary about releasing it though, nothing to do with the quality of my engine/code, just don't see there being good money in it, and it would just eat up time (producing docs, educating people, support etc).

    Best of luck if you go for it though!
     
  10. Bmc

    Bmc New Member

    Joined:
    Dec 12, 2004
    Messages:
    1,088
    Likes Received:
    2
    For example when I first started with Kanji, many things were hardcoded to work only on iPhone sized screens (web view etc) It was a major pain to go in a fix things.
     
  11. frozax

    Indie Author

    Joined:
    Sep 16, 2005
    Messages:
    95
    Likes Received:
    0
    It will be hard to compete with open source engines such as cocosdx (im using it) because it's free. I think you should also support Android, btw.
    I'm currently porting a PC game to mobile and realize that there are many things to change between these versions (phones are much slower, touch screen are really different than mouse...) but having the same codebase sure speeds up dev.
     
  12. jcottier

    jcottier New Member

    Joined:
    Jul 12, 2006
    Messages:
    1,385
    Likes Received:
    0
    I guess that is because when kanji was designed, the ipad wasn't out.
     
  13. jcottier

    jcottier New Member

    Joined:
    Jul 12, 2006
    Messages:
    1,385
    Likes Received:
    0
    Yes, there are a lot of 2d competitions out there with massive audience already but coco for example, is still pretty low level witch could scared some people. My engine is really conceived for multi-platform from the start. Meaning that you code everything on the pc or mac, copy your src code and data on the mac, include them in the project: compile and it works (less than 5 minutes). Obviously, as you pointed it out, you'll still need to make some changes but that will be true with everything (including unity). To give you an example, if you check my game Jump Birdy Jump, the src code is the same for iOS, PC & Mac and the iOS is portrait but the computer's version is landscape. Also, with almost no work, you can design the game with universality in mind. Whatever the resolution you designed your initial game, it will fit on any other device (by default with black bars) or you can stretch it to fit the new res or better, you can easily, code it for iphone and make it ipad compatible (different ratio) without that much messing around. Using the same idea, you code the game for computers in 4x3 but can tell the engine to support widescreen and as long as you provided 16x9 images for backgrounds and display outside the screen a bit (left & right) you'll get your game working widescreen for very little effort. Basically, I designed it to make my life easier so, I am pretty sure it will make other people life easier too. This is just an example, there are a lot of other cools little feature like text/localization friendly. Audio snd managment ... Nothing that's amazing on its own, but when you have use them once and see how it make pain in the arse stuff simple to do , you'll don't want to go back. Well, that's for me at least :)

    [​IMG]
     
  14. NicolasGB

    NicolasGB New Member

    Joined:
    Dec 7, 2010
    Messages:
    51
    Likes Received:
    0
    In the past when I had to choose an engine, a big part of the decision ultimately came down to who I was dealing with. I think there definitely is a market for such an engine, but to be commercially successful you'd need to be ready to fully commit to support it and build a corporate structure around the engine with sales, support, marketing, etc.

    I'd feel insecure about licensing an engine sold as a side project by a one-man team, at least until the number of users reaches some form of critical mass and a community is built around the engine ala Cocos2D (which is free). It's not about the price, it's about the trouble my team would be in down the line if the developer ceases to support it.

    Also 100% agree with Tobias : release and find out (and most likely improve & repeat ^^)

    Hope this helps !
     
  15. jcottier

    jcottier New Member

    Joined:
    Jul 12, 2006
    Messages:
    1,385
    Likes Received:
    0
    I had this private message here: "I have to say you have me interested in your engine. I'm using cocos2d right now for iPhone but would like something that did PC as well. If you did license it would source be included? Also are you able to provide an example of what the api looks like?" But I couldn't reply via PM because my reply was too long so I am printing it here as it might be interesting for others.

    Hello, yes the src code would be included. I am thinking of releasing for free the PC version (without src code) so people can test and use the engine without fears and to get familiar with the engine. Then if they want to use it on other platforms, they'll need to buy a licence and they'll get the src code for PC/Mac/iOS. 95% of the src code is identical for all platforms. I have just few files witch are platform specific. I want to keep the engine as simple as possible because I know that coders still want to use their own ways of doing things. So, for example you won't have a complex particles system (as you can find a lot of them that you can easily integrate with the engine: c or c++). The idea is really to have something where you can code on 1 platform and use the src code on all the others (unless you add some platform specific stuff obviously). As I have been doing games for a while, my engine support a lot of things that you won't have to worry. For example, on iOS it will manage on its own all the snd requierement (music stop when your phone ring or the music won't start if the user is already listening for some music). On computers, the game will automatically adapt to the screen res. So, even if you code your game in 1024x728, if you run it on a small laptop, the game might be display at 800x600. Or if your monitor is running in portrait mode, the game will still display perfectly centered on the screen (unless a lot of PC games that simply crashes if the monitor is in portrait). On the PC too, the engine will stop processing and stop playing music if the game lost the focus... Basically, there are a lot of little things made in the background for you that you'll never have to worry about. The snd managment is very simple to use and allow you to specify a lot of things inside a spreadsheet (so you don't have to worry about tweaking volume or stuff like that inside your code). The text system is also very simple to use but very efficient. Most of my games are localized at least in 6 or 7 languages (including Japanese and Chinese) and I can do that really quickly without having to change a lot of things. Basically, the engine provide a simple layout that allow user to display sprite (or more complex geometry) and play snd very easily. At this stage, I have few things that I would like to improve before I release it (and I will have to add a documentation obviously). My vision for the engine will be to stay fairly small (so it won't change massively compare to the original release) but just improve what is already existing and probably add more platforms (like Android, linux) but I am not at this stage for now. Here are some example of what it take to do things:

    // display a sprite, the sprite class include more options like rotation, colors for each extremity... but this is just to give you an idea

    CTexture *tex = CTexture::Create("my_image.jpg");
    CSprite sprite;
    sprite.SetTexture(tex);
    sprite.Pos[0] = V2(100,100);
    sprite.Pos[1] = V2(200,200);
    sprite.Display();

    // The engine is batching the sprites so as long as you don't change the texture, the engine will accumulated them on its own (making less calls to the graphic drivers). So, "sprite.Display()" won't actually display the sprite until the engine as to (but you don't even have to worry about this). I have a couple of other structure to display things using a similar texture so you don't have to managed sprite one at a time (for a smoke effect for example). Also, I have what I call a freeform object witch is allowing you to display a list of triangles so you have the flexibility to create any shape (more complex than a quad) or managed your own sprite system if you want to.

    CAudio::playSnd("BONG");

    // Play a snd. BONG is a meta name defined in an external text file, where you can specify the volume (so no need to change the sample to make it less loud by default), if the sample need to be streamed, if it need to stay in a cache memory, if it is a music track (so, it can use the internal music volume instead of the snd global volume...) and few other really useful stuff. That's it you don't need to manage anything more code wise for snd & music (PlaySnd return a handle so if you need to do things with a sample currently playing you can: for example faiding it out).

    CWString my_text = CTextSystem::Translate("BUTTON_PLAY");
    CText::CData tdata;
    tdata.ARGB = CColor(255,0,0);
    tdata.DisplayType = DP_LEFT; // could be also DP_CENTER (by default) or DP_RIGHT
    CText:: Display(my_text , V2(0,0), V2(300,40), tdata);

    // displaying a text. The engine is only displaying UNICODE text so when you'll do the Japanese localization, you won't have to change anything. my_text will contains the current text for the meta BUTTON_PLAY (define in an external text file). In English that might be "Play" and in French "Jouer". I am displaying this text in red inside a pre-defined area: between pixel (0,0) & (300,40). The engine will make sure that this text will always fit inside this area (by scalling it down if necessary). Also, you can specify if you want the text to be centered or glue to the left or right side of your area. This is a very good solution to display text. Initially, this was just an option for my text system but it is so useful and good that I am only using that now, so I made it the only option. Also, there is an external tool to export TFF font into a game font format.

    This is just to give you an idea of how the engine is working but I hope that you can see that everything was made to make "complex" or "annoying" things as simple to use as possible.

    JC
     
  16. jcottier

    jcottier New Member

    Joined:
    Jul 12, 2006
    Messages:
    1,385
    Likes Received:
    0
    I understand. But the engine isn't new. I have been doing games with it since 2006 so as far as I am concerned it is pretty stable and I won't be evolving it drastically (I just want to provide basic functionality). You'll get the src code so really you'll be able to change whatever you like even if I stop supporting it or something. Now, I'm 40 years old and I have been doing game's engine all my life (professionally). So, I guess if/when I release it, I'll obviously talk about some of the stuff I made in the past so you won't be that scared about trusting me :)

    JC
     
  17. Pallav Nawani

    Indie Author

    Joined:
    Aug 13, 2004
    Messages:
    371
    Likes Received:
    0
    I like the examples you've provided.

    This looks like something I could use. Popcap engine (that I am using) is nearing the end of its lifecycle and I am looking to port PopCap engine to some library/engine so my games can be ported to ios/android/Mac/Linux etc.

    Your engine looks like it fits the bill. I would like to try it out!

    However, I agree with Jamie W, selling an engine would probably be a lot of work and I doubt you will make much profit.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer