texts: How do I properly change the value of a prefab'd instance variable?

texts:
I am currently following a tutorial on how to make a 2D platformer in Unity.

The tutorial explains how to make an enemy wave spawner, but it doesn't explain how to make enemies stronger after I have completed a certain amount of waves.

So, to explain: I have an Enemy class, which has an EnemyStats class in it:

public class Enemy : MonoBehaviour
{
    [System.Serializable]
    public class EnemyStats
    {
        public int damage = 20;
        public int maxHealth = 100;

        public int CurrentHealth
        {
            get { return _currentHealth; }
            set { _currentHealth = Mathf.Clamp(value, 0, maxHealth); }
        }

        private int _currentHealth;

        public void Init()
        {
            CurrentHealth = maxHealth;
        }
    }

    public EnemyStats stats = new EnemyStats();

    private StatusIndicator statusIndicator;

    void Awake()
    {
        stats.Init();
        statusIndicator = transform.Find("StatusIndicator").GetComponent<StatusIndicator>();

        if (statusIndicator != null)
        {
            statusIndicator.SetHealth(stats.CurrentHealth, stats.maxHealth);
        }
    }
}

And in the WaveSpawner class I have the method to spawn the enemy:

private void SpawnEnemy(Enemy enemy)
{
    Transform sp = spawnPoints[UnityEngine.Random.Range(0, spawnPoints.Length)];

    if (CurrentWave % 5 == 0)
    {
        enemy.stats.maxHealth += 20;
    }

    Instantiate(enemy.transform, sp.position, sp.rotation);
}

In the WaveSpawner you can set a certain number of waves (let's say 5), and after you complete all of the waves I've set them to repeat.
So after I beat the 5 waves, I want the 5 waves to repeat and the enemies to be stronger (for example to have their max hp increased by 20).

I do that with the line: enemy.stats.maxHealth += 20;

But the problem here is that after this line is executed and I Instantiate the enemy prefab, the prefab changes its value in the inspector. So let's say that the initial value of the prefab was 120, after I beat the 5 enemy waves, the value of the prefab is set to 140. Then, after I reset the game, the initial value of the prefab is 140 and the max health of the first enemies is 140 and not 120.

I have tried to not change the maxHealth variable of the EnemyStats class, but instead to have another variable tempMaxHealth and do the changes on it. This doesn't resolve my problem, as other problems arise and I don't know what to do anymore.

I hope that you have an answer for me, I would be grateful if that's the case.


texts:
I have made games with cocos2d for the iphone however I am looking to move on from that, is there a good direction you could suggest? If not I was planning on using what the SDK gives me, and so for example to make a sprite, say the player on screen, rather than a CCSprite, what would be best to use? What do I need to go and learn?

Thanks.


texts: How do I use Content.Load() with raw XML files?

texts:
I'm using the Content.Load() mechanism to load core game definitions from XML files. It works fine, though some definitions should be editable/moddable by the players. Since the content pipeline compiles everything into xnb files, that doesn't work for now.

I've seen that the inbuild XNA Song content processor does create 2 files. 1 xnb file which contains meta data for the song and 1 wma file which contains the actual data. I've tried to rebuild that mechanism (so that the second file is the actual xml file), but for some reason I can't use the namespace which contains the IntermediateSerializer class to load the xml (obviously the namespace is only available in a content project?).

How can I deploy raw, editable xml files and load them with Content.Load()?


texts: UE4 - Render grid decal per pixel on GPU or all at once on CPU?

texts:
Using UE4 version 4.25.3, I am trying to project a 2D cartesian grid onto a landscape. The grid is currently just a series of black-bordered squares, but I am planning on adding an abundance of color effects to the grid cells based on movement and location of actors among other things. I need to communicate the location of the actors in question to the shader so that the material can update accordingly, but the only way I have found to be able to pass that information efficiently (it will eventually be used to pass location information for up to maybe 50 actors every tick, so I do not think using a bunch of constant vector parameters is a good idea here) is to use a texture that I build myself on a 2D canvas in CPU-bound code with this information encoded into it, and pass that to the shader as a texture parameter. I realized though that with just the location information available to the material, it is going to add a fair chunk of extra math per-pixel to the shader, though mostly just addition, multiplication, and division. Since I am already passing a texture to the shader, I could just compute the entire grid texture on the CPU with desired color and effects on specific cells using constant-complexity modular math, as opposed to checking extra conditions on every pixel. My intuition is that this technique of building the texture on the CPU will perform better frame-to-frame and will overall simplify the process of updating the look of cells on the grid with simple effects, but my question is really how many extra instructions per pixel do I need to see in a shader before I start to realistically need to worry about GPU performance? The TL;DR of the difference is that:

Computing on the CPU is constant time, just scale line segments by the cartesian coordinate of the cell to draw over the borders as I desire
Computing on the GPU is no longer constant because I have to check conditions against world location on top of addition and division operations on every pixel, but because GPUs are designed for this already it may just not be that much of an issue.

Which way should I go here? In general, I would like to try to set a precedent strategy when I have to pick between delegating work to the CPU vs the GPU - which one should I try to delegate the most to first as I continue to add more complex logic to my shaders and how those computations are tied to states of other actors?
Sidenote:
I had considered the method of passing a texture as a parameter before, and I decided to go that way after seeing a similar method on the UE forums that seemed to work out well for the user.
Though it does not quite answer the question, if there is a better way of delivering a variable-length array to a material as a parameter than passing a texture sample, then I would probably just go with whatever that alternative is and forego dwelling on the conundrum upon which this question seeks counsel.


texts: {Maya 2017} Problem with Knee Joint Target

texts:
I am not very experienced with Game Development or Character Design/Rigging, but I am trying to learn and have hit my first roadblock with rigging a character.

I used Maya 2017's QuickRig function and it worked out alright except for the Knees bend backwards. I tried shifting or rotating the Knee target node but it does not move unlike the elbow nodes did.

I believe all I need to do it get the Knee Target node on the front of my character.

Any Tips? Linked below are screenshots to help visualize my problem.

Character Rig: https://gyazo.com/bee70568fbacc473e095631185443a48

Knee Bend Problem: https://gyazo.com/d4b1ba9a542dbc18ffb2ba14db71c931


texts: Recursively calculate possible pathway on a grid depending on max walk distance

texts:
I have a character that is placed on a grid. It has a variable maximum walking distance. Grid fields can be walkable or not walkable. As the character may has to walk around certain not walkable fields to reach his destination his maximum walking distance isn't allways represented by a circle.

See these examples:

Without obstacles, walking distance 7:

With obstacles, walking distance 7:

Note how the obstacles affect the players maximum walking distance

To calculate this i've written this recursive function:

static Vector2Int[] GetWalkableFields (Vector2Int position, int steps) {
    List<Vector2Int> walkableFields = new List<Vector2Int>();

    if (steps > 0) {
        foreach (Vector2Int v in GetNearbyFileds(position)) {
            if (m_mc.IsInBounds(v) && m_mc.IsWalkable(v.x, v.y)) {
                walkableFields.Add(v);
                walkableFields.AddRange(GetWalkableFields(v, steps - 1));
            }
        }
        return walkableFields.ToArray();
    } else {
        Vector2Int[] v = { position };

        return v;
    }
}

And this function, that returns all four neighbour fields of a field:

public static Vector2Int[] GetNearbyFileds(Vector2Int position) {
    Vector2Int[] neighbors = new Vector2Int[4];
    neighbors[0] = new Vector2Int(position.x, position.y - 1);
    neighbors[1] = new Vector2Int(position.x, position.y + 1);
    neighbors[2] = new Vector2Int(position.x - 1, position.y);
    neighbors[3] = new Vector2Int(position.x + 1, position.y);

    return neighbors;
}

The function is called with the players position and maximum walking distance (steps) and get's the four neighbour fields and unless the steps are zero calls itselve for every neighbour field with the maximum walking distance decremented.

As you can see in the screenshots, this works absolutely fine. The problem is, as the calculation not only goes away from the player but, in some recursion paths, goes back and fourht between tiles until stepcount zero is reached without even having traveled one field, that this way of calculating the path is really resource heavy. For a walking distance of 7 there are 27646 possible walkways that all are getting calculated. If a player is able to walk 11 fields the calculation takes a few seconds, if he can walk 12 fields Unity crashes while calculating.

Is there a way to calculate this more efficient?

Thank you in advance.


texts:
The OpenAL site I'm looking at is a crappy outdated and broken sharepoint portal and the SDK in the downloads section give me a 500 html code when i request it.

http://connect.creativelabs.com/openal/Downloads/OpenAL11CoreSDK.zip

I found an OpenAL SDK on a softpedia and it has headers but not alu.h or alut.h which the tutorials I'm looking at apparently require for loading wavs etc.

What am I missing? Is OpenAL dead or something?


texts: Rendering order for units behind objects?

texts:
Im developing a 2D game with some fake 3D effects (parallell projection).
2D-units are able to walk in front of buildings aswell as behind them, although themselves being just 2d-objects.
This leads to a problem I will show you with a series of images (1-5). Can you tell me how to solve it?

Image 1: Animation for objects used in this example: Unit and Building.

Image 2: Unit and Building with animations and the physical bodies used in the game engine. Note the extruding arms and the building overhang enabling units to walk behind it.

Image 3: By using rendering order ground(0), units(1), buildings(2) the overall goal is reached. But as you can see the limbs of the unit is hidden by the building. This is my problem. How to solve it?

Image 4: I have tried splitting the building in a "front side" and a "back side" for rendering, but that leads to another issue - the corners. (Notice the penetrating hand on the rightmost unit.)

Image 5: So the final quick fix which I would rather avoid is this method:
Enlarged buffered physical buildings and shortened unit limbs.

Please, what are youre ideas on how to solve the issues?
If it matters, the game is continious and not built on grids or discrete values.


texts: How to create a solid cross-scene game manager in the editor of unity?

texts:
I have been checking dozens of known 'solutions' for how to create a game manager in Unity, but none leave me satisfied.

I know I can create a singleton GameManager.Instance() that would have data to persist across multiple scenes, but it doesn't show up in the editor unless I assign it to a game object.
The problem is, this game object would then be destroyed upon loading a new scene except if I use DontDestroyOnLoad().

However, when I use DontDestroyOnLoad(), and I open up a new scene in the editor, this GameManager Object doesn't exist in the new scene. The DontDestroyOnLoad() method assumes that the program entry point will always be the main/first scene, which is often not the case when working in the editor. This isn't great.

Example:

When I have events within scene2 (say a button or something), I cannot reference the gameobjects in scene1 in the Unity Editor (most importantly, the game manager).

Instead, I have to first attach a settings.cs script to my UI Button GameObject. When pressed, the Button will then call a function from the settings.cs void ChangeInput() {GameManager.Instance().ChangeInput();}. This feels quite clunky because the Button Element cannot reference the GameManager directly, since the Button is scene-specific but the gamemanager is not.

Is there a proper solution for issues like this?


texts:
Simple question. When I prototype game ideas I like to create objects without having to attach sprites. Is it possible to create a Rigidbody 2D in unity, set its size and render its wire frame? I am using a unity in 2D mode.

Thanks!


texts: I try to recreate a plasma gun from halo into my fps game

texts:
this is my code:
public class WeaponTest : MonoBehaviour
{
    public float weaponHeat;
    public float weaponOverHeat = 100f;
    public bool weaponIsOverHeat;

    // Start is called before the first frame update
    void Start()
    {
        //weaponHeat at the start was 0
        weaponHeat = 0;
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetButton("Fire1") && !weaponIsOverHeat)
        {
            if (weaponHeat < weaponOverHeat)
            {
                Weapon_Shoot();
                weaponHeat = IsHeating();
            }
        }
    }

    float IsHeating()
    {
        weaponHeat += Random.Range(5f, 10f);
        return weaponHeat;
    }

    void Weapon_Shoot()
    {
        RaycastHit hit;
        if (Physics.Raycast(playerCam.transform.position, playerCam.transform.forward, out hit, range))
        {
            // code for damaging the enemy
        }
    }
}

the shoot method was function exactly like what is want but I need the cooldown method I already try a few them but it not work exactly like I want. the I idea was went the left mouse was click the weapon heat will increase and when the left mouse was not been click the weapon heat will decrease until it reach 0. I hope you can help me solve this problem


texts: How to make RPG Maker VX Ace stop crashing steam?

texts: Every time I try to load RPG Maker VX Ace through Steam, it crashes Steam and prevents itself from loading. Is there any way to prevent this from happening? The last time I used it, I did put a lot of .mp3 files onto it, but that was the last thing I did (besides working on a game).


texts: Recommend a game engine with 2D GUI for a UI-intensive strategy game

texts:
Yes, this is another recommend game engine request; the 'twist' is I am doing a strategy game and on top of sprites, animation and abstraction of input controls, it has to have GUI support for rather complex controls, such as scroll-bars, select boxes, buttons and such.

I  have tried XNA with various GUI libraries, but the problem is that those libraries was not 'completed'.
 I am just wondering if there are other engines which I can look at?


texts:
I'm loading multiple labels (100+) with different font types (max 10), but they have different sizes.

As I read the code and did the research, it's not possible to 'reuse' the font.

For instance, I have 5 labels made with GILL_SANS font but these labels must have different scales (font scales).

Should I really make 5 different BitmapFont objects for different scales (AND LOAD THESE TERRIBLE GRAPHICS AGAIN AND AGAIN) or is there any way to optimize this (without loading .fnt and .png again)?

One load takes 2mbs of RAM (huge png) + ~2ms which is unacceptable for 100 labels.

Edit
I've check that. Label caches fonts so you can scale the same font and use setFontScale() on each label. But what about TextField?


texts: Simplest way to make a car follow a route

texts:
To get the cars to follow the circuit, I mapped the circuits to several points. And using the move_towards_point function I make everything happen correctly.

In addition, I use two objects: object 1 / pink square => to be followed by the cars, object 2 \ green square => to reset the car collision with object 1 (so that the collision with object 1 only happens once).

Sometimes I have to make an adjustment in the position of object 2, because it has to be in the path between two objects 1, otherwise it will not clear the collision.

I thought there would be another solution considering that I've seen in video tutorials a platform games function (usually used on villains so they do not fall into the void).

If I am not mistaken, it is as if at any moment the object throws a particle, and if it did not reach anything until a certain moment or height (y), the object would turn around and run in the opposite direction.

I imagine there is a function similar to this to use in my case. So that you detect the circuit object and do not let the car get out of it.

It's hard enough to have to put up points, then move the position of each of them to the code (I had to do this, because I preferred to create only one object and keep repeating it all over the circuit, I could have created several. Ex => point 1, point 2, ...).

Not wanting to plagiarize, but an example of what I want for my game, is this game:

Game: https://play.google.com/store/apps/details?id=com.moz.flracing2016.pro&hl=pt_BR

Video of game: https://www.youtube.com/watch?v=knZRQZI25Fo


texts:
I want to make the built-in FPS controller collide with an object and switch a boolean to true. Here is my code:

public static bool WellGUIOn;

// Use this for initialization
void Start () {
    WellGUIOn = false;
}

void OnCollisionEnter (Collision c)
{
    if (c.gameObject.name == "Well") {
        WellGUIOn = true;
    } else {
        WellGUIOn = false;
}

I have attached this script to the FPS controller and added a box collider on both prefabs (with is trigger ticked). The FPS controller already has a rigidbody(with kinematic ticked) and I added a rigidbody (with kinematic NOT ticked) to the object. Unfortunately, it doesn't work. How can I solve this?


texts: Better way to go up/down slope based on yaw?

texts:
Alright, so I got a bit of movement code and I'm thinking I'm going to need to manually input when to go up/down a slope. All I got to work with is the slope's normal, and vector, and My current and previous position, and my yaw.

Is there a better way to rotate whether I go up or down the slope based on my yaw?

Vector3f move = new Vector3f(0,0,0);
move.x = (float)-Math.toDegrees(Math.cos(Math.toRadians(yaw)));
move.z = (float)-Math.toDegrees(Math.sin(Math.toRadians(yaw)));
move.normalise();

        if(move.z < 0 && slopeNormal.z > 0 || move.z > 0 && slopeNormal.z < 0){
            if(move.x < 0 && slopeNormal.x > 0 || move.x > 0 && slopeNormal.x < 0){
                move.y += slopeVec.y;
            }
        }

        if(move.z > 0 && slopeNormal.z > 0 || move.z < 0 && slopeNormal.z < 0){
            if(move.x > 0 && slopeNormal.x > 0 || move.x < 0 && slopeNormal.x < 0){
                move.y -= slopeVec.y;
            }
        }

        move.scale(movementSpeed * delta);
        Vector3f.add(pos, move, pos);


texts:
I implemented PathModifier for path of each enemy in my tower of defense game. So I applied fixed time to path modifier in that enemy complete their path. Like following code describe.

new PathModifier(speed, path);

Here speed define the time to complete the path. But in tower of defense game my problem is, there is a tower which slow down the movement of the enemy. In that particular situation I was stuck. please someone provide me some guidance what to do in this situation.

EDIT :

        Path path = new Path(wayPointList.size());
        for (int j = 0; j < wayPointList.size(); j++) {
            Point point = grid.getCellPoint(wayPointList.get(j).getRow(),
                    wayPointList.get(j).getCol());
            path.to(point.x, point.y);
        }


texts: Disappearring instances of VertexPositionColor using MonoGame

texts:
I am a complete beginner in graphics developing with XNA/Monogame. Started my own project using Monogame 3.0 for WinRT. I have this unexplainable issue that some of the vertices disappear while doing some updates on them.

Basically, it is a game with balls who collide with the walls and with each other and in certain conditions they explode. When they explode they disappear. Here is a video demonstrating the issue. I used wireframes so that it is easier to see how vertices are missing. The perfect exploding balls are the ones which are result by user input with mouse clicking. Thanks for the help.

The situations is: I draw user primitives with triangle strips using like this

graphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.TriangleStrip, circleVertices, 0, primitiveCount);

All of the primitives are in the z-plane (z = 0), I thought that it is the culling in action. I tried setting the culling mode to none but it did not help.

Here is the code responsible for the explosion

private void Explode(GameTime gameTime, ref List<Circle> circles)
    {
        if (this.isExploding)
        {
            for (int i = 0; i < this.circleVertices.Length; i++)
            {
                if (this.circleVertices[i] != this.circleCenter)
                {
                    if (Vector3.Distance(this.circleVertices[i].Position, this.circleCenter.Position) < this.explosionRadius * precisionCoefficient)
                    {
                        var explosionVector = this.circleVertices[i].Position - this.circleCenter.Position;
                        explosionVector.Normalize();
                        explosionVector *= explosionSpeed;
                        circleVertices[i].Position += explosionVector * (float)gameTime.ElapsedGameTime.TotalSeconds;
                    }
                    else
                    {
                        circles.Remove(this);
                    }
                }
            }
        }
    }

I'd be really greatful if anyone has suggestions about how to fix this issue.


texts: What are the steps for creating level in Libgdx with Box2d?

texts:
I have been trying to learn game programming for a week, although I have a good knowledge of programming.

I don't understand some steps of game design. I'm recently working to clone the iSlash game.I'm so confused about creating level like this one.

For example , this is a level of this game.

This crab or whatelse must be designed in tools like photoshop, am I right? There are objects which can move around, but inside this crab so I think, I can use Box2D.

Here is my temporary design this game..
I want to use a my own object and move balls inside this object,but the problem is here.I can't imagine that how I should do this? If I use mesh like below code,

mesh.setVertices(new float[] { -0.5f, -0.5f, 0,
                                        0.5f, -0.5f, 0,
                                        0, 0.5f, 0 });

I think , It's very very hard way to create a level and I don't know what my object's coordinate.It takes forever.

In brief, What should I do? What tools should I use? How do big games like Angry Bird or above game (iSlash) solve this? Can I use tiled map editor for this problem?


texts:
During the last few days I was coding a painting behavior for a game am working on, and am currently in a very advanced phase, I can say that I have 90% of the work done and working perfectly, now what I need to do is being able to draw with a "soft brush" cause for now it's like am painting with "pixel style" and that was totally expected because that's what I wrote.

My current goal consist of using this solution :

Import a brush texture
Create an array that contain all The alpha values of that texture
When drawing use the array elements in order to define the new pixels alpha

And this is my code to do that (it's not very long, there is too much comments)

//The main painting method
//theObject     = the object to be painted
//tmpTexture    = the object current texture
//targetTexture = the new texture
void paint (GameObject theObject, Texture2D tmpTexture, Texture2D targetTexture)
{
    //x and y are 2 floats from another class
    //they store the coordinates of the pixel
    //that get hit by the RayCast
    int x = (int)(coordinates.pixelPos.x);
    int y = (int)(coordinates.pixelPos.y);

    //iterate through a block of pixels that goes fro
    //Y and X and go #brushHeight Pixels up
    // and #brushWeight Pixels right
    for (int tmpY = y; tmpY<y+brushHeight; tmpY++) {
        for (int tmpX = x; tmpX<x+brushWidth; tmpX++) {
           //check if the current pixel is different from the target pixel
           if (tmpTexture.GetPixel (tmpX, tmpY) != targetTexture.GetPixel (tmpX, tmpY)) {
               //create a temporary color from the target pixel at the given coordinates
                Color tmpCol = targetTexture.GetPixel (tmpX, tmpY);
                //change the alpha of that pixel based on the brush alpha
                //myBrushAlpha is a 2 Dimensional array that contain
                //the different Alpha values of the brush
                //the substractions are to keep the index in range
                if (myBrushAlpha [tmpY - y, tmpX - x].a > 0) {
                    tmpCol.a = myBrushAlpha [tmpY - y, tmpX - x].a;
                }
                //set the new pixel to the current texture
                tmpTexture.SetPixel (tmpX, tmpY, tmpCol);
            }
        }
    }
    //Apply
    tmpTexture.Apply ();
    //change the object main texture
    theObject.renderer.material.mainTexture = tmpTexture;
}

Now the fun (and bad) part is the code did exactly what I asked for, but by asking to draw anytime with the brush alpha I found myself create a very weird effect which is decreasing the alpha value of an "old" pixel, so I tried to fix that by adding an if statement that check if the current alpha of the pixel is less than the equivalent brush alpha pixel, if it is, then augment the alpha to be equal to the brush, and if the pixel alpha is bigger, then keep adding the brush alpha value to it in order to have that "soft brushing" effect, and in code it become this  :

if (myBrushAlpha [tmpY - y, tmpX - x].a > tmpCol.a) {
  tmpCol.a = myBrushAlpha [tmpY - y, tmpX - x].a;
} else {
  tmpCol.a += myBrushAlpha [tmpY - y, tmpX - x].a;
}

But after I've done that, I got the "pixelized brush" effect back, am not sure but I think maybe it's because I'm making these conditions inside a for loop so everything is executed before the end of the current frame so I don't see the effect, could it be that?

Am really lost here and hope that you can put me in the right direction.


texts:
I am making a flash game that will interact heavily with the server. For quite some time already I am using 'request hashing' technique to make sure that request data hasn't been tampered with. This works pretty well. However, in this game I'd like to go a little bit further and completely hide the protocol from the observer (right now it's plain JSON).

I imagine that I could zip and encrypt data (using one of symmetric algorithms). That would make it pretty unreadable by human, right (also smaller)? And SWF encryption/obfuscation should protect the encryption key (it is being done anyway).

As a side benefit that will also protect dynamically loaded resources from directly saving them to disk (or copying from the cache).

Questions:
* are there tools that allow you to simply dump the SWF with all its content, received and decrypted? If yes, this will render 'the side benefit' invalid.
* do you think it's worth it to burn all that CPU power?

To support my point, I will say that I like to inspect data being exchanged between client and server. And occasionally I find a bug or two which I can use to my benefit. But then there was a game that was sending and receiving some binary data. Being a lazy attacker, I decided not to analyze further. Otherwise, who knows what I could find :-)

Comments, ideas, criticism, suggestions? :-)


texts: Can I use two Collision Boxes on the same GameObject?

texts:
I have two Collision Boxes on the same GameObject. I don't want the Collision Boxes to be triggers. I want the Collision Boxes on the actual GameObject, not its children.

For example, if I want to check for a headshot. My reason for not wanting triggers is that a trigger is already being used. My reason for not wanting children is for cleanliness. I understand there are work arounds. I was wondering if there was a more direct approach.

When there is a collision, how can I check which Collision Box is hit?


texts: How do I fix my material texture rendering issue in Unity?

texts:
I am very new to Unity and was just testing out a few things to make my first ever game. I tried to make a material for my obstacle and I noticed that there is some texture issue. It shows pink lines and all other colors when at a close look. This can also be seen when the material color is brighter. How would I fix this?

My Unity version is Unity 2017.1.0f3.


texts: How to make a customizable 3D character with maya for a flash game

texts:
i'm working in a 3d flash role-playing game with alternativa 3d engine.

My game requires the main character to be customizable, for example, the player must be able to add a mustache, a hat, a tie, change colors of sking, clothing, etc, to the character.

How am i able to do that?.

(I'm using maya for modeling.)

Thanks in advance.


texts: How can I scale a subset of my game view during rendering?

texts:
I am developing a 2d game which has a lateral panel and a main panel with the scenario. I want to scale the main scenario to apply a zoom (only the main panel portion of the screen).

I think if I use SDL_SetRenderTarget I will be able to change textures and then zoom it, in runtime. I have to use only SDL2 library or some extension. I can't use openGL.

How can I accomplish this?


texts: How do you handle large triangles with frustum?

texts:
I am rendering the Sponza scene ato test my frustum implementation.

My current approach is simply, test if the vertices of the triangle are within the frustum (angle between the camera looking direction and the position od the vertex relative to the camera).

If any of the vertices are visible then the trianlge is considered to be visible.

The issue is that the sponza scene has some really large triangles, thus with my approach it is possible to be looking directly at a triangle and see nothing if all 3 vertices are outside the camera frustum.


texts: (LWJGL) Pixel Unpack Buffer Object is Disabled? (glTextImage2D)

texts:
I am trying to create a render target for my game so that I can re-render at a different screen size. But I am receiving the following error:

Exception in thread "main" org.lwjgl.opengl.OpenGLException: Cannot use offsets when Pixel Unpack Buffer Object is disabled

Here is the source code for my Render method:

    // clear screen
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);

    // Start FBO Rendering Code
    // The framebuffer, which regroups 0, 1, or more textures, and 0 or 1 depth buffer.
    int FramebufferName = GL30.glGenFramebuffers();
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, FramebufferName);

    // The texture we're going to render to
    int renderedTexture = glGenTextures();

    // "Bind" the newly created texture : all future texture functions will modify this texture
    glBindTexture(GL_TEXTURE_2D, renderedTexture);

    // Give an empty image to OpenGL ( the last "0" )
    glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB, 1024, 768, 0,GL_RGB, GL_UNSIGNED_BYTE, 0);

    // Poor filtering. Needed !
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

    // Set "renderedTexture" as our colour attachement #0
    GL32.glFramebufferTexture(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, renderedTexture, 0);

    // Set the list of draw buffers.
    IntBuffer drawBuffer = BufferUtils.createIntBuffer(20 * 20);
    GL20.glDrawBuffers(drawBuffer);

    // Always check that our framebuffer is ok
    if(GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) != GL30.GL_FRAMEBUFFER_COMPLETE){
        System.out.println("Framebuffer was not created successfully! Exiting!");
        return;
    }

    // Resets the current viewport
    GL11.glViewport(0, 0, scaleWidth*scale, scaleHeight*scale);

    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();

    // let subsystem paint
    if (callback != null) {
        callback.frameRendering();
    }

    // update window contents
    Display.update();

It is crashing on this line:

glTexImage2D(GL_TEXTURE_2D, 0,GL_RGB, 1024, 768, 0,GL_RGB, GL_UNSIGNED_BYTE, 0);

I am not really sure why it is crashing and looking around I have not been able to find out why. Any help or insight would be greatly welcome.


texts: How do I implement A* pathfinding for enemies to follow the player?

texts:
The enemies in my game are supposed to follow the player in order to cause damage to it. Right now, I have it where the enemy just goes in the direction that will bring it closer to the player, and this works fine, but the enemy gets caught on obstacles and solid tiles. The Collision.tileCollision methods check to see if there is or will be a collision with any solid tiles, by adding the speed of the enemy to its current coordinate, in order to look ahead for collisions. If there is no collision, and the direction its checking will bring the enemy closer to the player, then it goes in that direction.

if (Collision.tileCollisionRight(this.thisEnemy, this.thisEnemy.getSpeed(), currentLevel)
    == false && (Math.abs((this.thisEnemy.getX() + this.thisEnemy.getSpeed())
    - this.player.getX()) < Collision.getXDist(this.thisEnemy, this.player)))
{
    //Should/Can go right
    this.thisEnemy.setX(this.thisEnemy.getX() + this.thisEnemy.getSpeed());
}
else if (Collision.tileCollisionLeft(this.thisEnemy, this.thisEnemy.getSpeed(), currentLevel)
    == false && (Math.abs((this.thisEnemy.getX() - this.thisEnemy.getSpeed())
    - this.player.getX())) < Collision.getXDist(this.thisEnemy, this.player))
{
    //Should/Can go left
    this.thisEnemy.setX(this.thisEnemy.getX() - this.thisEnemy.getSpeed());
}

if (Collision.tileCollisionDown(this.thisEnemy, this.thisEnemy.getSpeed(), currentLevel)
    == false && (Math.abs((this.thisEnemy.getY() + this.thisEnemy.getSpeed())
    - this.player.getY()) < Collision.getYDist(this.thisEnemy, this.player)))
{
    //Should/Can go down
    this.thisEnemy.setY(this.thisEnemy.getY() + this.thisEnemy.getSpeed());
}
else if (Collision.tileCollisionUp(this.thisEnemy, this.thisEnemy.getSpeed(), currentLevel)
    == false && (Math.abs((this.thisEnemy.getY() - this.thisEnemy.getSpeed())
    - this.player.getY()) < Collision.getYDist(this.thisEnemy, this.player)))
{
    //Should/Can go up
    this.thisEnemy.setY(this.thisEnemy.getY() - this.thisEnemy.getSpeed());
}

I have heard that the A* search algorithm is good for path finding, but I have no idea how to implement the algorithm into my program in order for the enemies to not get stuck on walls when following the player. How would I go about doing such a thing? My program is tiles based for obstacles such as walls, but entities like the player and enemies have free movement. This is where I'm confused; I understand how it would work, if the entities also did tile based movements, but that is not how my game is set up. I don't want to check every pixel on the screen for a path, because that would take forever, and be extremely inefficient.


texts: Changing transform of ParticleSystem makes it not play?

texts:
Unity 2018.2.9f1, only 1 script, there is no other code. The scene is very simple (I just started).

I'm working on a mobile game and I'm trying to play a particle effect at the tap location.

I managed to get the particle effect to play, but when I attempt to change transform.position the particle no longer displays at all. I see the TapEffect's GameObject X and Y coordinates being updated in the Editor, but the actual animation is not playing.

This is the script I have attached to my player, the particle is the only child of Player at the moment.

public class Player : MonoBehaviour {

    private ParticleSystem tapEffectParticle;
    private Vector2 touchPos;

    void Start () {
        this.tapEffectParticle = transform.GetChild(0).GetComponent<ParticleSystem>();
    }

    void Update () {
        if(Input.touchCount > 0) {
            Touch touch = Input.GetTouch(0);
            if(touch.phase == TouchPhase.Began) {
                touchPos = touch.position;
                tapEffectParticle.transform.position = touchPos;
                tapEffectParticle.Play();
            }
        }
    }
}

Here is a screenshot of the TapEffect Particle, default particle.

This is a view of the Player GameObject selected.


texts: SpriteRenderer batching issue, with Z-Position and Order in Layer

texts:
I have two sprites (they look the same but with different colors):

I want them to be positioned like on the image above, so there's a feel like blue is standing on the green one.
There are two ways to achieve that:

Blue block with Order in layer 1, Green block with Order in layer 0
Blue block with lower Z coordinate, so it's physically in front of the green one.

Both of the concepts appear to break batching between these two objects. They're on the same atlas (I've tested it by setting the same Z position and Sorting Order and batching works).

How can I achieve batching here?


texts: Unity Assets folder is empty after opening package from the asset store

texts:
I downloaded the following Survival Shooter Tutorial from the Asset Store :
https://www.assetstore.unity3d.com/en/#!/content/40756
I was prompted to open it in Unity so I did and began following this tutorial :
https://www.youtube.com/watch?v=_lP6epjupJs
I am only 2 minutes into the first video and am stuck. In the tutorial there are lots of folders in the assets folder. I took a screenshot of what my screen looks like to show that it is empty.


texts: Resolution Independent 2D Rendering in XNA

texts:
I am trying to figure out the best way to render a 2d game at any resolution.

I am currently rendering the game at 1920x1200. I am trying scale the game to any user selected resolution without changing the way I am rendering, or game logic.

What is the best way to scale a game to any arbitrary resolution?

Edit: I am trying to achieve this:

http://www.david-amador.com/2010/03/xna-2d-independent-resolution-rendering/

but I think the code he has is for a different version of XNA because I cannot find that method overload he uses.


texts:
I am using the LibGdx framework and have an issue.

Currently, I am creating a game in a resolution of 480 x 320 and using 'GL20' to remove the restriction of that dreaded 'power of two' error.

It works really well, but only in desktop and phones whose screen sizes are the same. But when I try it to a phone with a resolution of 320 x 240, I can only see a small part of the screen and the screen calculations that I made for touch events are now incorrect.

Is there any way to make it work the same as in the desktop version? Like for example, even on the 320x240 phone, the resolution of the game is still at 480x320.


texts: Manual collision detection with a Box Collider 2D

texts:
My game is turn-based, so I only need collision to be detected after a specific game event has occurred, so for instance after every PlayerMoveComplete event.

I could just define a MonoBehaviour representing a rectangle and check if player is within its bounds, like:

class MyRect {

 void OnMoveComplete () {
    // if player lies within the specified rectangle
    if (this.Contains(player.transform.position))
       DoSomething();
 }
}

But I like to be able to see and adjust the area inside the editor similar to a Box Collider 2d.

I think I could also use the default box collider 2d implementation like:

collider2D.bounds.Contains(pos)

But I'm not sure if it'd still do all those calculations even if I do not implement any of its message handling methods like OnCollisionEnter2D. If it does it's an overhead for the task.


texts: How can I render fonts in a game with correct hinting?

texts:
I've used angel code's bitmap font generator quite a bit; though it's very good, I wonder if there would be a way to use the hinting information to provide a better and more readable result, by using hinting to provide differing thickness based on size/pixel coverage.

I imagine any solution would have to use the distance field tech presented in the valve paper on smoothing fonts while maintaining or reducing asset size. I haven't found any demos of it being used with hinting information turned on, or included in the field gradients in any way.

Another way of looking at this is whether there are any font bitmap generators that will output mipmaps that still maintain their readability in the face of pixel size. I think the lower mip levels would try to guarantee fill and space where it is necessary to maintain readability/topology over maintaining style/form; the point of hinting.

Is there a reason you can't just render the size you want?

The problem lies in the fact that font rasterisers currently don't render in 3D, and hinting information would be important in different amounts, due to the pixel density being different along different axes; even differing in importance along the length of a string, due to the size reducing over distance. For example, I only want horizontal hinting in a texture that is viewed from the side, and only really want vertical hinting in a font that is viewed from below or above. This isn't meant to be a renderer that tries to render a perfect outline as accurately as possible, as hinting distorts the reality of the font; instead, this is meant to be a rendering solution for static scenes, where the scenes use 3D transformed and warped text layout. In this case, the legibility is important; more important than the accuracy of representation of the polygon shape.


texts: Why does XMVector4Dot return a vector with the dot product copied to it's components?

texts:
The documentation for XMVector4Dot lists the return value as a vector. It also states that the dot product is replicated into each component. Given that the dot product is going to be a single value, how does this offer an advantage over just returning float?

The only way I can see to get the value is to do something such as:

        XMVECTOR w = { -XMVectorGetX(XMVector4Dot(x, eye)), -XMVectorGetX(XMVector4Dot(y, eye)), -XMVectorGetX(XMVector4Dot(z, eye)), 1 };

Which seems unnecessary. Is there another reason I'm overlooking?


texts: Component based entity system API naming problems

texts:
My engine uses a component-based entity system internally, and I want to bind it to Lua for scripting.

Now, I want to save people who write scripts for it typing work. In C++, to set the position of an entity, you'd do the following:

pEntity->GetComponent< CPoint >()->SetPos( Vector( X, Y ) );

That means, if I'd bind it to Lua 1:1 you'd also have to:

ent:GetComponent( CP_POINT ):SetPos( 123, 456 )

But let's be honest, would you want to type so much just to set an entities' position?

I don't think so, that's why I "hid" the component system from Lua:

Right now, what you do is

ent:SetPos( 123, 456 )

The component stuff is handled internally. You can still manually add and remove components from Lua with ent:AddComponent and ent:RemoveComponent, etc.

Now, this doesn't seem perfect either:

The Entity metatable gets cluttered because it has to take all functions of all components
Naming problems: ent:SetJointMotorEnabled() again seems kind of bad

Do you have any ideas how I could find a better naming scheme for component functions, without risking the scripting comfortability?


texts: What is the general architecture of a server for a game like rust/minecraft?

texts:
If a game's client is written in Unity or UE4 or another engine, is the server usually written in the same engine? Or is it written in standalone c++?

Does the server use a database like MySQL to store the locations of deployed structures and bases etc? Or is everything stored in memory in arrays or in another way?


texts:
I'm making a historically accurate game where the player can interact with past times and shape the future. The entire game is scientifically generated with math and real physics. (no, it won't have dragons! lol) The game will run real time and simulate the entire Earth (at first, then at level 56 the player unlocks universe mode where the whole universe is simulated). The player can build anything they want and it will use physics to simulate each creation based on the materials it's made of. Like they could build a rocket with solid fuel and it will launch realistically, as long as they shaped the nozzle correctly.

Anyway, I'm at the point where I'm simulating the dinosaurs and I want to make it accurate. I know we can't know exactly what the political structure of the dinosaurs was since most of the writings were destroyed in the comet strike, but most people know that our political system is based off theirs.

I was considering just modeling our political system and then applying mathematical regression to the algorithm to regress it 100 million years. However, I'm worried about the limitations of floating point numbers and I think that errors will compound. That would leave me with a political system that's really inaccurate.  What strategies can I use to develop a political system from scratch?

P.S.
I'm mostly talking about American dinosaurs, because they had the most impact on world politics.


texts: Example/Tutorial of passing structured data over network C++

texts:
This is very general question, about strategies how to pack same information about state of my game-world on server ( e.g. position/orientation of players, projectiles, etc. ) into data stream so that I can sent them over network and unpack them on the client side to draw on screen.

I know it's called serialization. But still I have many doubts.

My game already has some structure of objects. I do not want to re-design it ( too much ) in order to use some automatic serialization. I also do not want to make dependency on an other library (such as boost::serialize ) if not necessary
My classes/objects e.g.(class Airplane) contain some properties which should be passed over network to the client ( e.g. position and orientation ) but also some which should not ( e.g. some temporary variables relevant just for computations on server; pointers to nearest neighbor objects; array of Lift and Drag coefficient for set of angles-of-attack )
If I pack more objects into one message/packet I will probably need some protocol and parser to unpack the objects properly on the other side. The client should know of which Class type data are and to which instance it should be assigned.

Probably by trial and error I can figure it by myself, but it would take some time, and it would be helpful to have some example solution of similar problem to start with.

background - I have some skill with physics and graphics programming (Java,C++,Frotran,GLSL,OpenCL...), but I know absolutely nothing about networking. I have done some games into which I would like multiplayer. Just simple games with only few players and moving objects (projectiles). For reference consider something like LIERO


texts: add physics to a group or container body in phaser

texts:
I'm developing a HTML5 Phaser game. In this game I do have a Group which I would like to behavior as a physics body (arcade-physics).

It is a character with a lot of moving parts (sprites) inside this group. In this case the group acts like a container for the sprites.

However I only able do add physics behavior to a sprite.

game.physics.arcade.enable(mySprite); // works good!

Doing the same to a group does not works. it only add physics to children sprites

game.physics.arcade.enable(myroup) // does no works
myGroup.body.(...)  // body is undefined

I would like to create a "virtual" body to this group, mannually set dimensions for it (body.setSize) and add all my sprites inside it. Is that possible in any another way?


texts: How to make a windows installer for Monogame/F# game?

texts:
Alright, I have several questions that I haven't been able to find answers to yet. It looks like WiX and Inno Setup are pretty standard solutions for making the installer. WiX looks pretty intimidating and I got lost reading the tutorial on their site, so I'll probably use Inno Setup.

My questions:

What are the dependencies for Monogame that I need to install? I couldn't find any official documentation on this. I found a few forums posts where people said you'll likely need DX 11 and .NET 4.0. My visual studio project says .NET 4.5, so I'm guessing that's actually the one I need?
What things in my output directory need to be installed? I've got some .XML, .pdb, and .config files and I doubt I should be including them? Does MS have documentation on this?
Are there any tools to help me make sure I've got everything? Maybe some Visual Studio automation for doing this stuff? It looks like there is a WiX template for XNA, but I have no idea if I can safely use that with monogame.
Do I need a separate windows computer (including license) just to test the install? Or can I make a VM and use like a trial version of windows? It looks like windows 10 has a trial mode.
Additional guides, tutorials, or documentation I should be reading?

Thanks!

Here are the files in my output directory for the release build (do I need all these?):

font.xnb
FSharp.Core.dll
FSharp.Core.xml
MonoGame.Framework.dll
MonoGame.Framework.xml
NVorbis.dll
OpenTK.dll
Pong.exe
Pong.exe.config
Pong.pdb
Pong.XML
pop.xnb


texts: Texture2DArray in Directx11 with different formats

texts:
I'm trying to create a texture2DArray from multiple of images, each of which has different formats, and I got the following error from the DirectX11 debug layer.

D3D11 ERROR: ID3D11DeviceContext::CopySubresourceRegion: Cannot invoke CopySubresourceRegion when the Formats of each Resource are not the same or at least castable to each other, unless one format is compressed

I want to ask you there is any way of creating a texture2d array in Directx 11 with different format?


texts: Creating a full-screen window in Windows API

texts:
I've got a Windows API Window. I've managed to make it windowed, and "fullscreen windowed". But I can't seem to make the window just full-screen- for example, even if I specify WS_POPUP, I can still freely move the cursor to my second screen. However, if I launch full-screen games, they don't permit it, and exist only exclusively or minimized. How can I make a window that behaves this way?

Edit: Excuse me. Limiting the mouse movement was just one example of how a full-screen window behaves differently to a non-fullscreen window, I'm not looking for how to limit the mouse movement.

Or is this set in the D3DPRESENT_PARAMETERS, rather than just communicated?


texts:
I'm interested in behaviour trees that aren't iterated every game tick, but every so often. (Edit: the tree could specify how many frames within the main game loop to wait before running its tick function again).

Every theoretical implementation I have seen of behaviour trees talks of the tree search being carried out every game update - which seems necessary, because a leaf node (eg a behaviour, like 'return to base') needs to be constantly checked to see if is still running, failed or completed.

Can anyone suggest how I might start implementing a tree that isnt run every tick, or point me in the direction of good material specific to this case (I am struggling to find anything)?

My thoughts so far:

action leaf nodes (when they start) must only push some kind of action object onto a list for an entity, rather than directly calling any code that makes the entity do something. The list of actions for the entity would be run every frame (update any that need to run, pop any that have completed from the list).
the return state from a given action must be fed back into the tree, so that when we run the tree iteration again (and reach the same action leaf node - so the tree has so far determined that we ought to still be trying this action) - that the action has completed, or is still running etc.
If my actual action code is running from an action list on an entity, then I possibly need to cancel previously running actions in the list - i am thinking that I can just delete the entire stack of queued up actions. I've seen the idea of ActionLists which block lower priority actions when a higher priority one is added, but this seems like very close logic to behaviour trees, and I dont want to be duplicating behaviour.

This leaves me with some questions

1) How would I feed the action return state back into the tree? Its obvious I need to store some information relating to 'currently executing actions' on the entity, and check that in the tree tick, but I can't imagine how.

2) Does having a seperate behaviour tree (for deciding behaviour) and action list (for carrying out actual queued up actions) sound like a reasonable approach?

3) Is the approach of updating a behaviour tree irregularly actually used by anyone? It seems like a nice idea for budgeting ai search time when you  have a lot of ai entities to process.

(Edit) - I am also thinking about storing a single instance of a given behaviour tree in memory, and providing it by reference to any entity that uses it. So any information about what action was last selected for execution on an entity must be stored in a data context relative to the entity (which the tree can check). (I am probably answering my own questions as i go!)

I hope I have expressed my questions adequately! Thanks in advance for any help :)


texts:
I am trying to draw simple model, but I am experiencing strange error. When I use this View matrix:

Matrix.CreateLookAt(new Vector3(0, 200, 1), new Vector3(0, 0, 0), Vector3.Up);

my model is drawn correctly. But when I set camera position Z to 0 like this:

Matrix.CreateLookAt(new Vector3(0, 200, 0), new Vector3(0, 0, 0), Vector3.Up);

nothing is rendered. Why?


texts:
I am no graphics designer, but I'm a good developer with lots of experience. So, my question is the following:

Are any 3D design skills required for game development? If not, how does one write a game with 3D characters without having to design them?


texts: Technical differences between square and hexagon for a grid?

texts:
I'm developing a 2D city-building game and trying to decide on the type of grid. There will be vehicles, so the unit movement is important too.

I know there are visual differences for using Squares or Hexagons, what I want know is:

What are the issues for programming each type of grid regarding implementation and performance?
Is there a tradeoff or specific benefit for using one of them in a game context?


texts: How to balance experience gain in an RPG

texts:
I am currently developing an RPG game with a classic experience-points and levelup mechanic. The player kills monsters, gains experience points, levels up when they collect enough and become stronger.

How do I balance the amount of Exp points necessary for reaching each level and the amount of Exp awarded by each monster on each level?


texts: Does it make sense to do more calculations in the fragment shader if there are more vertices than pixels?

texts:
I'm very new to graphics programming, and as I understand it vertex shaders are called per vertex and fragment shaders are per pixel (ignoring anti-aliasing). When it comes to optimization all sources I refer to say that calculations that could be done in either shaders should be done in the vertex shader, and it makes sense: 5*8 done 3 times is way better than 5*8 done 300'000 (640×480 for example).

And that's fine for this scale but the question almost poses itself: what happens when the amount of vertices exceeds the resolution. Here's a practical example: a typical AAA game could have upto 3'000'000 polys rendering on the screen, for the sake of simplicity let's say it's a very detailed triangle strip, that would give it exactly 3'000'002 vertices; while a full HD screen has 1920*1080 ≈ 2'000'000 pixels. As you can tell a difference of a million operation could be a substantial performance increase.

Is my thought process sound, or does my ignorance of some details leave something to be desired?


texts:
I currently have a pixel shader that calculates the texture and I have another that calculates the light. I want another shader that does both. What I would ideally like to do is instead of creating a third shader that does that, I would like to have my object run through the first shader, then run through the second and then combine the final colors. Is this possible in DirectX11?

If this is possible, is it also possible that I run through the same shader multiple times? For example, could I load a texture and then run my texture shader then load another texture and then run the same texture shader again. Also same with lights, where I load light information to the cbuffer, run light shader, load another light informationm ,run light shader and rinse and repeat until I have run all lights.


texts: Making a 2D game with responsive resolution

texts:
I am making a 2D game, however I wish for it to be resolution agnostic.

My target resolution i.e. where things look as intended is 1600 x 900.

My ideas are:

Make the HUD stay fixed to the sides no matter what resolution, use different size for HUD graphics under a certain resolution and another under a certain large one.

Use large HD PNG sprites/backgrounds which are a power of 2, so they scale nicely. No vectors.

Use the player's native resolution. Scale the game area (not the HUD) to fit (resulting zooming in some and cropping the game area sides if necessary for widescreen, no stretch), but always fill the screen.

Have a min and max resolution limit for small and very large displays where you will just change the resolution(?) or scale up/down to fit.

What I am a bit confused though is what math formula I would use to scale the game area correctly based on the resolution no matter the aspect ratio, fully fit in a square screen and with some clip to the sides for widescreen.

Pseudocode would help as well. :)


texts: Android Fling Gesture, Animation And Collision - Resources?

texts:
I'm starting work on a 2D Android game where the player will put their finger on a game piece and do a fling gesture to throw the piece across the gameboard.

I've gone through some Android interpolation animation tutorials and have the fling working, and the game piece (currently the only item on the board) moving almost as intended.

However, I'm utterly flumoxed as to how I would work collision detection into this, as it seems to me that the fling gesture, and the resulting movement of the piece is a complete, uninterruptable action.

Are there any existing Android resources that implement 2D ball physics whilst also allowing things to be moved by flinging?  The next move in the game would only be made once all game pieces had come to rest, so it's only the initial action that requires the fling.

Failing that, could someone kindly point out some good resources that might be relevant to my question?  My Google hunting has pretty much just liquified my brain.


texts: 3D Background for a Verticle Shooter: Making it loop?

texts: I know how to scroll a background using spritebatches + 2D background images, but how would I do it with a 3D model?


texts: How to cut a desired shape out of a mesh?

texts:
I want the player to be able to cut a hole through a wall, similar to what's shown in this video

I know for the fact that it's really difficult to achieve, so I was wondering how I can cut a shape out of a simple mesh at run time (or even cut a shape out of a 2D sprite).


texts: How to create and choose sprite sheet for different mobile screen resolution in Unity

texts:
Background
We’re working on a 2D mobile game. We want to publish the game on all apple devices which at least support iOS 7 and to all android devices which at least support Android 4 OS. These devices come with different screen size and resolution. For example, in following image we have different Aspect ratios and resolutions that we almost found in every mobile device.

Question

Do we need to choose a higher resolution to design a sprite sheet
for those devices which share same aspect ratio? For example, iPhone
3Gs and iPhone 4s share aspect ratio of 3:2. But they have different
screen resolution.
If those devices come with different aspect ratio. Do we need to
create multiple sprite sheet for multiple aspect ratio?
What are the best practices that unity offer us to design and create
sprite sheet for multiple mobile device, which are optimize to even
lower mobile device?


texts: How can I make bodies that do not stick to the wall in Bullet Physics?

texts:
Possible Duplicate:
  Physics engine recommendation which can simulate pool game correctly?

I made a Billiards scene with Bullet Physics, but I've got a problem. When the ball is slowing down near a wall, it sticks to that wall and slides along it. It normally bounces, but at those low speeds it sticks instead of bouncing.

What's wrong? What should I set to make sure the ball always bounces when it hits the wall? I used barebone btRigidBody, with no parameters set.


texts:
I have the Footstepper: Complete Footstep Solution from the unity store, and i dont get it working with the Vr,
I made the footstep material like official documentation said, Then
i put the Footstepper Setup in the ovrPlayer object.
The problem is that sometimes sound the default fallback, so i think that the colission is not detected as it suppose.
Some idea ?


texts: Uniform lighting when there are multiple light sources

texts:
I'm writing a 2d game where there are walls and the NPCs can only see what is within their line of site. To do this I'm using Box2dLights so the walls create shadows.

The problem I'm having is that each NPC has a light. This means that the lighting increases where multiple lights crossover. Instead I would just like the same amount of light to hit the areas that are visible to the NPCs.

To summarise I would like there to be a peak amount of light to be reached. If any more lights are added then the light doesn't increase past this threshold.

Here is an example of multiple lights crossing over.

How might I go about doing this?


texts: How can I find the minimal texture size so the texture requires no pixel interpolation when transformed by a given matrix?

texts:
Given a rectangle with width x and height y, and a transformation matrix T: How can I estimate the minimal resolution of the texture (that is, its width and height) such the interpolation of additional pixels won't be needed?

Simple example: If x = 200px, y = 150px and T is a 2× scale matrix, then the required resolution is 400×300.

How can I do this for more complex cases, such as perspective projection?


texts:
I'm trying to create a helmet mounted display as a mod for a flight simulator. Unfortunately, I've been trying to figure out the math for this, but, to be honest, I'm stuck. I've done my best to look up the math related to this, but this kind of math really isn't my thing, so I figured I'd ask here to see if anyone can provide some help.
The information I have access to is as follows:

The pilot's position
The pilot's head's rotation
The location of the "thing" I'm trying to put a box on the HMD over top of

The HMD itself is drawn in screenspace as normalized 2D coordinates starting from the bottom left corner.
From what I can find, I can treat the pilot's head like a camera in a scene, and the thing I'm trying to track as an object in that scene, which means I'd need to use a view matrix, followed by a projection matrix, which would get me all the way there aside from translating that to the screenspace coordinates; at least that's what I can determine, but as there's no real way to debug problems aside from guessing and trying to fix them, I'd really appreciate having someone confirm/deny that route and correct any misinformation.


texts:
I am trying to develop a basic Breakout game using this tutorial using Unity 5. But the ball starts to bouncing infinitely very easily. I cannot understand why this happenes.

In my physics knowledge starting an infinite bounce is very hard, and even impossible. To return the ball to same position after bouncing we must send the ball with zero degrees with the vertical axis. To send the ball with zero degrees with vertical axis we must receive the ball with zero degrees with the vertical axis. To receive the ball with zero degrees with the vertical axis we must send the ball with zero degrees, and so on. We can send a ball with zero degrees only in initial ball throw. In all the other cases there must be an angle which is not equal to zero. Am I wrong?

I mean the ball does not change its rotation. Ball moves between two plates which are parallel to each other infinitely (for example between paddle and upper wall)

I added physics material to ball, paddle and the walls. This material has following settings:
Dynamic friction: 0
Static friction: 0
Bounceness: 1

Settings of the ball:
Mass: 0.5
Drag: 0
Angular Drag: 0
Is Kinematic: true (I changed to false just before firing)
Use Gravity: false

Settings of the paddle:
Mass: 0.5
Drag: 0
Angular Drag: 0
Is Kinematic: true
Use Gravity: false


texts: Does SFML support these specific features that I require?

texts:
I've been working on a game in c++ for about a week and a half, and I've been using SDL. However, my current engine only needs the following from whatever library I use:

enable double buffering
load an image from path into something that I can apply to the screen
apply an image to the screen with a certain x,y
enable transparency on an image
(possibly) image clipping, for sprite sheets.

I am fairly sure that SFML has all of this functionality, I'm just not positive. Will someone confirm my suspicions?


texts: Is it legal to use the Source Engine out of Steam?

texts: I would like to create a game that uses the Source Engine on Desura, the problem is that I am afraid that it is illegal to use the Source Engine in other platforms are not managed by Valve


texts: How would one create a "start button" on a website similar to some Korean games?

texts:
Some games have buttons that would actually let you click them and you'd log right into the game.  How does the web browser get permission to do this without plugins? Perhaps the client  registers a custom protocol URL?

They used to be popular a few years back - I can't remember any implementations off the top of my head. On desktop browsers, if your game client was installed clicking 'Play' on the home page would boot up the game begin it with you already signed in. It was popular with arcade games so you could browse the sessions on the web and then simply hit 'Start'. You didn't need any browser plugins.


texts: Getting an NRE when using delegates in Unity

texts:
I have a game where I have balls bouncing and you shoot them. Since I need a way to end the level when the player shoots all the balls I though I would create a game controller script which will register to an event from the ball script. In the awake function in the ball script I'm using this:

if (this.gameObject.tag == "SmallestBall") {
        if(!touchedTheRope) {
            countBalls(false);
        }
    }

NOTE: In this code here I'm not performing a check if(event != null) then execute - because I already know there is a problem. In the game controller script in the awake function I'm using this code:

UniversalBallScript.countBalls += CountBalls;

In the method CountBalls in game controller script I have Debug.Log to print out the number of balls. Because the small balls are being instantiated I first just performed a test where I check if the tag == "SmallestBall" and I just Debug.Log in the console, it gives me 28 small balls, but when I use the code above to call the event (if (this.gameObject.tag == "SmallestBall") etc... I get 24 balls and 4 null reference exceptions. I dont know if it has something to do with the fact that the small balls are being instantiated but I'm calling event registration in Awake and I also call that event in the Awake function, I have also tried to put this code:

if (this.gameObject.tag == "SmallestBall") {
        if(!touchedTheRope) {
            countBalls(false);
        }
    }

In OnEnable and OnDisable and its the same problem, I get 24 balls and 4 null reference exceptions. And BTW the null reference exceptions appear first and after that other 24 balls pass regularly. Does anyone have any idea?


texts: How to enter a level when touching an object

texts:
I am working on a project in Unity 4.6.1f1 and I was wondering how can I make a cube touch another cube to go to the next level (the image below)?

!

EDIT: I made a script and put it on the purple cube then enabled "is trigger" on the purple cube, but the blue cube goes right through it.

Inspector:

And the code:

EDIT 5/15/15: I edited my script and I was wondering if I'm doing something wrong.


texts:
On Ubuntu when capturing keyboard input with GLFW some keys like LEFT ALT are not passed to my window. Instead some desktop functionality is triggered like the dashboard search in case of the alt key.

How do I run a windowed game on Ubuntu, using all keys available on the keyboard, without telling the user how to turn off Ubuntu keyboard shortcuts all together at game start?


texts:
I am trying to achieve a certain kind of absorb effect within libgdx via the particle editor.

To be more descriptive: I want particles to spawn in a circle and then move towards the center point of that circle (and then disappear there).

I can of course spawn the particles in a circle, but then I cannot seem to find a way to make sure they all move toward a center point.

So my questions can be divided into two parts:

Is their any way I could use the particle editor to achieve this absorb effect I described?
If not, then what would the best way to achieve it in libgdx? Is their some way I could hack into the particle effect behavior itself and make this work?


texts: How do I map a 2D grid to my game object coordinates?

texts:
I'm using Gameplay3d as a game engine to develop a simple board game, PEG Solitaire.

I've come to the part where I've created a 2D grid for all the movable object, empty locations and also where it's not movable. I'm now trying to somehow map that 2D grid to my actual game coordinates, translations of my pieces. Using Gameplay I can select my objects. What I'm trying to figure out is how to solve this actual problem to map my grid to the actual movement of the game pieces?

I was maybe thinking of using an std::map<char*, int> where "char*" is the NodeID and "int" is the index in the 2D grid list so that I can identify each Node and where they are in my 2D grid.  The problem I'm having now is how can I solve the problem if the user select places on my board that doesn't have moveable piece. Let's say the user clicks on an empty hole on the PEG Solitaire board. How can I map that location to my 2D Grid?

I've created my board model and Sphere using Blender. I can using Gameplay use raypicking and select the differente Sphere Nodes and the whole Board Node. The problem is that I can't pick the individual holes on the Board as Nodes.
I know the center position of each hole on the board. So my solution was to somehow first figure out the Spheres world size maybe translate it to the screen size. When the user then clicks on the screen I can check if the position of x and y is inside the selection area of that hole so to say. I'm probably just wondering away in my own thought. But any detailed help here would be appreciated.

Get object world size and translate to screen size of possible.

The 2D grid looks like this:

0022200
0022200
2222222
2221222
2222222
0022200
0022200


texts: Blender bone animation with extruded vertex not moving as expected

texts:
I'm really new to blender. I've managed to make a model body and bone structure.
I've two problems:

But when I try to rotate the arm bone, my entire body moves. Why is this happening? I was following a guide and did ctrl+P and armature deform -> with automatic weights to link the bones to the mesh. What am I doing wrong here?
There appears to be some extruded vertex left in the joins of knee and shoulder. How do I fix that?


texts: Controlling screen and window size in Unity

texts:
In Java I know how to make a window of a certain size and make it not resizable.

How do I control my game's window size in Unity and prevent players from resizing it?


texts: When handling key input, I'm getting a negative timeout value in my thread. What's going on?

texts:
So I'm programming a game using Swing and AWT and I'm getting a weird error. As I check for input in my MenuState, which is just my Menu screen, it is telling me that the timeout value in my game loop.

MenuState.java:

package GameState;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;

import Handlers.MyInput;
import TileMap.Background;

public class MenuState extends GameState {

    private Background bg;

    private int currentOption = 0;
    private String [] options = {
            "Start",
            "Help",
            "Quit"
    };

    private Color titleColor;
    private Font titleFont;

    private Font font;

    MenuState(GameStateManager gsm) {
        super(gsm);

        try {
            bg = new Background("/Backgrounds/Menu.gif", 1);
            bg.setVector(-0.1, 0);

            titleColor = new Color(128, 0, 0);
            titleFont = new Font("Jokerman", Font.PLAIN, 22);
            font = new Font("Times New Roman", Font.PLAIN, 12);
        } catch(Exception e) {
            e.printStackTrace();
        }
    }

    public void update() {
        bg.update();
        handleInput();
    }

    public void draw(Graphics2D g) {

        bg.draw(g);

        //draw title
        g.setColor(titleColor);
        g.setFont(titleFont);
        g.drawString("Suddenly, Cold Pizza", 55, 70);

        g.setFont(font);
        for(int i = 0; i < options.length; i++) {
            if(i == currentOption) {
                g.setColor(Color.BLACK);
            } else {
                g.setColor(Color.RED);
            }
            g.drawString(options[i], 145, 140 + i * 15);
        }
    }

    public void init() {

    }

    private void select() {
        switch (currentOption) {
        case 0:
            //start
            break;
        case 1:
            //help
            break;
        case 2:
            //close
            System.exit(0);
        }
    }

    public void handleInput() {
        if(MyInput.isPressed(MyInput.BUTTON6)) {
            select();
        } else if(MyInput.isPressed(MyInput.BUTTON2)) {
            if(currentOption > 0) {
                currentOption--;
            }
        } else if(MyInput.isPressed(MyInput.BUTTON4)) {
            if(currentOption < options.length - 1) {
                currentOption++;
            }
        }
    }

}

And then the function that contains my game loop:

GamePanel.java:

public void run() {
    init();

    long start;
    long elapsed;
    long wait;
    boolean first = true;

    //game loop
    while(isRunning) {

        //start time
        start = System.nanoTime();

        update();
        draw();
        drawToScreen();

        //time elapsed
        elapsed = System.nanoTime() - start;

        //frame wait
        wait = targetTime - elapsed / 1000000;

        if(wait < 0) {
            wait = wait + 20;
        }

        try {
            Thread.sleep(wait);
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
}

I'm getting the error in the Thread.sleep(wait). It says I have a negative value for wait, but in debugging, the value never appears to be negative.

If you need any more information, let me know and I'll post it.


texts: How can I prevent players from reading a puzzle solution out of the game's code?

texts:
I'm sure you know of the part in Five Nights at Freddy's 3 where you input the reverse of the hex code for purple into a wall and something happens (I forget what).
I want to implement something similar in a game I'm making, but I'm worried about people looking at the code for the game or hacking into it to figure out what to do.
I wonder whether fnaf somehow prevented people from just decompiling the code and seeing what code to enter. How could I do something similar?


texts: Why do mesh classes still contain vertex arrays if VBO's exist?

texts:
I find I'm a bit confused about the practical use of resource management in combination with memory not tied to the CPU. Correct resource management is often recommended in game tutorials, books and on websites to ensure the same heavy data is not loaded in memory more than once, but cached and passed out whenever needed. This seems to be a valid idea and I've built a couple of resource management classes more than once.

Resource caches work perfectly for, say, level data or audio files, but my understanding always comes crashing down as soon as we're talking about memory residing on the GPU (vbo's, textures). It would seem to me that a mesh resource class should have to store nothing more than a vbo index, yet every mesh class I look at (e.g. Ogre3D) manually stores vertex lists in mesh classes. I can't seem to grasp why that is done. What's the use of vbo's if you're storing the mesh data in your usual memory anyway?

This question is not about how vbo's work (I understand them conceptually), but more about how they're practically applied in game development.

Could someone please elaborate?


texts: How can I make backtracking interesting?

texts:
When a player navigates a space for the first time, it is very interesting: the content is new, the dangers are unknown, paths need to be found. However, various situations force the player to backtrack, or navigate the same space multiple times. Perhaps the level designers are being economical, or trying to build familiarity with a space. Perhaps the game itself is open-ended, or like a sandbox, where navigating the same spaces is part of the game itself. These can make the same spaces seem tedious and sparse.

Given that backtracking (or navigating the same space multiple times) is unavoidable, what are some effective, economical ways of making it interesting? Please keep in mind:

We are reusing levels deliberately, either for effect or to save on cost. Therefore modifying the levels beyond recognition would be against our intent.
We also cannot modify the gameplay too much; if we were attempting to save cost by reusing levels, incurring more costs by adding gameplay would be counterproductive.

One quick-fix I had in mind was to give the player some sort of powerup or vehicle so that they could backtrack faster. I'm sure there are better methods, and examples of games where they were used.


texts:
I create my own pet-project graphics engine for the learning and research purposes.
Now I'm trying to create a more efficient scene transformations update technique. My current approach is the linear encoded transormation tree as follows:
My tree node
    struct TreeNode
    {
        TransformIndex parent;
        TransformIndex firstChild;
        TransformIndex next;
        TransformIndex prev;
    };

It is contained in the vector
std::vector<TreeNode> tree_;

Also I have world and local matrices for every node
    std::vector<mat4x4> worldTransforms_;
    std::vector<mat4x4> localTransforms_;

Couple of the dirty flags and the unused indices flags:
    using Flags = boost::dynamic_bitset<uint64_t>;
    Flags worldDirty_;
    Flags localDirty_;
    Flags free_;

using this flags I insert the new nodes in the any free index, but always after their parent:
TransformIndex TransformTree::allocateIndex(TransformIndex parent)
{
    assert(parent < tree_.size() && !free_.test(parent));
    auto posIndex = free_.find_next(parent);
    if (posIndex == Flags::npos)
    {
        posIndex = static_cast<TransformIndex>(free_.size());
        resize(free_.size() * 2);
    }
    auto pos = static_cast<TransformIndex>(posIndex);
///........
}

so update of the world matrices at the begining of an every frame looks like this:
    for (auto index = worldDirty_.find_first(); index != Flags::npos; index = worldDirty_.find_next(index))
    {
        const auto parent = tree_[index].parent;
        assert(parent < index);
        worldTransforms_[index] = worldTransforms_[parent] * localTransforms_[index];
        worldDirty_.set(index, false);
    }

It's quite fast, but not as good as it can be.
Main issue here that it's unparallelable since every single matrix update depends on another matrix somewhere back in the array and we have to know it's already updated.
I want to find a way to change the data structure and/or algorithm to be done in parallel. Also it's would be nice to do it in the compute shader in the future. I've googled for a decent time, but couldn't find any examples of it beyond the basic mentions that such algorithms exist and used in modern engines.
Please, give me any advices, how to improve my implementation to make it parallelisable.


texts: I'm making a 2D sandbox tycoon in UE4. I haven't started the money system yet, but I was wondering how I could make a money system that gives you a certain amount of money per real-life minute. Then, I want to connect this system up to some text so that the digits go up by whatever amount each minute.


texts: Map video texture to a half sphere in Unity

texts:
I'm new to unity3D. and am trying to play a 360-degree video. But instead of mapping the whole 360-degree (equirectangular) video to the whole sphere, I need to map the half-video to a half-sphere object. How can I do that? So basically we'll have two half-sphere, tied together, each playing the half of 360-degree video, as if a single video is mapped to a whole sphere. An example or tutorial for a beginner would be great.

e.g. So the top half of this 360 video should be textured on such mesh

UPDATE: No worries...we not cropping the video on the go! It is already cropped as two separate videos)


texts: How to correctly set window size in Libgdx scene2d.ui dialog

texts:
In my libGDX application I am using the scene2d.ui classes to render my game's GUI. One of the things I render via these classes is a dialog window with a background image set. I have created the uiskin.json file accordingly, and the dialog is shown correctly with the background image.

There is one catch however: The size of the dialog window is exactly set to fit the text elements, but not more. If not much text is shown on the dialog, then the background image is rendered much smaller than it really is.

I can override or hard-code the window size by overriding getPrefWidth() and getPrefHeight() in my custom Dialog class. But that does not feel right.

My question: What is the correct way to set a scene2d.ui dialog with a background image to be as large as that background image, regardless of how much text is being shown?


texts: I recently made the transition from xna to monogame, but I am now stuck in a pretty big problem. I do not have an xbox 360 controller, so i have been using x360ce and dropping the .dll into the xna debug folder, and my gamepad would work fine. However, the same does not work with monogame. Is there a way in which I can use a non-xbox controller with monogame?


texts: Do I need Texture Units when NOT using shaders?

texts:
Does calling glActiveTexture() even make sense when not using shaders?

I only have to switch the textures before drawing a buffer with glBindTexture(), right?


texts: Bouncing ball loses its forward momentum after the first bounce

texts:
I've created a bouncing ball in Unity, and I want to bounce the ball across the field, but the results I get seem very unrealistic.
The ball should bounce in the direction it was launched 2 or 3 more times, but after the first launch the next bounce is bouncing at the same place, going straight into the air. I also didn't see any spin effect on the ball. How can solve this problem?

And here's my physics settings


texts:
I am working on an iPad game, and would like to have a few, pre-rendered cut scenes that are shown at key moments throughout the game.

How do low-budget software developers create pre-rendered cut scenes, especially when the target device is an iPad?


texts:
I am using Unity 4.6 new UI. I have my project setup on bit bucket (using GIT). It was working fine but when I cloned the project on another macbook. All the unity new UI scripts went missing. Is there any workaround for this issue ?

I am using same unity version on both macbooks. Editor Settings screenshot attached

Ref of inspector where scripts went missing.
[Editor Settings


texts: Getting .mesh & .skeleton from Blender2Ogre export

texts:
I have downloaded the add-on blender2ogre from this source :
http://code.google.com/p/blender2ogre/

And I have created a simple mesh, with walking animation (similar to the gingerbreadman tutorial). My question is, whenever I want to export the project, I can only see the .scene export format. There is no option whatsoever to export as .mesh and .skeleton. Also, how can I export the walking animation separately, in other words, if my project have couple more animation, how can i separate those during export?


texts: Physics2D.Raycast not hitting any colliders

texts:
I am making a topdown 2d game and want to get the x,y of mouse clicks so I can move the character to that location.

I am writing a CharacterController script which performs the mouse-click check and raycast in the Update function:

void Update () {
    if (Input.GetMouseButtonDown (0)) {
        RaycastHit2D hit = Physics2D.Raycast(Input.mousePosition, -Vector2.up);
        if (hit.collider != null) {
            Debug.Log (hit.point);
        }
    }

This runs whenever I click the mouse, but the if(hit.collider != null) condition is never met.

I've looked around for other solutions, such as Unity - Raycast not hitting to BoxCollider2D objects, but when I change my code to the one used in that answer:

RaycastHit2D hit = Physics2D.Raycast(
  Camera.main.ScreenToWorldPoint(Input.mousePosition),
  Vector3.back
);

then the if(hit.collider != null) block is always true, even if I click on empty space, and it always returns the same coordinate. To illustrate this, here is a video of me clicking the game view. The green area has a 2d box collider that is very closely mapped to its boundaries. You can see that the logged hit.point is always the same.

video is here - https://i.imgur.com/uhNp8wC.gifv

screenshot -


texts: How would I get the physical button name (A, B, C) by the name set up in the Input Manager (Fire1, Reload, Jump)? For instance, if the player needs to reload his gun, I want to print "PRESS [RELOAD BUTTON] TO RELOAD" on screen where [RELOAD BUTTON] is whatever he assigned it to. I don't see anything helpful in the Input class, where else can I look?


texts:
I've looked at a few tutorials about picking and the method Unproject, so I have an idea of how getting the mouse in 3d space is done. The code I have does display a mouse position, but it is way off of the actual position the mouse is at.

    public Vector3 FindWhereClicked(MouseState ms)
    {
        Vector3 nearScreen = new Vector3(ms.X, ms.Y, 0);
        Vector3 farScreen = new Vector3(ms.X, ms.Y, 1);
        Vector3 nearWorld = device.Viewport.Unproject(nearScreen, cam.proj, cam.view, Matrix.Identity);
        Vector3 farWorld = device.Viewport.Unproject(farScreen, cam.proj, cam.view, Matrix.Identity);

        Vector3 direction = farWorld - nearWorld;

        float zFactor = -nearWorld.Y / direction.Y;

        Vector3 zeroWorldPoint = nearWorld + direction * zFactor;

        return zeroWorldPoint;
    }

This code is from another thread I found on here. I'm guessing the problem is the near and far world variables.

    public ThirdPersonCam()
    {
        proj = Matrix.CreatePerspectiveFieldOfView(0.78f, 1.7777f, 1f, 10000f);
    }

    public void CameraUpdate(Matrix objectToFollow)
    {
        Vector3 camPosition = objectToFollow.Translation + (objectToFollow.Backward * 10) + (objectToFollow.Up * 2);
        Vector3 camTarget = objectToFollow.Translation;

        view = Matrix.CreateLookAt(camPosition, camTarget, Vector3.Up);
    }

The variables are grabbed from my camera class, but I don't know why it isn't working. A point that's supposed to be at 0, 0, 0 ends up being at something like 36, -1, 57


texts: Search gamedev companies and vacancies by game genre

texts:
My favourite game genre is quest/adventure and I am a C++ game programmer and game designer from Europe.

I visited a lot of job search & employment websites, but did not find any with a function to search a company by genre preferences. Such prefered genres are defined by company's released titles, current active projects, etc.

Do you know such companies or search sites? Which search strategies would you recommend?


texts: Are there multiple valid definitions for what translate, rotate and scale do?

texts:
Are there multiple valid definitions for what translate, rotate and scale do to the 4x4 matrix?

I bring up this question, because I have a simple webgl program that draws a square and does a few translate, rotate, and scale transformations. When I originally wrote the program I was using glMatrix v0.9.5. I upgraded the glMatrix to v2.2 and now the square is in a different position and rotation.

I'm fairly certain I correctly upgraded the program to use the new version, since the program was so small to begin with.

Regardless of what is happening to my program, I'm very interested to know if translate, rotate, and scale have a single universal definition or if different graphics engines / matrix libraries can have different definitions for what the transforms do.

Further details:

No transformations (origin is at the top left corner)

The square program with the following transformations:

translate   x: 250, y: 250, z: 0

rotate around Z axis   angle: -90

Finally the square program with the following transformations:

translate   x: 250, y: 250, z: 0

rotate around Z axis   angle: -90

translate   x: 150, y: 0, z: 0


texts: Recap on how a camera works in 3d Space?

texts:
This may be marked as a duplicate, but I have been trouble thinking about a camera.

I understand that there is a "camera transform," or view matrix. However, this is multiplied with every vertex in the scene when the camera is looking towards the negative Z axis at the origin. Do I move the camera around and then find a translation, rotation matrix to transform the camera to the origin, looking at the negative Z axis and multiply each point by this matrix (in addition to the camera transform later)? Or do I simply always keep the camera at the origin looking towards the negative Z axis, and "move" the world around it? If this is the case, how do I move the world around it? I am looking for the most efficient one.

NOTE: NOT USING OPENGL OR DIRECTX OR ANY OTHER API OUT THERE


texts: Unity Video Player: Resolution exceeds the Microsoft Media Foundation decoder limit

texts:
I'm using Unity's Video Player component to play a short intro video before the main menu.
The problem is that its resolution is 2560x1440, and on Windows 7 or earlier operating systems it says:
Context: Setting media type for first video stream
Error details: The data specified for the media type is invalid, inconsistent, or not supported by this object.
Track types:
   Audio Track, type: %10%16
   Video Track [2560 x 1440], type: H264
      Resolution exceeds the Microsoft Media Foundation  decoder limit of 1920 x 1088 on Windows 7 and below.

Is there a way to check whether it's supported or not? Because then I could change the played video to a lower resolution version. And if that's not supported as well, I would just skip the intro all-together.
I would be happy with other solutions as well.
EDIT: What I'm trying now is:

subscribing to errorReceived,

and if currently it's the 1440p version, I switch back to the 1080p version and play it.

If errorReceived is fired again (so the current version is 1080p), I just skip the whole intro phase.
 videoPlayer.errorReceived += OnErrorReceived;

 ...

 private void OnErrorReceived(VideoPlayer videoPlayer, string message)
 {
     if (videoPlayer.clip == Intro1440p)
     {
         OnIntroFinished(videoPlayer);
         videoPlayer.clip = Intro1080p;
         videoPlayer.Play();
     }
     else
     {
         OnIntroFinished(videoPlayer);
     }
 }

Now the intro is skipped if no suitable format is found, which is good, but for some reason even the 1080p version is unsupported:
Context: Setting media type for first video stream
Error details: The data specified for the media type is invalid, inconsistent, or not supported by this object.
Track types:
   Audio Track, type: %10%16
   Video Track [1920 x 1080], type: H264

I've now added an 1080p wmv version, after all that's a Windows format, it must be supported by Windows 7.
But it's still unsupported:
Context: Setting media type for first video stream
Error details: The data specified for the media type is invalid, inconsistent, or not supported by this object.
Track types:
   Audio Track, type: a%01
   Video Track [1440 x 1080], type: WMV3


texts: 2D game collision response: SAT & minimum displacement along a given axis?

texts:
I'm trying to implement a collision system in a 2D game I'm making. The separating axis theorem (as described by metanet's collision tutorial) seems like an efficient and robust way of handling collision detection, but I don't quite like the collision response method they use. By blindly displacing along the axis of least overlap, the algorithm simply ignores the previous position of the moving object, which means that it doesn't collide with the stationary object so much as it enters it and then bounces out.

Here's an example of a situation where this would matter:

According to the SAT method described above, the rectangle would simply pop out of the triangle perpendicular to its hypotenuse:

However, realistically, the rectangle should stop at the lower right corner of the triangle, as that would be the point of first collision if it were moving continuously along its displacement vector:

Now, this might not actually matter during gameplay, but I'd love to know if there's a way of efficiently and generally attaining accurate displacements in this manner. I've been racking my brains over it for the past few days, and I don't want to give up yet!

(Cross-posted from StackOverflow, hope that's not against the rules!)


texts:
Just wondering what types of solutions are available to handle patching of PC/Mac games that don't have any sort of auto updater built into them.

In windows do you just spin off some sort of new install shield for the game that includes the updated files, hope you can read a valid registry key to point to the right directory, and overwrite files?

If so how does that translate over to Mac where the game is normally just distributed as straight up .app file?

Is there a better approach than the above for an already released product? (Assuming direct sells, and not through a marketplace that features auto-updating like Steam.)

Are there any off the shelf auto-updater type libraries that could also be easily integrated with a C/C++ code base even after a game has been shipped to make this a lot simpler, and that are cross platform?

Also how do auto-updaters work with new OS's that want applications and files digitally signed?


texts: Help With Rotating Turret and Muzzle Flare Sprites

texts:
I am making a top down game that involved tanks rotating their turrets and firing at other tanks.

I have the turrets rotating independently of the tank itself about the center. However, I am now trying to rotate a muzzle flare sprite animation around with the turret.

I am struggling with keeping the muzzle flare at the end of the barrel when the turret rotates.

Here is the two sprites lined up at position (0, 0):

And here is the position I would like the muzzle flare to be at:

The problem is, the muzzle flare does not maintain the offset (45, 8) when the turret rotates.

I have tried using the equations:

x2 = x * cos(theta) - y * sin(theta)

y2 = x * sin(theta) + y * cos(theta)

Where x = 45 and y = 8.

But I have had no luck.

Where is my math wrong?


texts: Coroutine not working, NullReferenceException Unity

texts:
When I run my game and collide with my object, I get a NullreferenceException error. I went through many posts I could find on Stackexchange and other websites, but nothing helped. When I did a Debug.Log, the Coroutine is triggered in both cases. I also checked my tags.

Coroutine:

public class Dialogue : MonoBehaviour {
public TextMeshProUGUI textDisplay;
public string[] sentences;
private int index;
public float typingSpeed;

public GameObject continueButton;

void Update() {
    if (textDisplay.text == sentences[index])
    {
        continueButton.SetActive(true);
    }
}

public IEnumerator Type() {
    foreach (char letter in sentences[index].ToCharArray())
    {
        textDisplay.text += letter;
        yield return new WaitForSeconds(0.01f);
    }
}

public void NextSentence() {
    continueButton.SetActive(false);

    if (index < sentences.Length - 1)
    {
        index++;
        textDisplay.text = "";
        StartCoroutine(Type());
    } else {
        textDisplay.text = "";
        continueButton.SetActive(false);
            }
    }
}

Coroutine call:

public class Mace : MonoBehaviour {
private Dialogue dialogue;

private void OnTriggerEnter2D(Collider2D otherCollider) {
    if (otherCollider.CompareTag("Player"))
    {
        StartCoroutine(dialogue.Type());
    }
  }
}

I did not cut my coroutine down more, as I think that all parts are at least somewhat relevant informations to my question.