Jump to content

  • Log In with Google      Sign In   
  • Create Account


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

#5275182 Advice on troublesome partner in profit share setup

Posted by Nypyren on Yesterday, 04:10 PM

Hopefully you guys are using source control. If you demonstrate that the commit history has no commits made by this person, it might be a pretty good argument that no measurable work has been done by this person. IANAL, so I don't know if this has any legal weight behind it, though.

#5275162 Visual scripting vs Coding?

Posted by Nypyren on Yesterday, 01:23 PM

There are certain things we do in programming where having some quick way to define our own DSL inside our source code itself would be ideal (ideally in a manner cleaner than preprocessor macros or template metaprograming). Visual and Text both have their own strengths and weaknesses, but they're both just different representations of information that could be represented in lots of different ways.

If we could quickly and easily define our own optimal representations ourselves, I think that would give us the most convenience, flexibility, and power.

#5274523 messing up the functions from inherited classes from two different base classes

Posted by Nypyren on 05 February 2016 - 02:42 PM

I usually avoid offering advice when discussing globals, because it's much more effective for the person to discover just how bad it can get in their own codebase. It makes a bigger impression to see the problem first-hand than to trust people's warnings that you don't fully understand yet.

#5274355 Why are there no AAA games targeted towards the young adult audience?

Posted by Nypyren on 04 February 2016 - 05:24 PM

Perhaps all of the Young Adult Fiction writers have been so successful writing novels that none of them have bothered attempting to write for games.

#5274334 Who vs. whom

Posted by Nypyren on 04 February 2016 - 03:36 PM

There is "write whatever sounds normal even if it's a bit incorrect" English, and then there's "write exactly correct at all times as if an English professor with a personal grudge against you is grading your writing" English.

Using "whom" is like opting-in to that second category. If you are inconsistent with your proper/casual use of English, the English pedants will come out of the woodwork.

#5274310 When you realize how dumb a bug is...

Posted by Nypyren on 04 February 2016 - 01:49 PM

I just made the following mistake:

PlayerPrefs.GetString(key) ?? defaultValue;
Unity's PlayerPrefs.GetString returns "", not null, if the string does not exist yet. sleep.png

Why not use PlayerPrefs.GetString(key, defaultValue)?

defaultValue in this case was actually a property with a few side effects that I didn't want to call unless the string didn't exist yet.

#5274124 When you realize how dumb a bug is...

Posted by Nypyren on 03 February 2016 - 04:18 PM

I just made the following mistake:
PlayerPrefs.GetString(key) ?? defaultValue;
Unity's PlayerPrefs.GetString returns "", not null, if the string does not exist yet. sleep.png

#5273908 c# and multitasking or async functions

Posted by Nypyren on 02 February 2016 - 11:48 AM

If you use async and await, the "Task" or "Task<T>" types that are involved are what you use instead of "response ids".


The main things you'll want to know first:

- The Task.Run functions. https://msdn.microsoft.com/en-us/library/hh195051(v=vs.110).aspx
- How async/await work. https://msdn.microsoft.com/en-us/library/hh191443.aspx
- Dealing with multiple tasks at once. https://msdn.microsoft.com/en-us/library/jj155756.aspx
- What happens with exceptions. https://msdn.microsoft.com/en-us/library/dd997415(v=vs.110).aspx

#5273598 Rotation Problem

Posted by Nypyren on 31 January 2016 - 10:54 PM

Hmm. entityPosition represents the vehicle's position, right? I think, since your playerPosition is now in the vehicle's space, you don't need to subtract entityPosition anymore:

D3DXVECTOR3 forwardVector = playerPosition;

#5273554 Unity vs. a more "lean" game engine

Posted by Nypyren on 31 January 2016 - 07:03 PM

I've been game programming for over a decade and used Unity for three of those years. Unity is the least-of-all-evils that I've seen so far (and *everything* is evil). It's pretty good in almost every way, but there is always a little hassle hanging around every dark corner.

As far as your first impression goes, it just sounds like you're complaining because it's not doing things your way right away. But of course it isn't, because it wasn't written by you. Nothing complex lacks a learning curve, so we must constantly learn and get used to doing things in ways we think are "weird" at first. Unity is more flexible than it appears at first glance, but if you haven't bothered to try, you will never learn.

You have to start off with at least one Scene with one GameObject with one script on it, but after that you can programmatically set up everything else. Or you can build scenes right in the editor. Or mix approaches. It's up to you. You can put scripts on GameObjects like usual, and you can run a single MonoBehavior which calls into a huge pure-C# game which only uses Unity as a presentation layer, or you can go the "normal" approach of composing behavior directly with MonoBehaviors. The amount of flexibility is pretty crazy compared to other "engines" I've used which force you into one and only one way of doing things.

#5273393 Is "Invite friend to this server" possible using Facebook?

Posted by Nypyren on 30 January 2016 - 02:10 PM

Yeah, your flow sounds exactly like something we've done where I work (we didn't use the post metadata to join a server, we used it to track what ratio of players actually followed those links).

I didn't work on it, so I don't remember the details of which calls you need to make, but I remember it works just like that. Sorry! I just know that it should be possible.

I'll do a quick search of what sounds familiar.




(see the ?referral=12345 stuff; I think that's where you can place your server join information)

See the "Handling incoming links" sections of these pages:

#5273241 Warning conversion from size_t to int in x64

Posted by Nypyren on 29 January 2016 - 01:22 PM

I'm always confused why people find size_t being unsigned to be a problem. Why are you performing signed comparisons on array indices in the first place? There are very few valid use-cases thereof.

Someone calls List<T>.IndexOf(x), but x is not in the list. You're the IndexOf function. What do you return?

signed -> return -1.

unsigned -> return Length+1 (essentially vector::end or equivalent)? What if the length is UInt32.MaxValue? You don't want to return 0. You either need to limit lists to UInt32.MaxValue-1 in length so that you can use MaxValue (i.e. (uint)-1) as the invalid position, or have two return values - Index and IsValid.

iterator (or some other custom type) -> collection_type::end, or a (index, isvalid) tuple, but this means your API now burdens people with understanding the mechanics of iterators or unpacking return values from complex types.

In my opinion, the API simplicity of signed values outweighs the loss of array sizes over 2 billion elements long. If you want collections larger than that, you can still make a custom type using ulong indices and complex IndexOf return values when you need it.

#5273094 Rotation Problem

Posted by Nypyren on 28 January 2016 - 07:45 PM

Since your gun orientation is relative to the vehicle, you need to make it compute its orientation based on the player's position from the vehicle's perspective.

Multiply playerPosition by the inverse of VehicleWorldMatrix before calculating forwardVector.

#5273090 What Looks Better? A Successful Game Or One Written From Scratch?

Posted by Nypyren on 28 January 2016 - 07:23 PM

Are we talking about applying for college (just plain education? scholarship? as a professor?), or something else?

When I applied to colleges, they only cared about what my education record was and whether I could pay tuition. I didn't tell them about any of my hobby projects.

A lot of the people I met in college had never programmed before that moment.

#5272883 Why didn't somebody tell me?

Posted by Nypyren on 27 January 2016 - 03:23 PM

Some of it .. I swear is confused just to be confusing...
Taps that serve potable water, are Faucets in the North, Spigots and the South, but those that provide water not fit for drinking are called Spigots in the North and Taps in the South.

I'm from the Pacific Northwest and I've exclusively heard "Faucet" regardless of potability or indoor/outdoor use. (Spell checker doesn't think potability is a word, but it totally is.)

"Faucet" on my kitchen sink.
"Faucet" outside that I hook my sprinklers to.
"Faucet" connected to a well.

"Tap" on a beer keg.

"Spigot" ... not used around here, but I'd think "Faucet" if someone actually said it.

We also use:

Drinking Fountain = Faucet that emits water upwards a few inches that lets you drink directly from the stream (or fill a bottle). Usually includes a basin to catch the water that you don't drink/bottle.

Fire Hydrant = 'Serious business' water supplies placed along the sides of roads that fire-fighting vehicles can connect to for high-volume, high-velocity water near the scene of a fire.