texts:
So here is my model (bed sheets). I have an extra face right below it and I cannot delete it. I made it bigger for you guys but at first it was really small. I have no idea how that geometry got there. I used nCloth for the bed sheets and it was my first time using it, maybe that's where I screwed up.

I tried to separate the faces for the sheets and create a new object but I received that message: // Error: line 0: sheets has only one piece. Ignored.


texts: Input events slow on unity Update function

texts:
I have this running on the Update() on Unity.  I am trying to create a page swipe feature on my game, but the problem is there is a half second delay when printing "dragging" to "end drag" when I release the mouse.

Does anyone have a method that will register input events faster?

void Update()
{
    if(isDragOn)
    {
        if(Input.GetMouseButton(0))
        {
            print ("dragging");
            //moveContainers((Input.mousePosition.x - mouseLastPosition) * 0.01f);
            mouseLastPosition = Input.mousePosition.x;
        }
        else if(Input.GetMouseButtonUp(0))
        {
            print ("end drag");
            isDragMoved = false;
            isDragOn = false;
            endDrag();
        }
        else if(Input.touchCount > 0)
        {
            if(Input.GetTouch(0).phase == TouchPhase.Moved)
            {
                //moveContainers(Input.GetTouch(0).deltaPosition.x);
            }
            else if(Input.GetTouch(0).phase == TouchPhase.Ended)
            {
                isDragMoved = false;
                isDragOn = false;
                endDrag();
            }
        }
    }
}


texts: How to leave a permanent skidmark on the ground in unity2d

texts:
I am working on a 2D driving game.I have a sprite of a car.Set the car movement.Now I need to create a skid mark on the ground
 for that I have created a empte game object and added Trial Renderer component and set the skid mark material to it.The problem is that when i start moving the car ,the skid mark follows the car as if that a skid mark is attached to the car.

Is there any simple way to leave a permanent skid mark on the ground in unity2d.
Can anybody please help me


texts:
I have a 3D-Model, made in Maya and I am trying to parse that through the latest XNA with the SkinnedModelProcessor (However, this issue remains without that processor).

In Maya, the skin is already attached to the skeleton, so why am I getting this error?

  Input skeleton not found

Is there anything special I should think of when exporting that .fbx file from Maya?


texts: Does client side prediction sync with the server in the past?

texts:
I've spent some time now messing around and just trying to learn dead reckoning and client side prediction for the fun of it.  Most of what I do doesn't need it, so i've never had a need to go down the path.

I get how to predict the client and i've got a completely deterministic setup with a lockstep of 60fps for the physics on client and server.  Both client and server use the same movement code, and i'm using constant velocity to reduce complexity.  I also understand how to interpolate for corrections.  I also have the server and client ticking at nearly the same time (as close as one can really get it).

The problem i'm having, that doesn't seem clear to me in anything I've read (i'll put links at the end to a few things), is what does the client message sync against on the server? So, for example, the client is at 0, 0, 0, with a heading of 0, 0, 1 at tick 0.  At tick 5 the client presses the button to start moving forward at 40u/s and sends the message to the server.  We'll say that the trip to the server takes 50ms and 50ms back.  So the server gets the message at tick 8 (roughly), and here is where I am slightly lost.

The client sent the tick they pressed the button along with the position and new velocity.  Does the server do:

A. Look back at tick 5 and say "you're good b/c you were where you
should be at that tick"
B. Check against tick 8 and say "well you where at 0, 0, 0 at tick 8,
so you didn't start moving until then".

It would seem with B, which is what i'm currently doing, that the server is always sending back a correction.  B also has a bad side affect that when I stop, I'm almost never where the server is and the interpolation of this feels impossible to get right.

While with A, it would seem I have to redo all collisions for that object from tick 5 thru 8 on the server, but this sends less corrections and would give a smoother feel.  I understand that A is used for lag compensation when firing a weapon or taking some action that would affect other entities, but is that also used for motion?

Things I've read:
http://gafferongames.com/
http://www.gabrielgambetta.com/fpm1.html
Various articles out of books and other websites that seem to skip past this detail

Thanks in advance for any help.


texts:
Title says it all.

What's efficient way to draw a lot of textured cubes in XNA4?


texts: How do you Draw a path and have a GameObject follow it?

texts:
How would you go about creating a path that a gameobject would follow?

I'm looking to create similar functionality that you see in some RTS games.
most notability the Total War series does this well. here are a few screen shots for reference.

https://imgur.com/a/Zhi6pQu

Goal.

Click a Unit
Hold the mouse button down and drag to draw a line
Release the mouse button. unit follows path drawn


texts: Implementing a delay timer into triggered method

texts:
I have a shoot method that is used as a mouseDown() Trigger on my player. I am wanting to introduce a delayTimer but am unsure of how to do this within the method due to the trigger.

public void Shoot(){
    if (BulletsManager.bullets > 0 && facingRight == true) {
        playShotgunSound();
        Instantiate (Bullet, firePoint2.position, firePoint2.rotation);
        BulletsManager.SubtractPoints (bulletsToSubtract);
        facingLeft = false;
        facingRight = true;
    }

        if (BulletsManager.bullets > 0 && facingLeft == true) {
        playShotgunSound();
        Instantiate (Enemy, firePoint2.position, firePoint2.rotation);
        BulletsManager.SubtractPoints (bulletsToSubtract);
        facingLeft = true;
        facingRight = false;
    }
}

Could anybody advise as to how I'd implement it within this code?


texts: How do I get the GUI to draw above the kinematic bodies when their z_index is changed?

texts:
Currently the Labels in the GUI are below the player and other objects, so the player appears above them.
How can this be fixed?

extends Node
var load_1 = true

    onready var level = preload("res://scenes/levels/Level.tscn")

    var Level = null

    func _ready():
        Level = level.instance()

        add_child(Level)
        move_child(Level, 0)
        VisualServer.canvas_item_set_z_index($GUI/Label3, 4000)
        print("I'm here")

    func _process(delta):
        getallnodes(self)
        pass

    func set_z_index(node):
        for N in node.get_children():
            if N.get_class() == "KinematicBody2D":
                N.z_index = N.position.y

    func getallnodes(node):
        for N in node.get_children():
            if N.get_child_count() > 0 and N.get_class() != "RigidBody2D" and N.get_class() != "KinematicBody2D" and N.get_class() != "StaticBody2D":
                getallnodes(N)
            else:

                if N.get_class() == "KinematicBody2D" or N.get_class() == "RigidBody2D":
                    setZOrder_kine(N)
                    print("- "+N.get_name())
                if N.get_class() == "StaticBody2D":
                    setZOrder_kine(N)
                    print("- "+N.get_name())
                elif N.get_class() == "Sprite":
                    setZOrder(N)
                    print("- "+N.get_name())

    func setZOrder_kine(node):
        for N in node.get_children():
            if N.get_class() == "Sprite":
                var myPos = N.get_global_transform().get_origin()
                var mySize = N.get_texture().get_height()
                var bottomOfSprite = (mySize*N.get_scale().y * N.get_parent().get_scale().y)/(2 * N.vframes)
                N.get_parent().z_index = (myPos.y+bottomOfSprite)

    func setZOrder(N):
        var myPos = N.get_global_transform().get_origin()
        var mySize = N.get_texture().get_height()
        var bottomOfSprite = (mySize*N.get_scale().y)/(2 * N.vframes)
        N.z_index = (myPos.y+bottomOfSprite)

    func _physics_process(delta):

        if(Level.get_node("Player")):

            $GUI/Label.text = "Velocity: " + str(Level.get_node("Player").velocity.length()) + ", " + str(Level.get_node("Player").velocity.x) + ", " + str( Level.get_node("Player").velocity.y)
            $GUI/Label2.text = "Position: " + str(Level.get_node("Player").position.x) + ", " + str(Level.get_node("Player").position.y) + ", " + str(Level.get_node("Player").z_index)
            $GUI/Label3.text = "Sword: " + "rotation " + str(Level.get_node("Player").rotation)
            $GUI/Label4.text = "stamina" + str(Level.get_node("Player").stam.current) + "attack_charge: " + str(Level.get_node("Player").stab.charge.current) + "countdown: " + str(Level.get_node("Player").stab_countdown[0]) + "cooldown: " + str(Level.get_node("Player").stab_cooldown[0])


texts: How to prevent accelerating along wall during 2d sliding collision response

texts:
I'm writing a simple 2d physics system using a circle colliding with edges. When the user presses a key the circle's velocity is incremented by some amount in the direction they pressed. There is currently no friction, although that shouldn't be relevant (for example if a character is jumping there's often no friction until landing but walls should still work correctly). There is also a limit to the magnitude of the velocity vector.

When the circle collides with an edge its velocity is projected along the surface of the edge. This allows the circle to slide along the walls, however it causes the circle to accelerate along the surface instead of move at the expected constant speed. Here's a diagram to demonstrate this:

On the left is the first iteration where the red vector represents the velocity and the green vector represents the amount added to the velocity from user input. This combined vector is projected on the wall to produce the blue vector.

On the right is the second iteration where the same green vector as before is added to the current velocity (the same projected velocity from the first iteration), and this resultant vector is projected along the surface to produce the new purple velocity vector.

As you can see the purple vector is larger than the blue one meaning that the circle is moving faster on the second iteration than the first and therefore is accelerating along the wall. The character will continue to accelerate on consecutive iterations along the wall until reaching the maximum speed.

I understand why this happens, however I'm struggling to figure out how to change the logic so that it'll behave in the way games typically handle this. Typically characters accelerate more slowly and have a smaller apparent speed cap the more perpendicular they are moving relative to the wall's surface.


texts:
I'm making a small spreadsheet that tracks the amount of kills my wrench's eaten over time in TF2.  So far I've been manually copy pasting fields from the TF2 window, but hey, Steam does have some API I could consume, and Google Spreadsheets can consume XML too. This number I'm tracking should also be exposed by the GetPlayerItems route, so I should be golden!

Except the Steam Web API requires a domain-bound authorization key (!). I don't own docs.google.com, so I can't get one. Thus, I cannot make the API call.

Is there some kind of API proxy service for the Steam Web API so that I can query the API without having to buy a whole damn domain for such a simple use case? ...or do I have to resort to scraping middle men such as tf2b.com?


texts: What are the technologies used to create Metal Gear game?

texts:
What are the technologies (programming languages and engines for example) used to create "Metal Gear : Snake Eater" and "Metal Gear : Guns of The Patriots"?

Is it usual to keep those things secret?


texts: i'm newly working with opengl. I'm trying to create a simple program that will simulate fire. My question is what are the ways other than particle effects to simulate fire. And can fire simulation really be done without particle system effect??


texts: Unity- how to render-to-texture with VR distortion

texts:
I've also asked the question here http://answers.unity3d.com/questions/1392099/how-to-set-a-render-to-texture-camera-to-be-a-vr-c.html (but it's currently "under moderation")

So, I want to do some post processing effects in VR. I put a camera as a child of the Main Camera and set it to render-to-texture. Then, I take what is rendered, and display it (with my post-proc shader) on a quad in front of the Main Camera (The main camera and the child camera render different layers, so I don't render the same thing twice). (Also worth noting- I know that the depth will be collapsed out of the rendered-to-texture content; this is intentional.) The problem is, in this process, the positional data (that was rendered to texture) gets misaligned.

I've already fixed a problem where I have to manually set camera_project.GetComponent<Camera>().aspect = main_camera.GetComponent<Camera>().aspect; every frame. (Changing/setting the screen size auto sets the aspect ratio of the main camera- it does not automatically set the aspect ratio of the child camera.

So, with just that, everything lines up great and looks fine when it isn't in VR. But, when it is in VR, it appears that maybe some distortion is happening to the main camera that isn't happening to the render-to-texture camera, and thus, the overlay (the post-proc'd content) isn't lining up.

So what can I do to emulate the VR distortion in the child camera? Are there other properties of the Main Camera that are getting auto-set in VR that I can manually copy to the Main Camera? (I also noticed that aspect wasn't listed in the camera documentation [https://docs.unity3d.com/Manual/class-Camera.html] unless you knew to search for it explicitly, so I think it might be likely there is some other property I'm missing?)


texts: Maya 2012: Is it possible to convert a single polygon to solid object?

texts: Is it possible to somehow extrude a single polygon into creating a solid object (ex: converting square polygon to cube)?


texts: Are C and Objective-C sufficient for creating games on the iOS?

texts:
These days, I'm focusing on games development on the iOS.
C++ is the lingua franca for games development but seriously, I prefer to code in C programming language, not in C++.

So for iOS games development, are C and Objective-C sufficient for creating games?


texts: How to implement accurate frame-rate-independent physics?

texts:
So, I have been working on a project for a while now and recently stumbled across a problem:

The common approach to frame-rate independent physics is to either use a fixed update interval (ie. Unity) or just multiply each physical change with delta.
So it would look something like this:

update(int delta)
{
   ...
   positionX += velocityX * delta;
   ...
}

And when acceleration is added, the velocity change is treated similar:

update(int delta)
{
   ...
   velocityX += accelerationX * delta;
   ...
}

This works fine for most use cases. In fact so fine, that I haven't noticed anything was off for months. But there is a problem with this logic, namely that the position will be slightly off for entirely different frame-rates. This problem is negligible when working with small frame-rate changes, but is entirely noticeable once the delta time is changing by bigger amounts. Say, FPS rate from 30 to 600. Now, in a normal game the FPS are just locked and even if the positions are off for a few frames by like 5% it doesn't matter because one doesn't notice it. But I manually multiply the delta with a factor to accomplish a certain effect, and the error is somewhat noticeable and game breaking.

A small example to clarify what I mean:

There is a game object with start position posX = 0 and a x-Velocity of 10 and an horizontal acceleration of 0.1.

After two frames, for 50FPS this would lead to (with an average delta)

velocityX += acceleration * delta;
posX += velocityX * delta;

velocityX += 0.1 * 20; //velocityX = 12
posX += 12 * 20 //posX = 240

//next frame

velocityX += 0.1 * 20; //velocityX = 14
posX += 14 * 20 //posX = 520 (240 + 280)

After one frame with 25FPS, which equals the same time interval like two frames with 50FPS, this would get us:

velocityX += 0.1 * 40; //velocityX = 14
posX += 14 * 40; //posX = 560

So two situations with the same time interval elapsed we get different results (520 for 50FPS and 560 for 25FPS).

Now, the problem obviously is that there is one extra frame (in this example, it could be any number of frames but the results still differ for the same interval) in which the acceleration is applied and therefore you get further with less FPS.

Stabilizing the delta is not an option as I need different deltas for said effect, so I need to physics to be entirely independent there. Has anyone ever come across a similar situation and are there any solutions for it?


texts:
There are a couple of questions like this already. This one is different because it is specifically about rendering, as opposed to navigation and generation. I've implemented suggestions from here already.

The current optimisations are:

Only render block faces that aren't adjacent to another face
Render blocks in chunks, each chunk as one mesh (VAO)

According to the NetBeans profiler, 96% of time is spent on the glfwSwapBuffers(long window) method, which is when OpenGL renders the scene. This implies that my other operations are efficient enough, compared to rendering.

What else can I do to improve rendering performance?

The chunk size is 16x16x16 voxels. Sample renders and FPS:

64 chunks : 500 FPS
125 chunks : 300 FPS
1000 chunks : 45 FPS
4096 chunks : 12 FPS


texts: Why does a UI button that is child to a canvas not appear in game view?

texts:
I am trying to place a button onto a canvas background using C# script.
I want the button specific to the canvas (i.e., if I move the camera to look at another canvas, I do not want the button visible).

My C# script is below. I have attached it to an empty game object.
When I run the game, the Heirarchy panel of Unity shows that the canvas and button are created OK, and that
the button is a child of the canvas.
The canvas appears in game view at the right size (200 x 200).

But in game view, there is no button!

The button is definitely present ; clicking on its name the Heirarchy panel shows me a location and size in the scene view that are exactly as specified in my C# script.
But nothing happens when I click the region in game view where the button is supposedly present.

Unity's Inspector panel shows that a "Button (Script)" has been attached to my button object, with Rect Transform parameters as specified in my C# code.
I tried messing with the colors, but still no button.
The "On Click()" window contains nothing except the message "List is Empty".

How do I make the button appear in game view?

How do I make the button work (i.e., generate the Console message "button pressed")?

using UnityEngine;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine.EventSystems;

public class TestScript : MonoBehaviour {

private GameObject myGO;
private Vector2 buttonSize;
private Vector3 buttonPosition;

void Start () {
// setup a canvas
    myGO = new GameObject ();
    Canvas myCanvas = myGO.GetComponent<Canvas> ();
    myCanvas.renderMode = RenderMode.WorldSpace;
    RectTransform parentRectTransform = myGO.GetComponent<RectTransform> ();
    parentRectTransform.sizeDelta = new Vector2 (200, 200); // set size of parent rectangle

// create and place the button
    Vector2 buttonSize = new Vector2 (10, 10);
    Vector3 buttonPosition = new Vector3 (150, -70, 1);

    CreateButton (myGO.transform, buttonPosition, buttonSize);
}  // end Start()

public void CreateButton(Transform panel ,Vector3 position, Vector2 size)
{
    GameObject button = new GameObject();
    button.name = "Button";
    button.transform.parent = panel;
    button.AddComponent<RectTransform>();
    button.AddComponent<Button>().onClick.AddListener (handleButton);
    button.transform.position = position;
}

void handleButton() {
    Debug.Log("Button pressed!");
}

} //  end class TestScript


texts: Is there any algorithm for creating 3D lightning?

texts:
Is there any algorithm for generating lightning?
Lets say, you input the starting and ending coordinates (x,y,z) and out comes an array of coordinates to show where the lightning goes.
It doesn't have to be scientifically accurate but as long it looks random and unpredictable

EDIT: I found this, but can't figure out how to put this in to C/++ code. There is a 2D example provided but I want 3D :O

EDIT2: The output might be something like this:

struct coord3 { int x, y, z; };

struct line
{
    unsigned char lumo;
    coord3 start;
    coord3 end;
};

line* lightning = new line[n]; // each element of the array would be a line that
                               // needs to be drawn for the lightning so the
                               // lightning can "fork" and can have different
                               // brightnesses


texts: Collision Detection with SAT: False Collision for Diagonal Movement Towards Vertical Tile-Walls?

texts:
I'm developing my first tile-based 2D-game with Javascript. To learn the basics, I decided to write my own "game engine". I have successfully implemented collision detection using the separating axis theorem, but I've run into a problem that I can't quite wrap my head around.

If I press the [up] and [left] arrow-keys simultaneously, my character moves diagonally towards the upper left. If he hits a horizontal wall, he'll just keep moving in x-direction.

The same goes for [up] and [left] as well as downward-diagonal movements, it works as intended:

Diagonal movement works fine for horizontal walls, for both left and right-movement

However: this does not work for vertical walls.

Instead of keeping movement in y-direction, he'll just stop as soon as he "enters" a new tile on the y-axis.

So for some reason SAT thinks my character is colliding vertically with tiles from vertical walls:

My character stops because he thinks that he is colliding vertically with tiles from the wall on the right.

This only occurs, when:

Moving into top-right direction towards the right wall
Moving into top-left direction towards the left wall

Bottom-right and bottom-left movement work: the character keeps moving in y-direction as intended.

Is this inherited from the way SAT works or is there a problem with my implementation? What can I do to solve my problem?

Oh yeah, my character is displayed as a circle but he's actually a rectangular polygon for the collision detection.

Thank you very much for your help.


texts:
For a strategy game, the area "already explored" has to be saved to a DB, so that the player can (upon resuming his game) see where he has already been.

The game will be a mmo-game, so i have to handle lots of users - each with perhaps 100x100 fields or more that are already explored.

I thought about client sided creating of a bitmap (each field with value 0 = unexplored or 1 = explored), then sending it to the server database to save it as a blob.

Has somebody already tried that solution or has choosen another (better) one?


texts: Is triangle count so much cheaper on hard surface models that on animated meshes?

texts:
I have a human character that consists of 40k triangles.
When I animated him, I noticed a huge impact on the frame rate.

Then I created a 10k tris version of the same model and animated him, and the frame rate was significantly higher.

I would like to ask if there is any formula or any other way to compare this situation with a high-poly model of a hard surface model against a low poly version of a hard surface model.

For example, I see some 3D model vendors that offer weapons for FPS games, and they call their weapons with 25k tris "lo poly".

Am I missing something here?

Is it really so cheap (for some reason that I haven't found out) to throw 25k of hard surface geometry to CPU or GPU, and it wouldn't make a noticable difference in comparision to a 3k tris hard surface model?

I'm working with Unity and HDRP, if that is important for an estimation.

Thank you.


texts: picking 3D objects rendered using instancing

texts: i have a peice of code that renders a 3D image, say a cube. I require 3 cubes in in different locations, this is done using instancing and i am able to render the cube in 3 different locations. However, i now need to pick any of the 3 cubes. I am pretty new to DirectX(11) and searches online did not yeild any answers. So how i pick an object when i only have a single set of vertices(triangle) used for the render?


texts: Why not draw a custom font with lines and/or polygons?

texts:
Reasons/advantages I see:

More flexible procedural animation.
Completely custom font.
Performance (no texturing or high-poly)?
No assets (unless data-driven).
Multi-resolution compared to sprite fonts / sprites.

Downsides I see:

Effort and time to define every character.
Effort and time to implement the general code.
Future localization pain.

Example: https://youtu.be/Tz7L-92Bo-M?t=2m13s

Is this unreasonable and why?
Will I get a rendering performance win compared to sprite fonts on common multi-core mobile devices?


texts: Assigning a different texture based on picking

texts:
I'm making a game using XNA.  I have some simple objects like cube and sphere, and I would like to change the texture of one face of these objects based on picking.  That is, when the cursor is over one face, it turns red.  The only way I've seen to do this is to overload the content processor as here: http://xbox.create.msdn.com/en-US/education/catalog/sample/picking_triangle

but it seems like it shouldn't be this complicated.  I'm using .x models, and would like to be able to implement this for more complex models in the future beyond cubes/spheres/etc.  Is this the best/only way to go about it?  I'll figure that out if that's what is necessary, but it seems that there would be a simpler solution to load a different texture to a face than I've seen, I just don't know what it is.


texts: C# Events in Unity to separate GameObject features into Components

texts:
Broadly speaking, this is a question about how to separate my game object's code into distinct feature components that can be added and removed as needed.
More specifically, I am trying to achieve this using C# events in Unity. But I am open to other solutions.
Scenario: We have enemies that have health. When their health reaches zero, they die. Some enemies (think asteroids) may spawn a number of child enemies (think smaller astroid pieces) when they die. Others however, just die.
I want to have two scripts:

EnemyHealth: Tracks the enemy's health and kills the enemy when its health reaches zero.
EnemyChildrenSpawner: Spawns child enemies after the enemy's death

This way, all enemies will have the EnemyHealth script, and some enemies will have the EnemyChildrenSpawner script in addition.

My idea is to have the EnemyHealth script raise an event when the enemy dies, and have EnemyChildrenSpawner subscribe to said event to spawn the children.
What would be the best way of achieving this?
Here's my attempt. It works. Just not sure if this is good practice, especially using the GetComponent in the second script?
EnemyHealth.cs
public class EnemyHealth : MonoBehaviour
{
    // The event to invoke when this enemy died
    public event EventHandler OnDied;

    // Gets called when this enemy's health reached zero
    private void Die()
    {
        // Invoke the died event
        OnDied?.Invoke(this, EventArgs.Empty);

        // Destroy this enemy
    }
}

EnemyChildrenSpawner.cs
public class EnemyChildrenSpawner : MonoBehaviour
{
    private void OnEnable()
    {
        GetComponent<EnemyHealth>().OnDied += SpawnChildren;
    }

    private void OnDisable()
    {
        GetComponent<EnemyHealth>().OnDied -= SpawnChildren;
    }

    private void SpawnChildren(object sender, EventArgs e)
    {
        // Spawn children
    }
}

```


texts: Read an object from compressed file generated from ActionScript 3

texts:
I have made a simple game Map Editor and I want to save a array that contain map tile info to a file, as below:

var arr:Array = [.....2d tile info in it...];
var ba:ByteArray = new ByteArray();
ba.writeObject(arr);
ba.compress();
var file:File = new File();
file.save(ba);

I had successfully saved a compressed object to a file.
Now the problem is my server side need to read this file and decompress the array out from the file, then convert it to a Python list.  Is that possible?


texts: Farseer - Difference between Position, GetLocalVector, and GetWorldVector

texts:
I have used Box2D extensively, and am used to just calling body.GetPosition(). But Farseer does not have this. Instead it has a property Position, as well as methods GetLocalVector and GetWorldVector. Farseer seemingly has a complete lack of documentation, and I have been unable to figure out what the difference is.

Also, though I feel a bit dumb about it, I don't really get what GetWorldVector means as opposed to GetLocalVector. They take a localVector and a worldVector as their respective arguments, but what does that mean? What is the difference between local and world vectors?

Any help is appreciated.


texts: How should bots be recognised in a game?

texts:
I'm interested in how bots are usually written.

Here's my situation:

I plan to make an online 2D mecha game in HTML5, and the server-side will be done with node. It is intended to be multiplayer, but I also want to make bots in case there aren't enough players.

How does my game logic see them, as players or as bots? Is there a standard by which I should make them? Also, any general tips and hints will be OK.


texts:
Possible Duplicate:
  Polling vs event driven input

I'm trying to teach myself a bit of game development using Pygame, and I'm unsure what's the best way to approach some of the fundamental parts of a game. For example, I've made a tiny 2D game where a sprite can move around the screen, seen from the top like a classic RPG. I'm using an event loop, and whenever I detect the right arrow key being pressed, I start the character walking right, and whenever I detect the key being released, it stops walking right, etc.

My question is if this is the best way to do it, or if it is better to check the state of the key at each step, and move right if the key is down, etc. I originally thought that it would be best to listen for events, as the player might conceivably press and release a key between two timesteps, thus making the game miss the event if it only checks the state of the key at each timestep.

I imagine for things like attack, which would start at or soon after the press of a key, and then last for a certain amount of time regardless of the state of the key, it would be best to listen for events. For things like movement, however, which typically lasts for as long as the key is pressed, it might be better to check the state of the key.

Any thoughts? Also, any links to a tutorial or textbook on game design which discusses these kinds of low level decisions would be great.


texts:
What are the options and mechanics for creating a grappling hook in a 2D game?

In the prototype for this feature, the person runs around in a platformer world and can throw the hook at any wall, where it sticks and shows a line to the player sprite. So that part (the easy part) is solved. But what options are available now for getting a rather good looking (not necessarily "correct") Tarzan-style grappling hook going, e.g. one allowing some kind of neat-looking swings?

(I understand several different approaches of how the mechanics could work are available; I'm looking for a simple one that may make some compromises and not be entirely physical, e.g. perhaps something which attracts the player to the hook center for a while or so while keeping to a certain rope min distance or such.)

I'm using JavaScript/ ImpactJS, by the way. Thanks!


texts: Does it matter what file type my save file is?

texts:
So, I am looking into game development, and I just learned how save files work and how to create and implement them. Here is the code that I was using on Dev C++:

// basic file operations
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;

int main () {
    string line;
    ifstream saveFiles ("save.txt");
    if (saveFiles.is_open()) {
        getline (saveFiles, line);
        string arr[2];
        int i = 0;
        stringstream ssin(line);
        while (i < 2){
            ssin >> arr[i];
            ++i;
        }
        saveFiles.close();
        cout << "You have " << arr[0] << " hearts" << endl;
        cout << "You have " << arr[1] << " food";
    }
    else {
        cout << "Hearts > ";
        int hearts;
        cin >> hearts;
        cout << "Food > ";
        int food;
        cin >> food;
        ofstream saveFile;
        saveFile.open("save.txt");
        saveFile << hearts << " " << food;
        saveFile.close();
    }
    return 0;
}

For me, this checks if there is a save file, if there isn't, asks for input and then saves it. Then, when they come back, it checks again and it finds the file and gives you the data. This seems like it'd be how you make a save file (instead you likely wouldn't directly enter information like in my example).

As you can see, I create a save.txt file and it works fine. However, for games that I've run (like Minecraft), it doesn't use a .txt file. What difference does it make and what would work best for me (in any example)?


texts: Correct texture format for Moai with TexturePacker

texts: We are going to use TexturePacker to create our texture atlases for a Moai-based game. I'm wondering what the correct texture format and image format is to use specifically for Moai. Should I just use png and RGBA4444 or can you use pvr and PVRTC4? PVRTC4 format seems to create a texture that indicates less RAM usage but I'm unsure if we can use this format.


texts: Box2D/Farseer - Moving fixtures on a Static Body

texts:
I am attempting to create a Pool of Fixtures, in order to reduce memory consumption.  My problem is that when I attempt to return a Fixture to the Pool and re-assign its position on the Parent Body, once it is repositioned the Fixture no longer provides any collision response with other world objects.

It seems that if you want to move a Fixture on a Static body, it needs to be destroyed and re-created.  This method doesn't allow me to use my Pool however.

Does anyone know if it is possible to move a Fixture on a Static Body?  I do not want to move the Body, but the Fixtures attached to it.


texts: How to represent a modular FSM for AI using ECS?

texts:
I am considering to implement AI using ECS which actually contradicts working with naive FSMs. My current idea is to have multiple components which represent the particular state an Entity that has a AIControllerComponent is currently in.

Let's say an enemy starts out with the mentioned AIControllerComponent as well as a EnemyIdleComponent. Now an EnemyIdleSystem would handle all those idle enemies and if it happens that a player comes too close it'd replace the EnemyIdleComponent with an EnemyChasePlayerComponent leaving the handling of this to EnemyChasePlayerSystem.

This approach is rather generic and I would basically end up with a bunch of enemies that have the very same behaviour. I was curious to know how I should combine this approach with some more modular states. At first I thought about adding an enum variable to AIControllerComponent which holds the type of the enemy but I can't really think of a decent solution to call different implementations inside of the EnemyFooSystems based on that particular enum value. Do you have any suggestions?

// EDIT: I am using pure ECS patterns and Jobs, as such MonoBehaviours and non-blittable types inside of IComponentData are not usable.


texts:
I want to draw cubes using textures.

void OperateWithMainMatrix(ESContext* esContext, GLfloat offsetX, GLfloat offsetY, GLfloat offsetZ) {

UserData *userData = (UserData*) esContext->userData;
ESMatrix modelview;
ESMatrix perspective;
    //Manipulation with matrix
    ...
    glVertexAttribPointer(userData->positionLoc, 3, GL_FLOAT, GL_FALSE, 0, cubeFaces);
    //in cubeFaces coordinates verticles cube
    glVertexAttribPointer(userData->normalLoc, 3, GL_FLOAT, GL_FALSE, 0, cubeFaces);
    //for normals (use in fragment shaider for textures)

    glEnableVertexAttribArray(userData->positionLoc);
    glEnableVertexAttribArray(userData->normalLoc);

    // Load the MVP matrix
    glUniformMatrix4fv(userData->mvpLoc, 1, GL_FALSE,
                       (GLfloat*)&userData->mvpMatrix.m[0][0]);

    //Bind base map
    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_CUBE_MAP, userData->baseMapTexId);

    //Set the base map sampler to texture unit to 0
    glUniform1i(userData->baseMapLoc, 0);

   // Draw the cube
    glDrawArrays(GL_TRIANGLES, 0, 36);
   }

(coordinates transformation is in OperateWithMainMatrix() )
Then Draw() function is called:

void Draw(ESContext *esContext)
{
   UserData *userData = esContext->userData;
   // Set the viewport
   glViewport(0, 0, esContext->width, esContext->height);

   // Clear the color buffer
   glClear(GL_COLOR_BUFFER_BIT);

   // Use the program object
   glUseProgram(userData->programObject);

  OperateWithMainMatrix(esContext, 0.0f, 0.0f, 0.0f);

  eglSwapBuffers(esContext->eglDisplay, esContext->eglSurface);
}

This work fine, but if I try to draw multiple cubes (next code for example):

void Draw(ESContext *esContext)
{ ...

    // Use the program object
    glUseProgram(userData->programObject);

    OperateWithMainMatrix(esContext, 2.0f, 0.0f, 0.0f);
    OperateWithMainMatrix(esContext, 1.0f, 0.0f, 0.0f);
    OperateWithMainMatrix(esContext, 0.0f, 0.0f, 0.0f);
    OperateWithMainMatrix(esContext, -1.0f, 0.0f, 0.0f);
    OperateWithMainMatrix(esContext, -2.0f, 0.0f, 0.0f);
    eglSwapBuffers(esContext->eglDisplay, esContext->eglSurface);
}

A side faces overlapes frontal face.
The side face of the right cube overlaps frontal face of the center cube.
How can i remove this effect and display miltiple cubes without it?


texts:
We are just finishing a mobile game for Android and iOS.
The image quality on iOS is subpar, and we are trying to understand why.
We are currently having two problems: the background, which is a gradient, is shown using few colors and the grandient's steps are very visible, and the fonts are pixelated.
I think both issues are clearly visible in this screenshot from the simulator (zoom in if needed):

The simulator is running an iPhone Xs with Graphics Quality Override set to High Quality.
I have disabled “Compressing PNG files”, but the result is the same. This issue is not always so visible, or, at least, not on all devices. On a smaller iPhone (e.g., 7, so 4.7"), there are no noticeable issues with the image quality and the font pixelation is minimal.
We are probably going to disable support for iPad because of this.
Do you have any hints on what we can do?
Thanks!


texts: Unity - kinematic rigidbody character calling OnCollisionEnter and OnCollsionExit on every frame for specific collisions

texts:
I'm encountering an issue with my character collider behavior. I have several elements that are relevant to this issue:

a "character" gameobject (capsule mesh), that is assigned with a kinematic rigidbody. It has a script with these methods:

OnCollisionEnter determines if the object has a "walkable" tag and if so, changes a "isGrounded" bool to true
OnCollisionExit is the opposite, it determines if the player has stopped colliding with this "walkable" object, and if so, turns the "isGrounded" bool to false
a "gravity" method, which applies a gravity force on the character if "isGrounded" is false

a "gravity" trigger collider, surrounding the entire game area. OnCollisionStay, this trigger applies a constant gravitational force upon the colliding character in a specified direction (in this case, the direction is -Y).
a "platform", a rigidbody with all position/rotation values locked. This is what the character object stands on top of, and when the character collides with it, the "isGrounded" value becomes true, and the character stops being affected by gravity.

This method works fine in my scene for multiple platforms. When the player lands on them, the OnCollisionEnter works, and when they are dragged off of them (in editor, no movement implemented yet), the OnCollisionExit works, and they start falling again (until they land and the collision enter triggers).

However, all those platforms which work are all either flat or sloped at a very slight angle. I am testing platforms at steeper angles, and find that at slopes of 30 degrees or higher, the player colliding with them causes both OnCollisionEnter and OnCollisionExit to be called every frame. This causes such a serious performance hit that it has even nearly crashed my computer in one instance (and my computer is able to run VR games, so it is hardly lacking in power!). I do not understand why it happens, as the object is clearly colliding with the slope, and as far as I can see, the object is not continuing to move after the initial collision (or at least the position values are not changing for the object). I thought it might be due to the object's orientation or due to the shape of the collider, but changing these variables did not have an effect on the problem.

It looks like the capsule is also never exactly hitting the ground, rather it is floating slightly above it. When I move the capsule to be inside of the platform, the error stops. The collider is the same size as the mesh, so I don't know why it is "colliding" before actually making contact. Is there something I can do to fix this problem? Reducing the collider size doesn't help either.

Can anyone offer insights as to why this problem is occurring, and tell me how I can fix it? Thank you for reading.


texts: A scriptManager (singleton) not storing a variable (in the same scene)

texts:
The script below is called every time I pickup an item and stores an instance of it in the array "mainInventory".

The problem is when I access the array after picking up another item its empty.

The script is on the MainCamera.

public class InventoryManager : MonoBehaviour
{
public static InventoryManager instance = null;
public Image inventoryPanel0;
public Image inventoryPanel1;
public Image inventoryPanel2;
public Image inventoryPanel3;
public Image inventoryPanel4;
public Image inventoryPanel5;
public Image inventoryPanel6;

private Item[] mainInventory;

// Use this for initialization
void Awake ()
{
    //Singleton
    if (instance == null)
        instance = this;
    else if (instance != this)
        Destroy(gameObject);

    mainInventory = new Item[7];
}

public void pickedUp(Item item)
{
    //Below checks which slot item belongs in
    bool positionFound = false;
    int currentPositionCheck = 0;

    while (!positionFound)
    {
        if (mainInventory[currentPositionCheck] == null)
            positionFound = true;
        else
            currentPositionCheck++;
    }

    //Adds item to slot
    mainInventory[currentPositionCheck] = item;

    //Adds image to inventory panel
    switch (currentPositionCheck)
    {
        case 0:
            inventoryPanel0.sprite = item.icon;
            break;
        case 1:
            inventoryPanel1.sprite = item.icon;
            break;
        case 2:
            inventoryPanel2.sprite = item.icon;
            break;
        case 3:
            inventoryPanel3.sprite = item.icon;
            break;
        case 4:
            inventoryPanel4.sprite = item.icon;
            break;
        case 5:
            inventoryPanel5.sprite = item.icon;
            break;
        case 6:
            inventoryPanel6.sprite = item.icon;
            break;
        default:
            Debug.LogError("Expand inventory", this);
            break;
    }

}
}

Item:

public class Item : MonoBehaviour {

public string name;
public Sprite icon;

private MessageManager messageManagerScript;
private InventoryManager inventoryManagerScript;
private bool inRange;

private void Start()
{
    //Gets managers
    GameObject managerContainer = GameObject.FindWithTag("MainCamera");
    if (managerContainer != null)
    {
        inventoryManagerScript = managerContainer.GetComponent<InventoryManager>();
        messageManagerScript = managerContainer.GetComponent<MessageManager>();
    }
    else
    {
        Debug.Log("Can't find camera containing maangers");
    }
}

// Update is called once per frame
void Update()
{
    //If in range and player presses key
    if (inRange && Input.GetKeyDown(KeyCode.F))
    {
        Destroy(gameObject);
        OnTriggerExit(new Collider());

        //Pickup item
        inventoryManagerScript.pickedUp(this);
    }

}

private void OnTriggerEnter(Collider other)
{
    inRange = true;

    //Displays pickup message
    if (other.gameObject.tag == "Player")
    {
        messageManagerScript.displayPickupMessage(name);
    }
}

private void OnTriggerExit(Collider other)
{
    //Removes pickup message
    messageManagerScript.removeDisplayMessage();

    inRange = false;
}

}


texts: Is there a game that is both voxel and polygons?

texts:
Looking to see the difference between the two technologies in a game experience and not in experiments - is there a half-decent game out there that has two modes - polygons and voxel?

EDIT

Games like minecraft that voxels are exaggerated to make the game appear like a retro is not the intention. The comparison I want to make is for games that attempted to deliver realistic experience like outcast. In addition it would be best to see the same assets in both versions so not characters in polygons and landscape in voxels.


texts:
I am looking to start development on a game that will have the server be written in Python/PyGame and the front end be in HTML5.  What I would like to do is, with as minimal impact as possible, open up a WebSocket or two to allow the server to push events to my browser.

Is this possible with Socket.IO, or do I need an extra layer to handle WebSockets?  I'd like to avoid importing and installing extra packages if possible.


texts: Space between randomly generated objects

texts:
Im not sure there is a going to be a simple answer for this question but Ill ask anyway. I am programming an endless scrolling game where the player's character is constantly "falling." As they fall  they dodge pinecones. I want the program to randomly generate pinecones (which it does right now); however, I need a way to check that there is enough space between pinecones so that the player's path is never accidentally blocked.

Simply programming a minimum distance between pinecones isn't hard. The problem is that I want to  allow some cones to be right next to each other, but still check to make sure there is space between others for the player to safely dodge pinecones. Basically, I do not want an equal amount of space between each pinecone all the time.

I've considered making a grid pattern that the pinecone spacing must abide by, but Im having trouble comparing spaces on the grid so that while some cones are allowed to be next to each other, others are not. If the question is unclear let me know and Ill try to explain better and include pictures or something.


texts: I have a question: if I have a VBO, and I have to change all the data inside it (because of resizing, ...), would it be more efficient to delete the old one and create a new one (and reallocate the memory for it), or change the data inside it using glBufferSubData?


texts: Changing color of UI Text in Unity into custom values

texts:
There are a few objects in the scene as well as a title. I want the title to change its text and color based on the object that is mouse-overed. The script below is added to each object that is intended to change the color and text of the title.

The title changes it's color correctly when values like Color.red are assigned but doesn't change color when values like new Color(254f, 152f, 203f).

public Text title;

void OnMouseEnter()
{
    switch(name)
    {
    CONDITION1:
        title.color = Color.yellow;  // works well
        break;

    CONDITION2:
        title.color = new Color(254f, 152f, 203f);  // doesn't work
        break;
    }

    title.text = name;
}

void OnMouseExit()
{
    title.text = "DEFAULT VALUE";
    title.color = Color.white;
}

Is there a specific reason to the former method to work and latter not to work? How can I change the color of the Text element with custom values?


texts: UDP client code throwing a very nonspecific exception

texts:
so I'm writing a UDP server and client on a couple of the machines in my virtual reality environment to allow (in this case) data from the location in the environment to trigger some air nozzles. The air nozzles I can control from the computer I have them plugged into, but I need to be able to control them from my machine running Unity. As far as I know, my server is functioning correctly, but I wrote a secondary listener script just to test it on the same machine and the error I'm getting is

Exception: System.Net.Sockets.SocketException: An invalid argument was supplied.

not 100% what this means, as I'm fairly new to Unity and software coding. my Client code is as follows:

public class udplistener : MonoBehaviour {
  public IPEndPoint ipep;
  public UdpClient udpListener;
  public int port = 13722;
  Thread udpThread;
  private Process process;

  // Use this for initialization
  void Start () {
    ipep = new IPEndPoint (IPAddress.Any, port);
    udpListener = new UdpClient();
    udpThread = new Thread (new ThreadStart(startProcess));
    udpThread.IsBackground = true;
    udpThread.Start ();
  }

  // Update is called once per frame
  void Update () {
    try {
      while(true)
      {
        byte[] recBytes = udpListener.Receive (ref ipep);
        string data = System.Text.Encoding.ASCII.GetString (recBytes);
        UnityEngine.Debug.Log ("Recieved data: " + data);
      }
    }
    catch (Exception e){
      UnityEngine.Debug.Log("Exception: " + e.ToString());
    }
  }

  void startProcess(){
    process = new Process();

    process.StartInfo.UseShellExecute = false;
    process.StartInfo.RedirectStandardOutput = true;
    process.StartInfo.RedirectStandardError = true;
    process.StartInfo.RedirectStandardInput = false;

    process.StartInfo.CreateNoWindow = false;

    //process.StartInfo.WorkingDirectory = WorkingDirectory;
    //process.StartInfo.WorkingDirectory = "";
    UnityEngine.Debug.Log("Starting client. Stand by...");

    //process.St
    process.Start();

    UnityEngine.Debug.Log("Started client");
    // //Commented out for thread closing. Not used any more because of UDP client/server
    // while(true)
    // {
    //   ReadStdOut();
    //
    //   if (programStopped)
    //   {
    //     return;
    //   }
    // }
  }

I'm really confused, because I lifted this code out of another portion of our software to create a "backdoor" into the dSPACE (the physical controller portion) machine so I wouldn't have to change a lot of serial communication that is already in place. What is the Exception referencing and what do I need to change?


texts: How can I get rid off the imprecision of the model matrix when I using WGS84 as the coordinate system to render the earth?

texts:
The global coordinate of WGS84 is too big, a float is not accurate enough. The only two ways I can come up with are using dmat replace for mat or transferring the modelview matrix rather than the model and the view matrices separately. The first method I thought it will bring efficiency problem and the second method which I'm using leads to some troubles such as doing some redundant matrix multiply on CPU.

I search the document of OSG-Earth, it seems to use double precision matrices which is the first method I mentioned, won't it bring efficiency problems?

Is there another way to deal with this problem? Or I should change my coordinate system. How can I design the new coordinate system for the earth-rending?

I'm working on a project which looks like OSG-Earth or Google Earth. Although the camera is near the land at most time, sometimes it will pull up from the land and could see the whole planet.


texts: NavMeshAgent.CalculatePath - how to use properly?

texts:
I seriously can't figure out how to use this function, and the documentation doesn't help at all.

Here's the documentation code:

public class ExampleClass : MonoBehaviour {
 public Transform target;
 private NavMeshAgent agent;
 void Start() {
     agent = GetComponent<NavMeshAgent>();
     NavMeshPath path;
     agent.CalculatePath(target.position, path);
     if (path.status == NavMeshPathStatus.PathPartial) {
     }
   }
}

Here's my code:

public class Movement : MonoBehaviour {
 NavMeshAgent agent;
 NavMeshPath path;

 void Start () {
     agent = GetComponent<NavMeshAgent>();
 }

 void MoveToTargetLocation() {
     agent.SetDestination(targetLocation); <-- being set somewhere else

     NavMeshPath path;
     agent.CalculatePath (targetLocation, path);

     if (path.status != NavMeshPathStatus.PathPartial) {
         if (Vector3.Distance (curLocation, targetLocation) > 0.55) {
             animation.CrossFade (animationRun.name);
             moving = true;
         } else {
             animation.CrossFade (animationIdle.name);
             moving = false;
         }
      }
   }
}

The error I'm receiving is:

  Assets/Movement.cs(59,54): error CS0165: Use of unassigned local
  variable `path'

Am I supposed to be setting the path somewhere else?


texts:
I'm programming a basic Pacman clone to teach myself game programming. However, I'm struggling with the best way to have the game objects communicate/interact without my code becoming a huge mess.

Right now, I have a stack (implemented as a list) of objects in my base Game class. These objects include components such as Graphics, Input, etc. as well as "actual objects" such as Map, Pacman, etc. While running the game, the Game class loops through all of the objects and updates the ones which want to be updated and draws the ones which want to be drawn.

However, these objects must obviously interact. I implemented a Link function on the objects which allows one object to be "linked" to another; i.e. it gives one class a pointer to the other class so interaction can take place. For example, the Pacman class may use Link to be given a pointer to the Map class so Pacman can determine whether or not it can move in a certain direction.

With a game as simple as Pacman, this structure probably won't be too challenging to maintain, but were a game to have many interacting objects, I suspect the code would get out of hand. Is the method I am using right now alright, or should I look at another implementation of object communication? If so, what would you recommend?

I've looked at Communication between objects in games?, but whenever I try to implement the mediator pattern, I end up with a giant mediator class which is a challenge to maintain. Is the mediator pattern what I should be using?


texts: TBN matrix for normal and parallax mapping

texts:
I'd like to refer to this question because I didn't completely answer to my problem.

I've implemented normal and parallax mapping but because of some assumptions I have to use two different TBN matrices for each effect.

One of the most important assumptions is that I have deferred renderer with normals encoding and light calculations in view space.

This implies that I have to convert data from normal maps (which are in tangent space) to view space using below TBN matrix:

mat3 NormalMatrix = transpose(inverse(mat3(ModelViewMatrix)));
vec3 T = normalize(NormalMatrix * Tangent);
vec3 N = normalize(NormalMatrix * Normal);
vec3 B = normalize(NormalMatrix * Bitangent);

mat3 TBN = mat3(T, B, N);

On the other hand parallax mapping required view direction vector in tangent space. To compute that I use camera position and fragment position (in world space) multiplied by following TBN matrix to move this vectors from world space to tangent space:

T = normalize(mat3(ModelMatrix) * Tangent);
N = normalize(mat3(ModelMatrix) * Normal);
B = normalize(mat3(ModelMatrix) * Bitangent);

mat3 TBN = transpose(mat3(T, B, N));

I'm looking for a way to optimize that. Is it possible to make it better?


texts: How to use depth buffer for z-level rendering in roguelikes?

texts:
Developer of the game explains how z-buffer works in Dwarf Fortress (loosely quoted):

"If you clear the buffer every single frame, it kills the game. You have sort of a depth of field. You say I need about 20000 integers worth of depth. So your first frame is 0 to 20000. And the next frame is 20000 to 40000, you treat everything lower as garbage. So you go 20 to 40, 40 to 60, 60 to 80. You have to clean it if you dealing with 4 byte integer something like every 100000 times. So the problem goes away."

Source: https://youtu.be/A9g1XMr2TTA?t=1628

His description is not completely clear for me. It seems he is using depth range from lowest z-level to highest and updating only one layer per frame?


texts:
I am new to LOD-based techniques so please be lenient with your comments about my naive questions.

Preface:

My aim is a simple terrain renderer (preferred C++ and OGL) that is to load a height-map (say 990 x 990 x 8bit) organized into 33x33 vertex chunks. No on-demand paging, just the sampling vertices from the height-map data directly into the vertex-buffers of the chunks. The rendering should be done via a quadtree whereas the leafs would render a whole chunk (33x33 vertices).

After reading Thatcher Ulrich's "Adaptive Quadtree" article, as well as chunked LOD and quite many other articles and questions on stack-exchange, I still seem to be too stupid to wrap my head around on how to actually proceed. Ulrich rendered leafs as triangle-fans directly (in his demo-code) which was appropriate at that time (I guess) but my prerequisite is a batch of triangles at once, hence the chunked approach.

1) Using a quad-tree (which is easy enough to understand, at least conceptually, and will -presumably- not lead to patent-wars later as with e.g. 'geo-mipmaps'), at some point the tree will have to be created. My guess was to load (or generate) a height-map first and then PRECALCULATE a quad-tree based on this map. Would that be a viable approach?
Various articles seem to expect the reader to know this fact a priori, so it is nowhere clearly stated. If pre-calculated, then all possible child-nodes would be pre-allocated in the RAM and walked top-down with some distance-to-node-by-width LOD criteria that would force the child-nodes to take over.

2) If pre-allocated, HOW would one render the chunks if lower LOD is required. I.e, the chunk being 32x32 quats => 33x33 vertices, an index buffer holding 33x33 indices would render the whole chunk as is. Now, a neighbor-node with one lower LOD-level is not a leave anymore, and its index buffer would not only need to span the four chunks of it children, it would also have to have an index buffer that indexes every second vertex as well to maintain only a single level of difference (or so my understanding). So I guessed (again) that EVERY node (leaf or not) would have to have (at least) one index buffer, and this index buffer would also have to be created/calculated during creation of the entire tree. (Which I would place in the engine's loading section, not anywhere close to the rendering-loop).
What I really don't understand is, how to do the rendering with the above approach (if it were the way to go, that is)... When nodes way above (in terms of lower LOD-level, i.e. coarser resolution) must draw their content, would that mean that the vertex-buffers of ALL chunks (in the leaf nodes way down) must be bound? And how would the index buffer of this node address the vertices in all the chunks?...
Or, would one have an empty 33x33 patch standing to the ready to collect vertices from various chunks as indexed by this lower-level node? (Sounds cheesy already whilst writing this...)

I would love to see an answer to this. I would accept a NO-CAN-DO with quadtrees and alternative suggestions, but a quad-tree solution is what I hope for.

My own alternative solution (which is a whack-job on my mind though) is a kinda 'Infinite Snapshot Quadtree' that starts with a root and creates nodes on-the-fly, but does only store as many nodes as required to render the visible world. A node however must carry all information to recreate its parent as well as to be able to create a chunck-geometry. The subdivision depth with this approach is (virtually) infinite (not considering issues with precision here), but the neighbor-linking mayhem is beyond good and evil...

Best Regards.
Edward


texts: How can I get a set of raw samples from an audio file in XNA 4.0?

texts:
In particular, I'd like to know how to get a set of audio samples that are compatible with the XNA's Sound API classes, such as the DynamicSoundEffectInstance class.

I've used the DynamicSoundEffectInstance class for synthesizer work in XNA before. But now instead of synthesizing my sounds, I'd like to read audio samples directly out of audio files - basically I want to do my own mixing and sequencing of samples into a single DynamicSoundEffectInstance object. I've had subtle timing problems when trying to do sequencing on XNA before using regular timers and Play() calls, so I need more control.

Clearly, XNA already knows how to load sounds, for instance, using the content pipeline and the SoundEffect class. Is the underlying format used by the SoundEffect class the same as the one used by the DynamicSoundEffectInstance class - signed 16 bit interleaved PCM?

In short, how do I reach the point where I can play an audio file using the DynamicSoundEffectInstance class?


texts: XNA 2D Rotated Rectangle Collision Response

texts:
I am using Rotated Rectangles which collide using the Separating Axis Theorem and they work perfectly fine for collision detection using Intersects and Contains.

However, I am starting to use faster objects in my game now and there is the issue of the two object overlapping during collision due to their higher velocities. I would like to do a collision response where I find out how much they are overlapping in the X and Y and put position them outside of each other.

I would like to use something like this: http://go.colorize.net/xna/2d_collision_response_xna/index.html.

But I am having some issues trying to adapt this to handle the rotation of the bounds.

Is this possible? Are there any resources out there that I can look at?


texts:
I have a border by default. But, I'm having trouble detecting if my object collides with the border. I am looking for efficient ways to do this, and I am not sure what should I use. I thought using a Tilemap might work. But, it was only giving me a grid, not a Tilemap. Even then, I was unable to figure out how to use the grid.
How should I go about creating this?


texts: Create texture atlas from loaded textures - OpenGL LWJGL Java

texts:
In my program I have objects with different textures, that are in the same vbo. I cant have an array of samplers in my shaderprogram, so i have to use a texture atlas. I have seen some ways to make a texture atlas out of PNGs, but that would mean that I'll have to load those textures twice. Is there a way to put two textures together in one atlas? For example i have:

id = 1;
width = 32;
height = 32;

and

id = 2;
width = 32
height = 32

I want something like this

int atlas = createTexture(t1.width + t2.width, t1.height + t2.height);
glBindTexture(GL_TEXTURE_2D, atlas)
//add(offset x, y, id)
glAdd(0,0,t1.id);
glAdd(t1.width, t1.height, t2.id);

I am not ooking for a texture packing algorithm! I need a way to create an atlas out of textures loaded to the GPU (OpenGL)


texts: Unity shader to pick 1 of 2 base colors for individual instances (picture)

texts:
I am building this scene in 3D using Unity 2019.3.13's Universal Render Pipeline. I have a block prefab that I want to instance, but I want to choose which are yellow and which are blue (you can see the materials are basically the same). How can I write a shader that will allow me to pick either yellow or blue in the editor for each one? Is this possible? What is the most optimal way to make dozens of identical blocks where the color is different for specific instances?

(I would prefer a script to a graph, something with a simple switch/boolean input and hex values:
yellow: e4c658
blue: 32676a


texts: What level of use can I give to these third person IP based art assets?

texts:
I'm making my first game (2D), and while details are irrelevant it compromises lots of spaceships in and out of the screen. They are not the main character or controllable by any means (I don't know if it makes any difference).

For the sake of variety and fun, I decided to re-create some iconic spaceships of various known series. They would compromise a small portion of the overall, less than one percent. Their addition would go in the lines of 'easter eggs' or rare sights, just to warm the fans hearts with lovely memories and enrage the ultrafans brains with conflicting date frames and galaxies far far away mixing with milky way lore.

I will implement them on the developer version of the videogame, as I assume private use is as free as air (I really make the game I'd like to play, and hell if I won't be the one that has most fun). I could implement them as an option for the public version if I was sure it was completely safe.

But considering the scenario in which I finish the game and want to fully release it.
This are some of the assets, as example: they are external designs, but I painted them pixel by pixel and generally have some little discrepancies with the canon, besides having one dimension less than they have in most of the original commercial products.

My question is:
Under what conditions can I publish them?
I would'nt claim them as original or own designs, but I am the maker(and thus, the owner) of the art asset nontheless. The fact that they are so low resolution could allow me to use them as parody work?
What if I don't want to make any money of it, and just publish the game without charge?

The simple truth is that I don't really want any problem with anybody. Nor I consider this to end up beeing of any help to my economy. But it would be nice to know if I can distribute it, and what options does it have of helping prevent starvation of one guy. Like, putting a donations button in the same web I use to distribute it, while clearly stating that the development of the game is unrelated to the donations it recives (web without ads, I know that would be considered commercial).

Thank you for your time.
(Non-native speaker, feel free to cry blood)


texts:
I am working on a Peer to Peer based Online Gaming system. I plan on using it for running a decentralized MMORPG in which there are no central servers and traffic is routed evenly among each node/Realm in the network. There are some diagrams and notes that I have for the system and I wanted to know if such a system is actually viable.

https://mega.co.nz/#F!5d8UFaRb!ojwZ0WyDzgFct2IhmdQoZg Diagrams are here.

Essentially this system would be a Mesh Net type network in which people can create their own private realm and then connect it to the network so that other people can play on it. There are two methods to configure the software, 1 you can create your own private realm or 2 you can act as peer for an existing private realm by acting as a mirror for it.

So the more people who connect to the network and play on it, the more stable the network becomes. An individual private realm and its mirror nodes would be called a Realm Cloud. Bit torrent protocol to evenly distribute all traffic to avoid network congestion. IPv6 for global network traffic and DHT for individual realm cloud traffic.

The number of connections can be configured in the client but there must be at least two. The number of maximum connections in theory can be indefinite. End to end encryption keeps all traffic within the network including text and voice chats secure from eavesdropping and garlic routing can prevent tracking.

People can set their own rules and policies for their own realms that they create. If you don't like them then create your own and write the rules the way you like it.

This is still just a basic idea but I just wanted to know if this is an idea that would actually work.


texts:
I'm working on a building game (the usual, build house X to produce resource A, which then lets you build house Y...) and I am now in the stage of balancing the various resource needs and productions.

Since I'm by far not the first person doing this, but couldn't find much practical advise on how to actually do it, I'm asking around: How to do the balancing math?

I thought about using a spreadsheet, but the main issue is not in the pure numbers but in the dependencies - if A then B. How many X are needed for Y to become available and does that fit to the stage of the game I want it to happen?

Which better ways than just playing for hours and tweaking the numbers exist? What approaches do you use to balance your economics games?

Additional details:

The game is a static build-your-village game. "static" means that time is not a factor - buildings provide a fixed amount of resources, not "x per minute". So a house provides housing for some peasants and a farm needs some peasants to work it, providing food.

So the things to balance against each other are resources. One trivial example: Farms need to provide more food than the peasants working on the farm plus the lumberjacks required to provide the wood for building the farm eat.

The goal of the game is resource-optimization. Doing the most with the resources available on the map. It is closer to a puzzle than to a clicker game.

Trivial early-game elements (see farm example) are easy to balance. But once you get into dependency trees (e.g. a 3rd level house needs A and B which are provided by X and Y, who need resources created at X2 and Y2, etc.) my intuition fails. Is X2 and Y2 balanced correctly or should they produce less? more?

I am not looking for specific answers, but for methods to approach this problem in general.


texts: I've recently been making a mobile game which I'm going to publish to Google Play. Google Play requires a Developer Name. Most Google Play Developer use their game studio name like Gameloft, Supercell, etc. But some indies use their names as the developer name like Scott Cowthon, FNAF Developer. I was wondering what are the advantages and disadvantages of each type to me as the only developer of my game?


texts: putting a delay between animation looping

texts: I've got a player swinging a sword, this animation is controlled by a state machine. However, I don't want the player to be continuously swinging the sword when he's attacking -- I want him to swing once, wait a bit, then swing again. The animation in the animator controller has a speed variable I can control, but this merely makes each swing slower or faster -- I want the swing speed to be the same, just have a pause before the animation loops again. How should I do it?


texts: Where can I find/download a decent, free voice synthesizer?

texts:
I've been looking all over the net, and I've found some voice synthesizers, but they either don't work, aren't free, or just have 5 or so voices to choose from... I need to get a synthesizer with which I'm able to edit the voice myself. This is needed for GLaDOS-like robotic character for my game.

I did some searching here on GDSE, and it seems that questions like this often get closed as "not constructive". I believe that this is not the case, as this could help many other people who happen to be searching for the same thing.


texts: Artifacts when trying to implement Cook-Torrance BRDF

texts:
I am trying to implement the Cook-Torrance BRDF within OpenGL, but I keep running into issues. The most obvious one are black patches and a bright spot at (0, 0). I checked my shader multiple times, but I can't find what's wrong with it: the functions I use are in line with everything I've seen online, and I can't see anything obviously wrong, neither there nor in the way I've implemented my deferred rendering pipeline.

The code I am using is:

#version 440

uniform sampler2DRect samplerWorldPosition;
uniform sampler2DRect samplerWorldNormal;
uniform sampler2DRect samplerWorldMatInfo;
uniform sampler2DRect samplerWorldMatColour;

uniform vec3 ambient_light_intensity;
uniform vec3 light_direction;
uniform vec3 light_intensity;

out vec3 reflectedLight;

// Approximates the fresnel effect
float fresnel_schlick(float VHdot, float refractive_index)
{
    float F0 = pow(1 - refractive_index / 1 + refractive_index, 2);
    return F0 + (1 - F0) * pow(1 - VHdot, 5);
}

// Uses the GGX distribution function
float GGX_distribution_func(float NHdot, float roughness)
{
    float alpha = roughness * roughness;
    float alpha_sqr = alpha * alpha;

    float NHdot2 = NHdot * NHdot;
    float exp = NHdot2 * alpha_sqr + (1 - NHdot2);

    return (alpha_sqr * max(0, NHdot)) / (3.14159 * exp * exp);
}

// Attenuation based on geometry
float geometric_attenuation(float NHdot, float NVdot, float VHdot, float NLdot)
{
    float G1 = (2 * NHdot * NVdot) / VHdot;
    float G2 = (2 * NHdot * NLdot) / VHdot;
    return min(1, min(G1, G2));
}

void main(void)
{
    vec3 texel_position = texelFetch(samplerWorldPosition,
        ivec2(gl_FragCoord.xy)).rgb;
    vec3 texel_normal = normalize(texelFetch(samplerWorldNormal,
        ivec2(gl_FragCoord.xy)).rgb);
    vec3 texel_diffuse = texelFetch(samplerWorldMatColour,
        ivec2(gl_FragCoord.xy)).rgb;
    vec3 mat_info = texelFetch(samplerWorldMatInfo,
        ivec2(gl_FragCoord.xy)).rgb;

    float diff_kd = mat_info.x;
    float roughness = mat_info.y;
    float IOR = mat_info.z;

    float NLangle = max(dot(texel_normal, light_direction), 0.0);

    float specular_light = 0;
    float geometric_term = 0;
    float GGX_facet_term = 0;
    float fresnel_term = 0;
    if (NLangle > 0.0)
    {
        vec3 view_direction = normalize(-texel_position);

        vec3 H = normalize(light_direction + view_direction);
        float NHangle = max(dot(texel_normal, H), 0.0);
        float NVangle = max(dot(texel_normal, view_direction), 0.0);
        float VHangle = max(dot(view_direction, H), 0.0);

        geometric_term = geometric_attenuation(NHangle, NVangle, VHangle, NLangle);
        GGX_facet_term = GGX_distribution_func(NHangle, 0.5);
        fresnel_term = fresnel_schlick(VHangle, 0.5);

        specular_light = (geometric_term * GGX_facet_term * fresnel_term) / (3.14 * NVangle * NLangle);
    }

    reflectedLight = NLangle * (light_intensity * specular_light +
        (texel_diffuse)) + ambient_light_intensity;
}

This code uses (or at least is meant to use) the standard Cook-Torrance model, with GGX microfacet distribution, the Schlick fresnel approximation and the Cook-Torrance geometric attenuation.

This is an example of the errors I am getting:

The errors are quite evident. What is wrong with this shader?


texts:
I'm looking for a way to draw textures to screen in Unity in a similar fashion to XNA's SpriteBatch.Draw method. Ideally, I'd like to write a few helper methods to make all my XNA code work in Unity. This is the first issue I've faced on this seemingly long journey.

I guess I could just use quads, but I'm not so sure it's the least expensive way performance-wise. I could do that stuff in XNA anyway, but they made SpriteBatch not without a reason, I believe.

So I see there is some sort of GUI notation in Unity. Maybe I could efficiently draw everything using it?


texts: Input into a switch statement to change position of a character.

texts:
I'm trying to make a simulation of Travelling sales man problem. So I got random circles spawning and each circle.

I want to make it so I can switch between the circles. Currently the player spawns to the first circle created which is in position (cir[0].x, cir[0].y). However, I'm trying to make an input so you can type in for example 12 and the position of the queen would now be (cir[12].x, cir[12].y). But, this seems to not work.

int number;
cin>>number;

if(number<NUMCIRC)
{
    switch(number)
    {
    case number:
        queenX = cir[number].x;
        queenY= cir[number].y;
        break;

    default: break;

    }
}

I was wondering as surely if I input the number and then press enter it should jump to the number. Assuming it's smaller than NUMCIRC, which is the number of circles that I have spawned.


texts: How to export HAXE code to other languages?

texts: I'm using Haxe on the HAXE IDE, HIDE. I can simply create code for any language, but I don't know how to export it. It didn't have any export options, and no tutorials explain this. How do I export it?


texts:
I'm trying to achieve in Godot something similar to cavity effect from Blender (this can be enabled in viewport options; cube on the left is displayed by viewport with this option enabled):

How would you replicate this?


texts: Long loading times on large PNG file using C++, OpenGL & SOIL

texts:
I'm currently optimising a C++ OpenGL game, and I've noticed something slightly odd about texture loading.

I've got a number of PNG files I load as textures and use as spritesheets; these are generally 512px or 1024px, with one 2048px. I use SOIL (www.lonesock.net/soil.html) to load the PNGs then bind them to a custom OpenGL texture class.

I've put some primitive code in to measure how long it takes to load these PNG files as textures measured in ticks. Generally speaking the load times are:

512px PNG: 100 - 150 ticks
1024px PNG: 400 - 500 ticks
2048px PNG: 1800 - 2000 ticks

Now I recognise that not all image files are created equally, but these don't quite seem to add up with what I understand in terms of texture files. There's not much to be gained by using fewer larger textures compared to more smaller textures, and often there's no gain for that 2048px PNG compared to four 1024px.

My question is, are these (relative) load times normal? Is there something I'm missing when it comes to loading textures with SOIL?

Note that my question isn't 'how can I generically speed up image loading times' (I may at a later date convert these to more OpenGL friendly file formats like DDS), but more is there a pattern I should / shouldn't be using to optimise this?

Thanks

Nathan


texts: My buildings are fine until I import them to Unity. None of the formats I've come across( FBX, DAE, 3DS Max, Blender Files, any of the Autocad formats, OBJ, PRJ, WRL etc.), have roofs when importing the buildings as one cohesive file into Unity. In Sketchup, Blender etc. they all appear fine. Does anyone have suggestions?


texts: How to rotate a whole Bezier Curve around a given point

texts:
I am using the code from the question Adding functionality to make individual anchor points of bezier continuous or non-continuous to create bezier curves (I added a line renderer).

How can I rotate the whole bezier curve (which may contain multiple cubic Bézier segments) around a point?

Please note that the rotation point could be any point including the one of the curves anchor points or control points.


texts: Are objects made out of lines still classified as meshes?

texts:
A cube or a sphere is a mesh, but are lines and circles?

I'm currently creating a renderer responsible for drawing many different types of object. functions in a namespace called MeshDescription are responsible for running and returning mesh objects so you can do things like this:

Mesh mesh = MeshDescription::Cube();

but I'm wondering if functions for lines and circles should be categorised differently? with a view to changing this soon so that everything is instanced.


texts: Libgdx and ParticleEffect with scene2d not showing the same way as in the Particle Editor

texts:
I am developing a new game with libgdx and trying to implement ParticleEffect in scene2d (using actor). I am creating a ParticleEffect with Particle Editor in which I would like to
add to a stage.

From some reason, the effect appears horizontally only (objects appear from left to right but not up and down) and is not appearing the same as in the Particle Editor (X and Y axis).
Does anyone have an idea what could be the reason for that?

Snapshot of the horizontal effects (desktop run):

Particle Editor effect:


texts:
When my player jumps, I start a rotation and I want to finish it when he gets back on the ground.

My Player is jumping off the ground and landing back on in 1 second.

My physics are updating at 10 FPS (10 times per second).

So I want to complete a 180 degree rotation for exactly 1 second. I add 18 degree to my player at every world update. I convert the degrees to radians, but the result is this:

I want him to jump with a 0 degree angle, rotate and land with 0 degree angle. Here is my code:

world.step(step, 8, 3);

if(isJumping) {
    angle -= (18*Math.PI)/180; // conver degrees to radians
    player.body.setTransform(player.body.getPosition(), angle);
}


texts: Vive SteamVR Stereo Rendering mirror doesn't reflect lineRenderer lines steadily

texts:
I'm creating a SteamVR game in Unity. I'm using the Vive SteamVR Stereo Rendering Toolkit to create the mirror effect. I also wrote a script to render three lines between headset, and two controllers, with lineRenderer. The lines are working fine, but in the mirror reflection, I can only see the lines rendered one at the time, as opposed to all three lines visible at the same time. Why is that?

Edit 1:

Add an image of what I see:

In my game, I used three balls to represent the headset, the left controller and the right controller. I see the lines between all three lines constantly (even though you can't see the ball in the headset obviously and the lines between the left/right controllers to the headset are clipped, which is fine...), but I can only see one line at a time in the reflection, either the line between the head and left controller or the line between the head and the right controller. For example, if I move the left controller, the line between the head and the left controller in the reflection is working, while the other disappear in the reflection. Also, the line between the left and right controllers never appear in the reflection.

Edit 2:

Add another image to explain what I want vs what I have now:


texts:
Got a really typical use-case here. I have large map made up of hexagons and at any given time only a small section of the map is visible. To provide an overview of the complete map, I want to show a small 2D representation of the map in a corner of the screen.

What is the recommended approach for this in libgdx? Keep in mind the minimap must be updated when the currently visible section changes and when the map is updated.

I've found SpriteBatch(info here), but the warning label on it made me think twice:

  A SpriteBatch is a pretty heavy object so you should only ever have
  one in your program.

I'm not sure I'm supposed to use the one SpriteBatch that I can have on the minimap, and I'm also not sure how to interpret "heavy" in this context.

Another thing to possibly keep in mind is that the minimap will probably be part of a larger UI, is there any way to integrate these two?


texts: How do I use UsePass in a shader in Unity when the pass does not have a name?

texts:
I'm trying to use passes from a given built-in shader in Unity. The docs say that the syntax is UsePass "Name". The problem is that built-in shaders don't have names on their passes. How could I do that in this case?

To be more specific, at the moment I need to use the Skybox shader passes. Here is one of the Subshaders in the internal Skybox.shader file:

SubShader {
Tags { "Queue"="Background" "RenderType"="Background" }
Cull Off ZWrite Off Fog { Mode Off }
Color [_Tint]
Pass {
    SetTexture [_FrontTex] { combine texture +- primary, texture * primary }
}
Pass {
    SetTexture [_BackTex]  { combine texture +- primary, texture * primary }
}
Pass {
    SetTexture [_LeftTex]  { combine texture +- primary, texture * primary }
}
Pass {
    SetTexture [_RightTex] { combine texture +- primary, texture * primary }
}
Pass {
    SetTexture [_UpTex]    { combine texture +- primary, texture * primary }
}
Pass {
    SetTexture [_DownTex]  { combine texture +- primary, texture * primary }
}
}

As can be seen there's no name in the passes. My shader is the following:

Shader "Custom/Outline" {
Properties {
_Color ("Main Color", Color) = (.5,.5,.5,1)
    _OutlineColor ("Outline Color", Color) = (1,0,0,1)
    _Outline ("Outline width", Range (0.0, 0.1)) = .05
_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
_Shininess ("Shininess", Range (0.03, 1)) = 0.078125
_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
}

SubShader {
//Tags { "RenderType"="Opaque" }
Tags { "RenderType"="Background" }
Pass {
    Name "OUTLINE"
    Tags { "LightMode" = "Always" }

    // Outline pass logic (not important for the problem)...
}
UsePass "RenderFX/Skybox/..." // WHAT SHOULD I DO HERE?
//UsePass "Bumped Specular/FORWARD"
}

The problematic line is at the end, as can be seen. The shader works for the Opaque case, using the "Bumped Specular/FORWARD" pass (see the commented lines). The built-in Bumped Specular shader is the following:

Shader "Bumped Specular" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
_Shininess ("Shininess", Range (0.03, 1)) = 0.078125
_MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {}
_BumpMap ("Normalmap", 2D) = "bump" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 400

CGPROGRAM
#pragma surface surf BlinnPhong

sampler2D _MainTex;
sampler2D _BumpMap;
fixed4 _Color;
half _Shininess;

struct Input {
float2 uv_MainTex;
float2 uv_BumpMap;
};

void surf (Input IN, inout SurfaceOutput o) {
fixed4 tex = tex2D(_MainTex, IN.uv_MainTex);
o.Albedo = tex.rgb * _Color.rgb;
o.Gloss = tex.a;
o.Alpha = tex.a * _Color.a;
o.Specular = _Shininess;
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
}
ENDCG
}

FallBack "Specular"
}

Even when using the Bumped Specular I had to find the pass name by trial and error, seeing code snippets from older versions, etc. That's why I like to have code for everything... I could just read the code of the shader management system and figure it out. Anyway... any ideas?


texts: Black screen after unity updated to 2019.4.17and later on Android

texts:
I upgraded my app from Unity 2019.4.9 to 2019.4.21.  it seems to work fine in the editor, but on my Android build I just get a blank screen.  No splash screen, no app main window.  I've been able to isolate it to the update from 2019.4.16 to .17 that breaks it.  I can toggle back and forth, build .16 it works, .17 and higher are all black screen.  I tried (.17,.18 and .21)
only thing relevant in the logs seems to be:
03-13 10:49:09.689  1458  7484 I WindowManager: WIN DEATH: Window{378e77 u0 com.mycompany.myapp/com.unity3d.player.UnityPlayerActivity}
03-13 10:49:09.689  1458  7484 W InputDispatcher: Attempted to unregister already unregistered input channel
03-13 10:49:09.689  1458  2335 I ActivityManager: Process com.mycompany.myapp (pid 8851) has died: fore TOP (366,458)

i'm building for Mono, .NET 4.x and Targeting ARMv7
anyone else run into this?  any info on what I should look at next to continue to debug?  anyone know what changed in .17 that might be causing this?


texts: Cardboard on iPhone 5 doesn't render on stereo

texts:
Has anyone ran into this?

I'm on Unity 5.1.1p3, Cardboard Unity Integration v0.5 (5/28/2015) and an iPhone 5 running iOS 8.3 (12F70).

I made a game that uses Cardboard and on an iPhone 6 the screen renders as expected: two offset cameras. On an iPhone 5 however, while the screen does show the 2 viewport masking and the distortion correction, it's actually a single camera that is being rendered, defeating the purpose of Cardboard.

Here's what I mean. This is the iPhone 6, as expected:

And this is the iPhone 5, which is wrong:

Any ideas?

Some extra info:

The iPhone5 can only use GLES2. It doesn't support ES3 or Metal. But what I did notice is that if I make a build for GLES2 the first time the app runs on the device (be it iPhone 6 or 5), when the Cardboard camera gets enabled, the app crashes:

If then I quit the app and start it again from the phone without it being hooked up to Xcode, on the iPhone5 I get the wrong rendering I've shown while in the iPhone 6 the app just crashes again. And if instead I make my build with automatic graphics API detection, what happens is that on iPhone6 it goes to Metal mode and so it works fine and on the iPhone5 it goes to GLES2 mode which, as stated before, crashes if attached to Xcode but otherwise just runs only that with the wrong rendering.


texts: Smooth circular collisions with edges/collision boxes [C# + XNA]

texts:
So, me and a friend are working on our top-down perspective 2D game, and have come to work on perfecting our collisions. In its current state our player sprite is colliding with walls, but is experiencing a "sticking" to the collided surface. This is mainly because our collisions only consist of "if colliding on X axsis, stop X movement":

if (boxR.Intersects(playerCircle)) {
    if (playerCircle.center.X <= boxR.X + boxR.Width || playerCircle.center.X >= boxR.X)
        stopX = true;
    if (playerCircle.center.Y <= boxR.Y + boxR.Height || playerCircle.center.Y >= boxR.Y)
        stopY = true;
}

What we are intending is smoothed collisions, so that if we hold down the S key (for down), and the player's collision circle hits the corner of a collision rectangle, then the sprite's brute force of moving down pushes itself to the side to continue without further collision. Example below; the solid line is the input vector, while the dotted line is the adjusted vector because of the collisions with the corner.

Is there a seemingly simple adjustment to be made? Or will we need to incorporate some sort of physics library to get around this? If so, then what would you suggest?


texts: I'm looking into the newer OpenGL's with GLFW, but I'm stuck in a decision. What kind of anti aliasing is the best, or something that makes it look real, not "real". I don't want the picture blurred, I want it clear. I'm thinking about super sampling but that does not seem like the best due to that it uses a ton of resources. What's your experience with what AA and did you like it? Can someone explain all the types of AA? Thanks!


texts: Advanced Animation for 2d Isometric Game?

texts:
I need help with workflow suggestions for a flash game. (although the concepts would apply to other game engines, too).

In a game like: Hero Academy

There are several different character models each with a multiplicity of animations (walking, standing, getting hurt, attacking, etc.). I am certain that each of these could be manually animated and a sprite sheet generated and used, but when you add up how many animations and core drawings would be needed...that would be near insanity to complete.

So, in research I found that some are creating character models in Blender, Maya, a 3d engine of some kind - setting the camera angle to 45deg, etc. animating and exporting that sprite.

In each of these examples however, the character models were 3d looking i.e.: 3d to 2d

When I look at Hero Academy, they still look like a 2d drawing.

If I am looking to re-create a similar art style to Hero Academy and need several animations per model what is the most efficient/correct workflow to creating the animation? Manually creating each animation sprite in Flash? Or utilizing 3d and texturing it to look 2d?(if that is even possible)?

EDIT:
Thank you to all those who have posted great answers. To add information to the concept, one 'issue' I am contending with is the modeling/view of our desired game. To further clarify, if you look at Hero Academy's grid system (a la chess board) if you wanted an entity to be able to move vertically or diagonally this would need it's own sprites. However, is this still a simple 2d side scrolling game since the camera is fixed? And they have simply designed the background map to have the EFFECT of perspective?

If that is the case, then using Nuoji's comments, a 2d skeleton would then again be possible.

The base question is: if we are looking at close to 100 different character entities all with their own movement animation, long and close range attack animations, taunts, etc. what is the most expeditious method of doing this?

Note that I have experience in programming but no design/modeling experience. Whether we went the flash animation route or 3d modeling route I would be learning from scratch so any previous skill or preference is nullified.


texts: How can I make diamonds disappear after collision in LIBGDX

texts:
I'm creating a Java game similar to Mario Bros. I'm using Tiled Map Editor to put diamonds inside my game, so my character can collect these diamonds. But, I have a problem. I can't make the diamonds disappear after collision.

This is my code that I've used to remove the diamonds:

public TiledMapTileLayer.Cell getCell(){
    TiledMapTileLayer layer = (TiledMapTileLayer) map.getLayers().get(8);
    return layer.getCell((int) (body.getPosition().x * MainGame.PPM / 64),
            (int) (body.getPosition().y * MainGame.PPM / 64))
}

This is my code that I have used for collision:

  if ("HARRY".equals(f1.getUserData()) && "COINS".equals(f2.getUserData())) {
        System.out.println("coins");
        if (f2.getUserData() instanceof Treasure) {
            System.out.println("Works");
            treasure.getCell().setTile(null);
  }

this if-statement doesn't work ( if (f2.getUserData() instanceof Treasure) )
If I use the code without this statement, just the first diamond that I've put it inside Tiled Map disappeared.

Can anyone help me please?


texts: How to use GameManager to get GameOver() from another script?

texts:
I'm trying to make a gameover-text show when the player is leaving the plane-area. In GameManager.cs I've written:

public void GameOver()
{
    gameOverText.gameObject.SetActive(true);
}

And in PlayerController.cs I've used the following code:

private GameManager gameManager;

and:

void Update()
{
    float horizontalInput = Input.GetAxis("Horizontal");
    float verticalInput = Input.GetAxis("Vertical");

    playerRb.AddForce(Vector3.right * speed * horizontalInput);
    playerRb.AddForce(Vector3.forward * speed * verticalInput);

    if (transform.position.y < -4)
    {
        gameManager.GameOver();
    }
}

But this doesn't really work, and the console is giving me this message:

  Assets/Scripts/PlayerController.cs(8,25): warning CS0649: Field 'PlayerController.gameManager' is never assigned to, and will always have its default value null

I've already used the OnTriggerEnter (for powerups) and OnCollisionEnter (for enemies). How can I get the GameOver-text to show when the player leaves the "Plane"?


texts: Using SQL for a Realtime Multiplayer Game Server's Working Data (Fast Enough?)

texts:
The game I'm working on currently has a Client in Flash AS3, and a Server in C# (multithreaded).

Currently I use mySQL to handle logins (Raw access: no middleman for accessing the database) which seems to be extremely quick.

My question is would using a mySQL database be quick enough for a fairly simple real time game?

My game functions in a similar way to Diablo2, League of Legends, or even Starcraft:

User logs in
User is taken to lobby
From lobby user may view active games
User's group into 2-8 for games which exist on the server in it's own thread

Now, the game has been designed in such a way to minimize server calculations, while still providing zero trust to clients.  Is it possible to use SQL in a way to store and manipulate all game data, for each game? ie:

Users 1 through 8 all create 50 units
Each user commands all of their units to move to a location on the map
Units attack each other
etc.

Is SQL fast enough to handle this kind of data traffic?  Or would it be better to store it all in memory?  Or is there some alternative (such as paging) I haven't considered?


texts: Serverside memory efficiency and threading for a turn based game

texts:
Im programming on a turn based war-game for some years now (along with the engine) and Im having quite a hard time at figuring out what the games server architecture should look like, since most game server architecture articles I found focus either on FPS oder MMOGs, which doesn't really fit since I want many matches with 1- 16 players on my server, with each match being played in turn based mode.

My chief concern is memory usage, since the most basic approach of loading every game that is being played completely into RAM should be quite inefficient, so is there a suitable strategy for selecting only the needed bits and loading them?

Another question I got is how to design the threading on the server, since I think using only a single thread could be a problem due to the fact that the game or part of it might have to be loaded from the database.

I would be very happy if you could share your knowledge or point me to material on this topic.