Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Doc Block
Apr 15, 2003
Fun Shoe
AFAIK the game logic for Angry Birds is written in Lua.

Also, Apple doesn't have rules against scripting languages anymore if I'm not mistaken.

Adbot
ADBOT LOVES YOU

skidooer
Aug 6, 2001

UraniumAnchor posted:

I was trying to find information on if using Lua is feasible in an iOS app but it seems that Apple has rules against using scripting languages
Wax will allow you to write your entire app in Lua, so it is definitely feasible.

Scripting is fine as long as the script is bundled with the app. It's scripts that are downloaded later, after the app is installed, that Apple has issues with.

UraniumAnchor
May 21, 2006

Not a walrus.

skidooer posted:

Wax will allow you to write your entire app in Lua, so it is definitely feasible.

Scripting is fine as long as the script is bundled with the app. It's scripts that are downloaded later, after the app is installed, that Apple has issues with.

Yeah the guy I was talking to said he was under the impression it was too slow for game logic on an iOS device, but if Angry Birds uses it extensively then maybe he misheard. Or maybe the person he talked to was just a bad programmer. :v:

So how would this work with DLC addons that include scripts? I assume I could get the addon approved by Apple and this wouldn't be an issue.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Public service announcement: don't call -[NSNotificationCenter removeObserver] outside of dealloc. tldr: you unregister your superclass too, which can break things. Instead use the more specific -[NSNotificationCenter removeObserver:name:object:].

I bring this up partly to ask a question: what if your superclass also registered for the same notification from the same object, then you deregister it specifically? Are we just hoping that, like the lack of namespaces, collisions just don't happen?

Doc Block
Apr 15, 2003
Fun Shoe

UraniumAnchor posted:

Yeah the guy I was talking to said he was under the impression it was too slow for game logic on an iOS device, but if Angry Birds uses it extensively then maybe he misheard. Or maybe the person he talked to was just a bad programmer. :v:

So how would this work with DLC addons that include scripts? I assume I could get the addon approved by Apple and this wouldn't be an issue.

I imagine that, for Angry Birds, only the high-level logic is done in Lua. The physics, rendering code, etc., is probably mostly C++ with some Objective-C where required.

Whether or not your game will be able to get away with using a scripting language depends entirely on how processor intensive it is.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

UraniumAnchor posted:

Yeah the guy I was talking to said he was under the impression it was too slow for game logic on an iOS device, but if Angry Birds uses it extensively then maybe he misheard. Or maybe the person he talked to was just a bad programmer. :v:

Tap Tap Revenge is widely thought to use it too. It's almost certainly not going to be your performance bottleneck. Lua's pretty fast.

quote:

So how would this work with DLC addons that include scripts? I assume I could get the addon approved by Apple and this wouldn't be an issue.

That is a fantastic question. If you can't include the scripts in the DLC, you could always package all scripts in the app bundle and just unlock them with an in-app purchase.

UraniumAnchor
May 21, 2006

Not a walrus.
Yeah, I've used Lua pretty extensively already in a C++-based engine I've been working on for the last couple of years off and on, so I was surprised to hear that it would potentially be slow on an iOS device. That didn't make much sense to me. Good to hear I'm not alone in thinking that sounds wrong.

I suppose I'll have to try writing some high level logic in C++/Lua and see if the performance difference is anything other than statistical noise.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Lua isn't quite as insanely optimized on ARM as it is on (say) i386, but I don't think it's going to be prohibitively slow.

sevenflow
Jun 28, 2003
just watch it for a second
First app is out on the store today: http://itunes.apple.com/us/app/jetsetter-for-ipad/id416813861?mt=8&ls=1

It's an an iPad app for Jetsetter, the travel company I work for. Features include 360 degree panoramic photos, animation universe (!), full screen photos in both orientations by cropping to photographer defined interest points, and a lot of other stuff that could be dangerous in hands like mine. There are many ways this could break, though I hope most of them have been fixed. If you have a moment and enjoy travel, please try and break it.

geera
May 20, 2003

sevenflow posted:

First app is out on the store today: http://itunes.apple.com/us/app/jetsetter-for-ipad/id416813861?mt=8&ls=1

It's an an iPad app for Jetsetter, the travel company I work for. Features include 360 degree panoramic photos, animation universe (!), full screen photos in both orientations by cropping to photographer defined interest points, and a lot of other stuff that could be dangerous in hands like mine. There are many ways this could break, though I hope most of them have been fixed. If you have a moment and enjoy travel, please try and break it.
And you've already got a writeup on TechCrunch. It looks pretty good -- got me curious enough to join Jetsetter a few minutes ago!

OHIO
Aug 15, 2005

touchin' algebra
Hey guys I'm at Voices that matter this weekend, are any of you attending?

fankey
Aug 31, 2001

Can MPMoviePlayerController deal with anything other than a .m3u8 file when loading from an http server? Pointing it at a .mov, .mp4 or .m4v doesn't appear to work.

LP0 ON FIRE
Jan 25, 2006

beep boop
Cocos2D iPhone question:

Say if you wanted to have a sprite move to a touch location, but on it's way there are obstacles that should block the player. On it's way doing this action, is there anyway to check for obstacles to stop the action without timers that constantly check collision?

On the bottom post on this forum, it looks like it's the way this guy does it: http://www.cocos2d-iphone.org/forum/topic/12373

e:Please let me know if there's a better way, but I think this might have to do something with making some kind of pre-check along the path that the sprite is going to move to see if there's any obstacles on the way. I was just hoping there was something built in..

LP0 ON FIRE fucked around with this message at 19:18 on Apr 8, 2011

sevenflow
Jun 28, 2003
just watch it for a second
There's some useful information on the web (http://stackoverflow.com/questions/1354472/detect-if-line-segment-intersects-square should work in Objective-C), but basically you just need to check if a line (representing the path) intersects a rectangle (representing the obstacle) before you start moving. It's a little more complicated if the objects move but the basic idea is the same.

LP0 ON FIRE
Jan 25, 2006

beep boop
Thanks... I know this will be simple to a lot of people but I'm sure this will break my brain once I get into moving objects!

sevenflow
Jun 28, 2003
just watch it for a second
In that case you can project where the object will be at the time of intersection, or you can just run the check every time your logic loop fires while the player is moving. It's not an expensive operation so you shouldn't run into any issues.

Small White Dragon
Nov 23, 2007

No relation.

fankey posted:

Can MPMoviePlayerController deal with anything other than a .m3u8 file when loading from an http server? Pointing it at a .mov, .mp4 or .m4v doesn't appear to work.
I worked on a video streaming app during the iOS 2.0 - 2.2 period, and it did then.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

UraniumAnchor posted:

Yeah the guy I was talking to said he was under the impression it was too slow for game logic on an iOS device, but if Angry Birds uses it extensively then maybe he misheard. Or maybe the person he talked to was just a bad programmer. :v:

So how would this work with DLC addons that include scripts? I assume I could get the addon approved by Apple and this wouldn't be an issue.

There are apps that have DLC with code included in the download (C64). You'd be fine. The restrictions exist to prevent you from providing an interface to the scripting engine to the user.

samiamwork
Dec 23, 2006

rjmccall posted:

Lua isn't quite as insanely optimized on ARM as it is on (say) i386, but I don't think it's going to be prohibitively slow.

Lua is optimized for i386? I'm not aware of anything architecture-specific in Lua. Are there optimized branches somewhere or something?

fyreblaize
Nov 2, 2006

Your language is silly
Is there anything faster for downloading an image than using NSURLRequest? Right now, a 135k jpeg is taking 2-4 seconds to completely download, and the time between the initial request and response is anywhere from 400ms to 1.5s.

I'm working on displaying a full page ad before a video plays, and I'd like to avoid having to preload the ad and just download it when the request is made, but if it's gonna take more than a couple seconds I'll probably have to resort to that.

Sch
Nov 17, 2005

bla bla blaufos!bla bla blaconspiracies!bla bla bla

Ryouga Inverse posted:

There are apps that have DLC with code included in the download (C64). You'd be fine. The restrictions exist to prevent you from providing an interface to the scripting engine to the user.

Really? That's surprising. I thought the whole reason for not allowing to side-load executable code is so that you can't get around the review process and e.g. introduce malicious code or violate any of the other app store policies?

Letting the user execute manually entered code is OK as far as I know, there's at least one Scheme interpreter in the app store.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

samiamwork posted:

Lua is optimized for i386? I'm not aware of anything architecture-specific in Lua. Are there optimized branches somewhere or something?

The trunk Lua implementation, no, but if you're interested in high-performance Lua there's LuaJIT, which has a very strong argument for being the best dynamic-language implementation in the world.

UncleGuito
May 8, 2005

www.ipadbackdrops.com daily wallpaper updates deserving of your iPad
I'm not sure if this is the right thread for this, but here we go:

Does anyone have any experience with website coding for iPad? I'm trying to optimize my site for iPad viewing, but since positioning/overflows are messed in mobile safari, my sidebar only extends down the length of the screen (then ends, resulting in a white space if the user scrolls below that area). I've tried fixing it by using fixed positioning, but the user must then use two-finger scrolling in order to navigate downwards (which is kind of a pain).

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

UncleGuito posted:

I'm not sure if this is the right thread for this, but here we go:

Does anyone have any experience with website coding for iPad? I'm trying to optimize my site for iPad viewing, but since positioning/overflows are messed in mobile safari, my sidebar only extends down the length of the screen (then ends, resulting in a white space if the user scrolls below that area). I've tried fixing it by using fixed positioning, but the user must then use two-finger scrolling in order to navigate downwards (which is kind of a pain).

If nobody answers here, the Web Design / Development thread deals with questions like this fairly regularly, FYI. Regardless, you'll need to post a URL or CSS / HTML for anyone to be able to help.

UncleGuito
May 8, 2005

www.ipadbackdrops.com daily wallpaper updates deserving of your iPad

Lumpy posted:

If nobody answers here, the Web Design / Development thread deals with questions like this fairly regularly, FYI. Regardless, you'll need to post a URL or CSS / HTML for anyone to be able to help.

Thanks!

lord funk
Feb 16, 2004

What's the easiest way to implement a group of vertical sliders for something like this (excuse the hideous colors):



Each vertical box is a slider-style object. I want the user to be able to slide their finger across the range to set them all quickly. Should I subclass UISlider, or roll my own subview?

samiamwork
Dec 23, 2006

rjmccall posted:

The trunk Lua implementation, no, but if you're interested in high-performance Lua there's LuaJIT, which has a very strong argument for being the best dynamic-language implementation in the world.

Oh, neat! Learn something new every day. I'll have to keep this project in mind. Thanks!

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

pokeyman posted:

Public service announcement: don't call -[NSNotificationCenter removeObserver] outside of dealloc. tldr: you unregister your superclass too, which can break things. Instead use the more specific -[NSNotificationCenter removeObserver:name:object:].

I bring this up partly to ask a question: what if your superclass also registered for the same notification from the same object, then you deregister it specifically? Are we just hoping that, like the lack of namespaces, collisions just don't happen?


Not sure about that but I have noticed that people generally forget to unregister their observers. This one bit me as well and was the primary cause of Storm Sim crashing.

LP0 ON FIRE
Jan 25, 2006

beep boop

sevenflow posted:

There's some useful information on the web (http://stackoverflow.com/questions/1354472/detect-if-line-segment-intersects-square should work in Objective-C), but basically you just need to check if a line (representing the path) intersects a rectangle (representing the obstacle) before you start moving. It's a little more complicated if the objects move but the basic idea is the same.

Thanks for your help. I did some thinking about this over the weekend before I ever went ahead and started coding, and I think (at least in my case) it will be a little bit different than this process even for still objects. My player sprite is 3 blocks wide and 2 high. So more than a line will need to test for collision.



Say if the red blocks are my player, the blue block was a block that the player could collide with and the bottom left corner of the green checkerboard is the touch location. If a line was drawn diagonally from the center point of the player to the bottom left of the green checkerboard block, it would never cross over the blue block that it should collide with, right? So this means that part of the player could cross over the blue block which shouldn't happen. The player has smooth movement and can stop on any pixel, and not rounded to the nearest block. So I'm thinking the test needs to be checking a path the size of the player, checking every square along the way if there's any collidable blocks. Thats for still tiles that are obstacles only. You think I'm on the right track with that?

edit: Even better... I think CGRectIntersectsRect will solve the issue even more. Still just thinking it out but for some reason I think this will be a smart choice.

LP0 ON FIRE fucked around with this message at 21:20 on Apr 11, 2011

dizzywhip
Dec 23, 2005

So this isn't specific to Apple development, but I'm working on a music-related app that renders a musical score. That of course means I need to draw lots of musical symbols, so I've been looking into music fonts. There's one called Petrucci that seems to have been originally created long ago to be the default font for Finale. I'd love to use it, but I'm totally clueless about licensing issues.

Googling the font brings up a bunch of sites that have the font freely available for download. However, I can't find any licensing information about the font at all. I assume it's not okay to just use the font in a commercial app, but I'm not really sure. I'd be willing to pay a bit for a commercial license for the font (or any other quality music font) but I can't seem to find any information on how to do so.

Does anyone have any experience with this?

xzzy
Mar 5, 2009

I don't have experience licensing fonts for games, but I've done it in the publishing and printing world. Someone, somewhere, owns the copyright to that font. They're probably buried under a mountain of google results that let you have it for free, but they are out there. Hard part is that most licenses (like if you bought them from Adobe), it's a per-computer license. You have no privileges to distribute it.

Odds are good that you could use it without license and never get caught, but be in a world of hurt if you do get caught.

A quick google for musical notation fonts turned up this:

http://www.music-notation.info/en/compmus/musicfonts.html

Which at least lists who owns the copyright, so you can contact them for information.

LP0 ON FIRE
Jan 25, 2006

beep boop

Gordon Cole posted:

So this isn't specific to Apple development, but I'm working on a music-related app that renders a musical score. That of course means I need to draw lots of musical symbols, so I've been looking into music fonts. There's one called Petrucci that seems to have been originally created long ago to be the default font for Finale. I'd love to use it, but I'm totally clueless about licensing issues.

I wouldn't risk it. You should take a look into MusiQwik fonts. Will these work for you? Check out the OFL License on this link below. I'm pretty sure you would freely be able to use this in commercially sold software.

http://cg.scs.carleton.ca/~luc/allgeyer/allgeyer.html

dizzywhip
Dec 23, 2005

NOG posted:

I wouldn't risk it. You should take a look into MusiQwik fonts. Will these work for you? Check out the OFL License on this link below. I'm pretty sure you would freely be able to use this in commercially sold software.

http://cg.scs.carleton.ca/~luc/allgeyer/allgeyer.html

Hmm...MusiSync may be usable, but I'm concerned that it doesn't have enough symbols. I'll look into it though, thanks!

xzzy posted:

I don't have experience licensing fonts for games, but I've done it in the publishing and printing world. Someone, somewhere, owns the copyright to that font. They're probably buried under a mountain of google results that let you have it for free, but they are out there. Hard part is that most licenses (like if you bought them from Adobe), it's a per-computer license. You have no privileges to distribute it.

Odds are good that you could use it without license and never get caught, but be in a world of hurt if you do get caught.

A quick google for musical notation fonts turned up this:

http://www.music-notation.info/en/compmus/musicfonts.html

Which at least lists who owns the copyright, so you can contact them for information.

That's a very useful list, thank you! I suppose I can get in touch with some of these people and see if I can work something out.

fankey
Aug 31, 2001

Small White Dragon posted:

I worked on a video streaming app during the iOS 2.0 - 2.2 period, and it did then.
Can you explain what you mean by this? I tried playing an .mp4 ( downloaded from here http://www.h264info.com/clips.html ) straight from an http link and I didn't have any success. I also converted it to an .m4v using Handbrake with the iPad profile and it didn't work either. Neither played when I pointed Safari straight at the url either - it just showed a 'No Play' icon. I'm pretty sure I had the MIME types correct on my server. It's possible the encoding was the problem but I'm not sure what else to try.

skidooer
Aug 6, 2001

fankey posted:

It's possible the encoding was the problem but I'm not sure what else to try.
Make sure your web server supports HTTP ranges. The well known ones like Apache typically do, but if you are using something a little more esoteric, it might not.

fankey
Aug 31, 2001

skidooer posted:

Make sure your web server supports HTTP ranges. The well known ones like Apache typically do, but if you are using something a little more esoteric, it might not.
That's probably it - all three web servers I was trying to use would probably be classified as esoteric - homemade c#, busybox and whatever is build into our NAS.

Small White Dragon
Nov 23, 2007

No relation.
I ran into a really bizarre problem in one of my apps.

In many cases, I have views that I CATransition out, and CATransition in a new one in its place. However, if I have an active touch on the screen I transition out, the new one will not appear or will disappear as soon as the touch is let up? :psyboom:

Has anyone seen anything like this?

wellwhoopdedooo
Nov 23, 2007

Pound Trooper!

fankey posted:

That's probably it - all three web servers I was trying to use would probably be classified as esoteric - homemade c#, busybox and whatever is build into our NAS.

On the plus side, HTML ranges are pretty easy to implement for a basic case--I did it once in VBScript (don't ask) in order to support resuming downloads.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Is there any reason not to do stuff like puzzle games in just plain UIKit?

Adbot
ADBOT LOVES YOU

sevenflow
Jun 28, 2003
just watch it for a second

NOG posted:

edit: Even better... I think CGRectIntersectsRect will solve the issue even more. Still just thinking it out but for some reason I think this will be a smart choice.

The only issue with this is that you won't be able to really project before hand, you'll have to test on every frame. Which is fine, it's a really cheap operation.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply