gamesalad to unity3D? - objective-c

I'm a newer than new newbie ... and I think this question should be part of the thread Newbie - Game Development (iPhone) - New to Objective C and Game Dev but I could only find an "answer" post window. I'd like to ask a related question.
If I were to develop a game in GameSalad or Stencyl, would I be able to look at the actual code of that creation and maybe import it into something more complicated like Cocos2d-x or Unity3D later on?
I ask, because happybadgers advised in that above mentioned question/answer to start out in something like GameSalad -- sort of jump into creating a game while learning objective c. But I imagine a person would eventually want to do more than "drag and drop" coding as their skills increased ... so -- could you take your drag and drop creation(s) and pop it/them into something that lets you play with the code more?
I'm aware that this may be a stupid, naive or stupidly naive question, so please excuse me, if so.
Thank you for your time. And if you vote to boot this question, I hope you'll explain the error of my ways.

As far as I know you cannot view the code directly in Gamesalad. However, a lot of the logic behind the game will be easy to replicate in code once you get the hang of it.
An example of this is the statements that you use such as if, while, for, get and set will all be available in Unityscript. You will not be able to convert your game into a Unity file however the art assets will be transferable.(So basically you can keep the aesthetic of your game,but you will just need to translate the drag and drop to code.)
Good luck,
p.s
(If you are really struggling with some code, just send me the drag and drop logic and I will do my best to convert it for you).

Related

Requirements for learning Cocos2D?

I would like to make a 2D iPhone game, I've done some research and Cocos2D does seem like the best option, I am just wondering how much knowledge of Objective-C I will need before tackling Cocos2D. I know the fundamentals of programming in Objective-C - I can make a basic command line tool app. I've done some iOS SDK tutorials but I wouldn't know how to make an iOS app if I was asked because the tutorials I'm currently following are about three years old.
What is required as prior learning before using Cocos2D and does anyone know of any good resources? I'm more of a visual learner so I find videos more helpful than books or blog posts.
Thank you in advance for your time and any help :)
There is no required prior learning. Use it. If you get stuck on something, look it up, google it, or ask a question.
Meaning: don't waste your time learning general concepts without actually being in the situation of having to apply them.
Analogy: you don't need a PhD in mechanical engineering to drive a car - though it might help when you run into any issues. But in such a case just do what 99% of all people do: call for help. It hardly makes any sense to first learn the potential problems you can have with a car, you deal with them as they happen.
Also: frustration is part of the game and can not be avoided. :)
how much knowledge of Objective-C I will need
A lot. You need to master Objective-C before trying to make a bigger project like this.
And to understand Objective-C, you need to have a very solid knowledge of C.
(Also, for using 3rd-party frameworks lile Cocos2D, make sure you understand well the basic, default libraries such as Foundation and UIKit.)
For making games like Free flow , having an intermediate knowledge of Objective-C is sufficient. But if you plan on make something like Temple Run, then you need really good knowledge of Objective -C,Open-Gl and cocos2d..
The site I would recommend is raywenderlich.com, that's where i started from and they have tutorials from really basic level to really advanced level.
Hope this helps
The answer to that depends truly on who you are, your work ethics, and how much effort your are ready to consent to that effort. I would argue that if you have solid foundations with other OO language/frameworks, your quest is possible. I would start by 'repurposing' a freely available game ( you will find many good examples and tutorials from Ray Wenderlich and also Steffen Itterheim. Pick a sample project that is not too 'distant' from your game specification, and repurpose it. In doing so, you will break-in to objective-C and some of the basic frameworks you need to comprehend. Mastery will follow if you are dedicated and stick to it. Also, SO rules : many answers are available here : appropriate questions will yield many helpful hints and solutions to point problems.
ps. My biggest learning curve turned out to be xCode, a truly arcane and dogma-ladden IDE. I since switched to another IDE and my productivity has gone back to respectable levels.
I recently picked up Objective-C and cocos2d at the same time. I did a lot of reading about objective-c in the beginning to give me a primer. Aside from the syntax, most of that knowledge remains unused in my game. The most important things to learn about objective-c before starting in on cocos2d tutorials are, memory management, and debugging.
The reference count memory management might take a minute to get used to depending on what languages you are coming from. The general rule is, if you alloced/copied (without autorelease) or retained it, you must at some point release it, and if you need to use something beyond the current scope, you should retain it. You can see from some cocos2d examples of overwriting an objects dealloc method in order to dealloc anything you created/retained.
The debugging took me a minute to get used to as well. It helps if you add a high level try/catch block that you can use to log uncaught exceptions, otherwise some of your errors will give you little info to go on. You may also want to research/mess with some of your project settings to allow for better bug catching, such as enabling zombies. A big causer of crashes in objective-c is sending messages to already dealloced objects. Once you come across a badaccess error that you can't figure out, you will basically be forced to get knee deep in this stuff in order to figure out the cause.
Some other purely objective-c knowledge that will come in handy are getting very familiar with how NSArray and NSDictionary objects work, how they automatically retain/release, and how they can only hold objects (no primitive values). To work with floats/int and arrays/dictionaries, you need to convert primitives into something like an NSNumber object, which can be done fairly easily with a little research. Another helpful too is knowing how to save/load plists. There are convenience methods for doing this on NSArray and NSDictionary objects. This along with a little knowledge of the NSFileManager should be enough to help you save/load game states. If you want to get really fancy/clean in your coding, you will also learn about observers in objective-c. KVO can be great for making your UI update automatically on a certain objects property changes. For instance, my HUD KVOs the player object's life, so that when the life value changes, the HUD automatically updates. This can allow you to make a cleaner MVC type application. You can also register to listen to other types of messages (not just property changes), just make sure to unregister your listeners when you are done listening.
My last bit of advice would be to always pay attention to XCode warnings. If you are getting one, and you don't know why, you should figure out why. Some simple ones you might be able to ignore, others may cause bugs that you will not be able to track down any other way. For instance, I once used the function max() in my code, and xcode gave me a strange warning that I didn't understand. This caused havoc on my program by corrupting the stack. When I changed max() to MAX(), three or four unexplained bugs instantly disappeared. This kind of thing can set you back weeks, and take serious combing through every piece of your code if you don't catch it right away.
The rest can mostly be learned by looking at cocos2d code/examples. Good luck.

Fundamental Architecture of an iPhone App: what does exactly happen?

I am new to iPhone-Programming and I am probably asking a beginner's question, but I really couldn't find a satisfying answer to this:
I would like to understand the underlying architecture or structure of an iPhone App. What comes first, what are the parts that a starting template usually does automatically? In C-Programms, you know the program always jumps into main and then everything starts like you coded it. In iPhone-Programming, we start also in main and then something like the event loop starts and etc.there is a lot going on under hood, which I would like to understand so I feel more confident writing code and actually being aware of all consequences that my code causes.
I would be happy about any answers or are there any good references that are compact and only focussed on the coding architecture?
Read this for example ... http://www.technolike.com/archives/86/core-application-architecture-for-iphone.html ... and Google for more. There are many resources how to iPhone application starts, what's going under the hood, how event handling cycle does work, etc. Also when you read these resources, try to ask more specific questions. It's too broad question to answer everything.
I suggest that you browse through Apple's documentation on iOS development: http://developer.apple.com/library/ios/navigation/
If you want to learn the low level stuff first, perhaps you should look into how Objective C works and then move to learn about UIKit (which is the central framework/library for iOS app development).

Sencha touch app building

I was put in charge of learning this and well I have read and tried to understand it all. I am lost in how to get it started and optimized. I need to achieve a window at startup that is menu based and takes you to different components. I think I have the photo galleries sorted out just now sure how to link to the startup window.
examples
I used this tutorial when I was trying to learn - http://miamicoder.com/2011/writing-a-sencha-touch-mvc-application/
The learning curve is quite steep but once you understand it it's a really good bit of kit to know your way around.
If you don't already understand the MVC (Model View Controller) architecture then it's going to be a bit tricky but the tutorial explains it all pretty well.
My advice would be start following the tutorial. Stick to it, get it working and THEN adapt it.
Good luck.
With Sencha Touch 2, the team have created a bunch of guides which hopefully help ease the pain when trying to learn the framework.
I suggest you first take a look at the Getting Started Guide, and then move onto the Building your first App Guide. These both should give you a kick start on where to start.
After that, I would definitely recommend you take a look at the code of their various examples, and then try modifying it. When I was first learning the framework (and JavaScript in general) I found that taking existing code and modifying it was definitely the easiest way of learning. Obviously this varies from person-to-person, but it is always a good step.
Much of their documentation have previews and examples which you can actually edit the code inline, which I have found very useful in the past. You can view an example of this here.
The Touch Forums are very active. Almost all topics get responded to within hours, and I have never seen a post which was never responded to.

Begin game programming basics [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Closed 6 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
My 11 year old kid brother wants to learn to program games. He has never programmed but would like to learn programming. His interest lies with games and game programming and he understands that it can be difficult but he wants to do that. So, obviously, I turned to SO folks to know what you feel on how he should go about it. Remember, please suggest on
Areas that beginners can choose,
how to begin in that area,
what to read in the beginning,
initial languages in the beginning etc.
Once the beginning part is taken care of, you may also suggest the intermediate and advanced stuff but this question is about very beginning level. If there are areas like Web games Vs. console games Vs generic computer games, then please advice on the areas. As I said he has never programmed, he might want to try all the areas and choose the one he likes the best. I hope this is not too much to ask for someone who is in this field but if this question is huge, please advice on how to break it into multiple questions. ~Thanks.
I started my programming career writing games when I was 15 and it was a lot of fun (even though I wrestled with C++ for 3 years just because "that's what's used for writing games"). My two cents:
Start with a programming language that is easy to use (NOT C or C++)
Get a beginners book for that programming language (not directed at games)
Decide on some API or environment that provides what's needed for writing games. I started out by doing snake, space invaders etc in the console, but any 2D-environment will do (stay way from 3D for as long as you can; there are much more important things to learn first). SDL/GLUT for OpenGL has bindings in almost any language. Pygame for Python looks promising too. Using HTML5's canvas-element, you could even write the programs in the browser using JavaScript. Im not sure what's best these days, but there you have some suggestions.
Find a community for inspiration and help when stuck. I used gamedev.net. Since we're on stackoverflow, gamedev.stackexchange.com should also be a natural choice :)
Start small. Very small. I mean really tiny. Then take small steps to new challenges. Please don't write an MMORPG.
The game design and graphics are fun, but focus on the programming (for now at least). When you've written a simple game, learn how to do the same thing better.
Set a goal. Imagine the game that you'd want to make. Don't try to make that one immediately, but make sure that each new thing you learn or make takes you one step closer. Don't learn what you don't need so to speak (there's simply too much too learn).
I wish you and your brother the best of luck, I never regret going down the path he's about to take!
For a beginning game developing enthousiast I think you can't go wrong with the combination Python + Pygame. Python is a great, elegant (and easy to learn) all-round language and lots of great tutorials are available for Pygame which explain the basics of (mostly) 2D game programming.
There's this post on Gamedev stackexchange where the poster is in literally the same position.
Quoting my answer from there:
I'm also 15, so I guess that could help? :P
I've recently started learning Python
(been doing C++ for a year or so), and
I'm finding it much easier to learn
than C++. There's a lot less pitfalls,
and you need little code to get
something on the screen - what I find
makes you want to continue.
And there's wrappers like Pygame and
Pyglet over SDL/OpenGL for the
graphics side.
And before he starts making simple
games, I would advise learning a
language for at least a couple of
months. (Of course, text based games
like guess the number and hangman are
good exercises during this time)
And for what to read; I can advise Invent With Python. It goes from learning the language in a very gamedev way - which is a good step to making sure he stays interested; I doubt many kids his age are going to want to learn all about variables and loops, moreso being able to make a game - all the way to seamlessly introducting PyGame and graphics.
It could take some time until he can program a proper game...
But as I see it, he should start with Java as it is easy to learn and good for basic games.
Starting out he wouldn't be able to do much more than a guessing game, but he shouldn't get frustrated, this will take time.
I think you should buy him a book on java, and start from the basics.
You would get many different answers on this one as it is mostly personal opinion...
Teach him the basics of programming: variables, declarations, properties, methods, arguments, classes, arrays, loops. I suggest C# as a starting language, it seems simpler than C or C++ to start with, in my opinion. Once he understands those concepts it shouldn't be extremely hard for him to jump in and follow some XNA tutorials on a simple game like pong or something.
Game Development, part of the Stack Exchange, is a great resource for these types of things. It's loaded with posts like this one.
How about instead of forcing him to learn a language first, get him involved in using a framework where he can readily see results to maintain an interest. Something along the lines of RPGMaker could be sufficient.
My reasoning for this would be that, yes, you want him to learn the basics of making games and introduce programming as well, but you don't want to burn him out on the formalities of a language.
If he is 14, then he is of high school age (assuming US based...), and there is a good chance that there are programming courses available to him there. Let him whet his teeth on those to grind out the difficulties of introducing programming, and then once he is interested in expanding beyond the bounds of the toolset introduce him to the answers posted by the other users.
My two cents...I've seen kids give up on programming before because they jumped right into game making and quickly got frustrated...
In the beginning, make sure you keep it fun. Try mocking old games like 1-stage of contra or air hockey. And use a programming language with easy implementation of timer. Because timers, I think are the easiest way to show some visible effects. I would recommend visual basic or objective-c (I know many people won't agree, BUT it is that damn easy with the power of Xcode). Thumbs up ! Have fun.
I agree with ChristopheD about Python and Pygame. When it comes to languages Python is great for beginners because it is very high level therefore so easier to understand and the syntax is clean and simple. And Pygame is a great library for learning game programming.
Eventually he'll want to move into C++, which as I understand is the go to language for game development. But Python and Pygame would be a better start, especially for an 11 year old.
A good series of easy to read online books are the following three:
http://greenteapress.com/thinkpython/thinkpython.html to learn Python
http://inventwithpython.com/ this site has two books, what to make games in plain Python and the other to make games using the Pygame library for Python. Once he gets through these three books he should be able to start making his own games in Python using Pygame and then eventually move on to more serious game development langauges/tools.
Write some simple scenarios for a game such as Wesnoth is maybe a good start.
Learning basis of programming is also important. A langage such as python is probably a good start.
The language is clear and easy to learn and teach.
And it is very extentable.
This is a -very basic- game source code (Butterfly adventure 1.0) made with javascript to start learn programming. Only basic codes (variable, if, switch, function, event, etc.) used.
It may be useful to start learning game development.
Play the game link
Source code link
Video tutorials (Only in Turkish) link
Screenshot
Have fun.
IMHO he should start learning C.
then switch to OpenGL later once he has the grip of basic C constructs.

Any code samples open-source-engines, or open source hex tile games, references for writing Hex Tile based Games?

Using other questions on here I found Amit's Page on Games including a section on Hex Tiles which also links to a game coding wiki here.
I am looking for suggestions:
(a) libraries, engines or code samples in any language. I have found one in python, PGU+pygame, but looking for more.
(b) open source hex-tile tactics or strategy games.
Because google can find things for me, what I'm hoping is that you have actually used one. So if you googled and then posted, then this is nothing better than let-me-google-that-for you. Much appreciated if (i) you have used it, (ii) seriously, any language at all is okay, C/C++, python, java, flash/flex, whatever.
Related question and another related question but .net
Battle For Wesnoth is a complete, open-source, turn-based strategy hex-based game. Its written in C++. Quite a good game too.
I'm sure there would be something valuable in there, although I've only have a brief browse of the source myself.
I used PGU a number of years ago to make a hex based game for PyWeek, you can take a look at the code if you want to. :)
http://www.pyweek.org/e/PySwec/
I've got a more updated version at home which is quite a bit better but unless you actually want to play the game you should be fine with that. :)
Based on another question here on stackoverflow, there is XConq, an open source turn based tile game.