text:
Batching in Java (software rendering)
I've watched some tutorials on java game development and when they start using spritesheets all they do is get a subimage out of the spritesheet and create a new BufferedImage out of that. Does java do some sort of batching behind the scene when drawing the images like some engines and libraries do? Is it even possible to batch in java, and if so how would I go about doing it?

You don't need to do batching in Java(but if you want to try it here is a link to a usefull link: https://www.youtube.com/watch?v=X6KjDwA7mZg), let me tel you why:
The idea of batching is to draw all models that have the same texture and other data, like vertex data, in batches so that you minimize the amount of binds and unbinds for said data as much as possible, when using APIs like OpenGL or DirectX. So instead of having to bind and unbind the texture add all the other data for every same model, we can simply draw all the models at once, binding and unbind only once the data needed.(IF you haven't understood click on the link above).
In Java this isn't need because your are not bind or unbinding anything. What you can do is, at the beginning of the program load all the sprites from spritesheets and then every time your render to the screen simply draw them using something like a JCanvas. Batching is all about minimizing the amount of bind and unbinds, as mentioned before, so since in Java you do need to bind anything to draw to the screen, batching is useless.
I know this might not have help you a lot do feel free to ask questions


text:
Touchpad Unity UI
For my Unity game, I want a touch surface (UI Panel).
I started implementing a MonoBehavious that should handle touch-started, touch-ended, touch-moved/dragged and double-tap with custom methods.
I read some forum posts and the scripting documentation, but I don't understand how have to do this.
Which base-class do I have to use? What methods should be implemented/ overridden?

Unity's standard UI elements respond to both touch inputs and mouse inputs.
If you want to implement custom events that trigger on touch, use the Input class. For instance, Input.touches returns all the touches that are currently happening at that instant.

Thank you very much, however I found the answer here: http://answers.unity3d.com/questions/875535/event-trigger-component-how-to-access-input-data.html.

@000000000000000000000 To help others with the same question find the solution, it's worth posting a description as an answer on this question, and marking it accepted. That way, even if the answers.unity3d link breaks in the future, the information will still be accessible.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Render ModelContent directly
Say I have a set of .fbx files which contain all my bones, meshes and animations. I want to make use of these in the finished application i.e. rather than converting them all to .xnb I just want to load the .fbx files at runtime. I've got AssImp importing them, MonoGame.Framework.Content.Pipeline processing them, but now I have a ModelContent object which is not usable as a Model (unless I'm missing something obvious).
Can I convert these to Model without passing them to a ContentWriter/ContentReader?

MonoGame does not support that, and original XNA did not either (as XNA developer Shawn Hargreaves blogged, "you must either use the Content Pipeline, or not use the type at all"). ModelContent gets serialized to the XNB file, and the file is deserialized to a Model by the framework.
This is because a runtime dependency to the Content Pipeline assemblies would be useless bloat for most applications (and in XNA's case, a licensing nightmare). XNB is a fast runtime format containing only the necessary data, whereas FBX is the exact opposite. If you really need to use FBX models, you have to modify or reimplement Model/ModelContent.

I guess this is about as good as we can get if it's not supported. Thanks.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
One large tileset or multiple tilesets
I'm currently writing a 2d tile scroller for a hobby project and I can't find any resources to give me a clear answer to which is more efficient to do.
Each block contains tiles 44 by 24, 32px x 32px in size, and I'm rendering all immediately-adjacent blocks offscreen. With each block, I am specifying what the types of the tiles are, such as Sand, Grass, Pavement, etc. My end goal is to have dozens of unique tiles in each set, potentially having several "Grass" sets to pull from, to have a diverse set of landscapes.
What I want to do:
I would like to only load tilesets that have tiles that appear in the loaded blocks. I would do this by marking tile "families" in Tiled, as well as giving them an ID that pertains to that tileset specifically.
However, I don't know if it's just better to load all of the tiles from one large tileset on the game's start and just keep it in memory, instead of making frequent content loads
Will the game potentially run more efficiently dynamically loading tilesets based on need, or one very large tileset when the game first starts?

Is memory efficiency really a problem? 2D textures are not typically huge enough to cause issues. Splitting the tilesets into too many textures may even cause problems in itself, since switching textures is not always cheap on the GPU. You should probably just optimize for your development efficiency at this stage.
Unless you're intending to have loading screens, dynamic loading of a texture may result in a glitch. Typically you're not able to load content in the background, so loading a texture is a blocking operation. In some cases, the block may be long: for example, my HDD shuts itself down after some idle time and takes seconds to start up.
Additionally, ContentManager does not unload assets unless Unload() is called (unloading everything), so if you're using a single ContentManager, memory use will creep up anyways during gameplay.

This is the right answer, in particular, because it begins by asking whether memory efficiency is really a problem.  Use one big tileset and keep it in memory.  Computers these days can handle that just fine.  If memory truly becomes an issue, which seems unlikely, you can deal with it then by breaking up the tileset, throwing in load screens at logical junctures, etc.

Thanks! I went with something similar. I'm keeping the separate tilesets but loading them on start, so I don't run into the 2048x2048px texture limit


text:
Trying to make 3D game look like 2D
I'm making a 2D dungeon crawler. The problem I found, it is that trying to animate the movement through the dungeon it is hard as hell. Then I thought that maybe a 3D dungeon will be better for this, but I don't like it. Are anyways to make a 3D game look like a 2D game? I mean...
There is some kind of shader o camera mode to achieve a 3D game look like this?

(Tough the game is in 3D, looks like it was a 2D game trying to be 3D).

Use an orthographic camera instead of perspective camera.

I believe you should still want to use a perspective projection instead of orthogonal one, as there is still a perspective in it.
There's some ways on how to achive it. One would be using a perspective projection and tweak the fov to achieve the narrow camera effect and maybe a low resolution framebuffer (OpenGL) and resize it to get a pixelated effect. Second would be using a ray casting method which is used for some old 3D games.
There should be more ways to achieve this though.

I will look at this. Raycasting is interesting too, but it doesn't seem to allow using textures on its walls.

@Tchangla Nah, texture is allowed. There is a stream video where Markus "Notch" Persson use this technique (or i think he did) to make a dunegon crawler which has textures for walls and floors. Edit: You can see that texture is allowed at the wikipedia link i provided at the feature and limitation part.


text:
Are there spritebatch drawing limitations on monogame?
I've reached a point that it seems when I draw too much on screen, monogame starts doing weird things.
When I call this code in the Draw method
public void drawDialogBox()
    {
        if (dialogueBoxOn == 1)
        {
            spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.NonPremultiplied, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Matrix.CreateScale(GameGlobals.zoom));
            spriteBatch.Draw(dialogBoxChara, new Vector2(89, 18), Color.White);
            spriteBatch.Draw(dialogBoxTexture, new Vector2(0, 108), Color.White);
            spriteBatch.DrawString(font, "àéùaDASASCZadhkjashdash", new Vector2(4, 108), Color.White);
            spriteBatch.End();
        }
    }

This happens:

This code is supposed to show the character, the textBox itself and the text. But the text isn't drawn correctly. If I comment one of the draw lines, it works.

Or this (if I only comment the character line)

Any ideas of what is happening here? I thought it was some SpriteBatch limitations, but I don't know...
EDIT: After following @Jon advice, i've reached this state

Now it shows the character and dialog properly, but the background and the walls are not displayed now. I have all the walls like this:
spriteBatch.Draw(leftcenterright4, new Vector2(0, 53), null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0.5f);

And the background
spriteBatch.Draw(background, new Vector2(0, 0), null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 1f);

And the code from earlier fixed:
spriteBatch.Draw(dialogBoxChara, new Vector2(89, 18),null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0f);
spriteBatch.Draw(dialogBoxTexture, new Vector2(0, 108),null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0.1f);
spriteBatch.DrawString(font, "àéùaDASASCZadhkjashdash", new Vector2(4, 108), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0f);

Somehow I've managed to solve this. With the help of @Jon. What I did, first, set all the layerdepth acordingly, after that, I've tried to change the resolution multiplier of my game to 1, and...It was working. Now it seems I've been causing the problem by trying to make zoom directly and not with RenderTarget2D. I will try to learn how to use that.

cool looking game btw.

Thanks @Jon. Also, I've finally get it to work as intended. With Jon's help here and on monogame forums. http://community.monogame.net/t/scaling-zooming-game-window/7824/16 I'll leave the link here, maybe will need it sometime.

Use an override of the SpriteBatch.Draw() function in order to specify what layer you want to draw your sprites on.  You are already specifying "FrontToBack" sort mode in your initialization so that is good.
Take a look here:  https://msdn.microsoft.com/en-us/library/ff433988.aspx
More specifically, take a look at the "layerDepth" property.  This is what you are looking for.  Set this according to the order you want to draw your sprites on.
spriteBatch.Draw (texture, position, null, color, 0, Vector2.Zero, 1, SpriteEffects.None. 0.5f);

spriteBatch.Draw(dialogBoxChara, new Vector2(89, 18),null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0.5f); I've tried this on the character, but the sprite isn't showing now.

Do this for all your draw calls,making sure you set that float value for the layerdepth accordingly

I can't get it to work. I've also tried in a new window with only one sprite, and to no avail. spriteBatch.Draw(mainMenuIndexSpr, new Vector2(89, 18), null, Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, -100000f); I've tried diferent values for "layerdepth".

the layerdepth value must be between 0.0f, and 1.0f

Ah, haha, true. 0 is the farthest or nearest?

Directly from the link I posted...  "The depth of a layer. By default, 0 represents the front layer and 1 represents a back layer. Use SpriteSortMode if you want sprites to be sorted during drawing."

Main post updated with the new issues.


text:
Can't get to work Spritefonts on monogame 3.5(using Visual Studio 2015 Comunity)
I've been trying to get to work spritefonts, but to no avail. I've added the pipefont to the Pipeline

but when I try to load it, it shows this error here

Here it is the spritefont content
<?xml version="1.0" encoding="utf-8"?>

<!--
Modify this string to change the font that will be imported.
-->
<FontName>Arial</FontName>

<!--
Size is a float value, measured in points. Modify this value to change
the size of the font.
-->
<Size>12</Size>

<!--
Spacing is a float value, measured in pixels. Modify this value to change
the amount of spacing in between characters.
-->
<Spacing>0</Spacing>

<!--
UseKerning controls the layout of the font. If this value is true, kerning information
will be used when placing characters.
-->
<UseKerning>true</UseKerning>

<!--
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
and "Bold, Italic", and are case sensitive.
-->
<Style>Regular</Style>

<!--
If you uncomment this line, the default character will be substituted if you draw
or measure text that contains characters which were not included in the font.
-->
<!-- <DefaultCharacter>*</DefaultCharacter> -->

<!--
CharacterRegions control what letters are available in the font. Every
character from Start to End will be built and made available for drawing. The
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
character set. The characters are ordered according to the Unicode standard.
See the documentation for more information.
-->
<CharacterRegions>
  <CharacterRegion>
    <Start> </Start>
    <End>~</End>
  </CharacterRegion>
</CharacterRegions>

Any ideas?

To be honest I don't really use SpriteFont's myself. I prefer to generate BitmapFont's using BMFont and importing them in with MonoGame.Extended (I'm the creator of that library).
That said, I think I can see the issue pretty quickly. You haven't got an importer or processor set in the Pipeline tool.
When I add a sprite font to the Pipeline the properties window looks like this:

As you can see, the Build Action is set to Build and the importer and processor is also set. This happens by default when you add a new spritefont within the tool.
If you right click the root Content node in the tree and select Add => New Item...
You should see a window like this:

That'll generate a new SpriteFont file and you can open it up in a text editor to change the font. Here's what it looks like on my machine:
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
  <Asset Type="Graphics:FontDescription">

    <!--
    Modify this string to change the font that will be imported.
    -->
    <FontName>Arial</FontName>

    <!--
    Size is a float value, measured in points. Modify this value to change
    the size of the font.
    -->
    <Size>12</Size>

    <!--
    Spacing is a float value, measured in pixels. Modify this value to change
    the amount of spacing in between characters.
    -->
    <Spacing>0</Spacing>

    <!--
    UseKerning controls the layout of the font. If this value is true, kerning information
    will be used when placing characters.
    -->
    <UseKerning>true</UseKerning>

    <!--
    Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
    and "Bold, Italic", and are case sensitive.
    -->
    <Style>Regular</Style>

    <!--
    If you uncomment this line, the default character will be substituted if you draw
    or measure text that contains characters which were not included in the font.
    -->
    <!-- <DefaultCharacter>*</DefaultCharacter> -->

    <!--
    CharacterRegions control what letters are available in the font. Every
    character from Start to End will be built and made available for drawing. The
    default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
    character set. The characters are ordered according to the Unicode standard.
    See the documentation for more information.
    -->
    <CharacterRegions>
      <CharacterRegion>
    <Start> </Start>
    <End>~</End>
      </CharacterRegion>
    </CharacterRegions>
  </Asset>
</XnaContent>

I hope that helps. Good luck :)

O man, thank you! Yes, it was that the spritefont wasn't set to build (it seems I misunderstood the tutorial I was doing). I will look "Monogame.Extended", maybe that will help me in many ways.


text:
Should I load scenes from files, or hard code them?
In a game engine I'm working on, I'm using scenes similar to what you would find in Unity. The entities, in my game, are composed of reusable components and custom data which is linked to those components. Entities have children, and one parent. This is shown, below:
class Entity {
    ...custom data here...
    let parent : Component
    var children : [Component] = []
    var components : [Component] = []

    ...methods...
}

If the entities did not have custom data, then creating a scene would be described by the following steps:

Loading a file into memory.
Creating a tree of entities.
Adding components to them, with parameters listed in the file.

However, this does not leave room for custom data. My other alternative is to create a scene by creating a scene object, then hard-coding the entities in. It would look something a bit like this:
var opening_scene = Scene()

opening_scene.addEntity(Player())
opening_scene.addEntity(Car())
opening_scene.addEntity(Terrain())
...

The downside to this is that everything is hard coded. What can I do to create scenes in a game more efficiently?

Game Coding Complete book addressing exactly this problem,where the engine architecture is entity component data driven,so in chapter 6 "Game Actors and Component Architecture" where here "Actor" is the same as entity,the writer says:
"All actors are defined with an XML data file. This data file allows you to def
component configuration and any default values for that component. Here’s s
sample XML for an actor......Keep in mind that these actor XML files define the template for a type of actor, not
specific actor instance. There can be many instances of this actor running around, each
with completely different sets of data within their components. The XML file onl
defines the definition. You can think of it as defining a class for this type of actor."
then he create a factory method to create all components at runtime , the book is full explanatory for all areas of game engine programming and it contains full engine source , and a game


text:
OpenGL 3.3 Core Compatibility with OpenGL 4.x
Are all OpenGL calls in 3.3 Core and GLSL 330 core shaders valid and functionally equivalent in OpenGL 4.0 through 4.5 core?
I can't seem to find a clear and definitive answer; both in specification and the real world, is code written for 3.3 core going to function in a 4.5 core context? I've currently kept all of my OpenGL renderer code strictly to 3.3 core profile, but I'd like to take advantage of some features that are only available in 4.0+ and 4.4+ if the user's environment supports those contexts. The change-logs of OpenGL seem fairly simple and it doesn't look like anything in 3.3 core has been deprecated in 4.
Are there new requirements OpenGL 4.0 or 4.4 that makes 3.3 core code used in conjunction with new features like tessellation shaders incompatible?

Code written for core 3.3 should be fully compatible with a 4.5 core profile. This can be seen from the OpenGL 4.1 and 4.5 specifications, which note features deprecated in each version (see appendices J and K in the first, and appendices E through H in the second). The only features which have been deprecated since the 3.3 specification are "the pixel pack parameters UNPACK_LSB_FIRST and PACK_LSB_FIRST" (deprecated in OpenGL 4.3). However, these calls are still available as of 4.5 and therefore compatibility is maintained.
As to whether there are quirks with switching the target GL version not obvious from the specification, I can't say. Strictly speaking though, you shouldn't encounter any issues.
For reference, all OpenGL specifications are available via the OpenGL Registry.

By "deprecated or removed" do you mean a call that was deprecated before 3.3 Core? I'm not using any libraries of indirection to OpenGL, I'm talking about an entire codebase of calls strictly complying to OpenGL 3.3 Core specification, I'm asking if all valid OpenGL 3.3 Core code is directly valid in OpenGL 4.0 and 4.4 Core by specification and in real-world driver implementations from Nvidia, AMD, and Intel.

I've rewritten my answer - it should answer your question a bit better now.


text:
Unity's Animator.GetBehaviour<T> always returning null
I have the following line:

As you can see "transitionOutAnimator" is null before the line runs. transitionOutAnimator is a StateMachineBehaviour of type ThoughtBubbleTransitionOutAnimator.
We can check that the StateMachineBehaviour of the correct type is actually stored in the run time animator:

Yet when the line runs:

Am I doing something obviously wrong? Is this a bug? I have another identical instance in the code where I do this, and it works perfectly.
EDIT: Immediate window:

EDIT: This is still a problem as of Unity 5.3.5f1.

You don't happen to have another class with the same name do you? Perhaps try including the full namespace path in your type specification. Also +1 for using the debugger to investigate this already.

@Byte56 Nah, that's not the case unfortunately.

I'd try it in the immediate window as well. Just to make sure it's getting the behavior from where you think it's supposed to.

@Byte56 Edited with immediate window output. Is that what you suggested? I've never used the immediate window before.

Looks more like the method isn't supported via immediate execution, instead of being a lead for what's happening with your code. Next thing I'd try is a rebuild.

@Byte56 Yeah a rebuild didn't help. I'll try updating to the latest version of Unity.

I figured out what was causing this issue. The game object that held the animator component was disabled initially. Having the game object enabled initially fixed the issue, and the behaviour reference was able to be accessed through GetBehaviour.
Why Unity does this is unclear to me. If this is intended, then hopefully they reflect it in their documentation in the future, at the least.

Yet they still haven't documented anything more. I have a null issue as well and my objects are enabled at start.

The difference being I programmatically set the controller at Runtime.


text:
How to color individual parts of curve in unity, real time?
So I have a mesh curve that I've imported from Blender. What I want to do is to place individual points on the curve (at fixed distance) and then based on a specific number, color them.
Let's say for instance number 1000 is color red and number 10 is color blue (based on color gradient). These numbers get updated real time, so I want my color to get updated real time.
I have no idea how to approach this problem. I've looked up some ideas but couldn't find anything useful.
Please help!
Thank you

What have you tried? Does your mesh have UV coordinates generated? Have you looked at modifying the vertex colors?

How are you placing the points?  If they are unity prefabs, you could just update their color in the update() by having some variable that it reads from.


text:
Inconsistent read violation when using game state machine
I am getting some very inconsistent read violation errors with my FSM. It is very hard to reproduce but it always happens when the FSM is switching between states. It breaks at this block:
void MenuState::update()
{
    for (int i = 0; i < m_gameObjects.size(); i++)
   {
        assert(m_gameObjects[i] != NULL); //the program breaks at this line
        m_gameObjects[i]->update();
   }
}

It's very strange because it occurs right when I am switching from my "MenuState" to my "PlayState". Using console outputs, I know for I fact that the state is changed to the PlayState, but the FSM still calls the update function from the MenuState.
void GameStateMachine::changeState(GameState *pState)
{
if (!m_gameStates.empty())
{
    if (m_gameStates.back()->getStateID() == pState->getStateID())
    {
        return;
    }
    if (m_gameStates.back()->onExit())
    {
        delete m_gameStates.back();
        m_gameStates.pop_back();
    }
}

m_gameStates.push_back(pState);
m_gameStates.back()->onEnter();
}

Change state when button is pressed:
if (InputHandler::Instance()->getMouseButtonState(LEFT) && m_bReleased)
{
    m_currentFrame = CLICKED;

    m_callback(); //this callback calls the FSM changeState member

    m_bReleased = false;
}

I've looked all through my code and I can't find the error, and this error only occurs 10% of the time I change states, which makes this whole thing even more confusing. Any tips or advice would be much appreciated.

The actual code causing the problem isn't present here. Just look for code that assigns into the m_gameObjects vector. If that fails, use your debugger and set a data breakpoint so you can catch the exact line that nulls out the element.

I think the problem ended up being in the update loop. Even though the state was changed the loop would run through another iteration and would attempt to access "m_gameObjects" even though it was deleted when the state was changed. What I ended up doing was checking if "m_GameObjects" was NULL, and if so break out of the loop.

nevermind, this didn't work since the debugger says that m_gameObjects's size is huge so I'm not sure what's going on

@michael You code is incomplete, but I assume m_gameObjects is a std::vector. A vector suddenly getting a nonsensical size is often caused by an invalid write that trampled its storage. Try to find the exact point at which the size blows up.

Use the debugger to inspect the values inside the vector, if they don't make sense, it's probably because the menustate got deleted. Then inspect the stack trace to see why it's even called while it should not.

The problem was that the loop continued to iterate even though the state was deleted, causing the read violation. I "solved" this by having a Boolean which holds if the state is the current state before updating. Do you think this is a legitimate solution?


text:
Algorithm for spacing points out among a line
I'm writing an angled tile system, and my implementation is to have a starting height and an ending height inside the tile.
Like so:

The starting and ending height allow me to get the length of the angle and the angle in degrees using atan2.
For collision against the angled tiles I give the tiles a collection of points along the line, and as a bounding box intersects any of a tile's slope points it will move the box's y position to that point.
This implementation works fine for 45 degree tiles, however with other degrees I don't know how to create the points on the line.
What algorithm could I use to space the points out along the line when they are not in a perfect 1 to 1 ratio angle? (e.g. 17 degrees instead of a nice 45 degrees)
EDIT: Here's a way to interpret my question perhaps more academically:
Given a length of a line and its angle, and an arbitrary number of points, find an algorithm that will space the points out among the line that will as closely resemble the angle.

Are you maybe looking for this line drawing algorithm?

@samhocevar YES! Exactly what I'm looking for!

My solution, using the Brensenham algorithm as suggested by Sam Hocevar:
public static Point[] brensenham(Point p1, Point p2) {
        final ArrayList<Point> points = new ArrayList<Point>();

        // BRENSENHAM the line across
        final int dx =  abs(p2.x-p1.x), sx = p1.x<p2.x ? 1 : -1;
        final int dy = -abs(p2.y-p1.y), sy = p1.y<p2.y ? 1 : -1;
        int err = dx+dy, e2; /* error value e_xy */

        while(true){
            points.add(new Point(p1.x, p1.y));
            if (p1.x==p2.x && p1.y==p2.y) break;
            e2 = 2*err;
            if (e2 >= dy) { err += dy; p1.x += sx; } /* e_xy+e_x > 0 */
            if (e2 <= dx) { err += dx; p1.y += sy; } /* e_xy+e_y < 0 */
        }

        return points.toArray(new Point[points.size()]);
    }

This returns a PERFECTLY spaced out line of points, with the perfect number of points in integer coordinates that most similates the original angle between the starting points.
Hope this can help anyone else, it made for a very easy angled tile system!

To space points on a line can be done several ways.
Where the line is defined with
x1 = ?  // line start
y1 = ?
x2 = ?  // line end
y2 = ?

To get a point on the line via a fraction of the line length
pointAt = ? // 0 to 1 are on the line
            // less than 0 is before the line greater than 1 is after the line

px = (x2-x1) * pointAt + x1;
py = (y2-y1) * pointAt + y1;

To get a point a set distance along the line get the normalized vector of the line
distOnLine = ?
nx = x2-x1
ny = y2-y1
lengthOfLine = sqrt(nx * nx + ny * ny)
if(lengthOfLine > 0){ // make sure the line has length
   nx /= lengthOfLine // normalise the vector
   ny /= lengthOfLine
   px = x1 + nx * distOnLine
   py = y1 + ny * distOnLine
}

To get points on the line a specific x coordinates find the slope of the line in terms of x
findPointForX = ?
if(x1 !== x2){ // make sure the line is not vertical
    slope = (y2-y1)/(x2-x1)
    px = findPointForX
    py = (findPointForX - x1) * slope + y1
}

For y just swap x for y in the above
Think that covers most of the situations. If you want to divide a line into equal segments use the first method and set the fraction as multiples of 1/steps.
If you want a  point on a line at an angle
distOnLine = ? // where on the line in pixels
x1 = ?  // the line start
y1 = ?
angle = ?  // the angle in radians

px = cos(angle) * distOnLine + x1
py = sin(angle) * distOnLine + y1

To convert to radians from deg
rad = deg / (180 / PI) // where PI is 3.1415....

This only works if I know what fractions I should set each point at, which I do not. This is what I am asking to find out. How to find the fractions of each point, to make the line as closely resemble the desired angle as possible.

@MitchWeaver Sorry did not get that will update the anser


text:
Does the age of test users matter?
Does the age of test users matter? Should I get users that are around my intended age level, knowing that some games are played by younger or older people than were originally intended? Should I have my test users be all around the same age for consistency, or a variety of ages to gather more useful data?

Testers don't grow on trees :-). Few game coders have the luxuary of accepting or rejecting testers. Additionally, it is not at all easy to keep them for a longer period of time than maybe a few months, at most. Those who are really dedicated, of some specific reason probably, may become lifetime helpers and even friends, but most of the testers will simply disappear over time.
If you have a really good, fancy, challenging game, or a series of games, you may get such amounts of interested people that you can make choices.
Otherwise take'em all. You get all kinds of input, and it is good that way. You are yourself the one who give emphasis on different input, depending on the quality of it. You will learn to read between the lines and recognize the nicknames, the kids, the old dogs, the musicians, the technocrats. And remember to make it public. Nobody wants to chat with you alone... or very few want to.
Do not invoke testers too early - nobody gets happy of crashing and incomplete software. It must be interesting, challenging and you must create the hype factor, and even harder, keep it. Let them shine!
So take it all with whatever means you have handy, and filter the input you get.
(If you aim to pay, for eg. Lithuanian testers, it is a totally different thing. They are good and they cost money)
5 cents :-)

It depends on what you want to test.
When you want to test user acceptance and behaviour, you should of course test within your desired demographic. People from a different demographic might give you different results and mislead you about the strengths and weaknesses of your product.
But when you want to test for bugs, you need professional testers who thoroughly test all the edge-cases of your game, systematically looks for bugs, find out how to reproduce bugs they find and then write useful bug reports which contain all the information you need to fix them. This is not how a normal player plays and experiences your game. Feedback about the gameplay itself is of course welcome, but it's not what you expect from these testers. Their feedback is also not very useful, because they are testing the game and not playing it. That's a completely different perspective. So it does not matter which demographic these testers fall under.

I think if you have a target demographic in mind, you should focus on that demographic for your playtesting (that would apply to age, gender, country of origin, income, and any other demographics).
If you're looking to feel out exactly who will enjoy your game, then getting your game into the hands of as many users from all demographics as possible would be a good idea.

Usually, for a game testing, you should look for experienced players, with a good eye to spot errors or bugs in your game. People with lots of experience playing videogames will spot these things better than people who don't know much about games. Plus, if the testers happen to know something about videogames developing or game logic, can help you out pointing out technical issues and hints on where to fix bugs.
But, if what you're aiming at making a demography study (finding out which crowd you'll aim your marketing at, or what population likes your game the most, etc) then it is recommended that you get as diverse people as you can, because this will give you nice data to work on.

I think you should gather test users which are all different ages. Most of Studies are made this way and (as you already said) you gather more useful data.

Depending on jurisdiction & age, you may be subject to certain laws regarding minors, I.E. the Children's Online Privacy Protection Act in the USA might cover online / remote testing by children under 13 years of age. If you plan on testing with minors, consult a lawyer.


text:
Publishing an XNA project on Windows Store
I have made an application in XNA that I want to sell on Windows Store. When it comes to uploading in the Windows Store dashboard it says files need to be in the format xap, .appx, .appxbundle or .appxupload but I can't figure out how to create these files.
The best information I could find is https://msdn.microsoft.com/en-us/library/hh454036.aspx but I don't have "Store" in my Project menu. I am using Visual Studio 2015 and XNA 4.0.5

You might try rewriting your game as a native C++/DirectX Universal Windows Platform (UWP) project. Or you could wait for the Win32 wrapper Microsoft is working on yo be finished. Applications found on te store no longer have the .exe format. The targeted the UWP API and not the old Win32 API.

XNA games aren't directly support in the Windows Store. The "appx" file types are generated when building a Windows Store app (it's one of the project options when you are creating a new project). As "rlam12" mentioned in his comment, there is a Win32 wrapper being worked on that can take a regular .exe and convert it into a Windows Store app. However, this won't be out for some time.
If you want to avoid re-writing your game from scratch into C++/DirectX, you could look into using MonoGame and then build a Windows Store MonoGame project. MonoGame is basically the open source version of XNA from when it stopped development back several years ago. I haven't used MonoGame is a long time, but it should hopefully not be a difficult transition. Here's a link to a short tutorial on how to get started with MonoGame and Windows 10 Store App development:
http://www.codeproject.com/Tips/1015929/XNA-Basics-Windows-and-MonoGame

It is a little iconic that you need to use the open source alternative to publish on Windows Store.

Since XNA hasn't been supported for almost 5+ years, it's not horribly unreasonable. I'm glad MonoGame has come to fill the void of XNA, but it is unfortunate that it has been dropped in favor of things like Unity.

XNA Game Studio has a number of limitations that make it unsuited to both the Universal Windows Platform (UWP), Xbox One, and the Windows 8 Store: It uses Direct3D 9 (unsupported), D3DX9 (deprecated), is x86 32-bit only (i.e. no x64 native or ARM), and a number of other technical issues. Monogame, SharpDX/SlimDX, Unity, etc. have all stepped in to fully support C#-based DirectX game development years ago. The ability to support non-Microsoft platforms is also a benefit these alternative solutions provide that XNA Game Studio cannot.


text:
Best way of approach? Mob moving around a section of tiles
Think the beginning stages of Metroid, where there would be a turtle-like mob that would move around a section of tiles, normally 1-3 in a line.
What would be the best approach to accomplish this sort of AI?
It seems so simple but its giving me headache.
The solution I've found have been to have a fixed distance for it to move, and changing directions once the distance has been met. This isn't that OOP though.
Another would be have a rectangle made of the section of tiles, and when the bounds of the mob no longer contains the line of rectangle, change directions. This is proving to be harder to implement and only works for rectangular sections, not for abstract "tetris" like sections of tiles.

Found an easy way of doing it, after having troubles with getting smooth movement under milk's suggestion. Here's the source, (python / jython):
s == the mob, and territory == its rectangular "home" area.
The +1's and +2's I added to some corners to make it look better as it was a bit "snappy".
fullBounds = s.getFullBounds()
rightBounds = s.getRightBounds()
leftBounds = s.getLeftBounds()
topBounds = s.getTopBounds()
bottomBounds = s.getBottomBounds()

top = s.territory.getTop()
right = s.territory.getRight()
left = s.territory.getLeft()
bottom = s.territory.getBottom()

if s.clockWise:
    if fullBounds.intersects(right) and not fullBounds.intersects(bottom):
        s.setVelocity(0, speed)
        s.setX(s.territory.pos.x + s.territory.getWidth())
        s.setY(restrict(s.getY(), s.territory.getY() - 2))
    elif fullBounds.intersects(top):
        s.setVelocity(speed, 0)
        s.setY(s.territory.pos.y - s.HEIGHT)
        s.setX(restrict(s.getX(), s.territory.getX() - 1))

    if fullBounds.intersects(left) and not fullBounds.intersects(top) and not topBounds.intersects(bottom):
        s.setVelocity(0, -speed)
        s.setX(s.territory.pos.x - s.HEIGHT)
    elif fullBounds.intersects(bottom):
        s.setVelocity(-speed, 0)
        s.setY(s.territory.pos.y + 2 + s.HEIGHT)

elif not s.clockWise:
    if fullBounds.intersects(right) and not fullBounds.intersects(top):
        s.setVelocity(0, -speed)
        s.setX(s.territory.pos.x + s.territory.getWidth())
        s.setY(restrict(s.getY(), s.territory.getY() - 2))
    elif fullBounds.intersects(top) and not fullBounds.intersects(left):
        s.setVelocity(-speed, 0)
        s.setY(s.territory.pos.y - s.HEIGHT)

    if fullBounds.intersects(bottom) and not fullBounds.intersects(right):
        s.setVelocity(speed, 0)
        s.setY(s.territory.pos.y + s.HEIGHT + 2)
    elif fullBounds.intersects(left):
        s.setVelocity(0, speed)
        s.setX(s.territory.pos.x - s.HEIGHT)

You want to patrol between different locations, so you could just create a list of locations to visit in order (so you would have two locations for a move back and forth behavior). Once your actor has visited each location she can start over and return to the first location (or you could visit the locations in reverse order, or stop, or whatever).
For arbitrary shaped patrols like you mention in the last paragraph, you can just add more locations to visit on the patrol (eg- (0,0) -> (5,0) -> (5,5) to create an L-shaped patrol).
Some pseudo-code for this kind of behavior:
class Patroller
{
    private List<Location> _locationsToVisit;

    private int _nextLocationIndex;

    public void Update()
    {
        // Visit each location
        var nextLocation = _locationsToVisit[_nextLocationIndex];
        MoveToward(nextLocation);

        if (IsAt(nextLocation))
        {
            _nextLocationIndex++;
            // If visited each location, then set the next as the first location.
            // Alternately you could start visiting the locations in reverse order
            if (_nextLocationIndex >= _locationsToVisit.Count)
            {
                _nextLocationIndex = 0;
            }
        }
    }
}

Thanks! This looks much easier than worrying about intersection of lines and rectangles hahaaha


text:
Generate camera shakes in Java
How would one of these work?
(If you don't know what I'm talking about, think like in a game where you shoot a big gun, and your screen bounces in the opposite direction.)
I've been experimenting with a couple different ideas but none are either fully working, or fully smooth.
Using this function for setting the camera position:
x = -target.x + halfScreenW;
y = -target.y + halfScreenH;

One problem I've run into is when setting the camera to move a certain distance in a direction, it will reach its target X or Y before the other, causing it to go travel in a straight line for a short while. I believe the solution to this is using the Bresenham line algorithm?
What would be the best way to achieve a camera shake?
edit: Related - Realistic Camera/Screen Shake from Explosion

Also related, possibly duplicate?

Also, check out Juicing Your Cameras With Math from the Game Developer's Conference. (And the sister website Math For Game Developers). In it, they explain a lot of the subtleties of camera shake.

you shoot a big gun, and your screen bounces in the opposite direction That's called recoil.

A favorite way to apply camera shake in 2D (or 3D) is to attach the camera's origin to a physics particle, then to attach the physics particle to the focus of the scene with a heavily-damped spring. This allows for adding variable camera shake quite easily, in any direction you want, by adding momentary acceleration (a poke) to the camera's physics particle. As an added bonus, the inertia of the camera will make it move differently in response to a moving focus, which can make acceleration of the focus feel a lot cooler.

This sounds like something engine-specific, as you don't really define what a "physics particle" is. Essentially a point in space such as the camera's (x,y) would be a "particle", yes?

Yep- all you need for the particle is a velocity vector and a position vector, and all you need for the spring is quick implementation of the formula F=-kX*0.99^|X| where k is a constant for how strong the spring is (probably pretty low- 0.05 would be a good place to start), X is the displacement vector (the difference of the camera's particle and the focus), |X| is the magnitude of the displacement vector, and F is the acceleration to apply to the particle. The code for this is pretty simple- I might post an example later.

Sounds like a good idea to me. And simple, as stated. Suggest OP gets the "spring effect" working in 1D first, then progress to using 3D vectors. Plain sailing thereafter.


text:
Is 3d game development advantageous/possible in SDL2?
I think this is not appropriate, but as the given video in the link, the youtuber name Bisqwit creates his own 3d engine from scratch in C and SDL2. How much is this advantageous is real 3d game development and following his idea can a first practice project? (rather than just starting with OpenGL)?
https://www.youtube.com/watch?v=HQYsFshbkYw

His software 3D engine seems to be made for practice. It's too slow (because it lacks hardware acceleration) for any decent graphics. You should take SDL+OpenGL.

Your question needs re-phrasing. SDL and OPENGL are two different technologies so to speak. Also, this question will lead to opinions instead of facts
Wikipedia says:
Simple DirectMedia Layer (SDL) is a cross-platform software development library designed to provide a low level hardware abstraction layer to computer multimedia hardware components.
Open Graphics Library (OPENGL) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics.
You do not just start with OPENGL and create a game. The workflow for creating a game using OpenGl is as follows:
1- Create a window on your platform of choice. For Windows this will be with, in my case SDL, SFML or GLFW. These are also available on Mac, Linux, IOS and Android with the exception of GLFW. GLFW does not support mobile platforms last i checked.
2- Create an OPENGL context that you can render to. This step depends on your Language choice. In C++ you get these out of the box for SDL, SFML and GLFW. In C# you need another tool like The Tao framework.
3- Call OpenGL functions and render vertices.
These steps are only three but doing all this and learning the tools will take you months even if you are a seasoned developer.
So, you can use SDL for Window creation, handling input, object loading and networking(I left out some). You will need the features that SDl provides to even draw a triangle on screen. You can use GLFW, SFML,GLUT or other similar tools out there but you have to start here. You can make do without these tools but creating a window in C++ on windows in my case is not an easy task.
Checking the SDL home page tells me that Half Life 2 was made with SDL. I also read somewhere that World of Warcraft most likely uses SDL. (Here similar qeustion about game engines). That question and specifically the second answer should address a lot of follow up questions that you will have.
Looking at how you asked your question I would have to make the assumption that you have never made a game at all. Your question is aimed at the lowest level of game development, graphics programming. I would suggest you go with a 2D framework first and make Breakout, Tetris, Snake clones. A non exhaustive list is SFML, SDL2, Monogame, XNA. Making something this simple will teach you a lot.
If your target is 3D graphics then go for Unreal, Unity, Torque, NeoAxis, JMonkeyEngine, Panda3D, Irrlicht. Stay away from Ogre unless you really know what you are doing. All the frameworks and engines I listed have bindings/wrappers for multiple languages.
TLDR: You will need SDL, SFML, GLFW or GLUT and other similar(Google them) frameworks to create a window first. Then setup an OPENGL context before you can draw vertices.


text:
Allowing one sprite to move through another in Quintus
I have a Bumper class extended from Sprite:
Q.Sprite.extend("Bumper", {

    init: function(p) {
        this._super(p, {gravity: 0});
        this.add("2d, ... //etc.
}

I have an Enemy class that should trigger a function when the center of the Bumper and of the Enemy collide.
I was thinking about doing something like this in my Enemy class :
this.on("bump.top, bump.bottom, bump.left, bump.right", function(collision) {
    if(collision.obj.isA("Bumper")) {
        if (this.p.x == collision.obj.p.x && this.p.y == collision.obj.p.y) {
        //Do something
        }
    }
});

But for that I need the two sprites to move through one another. Is there a way to do that while still checking for collision ?


text:
Elements of uniform array are always zero?
I'm building a shader program to render a simple bitmap font in GLSL.
My programming environment is C# so I'm using OpenTK to encapsulate OpenGL 4.0, but the syntax is very similar to any examples in C and C++.
My issue is that I'm trying to pass an array of integers to the fragment shader, but whenever I do, all the array elements end up being zero. The integers should range between 0 and 255 and I've checked the values before and after sending them. It's infuriating.
Currently I'm binding my program, then attempting to send the int[] array to the shader using the following instructions:
int[] ints = new int[] { 33, 34, 35, 36, 37, 38, 39, 40 };
GL.UseProgram(programLocation);
GL.Uniform1(arrayLocation, ints.Length, ints);

My fragment shader takes the array and uses a couple of functions to determine which part of the quad to place which characters. I've tested these functions with static numbers and arrays I build manually in the shader and they work just as I'd expect them to. For some reason the syntax above simply doesn't actually end up sending any data - all elements evaluate to 0.
In my shader, the array is denoted and used like this:
uniform int characters[8];
....
gl_FragColor = texture2D(bitmapFontTex, GetBitmapFontStart(characters[0...8etc]));

The rest of my code seems to work when tested in isolation - it only falls apart when it comes together, and the above code blocks are where it comes together. Have I made some silly rookie mistake, or is there something more screwy happening? Any help greatly appreciated.

I'm not familiar with OpenTK. Make sure you use a correct function to set the uniform and also check if arrayLocation is right

Well, all of my location data is correct so far as I've seen in testing - and I can set each element of the array separately using "characters[0...8]" as the uniform name - I just can't set the whole array at once. Besides that, if I set them all separately, then iterate over the array, technically I'm not accessing the same uniform because "characters[0]" has its own location, as does "characters[1]" and so on. This is all giving me a headache.

Does OpenTK have an glUniform1iv() method? I've never done anything with it before but syntax-wise this would be the one you need.

@cozmic In OpenTK, all of the glUniform1 methods are encapsulated into a single overloaded method. Their invocations change but they carry the same name. I'll have a look, but as far as I know this is the only one: http://i.imgur.com/GFIk6OD.png

Looks like you are using the wrong function, need to use uniform1i instead.
https://www.opengl.org/sdk/docs/man/html/glUniform.xhtml

glUniform1i and glUniform1iv are the only two functions that may be
  used to load uniform variables defined as sampler types. Loading
  samplers with any other function will result in a GL_INVALID_OPERATION
  error.
If count is greater than 1 and the indicated uniform variable is not
  an array, a GL_INVALID_OPERATION error is generated and the specified
  uniform variable will remain unchanged.
Other than the preceding exceptions, if the type and size of the
  uniform variable as defined in the shader do not match the type and
  size specified in the name of the command used to load its value, a
  GL_INVALID_OPERATION error will be generated and the specified uniform
  variable will remain unchanged.
If location is a value other than -1 and it does not represent a valid
  uniform variable location in the current program object, an error will
  be generated, and no changes will be made to the uniform variable
  storage of the current program object. If location is equal to -1, the
  data passed in will be silently ignored and the specified uniform
  variable will not be changed.

Thanks for taking the time to answer.This is one of the few points where the OpenTK and OpenGL method calls differ slightly. In OpenTK, all glUniform1x calls are wrapped into one overloaded method that can take various types (such as float and int).
They looks something like this http://i.imgur.com/GFIk6OD.png .


text:
Maya - How to clean combine mesh history?
I've combined a load of meshes using Mesh > Combine. Each mesh was already skinned to my rig. The combine worked ok and the rig / skinning is fine. However I'm left with a bunch of transform nodes:

If I delete history on the newly combined object these nodes are deleted but the skin becomes unbound. If I delete them manually the skin also becomes unbound and the materials disappear from the model. If I export (to Unity) all of these transforms are included, even if I just export a selection of the skeleton & mesh.
How can I get rid of these transform nodes and keep my skinned rig? I've searched online & in the help files and have tried various things for two days now without success.
I'm using Maya LT 2016 SP 4 Ext 3.
Many thanks

You need to do a selective history wipe. Take a look in one of the node editor (Or hypergraph or hypershade by preference or for older mayas) and graph the history of your object. You should be able to locate merge node(s). If your lucky this goes directly to your shape node or a tweak node. If not you need to create one and connect the merge to in mesh of merges and into rest of your history. Then delete the in history of that container and you should be free to delete the transforms and merge nodes.
Now it is very hard to be specific as I am not in front of your maya and can not see your total history. I admit that this is a bit involved.
A second thing that you may try instead of the wipe, is marking the transforms as intermediate nodes this should hide them from the outliner. Most probably your exporter will also ignore these nodes as part of unbaked history, but you never know Im not so knowledgeable about the unity exporter importer chain. Now that i think of it, this might be the easiest option.
And finally a third option. Detach your bones from the history and bake the weights down. Then delete history and reattach the bones. There are quite many tools to do this floating around as its one of those basic tricks for many rig builders. But obviously if you had some other animation nodes than just bones you would lose those. But again this might be easier than the history wipe altough it is also somewhat involved.

Thanks. I started to explore the first option after reading more about nodes (which was useful) but realised after a while it would take ages! Couldn't find how to mark a node as intermediate to try the second - can you explain that please? In the end I went back to an earlier file and turned off construction history before doing the merge which solved everything. I'll still mark as an answer though for the useful tips.

@Absinthe Im on Vacatiob right now so i cant check but you need to set the attribute intermediate to yrue in mel or python since there is no GUI for it.


text:
What to do with empty space?
On the game I am developing, I have a very small amount of left-over space on each level screen (but on no other screens.) It is a little less than 5 millimeters (~1/5in) on the left side and bottom. It is caused by the size of blocks, etc. and a few other factors. I could center the level, but still then there would still be dead space. By the way, the player cannot go past the edge of the screen or into the whitespace, so having the level appear to extend past the screen would be misleading. What should I do?

Assuming you don't want black bars, is there any reason you don't just fill the screen with your level and present an in-game barrier (e.g. wall) to the player? It would probably look more natural than a superficial border serving no purpose.

Center the level and then use the remaining pixels to add a decorative border which fits the style of your game interface.
You could also leave it black. Most screens have a black border anyway, so most people won't notice when it's a tiny bit wider than usual.

Great idea, but what should I use for a border? My game UI is 8-bit, and I would only have around .8 of a pixel to use. Should I use a smaller pixel size? I don't know what to do from here.

@programmer5000 That's a graphic design question which is hard to answer without actually seeing a screenshot of your user interface. And even then it would be a matter of personal taste. As I wrote, when in doubt just leave it black.

'Towerfall Ascension' is a good example for thematic filling of border space in 8 bit aesthetic: ( no images in comments so: http://indiegames.com/2014/03/12/ThornwoodQuest.jpg or use Google image search for "Towerfall Ascension").

@Felsir Love that art style! Great reference.

@Felsir thanks, but I have only a very small amount of dead space. Thanks anyways.


text:
Can my game be 8-bit even though it has hi-res text?

My game has 8-bit sounds, 8-bit graphics, 8-bit everything. Except one thing: the level selection screen. It has small text and therefore must be hi-res to be readable. What should I do?
Edit: The arrows on either side of 'select level' are for going to multiple level screens when there is more levels to be shown. A great answer has been given, but more are welcome.

8-bit doesn't refer to the resulotion, it only refers to the color depth. 8 bit means 256 colors.

@Bálint  8-bit here references an aesthetic; to replicate the look and feel of the 8 bit era. (I'd argue that 8 bit would mean a "16 color palette" as most of the machines at that time displayed 4 to 16 colors on screen at the same time). Same goes for 8-bit sound which means usually "chip-tunes" and so on.

@Felsir Yes, they could only display 4 to 16 colors at a time to save memory, but they could choose from different color schemes.

@Bálint some of them could. Still as said, it is about the aesthetic. In some cases it goes further than just graphics but also sound and/or controls.

When we think of 8-bit games, we often think of the 8-bit era, where the graphic style was the result of the obvious hardware constraint. In today's age, 8-bit is often associated with a graphical design that replicates these games. They do not necessarily restrict themselves to the same native resolutions. In fact, most standard hardware natively runs much larger resolutions. So in fact, a higher resolution that still bases its graphical design in 8-bit is still common - and still considered "8-bit".
Given that you are displaying information relevant to the level, itself, you have to consider the trade-off in redesigning the interface to use "8-bit" text. You could try conveying the information in a non-textual format; icons are a popular choice. But it is far easier to miss the mark in expecting your users to understand the information, where as the text itself is straight forward, and you can assume greater understanding across a wider range of users.
Is your game any less of an 8-bit game for using high-resolution text? Maybe. I would argue it is a semantic difference - too insignificant to really impact the 8-bit feel. Is your game still 8-bit for using it? Definitely. From what you explain, the rest of the game is entirely 8-bit. To say the text excludes it is simply nit-picking. If the game is good, and still has an 8-bit feel, most users won't care.
In your current case, you have made the trade-off of a small degree of graphical consistency for far more significant general usability. Your game will profit far more from users being able to understand your text and what it conveys about the level, and if your game is fun and enjoyable, the miniscule amount of "high-res" resource should not detract from the general 8-bit feel.
I say leave it, it works well.
If you're still concerned, ask your users. Get some playtests, and ask the users some non-probing questions concerning their opinions, their impression of "what genre is this" (given that 8-bit is now considered a genre of its own - some users may not even consider 8-bit a genre, so try to have some more experienced gamers in your testing), and their impressions of the overall style. At the end, you can ask more direct questions. Start with questions that do not infer any specific answer (dont start with "do you think this is 8-bit"), so you can achieve a more natural impression.

Thanks for the great answer. I have decided to keep the text but still get playtesters just in case. Thanks!

You could add arrows to cycle thru multiple slides with only a couple levels on each one. Maybe 3 per a slide? Thiis way you could divide the game into multiple "acts".


text:
How can I turn an open world into a fixed-size array?
I am developing a little game, where I need an A* path-finding algorithm for enemies who follow the player. I have already learned and tested a path-finding algorithm, but it only works with fixed-size array.
How can I turn an open world into a fixed-size array? I am developing with Irrlicht engine 1.6 version. I know that it is a quite old, but it is the only engine which works for me, on Windows XP.
Here is my A star path-finding code that works on a 2D grid. Additionally , if needed, Here there is a link to a walking person I have created with Irrlicht. You must place the media folder in your local drive.

Please add the relevant code and only the relevant code to the question.

@AlexandreVaillancourt I have done it. Look my A star pathfinding algorithm. It has been extracted from a webpage that I don't remember. I just need a bit of help. Please avoid downvote me. I am just a newbie. i need help. Thanks.

The problem is, although you may see it all as relevant code, you've actually provided us with all of your code (from what I can see). It is far less likely that users will take the time to read through all of your code, especially if you can not tell us a specific problem with it. Perhaps you could detail why you can only use a fixed array size, and perhaps just include functions relevant to your path-finding? You should put your code in your question, using four spaces to format the line into code.

There are two options that come to my mind:

You create a fixed size array from your 3D game world. Fixed size is not a problem if your world is finite. You divide the world up into little squares and put information into it whether or not a character can traverse. How this is implemented depends on your game world, the used geometry, the obstacles and so on. You want to go for an automated approach. If you got this you can apply the A* algorithm.
You use a technique that is made for 3D worlds: navigation meshes. There are a lot of results on Google for "C++ navigation mesh" and there are ready to use libraries. A lot has been written and coded for that, do some research and you will surely find a solution fitting your situation.


text:
Unity, Which side of Collider2D was hit by raycast?
I've got a player firing out 2d raycasts. If one of them hits a boxcollider2d I would like to know if it hit the top side, bottom side, left side, or right side. How would I go about doing this? I've tried using Bounds but that didn't work out very well.

pretty easy to do; Do your boxes rotate at all, or do they have a fixed rotation?

@Gnemlock They never rotate

I do not want to post an answer I can not double check, and don't have the time to test at present. You could try checking hit.normal (I am not sure if this is applicable in 2D), you could check hit.point against hit.transform, you could compare the transforms of the collider and the object initiating the raycast; I'm also sure there would be more advanced ways that would be more efficient.

Compare contact point with bounds of your collider. You can get center and extents of collider to get coordinates of each side of collider, and see, which side contact point belongs to.
See image below for example.

Red line is raycast line, green square - collider. You can get contact point from RaycastHit2D. Then simply check: if contact point X coordinate is equal to bound center.X + extents.X - it is either corner or right side. Same goes for left side - contact point X will be equal to center.X - extents.X. For upper and lower check you just should change X to Y.
Also, don't forget, that it is possible for raycast to hit corner - X and Y of contact point in such situation will be equal to both center.X +- extents.X and center.Y +- extents.Y correspondingly.
For more details, see Bounds reference.


text:
Different executions with different results using the same Random seed in LIBGDX
In my Libgdx project (for PC) I am using a Java Random object initialized with a constant seed. I use the Random object to generate a lot of different pseudorandom integers. I am not using multithreading, but the integers are a bit different each time I execute the application.
How can this be possible?
EDIT: What is really strange is that the Random object is called a few times more in some executions and I don't know why, causing the random numbers to be a bit different for each execution.

Are you making calls to nextInt() in the render() method?

No, I am using a different thread. In the render() method of the main thread I do nothing.

Then you need to edit your question, you originally said you were not using multithreading.

I also put all the code in the main thread and the results were the same. It was just to make the question easier.

If the number of RNG (Random Number Generator) calls changes depending on frame rate such as using the delta-time (animations, etc) to decide when to pull numbers out of the RNG you will get different results as the frame rate is unlikely to ever be the same between two runs.

This seems to be what I am getting, but it is strange because the Random I am using is encapsulated in a class which is only used in specific zones of my code. Maybe the Libgdx library is using the Java Random class by its own?

Unless you're giving Libgdx the instance of the random object you initialized, it shouldn't matter what Libgdx does.

Is this an oddity of Java?  I use seeded Random() in C# all the time and can always produce the same results based on the seed over instances of Random.Next().  I would be surprised if this wasn't the case in Java since it's a major component of pRNG code.

@JesseWilliams I don't think this is a Java thing; I've always observed Java's behavior for Random to be the same as you've described for C#.

Ah, I misread @Stephane's post.  Somehow I read it twice, and both times failed to see the leading "if".

As per the documentation for Random,

If two instances of Random are created with the same seed, and the
  same sequence of method calls is made for each, they will generate and
  return identical sequences of numbers.

This holds true if the instances are made via subsequent executions of the code. If your output is diverging, them somehow you are making more or less calls on different runs - the sequence of numbers generated is still the same, but your effectively sampling differently from the sequence each time. For example, imaging thumbing through a book front to back & looking at the first word on the left page - the order of words is fixed, but if you're skipping pages differently each time, the output you observe will diverge between runs.
@StephaneHockenhull gave a likely source as to why this might be. If some casual inspection into that doesn't pin it down for you then I recommend building a wrapper class around Random that increments a counter each time you make a call to get a random number. Dumping the number of calls made at intermediate points of execution will let you zero in on where your runs are diverging. Also, I find it's much easier to add breakpoints to wrapper classes; they can feel like a bit of a hassle, but they rarely take longer to code up than the amount of time wasted by blind trial & error debugging.

That is what I was really doing since the beginning, and also counted the calls a few hours ago, but I still were not able to see the origin of this bug, which makes me think that perhaps I am doing something strange because of the framework libraries.

Are you saying that on run A you observe call # n (as counted by the wrapper class) to nextInt() to give X & on run B you observe call # n to nextInt() to return Y?

No, the number of "n" calls to nextInt() changes depending on the execution. The nextInt() method always gives me the same result for the same "n" call, but the number of calls vary betwen runs.


text:
Why can't I change the size of my spheres in Unity?
I started to learn Unity. Now I make something like a solar system. I have one problem. What are the min and max sizes of the sphere? E.g. I have a radius of the Sun - 1.5 but it shows like the Sun has radius 1, I can't make bigger. But also I have the Earth with 0.01 size and the Moon with 0.009. But I can't make the Mercury with 0.03 radius.
So why when I'm creating a new sphere now I have only radius 1 and can't change it in Scene window?

You appear to be changing the collider, not the actual transform. The transform reflects the position, rotation and size of your game object. The collider reflects the invisible barrier around your object that flags potential collision events.
The Transform - the position, scale and size of our object
The transform is where you want to be directing changes to the overall size of your spheres. You can see the obvious distinction, below. The sphere mesh, itself, is the blue mesh made up of triangles.

In case you find yourself in a different predicament of confusion, the transform values also inherit from parent game objects. In the above example, you can see that the sphere has a scale of (2,1,1). This make the object extend 2 unit along the X-axis, and 1 unit along the Y-axis and Z-axis. Un-parented, we can say that it multiplies its values by 1. Parented to another game object, the transform values multiply by the transform values of the parent. Hopefully this does not sound too confusing, as it is an important feature. It allows you to easily lock objects together, create deliberate rotational pivots, or any number of useful reliance. It is also a common concept in general 3D design.
In the example, below, we have a second sphere with the scale of (0.5, 0.5, 0.5). When I parent our original sphere to the second sphere, its scale changes to (4, 2, 2) to retain the same size. This is because it now inherits from the second sphere, making its world transform (0.5*4, 0.5*2, 0.5*2), or the original (2, 1, 1). You will see this is also reflected in the position and rotation, with the parent values acting as the origin, or local (0, 0, 0) position/rotation.

The Collider - the collision barrier around your object
The collider is an invisible barrier around your object, used to calculate collision. Ideally you would want to wrap this around your object, as tight as possible. There is often some allowance in how loose the collider is, generally in favour of using simpler shapes. Simpler shapes are quicker for calculating collision.
The Collider dimensions are relative to the actual object. In the above example, we see the collider as a perfect circle around our actual sphere. With a radius of 0.5, a sphere collider will always wrap around your sphere mesh. In the case of not having a perfect sphere, due to having different X,Y and Z scale values, the collider will wrap to the largest axis. We can see this in the above picture, where the collider has wrapped to the X-axis, and extended past the spheres Y-axis and (unseen in the example) Z-axis. For this reason, you should generally never have to alter the sphere collider, in the project described above.
Unity Default Values
It is worth mentioning that by default, 1 unit is intended to represent 1 meter or 1 kilogram, depending on the context being distance or weight. It certainly does not have to, after all, its your project. That said, its worth knowing that this is the default interpretation Unity will take into account when calculating things such as physics.
If you find any abnormalities in your project, as a result, it is recommended that you play around with your project settings to find a comfortable balance. You can access your project settings by going to the top menu bar, and selecting Edit > Project Settings. From there, you can select Physics for 3D physics, Physics2D for 2D physics, or Audio for related audio settings such as Doppler effect.

From the image i see that you're changing the sphere collider not the sphere scale , sphere collider has nothing to do with sphere rendering, Try to change the Scale instead.

To change the size of an object, change the X, Y and Z scale in the Transform component. The Collider component governs how the object interacts with other objects. When you want the physical surface of your sphere to be identical to its visual surface, leave its radius at 1.0.


text:
Reconciling Flocking and A* (Theory)
For my RTS game I have got A* pathfinding working, and that's fine.  Basic collision detection exists too.  When a unit is moving it checks if the position it will occupy next move is a node occupied by another unit, and if so it finds another way to the destination.  I also think I understand the basics of flocking; that during movement it's just making sure that boids are checking the distance to their flock friends, and then correcting for this.
But I am a little confused.  Right now my pathfinding system works on a square grid of nodes, but if I'm to create a flocking system which works by taking a boid's circular footprint into account then this complicates matters, because in a tightly packed flock, or indeed a flock with a number of members with various footprint sizes, then their placement won't always match the square node grid designed for A*.
In theory, how then do a bunch of boids pack together in a ball, or flow through terrain bottlenecks (some nodes flagged unwalkable, etc) in an orderly manner?  Is this sort of behaviour emergent from a functional flocking system?
But I'm sure I'm misunderstanding this system and would like someone who understand how to implement it to explain the theory so that I can implement this myself.  I assume flocking isn't really congruent with A*: that's just used to find a path, and during movement flocking is the only way it manages collision detection and avoidance for units?  But then what about obstacles which can create bottlenecks?  How is A* and flocking reconciled?  Avoiding boids and terrain obstacles are different systems.

The contradiction
Indeed the two systems are quite exclusive to one another. As you mentioned:

A*: that's just used to find a path, and during movement flocking is the only > way it manages collision detection and avoidance for units

Here are key differences, pros, and cons, to keep in mind:
+---------------------+-------------------------------------+
| A* Algorithm        | Flocking                            |
+---------------------+-------------------------------------+
| Abstract overlay    | Real-world representation           |
+---------------------+-------------------------------------+
| Graph-Based (Nodes) | Free-Form (float coordinates)       |
+---------------------+-------------------------------------+
| Optimal trajectory  | Physical Trajectory (speed, inertia)|
+---------------------+-------------------------------------+
| Individual          | Group dynamics                      |
+---------------------+-------------------------------------+
| Global knowledge    | Local knowledge                     |
+---------------------+-------------------------------------+

If you want to mix the two, then I have to assume you have a way to make either work (but you want advice on how to have them work together). This means you already have:

A Physical world, where your boids can move around, interact with each other, and collide to world boundaries.
This can be a 2D set of segments, polygons, circles that form walls and obstacles, also friendly and ennemy units and buildings, slopes, terrain type, materials, political ownership etc. That is, everything that may physically or morally affect your characters.
Now your boids can move within this representation, have inertia, react to forces (real forces like collisions, or behavioural forces like seeking, fleeing). This is likely not just discrete cells, because boids are usually not constrained to cells, but it could be.
Ultimately, this is our game simulation/mechanics world so make it what you want.
A Graph representation of you world, for A-Star to work with.
This is a high-level, abstract representations (graph with nodes and weighted edges). This needs no information on terrain type or any of that: just nodes and weighted edges. An AI can quite easily handle this abstract representation to navigate it towards a goal, rather than the physical world in all its complexity.
To let the two representations interact, you'll also need:

A way to map any world position to a node in the graph
Vice-versa, a way, from any node in the graph, to pinpoint a matching location in physical world.
(Note, this is not a one-to-one mapping, so you could randomize the physical location of this point within the cell to get organic paths)

(In the rest of this answer, I will italicize Flocking algo and embolden A-Star algo as I did above).
So how can we let these two systems cooperate to get the best of both?

Towards cooperation
Split responsibilities between your algos.

Let A-Star find a reasonable global path (think guidance system) in the abstract realm. It will be optimal in graph space, and good enough in real-world space.
Let Flocking drive your boids locally along the path.

The A-Star will find a way to its objective, by feeding clever temporary 'seek' targets to the Flocking algo.

Detailed Implementation:

Beforehand, prepare some boids each of which have, at all times:

A macro objective, and a global path to that objective
A local tracking target for the steering behaviour, that we will move along the desired global path

At each time step, do the following for each boid:

Move the boid according its behaviours (point seeking, plus collision, plus flocking etc.) in the physical world
Map the boid's current location to its representative graph node
If the boid has left its previous node, it needs to recompute its path! We now give it a new target:

Perform an A-Star search, from the boid node, to the discretized macro objective node. This returns a global path.
Isolate a node further in the global path (The next node, or the one after that to get a more flowing seek behaviour?)
Un-descretize it (make it back into a physical location).
Assign to the boid a Seeking behaviour towards this local target

Note 1: Separation of concerns
You've altered A-Star by having each units look at cell occupancy by other units. This has compromised many benefits of A-Star:

Path is no longer optimal
Path is no longer guaranteed to reach the target due to interactions
Units will go back and forth whenever a path gets blocked/freed

This is because you've mixed concerns by having the algo both find an optimal path AND manage unit interaction. The nice thing about mixing two algorithms, is that this will allow you to resolve this by having A-Star simply find a path (regardless of other units, its the only thing it's good for) and let Flocking resolve conflicts (a task at which it is good for).
Note 2: Unit traffic jam
If you're concerned about groups of units blocking each other (like this (AAAA)--> <--(BB) ) in flocking mode, there are ways of mitigating this.

Try and recognize unit groups based on their intention (target node) and distribute a repulsive force on every unit of the smaller groups to "make way" (bigger group = bigger priority)
If you give mass order to big groups, then take that into account in you disretization process: make the discrete graph coarser when dealing with with large groups. Coarse A-Star will only find path through large enough "holes"

Note 3 - Unwalkable terrain
About unit walking into unwalkable terrain: Neither algorithm allows this.
At a high level, A-Star never orders a unit to pass through unwalkable edges, because those edges should not exist in the graph in the first place.
At lower level, Steering behaviout should include collision responses that keep boids out of the walls.
Worked Example
All white space in physical world is navigable, the graph world is a corresponding navmesh. Note that I purposely not followed the geometry in the graph, because it is an abstraction, so it doesn't matter as long as the edges have a correct weight (not shown).
The boid is in A and a, the objective is in E and e, there's a door in D and d.
Physical world             Graph world
+--------+------+          a---b
|A      B|F    G|          |\ /|
|        |      |          | X |
|        |      |          |/ \|
|        |      |          c---(d)---f
|        |      |               |\ / |
|        +      |               | X  |
|C       D     E|               |/ \ |
+---------------+               e----g

So the boid is in a, its A-Star path is a->b->d->e. So A-Star decides the next high-level move should be d (two vertices away, to create smooth trajectories). Since d resolves to D, the boid adopts a seeking behaviour towards D. But the boid is also very afraid of an ennemy in B, so here's what happens (the dots show the trajectory):
Physical world             Graph world
+--------+------+          a---b
|A      B|F    G|          |\ /|
|.       |      |          | X |
|.       |      |          |/ \|
|.       |      |          c---(d)---f
| .      |      |               |\ / |
|  .     +      |               | X  |
|C       D     E|               |/ \ |
+---------------+               e----g

The boid steered away from B (comination of seek+flee), changed of node in the process, and is now on node c ! We recompute the path, and now get c->d->e. The boid is assigned E as a seeking target. Etc, etc.
We thus get a natural, and emotionally coherent path which is a mix of A-Star and Steering behaviour.

Thank you very much, I'd just like to ask for a point of clarification: regarding the physical map and whether its nodes will be walkable or not.  "Let the boid follow its behaviours (point seeking, plus collision avoidance, plus flocking) until it changes of node" I assume this system checks before movement to see if movement enters a new node, and in that case, it will always avoid unwalkable nodes - because as you mention it's always looking for the optimal path to the target (via A*), and by default will just wait to move unless flock mates ahead move out of the way?

"I assume this system checks [...] to see if movement enters a new node". Well, no, to each his own. I assume your boids are physical objects that move around freely (double x, double y). They don't care about nodes. Those are an abstract representation of your world. In fact, you said "regarding the physical map and whether its nodes will be walkable or not" but I discourage you from using boids in discrete world, so they aren't 'in a node'. They're just, well, somewhere in (x, y).

To add up on this, I'll address your final conern: that boid might wander into 'unwalkable' territory. Well, your boid should collide with the physical world's geometrical boundaries (polygons, circles...). So they physically can't get into unwalkable zones.

Oh!  Physical collisions, I see.  Interesting. I shall have to investigate this further, but thank you, it's enough to get started on!

After closer examination of the theory, the one thing I still don't understand is how to reconcile square unwalkable terrain with circular boid space.  Could you explain any ways there are to make sure, say, boids won't pass into a large square obstacle, is this where your physical map reference becomes essential?  But what sort of algorithm is needed for realising the solution?

I'll need to update the answer. I need to be more concise and to the point and I haven't addressed your concerns properly.

Thank you very much, you almost got there!  It's just that one thing I am still confused about.

I'm sorry for asking about the old post, just I have a question: what can we do with the same problems if the world is not physical (e.g. there are no collisions for the non-walkable terrain)? I assume in that case it's required to add some avoidance along the non-walkable terrain, but not sure I understand how to implement it logically...

@norlin So you have non-walkable terrain, but you want your units to avoid it before it hits its boudaries? Simply add a strong enough repulsive force to those boundaries. A Collision is merely an infinitely strong repulsive force...

@MrBrushy yeah, I've ended up with something like this, just it's not really convenient since the shape of the boundaries can be any, not just a plane or sphere. I've ended up with making a repulsive-based "obstacle" spheres which can be placed anywhere on the level, but it's a hacky workaround.


text:
Using normal maps to output world-space normals
Im using deffered shading and here is my g-pass Vertex shader code:
vec3 T = normalize(vec3(transform * vec4(tangent, 0.0)));
vec3 N = normalize(vec3(transform * vec4(normal, 0.0)));
vec3 B = cross(T, N);
vs_out.TBN = mat3(T, B, N);

And my Fragment shader code...
gNormal.xyz = normalize(fs_in.TBN * (texture(normal, fs_in.uv).rgb * 2.0 - 1.0));

Usually, you would times your light direction and/or view direction with TBN. However, my g buffers are taking up more bandwidth than they should, and i would prefer to get world space normals from the normal map. How should i go about doing so?
EDIT: Apparently, this should output world space... but it isnt. So i guess something here is wrong.
Tangent generation function:
void CalculateTangents() {
        tangents.clear();
        for (int i = 0; i < vertices.size(); i += 3) {
            glm::vec3 edge1 = vertices[i + 1] - vertices[i];
            glm::vec3 edge2 = vertices[i + 2] - vertices[i];
            glm::vec2 deltaUV1 = uvs[i + 1] - uvs[i];
            glm::vec2 deltaUV2 = uvs[i + 2] - uvs[i];

            GLfloat f = 1.0f / (deltaUV1.x * deltaUV2.y - deltaUV2.x * deltaUV1.y);
            glm::vec3 tangent;
            tangent.x = f * (deltaUV2.y * edge1.x - deltaUV1.y * edge2.x);
            tangent.y = f * (deltaUV2.y * edge1.y - deltaUV1.y * edge2.y);
            tangent.z = f * (deltaUV2.y * edge1.z - deltaUV1.y * edge2.z);
            tangent = glm::normalize(tangent);

            tangents.push_back(tangent);
            tangents.push_back(tangent);
            tangents.push_back(tangent);
        }
    }

There is a point light "attached" to the camera (which clearly isnt working) and the reflection is wrong.

http://www.thetenthplanet.de/archives/1180
I suggest that you use this form instead. Instead of doing a complete transform of your data it works the other way around if that makes any sense. So that way it's much easier to tell what's going on and you can more easily work with the normals themselves.
Otherwise all you can do is know you have a bug...somewhere. And not necessarily in the code but it could be in your data as well.
This tutorial will help you show actual normals using geometry shader.
http://mbsoftworks.sk/index.php?page=tutorials&series=1&tutorial=17


text:
Issue implementing wall jump in Unity
I'm having troubles implementing a satisfying wall jump in Unity.
I managed to detect collision with a wall, but when I press the jump button, the result is alway weird or very weak. I think this have to do with the 2D physic in Unity, but I have no idead how to handle it correctly.
Here's my code with the concerned parts:
public void Move(float move, bool crouch, bool jump)
{
    // If the input is moving the player right and the player is facing left...
    if (move > 0 && !facingRight)
        // ... flip the player.
        Flip();
    // Otherwise if the input is moving the player left and the player is facing right...
    else if (move < 0 && facingRight)
        // ... flip the player.
        Flip();

    if (jump)
    {
        if (!grounded && walled)
        {
            StartCoroutine(WallJumpRoutine());
        }
    }
}

void Flip()
{
    // Switch the way the player is labelled as facing.
    facingRight = !facingRight;

    // Multiply the player's x local scale by -1.
    Vector3 theScale = transform.localScale;
    theScale.x *= -1;
    transform.localScale = theScale;
}

IEnumerator WallJumpRoutine()
{
    Vector2 wallJumpVector = new Vector2(jumpForce*10, 20f);

    GetComponent<Rigidbody2D>().AddForce(wallJumpVector, ForceMode2D.Impulse);
    yield return null;
}

To be more precise, the result I'm getting is either my player being moved a tiny bit (despite using the same force as my regular jump, which is working fine) or my player being moved a good distance but at very high speed (this is when I'm using ForceMode2D.Impulse).
Any help?

The velocity gained from AddForce in any particular direction is affected my a multitude of factors, including the current velocity of the rigidbody.
Two things you can try:
1) Setting velocity to zero before applying the force
GetComponent<Rigidbody2D>().velocity = Vector3.zero;
GetComponent<Rigidbody2D>().AddForce(wallJumpVector);

OR
2) Ditch addforce all together and control the velocity directly.
GetComponent<Rigidbody2D>().velocity = wallJumpVector;
Hope that helps.


text:
Unity - How to keep an object at the right or left of another object
I created a WallCheckRight and a WallCheckLeft linked to my character.
However, I noticed that when my character do a flip, they switch place (right to left and left to right)

Is there any way to prevent that?

There are many ways to do this.
1) The easiest way to prevent that instead of changing animations like what Shraa has mentioned, is to restructure your hierarchy.

You only want to flip the scale of PlayerSpriteRenderer.
OR
2) Instead of using a empty gameObject's transforms to store left and right points, do it in code.
Vector3 rightWallCheck = transform.position + Vector3.right;
Vector3 leftWallCheck = transform.position + Vector3.left;

What flipping does is just change the scale from 1 to -1 (or whatever the value). So all colliders and children will have this effect that you're having.
What you could do is have animations for the player facing both right and left direction. Instead of flipping using scale, you can just switch between the animations.
Edit: Instead of changing animations, which will need you to have more sprites which may decrease performance and increase size, you should use the solution that Eclmist suggested


text:
How can I reduce the sharpness of my generated terrain?
I am trying to generate a random low poly terrain for a 3D demo. I am using Perlin noise to generate the heights and then generate the 3D mesh, but the terrain generated is too sharp and unrealistic. It ends up looking like this:

But I'd like it to look more like this:

How can I smooth out my terrain so it looks more like the second image?

Please be more specific. What exactly is "unrealistic" about the generated terrain? The ideal terrain generation algorithm depends on your requirements.

It is too "sharp". Something like this: https://i.ytimg.com/vi/4olmeStiBsE/maxresdefault.jpg . I am looking for something like this: http://d1bb209af3y0vl.cloudfront.net/assets/proteus/social/Proteus-952965f2b3302245baf9f2c8be50f6eb.png

Are you sure it's the 3d mesh which is wrong and not the way it is rendered? You might want to post a comparison screenshot of a more "conventional" looking game.

Issue: The scale of the terrain in the sample image seems to be much larger. A hill is represented by at least 10x10 vertices while your mountain is represented by at most 5x5 vertices.
Solution 1: Increase the sample density of your noise. This is effectively equivalent to having more vertices and thus have more detail to your terrain
Solution 2: Increase your noise scale. This is effectively equivalent to smoothing your values. This means that you won't have tall mountains or steep cliffs.

Without knowing the specifics of your algorithm here are a couple things you can try:
If you want a simple method that keeps the same highs and lows; but has a greater amount of points fall in the middle range you can simply generate your terrain off two samples of noise instead of one, and average the results (or sum them and use 2 * maxval as your max instead of maxval).  This will lead to still having the occasional sharp peak/valley where the noise lines up but cause a smoother terrain overall.
If you want to have what you have now but with specific shapes to your peeks and valleys you can play around with a graphing calculator to find a curve that you like for the spread of results you can get.  For example if you are using values between 0 and 1 for your height values then applying a function like (tanh(x)-1)/2 to the points will smooth off your extremes while giving a closeish to linear range around the middle band.  Make sure if you chose this route to play with the values. doing things like halving or doubling x going in will effect the overall steepness of your terrain without impacting the max or min height and other changes will have other potentially useful effects.
As a side note, some of the apperance of sharpness come from your textures.  If the style is not desired, addressing it could help. If you cannot afford an approach such as multisampling (blending between two textures based on height) I would make transition textures for small bands between the high contrast steps to avoid the hard zigzag lines.

Another way to do this is to generate your terrain as a height map and then low-pass filter it. Applying a gaussian or even box blur to it will give you more gentle transitions between peaks and valleys.


text:
Unity, positioning with ints instead of floats
I round my transform.position to the nearest integer at the end of every frame so it's never a decimal number. I would like to know if there's a way to make unity store the position in ints instead of floats to prevent floating points precision problems.

No, you can't do that because Unity is doing all its internal calculation in float.
But if you would like to implement your game mechanics completely with integer arithmetics, you could write your own Vector3Int class, use it for all of your game mechanics, and then have each of your game objects write its Vector3Int-position to transform.position in LateUpdate().

Assuming that you mean a Vector3 type that uses ints, I don't think there is a type that uses ints as internal storage seeing as how the unity transform system all uses floats everywhere.


text:
How can I have cutouts in a texture?
I want to be able to have a gameobject that's basically just a black box on top of everything else. Then I want to be able to place other gameobjects which are just gradients on top of that and they should "cut out" of the black texture like this:

How can I achieve this sort of effect?
Please keep in mind that I have pretty much no experience with shaders :)
Here's a video that might help explain what I'm trying to achieve
https://www.youtube.com/watch?v=L1dd4fkVSAM

I saw the video link you provided. I dont think you have to do much about shaders. This can easily be achieved by using lighting. Make the entire scene dark by deleting all the lights including directional light (or configuring the light to decrese its intensity). Assign a light (may be a point light) to the character and you get what you want. When the character moves, the area around the character would light up.
Otherwise if you want your black box to show gradients of textures dynamically, it needs shader programming. Hope this help.

Its a 2D game so I dont have any lights

2D gameobjects by default doesnt not respond to lighting. Change your sprite shaders to Diffuse. Now your 2D sprites will respond to exterior lighting.

Yes, but then everything doesn't become black

Do you know how I would go about writing a shader for this?

I download an asset from the asset store, it works now