Scripting languages on iOS games - c++

First of all, there are other topics covering this subject but they were posted before Apple made the latest changes in its licenses this year.
I'm quite confused with Apple's iOS developer agreement license. Does it completely forbid scripting languages on game programming? Even if I don't compile it at runtime and provide all the code within the game package?
I have a game engine written in C++ which provides a scripting layer based on AngelScript used to ease the game logic programming. Is it true that I can't ever publish a game made with it as long as I use AngelScript for game event scripting?
Many game developers put an abstraction layer over their C++ library/engine/framework to ease game development, which doesn't change the fact the the games were actually written in C/C++.

You can use a scripting language as long as it doesn't download any code. It's not the scripting language apple has a problem with Angry birds for instance uses (lots) of Lua code.
If though you try downloading code and executing it then Apple will reject your app. Although even this is a gray area. For instance 'when does something become code?'. As an example you can download a new level pack for your game if then level's are defined in XML files.
But say for instance you use your own custom file format rather then XML for greater functionality. At what point does your code stop simply define parts of the game and become code?
Like many regulations there are gray areas even with things apple forbids (downloading code), however you shouldn't have a problem using a scripting language.

With Unity out and about on iOS, I have a hard time believing that Apple will enforce this, if they can...

Related

Qt Quick controls 2.0 for embedded device

My long term goal is to make HCI development for embedded devices, and by embedded I really mean it, not phone devices.
I've been working on Qt Widgets for a month now, avoiding Qt Quick for some reasons (I feared that QML code wasn't optimize), but yesterday I have watched this video :Youtube
The speaker says at the end : "If you're making an embedded product these days, use Qt Quick, especially now in 5.8. There's no excuse not to use Qt Quick"
But on the contrary, he explains that for embedded devices we should use c++ code, not JavaScript.
I don't really get it, does it means that I have to create all my objects in c++ code and make my architecture using Qt Quick ?
I don't really get what Qt want us to do. Is it just communication, since they don't want to optimize the old and stable Qt widgets, or is Qt Quick really the solution for embedded devices ?
I personally think that Qt is not the solution for embedded devices, as they keep evolving, changing strategy, and seems not to know where they are going.
I apologize for this non-algorithmic question, and thank you for all your answers.
I can't speak to the developer's intent, nor can I speak for other developers. I can only speak to what I understand, as a developer that has been designing embedded devices for 40 years (sorry for being a number dropper).
C++ or JavaScript? I don't feel that question has too much to do with whether you use QtQuick or not. Sure, you can embed some JaveScript in QML code (with limitations), but you can also use C++ in the same code base (just not embedded in the QML). Then there's Python. Both Qt and QtQuick are programming frameworks, and are somewhat language agnostic.
My perspective is that QtQuick is a good, portable way to create your user-interface code. In my current project (a multi-axis industrial servo-control system) I use QML for the user-interface (with a little JavaScript where needed), C++ for the bulk of the higher level processing (like network control and data-streaming), C and assembly language for the lower levels (those routines executed in uC's and DSP's). QML and C++ interface together nicely, in my opinion.
I believe the speaker is getting at the idea that most if not all your business logic should be done using a C++ model back-end. It is possible to do all your logic just in QML with embedded JavaScript however, because JS is an interpreted language its performance at run-time can possibly be less than compiled C++ code(dependent on how well the C++ is written).
Essentially you only want to use JS to manipulate graphical components while using C++ with QObject models to update the QtQuick elements' individual properties.
This is mentioned in the Qt Quick Best Practices wiki,
https://wiki.qt.io/Qt_Quick_Best_Practices

Game engine C++ and objective C/Xcode coding

I'm quite confused.
I want to develop a 3D game app. I have Unreal engine or Unity to choose from.
Both of them are coded in C++.
Where I have to use objective c that is the main language for iOS?
Can I do the app totally in the game engine Unity/UDK, coded there and then send it to the app store without any programing in objective c and straight from the game engine without using Xcode?
I really hope that the 6 month of full immersion in objective C/xcode were a waist of time.
Sorry if this question is very low level
Thank you
Regards
CL
If you are looking into programming for iOS... Yes you will need to know Objective-C (as it is the main language) and Xcode.
If you are looking to develop a 3D game, start looking into OpenGL ES.
You can't just write a game for Unreal/Unity and send it to the app store... doesn't exactly work that way.
With Unity3D, it is not C++ it is C#
Both are great engines, but if you are new to this, suggest going with Unity3D. Its easier to learn, with tons of free or cheap, easily accessible scripts and art.
and yes you can create the whole game in-Unity-engine, submit to apple and have it Live to the world (without knowing or needing any objective C)
You can also upload it to the app store submission with only a few setup steps.
You will need to download and install XCODE, but you don't need to learn any XCODE programming or project setup as unity does it all for you.
You won't need to learn OGL, or shader language (Unity comes with a suite of free, optimized mobile shaders) though it is fun to learn how to make your own later on.
Any native (objective C) stuff you might need, you can all do just by buying cheap plugins for unity that others have written. (usually in the $20 -$50) range.
You will need.. an apple developer account $100 a year.
Unity for iOS... basic or pro version.
a Mac, or a Hackintosh on a PC (mac mini is the easiest / compromise price route to go)
an iOS device would also help. (suggest getting several different ones for testing, or asking friends)
You could also do Droid instead of iOS. You dont need a mac then. But iOS apps make most of the money. something like 70% iOS 30% droid.
have fun!
You will have to create an Objective-C wrapper.
This is a good start point.
TECH TALK: BRIDGING UNITY AND THE IOS SDK

Should I be using scripting in this circumstance?

I am writing a game. it is in c++ an direct x and I think I am making my own engine as I am programming from winproc up.
I have made large amounts of progress such as sound, collision detection, AI specific to my game settings, dynamic graphics creation from tile sheets.
after doing some research on event programming I have been told to "script it". I have researched this and as far as i see scripting is used so non programmers can add to the project.
I an a prety good programmer and I have no intention of having anyone else work on the game except on outside things such as graphics or map design. I already had a function where I can read in maps from csv files. these contain not just the tile layout but the npc data, entrances/exits. other files of the same nature control monster and item data so I can update the contents without a recompile.
So I am asking for the view of experienced programmers and maybe real world examples that relate to my circumstances as to why I should or should not use scripting in my game?
The NPC and monster data need to be able to contain some simple logic like "if the player has this item", "if the player has been to somewhere", "if the player is comming from the right" etc. And for this you'll need ability to define some composed actions and conditionals. That is called scripting and is best done by incorporating some existing script language interpreter like Lua, Python, some variant of JavaScript, whatever.
There are several reasons to use a scripting system in a game, not just as you pointed out, to allow non-programmers to add game content. The first game I worked on professionally used a scripting system and the only people who were writing scripts were the programmers who created the scripting system. There were two reasons they used it:
build times
New data files/script files can be tested quickly. This particular engine didn't support it, but some allow for script files to be reloaded while the game is running. The more times you can iterate through the build-deploy-test cycle, the more you will be able to tweek your game and end up with a much better game.
power of expression
A custimized scripting system can allow you to easily express/code concepts that are cumbersome in traditional programming. For example, the game engine I am working with now allows me to easily control concurrent animations in script.
I don't think scripting is entirely necessary in your case. The bonus behind adding scripting support an engine have been listed up and down this page.
It gives you a simple langue to work with
It is more accessible to someone without training
It can be compiled on the fly, hot
swapped at runtime
For lots of high end games with large teams these items are very important. But it really comes down to the goals for your engine. If you are not considering sharing your engine and plan to work on the game just yourself then scripting does loose some of its benefits. Adding a scripting language also has some down sides.
Add complexity and creation time to your engine
Increase debug time, even if the scripting language has a wonderful debugger, switching between 2 languages is never smooth.
As long as you still have a data driven design (keeping stats and types in separate files which can be swapped out during runtime) you retain the ability to hot-swap out data for rapid iteration.
definitivly add scripting. Its a pita to recompile the whole game, just because your player does 0.8 damage instead of 1.0. Also, If you want to have a door open under certain circumstances, you need it definitfly. I would do most of the game in a scripting language, Its just more flexible.
Big names are using scripting languages. For example Eve Online is written in stackless python. Other examples can be found here: http://wiki.python.org/moin/PythonGames

Cross-platform, open-source development framework that needs 3d graphics

I'm thinking of developing a game-like piece of software. It will probably require a bit of OpenGL, MIDI input, and math. I'd like to eventually sell the software, so it needs to be installable on PCs with different OSes. And I don't want to have to spend a lot of time on memory management and other low-level details.
My question is this: what language/framework would you use for such software?
You have got a lot of options my friend, here are just a few which allow you to use a high level language to develop.
Torque 3D http://www.garagegames.com/
I've used this a bit and can tell you its a pretty good solution. You can build you game logic in their TorqueScript. Using it also gets you the option to release on pretty much every major platform including consoles and the browser. The only snag is it does cost money, but is very affordable for indies.
Panda3d http://www.panda3d.org/
This a completely free open source engine. I provides a lot of functionality and also allows you to program your game logic in python. The platforms it supports is Linux/Mac/PC.
Mono http://mono-project.com/Main_Page
I have not played around with this too much, and am not sure how good their 3d is (it isn't known for it anyway). It does allow you to program in a number of high level languages (C# and python to name a few). It also allows you to deploy to a number of platforms including embeded devices and the iphone (MonoTouch).
I would check these out and see if any are a fit for your situation. If none are then there are a large number of other options out there.
I think the closest thing to what you're after is Java. It has decent support for OpenGL(JOGL) and a good standard library that works on most systems.
Despite what some people will tell you, Java isn't as fast as C, and this can rear it's head doubly so in a game. It is cross platform though, and you don't have to bother with all that tiresome memory-management.
I would use C# for scripting & the Unity 3D Engine. http://unity3d.com/
Unity has a reasonable licensing fee but it's also free to download and get started. Check the details for when a licensing fee is payable.
Anyways, Unity3D takes care of:
3D rendering
Memory management
Input
Audio & Video
Networking
Asset pipelines
Scripting through the Mono CLR (ie, you can use C#)
And has a great level/world editor
If you are willing to trade raw speed for ease of use then this is for you. We started a project intending to use Unity. Our project needed greater customization than we could get from the engine. We wanted source code and to run at 60fps so we upgraded. But I would still recommend it as a solid multi-platform multi-OS solution.

C++/Qt vs Adobe AIR [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have to choose a platform for our product. I have to decide between The Qt Framework and Adobe's AIR. I am well versed with Qt as I have worked for the last two years. I looked up at the Adobe's site but all the info about flex, flash, ability to coding in HTML/ActionScript is overwhelming and confusing. I cannot understand the following about the Adobe ecosystem.
I have the following questions on Adobe AIR:
What language do I use for coding my application? (not just defining the looks of UI)
Like in Qt I use C++. Is it Actionscript?
Can we say AIR is only for making UI's for apps.
Where is the doc for the utility classes along with AIR?
e.g. http://qt-project.org/doc/ for Qt
Qt ships with a huge set of premade widgets that one can use. Does Adobe ship with any such widget set and if so where can i see it as in url?
I understand flex SDK is open source. Can I make commerical apps and ship them ? Does flex SDK ship everything (compiler, utility classes/widgets)
How much does AIR cost in terms of licensing?
Is there something in AIR that is equivalent to QGraphicsView of QT?
If you needs to access a lot of native libraries, you'll need to stay within your QT environment. Keep in mind that AIR is single-threaded and is run on the Flash Player (something that was originally designed for frame-based animations.)
However, depending on the style of application you're building, AIR might suit you just fine.
Beware that AIR can get confusing because there's a few different developer paths to creating AIR applications: 1) using html/javascript and the AIR SDK, 2) using Flash/Actionscript and 3) using Flex SDK and/or Flex builder. The last one is the most capable as far as coming from traditional desktop development background.
Small apps that are Web 2.0 for hooking into web services are good candidates for AIR applications. Things like the IM client Digsby would be great. My favorite AIR app that I've seen thus far is Basamiq Mockups. Other useful apps are TweetDeck. These are good examples of the types of things that are well-suited to solve with AIR.
You should visit the Adobe Showcase and look at some applications: http://www.adobe.com/products/air/showcase/
Also, if you're looking to just get out of the C++ game, I believe QT has some java bindings now...also I remember some python bindings, but never look at those myself.
As far as QGraphicsView, people have done similar things in Flex. I tried Googling right now but couldn't find them initially, but people have taken things like A large image, and then only displayed a current region in the window. Also, in the next version of Flex, they're acutaly building an official ViewPort component:
http://opensource.adobe.com/wiki/display/flexsdk/Gumbo+Viewport
Go spend some time with this AIR application and then ask yourself if Adobe Flex and AIR are worth investing your time in mastering (be prepared to ask yourself why something comparable doesn't exist for the likes of C++/QT):
Tour de Flex
Tour de Flex is a desktop application
for exploring Flex capabilities and
resources, including the core Flex
components, Adobe AIR and data
integration, as well as a variety of
third-party components, effects,
skins, and more.
Some of your questions:
Flex can be coded in MXML and
ActionScript3. AIR additionally
supports HTML/DOM/JavaScript
programming as webkit HTML render engine is built into
the AIR runtime.
MXML is an XML declarative DSL that
gets compiled into ActionScript3
imperative code. It is quite good,
though, for declaratively coding the
graphical forms of the UI (i.e., the
views of the MVC pattern).
ActionScript3 has a heratige that is
founded on JavaScript, but it has
been embelished to the point it more
resembles Java or C#. It has package
namespace, classes and interfaces
with inheritance, class member
access protection keywords,
constructors, static members, and
some very nice additions over Java:
properties, events, data-binding,
and closures.
Flex style programming is also a single-threaded model that relies on asynchronous I/O interactions. This is a simpler model to program than multi-threaded Java Swing or C# .NET Winform apps, yet permits achieving the same net results of program behavior. I elaborate on that here:
Flex Async I/O vs Java and C# Explicit Threading
Flex is open source, you can download the SDK for free, there are no licensing costs associated with it. (see their FAQ)
They do ship a 'flex builder', which is some custom Eclipse I think, and which costs money, but you can perfectly work without it.
The docs can be found at adobe's livedoc pages. (which to some, is enough reason in itself to dislike Adobe ;))
I do wonder, if you are well versed in QT, why are you considering something else? Which advantages do you expect AIR to give you over QT?
I have some experience with both QT and Flex, but not nearly enough to weight one versus the other. I do know QT/C++ is much, much more mature than Flex/ActionScript.
If you already know QT, I don't think the time spend learning a new framework (and programming language) will gain you enough to be honest...
I've used QT and Flex (not so much Air itself though) and have found that Flex is faster for getting apps up and running as well as modifying, while QT gives you more control -- particularly in the installer. The Air app installer is pretty awkward, or at least it was when I tried it, though it may have been improved since then.
The big advantage of Air is that much of the code for it can be run in Flash inside web pages. You can't access the local file system etc. from the web for security reasons but just about everything else is portable.
I made the opposite move. I started working on Adobe stuff and moved to QT. The main reason for doing it was about Adobe framework limitations. When you are using Adobe stuff, you are limited to the tools that they produce, it is hard to introduce external frameworks or libraries, if can not do what you want with Adobe stuff. Usually, the solution to do this is to use sockets, which transforms a supposed "stand-alone" application on a client-server architecture. In addition, if you are using many external stuff it can be hard to manage so many different clients.
Using QT you can code in C++ and add any external framework or lib you want. Even though, some times it can not be easy to code it, is doable and with no "strange" system architecture.
If your looking for some examples of "fun" UIs using Qt and SVG, take a look at the KDEGames [1][2] and KDEEdu [3][4] projects. There's lot's of nice code there that uses QGraphicsView and SVG to created scalable interfaces. Of course note that's it's GPL so be careful what you "borrow" if your app isn't.
[1] http://games.kde.org/
[2] http://websvn.kde.org/trunk/KDE/kdegames/
[3] http://edu.kde.org/
[4] http://websvn.kde.org/trunk/KDE/kdeedu/
I'll second #Pieter's comment - if you already know QT, moving to a whole new environment is going to take a LOT longer.
QT has the advantage of being cross-platform, and very mature: there are libraries for Windows, Linux, and Mac OS X. I'm not extremely familiar with AIR beyond knowing it's from Adobe, but the product site seems to indicate that it's for rich internet apps (http://www.adobe.com/products/air/). If that's true, then QT would be the far better choice if you're developing a desktop application.