Cocos2d-x...... :'(

Started by
8 comments, last by Buster2000 8 years, 5 months ago

Hey!

I'm a newbie wannabe programmer who started a few months ago with C++, and am slowly beginning to understand a bit about how the language works. I am enjoying programming so far and having a lot of fun tinkering around. I want to eventually be able to develop simple games as a hobby, and have created a few simple simple simple games. I was making text based games, then wanted to learn how to add graphics to the games and tried using SDL2. I enjoyed SDL2, but as my goal in the longer run is to try making games for iOS and android, I thought I should find a tool that would suit those needs. That's when I came across Cocos2d-x. A cross platform C++ tool for game development that's used primarily for mobile game development. Awesome!! I thought. I'm having so much trouble getting started. I can't find good recent tutorials that are made for beginners, and setting up and compiling takes so long.

Is this still a good tool worth continuing to try learning? Are there any good relevant tutorials for Cocos2d-x that are easy for beginners to follow? Is it too early for me to be using Cocos2d-x? Should I switch languages if I want to continue mobile games? I know Objective-C and swift are used more for iOS and some other languages for android. Should I use full game engines like Unity or GameMaker instead? I really like C++ so far, and I want to be able to make simple desktop games too (not the same games as the mobile ones). But I guess I'm willing to make changes too. I'm not in a hurry, and am willing to do what it takes to hone these skills.

Thanks :)

Advertisement

Setup is certainly C++'s Achilles heel. It's got a build system made in the 80s based on one from the 70s designed in the 60s. Compared to almost every other modern programming language, the build process in C++ quite simply stinks.

That said, Cocos2d-x actually does a very good job of making the code accessible to new developers, just at the cost of file size. When you create a new Cocos2d-x project it compiles the entire library with each project, make it easy to get up and going, but your first compliation is going to be slow. Fortunately subsequent compiles should be much faster.

As to good tutorials, I have a reasonably current Cocos2d-x tutorial series available here, that is aimed at beginners. The screenshots show MacOS, but the install process should be nearly identical on Windows. I am actually in the process of creating a video for each post in that series, so if you prefer video, you can see the setup process here.

If you like Cocos2d-x, stick with it. The initial setup pains you only pay once.

There are certainly other options, and some are definitely easier to get up and going than C++. I would say stay the hell away from ObjectiveC though... it's an awful language that is really only used on a single platform. You can port ObjC to Android and other platforms, but it really isn't worth it. For cross platform go C++, Java or even higher level or let your framework take care of it for you.

For mobile games you should try looking into Java, but take other oppinions as well. Cocos2d-x has tutorials and a wiki on their site so you can start there, but only if you have a good understanding of the language. Otherwise you will have things in the library that you won't know what they are, you use them the way you see in tutorials but you can't use them at their full potential because you have no clue of how they work.

I enjoyed SDL2

I really like C++ so far

I'm not in a hurry

Good! Then stick with it, you are already having fun and on your path to make games.

my goal in the longer run is to try making games for iOS and android, I thought I should find a tool that would suit those needs.

If you learn C++ and SDL2, Cocos2d-x will be easy when the time comes.

You will be able to adapt to anything they throw at you. So don't worry about your future plans, you will be changing laguages/tools all your life. Learn to program and to make games... the tools will come and go.

Good luck.

There are two kinds of camps out there right now. The OTS and the NIH.

The Off-the-shelf (OTS) people believe that you shouldn't be writing your own code. Others have already done that, and you shouldn't reinvent the wheel. This camp will tell you that Cocos2d-x isn't good enough, because you're still writing code. Use a game engine like Game Maker, Unity, Unreal 4, Construct 2, or some other game development environment. This camp gets a huge speed-boost for making games, but can't do anything unique or original without extreme pain.

The not-invented-here (NIH) camp believes that if someone else wrote it, it sucks, and they could do better. They spend their time writing everything from scratch and learning how all the low-level technology works. They do this at the expense of very slow development times compared to the OTSs.

Of course there is somewhere in between for you. My first question it this:

Do you think you're an OTS or a NIH?

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

There are two kinds of camps out there right now. The OTS and the NIH.

The Off-the-shelf (OTS) people believe that you shouldn't be writing your own code. Others have already done that, and you shouldn't reinvent the wheel. This camp will tell you that Cocos2d-x isn't good enough, because you're still writing code. Use a game engine like Game Maker, Unity, Unreal 4, Construct 2, or some other game development environment. This camp gets a huge speed-boost for making games, but can't do anything unique or original without extreme pain.

The not-invented-here (NIH) camp believes that if someone else wrote it, it sucks, and they could do better. They spend their time writing everything from scratch and learning how all the low-level technology works. They do this at the expense of very slow development times compared to the OTSs.

Of course there is somewhere in between for you. My first question it this:

Do you think you're an OTS or a NIH?

As a general rule of thumb, I prefer and would tend to hire the third unmentioned type. The pragmatic programmer.

Pragmatic frameworks exist too, that straddle that middle line between Off the Shelf and Not Invested Here. You could argue every single project with open source fits that category I suppose. However open projects with high level tools also exist, things like Godot, which is certainly rising in popularity for exactly this reason.

For the record, I agree with you completely, just adding my two cents on top.


However open projects with high level tools also exist, things like Godot, which is certainly rising in popularity for exactly this reason.

Godot looks promising. I struggle with this all the time. If you just use everyone else's code, you are at their mercy. If you choose tools without source code, like Unity, you need to sign in blood and hope they don't break anything down the line. But if all you use is your own stuff, you can't even keep up with OS changes and security updates, let alone embrace whatever flavor-of-the-month gameplay/graphics are popular.

I am currently making something similar to Godot. Maybe that will be the thing I need. Thank you for the tip!

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

Thanks for the replies!

-Serapth

I did check out that tutorial and it was one of the best ones I found online, but it ended a bit too early in the process for me. It was great for learning the tools, but what I really wanted to know at the end was how to combine them. In SDL2, it was easy to make the game loop and it was clear where the loop was, which helped me a lot. I heard Cocos2d-x does the looping for me? or something like that, so I don't have direct access to the loop itself. Because of that, I'm really confused as to where and how to implement functions to handle input, actions, collision, etc.. It's great that you're starting a video series though! I'll definitely be checking those out :) Again, thanks for the reply!

-Kenwill

I guess I should look around the wiki a bit more thouroughly. Thank you!

-Desdemian

Thanks for the advice. I guess I might play a bit more with SDL while exploring other options. Gotta work on the fundamentals of the language and game programming first :)

-Glass_knife

I'm not experienced enough to identify myself as one or the other yet, but the reason I started with C++ is because I didn't want the engine to do everything for me. I wanted to know how everything was working, and how a game is put together from a low(?) level perspective. But then again, I'm not used to developing games yet so I'm beginning to think that it might be better for me to use some of those tools to learn how to put a game together while not focusing too much on programming, and then going back to lower level once I'm a bit more accustomed to the process. That being said, I will continue to brush up my programming skills either way. I guess now is a good time to explore the options and see what I like.



Thanks for the replies!

-Serapth

I did check out that tutorial and it was one of the best ones I found online, but it ended a bit too early in the process for me. It was great for learning the tools, but what I really wanted to know at the end was how to combine them. In SDL2, it was easy to make the game loop and it was clear where the loop was, which helped me a lot. I heard Cocos2d-x does the looping for me? or something like that, so I don't have direct access to the loop itself. Because of that, I'm really confused as to where and how to implement functions to handle input, actions, collision, etc.. It's great that you're starting a video series though! I'll definitely be checking those out smile.png Again, thanks for the reply!

You know there are 5 parts to the written tutorial right? ( I will probably add more after the fact ). Your questions about the game loop are covered in some detail in this part of the tutorial.

Yes, Cocos2d-x easily internalizes the main game loop, this is because Cocos2d-x is a higher level framework than SDL. SDL basically provides the basics of a game, while Cocos2d-x is an actual game engine. Instead of operating in a loop updating various parts of your game, you implement functions like update() and they are called by the engine. The tutorial explains it in a great deal more detail.

If you've started learning C++ then stick with C++. The problem with Cocos2d-X is that many people learnt the Objective C version (with lots of tutorials) then migrated to Cocos2D-x and not many people re-wrote the tutorials.
There are however several books available that do a good job of teaching Cocos2d-X.

This topic is closed to new replies.

Advertisement