Saturday, February 22, 2020

Simple past, Present perfect Past perfect


Can you tell me which form of the following sentences is the correct one please?


Imagine two friends discussing the gym...



I was in a good shape before



I assume that it's not correct because simple past is used for a finished action in the past, at a specific time. And being in a good shape it's not an action..




I have been in a good shape before



This sounds ok to me, because it's "change over time".



I had been in a good shape before (I broke my leg)



If it would have had a simple past at the end I believe this would have been the correct form.


I think this is what the theory says, but I've seen for many times people using past perfect without specifying a simple past and I don't understand whether it is correct or not.




word choice - I'm born or I was born, which one to use


Should I say I'm born in or I was born in?



Can I say I'm born in Paris in 1900, or should I say I was born in Paris in 1990?



Answer



"I was born in Paris in 1990" is the correct statement to use.


"I'm" is a condensed form of "I am" which is present tense, as you are talking about a past event "I was" is used.


xbox360 - XNA: How does threading work?



I would like to implement threading in my XNA game but I'm not sure how things work when compiling for the XBOX 360. Could someone elaborate on this?


For example, how many threads does XBOX support? I realize that XNA uses a special version of the Compact Framework. How does this affect the code during development? Do I implement things differently when developing for XBOX than Windows?


Thank you.




terminology - What is data-driven design?



I've been reading up on a lot of articles covering data driven design for games. It seems to come down to:




  • No hard coding

  • No game-specific code in the engine

  • Scripting for AI, cutscenes, et cetera.

  • Generalizing code for reusability

  • Component design

  • Modularity

  • Low coupling

  • Editors (for data, maps, scripts)

  • External data retrieval


  • Constants kept in text files (.ini or otherwise)

  • Expose data through editors for scripting and manipulation by designers


Now, my question is, is this understanding correct?



Answer



I'd say this is not correct. I believe the most important idea in data driven design is separating your data from what modifies (or updates) the data.


So going from a standard OO deep hierarchy like this:


class MyCreature{
vector position;
void update(){ position += 1; }

}

to a separate state and system


class CreatureState{
vector postion;
}

class MovementSystem{
list states;
void update() {

for each CreatureState state in states {
state.position += 1;
}
}

On of the most influential DDD paradigms at this moment are Entity Systems. Some nice resources to look up are:


http://gamedevrubberduck.wordpress.com/2012/12/26/a-hybrid-entity-system-component-architecture/


http://entity-systems.wikidot.com/


Of course as with all paradigms/ideas there isn't an exact definition and not everybody understands the same idea when talking DDD but this is what I believe the most important thing.


procedural generation - How to devise an algorithm for a person being on a walk?



The game is an isometric RPG. The map is tile based.


I'm creating a town for this game. And I want one of the characters to roam the town randomly, because she is on a walk with her children.


I tagged the tiles she can go on. And I created a simplistic algorithm that I, in my naiveness, thought would be enough. Here it is:


If the character is blocked out and can't move in any direction she waits 1s before checking this again. If she can move in only one of the 4 directions, she moves that direction. If there is more than one possibility: If she can go forward, she always has 50% chance of going forward; if she can go both to her left and to her right there is an equal chance she chooses either of those two directions; and finally, if she can turn back, that chance is 2x smaller than turning to her left and 2x smaller than turning to her right. So, if she can choose from all 4 directions, she will have 50% chance to go forward, 20% chance to go to her left, 20% chance to go to her right, and 10% chance to go back. Repeat the above every step.


This algorithm fails beautifully. The character mostly moves randomly in one place. If she gets on a square she almost can't leave it.


I thought the solution would be to increase the chance of her moving forward. So I made the chance to go forward 5 times bigger than doing anything else. But this proved to hardly improve things.


COuld you give me some hints, point me to the correct direction? Or at least tell me that this is not worth it and I should instead resort to giving her a predefined path? (Are there no algorithms to make a character roam a given set of walkable tiles?)




meaning - right hand to God - what does this mean?


From the science fiction movie Dreamcatcher (2003):



— Nine miles to Hole in the Wall.

— I think I can manage it.
— I'll bring the snowmobile back and get you both. Now, Pete, you listen to me. Don't go back to the car for beer. Stay with her. Keep her warm.
Right hand to God, Dr. D.



What exactly does this expression mean?



Answer



"I swear/promise."


It's common practice in the US to place one's hand on a Bible and/or raise one's right hand when making an oath, such as being sworn into office (like the president) or when testifying in court.


You may also hear "God as my witness" or "May God smite me."


Friday, February 21, 2020

game design - Factors to consider when building an algorithm for gun recoil


What would be a good algorithm for calculating the recoil of a shooting guns cross-hairs?


What I've got now, is something like this:



  1. Define min/max recoil based on weapon size

  2. Generate random number of "delta" movement

  3. Apply random value to X, Y, or both of cross-hairs (only "up" on the Y axis)

  4. Multiply new delta based on time from the previous shot (more recoil for full-auto)


What I'm worried about is that this feels rather predicable, what other factors should one take into account when building recoil? While I'd like it to be somewhat predictable, I'd also like to keep players on their toes. I'm thinking about increasing the min/max recoil values by a large amount (relatively) and adding a weighting, so large recoils will be more rare -- it seems like a lot of effort to go into something I felt would be simple.



Maybe this is just something that needs to be fine-tuned with additional playtesting, and more playtesters? I think that it's important to note, that the recoil will be a large part of the game, and is a key factor in the game being fun/challenging or not.



Answer



Guns tend to recoil vertically far more than they recoil to the left or right (at least the few I've fired -- pistols and a shotgun -- have done so to the best of my recollection). I have a feeling the random variance in X would just feel unusual.


I would start with an implementation that kicks the gun/view upwards only, probably based on the power of the gun. When fired, a cooldown timer starts. If the gun is fired again while the cooldown timer is still counting down, the vertical kick is applied again, with intensity proportional to how much time is left on the timer. After a certain threshold it might be appropriate to add X axis variance to indicate that the player is really losing control of the (probably automatic) weapon. I've never fired such a thing so I don't know what that is supposed to feel like, but I imagine "chaotic" would fit nicely. The cooldown should probably scale a bit -- but nonlinearly -- as you continue to fire and the intensity of the kicks should probably be similarly damped or smoothed. Pure linear measures might feel too harsh.


Whatever you do, it sounds like your initial plans called for a fair bit of randomization and I don't think that would be appropriate -- a small bit, certainly, but sudden large recoils amidst smaller ones seem like they'd be unusual.


Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...