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!


Nypyren

Member Since 19 Aug 2002
Offline Last Active Yesterday, 09:08 PM

#5230503 Game Programming from 0 or using already made game engine?

Posted by Nypyren on Yesterday, 05:10 PM

First off, your English is excellent.

Deciding between an existing engine and writing your own depends on your needs:

If you are most interested in learning how to write a game without using an engine, you should do that.

If you want to focus your efforts towards finishing the game as quickly as possible, an engine is probably the better choice.

If you don't want to spend money on an engine, but have plenty of free time, then maybe writing your own engine is the better choice.

If you have an idea for a game that none of the popular engines are suited for, then you'll have to write your own.


There are hybrid approaches as well:

Some teams have used Flash to prototype games, and then write the game again from scratch once they know the game is worth the additional effort.

You can use Unity to see what it supports, get a feeling for how to put together a game, decide what parts of Unity you like and what you don't, and then make another game from scratch using what you learned without using Unity.


There isn't a "best" solution - game development has too many different choices that each person (or team) can make -- more than what could be fulfilled by one engine or system.


#5230323 Free to wait games, how can the wait or pay mechanic be used.

Posted by Nypyren on 21 May 2015 - 06:22 PM

DenshaDeD_ch01p16-17.png




#5230310 Oauth 2.0 and Unity

Posted by Nypyren on 21 May 2015 - 03:58 PM

There may be an OAuth flow to login by entering your credentials in your own app and then use nothing but REST requests to the authentication server. That would be ideal. I've never seen such a flow yet though...

I would be surprised if EVERYONE where I work didn't know about such a flow, because it would simplify our apps tremendously.


#5230292 Oauth 2.0 and Unity

Posted by Nypyren on 21 May 2015 - 01:25 PM

Oops, sorry, I was thinking of standalone windows forms apps and Metro apps when I said that, not Windows desktop apps that use Unity. To take complete control over the web browser widget, you have to be a Windows app that has access to one of the programmatically controllable web widgets. Unity doesn't include one of those as far as I know.


With a Unity app, I've never done "real" OAuth authentication on a PC. The hack we use when running our game in the Unity editor is to start an HttpListener locally, use Application.OpenURL to launch a browser window with the OAuth login URL, and have the redirect_uri go to localhost on whatever port you're listening on. The HttpListener then catches the response. This would probably not be an acceptable solution to ship in your game, though.


#5230277 Oauth 2.0 and Unity

Posted by Nypyren on 21 May 2015 - 11:23 AM

Hmm, well it didn't work on the droid build either so gonna look into it. Saw a page about the WWW class in unity which apparently opens the page IN the unity app as opposed to the Application.openurl I guess? Gotta fiddle more I guess


WWW lets you make web requests. For example, you can use it to access a web service or download an AssetBundle containing DLC for your game. It doesn't have a web browser user interface.


#5230186 How do they get games to open themselves?

Posted by Nypyren on 20 May 2015 - 10:28 PM

The game doesn't necessarily need to terminate if its main window is closed. I've had a lot of accidents where I didn't properly shut down my program and it continued to run in the background.

You could use this approach intentionally to "relaunch" the game by re-initializing your game after a period of time.

 
If you take this approach be sure to release any memory you no longer need and put your process to sleep. You wouldn't want your game to be eating up system resources in the background.


You'll likely need to do this anyway to properly reinitialize your game. Anyone relying on the process being terminated to free up resources for them is gonna have a bad time!


#5230157 How do they get games to open themselves?

Posted by Nypyren on 20 May 2015 - 06:23 PM

The game doesn't necessarily need to terminate if its main window is closed. I've had a lot of accidents where I didn't properly shut down my program and it continued to run in the background.

You could use this approach intentionally to "relaunch" the game by re-initializing your game after a period of time.


#5230146 Too clever...?

Posted by Nypyren on 20 May 2015 - 05:51 PM

Looks fine to me. In some other languages (like C# which I use most of the time) another common practice is to throw ArgumentException in those three cases.


#5229890 Oauth 2.0 and Unity

Posted by Nypyren on 19 May 2015 - 12:57 PM

I haven't tried Fitbit, but I've done Facebook and Twitter authentication on mobile devices. You register a special URI scheme for your app, and use a URI with that scheme for the redirect_uri you pass to Facebook/Twitter. Once you login via the web interface, they redirect to the URI you provide. Your app then handles the URI scheme and receives the authentication token, which you use however you need to.

Facebook and Twitter have specific restrictions on what redirect_uri you have to use (to prevent malicious entities from redirecting to their own services/apps), so perhaps Fitbit does as well.


#5229372 Multiplayer to an existing game?

Posted by Nypyren on 16 May 2015 - 05:03 PM

You need several years of experience programming in C, C++, and assembly language.

You also need lots of experience with:

- Reverse engineering
- Game programming
- Network programming
- A tremendous amount of patience and motivation


It's not easy, or fun, but it's possible.


#5227638 (7+9)**(1/2): Why isn't this returning 4?

Posted by Nypyren on 06 May 2015 - 08:28 PM

So Python 2 follows most programming languages in that arithmetic operations on two integers give an integer result. So 1/2 is 0, and anything raised to a 0 power is 1. Python 3 came along can said that most people find that 1/2 being 0 is unnatural so will let integer arithmetic yield floating point results, so 1/2 is 0.5.


That's one HELL of a breaking change... does that only hold true for literals, or does it do that for variables as well?


#5227620 (7+9)**(1/2): Why isn't this returning 4?

Posted by Nypyren on 06 May 2015 - 07:12 PM

Does python evaluate (1/2) as zero like most other languages?


#5227542 Small C++11 regex question

Posted by Nypyren on 06 May 2015 - 11:25 AM

I'm not familiar with C++'s regexes, but I've used C# and bash regexes and it looks similar.

Looks like it's matching a time string in the form "##:##:##".

\d is usually the same as [0-9]. "digit". I'm not sure if it needs to be in brackets in C++ or if that's redundant.

{2} means "require the pattern to the left to match twice"

: isn't a special character, so it just matches colon characters.


#5227385 C# class library and external functions

Posted by Nypyren on 05 May 2015 - 03:13 PM

A C# user would expect a vector subtraction function to look more like one of these:
 
public struct Vector3
{
   public float X, Y, Z;

   // constructor(s) omitted since they are trivial

    public static Vector3 Subtract(Vector3 a, Vector3 b)
    {
       return new Vector3(a.X - b.X, a.Y - b.Y, a.Z - b.Z);
    }

    public static void Subtract(out Vector3 a, Vector3 b, Vector3 c)
    {
       // Might not compile without some tweaks; I forget the exact struct-out requirements.
       a.X = b.X - c.X;
       a.Y = b.Y - c.Y;
       a.Z = b.Z - c.Z;
    }
}



#5227182 ISO quick max distance check

Posted by Nypyren on 04 May 2015 - 11:51 AM

Also, instead of flagging the player as a cheater, you can enforce the speed limit. This would prevent other players from seeing the cheater moving unacceptably fast.
 
float maxDifference = SPEED_LIMIT_PER_SECOND_CONSTANT * timeSinceLastUpdateInSeconds;
Vector3 diff = newPos - oldPos;
if (LengthSquared(diff) > maxDifference * maxDifference)
{
   newPos = oldPos + Normalize(diff) * maxDifference;
   // send forced position update back to the client with newPos - this is sometimes called "rubber-banding"
}





PARTNERS