texts:
Almost all the documentation available either says that "sprites are bitmaps" or that "css sprites must be bitmaps". Is there a specific reason for this? Is it, in fact possible to create a css sprite sheet with .SVGs? If it is possible is it a good idea, and is the SVG format supported on all browsers?

I'm creating a HTML5 game with a strong minimalist art style, using elements of European folklore. I don't need vector images per se, but I'd prefer the game was as responsive as possible to improve UX and to allow gameplay across different devices.

An example character. As you can see, there is no fine detail that would be better represented with a raster image.


texts:
I must write a cross-platform real-time-strategy game within 2-3 months. I want use C++ and OpenGL and am looking for an engine.

The engine must be open source and work under both Linux and Windows. Preferably it should work with 3ds Max models. I do not know the game engines. Which engine would you recommend?


texts:
I am using an octree to define my 3D voxel world.
And I want to use octree subdivision as a LoD system.
This means, subdivide close to the player, but far away nodes un-subdivided.
But it occurs to me that in some cases, the octree can quickly degenerate to a grid.
To illustrate, see the 2D sample of a quad tree below.

If the player is at location A, no problem, subdivide that cell, done.
If the player is at location B, two cells would require subdivision.
But at location C, all cells are subdivided, causing no reduction in work.
Are octrees even viable approaches to LoD, or do I need something else?


texts: Is ArrayLists so slow that it is doomed to kill performance in Unity?

texts:
I was reading Which Kind Of Array Or Collection Should I Use?

The document states to use list for the most performance.

  "...They are the fastest array in unity. For this reason, built-in arrays are the best choice if you need the fastest performance possible from your code (for example, if you're targeting iPhone)...performs significantly faster than ArrayList."

I am inclined to use list besides performance issues as well because...

If you're using List you won't have to cast objects since it's generic and use a T[] backing storage (at least .net does this). ArrayList have to cast everything to object and cause boxing with value types.
faster for value types as it avoids boxing., strongly typed elements.

But it got me to wonder, since everyone seems to favor to make a degrading statement about ArrayLists, is ArrayLists that horrible? If so why does it even exist? Is it more of trace of supposedly deprecated codes?


texts: Disable default unity editor behaviour on input

texts:
I'm creating a tool to create scenes easier on edition mode. I'm using the right click to delete elements, and I'd like to be able to delete several elements by keeping the right mouse button pressed and moving the mouse around.

The issue is that when I keep the right mouse button pressed over the scene window, the Hand Tool automatically activates, making the camera pan as I move the mouse.

Is there a way to disable this behaviour?


texts: Unity FPS Drop on Android Low end devices

texts:
I have stumbled upon an issue that is now taking a lot more time than I assumed. I have a game that has a lagging issue and I have tried almost all techniques that I could remember to fix that but now I am in desperate need of advice.
I am on Unity 2019.4.14f1 (URP)
I have done the following:

Turned off everything including UI and still CPU around 40ms and 25fps on Samsung Galaxy S6
Optimized Memory though textures compression of RGBA Crunched ETC2 or RGB Crunched ETC as needed.
Added target framerate = 60 as without this Semaphore.WaitForSignal took a lot more CPU ms and was resulting in even worst FPS even in an empty scene.
Turned off vSync
Turned off all sort of lights in the game
Tried turning off scriptable render features just to be sure they are not culprits.

Here are the setting screenshots:

Here are profiling screenshots of gameplay without turning off everything.

Here are the screenshots when everything including Ui, 3D Env/Char, and lights are turned off.


texts: In Box2D, how do I create an infinitely oscillating spring?

texts:
How do I create an ideal spring that can oscillate indefinitely using Box2D?

A b2DistanceJoint works almost perfectly, but it eventually slows to a stop, even with damping set to 0. I think it is because b2DistanceJoint is not meant for creating springs, but for preserving the distance between two bodies by correction the violated distance with a spring like behaviour. Hence, it should have a damping to eventually bring back the bodies to initial state and stop at some point.


texts: Unity inconsistent memory profiling when running same scene

texts:
I'm in the making of a 2D silhouette style game where I'm trying basically 2 setups:

One where it consists only of sprites,
One where it consists of a mix of sprites and meshes with NO texture.

Now, I'm experimenting with the two as I wish to want the scenes to take up the least memory.

I have these weird outcomes:

SPRITE SETUP:

Total 280 MB, Textures 155.5 MB, Meshes 1.7 MB
Total 249 MB, Textures 151 MB, Meshes 4.1 MB
Total 279 MB, Textures 151.0 MB, Meshes 10.8 MB

SPRITE & MESH SETUP:

Total 334.4 MB, Textures 188.2 MB, Meshes 1.8 MB
Total 241 MB, Textures 148,0 MB, Meshes 2,3 MB
Total 253.1 MB, Textures 157.7 MB, Meshes 4.2 MB
Total 301.8 MB, Textures 157.7 MB, Meshes 8.4 MB
Total 234.8 MB, Textures 145.3 MB, Meshes 1.9 MB

Now, I find these result strange because:

It was checked on the exact same scene (the mesh setup had same amount of objects, just swapped the sprites for meshes) and the data is inconsistent, meaning there is about 100MB difference between the same mesh scene
A scene of mostly mesh with zero textures uses more, or at least not less, textures than a sprite only scene??

By taking a look at the data above, I would require someone skilled to guide me through this. Shall I keep using those meshes or just go for sprites? What is really goind on here with this data?


texts: What is the best way to check for intersection of two bounding boxes, given a minimum and maximum Vector3 for each one

texts:
I have a BoundingBox object which holds two Vector3's (x, y, z), one for the minimum point and one for the maximum point. (-1.5 0 9 | 1.5 3 10)

What is the best way to check for any intersection or overlap of two BoundingBoxes?

The test for intersection will happen more often than not when there are no points actually intersecting, just faces.

The code that I currently am using is:
bb1.max_.x_ > bb2.min_.x_ && bb1.min_.x_ < bb2.max_.x_ && bb1.max_.y_ > bb2.min_.y_ && bb1.min_.y_ < bb2.max_.y_ && bb1.max_.z_ > bb2.min_.z_ && bb1.min_.z_ < bb2.max_.z_;

However this leads to problems when points are, for example -1.5 0 9 | 1.5 3 10 intersecting with -0.5 0 8.5 | 0.5 1.8 10.5... The Z minimum and maximum points for the second object laying entirely outside of the Z min and max for the first object.


texts: How many polygons count are reasonable for an Android mobile game ?

texts:
I'm trying to develop a mobile game but I'm facing issue regarding FPS.
So my question is: 2016/2017 smartphone hardware, how many polygon counts are reasonable ?

Thanks


texts: How do I calculate legal moves in a travelling board game?

texts:
I'm making a traditional roll-the-dice-and-move style board game.
Players move along the white squares on the board (see image) and may move in any available direction from a junction.
Players must move the full distance of their roll.

Other than a brute force calculation, how can I efficiently calculate the destination squares of all legal moves?


texts: How to encourage players to level up multiple characters?

texts:
In my game, it is possible to make multiple characters. You can make as many as you desire. What I usually do (and almost all players do) is just make a single character and level it up a LOT, and just use it for everything.

Some games have tried to solve this by having multiple "classes" or types of characters that do different things, but this typically results in just having one of each "class."

How could I encourage players to not make one or two really high leveled characters but instead have, maybe, several high-level characters, several mid-level, and some low-level characters that are currently being leveled up?

(NOTE: I am unaccepting the previously accepted answer because I seem to have a lot of new answers coming in. (sorry Thomas Marnell, your answer is still great :) ))


texts: How are these physics formulas translated to this code?

texts:
So how exactly does something like \$v_f = v_i +a*t\$
translate to something like self.vel += self.acc in code?
or \$d=v_i*t+\frac{a*t^2}{2}\$ translating to self.pos += self.vel + 0.5 * self.acc there seems to be variables missing, and summations happening that aren't part of the formulas.


texts: Should I use inheritance or composition for modelling game objects?

texts:
In terms of game engine modeling, please give your pros and cons for two types of interfacing:

class MySceneObject_Model1 : public IRenderable, public IScriptable, public IAnimatable { ... }

class MySceneObject_Model2
{
protected:
   IRenderable* m_ptrRenderable;
   IScriptable* m_ptrScriptable;
   IAnimatable* m_ptrAnimatable;

public:

   IRenderable* GetRenderable();
   IScriptalbe* GetScriptalbe();
   IAnimatable* GetAnimatable();
}

What if MyObjects have different variations of supported interfaces? For example one of them can be only Scriptable. Some of interfaces could appear in future. Some of them could be very similar to each other: IAnimatableByMorphing, IAnimatableByBones, etc. Some of them can be very close to each other: IRenderable depends on new object's state after IAnimatable's work. I know it is very basic and very wide question, but tell about your experience!


texts: how did coordinate-handling in old flightsimulators work?

texts:
Im currently working on a combat flight simulator pure for own fun.
Using a floating-origin i thought the float inprecision was history, however this was the case untill i tried adding multiplayer to the game.

The server is authorative and i'm banging my head around positioning the players on the server and handling the gun hits and collisions.

Using sectors i reset the origin of the clients but the server keeps the original position. This will lead into float inprecisions on the server, thus physic and collision checking are terrible.

Now i'm just wondering how games like Airwarrior, Warbirds and aceshigh overcame these problems. What approach did they use? I'm assuming something else. If only i was able to use double precision, or even fixed point, but i'm tied to a physics model working with floats. I don't feel like changing that around, unless i have no other option.

Thanks for any pointers.

stephan


texts: How to check if a particular vector is pointing at X-Y plane or Y-Z plane

texts:
As you can observe from the diagram,
Vector A is pointing at the Y-Z plane and Vector B is pointing at  X-Y plane.
Is this possible to find? Am I missing some logic or concept?
EDIT:
Suppose, Vector B moves forward in its local space, in this, it would be moving along the z-axis and the world x-coordinate wouldn't change, and for Vector A, it would be the other way round. Basically, I want to know, which world coordinate would change if the vector moves forward in the local space?


texts: Moving the jBullet collision body to with the player object

texts:
I am trying to update the location of the rigid body for a player class, as my player moves around I would like the collision body to also move with the player object (currently represented as a cube).  Below is my current update method for when I want to update the xyz coords, but I am pretty sure I am not able to update the origin coords? :

    public void Update(float pX, float pY, float pZ) {
    posX = pX;
    posY = pY;
    posZ = pZ;

    //update the playerCube transform for the rigid body
    cubeTransform.origin.x = posX;
    cubeTransform.origin.y = posY;
    cubeTransform.origin.z = posZ;

    cubeRigidBody.getMotionState().setWorldTransform(cubeTransform);

    processTransformMatrix(cubeTransform);
    }

I do not have rotation updated, as I do not actually want/need the player body to rotate at all currently.  However, in the final game this will be put in place.


texts: Firing bullets with a time interval between them

texts:
How can I make my enemies shoot bullets in intervals?

I already have the enemy shooting bullets, however my problem is that it shoots the next bullet instantly, making it look like a line instead of bullets with gaps between them.

I tried to use gluttimerfunc but it didn't work since it just delayed the trigger of the bullet but once the trigger (bool statement) was set to true, it would shoot the max bullets on screen instantly.


texts: Why does glBindVertexArray sometimes fail (but mostly not)?

texts:
Quick outline:

Test program that loads and displays big (3k x 4k) 16bit gray scale images (ca. 32MB).
Using modern OpenGL (eg. 3.3 or so) with shaders VBOs VAOs etc.
Running on Windows with OpenTK (WinForms inside WPF) - C#
developing on ATI FireGL and Nvidia Quadro FX
using MipMapping

My test program is actually working quite well (seems like I am doing not so much wrong). I've written a load test to find threading errors and resource leaks. So ater a while of loading and closing viewers and their images, sporadically glBindVertexArray() fails in one viewer instance and works in another viewer instance. Speak: Different OpenGL contexts, same graphics card, same process, same thread.

Visually I see my OpenGL HWND filled with a red cross and a red frame.

The failing viewers become more over time. Never the less some still keep working.

My background loading of textures is currently disabled. So threading issues should be out of scope.
I do 'MakeCurrent()' the context before I draw.
As of WPF law, all my Viewers work in the same UI thread. (that's what I think)

So what is wrong?

It seems little like a resource problem... because the problems become more over runtime. But what could be the reasons why glBindVertexArray() fails. My workflow should be most of the time OK. So are there any data operations I have to glFlush() before I call?

Actually I tried to add a  glFlush() before it but it did not resolve it.

My Program flow is a little convoluted by OO patterns but essentially boils down to that:

Creation of VAO:

int a =GL.GenVertexArray();
GL.BindVertexArray(a);
int b1= GL.GenBuffer();
GL.BindBuffer(BufferTarget.ArrayBuffer, b1);
GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(BufferSize), data, BufferUsageHint.StaticDraw);

int b2= GL.GenBuffer();
GL.BindBuffer(BufferTarget.ArrayBuffer, b2);
GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(BufferSize), data, BufferUsageHint.StaticDraw);
//->vertex data  (OO implication of multi calls)
GL.BindBuffer(BufferTarget.ArrayBuffer, b1);
GL.BindBuffer(BufferTarget.ArrayBuffer, b1);
GL.EnableVertexAttribArray(0);
//-> texcoords
GL.VertexAttribPointer(0, elements, attrType, normalized, stride, offset);
GL.BindBuffer(BufferTarget.ArrayBuffer, b2);
GL.BindBuffer(BufferTarget.ArrayBuffer, b2);
GL.EnableVertexAttribArray(0);
GL.VertexAttribPointer(0, elements, attrType, normalized, stride, offset);

consider generic valid parameters.

The Draw happens about like that sequence of calls (which I hopefully reflect correctly)

MakeCurrent();
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
GL.UseProgram(prg);

// Set texture uniform
GL.Uniform1(Handle);
GL.ActiveTexture(unitnumber);
GL.BindTexture(Texture2D, Handle);

//... set some more Uniforms...
GL.GetError(); // returns NoError
// then it is over
GL.BindVertexArray(a);  // <<-- this is where it crashes sometimes!!

// this is my LUT-data but does not matter after the failing call
GL.ActiveTexture(1);
GL.BindTexture(TexTarget.TextureArray, Handle);

GL.DrawArrays(PrimitiveType.TRIANGLES, first, count);


texts:
I'm making a Pong clone in which the user can press the 'p' button to pause/unpause the game. When the user presses the 'p' button the word 'PAUSE' is drawn to the screen and when he presses again the word is erased. My problem is this:

As you can see, the ball sprite is erasing the text. Any clue on why this is happening? Here is the code for the main stuff.


texts: How do I play a sound after a given time is over?

texts:
I have a sound effect in my game that I want to play every time there is a collision detected, the problem is that the collisions are very frequent and the sound plays many times and gets overlapped, which doesn't sound good.
The code is simple enough, I just put a walkSound.Play() in the OnCollisionEnter method.
I also tried using a coroutine but I don't get the desired result:
private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag == "Ground")
        {
            StartCoroutine(WalkSound());
        }

    }

IEnumerator WalkSound()
    {
        walkSound.Play();
        yield return new WaitForSeconds(0.41f);
    }

The WaitForSeconds could be above the playing code, but then there is an unnecessary delay that I don't need.
Basically what I want to achieve is, to have code execute the Play() method only when the previous iteration of the sound reaches 0.41f seconds. This is similar to having an if statement that checks if the sound is already playing, but I want the sound to overlap at a given time.
Hope I was clear enough, any help appreciated. :)


texts: How to remember a non-consumable Unity IAP the right way

texts:
I have implemented Unity 5's IAP system through Google Play. I read a few guides that mention not to store completed purchases in PlayerPrefs because it is clear text and easy to hack, but none mention the correct way to "remember" purchases. For example, when re-installing an Anroid app, purchases are restored the first time the app runs by individual calls to this method defined in the Unity IAP API.

public PurchaseProcessingResult ProcessPurchase (PurchaseEventArgs e)
    {
        //my Playerpref save that I want to avoid is here.
        return PurchaseProcessingResult.Complete;
    }

On subsuqent app runs, this method is not called again. Is there a way to query past purchases other than saving them in PlayerPrefs?


texts:
Before I start development of an XNA game, I need to choose a 3D game engine to develop upon. Is this belief unfounded? Does XNA have basic object transformation, lighting and mesh/texture importing functionality by which you can develop a decent 3D side-scrolling game?

Chances are I'm going to need a 3D engine such as Torque X to handle most of the special effects, animation and sound for me. What are the engines that you recommend building an XNA game with? What work reliably in your experience? Is XNA alone enough? do you have repositories of code that work directly with XNA to create effects and other game environments with sunlight, fog and rain?


texts:
I'm having weird black artifacts appear on my render textures when they are transformed while the game is running.

I am using a ScrollRect as a scrolling container for buttons (the buttons are just textured quads with the same render texture applied to them). When I translate the quads while the game is running, strange black artifacts will appear on the quads themselves.

Is there a way to fix this?

Edit: Interesting to note, setting every quad inactive except for one fixed the artifacting on the only visible quad: http://i.imgur.com/OInBBWs.png

The intensity of the artifacting seems to be related to the number of objects on-screen that use the same render texture. 5 quads active with the same render texture has a really pronounced artifacting, 3 is more subtle, 1 is visibly non-existent.


texts: UV Tiling & Offset input values from World Position - incorrect behavior?

texts:
I'm using ShaderGraph in 2020.1.0f1. I have some shader experience, but it's all been handwriting shaders. I have experience with node-based things of this nature by way of Substance Designer. I'm working on a shader that should allow for seamless visibility between quads by changing the UV offset of a noise pattern based on the world position of the quad.
That said, I'm running into two things. This short (0:05) video shows how I'm expecting this to work - as the X/Y values of the UV Offset are changed, the continuous flow of the noise is smooth.
https://youtu.be/YAd9BtAWVRM
So, I add a position node and a split node, feed the world position into the split, and feed R/G from the split to X/Y of the Vector2 node. That does two things: it makes the preview boxes 3D (becomes a sphere instead of a quad), and "expands" the apparent tiling:

I'm guessing this is because the value from the split is a Vector1 rather than a float, though it seems odd that there's no implicit conversion, or that Vector1 values applied to UV Offset would change the actual appearance.
So, is this due to it being a Vector1 rather than a float? If so, is there a node that can convert from Vector1 to float? Am I going about this the wrong way entirely?


texts: I am creating simple game for android.I used touchphase.moved to power up my ball and touchphase.ended to throw the ball.But what happened is the ball is thrown when I moved my finger in both x and y direction.But I want the ball to be thrown only while swiping in y direction.How to do that Suggest me?


texts:
I'm at the beginning stages of building my first 2D game engine, and I'm not sure if I should setup my base 2D vector class as a vec3(x, y, z) or a vec2(x, y)

I might want to use a vec3(x, y, z) for adding z values, for ordering which objects would overlap other objects and still be visible. I'm also not sure if it's just easier to have a vec3 for working with the transformation matrices and graphics libraries like OpenGL. This is my first game engine project, and I don't really know what is required for the long haul, in a 2D game.

How should I setup a vector class for a 2D game engine?


texts: How can I get accurate collision resolution on the corners of rectangles?

texts:
I have a working collision system implemented, and it's based on minimum translation vectors. This works fine in most cases except when the minimum translation vector is not actually in the direction of the collision.

For example:

When a rectangle is on the far edge on any side of another rectangle, a force can be applied, in this example down, the pushes one rectangle into the other, particularly a static object like a wall or a floor. As in the picture, the collision is coming from above, but because it's on the very edge, it translates to the left instead of back up. I've searched for a while to find an approach but everything I can find deals with general corner collisions where my problem is only in this one limited case.

Any suggestions?


texts: Calculating probabilities for a custom drop table system

texts:
I have a "drop table" / "loot table" / "item table" / "whatever you want to call it" system and I need to solve two Problems. Apologies in advance for the text wall :/
The Problems:

Calculate the probability of pulling a specific item from a table
Calculate the probability of pulling ANY item from a table with a specific tag (such as "Epic", "Rare", "Weapon", "Sword", "Currency", etc)

A few details about the system:

Tables are setup with a certain number of 'Slots' and 'Rolls'
Slots determines the total number of unique items that can be dropped from the table
Rolls determines how many times we 'pull' an item out of the table
Each row within a table will drop one of a pre-calculated set of items
Each row can be marked as 'Guaranteed', 'Random' or both (more on that in a bit)
Rows have a 'MaxRollsToConsume' field (0 == infinite rolls), and a Weight field (used for weighted randomness, 0 Weight = never pulled)

And a bit of pseudo code for how we actually pull items out of the table
create a guaranteed set of rows
create a random pool of rows
create a result with a set number of slots available to fill

(note: adding an item to the result will only fill a slot if that item does not already exist in the result)

foreach row in table
   if row is guaranteed, then add to guaranteed set
   if row is random, then add to random pool

foreach row in guaranteed set
   pull item out of row and add it to result
   consume a roll

while there are rolls remaining and empty slots in the result
   select a row from the random set using weighted randomness and respecting the MaxRollsToConsume field
   pull item out of row and add it to result
   consume a roll
   if this row has reached its max rolls then remove it from the random pool

while there are rolls remaining
   select an item from the current result using weighted randomness and respecting the MaxRollsToConsume field
   add the item to the result
   consume a roll

return the result

I understand how to calculate the probabilities for the 'Guaranteed' rows because, well, they are events that are guaranteed to happen so it's pretty easy to calculate.
Where I'm falling short is on how to calculate the 'Random' rows (especially with respect to the MaxRollsToConsume field) and only pulling a certain number of times. For example, I have 5 random rows, but only 2 Rolls to consume. How do I calculate the probability of an item being pulled from one of the those 2 Rolls while also taking into account how many Rolls are allowed per row?
I'm fairly confident that if I can solve Problem 1 with some help then I'll be able to solve Problem 2 on my own. Any help is appreciated and thanks in advance! If anything is unclear or more info is needed please let me know! :)


texts: How can I start the game with a random formation?

texts:
public class SquadFormation : MonoBehaviour
{
    enum Formation
    {
        Square, Circle, Triangle
    }

    [Header("Main Settings")]
    public Transform squadMemeberPrefab;
    public int columns = 4;
    [Range(4, 100)]
    public int numberOfSquadMembers = 20;
    public float yOffset = 0;
    [Range(1, 20)]
    public int numberOfSquads = 1;
    [Space(5)]
    [Header("Formations")]
    public int squareSpace = 10;
    public int circleSpace = 40;
    [Range(3,50)]
    public float moveSpeed = 3;
    public bool randomSpeed = false;
    [Range(3, 50)]
    public float rotateSpeed = 1;
    public float threshold = 0.1f;
    public bool destroySquad = false;
    public string currentFormation;
    public bool startRandomFormation = false;

    private Formation formation;
    private List<Quaternion> quaternions = new List<Quaternion>();
    private List<Vector3> newpositions = new List<Vector3>();
    private bool move = false;
    private bool squareFormation = false;
    private List<GameObject> squadMembers = new List<GameObject>();
    private float[] step;
    private int[] randomSpeeds;
    private int index = 0;
    private int numofobjects = 0;

    // Use this for initialization
    void Start()
    {
        numofobjects = numberOfSquadMembers;
        if (startRandomFormation)
        {
            formation = UnityEngine.Random.Range(1, 3);
        }

In this case I have 3 formations. But it might later more or less formations.
Making this line is has no sense:

formation = UnityEngine.Random.Range(1, 3);

The idea is to start randomly with one of the 3 formations.

How can I get the number of formations ? The count in the enum ? And how can I select randomly one formation ?


texts: How can I rotate the camera around the player on the Y axis on this code in Unity?

texts:
I have a problem, I want my camera to rotate along the Y axis while he is looking at the player with an offset. I want to rotate with Q and E key to right and left around the player but on my Camera Follow Player Script I used Vector3.SmoothDamp to follow the player on the other side when I try to rotate with Keys with transform.RotateAround() it seems like its locked on the Y axis I dont know how to get around this.

Code:

void CameraFollowPlayer()
{
    transform.position = Vector3.SmoothDamp(transform.position, player.position + offset,
                                             ref velocity, smoothSpeed * Time.deltaTime);
    transform.LookAt(player.position);
}

void RotateRightLeft ()
{
    if(Input.GetKey (KeyCode.E))
    {
        transform.RotateAround(player.position, transform.up, rotateSpeed * Time.deltaTime);
    }

    if(Input.GetKey (KeyCode.Q))
    {
        transform.RotateAround(player.position, -transform.up, rotateSpeed * Time.deltaTime);
    }
}


texts:
want to import models that i made in to garrys mod but i cant figure out how to convert them in to .mdl files. I dont have any moding experience with the source engine. I tried to find a program to convert them but with no luck.
My models are textured (.png files for the textures and the .mtl for the mapsing)
Any wany to do it?


texts: Why is there a different set-constant-buffer function for every shader type?

texts:
Why are there VSSetConstantBuffers(), GSSetConstantBuffers(), PSSetConstantBuffers() (and so on) instead of just one SetConstantBuffers() for all shaders?

Should I have completely separate constant buffers for every shader type or should I use different functions (e.g. VSSet.../PSSet...) to set the same constant buffer when it holds data used in multiple shader types (such as light position or transform matrices)?


texts:
While profiling GPU usage in VS2017, I've noticed a strange disproportion in performance of ClearRenderTargetView compared to ClearDepthStencilView:

What can cause this four-orders-of-magnitude difference?

First idea was that the 1.0f I'm writing to the depth buffer is a special optimized value, so I've tried 0.0f and 0.4f, but it seem to affect nothing. Then I tried to change the clear color from (0,0,0,1) to (0,0,0,0) to no avail.

Googling for ClearRenderTargetView performance brings up nothing.

The only thing I can think of is that the target texture is somehow affected by the D3D9 interop it participates in:

private void InitRenderTarget(int width, int height) {
    var renderTargetDescr = new Texture2DDescription() {
        Width = width,
        Height = height,
        MipLevels = 1,
        ArraySize = 1,
        SampleDescription = new DxgiSampleDescription(1, 0),
        Usage = ResourceUsage.Default,
        CpuAccessFlags = CpuAccessFlags.None,

        // The following are mandatory for WPF interop:
        Format = DxgiFormat.B8G8R8A8_UNorm,
        BindFlags = BindFlags.RenderTarget | BindFlags.ShaderResource,
        OptionFlags = ResourceOptionFlags.Shared
    };
    _renderTarget = new Texture2D(_device, renderTargetDescr);
    var renderTargetViewDescr = new RenderTargetViewDescription {
        Format = renderTargetDescr.Format,
        Dimension = RenderTargetViewDimension.Texture2D
    };
    _renderTargetView = new RenderTargetView(_device, _renderTarget, renderTargetViewDescr);
}

private void SetupWpfInterop() {
    _surfaceD3D9 = _d3d9.DXDevice.GetSharedD3D9(_renderTarget).GetSurfaceLevel(0);
    _targetImage.Lock();
    _targetImage.SetBackBuffer(D3DResourceType.IDirect3DSurface9, _surfaceD3D9.NativePointer);
    _targetImage.Unlock();
}

But then, calls to DrawIndexed would likely also be affected, which doesn't seem to be the case (or I just misinterpret the profiler diagrams).


texts: Small text is very light / faint with FreeType and OpenGL

texts:
I'm able to render large text with FreeType just fine:

But when I want to render small text (and the only parameter that changes is the font size), the quality is much poorer:

As you can see, all the characters are very faint, although the 'o' and the 'w' look a bit better than the others.

I've Googled around for similar topics, and many people mention hinting as a potential source of problems.  Right now I'm calling FT_Load_Glyph() with the FT_LOAD_DEFAULT flag, although I've tried pretty much every flag listed at http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_LOAD_XXX and none of them have produced adequate results.

Has anyone had a similar problem and determined how to fix it?  I really need to render clearly-readable text at a small size, but I've heard that FreeType runs into problems here because certain hinting algorithms are patented, so should I look into an alternative text-drawing library and/or an alternative font?  I'm not completely attached to this particular font (it's Liberation Sans TTF), so if there was another font I could use that would look better, that would be fine too.


texts: It is worth planning before jumping in the code?

texts:
I always thought that planning is important for a game. But i don't know at which point. Some are telling me to code instead of planning but i feel like its still important because when you will be in the code you will know what to do next more easily. I am currently working on a game that will have lots of content so i decided to start a design document introducing thoses content and at a side-level i am doing proofs of concept to check if it can be done. Parts of each proofs of concept then could be used later in the real game.

EDIT: I am working alone on this project.

So my question is : It is worth planning before jumping in the code ? Im still interested to know what others have to say about this. Cause i still get some poeple saying i should code instead of thinking.. so what your opinion on this ?


texts: How does Unity call "update()" in the scripts?

texts: I understand that you can expose your C++ code to a scripting language such as ChaiScript. From this you can call code that you've made in C++. In Unity, however, they have functions in the script, such as Update() that get called. In other words, how do I call script functions from C++?


texts: Client Side Prediction for a Look Vector

texts:
So I am making a first person networked shooter.  I am working on client-side prediction where I am predicting player position and look vectors client-side based on input messages received from the server.  Right now I am only worried about the look vectors though.  I am receiving the correct look vector from the server about 20 times per second and I am checking that against the look vector that I have client side.  I want to interpolate the clients look vector towards the correct one that is server side over a period of time.  Therefore no matter how far you are away from the servers look vector you will interpolate to it over the same amount of time.  Ex. if you were 10 degrees off it would take the same amount of time as if you were 2 degrees off to be correctly lined up with the server copy.  My code looks something like this but the problem is that the amount that you are changing the clients copy gets infinitesimally small so you will actually never reach the servers copy.  This is because I am always calculating the difference and only moving by a percentage of that every frame.  Does anyone have any suggestions on how to interpolate towards the servers copy correctly?

if(rotationDiffY > ClientSideAttributes::minRotation)
{

    if(serverRotY > clientRotY)
    {
        playerObjects[i]->collisionObject->rotation.y += (rotationDiffY * deltaTime);
    }
    else
    {
        playerObjects[i]->collisionObject->rotation.y -= (rotationDiffY deltaTime);
    }

}


texts: How to access SpriteBatch, Input, and ContentManager from all game screens?

texts:
I'm trying to make a Game State Manager and I'm using the Microsoft Game State Management Sample as guidance. However, I want a more simplistic design (no transitions, reflection, or support for 360/Phone). Now, I am diverging a bit in to my own design.

I figure every single game screen is going to need access to the SpriteBatch, ContentManager, and Input. Input is a class I defined to detect key and mouse presses/releases/etc.

Currently I'm just using regular old dependency injection and just passing those three references in to the constructor of all newly created screens, but the code repetition is bugging me slightly.

Since all screens in my game are going to need to detect input, load content, and draw to the screen, I'd prefer a solution where I wouldn't have to cumbersomely pass and include these three objects in all new game screens. However, I'm not sure how exactly to do this.

I suppose the Game Screen Manager could maintain a reference to all of these objects, but then each game screen would have to maintain a reference to the game screen manager, which just sounds wrong. Also, they would have to be public properties on the game screen manager and I'm not sure I want to expose that much information to potential clients. Ideally, each game screen would not have to know about the game screen manager and would somehow have access to these three essential objects without requiring them in all of their constructors.

Any ideas? Thanks.


texts:
( sorry for my bad english in advance :D )

I'm trying to get a .exe setup output, from my UDK !( with my own maps and scripts which I made within MyGame)
I tried UnrealFrontEnd! But It made a setup , that after installation I can see my .udk maps, my packages and etc.
But It's not a real output that I can show to my customers. I don't want, other can use my resources !

So... How can I get a binary-like output from UDK as a real Game-Output ? ( like what we see in all commercial games )
Is there any option in frontend that I missed ?


texts:
I am building forward rendering engine combined with atlas shadow map technique.

My goal is to build an engine that is capable of rendering similar scenes from games such as..
Doom

Overwatch

So I wonder, do I need to write one giant shader that does all? or do I have many different shaders for each different materials?


texts: How can I set the world matrix from an array of floats in D3D9?

texts:
I have objects that hold their own transform matrix (calculated every frame by the physics system) held in a linear array of floats as follows:

[m0, m1,  m2,  m3]
[m4, m5,  m6,  m7]
[m8, m9, m10, m11]

How can I assign this matrix to D3D's world matrix for use in rendering the objects?


texts: A solution for developing a web game client for iphone and ipad…

texts:
We have just finished developing a web game using flex + flash + python and now we want to make a client app for the iphone/ipad device just like this one

Since we have had no such experience I hope someone has done this might give us some hint or suggestions.

PS:I got some advice from other websites saying that I can do it as follows:
1.Re-write those as script (logic stuff) with objC (I agree with this)
2.Use html5 (which I do not understand quite well, does this mean that I need to re-write those MXML files with html5?)

Thanks in advance.


texts: How can I render a single object that uses multiple textures?

texts:
I'm looking for a technique to render an object with multiple texture sources. One texture is static, the other is generated dynamically (it's a render target). For example, say I was rendering a TV. The frame of the TV is a static texture and the image comes from a render-to-texture pass.

It doesn't sound difficult but I've been unable to find a decent approach. Some of my ideas are:

Instead of rendering to a unique texture I render to a part of the other texture (so the part with the TV screen is overwritten, the frame remains). This doesn't work if I want to combine multiple textures (two TVs with different frames, same show playing)
Create a two-part object: render the TV frame as one-object then render the image as another. This would require leaving a hole in the one model, or putting the other model slightly on top. Is there a drawback to this approach?

Is there another approach that works well?


texts:
a game that I currently working on is in a way that player should actually draw a rainbow on the screen by tap and drag gesture in order to make a hills for the car.

but the issue that i currently facing on is if the player wants to pause the game by touching the right most button on the screen above, the game will stop but the hill that he was drawn will remove. I actually not have any idea how can i put exception for that button on the screen because everytime i calculate the whole pixels on the screen for drawing hills.
do you have any idea how can i solve this issue ?

btw, this is my code if it's required : http://pastebin.com/VnLAQbzW


texts:
I've made a totally new scene for a 2D mobile game. I placed a sprite on the center of the screen and attached the following script onto it (this is basically a diablo-style click-to-move control script, the sprite follows the pointer when it is clicked):

using UnityEngine;

public class Movement : MonoBehaviour
{
private float _moveSpeed = 5;
private Vector3 _targetPosition;
private float _targetDistance;

void Update()
{
    _targetDistance = Vector3.Distance(_targetPosition, transform.position);

    if (_targetDistance < 1)
    {
        _moveSpeed = 0;
    }
    else if (_targetDistance > 1)
    {
        _moveSpeed = 5;
    }

    if (Input.GetMouseButton(0))
    {
        Plane playerPlane = new Plane(Vector3.up, transform.position);
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        float hitdist = 0.0f;

        if (playerPlane.Raycast(ray, out hitdist))
        {
            _targetPosition = ray.GetPoint(hitdist);
        }
    }

    if (_targetDistance > 1)
    {
        transform.position += (_targetPosition - transform.position).normalized * _moveSpeed * Time.deltaTime;
    }
}
}

Normally this script doesn't work unless I rotate the main camera by 90 degrees (axis: X) and rotate the sprite also by 90 degrees (axis: X).

How should I modify the script to make it work without rotating the camera and all the sprites I place on the scene?

Thank you in advance!


texts:
I have what I think is a great idea for a small android game. It might be crap, but for the sake of the discussion, let's assume it is potentially good. I'm currently learning game development as a self-taught. So if I succeed in creating that game, it won't be before a few years, until I get the technical knowledge to fully build it.

In the mean time, should I talk about that idea (in order to get help, advices, feedbacks) to confirmed developpers I might encounter? My game is not incredibly complex, so it could probably be developped by an experienced programmer in a few months. So if it's actually any good, talking about it means taking the risk of having my idea stolen and developped by someone else.

Is this risk real, or am I completely foolish?

More generally, are there some caveats that a newbie developper should be aware of when sharing ideas and concepts with other people?


texts:
Alright, so I want my guy to move, I simply use this code.

velocity.y = speed;

Same goes for velocity.x
Thing is, the lower the framerate the slower he moves.

But, if I add delta time, the player will sometimes, randomly, jitter back. Now I've traced the problem to be the delta time, but I don't know why. This is a small output of my delta time.

0.017027862
0.01713779
0.015907489
0.017954277
0.015993927
0.016019527
0.017010393
0.017026054
0.016008984
0.01701702

So it doesn't really vary that much per frame, still the jittering keeps happening.

Any possible solutions?


texts: Making large scale changes to an economy in a social game

texts: Are there any examples or case studies of social games, specifically on Facebook, where the developer has made drastic changes to the economy?  I'm specifically interested in examples where the old economy was based off of purchasing items with Facebook credits then moving to a new model where the same inventory or similar inventory is sold with a soft currency.  The closest comparisons I've been able to find so far are looking at iOS games that have gone from purchase models to freemium models, but haven't found a comparable scenario in a social game besides larger scale MMO's.


texts: Centering GLViewport position within physical screen

texts:
I'm developing my app on one device and want it to display at the same ratio on all other devices.

Currently what I have is 'image 1' in my image below - the game fits perfectly onto my development device's screen.

If I keep the viewport at the same ratio then I get the results seen in 'image 2'.

This is great, but now I need to center the viewport , and I'm not sure how to do that.

What I'm aiming for is what is in 'image 3' - just not sure how to get there.

This is how I'm keeping the viewport at the same ratio:

the ratio is width / height (this is 1.702127659574468 and we will use this explicitly)

//Set viewport size based on screen dimensions
GLES20.glViewport(XVal, YVal, (int) (height * 1.702127659574468), height);

At the moment, XVal and YVal are both 0 - I need to change XVal to move the image along.

How do I work out the amount to move the viewport along by? (I know it will be equal to half of the space to the right of the viewport ('image 2') - just not sure how to work this out.......)


texts: Completion rates/retention rates and hours spent on avg for adventure/rpg games

texts:
I'm building an adventure/RPG game and would like to understand two main metrics for this genre of game:

Completion/retention rates
Hours spent playing per day, or week or month, etc

If demographic data with reasoning is available that would be helpful too.

IGN's GDC Study gave a list of specific titles, such as Portal - 47%, but I'm looking for something more genre related.


texts: How can I improve the seemingly capped framerate of my flash game?

texts:
I used to be sure that all Flash games are capped to 30fps as Edmund McMillen's  The Binding of Isaac runs at that frame rate. N v2.0 (Flash Player 11) runs at 60fps.
Why do games developed in Flash seem to have capped frame rate?
What are the limits on the fps when developing in Flash?


texts:
I have a task in hand about making a puzzle generator, that can fill a game board with colored pearls, that then needs to be solved by the player.

The core rules are

Pearls are placed in a grid, size varying each level.
The player needs to clear out all the pearls, or the level is lost.
Only three pearls in a row (adjacent to each other) can be popped.
Popping 7 or more will pop each pearl of that color, easing up the board quite a lot.
Pearls are affected by gravity, and will fall down on the cleared pearls place.
No new pearls are spawned.

I also need two levers to adjust difficulty. One being the number of colors the pearls can have (clear to the player) and another being a "cruelty" factor in how tight the spectrum of right solutions vs dead ends the level contains.

I seem to be at a crossroad between two ways of approaching this, and would like feedback from you gents and gals.

My two options seems to be :

Start out with a clean board, and programmatically add pearls-combos to the board till its full. Then the player needs to track backwards from there to solve it. (They wont see it actually being generated, this will happend backstage) This should ensure that a board always have at least one solution, which is backtracking how the engine placed the pearls in the first place.
Making a pure random board, and then set a scripted runner to try and solve it, branching every time there are more than poppable option, and starting over on a new board if all branches leads to a dead end. This should give me a good result about how many dead ends vs solutions the board contains.

Im not sure which is the best approach, or if I got it all wrong and need to go for a third approach to this. Admittedly, this is my first attempt on a puzzle game mechanics.


texts: How to start a coroutine that will finish after the object is destroyed

texts:
I have a simple game in which the player can collect power-ups. Each power-up gives the player a temporary advantage for several seconds. The power-up should disappear immediately after the player collects it.

My current implementation of the power-up logic is:

[SerializeField] float duration;

private void OnTriggerEnter2D(Collider2D other) {
    if (other.tag == "Player") {
            StartCoroutine(GiveTemporaryPowerup(other.gameObject));
            Destroy(gameObject);
    }
}

private IEnumerator GiveTemporaryPowerup(GameObject gameObject) {
    gameObject.ActivatePowerupFunction();
    yield return new WaitForSeconds(duration);
    gameObject.DeactivatePowerupFunction();
}

This does not work: the powerup is activated but not deactivated. Deactivation does work when I remove the line "Destroy(gameObject)". However, without this line the player can collect the same powerup several times, which I want to avoid.

I tried to put the coroutine on a component attached to the player object (rather than the power-up object), but this did not solve the problem - deactivate was not called. Here is the updated code on the power-up:

private void OnTriggerEnter2D(Collider2D other) {
    if (other.tag == "Player") {
            var playerComponent = other.gameObject.GetComponent<Player>();
            StartCoroutine(playerComponent.GiveTemporaryPowerup(duration));
            Destroy(gameObject);
    }
}

And the code on the Player component:

public IEnumerator GiveTemporaryPowerup(float duration) {
    ActivatePowerupFunction();
    yield return new WaitForSeconds(duration);
    DeactivatePowerupFunction();
}

What is the correct way to implement this?


texts: How can I use Unity Assets made by Unity in a commercial project?

texts: I know you can't use starter and training etc.. assets made by Unity for commercial purposes, but according to this every Unity asset made by Unity is restricted for commercial use. So that means I can't use Post Processing Stack? That would be disappointing.


texts:
I've made a custom skydome in my game. For all my lights I have set them to not affect the skydome. The only thing affecting the skydome is the ambient light.

For my game I have ambient intensity at 0.8, but this makes my skydome much darker than the original texture. What I want to do is to set the ambient intensity for the skydome to 1.0 and for all other objects to 0.8.

Is there any way I can say before drawing the skydome set ambient intensity to 1.0, and right after set it back to 0.8? Or is there perhaps a simpler solution? :)


texts: How to perform some custom math between the model matrix and the projection matrix?

texts:
I'm trying to write a shader in Unity that will perform some custom math after the model*view matrix is applied but before the projection matrix is applied.
First off, I'm not sure whether I should be using a surface shader or an unlit shader. My impression is that a surface shader can do everything I need it to and the outcome will look better with less effort, is that right?
I'm thinking that what I can do is manually apply the model and view matrices in the vertex shader, and then I have to tell it somehow to only apply the projection matrix in the rasterization step. Any idea how to go about this, or a different way to achieve the same result?


texts: Collision with tile corners/seams in 2D platformer

texts:
There seems to be a lot of somewhat related questions answered already, but none I read answered my exact problem.

I have a 2D platformer whose world is made entirely out of tiles that are in a regular grid. When there is a collision, I just move the character to the position he was in prior to the collision and it works well enough for me.

The character can fly/slide in the world, so I also want to set the speed towards the collided tile to zero. Here lies my problem.

At the moment the only way to do this I can think of is to check the difference between the character position and the center of the tile. If (the absolute value of the) x-difference is greater, then it is a horizontal collision. If y-difference is greater, then it's a vertical one. However, as the character is sliding horizontally on tiles, from one tile to another, sometimes he stops at the seam of the tiles because momentarily the x-difference becomes a tiny bit greater than the y-difference (due to float inaccuracies I suspect). I don't know if it's possible to change this algorithm to fix this, or if I need a new one. Any algorithm will do, as long as it fulfills the "requirements" stated above.

If at all possible, I want to treat the x- and y-collisions identically, because the movement is not just walking horizontally.

Image illustration: http://i.stack.imgur.com/URkoV.png


texts:
Quick question:

I have a SoundEffect instance, and I would like to know if it is playing at the moment or not. But there's neither a method, nor a property that would allow to check it...

So, is there a way to know it?


texts: Unity: Unable to rearrange "Sorting Layer" for 2D game

texts:
Since yesterday I got a bit into game development with Unity (i've never done game development before), and I am currently making a small 2D game. I am attempting to rearrange the various layers in the "Sorting Layers" list. According to Unity's own official tutorial, you can simply drag & drop the layers around to rearrange them. However, when I click on one of the layers, I can not drag it anywhere.

Can someone help me out?


texts:
I'm using NavMesh, and NavMeshAgent for my character movement and Pathfinding.

I made a testing NavMesh with 2 area layers:

0 = Walkable
3 = Water.

In have a  click to move script, and i need to get the ID of the NavMesh Area where the player clicked. I tried to get the ID of the layer where the player clicked, using NavMeshHit.mask but is always resulting 0, even if I click where the NavMesh area ID is 3.

From Unity documentation:

  Mask specifying NavMesh area at point of hit.

Script:

RaycastHit hit;
NavMeshHit nHit;
Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
if(Physics.Raycast(ray, out hit)){
    bool hasHit = NavMesh.Raycast (this.transform.position, ray.direction, out nHit, NavMesh.AllAreas);
    if (hasHit) {
        Debug.Log ("Area ID: " + nHit.mask);
        targetPosition = hit.point;
    }
}


texts: Exporting Blender bones' transform matrix

texts:
I use this simple python script to export bones transformation:

bones = armature.pose.bones
# for eaach bone in bones
SystemMatrix = Matrix.Scale(-1, 4, Vector((0, 0, 1))) * Matrix.Rotation(radians(-90), 4, 'X')
if (bone.parent):
  Export_babylon.write_matrix4(file_handler, "matrix", bone.parent.matrix.inverted() * bone.matrix)
else:
  Export_babylon.write_matrix4(file_handler, "matrix", SystemMatrix * bone.matrix)

I'm using a left handed Y up system but I should forget something about rotation because the result is not correct :(

Original (under Blender):


texts:
I'm trying to move a game object within a set x and y range. I thought the code below would work, but it does nothing. The idea is the player controls the platform and tries to move under the ball. Any suggestions would be appreciated.

using UnityEngine;
using System.Collections;

[System.Serializable]
public class Boundary{
    public float xMin, xMax, yMin, yMax;
}

public class PlatformController : MonoBehaviour {

    public float speed = 10f;
    public Boundary boundary;
    public Rigidbody platformRB;

    void Start(){
        platformRB = GetComponent<Rigidbody> ();
    }

    void FixedUpdate(){

        float moveHorizontal = Input.GetAxis ("Horizontal");
        float moveVertical = Input.GetAxis ("Vertical");

        Vector3 movement = new Vector3 (moveHorizontal, moveVertical, 0f);
        platformRB.velocity = movement * speed;

        platformRB.position = new Vector3 (
            Mathf.Clamp (platformRB.position.x, boundary.xMin, boundary.xMax),
            Mathf.Clamp (platformRB.position.y, boundary.yMin, boundary.yMax),
            0f
        );
    }
}

Here's how the rolling ball works (as is intended)

using UnityEngine;
using System.Collections;

public class BallMovement : MonoBehaviour {

    public Rigidbody ballRB;
    public float thrust;

    // Use this for initialization
    void Start () {
        ballRB = GetComponent<Rigidbody> ();
    }

    // Update is called once per frame
    void FixedUpdate(){
        ballRB.AddForce (Vector3.right * thrust);
    }
}


texts: When one begins the character design process, what are good starting points? Are there well known methodologies or systems to help in this process? How does the design process work in game industry, and are there big differences between the approaches different game producers use?


texts: Why does this code never switch back to the object at index 0?

texts:
I have two GameObjects in an array, and the S key is used to cycle an index referring the objects in this array.

When I run the game for the first time and press S, it changes from 0 to 1 and then to 2. After that it just cycles between 1 and 2... but it should be changing between 0 and 1 only; there are only two objects.

Why is this behavior occurring? My code is below:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SwitchObjects : MonoBehaviour
{
    public GameObject[] objects;
    public int activeIndex = 0;

    public void SetActiveObject(int aIndex)
    {
        activeIndex = aIndex;
        for (int i = 0; i < objects.Length; i++)
            objects[i].SetActive(i == activeIndex);
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.S))
        {
            if (activeIndex == objects.Length)
                activeIndex = 0;
            activeIndex++;
            SetActiveObject(activeIndex);
        }
    }
}


texts: What makes aiming on a PC first person shooter feel good?

texts:
I liked this question:
What makes aiming in a console first person shooter feel good?

So here it is for PC (and its not a dupe because a mouse is hugely different from an analog stick)

You've probably noticed some games "feel better" than others when it comes to aiming using the mouse.  Why is that?

Some of the best engines are the original Half Life 1 engine and the Quake 3 engine.

What is the biggest problem?  Laggy input response?


texts: What are real world uses of secondary key bindings?

texts:
I'm currently wondering if there's really a reasonable use that would justify making the effort of implementing secondary key bindings?

If you don't know what they are: They allow multiple controls (keys, mouse clicks, ..) to be mapped to the same action (running forward, opening a chest, ..).


texts: What is GPU instancing and what are its differences in comparison to standard instancing?

texts:
I have been reading a lot of debate on a new feature that will be in Unity 5.4: GPU instancing. I understand the importance of instancing in general, both in terms of saving memory and draw calls.

However, even after doing some reading, I still couldn't understand what exactly are the differences between GPU instancing and non-GPU instancing - and, more importantly, where the alleged GPU advantages in terms of performance come from.

Thanks for your knowledge and for any references.


texts:
For my game, I'm currently considering where I should save the player's information (configuration files, state saves, player generated content). 'Where' refers to the physical location on disk. I have seen these approaches (there are probably more):

(A subfolder in) the game's install dir (\Program Files\somegame\save\config.sav)
A subfolder in My Documents (\Users\someuser\My Documents\gamename\config.sav)
A subfolder in My Games (\Users\someuser\My Documents\My Games\gamename\config.sav)

Are there any important advantages to / reasons for using one over the other?


texts: What causes seemingly random triangle artifacts in OpenGL?

texts:
When switching version of OpenGL from 4.5 to 4.4, I suddenly started seeing these weird random triangles flickering over my scene

They move around somewhat randomly and are always pointed towards [0,0].

Given that this only appears in 4.4 and not in 4.5, my guess would be that I have some undefined behavior that manifests only in one version? I'm not using any advanced OpenGL, just drawing basic triangles with VBO buffers.

How should I go about debugging these sorts of issues, and what are the likely causes that manifest as artifacts? (The hexes and the white-ish path are what I inteded to draw, only the black/yellow/blue triangles are the artifacts)


texts: How can I make a character walk on uneven walls in a 2D platformer?

texts:
I want to have a playable character who can "walk" on an organic surface at any angle, including sideways and upside-down. By "organic" levels with slanted and curved features instead of straight lines at 90-degree angles.

I'm currently working in AS3 (moderate amateur experience) and using Nape (pretty much a newbie) for basic gravity-based physics, to which this walking mechanic will be an obvious exception.

Is there a procedural way to do this kind of walk mechanic, perhaps using Nape constraints? Or would it be best to create explicit walking "paths" following the contours of the level surfaces and use them to constrain the walking movement?


texts: Why is 90° horz / 60° vert the default FPS Field of View?

texts:
As far as I understand it, vertical Field of View should be adjusted to:

fov = 2 * arctan(0.5*screenHeight / distanceEyeScreen);

That is, Field of View should match a user's distance to and size of the screen.

In many FPS, there's a default value of 90° for horizontal FoV, or 60° for vertical FoV (assuming 16:9). One example is CryEngine.
But for a 16:9 20" screen (diagonal of visible area, i.e. about 40 cm x 25 cm), this default value would require users to have their eyes 20 cm from the screen in order to get a perspectively correct view.

So either I've made a mistake in my calculations, or there must be a reason why you'd choose an inadequate FoV value on purpose.

What is the reason for a default FoV of 90° horz / 60° vert?


texts: Java LWJGL - How can I add water to my 3d world?

texts: The title says it all, how can I implement a simplistic water system into my game? I am using Java LWJGL and OpenGL glsl shaders. I am still fairly new to game programming, and a complete noob in the use of shaders so some guidance and a thorough explanation would be great!


texts: How to make Frame Independent Timer Clock

texts: I want to make a frame Independent Timer that it work consistently across different computer configuration.


texts:
I'm wondering what would be the best way to store password and login in the client. Many people complain that they need to re-enter this every time they log in and they want me to make a way to save it. But how to save it? Saving it as plain text in game folder wouldn't be clever, but neither would encrypting it help so much. It would still be easy to decrypt the data.

How would you do that?

Best regards!


texts: Pygame Collision | Why do I slide up walls in my tile based game?

texts:
My player if in contact with a wall either left/right/top(head) they will be able to just continue in the Y direction if you press jump as if you were flying. This is for all walls and invisible walls that work as boundaries on the side of the stage, if you're touch it on your left or right side you can press up and move up it.

def wall_collision(sprite, group, dir):
    if dir == 'x':
        collide = py.sprite.spritecollide(sprite, group, False, collide_hit_rect)
        if collide:
            if collide[0].rect.centerx > sprite.hit_rect.centerx:
                sprite.pos.x = collide[0].rect.left - sprite.hit_rect.width / 2
            if collide[0].rect.centerx < sprite.hit_rect.centerx:
                sprite.pos.x = collide[0].rect.right + sprite.hit_rect.width / 2
            sprite.vel.x = 0
            sprite.hit_rect.centerx = sprite.pos.x
    if dir == 'y':
        collide = py.sprite.spritecollide(sprite, group, False, collide_hit_rect)
        if collide:
            if collide[0].rect.centery > sprite.hit_rect.centery:
                sprite.pos.y = collide[0].rect.top - sprite.hit_rect.height / 2
            if collide[0].rect.centery < sprite.hit_rect.centery:
                sprite.pos.y = collide[0].rect.bottom + sprite.hit_rect.height / 2
            sprite.vel.y = 0
            sprite.hit_rect.centery = sprite.pos.y

This is the collision code and below is the update for the player:

def update(self):

self.rect = self.image.get_rect()
self.rect.center = self.pos
self.pos += self.vel
self.hit_rect.centerx = self.pos.x
wall_collision(self, self.game.walls, 'x')
self.hit_rect.centery = self.pos.y
wall_collision(self, self.game.walls, 'y')
self.rect.center = self.hit_rect.center

# Apply Friction
self.acc.x += self.vel.x * PLAYER_FRICTION
# Equation of motion
self.vel += self.acc
self.pos += self.vel + 0.5 * self.acc

def jump(self):

self.rect.x += 1
collision = py.sprite.spritecollide(self, self.game.walls, False)
self.rect.x -= 1
if collision:
    self.vel.y = -10

If you jump and your head touches a wall and you keep hold of the up arrow it keeps adding to your vel.y even though the wall is blocking you.


texts: what are the networking features available in iphone?

texts:
So far I couldn't find anything on google so I'm asking here:

I need to connect two iphones or more to each other for a multiplayer game, what features does iphone api provide? is there some kind of bluetooth device or equivalent in iphone or should i just search over the wireless network connection? and what api should I use to connect them? is it possible to use c++ or are the api functions only available via obj-c iphone sdk?


texts: Need a reference to an [unusual?] RTS setting

texts:
Imagine an RTS game where so-called basic units play the main role throughout a whole game session.

In my game basic units are actually programmable by a player (like in Colobot/Ceebot), that's why it is so important to keep them significant from the first to the last second of each session.

Problem

I found out that end-game of a typical session is quite boring, no impression of... say, development of a game since middle-game. Don't know how to describe this feeling correctly.

I'm looking for reference to other games where such problem of end-game was resolved.

Thanks in advance.

UPDATE

Some more background:

The game is about splitting tasks which are best solved by chip and by brain. Player does not have to micromanage, he or she writes algorithms (in advance) instead. Players are to make strategic decisions and give high-level orders. I.e. if you have better combat algorithms for a group of bots == you're better at micromanagement. The same goes for engineering units in home front.

The typical border between middle-game and end-game is when all "free" resource sources are conquered by one of players, resources are being drilled, roads a constructed and factories produce bots at full speed (everything is automated by players in a way they want). Frontier line is more or less clear and stable.

From this point there is no choice of rush/produce/defend, you are to collect forces, invent tricky maneuvers and attack.

At this moment there is only one work for players brains: tricky tactics. It is something human brain excels at (in comparison to algorithms).

Balance is so that frontal attacks are very costly (good defense can destroy a great amount of units if an attack is frontal). Therefore attacking from multiple directions, "red herring" и fast relocation along the front line become very important (exactly like at wars in the middle of XXth century, e.g. WWII).

Again, this is where the human brain is much better than any program, so it makes no sense [for players] to write algorithms for such tasks.

My concerns is that in end-game it becomes just like a hexagon game with a very limited amount of units since all underlying tasks are "encapsulated" by algorithms.

Supreme Commander resolves such problem by introducing experimentals, Populous does it with spells (I remind, Populous: The Beginning has only five basic units).

Again, thanks in avance :-)


texts: How do I efficiently determine what objects are visible to a camera?

texts: I want to call the rendering methods of only the game objects that are visible. How can I efficiently determine which objects or tiles are within the camera's rendered region?


texts:
I have a setup in my game engine where I can add behavours to game objects. All behaviours are based on the class AbstractBehaviour. To easily get access to behaviours from a game object, I am trying to mimic unity's getComponentOfType<type>().

Now for the question:
how can I pass a class type as a parameter to my GetBehaviourOfType() function?

What I am trying to achieve in code:

AbstractBehaviour* GameObject::GetBehaviourOfType(typeid type)
{
    for (int i = 0; i < _behaviours->size(); i++)
    {
        if (dynamic_cast<type>(_behaviours[i]) != NULL)
        {
            return _behaviours[i];
        }
    }
}

Where _behaviours is a vector of abstract behaviours.


texts: DirectX11 - Color Interpolation Along Quad Diagonal

texts:
Imagine that we have a vertex structure that looks like this:

struct Vertex
{
    XMFLOAT3 position;
    XMFLOAT4 color;
};

The vertex shader looks like this:

cbuffer MatrixBuffer
{
    matrix world;
    matrix view;
    matrix projection;
};

struct VertexInput
{
    float4 position : POSITION;
    float4 color    : COLOR;
};

struct PixelInput
{
    float4 position : SV_POSITION;
    float4 color    : COLOR;
};

PixelInput main(VertexInput input)
{
    PixelInput output;

    input.position.w = 1.0f;

    output.position = mul(input.position,  world);
    output.position = mul(output.position, view);
    output.position = mul(output.position, projection);

    output.color = input.color;

    return output;
}

And the pixel shader looks like this:

struct PixelInput
{
    float4 position : SV_POSITION;
    float4 color    : COLOR;
};

float4 main(PixelInput input) : SV_TARGET
{
    return input.color;
}

Now let's create a quad consisting of 2 triangles and the vertices A, B, C and D:

// Vertex A.
vertices[0].position = XMFLOAT3(-1.0f,  1.0f,  0.0f);
vertices[0].color    = XMFLOAT4( 0.5f,  0.5f,  0.5f,  1.0f);

// Vertex B.
vertices[1].position = XMFLOAT3( 1.0f,  1.0f,  0.0f);
vertices[1].color    = XMFLOAT4( 0.5f,  0.5f,  0.5f,  1.0f);

// Vertex C.
vertices[2].position = XMFLOAT3(-1.0f, -1.0f,  0.0f);
vertices[2].color    = XMFLOAT4( 0.5f,  0.5f,  0.5f,  1.0f);

// Vertex D.
vertices[3].position = XMFLOAT3( 1.0f, -1.0f,  0.0f);
vertices[3].color    = XMFLOAT4( 0.5f,  0.5f,  0.5f,  1.0f);

// 1st triangle.
indices[0] = 0; // Vertex A.
indices[1] = 3; // Vertex D.
indices[2] = 2; // Vertex C.

// 2nd triangle.
indices[3] = 0; // Vertex A.
indices[4] = 1; // Vertex B.
indices[5] = 3; // Vertex D.

This will result in a grey quad as shown in the image below. I've outlined the edges in red color to better illustrate the triangles:

Now imagine that we’d want our quad to have a different color in vertex A:

// Vertex A.
vertices[0].position = XMFLOAT3(-1.0f, 1.0f, 0.0f);
vertices[0].color    = XMFLOAT4( 0.0f, 0.0f, 0.0f, 1.0f);

That works as expected since there’s now an interpolation between the black color in vertex A and the grey color in vertices B, C and D. Let’s revert the previus changes and instead change the color of vertex C:

// Vertex C.
vertices[2].position = XMFLOAT3(-1.0f, -1.0f, 0.0f);
vertices[2].color    = XMFLOAT4( 0.0f,  0.0f, 0.0f, 1.0f);

As you can see, the interpolation is only done half of the way across the first triangle and not across the entire quad. This is because there's no edge between vertex C and vertex B.

Which brings us to my question:

I want the interpolation to go across the entire quad and not only across the triangle. So regardless of which vertex we decide to change the color of, the color interpolation should always go across the entire quad. Is there any efficient way of achieving this without adding more vertices and triangles?

An illustration of what I'm trying to achieve is shown in the image below:

Background

This is just a very brief explanation of the problems background in case that would make it easier for you to understand the problems roots and maybe help you with finding a better solution to the problem.

I'm trying to texture a terrain mesh in DirectX11. It's working, but I'm a bit unsatisfied with the result. When changing the terrain texture of a single vertex, the interpolation with the other vertices results in a hexagon shape instead of a squared shape:

As the red arrows illustrate, I'd like the texture to be interpolated all the way into the corners of the quads.


texts: When would a GPU need to write data to a vertex (or other) buffer?

texts:
I'm trying to understand why, when and how a GPU would need to write data to some buffer inside its own Video Ram.

In Direct3D 11, there are two flags that concern this, which are D3D11_USAGE_DEFAULT and D3D11_USAGE_IMMUTABLE. The former gives the ability to read and write, the latter only the ability to read.

So, apart from the resources that imply actual rendering to, like back buffers or textures set to use in a render-to-texture scenario, is there any other case where one would prefer to use DEFAULT over IMMUTABLE? How would you get the GPU to change this data? (I guess from a shader?) Why is it not the default one the one that gives you read only access?


texts: 1:1 mapping of texels to pixels with DX11 and multisampling and linear interpolation

texts:
Is it possible to get a 1:1 mapping of texels to pixels on a multisampled target in DX 11 with interpolation? It seems to me that the texture coordinate used in the shader is always one of the sub-pixels, not the center of the post-MS-processed pixel on my NVIDIA driver. With the reference renderer, however, the texture is correctly read from the center of the texels, which leads me to assume that my texture and point coordinates are correct.

This is, of course, only a problem when I enable some form of continuous interpolation. Point sampling easily circumvents the problem, so this is more out of curiosity.

I was just wondering if this is implementation-defined or possibly a hardware/driver bug? The issue makes it somewhat harder to implement correct GUI rendering, because you can no longer turn off multisampling via the rasterizer state in DX11 feature levels, and this small offset leads to bleeding-in of the neighboring elements in my texture atlas.


texts: Programatically find out which app store install came from?

texts:
Background

In my app, I have a 'rate me' button.  It follows the usual path - user clicks in, it starts an intent and opens the app's listing on the Play Store.  All well and good.  Now I wish to try to distribute my app via different app stores (Amazon for example), so obviously, if the user hits the 'rate me' button I don't want it to take the user to the Google Play Store but to whatever store they got it from.

APK For each store

This is possible, true, but I think it would be a complete nightmare to manage (like creating a new APK for each store every time I issue a new update.

So I'm looking for something like this pseudo code:

if(rate-me button pressed){

    if (from Google Play Store){
        Go to Google Play Store
    }
    else if (from Amazon Store){
        Go to Amazon Store
    }
}

And so on.......

I'm guessing there is a way (that some apps must surely use) but I have no idea how to go about it.


texts: Smoothly extend eased animation to new target value

texts:
I am implementing animated double property from scratch, currently with SmoothStep easing, however when new target value is set, there is visible "jump" in animation speed (probably due to applied easing). I would like setTarget to smoothly extend currently ongoing animation.
I have tried to calculate originalValue_ and remaining_ based on current t (offsetting those correctly, I think, will solve the problem), but haven't managed to find the correct formula.
How do I smoothly extend ongoing smoothstep animation to new target value?

void setTargetValue(double value, double duration = 1.0)
{
   originalValue_ = currentValue();
   targetValue_ = value;
   remaining_ = duration;
   duration_ = duration;
   t = 0.0;
}

double currentValue() const {
   return SmoothStep(originalValue_, targetValue_, t); //x*x*(3 - 2*x)
}

void update(double deltaT) {
   remaining_ = fmax(0.0, remaining_ - deltaT);
   t = clamp(0.0, 1.0, 1.0 - remaining_ / duration_)
}


texts: I am struggling with a combo system for a game of mine

texts:
I am currently trying to make a game with a friend but at the moment I am having a few problems with finding a combo system. Until we progressed I copied this code from a video where I use our first combo hit as a source of damage. My code for this is below:

public Animator anim;
private bool attack1 = false;
private float attackTimer = 0;
private float attackCd = 0.3f;
public Collider2D attackTrigger;
public KeyCode Stance1;
public KeyCode Attack1;

// Use this for initialization
void Awake ()
{
    anim = gameObject.GetComponent<Animator>();
    attackTrigger.enabled = false;
}

public void CreateHitbox (int createhitbox)
{
    attackTrigger.enabled = true;
}

public void DestroyHitbox (int destroyhitbox)
{
    attackTrigger.enabled = false;
}

// Update is called once per frame
public void Update ()
{
    if (Input.GetKeyDown(Stance1))
        anim.SetTrigger("Stance");

    if (Input.GetKeyUp(Stance1))
        anim.SetTrigger("Stance");

    if (Input.GetKey(Stance1))
    {
        //Melee attack
        if (Input.GetKeyDown(Attack1) && !attack1)
        {
            attack1 = true;
            attackTimer = attackCd;
        }

        if (attack1)
        {
            if (attackTimer > 0)
                attackTimer -= Time.deltaTime;
            else
                attack1 = false;
        }

        anim.SetBool("attack1", attack1);
    }
}

Our attack animations take a bit to initiate so we work with a hitbox as an attack trigger and activate the trigger through an animation event so that enemies are hit when they are supposed to. Furthermore in our game you have to go in a stance where you draw your sword to attack so I wrote it so that you can only attack when you are in the stance.

The problem is that I want to have a 3 hit combo in the end but I have a problem finding a solution that works. In addition I would like the different combo attacks to deal different damage so giving each attack different values would be great. My friend and I are beginners when it comes to C# as well so thinking of something ourselves was not possible.


texts:
I'm creating a space game in Godot that has procedurally generated nebulae. A nebula is comprised of between 50 and 200 child particles, all with the same shader assigned to them which creates an effect as follows:

https://gyazo.com/41aa6fb9695a626ece10f7aff144ecba

My issue is that the more particles that are placed, the more the nebula itself starts to resemble a square shape.

I want to be able to place these particles in a way that more closely resembles a cloud formation, which I imagine will use some sort of noise function (Perlin, Simplex?) to do so - but I've only ever used noise for generating graphics, not placing items.

The parent object of the particles can vary in size, as can the number of particles placed within it.

How would I place these particles randomly, while ensuring they more closely resemble cloud formations?

The language I'm using is C#, but Pseudocode is more than fine.


texts: How do you clean up textures that are too photo-realistic to match the rest of your game assets?

texts:
I was browsing for textures online and notice most of it are too photo-realistic and many of them is just photo of real thing.
I'm sure there some "cleanup" process for this type of texture using Photoshop filter or via other tool etc.
Let say I want texture to match Left for Dead 2 look.
Does anyone have any links\resources on this?


texts:
I installed the latest version version of Unity for Linux from the official website, but when I try to launch Unity, it displays a blank dialog box. I waited for a long time, but nothing happens.

These are my system specifications. I was running Unity on the same computer, several months ago, using Windows.

Model: Thinkpad R500
Processor: Intel® Core™2 Duo CPU P8600 @ 2.40GHz × 2
RAM: 2Gb DDR3 RAM
Storage: 155Gb HDD
Graphics Card: ATI Mobility Radeon HD 3400 Series 128mb dedicated GFX

Why is it doing this? Is there a problem with the latest build? What should I do to fix it?


texts: Unity 3d 4 players Only 4 buttons can be pressed at a time

texts:
Only 4 buttons can be pressed at a time, so players cant move sometimes

Each Player Has their own Controls

i Change, Up Arrow and the other ones for each player---v

InputsV-V-V

public string UpArrow;
public string DownArrow;
public string LeftArrow;
public string RightArrow;

    if(Input.GetButton(UpArrow))
        transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);

    if(Input.GetButton(DownArrow))
        transform.Translate(-Vector3.forward * moveSpeed * Time.deltaTime);

    if(Input.GetButton(LeftArrow))
        transform.Rotate(Vector3.up, -turnSpeed * Time.deltaTime);

    if(Input.GetButton(RightArrow))
        transform.Rotate(Vector3.up, turnSpeed * Time.deltaTime);


texts:
In my game the character movement animations work fine
but now I'm trying to do a sequence of programmatic animations,
for an enemy character, and it's proving to be a pain.

I'm just doing it on Android.

I have the enemy character doing a walking animation till
it reaches and end position, then I want it to do a three frame
throw animation.  It's walk animation is fine.

Since I only want to do the throw animation frames once, I tried to use
Animation.PlayMode.NORMAL, and try to use isAnimationFinished().

I also tried to get the frame number using getKeyFrameIndex()
to try to detect when it showed the last frame.

But in both cases, when it reaches the end position, either I just
see a flash of one of the throwing frames, or nothing at all,
and it says it's "finished" with the animation, using one of the above
ways to test it.

objectBatch.draw(
    animation.getKeyFrame(throwingSkeletonObject.fStateTime),
    throwingSkeletonObject.position.x,  // x
    throwingSkeletonObject.position.y,  // y
    1,      // width
    1);     // height

I'm using the fStateTime that was passed into the Object from the
update() of the Object.  For the walking animation I use:

 animation.setPlayMode(Animation.PlayMode.LOOP);

and for the throw animation:

 animation.setPlayMode(Animation.PlayMode.NORMAL);

The frameDuration for the walk animation is 0.7f and for the throw 0.3f.

So what do I need to do to be able to actually see
all the frames of the throw animation, and then be able to
tell when that's "finished", so I can go back to the walk
animation going the other way or whatever?

I've tried lots of different combinations of things, including using
a slower throw frameDuration, and nothing seems to really work.

Eventually I want to try to get the Boss animations going
and those are much more complicated, so I want to get
this fairly simple sequence to work.

UPDATE:

In the update() I'm doing:

throwingSkeletonObject.fStateTime += fDeltaTime;

The game is 2D, and I'm not using scene2D.

UPDATE  SOLVED?:

I wrote a smaller test app in hopes of replicating the problem
but it worked pretty well.  When it did the throw animation I reset the
StateTime back to zero, so as a test, I commented that out so it used the
same StateTime as the walking animation and it only showed one
frame of the throwing animation, so I think that was the problem.
But I'm not sure about the throwing animation "end" test, I'm hoping
that that will also work now.


texts: How do I fix these touch events? Events respond if there are 2 fingers but not 1

texts:
I am making a simple game of mine mobile-friendly.

The goal is to:

Make character walk if a touchstart event is sensed on right half of screen.
Stop character if a touchend event is sensed on the right half.
Jump the character if a touchend event happens on the left half of the screen.

I have the logic working perfectly for mouse up and down events so I'm pretty sure it's something to do inside the touchstart and end functions.

If two fingers are used as one press it seems to work fine.

If only one finger is used it doesn't work properly: touching anywhere starts the movement but nothing will stop it.

Here is the code for the touch inputs and associated function:

CheckWhichScreenHalf = function(e) {

    loc = WindowToCanvas(e.pageX, e.pageY);
    onScreenY = loc.y >= 0 && loc.y <= gameCanvas.height;
    leftSideX = loc.x >= 0 && loc.x < gameCanvas.width/2;
    rightSideX = loc.x > gameCanvas.width/2 && loc.x <= gameCanvas.width;
    if (onScreenY && leftSideX){
        return 'left';
    }
    else if (onScreenY && rightSideX){
        return 'right';
    }
    else return 'neither';
};

TouchMove = false;
TouchJump = false;

gameCanvas.ontouchstart = function(e){

    if (imagesHaveBeenLoaded) {
        e.preventDefault();
        for (var i = 0; i < e.touches.length; i++){
            var side = CheckWhichScreenHalf(e.touches.item(i));
            if (side === 'right'){
                TouchMove = true;
            }
        }
    }
}
gameCanvas.ontouchend = function(e){

    if (imagesHaveBeenLoaded) {
        e.preventDefault();
        for (var i = 0; i < e.touches.length; i++){
            var side = CheckWhichScreenHalf(e.touches.item(i));
            if (side === 'right'){
                TouchMove = false;
            }
            else if (side === 'left'){
                playerJumping = true;
            }
        }
    }
}

The game can be played here: http://webstudentwork.com/jgossling/MMWD/mp2/mp2.html


texts: Collision detection without classes, in Pygame

texts:
I am writing a game in Pygame and want to get collision detection working. The aim is that when an object hits another, the target object disappears. I want to avoid having classes for now, to keep things simple. This makes it difficult to get collision detection working, because the Rect method in Pygame assumes classes.

The logic I want to achieve is:

if object hits a target object
    target object disappears

What's the minimal code I'd need to achieve this?


texts: Run script after game start, before scene load

texts:
I'm making some kind of dependencies solving script. To work this script, it must be run before all other MonoBehaviour scripts.

So I made the script something like this:

public class DependencyController {
    private static Dictionary<string, bool> m_DependencyTable = new Dictionary<string, bool>();

    static DependencyController() {
        SceneManager.sceneUnloaded += ResetDependencyData;
    }

    ... some other stuffs ...
}

I'm using dictionary to compare which dependency script(s) loaded. To can use every script's Awake/Start, I declared as static and instantiated right after.

The system actually work pretty good, all scripts can access DependencyController in Awake/Start without any problem, but have some questions remains:

Is static m_DependencyTable is always created before scene loaded?
Is static DependencyController constructor always called after SceneManager is loaded? As you can see, I attached EventListener in SceneManager.sceneUnloaded so that I can clear the dependency table before scene loads.

Any advice will very appreciate it.


texts: World space UI stretched too much instead of billboard in unity

texts:
I am scaling my world space UI element as my camera go far away from UI using this code snippet:

public class ZoomNamePlace : MonoBehaviour
{
    //public CameraController camContrller;
    public int Zoom_Factor;

    void LateUpdate()
    {
        Zoom();
    }

    void Zoom()
    {
        float size = (Camera.main.transform.position - transform.position).magnitude;
    }

}

It is working fine and my UI scale according to the distance of Camera and UI. Now i want to rotate/billboard my world space UI to the camera and here is my script:

public class Billboard : MonoBehaviour
{

    //Orient the camera after all movement is completed this frame to avoid jittering
    void LateUpdate()
    {
        Camera m_Camera = Camera.main;

        transform.LookAt(transform.position + m_Camera.transform.rotation * Vector3.forward,
            m_Camera.transform.rotation * Vector3.up);
    }
}

But the problem is instead of billboard my UI shape stretched too much maybe due to my canvas scale set to 0.01.


texts: What is the most efficient container to store dynamic game objects in?

texts:
I am making a first person shooter and I know about about a lot of different container types but I would like to find the container that is the most efficient for storing dynamic objects that will be added and deleted from the game quite frequently. EX-Bullets.

I think in that case it would be a list so that the memory is not contiguous and there is never any re sizing that is going on.  But then I am also contemplating using a map or set.  If anyone has any helpful information I would appreciate it.

I am writing this in c++ by the way.

Also I came up with a solution that I think will work.

To start off I am going to allocate a vector of a big size.. say 1000 objects.  I am going to keep track of the last added index in this vector so that I know where the end of the objects are.  Then I will also create a queue that will hold the indices of all objects that are "deleted" from the vector. (No actual deleting will be done, I will just know that that slot it free). So if the queue is empty I will add to the last added index in the vector + 1, else I add to the index of the vector that was at the front of the queue.


texts: Stuck on development of turn-based-strategy game

texts:
I am developing a turn based political/military strategy game similar to the DOS game Conflict.  I have my game design document completed, but I'm having trouble actually putting together the logic of the turns.

How do I determine the strengths/weakness of the various nation-states in my game?  Is there a common set of mathematical formulas somewhere on the interwebs that I can modify?  Or do I need to come up with my own?

If I do need to come up with my own, how do I go about doing this?  I have very limited experience playing games like Dungeons and Dragons and Settlers of Catan--would it be a good idea for me to buy a copy of a board game that is similar to my idea and model my game off that?


texts: Godot installation errors: cache directory path, EditorSettings config path

texts:
I am using Windows 7.  After installing Godot from a browser, I get two errors:

OpenGL ES 3.0 Renderer: GeForce GTX 980/PCIe/SSE2
ERROR: EditorSettings::create: Cannot find path for cache directory!
   At: editor\editor_settings.cpp:756
ERROR: EditorSettings::save: Cannot save EditorSettings config, no valid path
   At: editor\editor_settings.cpp:934

I am new to game engines, and I don't really understand what these errors mean.  I had a similar problem with Unity before I gave up on it.

Edit 01:

If it helps any, when I try to open a demo project in Godot, it crashes and suggests I use Visual Studio to debug it.  If I do this, the Visual Studio debugger reports this:

Unhandled exception at 0x0000000140003F05 in Godot_v3.0.2-stable_win64.exe: 0xC0000005:
Access violation reading location 0x0000000000000000.


texts: How to develop both a client and headless server together in Unity

texts:
I'm making a multiplayer 2d shooter platformer in unity. And after studying the different options to program an authoritarian server and with the great help that many of you have already provided me on this site. I have decided to create my server also with a unity in headless mode in order to reproduce or simulate the physics of the games on the server with the same engine (box2d) and that the server is the one that decides the movements of the clients.
As you have told me (Thanks @DMGregory), a good option for server development in unity is to use a single project to program both client and server and thus be able to reuse the scenes and prefabs without having to clone them in 2 different projects, but with This idea I find some main problems that I do not know how to solve.

Debugging. How can I run the 2 editors of the same project in unity simultaneously to run server and client?

Separate client and server. Is there a way to separate those elements necessary for the client from those necessary for the server in unity? If not, when compiling my project to use it as a server, it will have a lot of unnecessary material (scripts, sprites, prefabs, etc.) that will make the program more heavy without necessity.

Thank you very much and sorry for my level of English


texts: Shot em up! Vertical or Horizontal "side scrolling"?

texts:
Question it’s about "Shot em up" style game (For example: Tyrian) also known as Top-Down shooters.
These games in the past mostly exist as top down concept, it means player object can move from the left to the right and enemies start appearing from the top of the screen and moving down to the screen.
This concept was probably picked due to the monitors aspect ratios in the past where was most spreaded 4:5.
Also this concept are very popular on mobile phones, because is sometimes more user friendly not using landscape mode when playing.
There was a very little titles, when the concept Top-Down are changed Right-left It means, player object is on left screen side and moving Top and Down, and the enemies moving from right to the left.  Also, there is almost no titles on desktops when current aspect ratios are mostly 16:9. Even if some new “Modern” Shot em up is released, mostly pick the Top Down concept.
And my question is, is there any reason for that on Desktops target platform?
I think for the current monitor aspect ratios 16:9 “Right-Left” better fit the gameplay and user experience. Or Am I missing something?


texts: Confused about calculation of steering force

texts:
I'm reading Programming Game AI by Example, by Mat Buckland. What I don't understand there is why the individual behaviors return a vector representing change in velocity, but the combined result is treated as a force vector.

Here's the excerpt from the update function:

  Vector2D SteeringForce = m_pSteering->Calculate();

  //Acceleration = Force/Mass
  Vector2D acceleration = SteeringForce / m_dMass;

  //update velocity
  m_vVelocity += acceleration * time_elapsed;

  //make sure vehicle does not exceed maximum velocity
  m_vVelocity.Truncate(m_dMaxSpeed);

  //update the position
  m_vPos += m_vVelocity * time_elapsed;

And m_pSteering->Calculate() returns the weighted sum of different steering "forces", like Seek

Vector2D SteeringBehavior::Seek(Vector2D TargetPos)
{
  Vector2D DesiredVelocity = Vec2DNormalize(TargetPos - m_pVehicle->Pos())
                            * m_pVehicle->MaxSpeed();

  return (DesiredVelocity - m_pVehicle->Velocity());
}

So, how come steering functions like Seek just return change in velocity and don't take mass into account, but still get used as force?

Here's the source code


texts: How do I go from a general idea to a specific draft of a design?

texts:
Before starting planing your code, the data structures, the class hierarchy, you need to have a clear idea of what you want for your game.
I came across with an idea for a game, but it is too general.

I think every game starts with a general idea, but how did they take that general idea and then the came up with games like Imperium Civitas... I'm refering to the actions you can or can't do, the events, in-game materials etc.

I wonder how you should engage a blank paper. Where you should start? Is there a chain of steps that you have to follow?
Thanks.

(My idea is much more simpler than Imperium Civitas)


texts:
I created a new material and changed the material colors to make it black:
R,G,B all value is 0 and A value is 255

The shader on the Plane is: Legacy Shaders/Transparent/Diffuse

But the Plane seems to be transparent.

The main goal is put a plane in front of the camera the FPSCamera and then using a script to fade in/out the alpha color.


texts:
I am working on a tiled map editor, and I need to choose tiles automatically, based on the adjacent tiles. For example, when placing a road tile, next to another road tile, the two need to be oriented so that they form a continuous road. If there are other roads around them, we may need to use corner or intersection tiles.

Can anyone recommend some algorithms for doing this? The game uses an 8-directional square tiled map.


texts: Game Architecture doubt on variable access

texts:
Im having a hard time figuring out a solution to a problem that seems it should be easy to answer but since i cant come up with a good solution I bid your knowledge:

In my game i have a state manager which deals with either the game is at the menu state, level1 state, level2 state, etc etc, every different screen condition is a state that is, and in my level state i created a base level class so i can extend the level1, level2, etc levels.

In the base level class, it is where i declare my common level variables, like Player, the Tilemap, the array of enemies (mobs), the CollisionManager etc. (this might be what i am doing wrong...) and i wanna add explosions to the game, which will occur at least when i shoot explosive barrels (and the barrels really arent the problem because since they are created in the beggining of the level, i can just add an array of barrels and set the argument of the barrel to receive the array of explosions pointer so the barrel just adds a new explosion when the time comes) and when explosive bullets hit the wall.

Now my problem is specially the bullets, because explosive bullets are created by the mobs which might use a rocket launcher (including the player) and i dont really think sending the array of explosions to every mob that might shoot explosive bullets is good architecture, so my question is how i solve this problem or even better how i improve my architecture in a whole to avoid problems like these.

P.S. As a side note regarding how the mobs shoot bullets, every mob has a Weapon, which is a class that extends in the several weapons the game might have, from pistols to lasers and flamethrowers, which are all functional and working lovely. This means, though, that if id send the explosions array to the mob that will use rocket launcher, i would then have to send that pointer to the weapon, and from weapon to every bullet that the weapon spawns, so the bullets are the ones adding the explosions to the array when the time comes. This train-like passing of the array is what is bugging me and what i strive for a solution.

P.S.S. Although every advice is very appreciated, answers telling me to use Aggregation of Components Architecture are, at the moment, "ignored" because im trying to correctly use the traditional Hierarchical approach for this game, i might use component architecture in a future game though, it seems pretty neat : )