Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


alnite

Member Since 07 Nov 2002
Online Last Active Today, 12:10 AM

#5008488 iOS Game development on Windows- What are my options?

Posted by alnite on 08 December 2012 - 07:38 AM

iOS development is always done on a mac, not Windows. Apple never made their SDK available for Windows. I haven't used Macincloud, but I wouldn't suggest doing that. When you sign up to be an Apple Developer, you are required to sign your build before you can put that on a device or release it to the market. This key needs to be stored on your machine, and you would need to connect your iPhone to the actual physical machine before you can test your app. You can't do that over the cloud.


#5007200 [C++] - Multithreaded Bubble Sort

Posted by alnite on 04 December 2012 - 03:46 PM

Look up merge sort - it inherently merges two sorted lists together, you'll find how to do it there. The result is basically a simplified selection sort, taking advantage of the fact that the two lists are already sorted, which runs in O(n) time and uses a temporary array. You could extend this to an arbitrary number of lists, or you could do the merging in parallel too (which would be more useful, because doing the merge step on a single thread defeats your use of multithreading in the sorting step).

Is this for a school assignment, by the way? If not, you might be better served by trying to implement a multithreaded merge sort, which is more interesting and is actually useful.

I second this. Split array into two, spawn two threads and each handle its own segment. Recursively do this until you reach the smallest subset.

Merging the array shouldn't be too compliated either. Since each thread spawns two subthreads, you just wait until both threads finished executing, then merge, then flag its parent thread.


#5006081 Does anyone else struggle with problem solving?

Posted by alnite on 01 December 2012 - 01:53 PM

For example, the Tic Tac Toe game, I keep trying to do it the exact way that the other guy does it, and I get stuck, and constantly refer back to his code to see what I am doing wrong. Not to mention whenever I try doing it by myself, I constantly think about that persons code. So I can never try it myself.


If you can't think of a solution for a tic-tac-toe game, then maybe it's too much of a challenge for you. Step back, and start something much simpler, like a number guessing game, text-based adventure, dice rolls. I have no idea how many useless/random programs I have written back in my GW/QBASIC days: draw random lines, circles, rectangles, compound interest calculators, address books, fake shell, etc.

It's a good thing that you are doing this because you want to learn. Keep this attitude, and never stop writing code.


#5005533 Does anyone else struggle with problem solving?

Posted by alnite on 29 November 2012 - 07:53 PM

I find this a problem common among beginners. If I give you code, you can understand the process and what the code does. But if I tell you to write a brand new code from scratch, you are stuck right from the beginning. Did I run into this when I first started? I don't remember. But I see this all the time.

The era of the Internet today makes it easy to copy and download code snippets, which encourages lazy thinking. You see this all the time on blogs. People would comment "Code doesn't work! HELP! HOW DO I FIX!?!?". And this is coming from using a simple code how to convert a file to a string object, for example. I'm not pointing out that the code doesn't work, but I'm pointing out the sheer laziness in people that they expect things to fall on their lap and work. When things not operating the way they expected, they don't bother to find the solution themselves.

It only comes from experience, and it has to be the right experience. Always write code from scratch. It's okay to look at code from web, but only as a reference, not meant to be copied directly to your code. 90% of the time that code won't be compatible to your code anyway. Never, ever, copy-paste and use code you get from web, conferences, CDs, or anywhere else. It's okay to use prepackaged libraries (like STL, SDL, Ogre, 3rd party libraries), the ones that you don't have to look at their code to use it.

How can a writer be a writer, if all he does is copy someone else's work? Programming the same way.


#4999971 Switch vs if else

Posted by alnite on 11 November 2012 - 12:30 PM

While this might be language-dependent, you can't normally switch-case objects like strings. switch-case could only be used on integers, as it creates a jump/branch table. Additonally, in some languages, you are allowed to fall through a case statement.
switch (x) {
	 case 0:
	 	 doSomething();
	 case 1:
	 	 doSomethingElse();
	 	 break;
	 default:
	 	 doDefault();
	 	 break;
}

if x = 0, doSomething() and doSomethingElse() are executed. This style of coding could be useful in certain cases (no pun intended).


#4999095 Already know C++ - where to learn game programming?

Posted by alnite on 08 November 2012 - 07:30 PM

C++ by itself does not contain any library to access the video, input, and sound hardware, which is what you need for games. So in order to do that, you'd need to use a 3rd party API. SDL, SFML, as people mentioned are good candidates.

Once you familiarized yourself with the API, then you can start working on the core of the game. There isn't any 'de facto' Tetris tutorial, as there's no one correct way of making a Tetris (or anything else really). How you make it is up to you. Other people's source code should be good as points of reference. Here's one: http://code.google.c...e-tetris-clone/

As a beginner, I wouldn't suggest trying too much organizing your code. Your lack of experience will probably backfire -- chose the wrong patterns, premature optimizations, and all that. Do it as best as you can, but the most important thing is to actually complete your game. After you complete your game, your knowledge of project structure will skyrocket, and you'd know how to do it better next time.


#4999082 Industry's look on tattoos etc.

Posted by alnite on 08 November 2012 - 06:46 PM

I'm currently studying to become a games developer/programmer and have a tattoo sleeve but due to it being around an inch above my wrist I can easily cover it up (long sleeved shirt etc.) if need be. also was thinking of having a flesh tunnel in one of my ears (around 5mm - not like it matters) what are the views upon these things in the games industry (employment wise) anyone who has been in the industry and knows about the policy.
All answers are greatly appreciated
Thanks.


Depends on the company, but most game developers are pretty open-minded. As long as you don't flash gang tattoos and dress up in wife-beaters, you are fine.


#4996778 How powerful is Java?

Posted by alnite on 02 November 2012 - 11:46 PM

Over 9000


#4995503 Moving from Java to c++

Posted by alnite on 30 October 2012 - 12:16 PM

Hmmm. that actually sounds like a good idea, my main goal here is to learn everything thoroughly and properly from the beginning so I can be a good c++ programmer soon. I think forcing myself to do that will help me learn things that I'd usually just happily ignore and let my IDE do it for me. How important and how hard is learning all that? Anyone else think this is a good idea?


A command-line compiler is a great tool to learn. You will use it at some point in your career, and I'd recommend using that over an IDE at this point in time. IDE like VS can spout out error because of IDE config errors, not your code. This can confuse beginners a lot, thinking that their code is wrong while in fact, the IDE is messed up.

Also while I'm here, should I start with c++ 11? I know nothing about the different versions, is it backwards compatible? is it or will it be the standard soon? which version do you recommend I start with and why? The only concern I might have about that is that its new and might not be as well documented, I love have a wealth of resources when learning something new and complicated like c++.


I don't know much about C++ 11, but last time I tried to use it, the compilers have yet fully support all the features of C++ 11. You will get different results depending on which compiler/IDE you use (GNU, VS). I would suggest that you stay away from it for now. It's an extension of the language, not a whole redesign, so you won't miss a thing.

Anyone have any other general suggestions for learning resources or tips? I wanna learn this as thoroughly and as well as possible but I'm also eager to get my hands dirty with some real programming as soon as I can


I would focus on pointers, ctors, and dtors, as that's one of the main differences between Java and C++. When objects are allocated/deallocated in C++ is a whole different thing.


#4993991 Performance issues in simple program

Posted by alnite on 25 October 2012 - 07:15 PM

The main algorithmic improvement here is diving only by numbers up to the square root of the number.
...code snippet...


Nice. Here's my version:

int largestPrimeFactor = 2;
for (int i=2; i<=n; ++i) {
    while (n % i == 0) {
	    n/=i;
	    largestPrimeFactor = i;
    }
}



#4989221 Advice for managing two different codebases for one game using Git (browser a...

Posted by alnite on 11 October 2012 - 01:51 PM

Yes, this is a good example for preprocessors. What preprocessors do basically format your code before passing it on to the compiler. So essentially, you can add/remove certain parts of the source code depending on the flags of the preprocessors you have setup.

For example: you have this code:

doSomething();
#if IPHONE
doiPhoneStuff();
#elif WEB
doWebStuff();
#endif
doSomethingElse();

Before compiling for iPhone, you set IPHONE variable to true, and WEB to false, and thus the code after being preprocessed will look like this:

doSomething();
doiPhoneStuff();
doSomethingElse();



#4986618 Communicating with Programmers

Posted by alnite on 03 October 2012 - 07:16 PM

Well yes, English. Beyond that, your knowledge in technical aspects is the only ticket to loosen out that tension.

Most frustrating communications I ever encountered with artists, or graphics designers, or UI designers, is that they don't usually understand the enormous task necessary to implement their artwork. Adding just one layer in Photoshop could equal to 10K lines of code with rigorous testing depending on what you are asking for.

This is an example that I run into just recently.

UI Designer created an assets for some product. It is obvious in the spec he created that the locations of every single thing is hardcoded in pixels. 10 pixels between button A and B, 23 pixels between button C and D, font size 12, etc. That's not going to work when you create a product on which the environment can be of any resolutions -- yet somehow he didn't get this and continue to give specs in pixels.

You artists have the benefit of working on a constrained environment. Your canvas has fixed width and height. You can fine tune each pixel or voxels or polygons, and paint brush imperfections. Programmers work on open-ended environments, in which he has to abide to the principle of generality. One code fits all. The code has to run on every single hardware combination with every single resolution on every single machine out there. So, we tend to approach problems as a whole, and fix the whole thing in one shot.

This introduces something that we all programmers hate, special cases. Special cases like "Can we bold the letter R right in the middle of that text, and then have the letter Z flash red every 10 seconds, and have the whole thing spin around, and only to do this when the hero died from the backstab wound, but in every other case, the text must flash blue-green and spin on the z-axis, because I think that'd be cool?" will drive programmers nuts.

Unfortunately there's nothing you can do to understand us except putting yourself in our shoes (learn coding) and see it from our perspectives. I have had the most pleasant experience working with artists who also happen to have done coding themselves.


#4981845 how to unlearn a language

Posted by alnite on 19 September 2012 - 04:05 PM

You want to step away from tutorials at this point. You need reasons why writing clean code is better than messy code. At this point, your brain can't tell the difference, and likely won't make a change unless you are running into situations where clean code is preferable than messy code.

1. Read your own code from a few months back. If you can still read it and understand it, you are in the right direction.
2. Work on a small app or game, and try to make it bug free. It's the hardest thing, and that's where your messy code will hurt you the most.
3. Then try reuse that code you wrote. Are they reusable? Is it easy to reuse them, do you have to strip off a lot of dependencies for using just one small chunk?

Repeat this process infinitely, your code will get cleaner and better, and less buggy.


#4980227 Asynchronous I/O vs resource loading thread.

Posted by alnite on 14 September 2012 - 05:55 PM

Yeah, I was thinking mostly in the context of a Skyrim type of game with open world exploration.

Then it'd be best to use an I/O thread.

Otherwise, you'd see hiccups when you hit certain boundaries in the game. You can see that a lot in older games from the 80s.


#4979501 Threads and c++?

Posted by alnite on 12 September 2012 - 04:49 PM

Both responses where very very helpful. in fact i have experienced this problem with I/O when trying to load geometry. the process of loading geometry hangs up the entire program and the more complex the geometry the longer the wait. So from what i understand threading would allow me to load geometry on the side of my program with out halting the main thread? I am assuming it would still take time but it would not stop one from continuing interaction with the main program being run by the main thread?


Yes. Although it sounds very simple, you would need to design your multi-threaded app very carefully. You now have multiple lines of code running concurrently, which thread access which lines first cannot be controlled. This could introduce a slew of bugs that are hard to debug.

A good practice is to keep the code separated between threads. For example, I/O code only accessible by I/O threads.




PARTNERS