Friday, September 30, 2016

xna - 2D platformer corner collision


Repost from my question on stack overflow, didnt know this site existed.


I have a 2d platformer and I need help with collision. To show you my current collision system, here is picture: http://i.imgur.com/romKF.png


Top picture is how game looks normally, bottom picture shows highlighted collision rectangles. Black ones are horizontal (If player rectangle intersects them, move player on Y axis), blue are vertical (move player on the X axis) and red are corners.


I've implemented corner rectangles, after bit of testing after I found out, that when I had black and blue overlapping each other, this happened: Player jumped and intersected both rectangles at once, game would recognize that and resolve both intersection at the same time, cause the player to spaz around the map and ending up in a another rectangle, which would then cause another intesection and resolution until the chain reaction stopped, and player would end up somewhere where he should not have been.


So I added corner rectangles, they should resolve this situation like this: if player hits corner from the bottom, act like horizotal rectangle, if he hits from side, act like vertical.


Thing is, I have no idea how to make them work like that.


Here is my code so far:


        if (InputHandler.KeyDown(Keys.W))
{

player.MoveUp();
Parallel.For(0, horizontalPlayerCollisionRectangles.Count, i =>
{
if (player.PlayerRectangleInWorld.Intersects(horizontalPlayerCollisionRectangles[i]))
{
player.PlayerPositionY = horizontalPlayerCollisionRectangles[i].Y + horizontalPlayerCollisionRectangles[i].Height;
}
});
}


if (InputHandler.KeyDown(Keys.D))
{
player.MoveRight();
Parallel.For(0, verticalPlayerCollisionRectangles.Count, i =>
{
if (player.PlayerRectangleInWorld.Intersects(verticalPlayerCollisionRectangles[i]))
{
player.PlayerPositionX = verticalPlayerCollisionRectangles[i].X - player.PlayerRectangleInWorld.Width;
}
});

}

if (InputHandler.KeyDown(Keys.A))
{
player.MoveLeft();
Parallel.For(0, verticalPlayerCollisionRectangles.Count, i =>
{
if (player.PlayerRectangleInWorld.Intersects(verticalPlayerCollisionRectangles[i]))
{
player.PlayerPositionX = verticalPlayerCollisionRectangles[i].X + verticalPlayerCollisionRectangles[i].Width;

}
});
}

if (player.Gravity)
{
Parallel.For(0, horizontalPlayerCollisionRectangles.Count, i =>
{
if (player.PlayerRectangleInWorld.Intersects(horizontalPlayerCollisionRectangles[i]))
{

player.PlayerPositionY = horizontalPlayerCollisionRectangles[i].Y - player.PlayerRectangleInWorld.Height;
}
});
}

Its pretty simple. Now that I think about it, my system is flawed, so thats why I'm asking this question. How to make collision work using collision rectangles?


P.S. I can't use any physics engine like Farseer, it's a school graduation project and I have to code as much as possible by myself.




nouns - Is "mathematics" singular or plural?


I always say "mathematics is funny" (ok, maybe many of you disagree about the adjective), but then I noticed that "mathematics" seems to be a plural, like the Greek word from which it derives.


Am I correct in using the verb in singular form?
And are there other words like this one?



Answer



Whilst a dictionary search shows that the word is singular but plural in form, it is most commonly used (in my experience) with a verb in singular form.



Math(ematic)s is my least favourite subject.



Math(ematic)s is really hard.



This Ngram viewer helps: enter image description here


Link to Ngram


EDIT: As @Araucaria points out, the "mathematics are" examples in the Ngram above are not really relevant. See his comment below.


Thursday, September 29, 2016

models - Do I need to obtain a license to use real car brands in a game?



We are small team which working on car racing game but we don't know about licensing process for branded cars like Nissan, Lamborghini, Chevrolet and etc.


Do we need to buy any licence for using real car brand names, models, logos,... or we can use them for free?


Second option we think about using not real brand with real models is it possible? If someone have experience with that, fell free to share it. Any information about that is welcome.



Answer



Yes. Their names, logos, and body designs are all trademarked and cannot be used in any capacity outside those explicitly allowed by trademark law, which almost certainly excluded use in your game. And expect to be completely incapable of acquiring those licenses for reasonable terms, as the licenses are generally very expensive and come with a mile long list of stipulations.


Even though you will be paying them, the companies will be seeing your game as another advertisement for their cars. They will completely reject working with you unless they believe your game will make their cars look awesome and make your players want to buy them.


There was a "car czar" for the Forza 4 team. His full time job was to make sure their car models and car performance matched the various licensing agreements they had, to make sure the cars were modeled accurately, and so on. You need a full time guy just to do that if you want to license cars.


And expect weird incompatible licensing terms to happen and look forward to wasting tons of time resolving them. E.g., two manufacturers who want their car to be the fastest car in your game, or who refuse to allow one player selectable color to be applies to their car, or to refuse to allow damage to apply to their car, or to demand that the car can only be used if you model every little mechanical detail to a level of accuracy that your artists or your engine possibly can't handle.



As with all things in the small game and indie space, you are far better off being original and unique.


Also remember that if you try to make games that have the same selling points as AAA titles (like having real cars like Forza does), your game is going to get compared to those games, and is highly unlikely to come out with high marks. Strive to be unique so your game can stand in its own rather than be compared to games with tens of millions of dollars put into them.


graphics - Java single Array best choice for accessing pixels for manipulation?


I am just watching this tutorial https://www.youtube.com/watch?v=HwUnMy_pR6A and the guy (who seems to be pretty competent) is using a single array to store and access the pixels of his to-be-rendered image.


I was wondering if this really is the best way to do this. The alternative of Multi-Array does have one pointer more, but Arrays do have an O(1) for accessing each index and calculating the index in a single array seems to take one addition and one multiplication operation per pixel.


And if Multi-Arrays really are bad, can't you use something with Hashing to avoid those addition and multiplication operations?


EDIT: here is his code...


public class Screen {

private int width, height;
public int[] pixels;

public Screen(int width, int height) {
this.width = width;
this.height = height;

// creating array the size of one index/int for every pixel
// single array has better performance than multi-array
pixels = new int[width * height];

}

public void render() {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
pixels[x + y * width] = 0xff00ff;
}
}
}
}


Answer



Talking about the "best choice" is always difficult, as long as you did not specify the task that you intend to perform in all detail.


But here are several aspects to consider. First of all: Java is not C. The memory management is completely different, so one has to be very careful when trying to apply insights from one programming environment to another.


For example, your statement:



The alternative of Multi-Array does have one pointer more, but Arrays do have an O(1) for accessing each index and calculating the index in a single array seems to take one addition and one multiplication operation per pixel.



As already pointed out in one of the linked answers: A "2D array" in C is mainly a syntactical convenience for addressing a single (1D) memory block. So when you write something like


array[y][x] = 123; // y comes first because y corresponds to rows and x to columns


in C, then this might actually be eqivalent to


array[x+columns*y] = 123;

So the argument of saving a multiplication is at least questionable here. A special case here is when you actually have an array of pointers, where each row is allocated manually with malloc. Then, the addressing scheme is different (and in fact, this may be considered as being closer to what Java does).


Additionally, Java is a language with a Just-In-Time-compiler, which makes comparisons at the level of single instructions (like multiplications) very difficult. You hardly ever know what the JIT does with your code. But in any case, you can assume that it will make it faster, and use the nastiest tricks that you can (not) imagine to do so.




Concerning the general strategy to use a 1D array for pixels, there is one reason to do this in Java (and from quickly skimming over the linked video, this reason seems to apply here) : A 1D array can conveniently be transferred into a BufferedImage.


This is one reason from a pure "convenience" point of view. But when talking about performance, there are other aspects that are far more important than a few multiplications. The first ones that come to my mind are



  • Cache effects


  • Implementation details


Two examples showing how they may affect performance:


Cache effects


For the first one, you might consider the following example: It demonstrates the significant difference in performance between accessing pixels with


for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
pixels[x + y * width] = ...
}
}


and with


for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
pixels[x + y * width] = ...
}
}

Summarized in a small test program:


public class PixelTestButNoBenchmark

{
public static void main(String[] args)
{
long before = 0;
long after = 0;
double readTime = 0;
double writeTime = 0;

for (int size = 1000; size<=10000; size+=1000)
{

Screen s0 = new Screen(size, size);

before = System.nanoTime();
s0.writeRowMajor(size);
after = System.nanoTime();
writeTime = (after-before)/1e6;

before = System.nanoTime();
int r0 = s0.readRowMajor();
after = System.nanoTime();

readTime = (after-before)/1e6;

System.out.printf(
"Size %6d Row major " +
"write: %8.2f " +
"read: %8.2f " +
"result %d\n", size, writeTime, readTime, r0);

Screen s1 = new Screen(size, size);


before = System.nanoTime();
s1.writeColumnMajor(size);
after = System.nanoTime();
writeTime = (after-before)/1e6;

before = System.nanoTime();
int r1 = s1.readColumnMajor();
after = System.nanoTime();
readTime = (after-before)/1e6;


System.out.printf(
"Size %6d Column major " +
"write: %8.2f " +
"read: %8.2f " +
"result %d\n", size, writeTime, readTime, r1);

}
}
}


class Screen
{
private int width, height;
public int[] pixels;

public Screen(int width, int height)
{
this.width = width;
this.height = height;
pixels = new int[width * height];

}

public void writeRowMajor(int value)
{
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
pixels[x + y * width] = value;
}

}
}

public void writeColumnMajor(int value)
{
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
pixels[x + y * width] = value;

}
}
}

public int readRowMajor()
{
int result = 0;
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)

{
result += pixels[x + y * width];
}
}
return result;
}

public int readColumnMajor()
{
int result = 0;

for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
result += pixels[x + y * width];
}
}
return result;
}
}


The details will vary, and heavily depend on the target system (and its cache size), so this is NOT a "benchmark", but shows that there may be a large difference. On my system, an order of magnitude, eg.


Size   7000 Row    major write:    46,73 read:    28,09 result -597383680
Size 7000 Column major write: 528,46 read: 500,53 result -597383680

The second influence may be even more tricky:


Implementation details


The Java BufferedImage class is very convenient, and operations using this class can be blazingly fast.


The first condition for this is that the type of the image must be "appropriate" for the target system. In particular, I have never encountered a system where the BuferedImage types that are backed by int[] arrays have not been the fastest. That means that you should always make sure to use images of the type TYPE_INT_ARGB or TYPE_INT_RGB.


The second condition is more subtle. The engineers at Sun/Oracle employed some nasty tricks to make painting of BufferedImages as fast as possible. One of these optimizations is that they detect whether the image can be held in VRAM completely, or whether they have to sync the image with the contents of an array that resides in the Java world. An image that can be held in VRAM is called a "managed" image. And there are some operations that destroy the "managedness" of an image. One of these operations is obtaining the DataBuffer from the Raster of the image.



Again, a program where I tried to demonstrate the effect. It creates two BufferedImage instances. On one of them, it obtains the DataBuffer, and on the other one, it doesn't. Note that this is also NOT a "benchmark", and should be taken with a huge grain of salt. But it shows that obtaining the DataBuffer from an image can significantly reduce painting performance.


import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.DataBufferInt;
import java.beans.Transient;
import java.util.Random;


import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;


public class ImagePaintingTestButNoBenchmark
{
public static void main(String[] args)

{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
createAndShowGUI();
}
});
}


private static void createAndShowGUI()
{
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

int size = 1200;
BufferedImage managedBufferedImage = createImage(size);
BufferedImage unmanagedBufferedImage = createImage(size);
makeUnmanaged(unmanagedBufferedImage);


final ImagePaintingPanel p = new ImagePaintingPanel(
managedBufferedImage, unmanagedBufferedImage);
f.add(p);

startRepaintingThread(p);

f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);

}

private static void startRepaintingThread(final JComponent c)
{
Thread t = new Thread(new Runnable()
{
@Override
public void run()
{
while (true)

{
c.repaint();
try
{
Thread.sleep(50);
}
catch (InterruptedException e)
{
Thread.currentThread().interrupt();
}

}
}
});
t.setDaemon(true);
t.start();
}

private static BufferedImage createImage(int size)
{
BufferedImage bufferedImage =

new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = bufferedImage.createGraphics();
Random r = new Random(0);
for (int i=0; i {
int x = r.nextInt(size);
int y = r.nextInt(size);
int w = r.nextInt(size);
int h = r.nextInt(size);
int c0 = r.nextInt(256);

int c1 = r.nextInt(256);
int c2 = r.nextInt(256);
g.setColor(new Color(c0,c1,c2));
g.fillRect(x, y, w, h);
}
g.dispose();
return bufferedImage;
}

private static void makeUnmanaged(BufferedImage bufferedImage)

{
DataBuffer dataBuffer = bufferedImage.getRaster().getDataBuffer();
DataBufferInt dataBufferInt = (DataBufferInt)dataBuffer;
int data[] = dataBufferInt.getData();
System.out.println("Unmanaged "+data[0]);
}

}



class ImagePaintingPanel extends JPanel
{
private final BufferedImage managedBufferedImage;
private final BufferedImage unmanagedBufferedImage;

ImagePaintingPanel(
BufferedImage managedBufferedImage,
BufferedImage unmanagedBufferedImage)
{
this.managedBufferedImage = managedBufferedImage;

this.unmanagedBufferedImage = unmanagedBufferedImage;
}

@Override
@Transient
public Dimension getPreferredSize()
{
return new Dimension(
managedBufferedImage.getWidth()+
unmanagedBufferedImage.getWidth(),

Math.max(
managedBufferedImage.getHeight(),
unmanagedBufferedImage.getHeight()));
}

@Override
protected void paintComponent(Graphics g)
{
super.paintComponent(g);


long before = 0;
long after = 0;

before = System.nanoTime();
g.drawImage(managedBufferedImage, 0, 0, null);
after = System.nanoTime();
double managedDuration = (after-before)/1e6;

before = System.nanoTime();
g.drawImage(unmanagedBufferedImage,

managedBufferedImage.getWidth(), 0, null);
after = System.nanoTime();
double unmanagedDuration = (after-before)/1e6;

System.out.printf("Managed %10.5fms\n", managedDuration);
System.out.printf("Unanaged %10.5fms\n", unmanagedDuration);
}

}


The actual impacts will here probably be even more dependent on the hardware (and the VM version!), but on my system, it prints


Managed      0,05151ms
Unanaged 6,27663ms

which means that obtaining the DataBuffer from a BufferedImage may slow down the painting by a factor of more than 100.


(An aside: In order to avoid this slowdown, one can use the setRGB method, like in


image.setRGB(0, 0, w, h, pixels, 0, w);

but of course, this involves some copying. So in the end, there is a trade-off between the speed of manipulating the pixels and the speed of painting the image)


physics - How do I convert matrices intended for OpenGL to be compatible for DirectX?


I have finished working through the book "Game Physics Engine Development 2nd Ed" by Millington, and have got it working, but I want to adapt it to work with DirectX.


I understand that D3D9+ has the option to use either left handed, or right handed convention, but I am unsure about how to return my matrices to be usable by D3D. The source code gives returning OpenGL column major matrices (the transpose of the working transform matrix shown below), but DirectX is row major.


For those unfamiliar for the organization of the matrices used in the book:


[r11 r12 r13 t1]
[r21 r22 r23 t2]
[r31 r32 r33 t3]

[ 0 0 0 1]

r## meaning the value of that element in the rotation matrix, and t# meaning the translation value.


So the question in short is: How do I convert the matrix above to be easily usable by D3D? All of the documentation that I have found simply states that D3D is row major, but not where to put what elements so that it is usable by D3D in terms of rotation, and translation elements.



Answer



First, a point of clarification: row-major means something different than row vector. OpenGL uses column vectors, which abstractly means that you consider a vector as a 4x1 matrix, and transform a vector v by a matrix M with v' = M · v. DirectX uses row vectors, which means that you consider a vector as a 1x4 matrix, and transform a vector w by a matrix N with w' = w · N. Notice that the two vectors are simply the transpose of each other: if you have an OpenGL vector v, then the DirectX vector is vT. And thanks to the linear algebra rule (A · B)T = BT · AT, you can see that the DirectX transformed vector (v')T = (M · v)T = vT · MT. That is, the DirectX matrix is simply the transpose of the OpenGL matrix.


And unrelated: OpenGL expects column-major storage, which means that the in-memory representation of a matrix keeps columns contiguous. So your example matrix would be stored as {r11, r21, r31, 0, r12, r22, r32, 0, r13, r23, r33, 0, t1, t2, t3, 1}. DirectX expects row-major storage, which means that the in-memory representation of a matrix keeps rows contiguous. So your example matrix would be stored as {r11, r12, r13, t1, r21, r22, r23, t2, r31, r32, r33, t3, 0, 0, 0, 1}. (Incidentally, in C and C++ two-dimensional arrays use row-major storage.)


And the fun part: it's easy to conflate these because they have "similar" effects. That is, if you take a matrix that's intended to be used with column vectors, and store it in column-major format, you get exactly the same thing as the transpose of that matrix (i.e. a matrix that represents the same transformation, but on row vectors) stored in row-major format. In a sense, the two operations cancel each other out. So OpenGL matrices and DirectX matrices look the same in raw memory. (And, of course, both of these are different than right-handedness vs left-handedness).


To summarize: If you're working in DirectX and looking at references that present OpenGL matrices, just transpose them to get matrices that you can use with DirectX.


grammar - "They live in their own house" or "they live in a house of their own"?



Is it correct if I say "They live in their own house?" or is "They live in a house of their own" the only correct variant in this case?(I mean grammar) And will the correctness remain the same if I change" live" into "have"?(They have a house of their own/ They have their own house).




sentence construction - "Where will you go" vs. "Where you will go"


Which sentence is correct between these?






  1. Where will you go?






  2. Where you will go?







Wednesday, September 28, 2016

grammaticality - A question about using the "v-ing" verbs


To native speakers, normally do you use adverbs to modify these v-ing worlds especially when they are the objects of the verbs?


Like:




I regret swimming hurriedly



Not



I regret hurried swimming.



Right? And what about these two sentences:



I regret stamp-collecting




or



I regret collecting stamps



Besides, when using these words, it still retains the verbal characteristics right? Like:



The house needs a careful cleaning.



has the same meaning with




The house needs carefully cleaning.



or



The house needs to be cleaned carefully.



(SOMETHING like passive voice)




sentence construction - "Have you ever seen anyone walk (walking) the streets like that?"



Have you ever seen anyone walk the streets like that?


Have you ever seen anyone walking the streets like that?




Are both the above sentences grammatically correct? Do they mean the same?



I saw him kiss her the other day.


I saw him kissing her the other day.



Are both the above sentences grammatically correct? Do they mean the same?


And I'm sorry, if the latter two sentences come off immature .-. I couldn't come up with better sentences.




Starting programming in 3D with C++




EDIT: There aren't sufficient enough tutorials for what I'm trying to do in Python, so I'm going to take my time and slowly build up my skills in C++. It's hard to trip and not land in a book of C++ tutorials on game development and 3D programming.


Once I get passed the basic syntax for classes in multiple files with preprocessor declarations, what is the next step in 3D?


Do I use DirectX or OpenGL? If I use DirectX, are there sufficient enough books on the subject for a BEGINNER? Same question for OpenGL. I love programming books, I just feel that most of them are way below par - they either have good general explanations and terrible source code, or vice versa.


Thanks for your time. I'll do my best to turn this into an active discussion on the matter.




Tuesday, September 27, 2016

opengl - What method replaces GL_SELECT for box selection?


Last 2 weeks I started working on a box selection that selects shapes using GL_SELECT and I just got it working finally.


When looking up resources online, there is a significant number of posts that say GL_SELECT is deprecated in OpenGL 3.0, but there is no mention of what had replace that function.


I learnt OpenGL 1.2 in back in college 2 years back but checking wikipedia now, I realise we already have OpenGL 4.0 but I am unaware of what I need to do to keep myself up to date.


So, in the meantime, what would be the latest preferred method for box selection?


EDIT: I found http://www.khronos.org/files/opengl-quick-reference-card.pdf on page 5 this card still lists glRenderMode(GL_SELECT) as part of the OpenGL 3.2 reference.



Answer



The way I do picking in core OpenGL is to assign a unique color to every object in the world and draw only the vertices (no texcoords, normals, etc.) with the assigned color to a FBO.


Once all the objects have been drawn, you can call glReadPixels at the mouse coordinate with a width and height of 1 to get the pixel color at that point. Then all you have to do is lookup which object was assigned to that color and return it.



If you want to drag-select a rectangle, do the same thing, but store the pressed mouse coordinate and change the parameters of glReadPixels to read back the selected rectangle between the pressed mouse coordinate and the released mouse coordinate.


c# - How do I translate a spherical coordinate to a Cartesian one?


Could someone point me in the right direction as to how this might be achieved? 3D math / geometry often throws me.


I'm looking for something like this (ideally in C#):


public Vector3 getCartesianFor(float elevation, float asimuth, float polar)
{
return ????;
}


Answer



http://blog.nobel-joergensen.com/2010/10/22/spherical-coordinates-in-unity/


public static void SphericalToCartesian(float radius, float polar, float elevation, out Vector3 outCart){
float a = radius * Mathf.Cos(elevation);
outCart.x = a * Mathf.Cos(polar);
outCart.y = radius * Mathf.Sin(elevation);
outCart.z = a * Mathf.Sin(polar);
}



public static void CartesianToSpherical(Vector3 cartCoords, out float outRadius, out float outPolar, out float outElevation){
if (cartCoords.x == 0)
cartCoords.x = Mathf.Epsilon;
outRadius = Mathf.Sqrt((cartCoords.x * cartCoords.x)
+ (cartCoords.y * cartCoords.y)
+ (cartCoords.z * cartCoords.z));
outPolar = Mathf.Atan(cartCoords.z / cartCoords.x);
if (cartCoords.x < 0)
outPolar += Mathf.PI;
outElevation = Mathf.Asin(cartCoords.y / outRadius);

}

present perfect - What kind of conditional form is this sentence?



"I will have failed if I haven’t given you the confidence and desire to explore further ..."



This sentence is from a book "Make Your Own Neural Network". This is not the only one, here are some others:




I will have failed if I haven’t given you a sense of the true excitement and surprises in mathematics and computer science.



and



I will have failed if I haven’t shown you how school level mathematics and simple computer recipes can be incredibly powerful ...



It has the "future perfect" + the "present perfect" in the "if clause" and it looks like some kind of conditional but I have never met such a form in grammar books. So, if it is not the "future conditional" what it could be?



Answer



Okay, this is one of those awkward sentences in English. We see the future perfect in the apodosis (then-part of an if-then statement) and the present perfect in the protasis (if-part of an if-then statement). In an earlier explanation of grammar, I would have argued that the present perfect in the protasis is the present perfect subjunctive as I posit below in my two comparative examples, but that doesn't work so much in Modern English because we rarely use the present perfect subjunctive construction in subordinate clauses anymore, which is clearly evinced in the third-person singular inflection (i.e., "if he haven't given"):




"I will have failed if I haven’t given you the confidence and desire to explore further ..." ("I haven't given" is present perfect subjunctive)


"I would have failed if I hadn't given you the confidence and desire to explore further..." ("I hadn't given" is the past perfect subjunctive)



In fact, the present perfect subjunctive is very rare these days in English, but it can still be seen in the mandative and hortatory forms, as well as some other forms:



I would rather it have been shorter. (although one could use the past perfect subjunctive here as well and it would mean the exact same thing: "I would rather it had been shorter.")


It's important that he have passed his driving test before he is permitted to drive alone.


It's possible for him to have been there. (the infinitival phrase here forecloses the present perfect subjunctive)


It's possible that he might have been there. ("may" and "might" are often used to foreclose the present perfect subjunctive)


Should he have survived that fall, he will find a way to get in touch with us in some way, shape, or form. ("Should" is used here to replace the present perfect subjunctive.)




I think this is what you're asking about—why is the apodosis in the future perfect when the protasis is in the present perfect? My answer is that what once followed the "if" here was the subjunctive, but it's not necessarily the case anymore as English has continued to syncretize over the centuries. In Shakespeare's time, this would have been easier to see, although even then the present perfect subjunctive was very rare, which is strange because the past perfect subjunctive has never been rare in English:



If I hadn't failed the exam, I would have passed the class. (past perfect subjunctive)



In essence, the statement that you have written above is basically stating that, at some unknown or unspecific or unimportant time in the future, I have failed at some specific goal on the condition that I have not yet been able to give you the confidence and desire to explore. I believe it's a strange construction because it uses the future perfect in the apodosis rather than the future simple, which is also why it uses the present perfect (subjunctive) in the protasis. It's just talking about a situation that has not yet occurred, but will occur at an unknown or unimportant time in the future. I think it would be easier just to say:



"I will fail if I should / do not give you the confidence and desire to explore further..." (using "should" here is an attempt to preserve the present subjunctive in English without writing the archaic form "if I not give" or "if I give not"; "do" is being used as the periphrastic present simple indicative after "if", which is vastly more common in Modern English.)



In my mind, this is simpler, but it's more direct than your example using the future perfect in the apodosis.



I hope this might have helped you out. If you should have any more questions, please feel free to ask, especially if my explanation should be confusing you. Take care and good luck!



P.S. Sergey, you have asked why the future real conditional takes the future simple in the apodosis and the present simple in the protasis. There is a reason for it. In the English of yore (times long ago), the protasis did not take the simple present indicative; it took the simple present subjunctive form, which is one of the reasons why it seems so weird to you:



"But if the courses be departed from, the ends will change. Say it is thus with what you show me." Ebenezer Scrooge, A Christmas Carol by Charles Dickens, 19 December 1843. (notice "if [they] be departed from; not "if they are departed from")


If he fail this exam, he will not pass this class. ("if he fail"; not "if he fails")



Over time, this form started to die off because English is syncretic, which basically means it doesn't have many inflections. For instance, in the simple present indicative, the only inflectional change is in third-person singular, i.e., "he goes". The rest of the paradigm of the verb "to go" uses "go" as its inflectional form: "I go, you go, we go, you go, they go". Do you comprehend this? However, in the simple present subjunctive, the inflectional forms are all stale: "I go, you go, he go, we go, you go, they go". Over time, the subjunctive in clauses with subordinating conjunctions such as "if" transformed into the simple present indicative in an effort to rid English of the subjunctive:



But if the courses are departed from, the ends will change. Say it is thus with what you show me. (notice "are" now; not "be")



If he fails this exam, he will not pass this class. (notice "fails" now; not "fail")



But some people like me still truckle to the present subjunctive, but it can be awkward saying it with subordinating conjunctions such as "if" in Modern English because people will often look at you as though you were speaking Shakespearean English (really old English); therefore, there is a middle ground in which one can use "should" as well as some other modals in English in some rare instances:



But if the courses should be departed from, the ends will change. Say it is thus with what you show me.


If he should fail this exam, he will not pass this class.



When we use "should" to replace a present subjunctive in an if-then clause (or a present perfect subjunctive of some form), we can invert it, thereby removing the "if":



But should the courses be departed from, the ends will change. Say it is thus with what you show me.



Should he fail this exam, he will not pass this class.



The present subjunctive is still common, though, in certain "that" clauses, which usually form the mandative subjunctive:



I demand that she go with you. (not "she goes")


I recommend that he pay now instead of later. (not "he pays")



The "that", however, is not mandatory in these clauses:



I recommend he pay now instead of later. ("that" is optional)




The present subjunctive in Modern English is usually negated without a periphrastic "do / does" and with the "not" between the subject and the present subjunctive verb:



It is important that they not speak too rapidly during their presentation. (not "they do not speak")


I suggest that you not do anything to upset them. (not "you do not do")


I recommend that he not buy this product. (not "he does not buy")



The simple past subjunctive can only be noticed in the verb "to be", and only in the first-person singular and third-person singular forms:



If I were in charge, I would fire you. (not "I was")



If it were up to me, you would still be in jail. (not "it was")



But the simple past subjunctive of "to be" looks equivalent to the simple past indicative of "to be" for the remaining persons:



If you were in charge, I would quit.


If they were here, we could finish this assignment.



For the remaining verbs in Modern English, the simple past subjunctive forms look equivalent to their simple past indicative forms:



If she owned this company, it would be bankrupt in six months.



If he spoke better English, there would be no problem here.


If we had more money, we could go out for dinner tonight.



Please read more about the subjunctive at my link here: Could 'it' be regarded as plural? Why is 'were' used instead of 'is' in "...if it were cleaned and fed..."?.


If you should have any more questions, please feel free to ask and I shall try to respond as quickly as possible as long as it not be too late in the evening (present subjunctive forms rather than "you have" and "it is not", which are present indicative forms, although "you have" is also the present subjunctive form as well).


tense - Is this reported speech?


I have another question regarding reported speech. Are these sentences some kind of reported speech?




"I was told that she knows/knew the whole story."



If I turned it around, I think I could form a normal reported speech:



"She told me that she knows/knew the whole story."


"I was told that you would/will know this."



Turning it around:




"She told me that you would/will know this."



Is being told something counted as reported speech? Please help!




tools - How can I measure the "creative/entertainment value" of video-game requirements?


I realize this question is complex and subjective, but bear with me for a moment.


I firmly believe that video-game software is essentially different from, for example spreadsheet software, as from a user point of view, some games have more similarities with film art than with regular software. However, when it comes to requirements prioritization methods that help developers sort out which feature or idea is most important, there is none that facilitate the creative aspects of video games. Most available techniques only aid regular software development where focus is on the risk and cost of requirements, and do not take into account the creative aspect of video-game requirements.


To illustrate the problem, think of a requirement (i.e. feature idea) such as the one seen in Super Paper Mario, where Mario can exit the 3D world and enter a 2D world, and vice versa in order to go around obstacles. This is a fairly challenging requirement to implement and probably costly, but definitely crucial to the success of the game. Available prioritization methods overlook the creative/entertainment value of this requirement and mainly just estimate how costly and (technologically) risky implementation is. Of course, this is a very simplistic example, but you can imagine a case where there is a pool of great game ideas (functional and non-functional requirements) and not enough resources to realize them all. When it comes to value calculation, academic research doesn't provide game developers with an adequate way to estimate the value of game requirements.


UPDATE / Clarification: In my research, I study available software product management solutions (more specifically requirements prioritization algorithms) and try to find out why are they not suitable for game development. It seems that it is the creative or entertainment nature of the software itself that introduces this incompatibility. It is the (available) techniques inadequacy, to recognize the core value of the software and its conceptually different purpose.


With regular software, it is the user or his/her needs that most often help estimate the value of requirements. Moreover, it is the user that produces most requirements. In video-game software, it is the creative vision that drives the requirements. With regards to requirements origin, it is the outside in vs. the inside out paradigm. Having established this fundamental difference, we can deduce that if requirements prioritization (RP) algorithms focus on user ideas/needs in order to estimate the value of requirements for regular software, then in the case of video-game software, the RP algorithm should satisfy the creative vision. By creative/entertainment value of a requirement, I refer to the degree to which the core vision relies on this particular requirement.



What I try to do is find a way to prioritize the requirements according to their relevance/importance to this core creative vision. This will ultimately provide a creative value, but it is relative to the central idea and the stakeholders’ ability to subjectively assess the requirements. This is just one side of the RP algorithm, as other factors such as risk and cost need to be taken into account as well, but the available RP solutions already offer adequate ways to do that, and they are compatible with the needs of game development.


The reason I’m writing here is because I am trying to see how developers deal with these problems (PR and focusing on the core idea) when dealing with more complex projects.


I try to refine part of the preproduction process by developing a requirements prioritization method tailored to the needs of game development industry. A pivotal element in such a method is the ability to identify and estimate the creative/entertainment value of requirements. However, in order to do that, I need to understand how game developers perceive this creative/entertainment value of requirements. In a nutshell, I am seeking answers to the following questions:


Question 1: How would you define the creative/entertainment value of video-game requirements?


Question 2: How would you measure it?


Question 3: Who should measure it?


I would love to see how these issues are perceived by game developers and I would appreciate your take on them here, but if you want to contribute to this research – receiving my eternal gratitude and a proper credit/citation in the research and all the publications that will follow, please fill up my extremely short survey (just 7 questions, 3 of which you already see above):


The extremely short survey which will cement you as my personal hero.


Research information and trigger


This research is being conducted at Utrecht University, The Netherlands, as part of an Information Science master’s thesis.



Game development is in many ways similar to product software development as developers follow certain software development processes. Following a poor development method (or none at all) could result in longer development times, going over budget and/or delivering buggy products (Bethke, 2003). What makes video games different is the creative game vision that must be shared by the entire team to ensure that the end product is consistent and of good quality. This is especially true for full-blown game titles where from a user point of view, there are more similarities with film art than with any other software. Unfortunately, this curious creative aspect renders many software product management techniques unadoptable by the gaming industry.


I am quite interested in working towards improving the game development process in the preproduction stage, by creating a requirements prioritization method tailored to the specific needs of the game industry and I need your help! The easiest way to contribute to the research is by filling up my short survey (link above). If you find this research interesting, please contact me at a.cherv@gmail.com


Researcher information


My name is Alex Chervenkoff, an avid gamer and quite excited about this research! You can contact me at: a.cherv@gmail.com


Degree in BSc Computer Science, The University of Sheffield, UK.


Currently doing MSc Information Science at Utrecht University, The Netherlands.


Thank you!




negation - "No more than" — comparing two clauses


I came across this sentence today:



Even she, who believed herself to be a revolutionary, could no more have broken her marital bangles than she could have driven a stake through her husband's heart.



I understand the meaning of this sentence. Here in this sentence two things are being compared. Both are negative sentences. The first sentence is no more than the second sentence. Ultimately resulting in that both the sentences are not true.


But I wonder:




  1. The second part, the one the first one is being compared to — "she could have driven a stake through her husband's heart." —, has no negative, yet how does it mean something negative?

  2. How do both the first and the second part tell that both are impossible to her?




pronouns - Why place "both" and "all" after an auxiliary verb such as "have"?



(1) We both/all have seen the movie.


(2) Both/All of us have seen the movie.


(3) We have both/all seen the movie.




It seems that "both" and "all" are part of the subject in (1) and (2), but not in (3). Is this correct?


Regardless of whether "both" and "all" are part of the subject in (3), it's clear that these three sentences have the same meaning, and that "both" and "all" are located after the auxiliary "have" in (3), unlike in (1) and (2).


Why place "both" and "all" after an auxiliary verb such as "have" as in (3)?



Answer



The phenomenon presented in your question is called "Quantifier Floating".


In English grammar, quantifier floating is the syntactic process by which a subject-related quantifier (all, both, or each) can be separated from the subject and appear in more than one location in a sentence. (directly copied from the link)


This quantifier floating is possible not only with normal verbs, but also with auxiliary verbs.


http://www.aclweb.org/anthology/W13-3730 This page has a few examples of quantifier floating involving auxiliary verbs.



(a) All the boys seemed to be in a good mood when they arrived.



(b) The boys all seemed to be in a good mood when they arrived.


(c) The boys seemed all to be in a good mood when they arrived.



It seems that when the subject is not a personal pronoun, structure "all of..." becomes optional. But when a personal pronoun is the subject, if you want to place "all" before the subject, "all of..." becomes obligatory, as in "all of us".


So why do we do it? I don't know. It's just that there are options from which we can choose, and we just choose one of them.



It seems that "both" and "all" are part of the subject in (1) and (2), but not in (3). Is this correct?



You are partially correct. It is more complicated than that.


An example:



The possible positions if the verb is "be" are shown in (31). We can see that the quantifier "all", which is part of the subject NP "all of my relatives" in (31a), can move to a position after the noun when "of" is deleted, as in (31b), or after the verb, as shown in (31c). It is tantamount to saying that "all" that appears separated from the subject is just a transformed version of "all of", still fully related to subject (but due to lack of my knowledge, I don't know if you can claim that it is a part of the subject or not). In (31d), "all" is part of the NP all of my friends, which is the subject of the complement in square brackets. Notice that here all can move to a position where it splits the nonfinite (infinitive) form of to be, as in (31f), but it cannot move over the infinitive, as shown in (31g).



(31) a. All of my relatives are farmers.


b. My relatives all arefarmers.


c. My relatives are all farmers.


d. I want [all of my friends to be at the airport].


e. I want my friends all to be at the airport.


f. I want my friends to all be at the airport.


g. *I want my friends to be all at the airport.




Link:http://grammar.about.com/od/pq/g/Quantifier-Floating.htm


Monday, September 26, 2016

Gerund and infinitives for "Suggest and Recommend"


When we can use a gerund (or infinitive) after the verbs: suggest and recommend? These examples made a confusion for me:


We recommend you to book your flight early.


He recommends reading the book before watching the movie.



I recommend you going there.


I suggest you go to the sport center. (is it OK to add to before the verb go, or using going instead of it?)




Sunday, September 25, 2016

algorithm - Real Time Dynamic Pathfinding?


I'm currently doing some pathfinding research and my simulation is the following: I have a 3d scene with a start and end point represented, I'm capable of creating navigational meshes, waypoints and polygons to aid with pathfinding.



I've tried an A* algorithm and some of its variants and they work perfectly. However, now I'm more interested in 'dynamic' pathfinding. For example, while finding a path from point A to point B, if a new obstacle suddenly appears, i want my algorithm to immediately be able to re-plan a path and not start searching from scratch again.


I've done some reading on the D* algorithm and wondering if this would be appropriate for what I need or would this seem like an overkill.


So my questions basically are: What algorithm would be best for Real Time Dynamic Pathfinding? OR what combination of techniques could I use instead?




word usage - Why is it called "under the sea" when it should be "in the sea?"



Why is the phrase "under the sea" constructed the way it is? Shouldn't it be "in the sea?" Does "sea" refer to the surface of the ocean in this case? Or is it just one of those quirks in English?




Answer



Under is used to refer to something below a surface:


Macmillan dictionary has:



e. below the surface of water:
The ducks kept diving under the water to catch fish.
He was the first person to claim there was oil under the North Sea. She jumped in the pool and went under.



assets - Help streaming resources (maps, sounds, music, etc) from many files for contiguous world


So I'm creating a game and I would like to know how to perform resource streaming (rather than loading the whole file into the buffer) for things such as my maps, sounds, music, etc. I'm using C++ and DirectX9 if in case you need to know.




grammar - What is the reference of "it" here?


I've come across with the sentence below?



Old tasks become easier the second time around, but it doesn’t get easier overall because now you’re pouring your energy into the next challenge.



I don't know what the reference of "it" is here. The tasks? the process? or anything else? So could you please tell me what the reference of "it" is here?


The full text is:




Usually, this minor dip in performance is no cause for worry. [...] The less energy you spend on trivial choices, the more you can spend it on what really matters. However, when you want to maximize your potential and achieve elite levels of performance, you need a more nuanced approach. You can’t repeat the same things blindly and expect to become exceptional. Habits are necessary, but not sufficient for mastery. What you need is a combination of automatic habits and deliberate practice. Habits + Deliberate Practice = Mastery To become great, certain skills do need to become automatic. Basketball players need to be able to dribble without thinking before they can move on to mastering layups with their nondominant hand. [...] But after one habit has been mastered, you have to return to the effortful part of the work and begin building the next habit. Mastery is the process of narrowing your focus to a tiny element of success, repeating it until you have internalized the skill, and then using this new habit as the foundation to advance to the next frontier of your development. Old tasks become easier the second time around, but it doesn’t get easier overall because now you’re pouring your energy into the next challenge. Each habit unlocks the next level of performance. It’s an endless cycle.



Atomic habits by James Clear



Answer



That is rather like a "weather it". The sentence requires a subject and "it" is used without a definite reference.


You could interpret "it" to mean "The process of developing mastery", ie the subject discussed in this paragraph.


Saturday, September 24, 2016

xna - Laser Beam End Points Problems


I am building a game in XNA that features colored laser beams in 3D space.


The beams are defined as:



  1. Segment start position

  2. Segment end position

  3. Line width



For rendering, I am using 3 quads:



  1. Start point billboard

  2. End point billboard

  3. Middle section quad whose forward vector is the slope of the line and whose normal points to the camera


The problem is that using additive blending, the end points and middle section overlap, which looks quite jarring. However, I need the endpoints in case the laser is pointing towards the camera!


See the blue laser in particular: XNA Laser Demo Screenshot




grammar - How to use phrase "think so" as perfect of recent past?


Is it correct to use present perfect tense and say "I have thought so" during a talk when referring a reply. For example in a context where I have been looking for my keys for the last a couple of minutes.


Me: I am still looking for my keys. My friend: Keys are on the table in living room. Me: I have thought so.


In this context, thinking action lasts just a couple of seconds and it is complete and over a moment ago before I say " I have thought so "; therefore it belongs to recent past. Especially in British English as seen below links, present perfect is used for the events that happen in recent past which is also called perfect of recent past.


Can I similarly use present perfect above context to relate my thought with my friend's answer? Or can I only use present perfect if thought is still in my mind at the moment I say "I have thought so" ? Can you explain please?


https://www.diva-portal.org/smash/get/diva2:404674/FULLTEXT01.pdf http://www.glossary.sil.org/term/perfect-recent-past




grammar - Explaining the Second Conditional and the Third Conditional in a "logical" way



When I was searching for a job, I applied to be an English teacher, and the employer asked me about "how to efficiently explain to students the difference between the second conditional and the third conditional." And I presented to him my own explanation and finally failed.


Please be reminded that I am not asking for my benefit but just asking for the pure confusion because the question of why I failed remains to this day.


The Second Conditional
If there is a sentence like below, how would you, as a native speaker, explain the "logic" of the meaning of the present perfect?



If I were him, I am going to go to the shop.



The potential employer simply told me that "even though the first part of the speech is past tense, that part (=If clause, here) is demonstrating the present situation."


My explanation was, "The first speech denotes the past. Therefore, that situation is "irreversible." However, if the "irreversible" situation becomes "reversible" by putting "if", that part of the speech will denote that you are describing "now." So, the last part of the speech could denote possible future events."


The Third Conditional

In the case of a sentence like:



If he had not been there, he would be alright now.



My logical explanation would have been:



The first part of the speech was denoting the "past before the past." So even if "if" was put, that would remain as a past, so that is still "irreversible." Therefore, the last part of the speech denotes the present (and irreversible) result.



"He" (the employer) did not comment at all because the "interview" had ended before I was trying to explain about the past perfect.


What would you think of my "logic?" Does anyone have "precise" logic about this grammar? After all my searching, what came up was just the case in which English native speakers are not explaining the "logic" at all, but simply the grammar itself.




Answer



First of all, it might be helpful to get a firm grip on what actually goes on with conditionals. Basically, there are two tense systems that we use. The first is the tense system we generally use when using sentences with subordinate clauses that tell us about when something is going to happen. This is to say we use past verb forms to talk about past time, and we use present tenses to talk about present and future time. Within this type of conditional we can see all sorts of verb forms and modals in both clauses.


In the second system we can observe what is sometimes called backshifting of tense. What this means is that in these conditionals we use past tenses to talk about present and future time, and we use past perfect verb forms to talk about past time - even when we would normally expect to just see a past simple or continuous verb form. These backshifted conditionals have a different type of logic that is very difficult to accurately describe. This doesn't matter too much, because most languages have types of conditional which match these meanings very closely. So what you really need to do is enable learners to identify which ones they need. Effectively, backshifted conditionals are hypothetical, in the sense that when we use them we are more interested in discussing the idea at hand than we are directly in the immediate physical world.


When we use normal conditionals, what we are saying is that the situation described in the result clause WILL HAPPEN (or did happen etc), if the situation in the if-clause happens or did happen. When we use backshifted conditionals, we are saying that the situation in the result clause is a LOGICAL RESULT of the situation in the if-clause. However in this instance, it does not matter whether the situation in the if-clause ever happens or not. What we are emphasising is that the result clause is logically connected to the if-clause.


Students understand very quickly whether a given situation is hypothetical or not for them. All you need is a few examples.


However, here is the nasty truth of things. EFL books, and linguists in general know pretty much nothing about conditionals at all. However, we don't really like to say that we know nothing about something, especially if we have to write a reference grammar on it or teach it to students. For this reason, we like to make things up that are flagrantly not true or are only half true. It generally beats having nothing to say. This means that you need to learn what rubbish it is that you are expected to know. After that you need to know how to avoid teaching this at all costs.


The ugly untruth


This is the lie that you need to learn. Firstly, backshifted conditionals are sorted into two types. The second conditional uses the past simple to talk about the present of future. The third conditional is used to talk about past time.


The second conditional indicates that a given situation is UNLIKELY. The third conditional indicates that a given situation is IMPOSSIBLE. [Remember - none of this is true!!!!!]


Different writers use different words to describe this improbability. They use terms like modal remoteness and negative epistemic stance, or they just talk generally about improbability.



So, if you go for an interview to get onto a teacher-training course, what they want you to say is something like:




  • For the second conditional, I would give my students unlikely situations such as winning the lottery, and get them to make sentences about what they would do if they won.




  • For the third conditional, I would ask them about regrets they have in their life and how their lives would be different if they hadn't done those things.




In terms of explaining the difference, second conditionals indicate unlikely situations in the present or future and third conditionals indicate impossible situations in the past.



If you can remember that story, you will be able to pass the interview with flying colours.


Why you should never teach anyone this baloney


You may have noticed that you breathe when you sleep. However much you agree with this statement, you are unlikely to agree that you sleep when you breathe. Now we may use second and third conditionals when we think that a situation we're talking about is unlikely or impossible. But this is only because we cannot talk about these situations by describing the world directly. These situations are necessarily hypothetical. However, just because we wish to discuss things in a hypothetical manner does not mean that we think they are unlikely to happen. We often talk hypothetically for other reasons:




  • It is less direct and intrusive than talking directly about the world - especially if we are making suggestions to someone else or discussing a situation that doesn't directly affect us personally: Well, if you took the position at Kings college you'd be near your friends, and if you took ...




  • We may not want to bring the discussion round to whether the situation in the if-clause is actually going to happen or not. We may want to keep it hypothetical: So, if we offered you this position, what kind of salary would you be expecting?




  • We may want to emphasise the logical connection between the if-clause and the result clause: If he had the measles he would be displaying exactly the symptoms that he is in fact displaying.


Notice that we cannot use a non-backshifted conditional for that last example. If you teach your students that we use backshifted conditionals because they indicate that the event described in the if-clause is unlikely, they will understand that last conditional to be saying exactly the reverse of what it's intending to say. Furthermore, it also means that your students may misunderstand people in interviews for example. Your students may think that the interviewer is not going to offer them the job when they ask about a hypothetical situation in which your student is given the job. Lastly, if your students ever become EFL teachers or write on sites like this one, they will unwittingly lie to all and sundry about the real meaning of backshifted conditionals.


So, in short, you need to learn this so you can parrot it at interviews. You then need to remember never to teach this deleterious piffle to your students.


education - What are some non-obvious topics to learn for game development?



I've been writing games for around 10 years now (from QBasic to C# and everything in-between). I need to start stretching my skills into different areas. What are other, surprising topics I should read up on?



Expected topics would include the usual suspects:



  • Programming language of your choice

  • Scripting language

  • Source control

  • Project management (or Agile)

  • Graphics API

  • Maybe some AI (A* path-finding?)

  • Physics (projectile physics)

  • Unit testing (automated testing)



I'm looking for more esoteric topics; things that you don't expect to need to know, but if you do know them, they make a difference. This could include things like:



  • Art skills (drawing, lighting, colouring, layout, etc.)

  • Natural language processing

  • The physics of sound (sound-waves, doppler effect, etc.)


Personally, I feel that having technical art skills (eg. can make decent art-work if you can only come up with ideas; or, following Photoshop/GIMP tutorials) was the most beneficial for me.


This is not intended to be an open-ended question; I'm looking for specific skills that helped you and you expect will continue to benefit you in the short- and long-term.



Answer




Story Telling - people and critics always say story is important in games. It's often added as an addendum to a list of things your game should have, but actually implementing a compelling narrative in a game is hard. Games narratives get put into the context of literature or movies often, yet they fundamentally function differently and there is a lot of interesting discussion around about how to even talk about game narrative on its own terms. This gets even more abstract for games that don't use 'characters' or are basically an assembly of mechanics.


Given all that, literary and film analysis can be useful to be able to phrase intent.


Marketing - so you've actually finished a game (haha, as if). Now what? We hear about Minecraft or Angry Birds, but the business side of actually promoting and distributing our game is, for many of us, a giant black box. XNA? Sure, put it on XBLIG, but what else can be done to promote it?


Psychology - Specifically, how do we learn? How can you teach game mechanics through game play so that people aren't totally lost by your esoteric opus on time manipulation?


Graphic Design - Sure we all know that using Papyrus or Comic Sans is bad, but creating a well designed menus system or UI requires skill. This is only partially a subset of art skills, not necessarily an complete subset - some people can be good designers without being able to draw well.


Friday, September 23, 2016

phrase usage - How many meanings does "I am in" have?



I have heard the phrase ‘I am in’ or ‘I am absolutely in’ (and similar variations) several times.


As I understand it, it means I agree with the idea and I will join you in your efforts.


Recently, I wanted to use this phrase in a written form and I thought perhaps my understanding was incorrect. I Googled the phrase to reassure myself that I understood it, but I still wasn't sure of the correct meaning.


I was not able to find a definitive answer. Frequently, the phrase was associated with other word(s) that completely changed the meaning.


For example:



In addition, this I am in seems to have the meaning of being accepted.


So what is the correct usage of the phrase ‘I am in’? Does it have more meanings? Can all of them be used in written (formal) form?



Answer



"I am in", the way you heard it used, means "I will join you (in a given endeavour)", "I will participate (in the endeavour)", "you can count on me", "you can include me in your plans".



The opposite also exists, "I'm out". Meaning "I'm no longer participating", "I'm not onboard anymore".


It is informal, but that doesn't prevent it from being used in literature or movies to depict just that, informal situations. For example, in the movie Ocean's Eleven, George Clooney's character famously recruits Matt Damon's character by saying,



You're either in or you're out. Right now.



You can also ask people "who's in?" or "are you in?", etc. Again, this is okay for example for informal emails, but you won't see it used to invite people to a Royal gala, nor should you use it when replying to such an invitation.


Another common expression is "count me in", with the same meaning as "I'm in". (And the corresponding "count me out".)


The last usage of in is completely unrelated to all of the above. In that situation, in means "popular", "in fashion". (And once again, it is complemented by out meaning "out of fashion", "unpopular".) You can say, "red cars are in these days", for example. Or "gangsta rap is out". I would say this is less informal and more mainstream; you will find many newspapers or magazines, covering anything from fashion to politics, having a column titled "in and out [today/this week/this month]" or some such.


Oh, and if you still want to look these words up in a dictionary, look under "in (adverb)" and "in (adjective)" — not "in (preposition)" —, and the better ones will have the corresponding entry.


difference - "a lot of" vs. "lots of"


What is the difference between "I have a lot of friends" and "I have lots of friends"?


Are they interchangeable?





articles - time expression + has/have




After ten years has passed you can apply for possession of the land.


Ten years have passed - ten long, lonely years - since Bill died at sea.




I wonder why is there has in first sentence?. I know if we use it as "a period of ten years" then we can use has.




"A short ten years has brought us to this point."


"An arduous ten years have passed."



Here in #2 it(Ten year's) modified by article that makes it countable. So there should be Has in both sentences of example #2. Correct me if i am wrong.



Answer





After ten years has passed you can apply for possession of the land.



Well, you basically answered this yourself. But I would express the usage as 'ten years' is considered singular.


As you noted, we use this in time phrases. We also use this in money phrases, such as 'Ten dollars is all I have.'



A short ten years has brought us to this point.



Here the same thing is happening. Ten years is considered singular, so both a singular verb and the indefinite article is used. (The indefinite article may only be used before count nouns, and count nouns are singular; that is, non-count nouns cannot be plural.)


I can also say




A ten years has passed that I will never forget.



Again, ten years is considered singular and so I can use a singular verb, and I can use the indefinite article before the singular 'ten years'.


The question seems to be about the following:



An arduous ten years have passed.



We know that with "arduous" we can say:


An arduous ten years has passed.


Ten years is considered singular, and the indefinite article may be used before a singular noun. In addition, an adjective may modify a singular noun.



So the question remains, can we say



An arduous ten years have passed.



Here, 'ten years' is considered plural, a plural form of the verb has been used, an adjective has been used, BUT an has been used. We know an goes only before singular nouns. So there does seem to be a conflict.


Despite this, the usage seems fine to me. There are other expressions in which we use the indefinite article an with in an expression that uses a plural verb form:


A good many days have passed.


A few days have passed.


A number of people are marching down the street.


A large number of complaints have been received.



A lot of horses recently have been coming around the mountain.


A hundred people have gone home after waiting an arduous ten years.


Pethaps it is possible that the idea of ten years being considered singular OR plural is similar to a collective noun (example: team, crowd, government) being considered singular or plural:


The team is unbeaten after playing ten games. (US)


The team are unbeaten after playing ten games. (UK)


Thus, maybe the following is possible:


? A lucky England football team have won the world cup.


I don't know if the above would actually be said (maybe the idea is too preposterous to consider). But the following has been said:


An eager team have knitted and crocheted 120 squares including 4 complete blankets.


relative pronouns - In Tales of Count Lucanor, what's 'that' in 'that which'?



[Source:] The titles in the following list are those given in James York's 1868 translation into English.[5]


The Prologue
1. Relates to what happened to a Moorish king of Cordova. This story is based on the life of Al-Hakam II: his battles repulsing the last Norman attacks, and the struggle against the Zirids and the Fatimids in northern Morocco.
2. Treats of that which happened to Lorenzo Suarez Gallinato, and Garciperez of Vargas, and another knight ...



5. Of that which happened to the Emperor Frederick[disambiguation needed] and Don Alvar Fañez, with their wives
6. Of that which happened to the Count of Provence and Saladin the Sultan of Babylon
7. Of that which happened to a King and three Impostors



In these titles, to what noun phrase does (the relative pronoun) that refer ?
I know that 'which' starts the restrictive relative clause modifying that.
(I was going to write '...relative clause THAT modifies that', but this looks confusing)


Obiter dictum: I was reading The Emperor's New Clothes which linked to this page.



Answer



Michael Swan, author of Practical English Usage (1995), considers that which to be an older form of what. In fact, he says that the form that which is very unusual in modern English. However, a search in Google shows that there are over 1.5 million hits for that which; surely, that many sources can't be completely off the mark!



pronouns - "It's cold today" -- what term do linguists use to call "it" when it's used as the subject of a sentence, but has no real antecedent?


Could you please remind me what term linguists and the grammar people use to call it when it's used as a subject pronoun, but the funky thing is that it doesn't really refer back to anything in particular like he, she or we usually do which do refer back to a person or an animal that they stand for.


In grammar-speak, when it is used like that they say that it has no antecedent. I think I knew the term, but I unfortunately forgot it. I did a Google search, but the only thing I could find was empty subject. But the truth is that I don't think that's what they actually use in linguistics. Would you please refresh my memory?


Examples:




  1. It's quite cold today outside. So, I don't really wanna go out.

  2. Did I solve that math problem? Yes. Actually, it was very easy to get it cracked. There was really nothing to it!

  3. Don't mention it! It's nothing. I really like to help people who are in need.





Answer





  1. It's cold today.

  2. It's easy to do.

  3. It's nothing.



For your example #1: It's cold today.



The term I use for that "it" (in #1) is dummy pronoun, and it is a dummy pronoun that realizes subject function.


Evidence that shows "it" to be a subject is: "Has it been cold today?" (subject-auxiliary inversion). The "it" underwent inversion with the auxiliary verb, and so, it probably is the subject.


Evidence that shows "it" to be a pronoun: "It is cold today, isn't it?" (interrogative tag question). Only pronouns can be subjects of the tag question.




As for your other examples (#2 and #3), er, they might be regular pronouns (that is, they are not dummies). You might want to surround them with a context, and then, you might see that the "it" actually does have an antecedent.


modal verbs - "can't" versus "couldn't", what is the difference?





  1. That can't be Obama at the door, it's too early.




  2. That couldn't be Obama at the door, it's too early.






What is the difference between them? Are they almost the same?




assets - What are good sites that provide free media resources for hobby game development?



(Note : This question is being transfered from stackoverflow to gamedev.stackexchange where it belongs)


I really suck at graphics / music / 3D modeling / animation and it's a must-have when you have a hundred hobby game development projects you're working on. I'm looking for different quality sources on the web that provide free resources.



[EDIT] Some resources given by the answers, in bold the biggest resource per section:


MODELS





SPRITES





ANIMATED SPRITES






CLIPART / VECTOR BASED





PHOTOS





TEXTURES





MUSIC






SOUND EFFECTS





OTHER PRECOMPILED LISTS





Thursday, September 22, 2016

word usage - "Has" vs. "have"


Can anyone tell me where we have to use "has" and where we have to use "have"?
I am confused. Can anyone explain me in a simple way?




software engineering - Should I use Game Engines to learn to make 3D games?



HI i am a software engineering student in his second-last year.


I am proficient with C,C++,C# and java programming languages, and being a student of engineering I have studied calculus, vectors etc in both 2D and 3D & various other mathematical, probability and statistical topics.



I have made several 2D games, my most recent being a Super Mario-like game with side-scrolling and multiple levels.


Due to my these small game projects,i have become really interested in making games.


So now i want to move ahead to learn to make games in 3D.


Now I know that there are several game engines available which can take care of rendering details and other "low-level" stuff for me...


My Question is:


1) Is it a good idea to learn to program everything yourself, from making 3D shapes, terrains (using polygons meshes) etc, to programming mechanism for collision detection, lighting etc, considering my motive is to learn how to make games in 3D (but am not too eager to get into the game industry quickly, want to build a solid foundation first)


Or could I do without these details & work on the abstraction-level which the game engines (like UDK) provide ??


3) If I should try to develop from scratch, then can anybody suggest which API to use: Direct3D or OpenGL?? (which i would be more comfortable with, in light of my above mentioned skills) & can anybody also give me references to some good books, reading materials, tutorials, etc to get me started?? (I wouldn't mind theory as long as it helps me make a sound foundation)


Many Thanx in advance (for even reading my question, i know it's lengthy... but i need a DETAILED answer... :D :D )



Answer




In my experience you need to learn to program everything from scratch individually and use a game engine for any actual games you work on.


Even if you work in the industry you'll never write everything form scratch, you'll focus on certain aspects of the game. So if you want to maximize the use of your time, I would say have small projects like going on at openprocessing.org or something similar and use a game engine like Unity3D or corona for your personal projects.


Your for fun projects may look like:



  • 2d perlin noise generator

  • terrain generator

  • 2d bone animation sim

  • 3d cube scene with multiple cubes and from scratch camera projections on openprocessing.org

  • simple 2d game using corona or unity3d

  • random chapter from one of the GPU gems or game development gems books (the have lost of things you can try to implement)


  • write some shaders in HLSL

  • more advanced game with maybe some 3d using unity3d

  • etc etc etc


Of course these projects would be tailored to things you're actually interested in.


Do I use the definite article, or not, with a plural count noun when referring to all of those things named by the noun?



(the) Security forces helped us fight (the) terrorists.



If I wanted to refer all security forces in a specific country would I need to use a definite article? Same with "the terrorists", I want to make clear that the security forces are fighting not all terrorists but a few groups of terrorists; would I have to use the definite article then?


The question this is supposed to be a duplicate of talks about generic noun phrases. This means things that do not actually exist in the world (you can't feed or take a photo of a generic lion, for instance). I am talking about noun phrases (security forces, terrorists) that actually exist and fight and die in a specific country. We can feed and and photograph them. They are "real," not generic.




Fundamental physics component(s) in component-based game engine




What are the "smallest" physics components in your component-based game engine?


Would it make sense to create something like Positionable, Rotatable, Movable, Collidable and combine them the way you want or is it better to use one unified component like PhysicsInteractable?



Answer




Well, it depends of the overall look of your engine. I have always aimed for static and dynamic objects; the static ones just sit there with their collision data and the dynamic ones get updated and checked against static and other dynamic objects.


sentence meaning - did call vs called


Is there any difference in meaning between the two sentences below?




I did call him



And



I called him



Both of the above sentences are in past tense. Please help me understand the difference in meanings. Also please help me with example.




Wednesday, September 21, 2016

past tense - "had been" vs "were"



Could you please tell me what is the difference between these two sentences?



There had also been reports that rival gangs of youths had been seen throwing fireworks at each other near the warehouses, and this might also have had something to do with the fire starting.


There were also reports that rival gangs of youths were seen throwing fireworks at each other near the warehouses, and this might also have had something to do with the fire starting.





pronunciation - How many vocabulary words should I learn every day?



I am trying to learn new words but pronunciation is difficult. I try to learn new words, but by the next morning I have forgotten what they were and I have to start over again. How many new words should I learn every day so that I can remember them all?



Answer




A: How long should my legs be?
B: Long enough to reach the ground.




In other words, as many as you are able to learn. If you can learn 10 a day, you'll be doing great.


The more you read (stories, newspaper articles, textbooks, not EFL textbooks, but textbooks in fields that you know something about and are interested in), the more vocabulary you'll learn and the faster you'll learn it.


Don't try to memorize vocabulary lists: that's pointless because it doesn't work. To be able to remember vocabulary, you have to recycle it, which means that you have to read those words in meaningful and interesting contexts as often as possible.


My European immigrant father-in-law learned English vocabulary by reading the newspaper (with a dictionary) every day. When I was studying French last century, I read an anthropology textbook written in French. I had to use the dictionary a lot at the beginning, but by the time I'd reached page 100, I'd learned (not merely memorized) all the important vocabulary and could rapidly read the rest of the book (another 150 pages) without needing the dictionary more than once or twice every ten pages. I love to read anthropology books, so it wasn't a chore.


What is an example of a sentence that has no verb?


My teacher believes that every sentence has a verb but I want to prove her wrong. (My teacher told the class that whoever can find a sentence with no verb she will give them a prize.)


Does anyone know and example of a sentence that has no verb?




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...