Load a .tmx (Tiled Map) in Sprite Kit? - ios

Is there a (preferably easy) way to load a .tmx file in iOS 7's Sprite Kit? If not, are there any alternatives?

you should use JSTileMap that is designed to work with Sprite Kit
add JSTileMap files to your project
add libz.dylib to the linked frameworks and libraries section of your project
import JSTileMap.h
and load a map with:
JSTileMap *tiledMap = [JSTileMap mapNamed:#"mapFileName.tmx"];
if (tiledMap) [mySKNode addChild:tiledMap];
Here is the source: https://github.com/slycrel/JSTileMap
Good Luck!!

Check out TilemapKit for Sprite Kit. Unlike other solutions it loads and renders all (!) map types and variations supported by Tiled, including staggered iso and hex maps!
TilemapKit is properly engineered like a OOP framework should be, and exposes all data that is stored in the TMX file. In other words it's definitely not just a single class that got everything crammed into it.
Tile picking (point to coord, coord to point conversion) for all map types/variations is built-in. More awesome features on the way, review the roadmap and check out the Class Reference.
TilemapKit is also tested to be fully compatible with Swift and Mac apps, too.
Visit the TilemapKit forum if you have any questions or requests. I'm also posting frequent development reports so you can check what's coming up next.
Disclaimer: If it isn't obvious by now, I'm one of the TilemapKit developers. :)

This is the best I have found. I am not sure if the do-it-yourself method would work this instance as I haven't tried implementing it yet.
http://gamedev.tutsplus.com/tutorials/implementation/parsing-tiled-tmx-format-maps-in-your-own-game-engine/

Related

Where can I find new Cocoa Touch Framework project in XCode?

I'm following a tutorial to learn to make a cocoapod. Unfortunately the tutorial instructs to create a "Cocoa Touch Framework" when that no longer exists in current XCode.
What's the current equivalent, that I can use for the purposes of this tutorial / to make a cocoapod?
The answer isn't too complicated: it's the "Framework" option.
A Static Library is pure object code (a.k.a. compiled code), and it cannot contain images, storyboards, etc. Pure object code also means you can't read the code files which makes it pretty much un-debuggable.
A Metal Library lets you develop using the Metal library, basically for 3D graphics and GPU stuff.
Framework is a cocoapod framework. Tried and tested and loved by all Apple Developers.

Dynamic 3DObject use in ARKit-SceneKit

I want to download the 3D Object-dae(collada) file from server and want to display on surface dynamically so can please share how can I achieve this in ARKit via SceneKit or else?
You can check this link: https://the-nerd.be/2014/11/07/dynamically-load-collada-files-in-scenekit-at-runtime/ it is old post but I don't think something is changed since that
According to this (see the Discussion section): https://developer.apple.com/documentation/modelio/mdlasset/1391813-canimportfileextension?language=objc
dae is not supported at runtime (ModelIO).
Additionally I'm working on a library called AssetKit (In Progress) and it will full support COLLADA and glTF, it is too early to say that but after initial release, you will be able to load dae files dynamically. It is written with C99 but I'll optimize it for Swift (by writing wrappers or integration with SceneKit...). Since it is still in progress I suggest that follow the first link

How to edit and load tile maps in Swift? [duplicate]

Is there a (preferably easy) way to load a .tmx file in iOS 7's Sprite Kit? If not, are there any alternatives?
you should use JSTileMap that is designed to work with Sprite Kit
add JSTileMap files to your project
add libz.dylib to the linked frameworks and libraries section of your project
import JSTileMap.h
and load a map with:
JSTileMap *tiledMap = [JSTileMap mapNamed:#"mapFileName.tmx"];
if (tiledMap) [mySKNode addChild:tiledMap];
Here is the source: https://github.com/slycrel/JSTileMap
Good Luck!!
Check out TilemapKit for Sprite Kit. Unlike other solutions it loads and renders all (!) map types and variations supported by Tiled, including staggered iso and hex maps!
TilemapKit is properly engineered like a OOP framework should be, and exposes all data that is stored in the TMX file. In other words it's definitely not just a single class that got everything crammed into it.
Tile picking (point to coord, coord to point conversion) for all map types/variations is built-in. More awesome features on the way, review the roadmap and check out the Class Reference.
TilemapKit is also tested to be fully compatible with Swift and Mac apps, too.
Visit the TilemapKit forum if you have any questions or requests. I'm also posting frequent development reports so you can check what's coming up next.
Disclaimer: If it isn't obvious by now, I'm one of the TilemapKit developers. :)
This is the best I have found. I am not sure if the do-it-yourself method would work this instance as I haven't tried implementing it yet.
http://gamedev.tutsplus.com/tutorials/implementation/parsing-tiled-tmx-format-maps-in-your-own-game-engine/

ios : Displaying a simple 3D model with GLEssentials sample code

My goal is to display a simple 3D model and apply a texture on it.
I've downloaded the GLEssentials ios sample project to learn how to develop this (i'm new in ios OpenGL-ES API)
But the example model is a .model file, which I never heard about and which never appear in model bank websites.
What is this kind of file?
is the sample code compatible with other common model types (.obj, .c2d, .3ds)?
is it a good idea to start from this project?
Have a look at this question:
How to convert Blender blend (or obj) file to Qualcom Vuforia .h file
In my answer, I describe a script and accompanying Xcode project that converts .obj/.mtl files to header files suitable for OpenGL ES on iOS [link].
In response to your questions:
I believe the .model file is only appropriate for the sample project and is a proprietary Apple extension. It most likely contains simple data such as vertex positions.
I think you'd struggle to fit other model types into the sample code, which is very complex for OpenGL ES beginners. You might want to have a look at .pod files on Cocos2D here. I've seen and heard great things about it.
I wouldn't recommend it :)

Loading 3D model in iOS

I'm creating a game application from scratch with xcode for iOS, and I've use the OpenGL Game projet template to create mine.
I've searched a lot in the past few days, but I can't find any tutorials or example as to how I would load 3D model (via .obj files) in my application. I've found some documentation on loading them onto an app with a console script, but I need to do it programmatically.
Any help would be very appreciated
Also, my 3D models are created using blender
The future will be here momentarily — SceneKit, available in OS X since v10.8, will be in iOS 8. It can build and render a scene with COLLADA (.DAE) models directly. No need for third-party tools or code, nothing complicated to learn.
Apple's documentation is pretty good but if you prefer then other tutorials are available.
OpensceneGraph has support for iOS and a lot of prebuilt code which can help you develop the game. It supports loading OBJ models.
I recommend to use an Engine (like isgl3d, nineveh, Cocos3D, ...) for creating a 3D game, it will be hard if you use Opengl for a start.
Note: you can search for a list of game engine to choose the suitable one for you game, cause there is a lot of game engine, open-source or paid engine.
You can download the zip file from here and then run ./obj2opengl.pl 3DModel.obj in terminal .It will give you 3DModel.h file as output.
You need to use glDrawArrays instead of glDrawElements as the .h file contains array.
Obj files are simple to parse and are well described on wikipedia. You should be able to load them in one or 2 hours. But if you want to load the materials you need to invest some more time in your engine and into loading the obj file.

Resources