how to use xcode cocos2d project including both box2d and chipmunk? - cocos2d-iphone

I don't know if this sounds crazy.
I have 2 xcode projects, 1 using cocos2d-box2d and the other using cocos2d-chipmunk, and want to merge them into one single project.
I just know how to create project with choosing box2d/chipmunk, but not import one engine to an existing project with an engine.
I tried to copy files to another project and errors showed at Box2d/chipmunk classes.
How to import Box2D to a Chipmunk project (or the reserve) correctly?

Do not drop them both into your project. Create a static library target for each physics engine. That way you can make sure they build separately, and apply custom build settings for each where necessary.
Since you're already in the process of converting a project you may find it easier to migrate to Kobold2D directly. Both Box2D and Chipmunk are setup and ready to use, there's nothing speaking against using both in the same project. All you'd need to do is add the headers for both physics engines and you're ready to go.
PS: yes, it DOES sound crazy. :)

What were the errors? There shouldn't be anything that would prevent Box2D and Chipmunk from existing in the same executable. My best guess is that you have other duplicate symbols in the project or need to tweak the compile settings for something.

Related

UE4 Can I load .umap into packaged standalone?

I need to load on start .umap files created after packaging standalone version of my app. The problem is that .umap need to be cooked (even when I uncheck Pak flag). How can I solve that?
What I want to accomplish is that to build standalone app. Let designers to create some .umap level files in Unreal Editor. And finally to be able to start my app with new .umap level.
I see 2 possible ways:
Find some plugin or tool which can separately cook .umap file and add it to packaged project. Does such a plugin exists?
Build standalone project without cooking (I don't need to redistribute the project, it's tool for internal use). Is it possible?
Any thoughts?
You should take a look at UAssetManager class, which could be used for loading UE4 assets at runtime. However, I can't promise you it will load entire map for you, i've never used this mechanism at my own.

Xcode support for C++

I try to use Xcode (v.7.3.1) for my C++ project (build system - make), but the experience is quite poor (and it was always like that since old versions like v4 when I started using it) - code completion doesn't work, color syntaxing works oddly (no coloring sometimes, or partially colored code), no "jump-to-definition" functionality, can't switch b/w header/source files with shortcuts. Basically, it's just a text editor where I have to use "Find" and Cmd+Shift+O all the time.
Is this intentional and Xcode will never get any proper support for C++ projects with external build system (make) or am I misconfiguring my project? How can I re-index files in the project? How can I make code completion work?
Thanks,
I believe there is a way to use Xcode with makefiles by adding an external build target, file->new->target->External Build System.
This is an older tutorial but the steps may be worth looking through: http://web.ist.utl.pt/jose.alberto.coelho/mac/MakefilesXcode.pdf
I've never had a problem with the syntax highlighting, but I remember the refactoring support being limited for C++ in some ways.
So, I ended up using this workaround: even though, I use external build system, I create Console Application project in Xcode and choose C++ language in settings. Then, I simply add my source files to the project (just drag folders from the Finder window) and then manually create project targets of type External Build System as I need. I don't use default target and don't use generated main.cpp file at all.
My files get indexed with no problems. I'm also able to debug code as I used to.
I still think Xcode developers should review indexing process for the projects with external build system...
Thanks for all the insights though!

How do i use a bunch of .h and .cpp files to create a static library that can be used in another c++ Project

I am trying to learn C++ from some Stanford Course and they have a custom library which contains a bunch of header files(.h) and their associated source (.cpp) files.
I want to create new C++ projects in xcode 6.x to try out code and include those custom header files in my new projects.
I have no freaking idea how to include those files in my project so that i can peacefully #include "blahblahblah.h" and use functions from that header file without issues.
I am new to both xcode, c++(although i know some coding part) and anything else with this process.
Summary:
I have a folder Library which contains a series of .h and .cpp
files.
I have XCode 6.x.x/Eclipse installed.
I want to create a new C++ project and use #include
"OneOfThoseHeaderFiles.h" and then use a function or something from
those header files.
Also assume i have no clue how to run some command line codes that i see a lot of.
If someone can please tell me in the most simple way(preferably step-by-step) i would be so eternally grateful and sing praises to you until the day i die :)
Note: Either XCode or Eclipse is fine. I really just want to start coding.
I have spent the better part of a whole week trying out xcode, eclipse etc and trying to follow a ton of steps to get it working but i just cant get how to add the files without issues. Either the info seems to be for Xcode 4.x and every menu seems changed or the suggestions are so complicated that a novice like me cant figure it out.
First off, almost all the information for Xcode will be available on the Apple Developer's portal:
https://developer.apple.com/library/prerelease/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/start_project.html#//apple_ref/doc/uid/TP40010215-CH2-SW5
To create a simple static library on Xcode 6 you start by creating a new project, then under OS X - Framework and Library select Library, on the next window change the Framework to None (Plain C/C++ Library) and static (since that is what your are stating).
Once your project is created, add the existing headers and sources to your project, either by dragging them with the mouse or with the add files drop menu from the right click functionality, you can create a new group in Xcode if you want some order for them.
When adding the files, on the add window shown you can select to either copy them or use their current location.
If needed you might have to change the "header search path" in your target configuration under "Build Settings", if it is the first time you are using Xcode some of this will sound weird but I am sure you will find most of it on the Apple Developers portal in great detail.
If you want to test the files without having to create an external static library you could create a command line project and test them faster and easier.

Creating a new Cocos2d-x Project is over 200mb! How to create a more bare-bones template?

Really, the template new project that is created, as described in the Cocos2d-x documentation, creates a massive 200+ megabyte project which hurts my hard drive. I tried deleting stuff, but of course it will give tons of errors because things are missing. So I want someone to give me a reasonable way to create a bare-bones cocos2d-x template, perhaps 20MB or less.
Compare it to a Cocos2d-iPhone template, which is like, only 5 MB.
Very confused, and, just looking for a straightforward way to make a basic new game that isn't huge. It's the same for Cocos2dx-html5. If you take the open source test game "Moon Warriors," it's like, over 300MB. How in the world am I going to fit a 300MB Demo game on my website?
The Cocos2d-x framework is quite large. If you have a project already working, I'd say you could remove the docs, licenses, plugins, templates, tests, tools as well as there are some misc text files like Authors, ChangeLog, etc.
I tried and that shaved off 500MB for me. I compiled cocos2d_libs.xcodeproj just fine.
After cocos new you can remove cocos2d folder inside new project, and create a symlink to unzipped cocos2d-x folder:
rm -rf cocos2d; ln -s /path/to/cocos2d-x cocos2d
This makes 3Mb-14Mb project folder, which can be copied instead of cocos new
To improve build size and time it's possible to use prebuilt cocos2d-x library.
In your project CMakeLists.txt remove add_subdirectory(${COCOS2D_ROOT}) and add link_directories(/path/to/libcocos2d) include_directories(/path/to/cocos2d-x/cocos /path/to/cocos2d-x/extensions). Run cmake ..&& make.
This may error in many undefined references, resolve them by adding libs to taget_link_libraries(). Also it may require setting some options in cocos2d-x CMakeLists.txt to OFF before prebuilding libcocos2d.

C++ - New SFML project with the same settings

I set up a new project and configured it to use SFML as instructed here:
http://www.sfml-dev.org/tutorials/2.1/start-vc.php
I'm going to be developing a chess game, but before that, I will probably create several projects to experiment with SFML and I wondered whether it's possible to copy the solution settings (like the dependencies) to a new project instead of manually configuring SFML every time I create a new project/solution. Is it possible, and if so, how would I go about doing so?
I've already tried going to File -> New -> Project From Existing Code but that apparently didn't work as the dependencies weren't there in the new project.
I'd appreciate help with this.
1- Create your base project with all the settings
2- File (in upper left)
3- Export Template
4- Follow the instructions
5- When you make your project, select "template" instead of the other options
6- Tada!