texts:
How to remove (cut-out) a transparent rectangle in a Texture, so that the hole will be translucent.

On Android I would use the Xfermodes approach:

https://stackoverflow.com/questions/8115732/how-to-use-masks-in-android

But in libgdx I will have to use opengl. So far I almost achieved what I was looking for, by using the the glBlendFunc  From this nice and very helpful page I learend that

glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);

should  solve my problem, but I tried it out, and it did not quite work as expected:

batch.end();
batch.begin();

batch.setBlendFunction(GL20.GL_ZERO,
        GL20.GL_ONE_MINUS_SRC_ALPHA);
// Draw the background
super.draw(batch, x, y, width, height);
// draw the foreground
mask.draw(batch, x + innerButtonTable.getX(), y
        + innerButtonTable.getY(), innerButtonTable.getWidth(),
        innerButtonTable.getHeight());
// result = {foreground}*{0,0,0,0} +
// {background}*(1-sourceAlpha)

batch.end();
batch.setBlendFunction(GL20.GL_SRC_ALPHA,
        GL20.GL_ONE_MINUS_SRC_ALPHA);
batch.begin();

It is just making the mask area plain black, whereas I was expecting transparency, any ideas.

This is what I get:

This is what I expected:


texts: Why do games have credits more often than other software?

texts:
Lately I have seen several videos that discuss how important it is to have your name in the credits of the game you've worked on. And it kinda makes sense - it's a way to prove to your future employers what experience you have.

However what puzzles me is that games seem to be the only software that does it. Unless it's a small one-man project, most software - especially closed-source commercial stuff - doesn't list any credits at all. Nor does anyone expect them to. It seems that neither employees nor their (future) employers have any problem with that.

How come there is this huge difference?


texts: Monogame apply tint to only some parts of sprite

texts:
Each player is a different colour (Red, Blue, Green, Yellow) and I want a small part of each piece of armour to be tinted to the player colour.  Is this possible without using a second armour sprite that overlays?

I'm hoping for something along the lines of reserving a certain portion of colours (say various shades of magenta) to convert back to a player colour while drawing.


texts: Decompose a Mesh so that each piece can be watched by a Guard inside the piece

texts:
The title pretty much explains it but I'm gonna go into more details.
We have 3D mesh object and we want to decompose it into separate objects so that each one of these objects can be seen completely if we place a point somewhere inside them. The point location will not be random. We just need to make sure that there is a place inside the objects where the point can see the object completely.

If we speak in 2D terms, we are trying to break down the mesh in star-shaped polyhedrons.

There is an algorithm on this by Keil for the 2 dimensions (Minimum star-shaped decomposition) but I haven't found anything on 3D.

There are,however, papers on convex decomposition and this works but it will lead into more parts than I would like .  Will I have to rely on these? How else should I approach this?

Extra notes:
We have to do with polyhedrons with no holes and the decomposition doesn't have to be the minimum one.


texts: Unity Material Override Video is too dark

texts:
I have made a TV in Blender, UV Wrapped a material and applied a  video on it in Unity.
But the picture is too dark, and I would like to make it brighter.

How could I solve this problem?

The left one


texts: Ambiguation between multitouch geistures tap and free drag in Windows Phone 8 Emulator (Monogame)

texts:
I am making a 2d tile based tactic game. I want the map to be slided around (because it's bigger than the screen) with FreeDrag (It's perfectly done, the map can moved around, that's not the problem).

And then, I want to display the character's actions, everytime it's tapped.

The problem then appeared. Everytime I want to FreeDrag the map, the Tap trigger always fired first before the FreeDrag one. Is there any way to differ the map sliding than the character tapping? Below is my code.

while (TouchPanel.IsGestureAvailable)
{
    GestureSample gesture = TouchPanel.ReadGesture();
    switch (gesture.GestureType)
    {
        case GestureType.FreeDrag:
            {
                //a
            } break;
        case GestureType.Tap:
            {
                //b
            } break;
    }
}

Every time I first want to free drag (at the first touch), it always goes to "b" first (see commented line above), and then to "a" rather than immediately goes to "a".

I've tried flick, but it seems the movement produced by flick is too fast, so freedrag fits the most.

Is there any way or workaround to perform FreeDrag (or similar) without firing the Tap trigger?

Thanks in advance.


texts: Shader that "cuts" hole through all geometry

texts:
How can I create a shader that "cuts" through all geometry, only rendering the clearing background in Unity? An example:

That's a prism in a huge white box-shaped room. The surface of the prism is just rendering the skybox of the scene (a starry sky). I used multiple cameras, which is pretty inefficient... There must be a way with just shaders.

How can I do this?


texts: Objects are stumbling in place continuously. How to fix that?

texts:
I have a nasty problem with my physics engine. Objects sometimes just jump in place, or roll left and right.

Main game loop works in that manner:

Every living object is updated (it changes velocity, the logic is different for each object)
Engine computes collisions using objects' positions and velocities and resolves them.

Imagine that we have a grenade positioned at one pixel above ground, with zero speed, and the gravity is 1 px/tick^2. Normal bounce coefficient is 0.5, so an object will bounce with half speed.

According to the algorithm:

Object's controller adds gravity to its velocity, so now v = -1.
Engine moves object to y = 0, no collisions happen.
Velocity is changed to -2 by the controller.
Engine tries to move the object, the collision happens immediately, v is set to 1, and object moves to y = 1.
Velocity is changed to 0 by the controller.
The object remains in place.

Initial conditions has reproduced. The object will bounce forever with a period of 3 ticks. These situations vary, but they all are caused by discrete nature of the engine described above.

This bug was in every version of my game. Objects may vary in shape and size, and the terrain is destructible Worms-like. I use my own engine that uses swept collision detection customized to work with small and fast objects, never letting them go through impassable object unless they were spawned inside, and the only acceptable option for me is to modify it.

One thing that I have in mind that I can detect if object had very low speed for some time, make it "immobile" and call different controller functions depending on "immobile" flag. It's an ugly solution though, because the complexity of my logic will increase. Also, when a round object stands on two points and we remove one, it will not fall. So this approach is wrong at all I guess.

What is the right approach to fix that?


texts: What are useful server metrics to gather for a table card game?

texts: When building a game server intended to accomodate large numbers of simultanous games (e.g. table card games), where the server manages lots of tables and each table has up to a small handful of users, what metrics are most useful to collect and why?


texts: LibGDX's HTML project doesn't show anything in Browser

texts:
The question is self explanatory, when I run my demo-html project as a Web Application and I open Chrome with the provided link by eclipse, my browser doesn't show the image it is supposed to show in a new project.. However, the tab displays the correct title "Demo". Can somebody help me with this?

Eclipse after Running the project:

And Chrome running the project:

I'm using the old setup-tool from Libgdx, the non-gradle way..


texts: Best way to test if some point on a line if in front of another point on the same line in 3D

texts:
I have a line in 3D defined by point P0 and direction vector D.
For given input point P on a line defined as above, I want to test if P is in front of point P0. The code will be used in GLSL fragment shader.

So far, my best solution is following GLSL function:

bool IsInFront(vec3 P, vec3 P0, vec3 D)
{
  float d = length(P - P0);
  vec3 Pp = P0 + d * D;
  return (length(Pp - P) < 1.0E-4);
}

Explanation is simple. d is distance between P and P0, and there are only two possible positions on a line where a point with distance d from point P0 can be on a line: in front, or behind point P0. Then I just check if positive point is same as input P.

However, this code uses precision 1.0E-4, and recalculation of input point P. Is there a faster and numerically more stable way to do this?

Regards


texts: What exactly does the XNA resdistributable installer do?

texts:
I was wondering why I cannot just put all XNA dlls in the same directory as the game.exe, but I need to install that XNA redistributable?

if i try to run it i get an "assembly not found" error
http://msdn.microsoft.com/en-us/library/shhcw6y9(v=vs.80).aspx
even though that assembly (dll) is there in the same directory.


texts: Monogame - How do I make a moving game such as terraria or stardew valley?

texts:
Alright so after some long hours and a lot of work I finally understand the basics of Monogame and am able to create a simple game with menu, sounds, the whole lot. But now I want to create a map game, like for example in stardew valley you're able to walk around and the camera will move with your character to a different location. Another example is terraria where you can keep going left for ages and the game will keep on going.

Currently for me I'm limited to the window box of my screen.


texts: Should I used Box2D for a Flash platformer or use something for gaming like Fixel or Flashpunk?

texts: I'm trying to make a platformer with Flash/AS3 and have been looking for something to help with some of the collision etc. I've look at a few engines and Box2D/WCK seems the most sophisticated. Do I need that level of sophistication or should I just stick to something simple like Fixel or Flashpunk? OR should I just do everything myself?


texts: When is it the right time to start teaching collision detection?

texts:
I and a friend of mine started a game development club in our school two months ago and everything is going well for now. We are following McKesson's tutorials which I find comprehensive and well-built.

We have come to the point where we started making simple prototypes of easy-to-do games, like 3D Pong (not as polished as the referenced version), and soon we are going to finish the second part of the tutorials (the Positioning of objects). We have ideas for prototypes which involve little more complex collision detection and I started wondering is it a good place to look in depth at this topic of game programming? And should I also include the BSP, quadtrees, octrees and other partitioning algorithms with it?


texts:
I've encountered a problem in my attempt to implement Collision Handling for a game I'm creating, involving a collision with two angled platforms.

I'm using GJK-EPA for detecting/handling collisions so I can pull the penetration vector and depth from each collision, and using this I have been calculating the angle of the surface the player collides with.

What I don't understand, is how I should resolve a collision when the character is moving from one slope to a steeper slope, one slope to a shallower slope and flat-surface -> slope and vice versa.

I attempted comparing penetration depths but due to the nature of GJK, I can only do this with some additional vector maths which then refuses to work for steep->shallow slopes. Additionally: It sometimes seems to 'spasm' on direct contact with vertices.

Basically, can anyone tell me a good/common way of handling angles of objects that are touching TWO platforms, using GJK-EPA?

Thank you!

(To note: I'm relatively new to game development, and I'm trying to get some smooth slope physics working, just so you know the 'situation').


texts: Object reference not set to an instance of the object;

texts:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour {

    public CharacterController2D controller;

    public float runSpeed = 40f;

    private float horizontalMove = 0f;

    // Update is called once per frame
    void Update () {
        horizontalMove = Input.GetAxisRaw("Horizontal")*runSpeed;
    }

    void FixedUpdate(){
        controller.Move(horizontalMove*Time.fixedDeltaTime,false,false);//error is somewhere here
    }
}

Though all the classes are defines it throws the error
please help!!!!!


texts: Fixed timestep on the server without hogging CPU?

texts:
It sounds backwards, but it's the situation I'm currently trying to solve on my dedicated server.

Everything I've read about fixed timestep assumed it was on a client, where you're already running in a loop as fast as you can to render the game, and you are just inserting the fixed timestep updates within that.

Problem is, on the server, that's the only thing being done in the loop, aside from checking for network activity. So my server ends up using 100% CPU, looping needlessly while waiting for the next fixed timestep.

The only way I know to fix this is by adding a sleep to the loop, but I know how inaccurate that delay can be, which would throw off the accuracy of the timesteps.

Is there a better way to keep it from burning CPU? Or is sleep what most dedicated servers are doing anyway?


texts: Has there been any research done on ideal values for loot drop tables?

texts:
I doubt many people want to grind for an item that has a 0.00001% chance to drop from a boss that takes 30 minutes to kill. I'd imagine there are certain factors that play into how rare an item should be. For example

if an item is part of a set
if the item comes from a boss vs a regular mob
how many stats/magical properties an item has

does anyone know of some research that has already been done or some data on this sort of idea. I can't be the first person to think of this.


texts: Separation algorithm in flock simulation?

texts:
I'm using box2d (the c++ one).

I found a method for an arriving behavior (on http://www.red3d.com/cwr/steer/gdc99/ ), which works well, problem is, the bodies are bumping into each other and it results in an ugly shaking effect.

How do you make sure bodies keep away from each other after I applied the arriving behavior ? Or the other way around ?

I'm wondering if it might be a better idea to completely remove the arriving behavior to implement the separate algorithm.

edit: even setting a low restitution results in shaking


texts:
I've got a character in a 2D game using surfaceView that I want to be able to move using a button (eventually a joystick), but my game crashes as soon as I try to move my sprite.
This is my onTouch-method for my steering button:

public void handleActionDown(int eventX, int eventY) {
    if (eventX >= (x - bitmap.getWidth() / 2) && (eventX <= (x + bitmap.getWidth()/2))) {
        if (eventY >= (y - bitmap.getHeight() / 2) && (y <= (y + bitmap.getHeight() / 2))) {
            setTouched(true);
        } else {
            setTouched(false);
        }
    } else {
        setTouched(false);
    }

And if I try to put this in my update-method:

public void update() {
    x += (speed.getXv() * speed.getxDirection());
    y += (speed.getYv() * speed.getyDirection());
}

The sprite moves on its own just fine, but as soon as I add:

public void update() {
    if(steering.isTouched()){
        x += (speed.getXv() * speed.getxDirection());
        y += (speed.getYv() * speed.getyDirection());
    }

the game crashes.

Does anyone know why this is or how to fix it? I cannot figure it out. I'm using MotionEvent.ACTION_DOWN to check if the user if pressing the screen.


texts: Is it possible to generate a Spheremap from a Texture2D in Unity at run-time?

texts:
I was trying to create a spheremap from a Texture2D for a skybox at run-time (Standalone build) in Unity. Does anyone know if this is possible and how to do that in Unity?

In the editor you can set a texture to a cubemap and then select it's import setting as a spheremap, but I can't find a way to do this at run-time using the Unity API.


texts: Map a fbx model between 2 VertexPositionColor Positions

texts:
I have created a VertexPositionColor position and drew it in the XNA like this

VertexPositionColor[] backbone;
backbone = new VertexPositionColor[2];

backbone[0].Position = new Vector3(0, 22, 0);
backbone[0].Color = Color.Black;
backbone[1].Position = new Vector3(0, 10, 0);
backbone[1].Color = Color.Black;

In the draw method

graphics.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.LineList, backbone, 0, 1);

My question is, is it possible to map a 3d bone (Model exported as fbx) to these coordinates. or is there a much easier way to achieve this.


texts:
Is it possible, using delta in my update method to increase a game speed variable exponentially on cubic growth (the blue line below)

My maths isn't great so I'm not sure how the formula would be put into practice using a float gameSpeed and delta in an update method -(void) update:(ccTime)delta I think I would also need a value to control the speed of the growth too?


texts: How should a Unity object control it's state?

texts:
I've been using Unity's component based design, and the biggest problem I've faced is how to control an object's( not component's ) state.

The problem is, some components must act differently based on the object's state. However, checking an object's state within a non-specific component( imagine we have a "DamageEnemyComponent" ) won't work at all because it makes assumptions about the object it's attached to.

The alternative is to make each component perform one, and only one function. The components are then disabled/enabled or added/removed depending on the object's state( probably managed by a more specific component. )

Imagine we have a "Boomerang" object. Assume it has only two states; idle( being held by the player ) and firing. In the idle state, the boomerang would have very few components, because we don't want it to interact with the world while it's simply being held. It may have components to listen for a "throw", though. Once it is thrown, some state manager on the object needs to update the object to have components for moving, damaging enemies, maybe picking up items etc. When the boomerang is back in the hands of the player, it's component list would need to be restored. This would work, but it would basically be building a new game object for each state, which is incredibly tedious and messy without Unity's editor. Not to mention the inheritance and interfaces can't be used well here( since the state specific components will be built into the state manager script. )

I can't see a way to control state using Unity's components. How is this usually done? It feels as if Unity should provide a way to build different states in the editor, much like building an object.


texts: How can I get my entire game to scale based on screensize?

texts:
I'm currently building a 2d mobile game and I'm currently stuck trying to get my game to scale with screen sizes. Currently my background is scaled to 1920 X 1080. When I run the game on my Galaxy S10+, it scales to 1920 X 1080, but you can see blue space on the sides (See Image). How do I get that 1920 x 1080 background to fill the entire screen without using a UI canvas?

I want the game to fill the entire screen. If I set the resolution to the Galaxy resolution, it fills the entire screen. But won't this look weird on other screens that don't have the same resolution?

I'm not trying to scale any UI. Everything I find online is only talking about scaling UI. That's not the issue. I'm trying to get the entire game to adjust based on screen sizes.


texts: Algorithms for Physically based shading models

texts: For real time interactive graphics, it seems to be practical now to use physically based shading models. I want to write some shaders to incorporate into an openGL based game engine that I'm writing and I wasn't sure of what algorithms to read up on. What algorithms and models seems to be practical and useful for real time graphics as of 2014?


texts: What are the pros and cons to building an audience with a small, simple, free game first as opposed to focusing efforts on a commercial release

texts:
There are two projects we can work on. One would be a small free game to try and get our name out/build an audience. The second is our main idea for a first product.

What are the pros and cons of building the small, simple, free game first instead of focusing that time/effort into the main money making project.


texts:
I am trying to make my own camera in ROBLOX. Here's my problem, I am using an inverse function to make the camera look nice and smooth but it only works on the x axis in the positive side.

Here's an example of the zoom in and the zoom out of my camera:

For now we can think it's working but if I put my player on a different axis like this:

We can see that the inverse animation is only in the x and y axis and now heres the little part of my code:

for x = 1, 15 do
  y = 10
  camera.CFrame = CFrame.new(Vector3.new(y/x, x+5, camera.CFrame.p.z), character.Head.Position)
  wait(0)
end

What can I do to make it work in the z axis too?


texts: Creating Input layouts for different vertex types

texts:
I'm still in the planning phase for a hobby abstract renderer, and i'm wondering how i should handle multiple vertex types and different shader inputs. (This is my first graphics project, so cut me some slack for lack of knowledge :) ).

What I want to to do is have the vertices be typeless, and have my model file specify "channels" of attributes EX: position, color, normal, binormal, tanget, etc. These channels would have string identifiers and stride values. On the shader side, i would like each shader program to specify which "channels" it requires via the identifier. Vertex Buffers would be compatible with the shaders if they had all the attributes required by the shader.

this is all abstract so I must be able to implement the functionality in most API's. However, taking a look over at D3D11, it looks like i would have to create a new Input layout per Vertex Buffer/ Shader COMBINATION. It would also mean some sort of goofy cataloguing system that goes, "if you have this specific combination of attribs, and the shader requires this specific combination of attribs, then use this layout", which makes me a little queasy thinking about it :\ . The number of input layouts would grow exponentially with more combinations.

The other solution would be to create and delete a new input layout EVERY time you wish to render. same queasiness -_-. Was D3D11 intentionally trying to force every vertex buffer in your design to have the same type?

Does anyone have a better suggestion? the main parameters i would like are the channel based vertex buffers, and the channel receiving shaders.


texts: Multiple collisions within a single frame cycle?

texts:
So say you want to simulate several objects in two dimensions, just bouncing around in a finite space. Using AABB and sweep tests, it shouldn't be that complicated to calculate single collisions between objects. But if you want to have an object bounce off another surface in the same frame (one collision), how do you account for any additional collisions after that first one? This might not make much sense, so I put a little graphic together to explain what I mean.

So say all this is happening in one frame cycle. The gray box moves up and bounces off the wall on the top; that's easy enough. That orange box is the problem, though. How do I calculate that collision as well (where the two translucent boxes are)? OR, if the frame rate is high enough, does it even matter? Thanks!


texts: Cocos2d not getting the texture which is added to CCTextureCache using thread

texts:
I convert the image into texture in a thread using the following line of code to reduce the image to texture converting time.

[[CCTextureCache sharedTextureCache] addImage:@"imageName"];

But when i retrieve this image from cache i am getting a blank image. If i am calling the above line of code in main thread i am getting the image.


texts:
I'm designing a turn based game in which players profit from buying, transporting, and selling resources. Each turn, the map has to produce a certain number of resources and different locations, and resource prices have to be updated. Because of this, each round, after every player has taken their turn, the game state has to be updated; resources are consumed/produced, prices in each cell of the map need to be updated, etc. Originally, I was going to have a simple turn order, where each player took their turn, then the map is updated, then the cycle repeats in the same order. However, after a little bit of testing, it became clear that this gave a significant advantage to players who have their turn right after the map is updated. They're able to collect the newly produced resources before any one else has a chance to.

The easiest way I could think of to balance out the gameplay for all players is to randomize the turn order after each round. While this would give everyone a fair chance, I'm worried that this might be too big of a shift away from strategy and towards luck.

How might I eliminate asymmetrical gameplay caused by turn order?


texts: Where can I find sources on how many people play on silent etc.]

texts:
This is probably more a problem with me being unable to find statistics which i am absolutely certain must exist in some form: How many people play with the sound off/on when playing browser games or very casual mobile games. Because in my experience: nobody, but that is too subjective.

The question i want to answer for myself: Is it worth adding sounds to my game. But I dont want to base that decision off of my personal experience (sound is always off), but rather some cold hard fact.

They must exist somewhere, someone must have compiled that data, but I cant find it anywhere...


texts: Unity Engine - Move the Object According to Image tracking

texts:
Motive : Want to develop Software which will track the Pad and move the four views of object accordingly.
What I did/Current Knowledge : I had placed the four camera around the object and change their viewport accordingly. Then, using Vuforia, tracked the pad(Image).
Problem : As I am beginner in Unity. I don't know how to move the object as the pad moves i.e. i don't want AR Projection on pad. but i want to use pad to move the object.
You can see my progress and work i done in these images. http://imgur.com/a/V5brG
Thanks.


texts: Per-fragment lighting system behaves like ambient lighting system

texts:
This is the relevant section of my fragment shader

  varying vec3 normal;
  varying vec3 halfv;
  ...
    vec4 color = ambient * gl_LightSource[0].ambient;
    vec3 n = normalize(normal);

    float nl = max(dot(n, gl_LightSource[0].position.xyz), 0.0);

    if (nl > 0.0)
      color += (diffuse * gl_LightSource[0].diffuse * nl)
            +  (specular * gl_LightSource[0].specular * pow(max(dot(n, normalize(halfVector)), 0.0), shininess));

    gl_FragColor = color;

Where ambient, diffuse, specular, and shininess are all already defined.  normal and halfv are defined in my vertex shader as

normal         = normalize(gl_NormalMatrix * gl_Normal);
halfv          = gl_LightSource[0].halfVector.xyz;

My light is directional, position is set to 100, 100, 100, 0.  Ambient, diffuse, and specular values are 1, 1, 1, 1, .01, .01, .01, 1, and 0, 0, 0, 1, respectively.  When might light vector is 100, 100, 100, 0, the entire mesh appears ambient lit.  Any other position or magnitude causes the mesh to go dark, only showing the ambient component.

EDIT

This is the updated fragment shader:

  vec4 color = ambient * gl_LightSource[0].ambient;
  vec3 n = normalize(normal);
  vec3 ldir = normalize(gl_LightSource[0].position.xyz);
  vec3 halfv = normalize(normalize(cam) + ldir);

  float nl = max(dot(n, ldir), 0.0);

  if (nl > 0.0)
    color += (diffuse * gl_LightSource[0].diffuse * nl)
          +  (specular * gl_LightSource[0].specular * pow(max(dot(n, normalize(halfv)), 0.0), shininess));

  gl_FragColor = color;

and vertex shader:

normal         = normalize(gl_NormalMatrix * gl_Normal);
cam            = camera_pos.xyz - gl_Vertex.xyz;

I'm still seeing a dark, ambient tone only.  I've also normalized my vector CPU side, now as 1, 1, 1, 1


texts: Randomised Path from A to B for cursor movement simulation

texts:
I'm trying to simulate the movement of the mousecursor, by creating a path from point A to B that has random variation. The algorithm I'm using at the moment is very basic, and is limited in that  it's only really good for creating a path where X and Y distance from the start are the same, forming a square:

The code looks something like this:

   function calcualtePath(from, to)
   {
      var pathNodes = [];
      while (from.x != to.x || from.y != to.y)
      {
         var newTransition = {x: from.x, y: from.y};

         if (Rand(1, 3) != 1 && newTransition.x > to.x)       newTransition.x--;
         else if (Rand(1, 3) != 1 && newTransition.x < to.x)  newTransition.x++;
         if (Rand(1, 3) != 1 && newTransition.y > to.y)       newTransition.y--;
         else if (Rand(1, 3) != 1 && newTransition.y < to.y)  newTransition.y++;

         pathNodes.push(newTransition);
         from = newTransition;
      }
      return pathNodes;
   }

I'd like some assistance in creating is a relatively fast algorithm that creates a randomised path between point A and B, that has a more curve like path and isn't limited like the one above. Ideally something a bit like this, with a pronounced curve:


texts: What kind of system can I use to balance an RPG?

texts:
I'm developing a 2D RPG game, like Zelda. I've developed a first version, for studies.
Now, I'd like rewrite it in better way

The character has strength, agility, willpower, constitution, dexterity and concentration and has to fight monsters. Typical.

But I'm a noob, and I would like advice for creating the game system that the characteristics for damages, level-up, resistance, and so on. The one I used in the first version was not balanced.

So, what kind of system can I use ?


texts: Update shadow caster 2d points in script

texts:
Using the Universal Rendering Pipeline,
how do I update the points of a ShadowCaster2D through script?
I presume I could have a singleton manager that would contain all possible shapes for a particular sprite and fetch them as need be. For now, we intend to switch 15 sprites with their own outline that we want to use. We've used a script to update the PolygonCollider2D.
This isn't really easy to maintain if someone had a lot of sprites to switch to.


texts: How to implement visibility graph pathfinding in Unity/C# to detect paths (i.e. visibility connections) efficiently?

texts:
I am struggling with implementing continuous path-finding trough visibility graphs. Notice, I know that grids can be used even when movement is not trough grids (e.g. Theta*). But for my current needs, I really have to implement a real visibility graph path-finding.

First, I understand the logic of such an approach: 1) finding the points that go at each corner around obstacles, 2) calculating which of these points have direct connections to each other, 3) then applying A*. I am able to do steps 1 and 3 by my own, but I can't find out how to do number 2. It means, how can I find out which points are visible to each other and then transform it into an array to use with A*, in an efficient manner in terms of computer processing (i.e. avoinding raycast)?

I use Unity and C#, but also favor pseudo-code format. Please, suggestions, tutorials, sources, are all welcome.


texts: Textures on top of other textures when using VBOs

texts:
I'm currently making a cube style game. With chunks being drawn with VBOs. I'd like to know if there is a way to create an overlay texture on top of the existing texture without the need to rebuild the VBO. This is required to show activity in a cube (think of Minecraft when destroying a block and the little cracks start spreading).

I believe these are called "decals" but I've not found how to use them with VBOs. So how do I draw decals on OpenGL VBO drawn cubes?


texts: How to make a smooth projectile in roblox?

texts:
I am trying to make a projectile (Energy ball) for my game. I am using body velocities, but the issue is is that it seems laggy. I shoot it then half a second through flight it seems to stop in mid air for a quarter of a second then continue. This only happens the first minute of playing.

Here is my code:

local Motion = Instance.new("BodyVelocity", Ball)
Motion.Velocity = ((MouseClickLocation - Player.Character.HumanoidRootPart.Position).Unit*100)

Why is the described behavior happening and how can I make it never happen?


texts:
IEnumerator Shooting()
    {
        //Random Delay
        rand2 = random.Next(1, 4);

        if (!audioSource.isPlaying)
        {
            enemyParticles.SetActive(true);
            particle.Play();
            audioSource.Play();

            rand = random.Next(0, 5);
            Vector3 vel = rb.velocity;

            if (rand == 2)
            {
                if (vel.x < 6f || vel.y < 6f || vel.z < 6f)
                {
                    health.numOfHearts -= 1;
                }
            }
        }
        yield return new WaitForSeconds(rand2);
    }

This script is tied to several enemy objects.
random is initialized in the Start method with a different seed for every object. For some reason that I can't figure out, the delay is not randomized here.
The AudioSource for instance is played for all the enemies at the same time with the same delay every time. I'm not too familiar with coroutines and how they are executed, but I always put the WaitForSeconds() statement at the beginning or end which usually works for me.
Here is the Start method:
//Random Seed
    public int RandomSeed;
    private System.Random random;
    private int rand;

    //Random Delay
    private int rand2;

    void Start()
    {
        //Random
        random = new System.Random(RandomSeed);
    }

Could someone explain why the AudioSources of all the enemy objects are played at the same time when I encounter them? Thanks in advance. :)


texts: Must light helper be added directly in scene?

texts:
Following method of adding light helper works ok:

var light = new THREE.SpotLight( 0xFFFFFF );
light.position.set(100,100,100);
scene.add(light);
var helper = new THREE.SpotLightHelper( light );
scene.add(helper);

but following will cause helper to be off position:

var wrapper = new THREE.Object3D();
wrapper.position.set(100,100,100);
var light = new THREE.SpotLight( 0xFFFFFF );
wrapper.add(light);
var helper = new THREE.SpotLightHelper( light );
wrapper.add(helper);
scene.add(wrapper);

It seems like helper position is taken from absolute light position to scene, but is then applied from it's wrapper, that means it is actually applied twice a thus doesn't match actual position of the light. In this example, helper would appear on (200,200,200). Same applies for PointLight and probably other light types.

Is it possible to put helpers into wrapper together with light and avoid position problem?

demonstration:
http://jsfiddle.net/wfpxdw37/24/


texts:
I am just starting out in indie game development and one thing that seems clear to me is that in the mobile space at least, unless you are already a famous developer, have a well known brand/franchise or are just plain lucky, then you need to price your game at zero to stand any chance of being installed on devices. So to make money you must use Free to play (F2P) monetisation methods. In my own experience with myself and my kids plus reading around on the Web a lot of these methods are not appreciated by the players...

My questions is: Which F2P methods do players find ethical and acceptable?

I am looking for specific game mechanics and an answer which references or is based on data/research (if there is any) and not personal opinions or anecdotal references to successful, money making F2P games like Candy Crush Saga or Clash of Clans etc.


texts: NullReferenceException: Object reference not set to an instance of an object on boolean variable from separate class

texts:
I'm trying to develop game scenario that able to trigger the alarm with alarm light and siren audio to play. For the testing purpose I set it that to boolean value as "alarmOn" in AlarmLight class.

**AlarmLight.cs**
public class AlarmLight : MonoBehaviour {

public float fadeSpeed = 2f;
public float highIntensity = 2f;
public float lowIntensity = 0.5f;
public float changeMargin = 0.2f;
public bool alarmOn = false;

private float targetIntensity;
public Light light;

//add alarm lights
// tag as siren
void Awake()
{
    light.intensity = 0f;
    targetIntensity = highIntensity;
}

void Update()
{
    if (alarmOn==true)
    {
        light.intensity = Mathf.Lerp(light.intensity, targetIntensity,fadeSpeed * Time.deltaTime);
        ChecktargetIntensity();
    }
    else
    {
        light.intensity = Mathf.Lerp(light.intensity, 0f, fadeSpeed * Time.deltaTime);

    }

}

void ChecktargetIntensity()
{
    if (Mathf.Abs(targetIntensity - light.intensity) < changeMargin)
    {
        if (targetIntensity==highIntensity)
        {
            targetIntensity = lowIntensity;
        }
        else
        {
            targetIntensity = highIntensity;
        }
    }
}

}

Then I  tried to access that value with LastPlayerSight class and for the testing purpose i was trying to return false as below.

alarm.alarmOn = (playerPosition != resetPlayerPosition);

Then I tried to play my scene, and I got the error which is the problem with above line of code.

This is my LastPlayerSight.cs class

public class LastPlayerSight : MonoBehaviour {

public Vector3 playerPosition = new Vector3(1000f, 1000f, 1000f);
public Vector3 resetPlayerPosition = new Vector3(1000f, 1000f, 1000f);

public float lightHighIntensity = 0.25f;
public float lightLowIntensity = 0f;
public float fadeSpeed =7f;

public float musicFadeSpeed = 1f;

//directional alarmlight ref
private AlarmLight alarm;

//main directional light ref
private Light mainLight;

private AudioSource panicAudio;

//siren audio
private AudioSource[] sirens;

void Awake()
{
    alarm = GameObject.FindGameObjectWithTag(Tags.alarms).GetComponent<AlarmLight>();
    mainLight = GameObject.FindGameObjectWithTag(Tags.mainLight).GetComponent<Light>();

    GameObject[] sirenAttachedGameObjects = GameObject.FindGameObjectsWithTag(Tags.siren);
    sirens = new AudioSource[sirenAttachedGameObjects.Length];

    for(int i = 0; i<sirens.Length; i++)
    {
        sirens[i] = sirenAttachedGameObjects[i].GetComponent<AudioSource>();
    }
}

void Update()
{
    SwitchAlarms();
    MusicFading();
}

void SwitchAlarms()
{
    alarm.alarmOn = (playerPosition != resetPlayerPosition);

    float newIntensity;

    if(playerPosition != resetPlayerPosition)
    {
        newIntensity = lightLowIntensity;
    }
    else
    {
        newIntensity = lightHighIntensity;
    }

    mainLight.intensity = Mathf.Lerp(mainLight.intensity, newIntensity,fadeSpeed*Time.deltaTime);

    for (int i = 0; i < sirens.Length; i++)
    {
        if (playerPosition != resetPlayerPosition)
        {
            sirens[i].Play();
        }
        else
        {
            sirens[i].Stop();
        }
    }
}

void MusicFading()
{
   //AudioSource audioTemp = audio.GetComponent<AudioSource>();

    if (playerPosition != resetPlayerPosition)
    {
        //audio.GetComponent<AudioSource>().volume = Mathf.Lerp(audio.volume, 0f, musicFadeSpeed * Time.deltaTime);

        panicAudio.volume = Mathf.Lerp(panicAudio.volume, 0.8f, musicFadeSpeed * Time.deltaTime);

    }
    else
    {
        panicAudio.volume = Mathf.Lerp(panicAudio.volume, 0.0f, musicFadeSpeed * Time.deltaTime);

    }
}

}

I'm beginner of developing such things and can anyone guide me to correct the problem?


texts: Storing server information for an MMORPG

texts:
I wanted to get some professional feedback(I hope) on which is the fastest way to store/retrieve/update/delete information for an MMORPG with the server coded in C++.  For characters, monsters, items, objects, etc. What do games like World of Warcraft, and Lord of The Rings, and Star Wars use?  Do they use linked-lists (stl, or a custom one)?  Do they use vectors, arrays.  Should I store them with vectors to make life easier?  Should I come up with my own clever ways to quickly and efficiently retrieve/change/update massive amount of data?

I was reading on the web and it seems like linked-lists are the way to go.  What are your thoughts?  If one were to use either of the mentioned ways to store data, should it be broken down to even smaller sub-categories?  For example, if I were to use linked-lists.  Would I make linked-lists for items like weapon_on_ground, weapon_owned, armor_on_ground, armor_owned, belt_on_ground, belt_owned, etc. And do that for each type of linked-list and try and make each linked-list as small as possible?  As I could see a potential problem having lets say 100k items in the world, and having to sift through them each time a player drops one, or causes it to be changed/updated/deleted.

I am in the middle of porting a project I was working on to a IOCP server.  Before I was just storing all data into linked-lists called: player_info, items, monsters, objects, etc.  But I fear that it might not be a smart idea, and maybe there are better ways of storing information on a server that I know of.

I hope I can get some great replies.

EDIT:  The "project"(as in, it may or may not get finished) is going to be a 2D dungeon crawler MMO, with a lot of monsters, items, and NPCS.  Lets say itll be a old school classic 2d rpg but MMO style.


texts: AndEngine Physics: Shape rotating but not updating physics effects

texts:
I was looking at PhysicsExample from AndEngine's Examples. I made the following change that I added a vertical line shape and created a fixture for it. Then I registered a rotation modifier for that shape. It is rotating properly but not updating its physics properties on rotation means when it is rotating and any physics body hits it, it did not give collision effect. Here is my code:

final VertexBufferObjectManager vertexBufferObjectManager = this.getVertexBufferObjectManager();
        final Rectangle ground = new Rectangle(0, CAMERA_HEIGHT - 2, CAMERA_WIDTH, 2, vertexBufferObjectManager);
        final Rectangle roof = new Rectangle(0, 0, CAMERA_WIDTH, 2, vertexBufferObjectManager);
        final Rectangle left = new Rectangle(0, 0, 2, CAMERA_HEIGHT, vertexBufferObjectManager);
        final Rectangle right = new Rectangle(CAMERA_WIDTH - 2, 0, 2, CAMERA_HEIGHT, vertexBufferObjectManager);
        final Rectangle center1 = new Rectangle((CAMERA_WIDTH/2) - 2, (CAMERA_HEIGHT/2) - 100, 10, 200, vertexBufferObjectManager);
        final Rectangle center2 = new Rectangle((CAMERA_WIDTH/2) - 100, (CAMERA_HEIGHT/2) - 2, 200, 10, vertexBufferObjectManager);

        center1.registerEntityModifier(new LoopEntityModifier(new RotationModifier(2, 0, 360)));

        final FixtureDef wallFixtureDef = PhysicsFactory.createFixtureDef(0, 0.5f, 0.5f);
        PhysicsFactory.createBoxBody(this.mPhysicsWorld, ground, BodyType.StaticBody, wallFixtureDef);
        PhysicsFactory.createBoxBody(this.mPhysicsWorld, roof, BodyType.StaticBody, wallFixtureDef);
        PhysicsFactory.createBoxBody(this.mPhysicsWorld, left, BodyType.StaticBody, wallFixtureDef);
        PhysicsFactory.createBoxBody(this.mPhysicsWorld, right, BodyType.StaticBody, wallFixtureDef);
        PhysicsFactory.createBoxBody(this.mPhysicsWorld, center1, BodyType.StaticBody, wallFixtureDef);
        PhysicsFactory.createBoxBody(this.mPhysicsWorld, center2, BodyType.StaticBody, wallFixtureDef);

Although the body give collision effect when it reaches the shapes initial position. I am new to AndEngine. Where I a wrong...???


texts: Is it possible to generate Events and Hooks in Lua for any game without built-in support?

texts:
Does a game have to have built-in functions to accept and run lua scripts, or can I design Events and Hooks using Lua on any game I please, akin to the days where C code could be used to hook into the WinAPI using dlls?

The reason I ask is, I am trying to create a background application that will perform events and hooks on a particular game that does not currently support lua in-game.

Brief examples:

Events:
- An action executed by the PLAYER is detected. For instance, hitting the Q key will normally make my character use an ability, but with my Lua script running in the background, will cause a sound to play on my computer (or something).

Hooks:
- An action within the GAME is detected. For instance, the game spawns an enemy every minute. When an enemy spawns, the script will detect this and perform an action, for instance playing a sound locally on the computer.

I would like to do both, but I know for games like Garry's Mod, the game already has built-in support for running lua scripts.

Is there a way to do either events OR hooks using lua similarly to how C/C++ can connect to a game using WinAPI dlls?


texts: Memory managing fully removing an item from a dictionary of GameObjects - Unity

texts: When you have a dictionary that looks like Dictionary<string,GameObject> dictionaryOfGameObjects, for removing an item from the dictionary, do you have to Destroy(gameObject) and dictionaryOfGameObject.Remove(stringid) as well?


texts:
Rookie here, still learning the basics of Unity.
I've been using a quad as a cursor sitting flat on top of a hilly terrain mesh. I've been getting the terrain angle by raycasting down at all four corners of the quad and finding where it hits the floor, then editing the quad vertices to shape it to the terrain angle. Probably not the ideal way but it works great for what I needed.
So the next step is replacing it with a sprite. I changed from quad to a sprite renderer, and added a little animation to it. I went to edit the vertices and the setup is completely different (it seems to have 20+ vertices now instead of 4).
I did notice the SpriteRenderer has 4 triangles, but the points are Vector2s rather than Vector3, so I guess that won't work either since I'm applying it to a 3d world?
Can anyone with experience point me in the right direction with this?


texts: Where does the money to make a video game come from?

texts: So 360/ps3 video games takes a few months to a few years to make I assume. If so where does the money to pay employees and costs of everything needed to make the game come from during those few months/few years?


texts: Black and white textures load as turquoise?

texts:
I have some black and white, and some grayscale textures, that are loading in unity as turquoise and white textures. What is causing this and how can I fix this?  Also, can somebody verify that I am supposed to load roughness textures into the "Metallic" slot of the Standard shader? That feels so weird. I was using Principled  Shader in Blender to make the original materials. **EDIT: "Autodesk Interactive" shader has a "Roughness" input but most of my roughness textures and some b&w textures are still turquoise, what is happening...

Here is one of the problem textures (the others are too big, > 6mb):


texts: How can I render text using the new(ish) JOGL GPU curve rendering classes?

texts:
I'm fairly new to OpenGL/JOGL, working through various tutorials and books and making steady progress. Text, however, is an area where I'm stuck. I figured out one way using BufferedImage and Graphics2D to draw strings and then swizzle the pixels and copy to an OpenGL texture, but the quality is low, it is resolution dependent, and it's not efficient.

I found this: http://forum.jogamp.org/GPU-based-Resolution-Independent-Curve-Rendering-td2764277.html. Unfortunately while there are some demos in the GitHub repo I can't quite get my head around them. The code I've tried to use is below:

In the init() method:

    InputStream fontFile = getClass().getResourceAsStream("media/futura.ttf");
    try {
        font = FontFactory.get(fontFile, true);
    } catch (IOException e) {
        System.err.println("Couldn't open font!");
        e.printStackTrace();
    }

    RenderState renderState = RenderState.createRenderState(SVertex.factory());
    renderState.setColorStatic(1, 1, 1, 1);
    renderState.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);

    renderer = RegionRenderer.create(renderState, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
    renderer.init(gl, Region.VBAA_RENDERING_BIT);

    util = new TextRegionUtil(Region.VBAA_RENDERING_BIT);

In the display() method:

    PMVMatrix pmv = renderer.getMatrix();
    pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
    pmv.glLoadIdentity();
    pmv.glTranslatef(0, 0, -300);
    float pixelSize = font.getPixelSize(32, 96);
    util.drawString3D(gl, renderer, font, pixelSize, "Test", null, samples);

I've searched and searched for a tutorial on this stuff or a simple, commented code example explaining how it works but to no avail. If anyone can help me I'd be extremely grateful!


texts:
I want to develop a little tool to help visualize fireworks before using them in a show in Unity where the user can set several parameters and gets a preview of the firework effect in a preview window. To allow the user to customize color over time like I can currently statically do in the visual effects graph, I wanted to add a Gradient input field to my UI.
After fiddling around with manually trying to make things work, I stumbled upon the new UIElements / UI Toolkit and following this Medium post was able to render a simple text UI in a Panel Renderer. However the Gradient Field I added won't show up (which is quite reasonable because in the UI Builder it said something about "Editor only").
Just to make sure, the box on the left is what I mean:

I was strolling around in the Asset Store for a while but couldn't find anything like what I was looking for (just shaders and stuff to apply a gradient to UI elements amongst other things). Other searches led to tutorials on how to completely custom build a single color selection tool which both seemed like a larger effort and didn't allow creating a full gradient.
The question is: Is there some sort of library, package or tool I could use to add an input like that to my "game"? Or am I taking a completely wrong approach with this?


texts: I have curious question about music rhythm based genre while I'm making a code for the game. Is it really better if I set a random pattern encountered on every music played or there is a specific pattern depending on the music and the difficulty? I have observed the Guitar Hero 3 game for the game console where the difficulty is set on the number of strings used and possible number of combo (e.g. two-string combo). Compared to the Tap Tap Revenge for the Android and iPhone, the difficulty based on the number of BPM (Beat per Minute), meaning, number of targets spawn and must be hit.


texts: Bilinear filtering of output image in Direct3D 11

texts:
I'd like to render something at one resolution, but display it in a window at another resolution (e.g. render the scene at 640x480 and stretch it to a 1024x768 window).

Simply resizing the window after creation allows this to work - however, the image is filtered using nearest-neighbor. Is there a way to change the filtering algorithm to e.g. bilinear?


texts:
I'm working on a 2D side-scrolling game in the Unity engine. I am using the 1-Dimensional Perlin Noise function and using pseudo-code. I can't use two links so I'll provide a link to imgur with the images and the links in numerical order. First link in imgur links to the pseudo-code/implementation of perlin noise I am using.
My implementation so far is showing good results.
Here is a picture:

This image uses the values:

Persistance = 0.7

Octaves = 4
From the first article I linked, it states:

Now, you'll want several different random number generators, so I
suggest making several copies of the above code, but use slightly
different numbers. Those big scarey looking numbers are all prime
numbers, so you could just use some other prime numbers of a similar
size.

This block of text is referring to this part of code which is an Integer-noise function:
  float Noise (int x)
    {
        x = (x << 13) ^ x;
        return (float)(1.0 - ((x * (x * x * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0);
    }

Another site I found the author adjusts the Integer-noise function from discrete to continuous (allowing the range not to be limited). I've made this change although I am not sure if my implementation of both links I've provided is entirely correct. The results are promising but when you change these variables values to:

Persistence = 1

Octaves = 8

the terrain starts to have little gaps at the bottom like so:

I am not quite sure how to fix this, I know lowering the persistence provides smoother results resolving this issue but that makes the terrain's amplitude rather low for a side-scrolling platformer.
Here is the complete code:
    void Start ()
    {
        objectArray = new GameObject[width, height];

        for (int i = 0; i < width; i++) {

            float x = PerlinNoise_1D (i, persistances, octaves);

            for (int j = 0; j < height; j++){
                objectArray[i,j] = (GameObject)Instantiate (gameobject, new Vector3 (i, j + x, 0), Quaternion.identity);
            }
        }

    }

float Noise(int x){
    x = (x << 13) ^ x;
    return (float)(1.0 - ((x * (x * x * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0);
}

float CoherentNoise  (int x)
{
    int intX = (int)(Mathf.Floor(x));
    float n0 = Noise (intX);
    float n1 = Noise (intX + 1);
    float weight = x - Mathf.Floor (x);
    float noise = Mathf.Lerp (n0, n1, weight);
    return noise;
}

float SmoothedNoise (int x)
{
    return CoherentNoise (x) / 2 + CoherentNoise (x - 1) / 4 + CoherentNoise (x + 1) / 4;
}

float InterpolatedNoise (float x)
{

    int integer_X = (int)x;
    float fractional_X = x - integer_X;

    float v1 = SmoothedNoise (integer_X);
    float v2 = SmoothedNoise (integer_X + 1);

    return Cosine_Interpolate (v1, v2, fractional_X);
}

float Cosine_Interpolate (float a, float b, float x)
{
    float ft = x * (float)Mathf.PI;
    float f = (float) ((1 - Mathf.Cos ((ft))) * .5);

    return  a * (1 - f) + b * f;
}

float PerlinNoise_1D (float x, float persistance, int octaves)
{

    float total = 0;
    float p = persistance;
    int n = octaves - 1;

    for (int i = 0; i <= n; i++) {

        float frequency = (float)Mathf.Pow (2, i);
        float amplitude = Mathf.Pow (p, i);

        total +=  InterpolatedNoise (x * frequency) * amplitude;
    }

    return total;

}

Thank you for your help and time.


texts: How can a single script attached to multiple enemies provide separate behavior for each enemy?

texts:
I am making a TD game and now stucked at multiple enemies using same script. All is well with scripts attached with one enemy only. Problem is in running multiple enemies.

Here is the overview. I have a Enemy object with which I have attached a 'RunEnemy' script. Flow of this script is:

RunEnemy.cs:

PathF p;
p = gameObject.GetComponent<PathF>();     //PathF is a pathfinding algo which has     'search; function which returns a array of path from starting position
PathList = p.search(starting position);
//-------------------------------

if(PathList != null) {                               //if a way found!
if(moving forward)
     transform.Translate(someXvalue,0,0);  //translates on every frame until next grid point

else if(moving back)
   transform.Translate(0,someXvalue,0);

    ...and so on..

      if(reached on next point)
         PathList = p.search(from this point)   //call again from next grid point so that if user placed a tower enemy will run again on the returned path
}

Now I have attached this script and "PathF.cs" to a single enemy which works perfect. I have then made one more enemy object and attached both of these script to it as well, which is not working they both are overlapping movements. I can't understand why, I have attached these scripts on two different gameobjects but still their values change when either enemy changes its value. I don't want to go with a separate script for each enemy because there would be 30 enemies in a scene. How can I fix this problem?


texts: How can I add solid collideable borders to the viewport regardless of the resolution?

texts:
I'm making a game in Unity. In my game I have a sphere, what I need is for the sphere to rebound against the edges of the viewport.

For that I used a few Gameobjects with 2D box colliders.

The problem is that when game resolution changes, the edges of the camera are extended or reduced, and empty gameobjects are not on the edge.

How can I make gameobjects which always stay on the edge of the viewport?

Is this the correct way to make it bounce at the edges?


texts: What version of OpenGL should I target for Steam?

texts:
I'm planning on developing a game (targeting towards PC and Linux) and putting it up on Steam in the future but I am not sure of what version of OpenGL to target so that the majority of steam users can be able to play my game.

I know Steam has a hardware survey but I'm still not sure of what OpenGL to use but a lot of people recommend OpenGL 3.0 and to make sure not version OpenGL 3.x since 3.x != 3.0.


texts: OpenGL: Is it efficient ok to glPushMatrix, plMultMatrix, plPopMatrix for every object in my scene?

texts:
I'm very new to opengl, and I might not fully understand the openGL matrix projection stack thing.

So, I have about 300 'objects' in my scene, each with their own position/rotation, and I want to draw them all (ignore culling and overdrawing for now). Would it be efficient enough to:

for each object {
    glPushMatrix();
    glMultMatrix(object pose);

    // do object drawing

    glPopMatrix();
}

or is there a better way to draw each object?


texts: OpenGL Core profile - Array of arrays in glBufferData for VBOs

texts:
I want to send each face as VBO, and I structured the data as this

facevbo[0] =  x x x x x x   //x,y,z,r,g,b,s,t
facevbo[1] =  x x x x x
facevbo[2] =  x x x x x x x
facevbo[3] =  x x x x
.
.
.
facevbo[numfaces] = x x x x

Basicly I have dynamic 2d array with different column size:

GLfloat** faceVBO = new GLfloat*[m_numOfFaces];
faceVBO[dfaceIndex] = new GLfloat[pFace->numOfVerts*8];

When I print all the faces, everything is fine,
but when im trying to put them to use,
i have problem at this line:
(ideally I would iterate trough all the faces to bind each face, but lets take the first column)

glBufferData(GL_ARRAY_BUFFER, 4*oindices, faceVBO[0], GL_STATIC_DRAW);

the third parameter (faceVBO[0])
"argument of type GLfloat is incompatible with param. of type const void*"

but if i tead from array, like

GLfloat facevbo[] = {x,x,x,x...}

and

 glBufferData(GL_ARRAY_BUFFER, 4*oindices, faceVBO, GL_STATIC_DRAW);

it works OK.
How should i send the data in this case?

Thanks


texts: I have begun to learn OpenGl and using JOGL. There's something I haven't found any actual or easy guide to though: how can I draw textures? For example, what kind of code would I need to draw a texture at (X, Y, Z) position? I want to use glDrawArrays() or glDrawElements().


texts: what is the most popular mmorpg game that has an out-of-game api?

texts:
World of Warcraft is off the table, because of the "WOW Glider Lawsuit" of 2008. Also see: Where is Blizzards official World of Warcraft API? Eve Online has an API

But, what is the MOST popular (in terms of usership) MMO Game that does allow programmers to develop out-of-game things (like an Android app).


texts: MPL 2.0 in perspective of game development and selling

texts:
I am planning to use a math library named Eigen3 which is under MPL 2.0.
 However, I am not sure what MPL 2.0 means.

As a game developer, who want to sell game.exe (probably by Steam or GoG) who does not wish to distribute source .h/.cpp, here is what I understand MPL 2.0 :-

I have to tell the buyers of my game that I use Eigen3, and provide a reasonable-and-almost-free way (how? Is attaching a description .txt enough?)  to download code of Eigen3.
If I just call some functions of Eigen3 and I don't modify any part of the library, I don't have to distribute any of modification of anything.
There are no other obligation.

Question

How should I provide them source code of Eigen3 in practice?
Is there any wrong about my understanding?


texts: How to divide sprite sheet, but keeping the in same png?

texts:
first post here, but couldn't find an exact answer in your database, so guess I'll have to ask.

I want to know how it is possible to create a ".META" file for a .png so you can extract individual sprites in a spritesheet without having to save all the sprites in individual .png's.

I know it's possible since the developer in the tutorial HERE is using a spritesheet like that.

Thank you very much in advance.


texts: hey i just wanna ask if its ok to add ww2 weapons, specifically nazi weapons into a game

texts: I'm making a ww2 thing and I'm using Nazi weapons and I'm not sure if I have to ask the company to use them or if its ok to just add them without any problem. I really just wanna know if its ok because I've seen many other games add those types of weapons but I have heard of companies making agreements with gun manufacturers.


texts: How can I make my race game fair with all players and keep it climatic?

texts:
I'm making a minigame where up to 5 players have to race against AI or another player(the "enemy"). The race consists of prompts, the current player is asked to press a key in a given amount of time to make progress, if they fail they have to wait until it's their turn again to progress. The current player has to avoid being outran by the enemy they race against, else it's a game over for them.

My problem comes with the fairness of it, the turns are a plain cycle and feels boring, the enemy is dumb and always loses. The game is anticlimatic this way, so I'm looking for a way to choose the next player in a random way but at the same time being fair with the rest until a certain point(the difficulty defines how many consecutive rounds a player can take). I'd also like the game to give random 'boosts' to the players that are near the enemy(and also give the enemy a boost to make it challenging).

How can I achieve this? I'm using Python but I don't know if that matters.


texts: Relationship between Desktop and Android on LibGDX

texts:
So I finished tweaking a tutorial called Rain Catcher and I ran the desktop application.  It works fine.  I then proceeded to run the application using the android emulator the game then crashes.

I set up the project using libGDX's project set-up.

Why won't it run properly on the android emulator even though it runs fine on the desktop application?

I don't know if you can see it but if you zoom you would be able to see it easier.


texts:
I am making my own Tower Defence game engine. I havent built one before and I don't know lot of stuff how games work.

I will take Starcraft as an example. You have a marine shooting a zergling from a certain distance. But you dont see the bullets  traveling trough the air because the marine and the zergling are either too small. So if there are no bullets at all how does the game engine does damage to the zergling under the hood (Use hitTestObject() in flash with what :) )?

I have and idea to add in my game engine and it work this way as explained in the example but I dont know how to implement it trough code.

thanks


texts: Fading to transparent with premultiplied alpha

texts:
I'm fading an object from fully visible to transparent, but the fade darkens the object.

this.Color = Color.Lerp(Color.White, Color.Transparent, weight);

The object does fade to transparent, but.. It becomes darker and more transparent. There used to be a Color.TransparentWhite and Color.TransparentBlack in the non-premultiplied alpha xna world. How can I make the fade to transparent make the object fade through white to transparent with premultiplied alpha?

We are drawing sprites as quads using GraphicsDevice.DrawUserIndexedPrivitives and BlendState set to BlendState.AlphaBlend. This is supposed to do premultiplied alpha blending in XNA4.

Also, how the color is used in the rendering:

effect.Alpha = this.Color.A / 255f;
effect.DiffuseColor = new Vector3(this.Color.R / 255f, this.Color.G / 255f, this.Color.B / 255f)

I suspect I should not use premultiplied alpha when using Alpha and DiffuseColor to make sprites/texts transparent. However when I use Color.Lerp to fade to new Color(1,1,1,0) it still darkens.


texts: How do I model / diagram turn-based combat?

texts:
I'm developing a turn-based combat system for an RPG, and I'd like to know if there is any kind of best practice around diagrammatically modelling something like this.

The ideal modelling paradigm would capture quite a few things, including:

entities (and their stats/status)
entity actions / interactions
positioning
terrain effects
temporal effects

Do I use something from UML? BPMN? A combination? Do I home-bake something?

To clarify: I'm not looking for any advice on designing the system. I'm already quite far along with that. I'm looking for a good way to diagram the model.


texts:
I had a problem with my Font in a game I am developing in libGDX. After some googling I was instructed to use the following code:

private void createFonts() {
    FileHandle fontFile = Gdx.files.internal("data/Roboto-Bold.ttf");
    FreeTypeFontGenerator generator = new FreeTypeFontGenerator(fontFile);
    FreeTypeFontParameter parameter = new FreeTypeFontParameter();
    parameter.size = 12;
    textFont = generator.generateFont(parameter);
    parameter.size = 24;
    titleFont = generator.generateFont(parameter);
    generator.dispose();
}

The problem is there is no FreeTypeFontGenerator class in any of the libGDX libraries I am using. I found that it was an extension. LINK

I can't seem to find clear instruction on how to import these extensions so that I may use them in my game.

I am using Android Studio for development.


texts: Different bounding volumes for culling and collision detection

texts:
Should an object in a 3D-engine use different bounding volumes for collision-detection (broad-phase) and culling?

Basically class renderBounds and class physBounds versus class boundingVolume?

Each of this classes then could either contain the same type of volumes (AABB's, kDOP's,  sphere's etc.) or a special fitting one for the particular object.

(note: without considering of using an external physics engine)


texts: Error OpenGL null Cocos-2D/Visual Studio

texts:
When I try to execute a game code fully functional on Visual Studio 2013, using Cocos-2D (3.8.1) library this error jumps on screen. (I'm working on a laptop)

  OpenGL 1.5 or higher is required (your version is (null)). Please upgrade the driver of your video card.

And then this one:

My Graphic card is an AMD Radeon HD 7600M (OpenGL version 4.x), with de drivers fully updated.

Neither my college teacher nor me know how to fix it.

What can I do to fix it?


texts: Rectangle collision in SDL2 partially allowing sliding C++

texts:
I am working on a game in SDL2, in which the player needs to be able to slide along walls, but NOT go through them. I've read up on things like Quadtrees, and this stackoverflow question https://stackoverflow.com/questions/2656943/2d-platformer-collision-problems-with-both-axes, but I have no idea how to implement Quadtrees (I'm a relative beginner still to C++) and no idea on how to check how much overlap there is. I tried using SDL2's collision functions, but to no avail. Here are my collision functions

main.cpp

//At the top of the program, initialized as global
//variables are the isCollidingYAxis/isCollidingXAxis variables,
//and those are set to false.
bool check_collision(SDL_Rect a, SDL_Rect b){
    int leftA, leftB;
    int rightA, rightB;
    int topA, topB;
    int bottomA, bottomB;

    leftA = a.x;
    rightA = a.x + a.w;
    topA = a.y;
    bottomA = a.y + a.h;

    leftB = b.x;
    rightB = b.x + b.w;
    topB = b.y;
    bottomB = b.y + b.h;

    if(rightA <= leftB || leftA >= rightB){
        if(isCollidingYAxis){
            isCollidingYAxis = false;
            return false;
        } else {
            isCollidingXAxis = true;
            return false;
        }
    }

    if(bottomA <= topB || topA >= bottomB){
        if(isCollidingXAxis){
            isCollidingXAxis = false;
            return false;
        } else {
            isCollidingYAxis = true;
            return false;
        }
    }
    return true;
}

void reset_collision()
{
    isCollidingXAxis = false;
    isCollidingYAxis = false;
}

//further down, I call the above functions from my player class...
void Player::move_player(std::vector<SDL_Rect> objectsWeHit)
{
    playerPositionX += playerVelocityX;
    playerPositionY += playerVelocityY;
    pCollider.x = playerPositionX;
    pCollider.y = playerPositionY;

    for(int x = 0; x < vectorOfRectangles.size(); x++){
        if(check_collision(pCollider, objectsWeHit[x])){
            if(isCollidingXAxis){
                playerPositionX -= playerVelocityX;
                pCollider.x = playerPositionX;
                std::cout << "Collision detected on the X axis!" << std::endl;
                reset_collision();
            }
            if(isCollidingYAxis){
                playerPositionY -= playerVelocityY;
                pCollider.y = playerPositionY;
                std::cout << "Collision detected on the Y axis!" << std::endl;
                reset_collision();
            }
        }
    }
}

My collision detection functions are similar to lazy foo production's collision detection. The tutorial that I based my function off of can be found here: http://lazyfoo.net/tutorials/SDL/27_collision_detection/index.php. In case its not obvious, I am using a vector to store rectangles, and I'm positive that part is okay. The problem right now is that only the X axis collision detection works, and not the Y axis. Meaning I can go through the top/bottom of the rectangle and not the left/right. I can, however, slide along the left/right sides of the rectangle, which is the desired behaviour. The complete program can be found here: https://bpaste.net/show/1715097a16e1. I'm at a complete loss, so any help is appreciated!


texts: How to store the co-ordinates traced by a character in unity C# script?

texts: I have a navmesh agent with a trail-renderer component attached to it, who travels to a pre-determined destination based upon user input using unity's built in Navigation system. I want to store the (x,y,z) cordinated of the path traced by the character in some kind of data structure and then I want the camera to trace that exact path, but at some height above so the path(trail-renderer) is visible.


texts:
I thought floating point has a very large range, for example up to 3.4*10^38.
However today I tried to set my player's Transform.position.x to 1000000 in the GUI and it gave me a warning:

  "Due to floating-point precision limitations, it is recommended to bring the world coordinates of the GameObject within a smaller range."

Does that mean that my single scene has to be smaller than 1000000*1000000*1000000. Is this considered big enough? I will need multiple scenes if I want a larger world? When a new scene gets loaded, will my player's position be reseted? How do I manage the position data so that it doesn't go out of range?

I'm using Unity3D Pro.


texts: How can I make a Custom Inspector display a UnityEvent method selection widget like the Button OnClick Inspector?

texts:
I know that UnityEvents display themselves automatically with the default inspector.

But what if you create a custom inspector by extending the Editor class? The fields don't draw automatically since they're overridden by the custom editor.

How can I write my custom Editor class, so that it displays my UnityEvent fields in exactly the same way as the default inspector?

For example, here is the UnityEvent method selection widget for the Button component using its default inspector:


texts: Record from microphone and playback audio in the next scene in Unity

texts:
I am making a simple interactive video in which I need to trigger the microphone to start recording automatically in the beginning of the scene and stop recording after 15 seconds. And then, I need the recording to be played automatically after 30 seconds in the next scene.
I have found this script (https://gist.github.com/darktable/2317063) for saving the recording as a wav file, and then I can guess how to load it to the next scene. However, I don't know how to properly write the recording+saving. I know this might be very basic but I am a complete beginner and need to do it for my graduation project. Any help/suggestion is greatly appreciated! Cheers!


texts: Power-up spawns 2-3 times after a restart, but enemies spawn normally

texts:
I have two spawning objects that use the same behaviour. They are being called in the same function and in the same situations. The only difference is the variable of time that classifies what's an enemy and what's a power up.
The spawning of enemy objects is working fine: no matter how many times I restart the game, the behaviour is the same. But with the power up spawning object, it spawns the right way sometimes, but in other times it spawns like 2 or 3 times in the same place. This only happens when I restart the game.
How can I fix this bug?
I'm not fluent in english.
File 1:
public float enemySpawnSeconds = 2.5f;
public float powerUpSpawnSeconds = 6f;

public void Start()
{
    gameManager = GameObject.Find("GameManager").GetComponent<GameManager>();
}

private void Update()
{
    GameSpeed();
}

public void StartSpawnObjects()
{
    StartCoroutine(SpawnPowerUps());
    StartCoroutine(SpawnEnemies());
}

public IEnumerator SpawnEnemies()
{
    yield return new WaitForSeconds(2f);
    while (gameManager.startGame == false && gameManager.gameOver == false)
    {
        Instantiate(enemies[Random.Range(0, 2)], transform.position = new Vector3(9.8f, yPosition[Random.Range(0, 2)]), Quaternion.identity);
        yield return new WaitForSeconds(enemySpawnSeconds);
    }
}

public IEnumerator SpawnPowerUps()
{
    yield return new WaitForSeconds(2f);
    while (gameManager.startGame == false && gameManager.gameOver == false)
    {
        yield return new WaitForSeconds(powerUpSpawnSeconds);
        Instantiate(powerups[Random.Range(0, 3)], transform.position = new Vector3(11.1f, yPosition[Random.Range(0, 2)]), Quaternion.identity);
    }
}

File 2:
void Update()
{
    spawnPlayer();
    gameTimer();
    restartGame();
}

public void spawnPlayer()
{
    if (startGame == true) //starting the game
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            Instantiate(player, player.transform.position, Quaternion.identity);
            spawned = true;
            startGame = false;
            uiManager.HideTitleScreen();
            spawnManager.StartSpawnObjects();
        }
    }
}

public void gameTimer()
{
    if (startGame == false)
    {
        timer += 0.0165447f; // game time
    }
}

public void restartGame()
{
    if (gameOver == true) // restarting the game
    {
        timer = 0f;
        spawnManager.enemySpawnSeconds = 2.5f;
        if (Input.GetKeyDown(KeyCode.Space) && uiManager.restart == true)
        {
            gameOver = false;
            uiManager.HideTitleScreen();
            spawnManager.StartSpawnObjects();
        }
    }
}


texts: Is there a way to read a picture pixel by pixel in unity without any distortions

texts:
In my unity project I have an image file which contains information. I would like to be able to read this .bmp file pixel by pixel. So I tried simply loading a sprite, and then reading its texture. However when I do that, the loaded texture appears to be different than the image I'm using, as if it was compressed. I tried modifying the asset settings (making it an advanced texture with point filter mode, and setting format to argb32bit uncompressed) but it doesn't help. Any ideas?

EDIT: Some additional information,

The code with which I load the image into a pixel array

// sprites from which paths will be loaded
public Sprite[] path_maps;
// Color 24 array which contains the texture bitmap
private Color32[] pixels;
// graph with paths
public Graph[] graphs;

void Start () {
    // I skipped some  code that doesn't matter to the problem

    // go through all path maps
    for (int i = 0; i < path_maps.Length; i++) {
        // load sprite into pixels array
        pixels = path_maps[i].texture.GetPixels32 ();
        // create new graph
        graphs [i] = new Graph ();
        // get graph from path map
        graphs[i].pixels_to_graph(pixels, path_maps[i].texture.width, path_maps[i].texture.height, camera_width, camera_height);
    }

}

The function which reads pixels and creates node for each colored pixel (only relevant part of the function)

public void pixels_to_graph (Color32[] pixels, int width, int height, double camera_width, double camera_height)
{
    // assign pixels width and height
    pixels_width = width;
    pixels_height = height;
    // assign camera dimensions
    this.camera_width = camera_width;
    this.camera_height = camera_height;
    // First create as many nodes as there are colored pixels (simply read the pixel map)
    // Note that pixel map contains the bitmap from bottom to the top (left bottom to top right)
    // create nodes array
    pixel_nodes = new Node[width*height];
    // current position in pixel array. Made for easier calculations
    int carriage = 0;
    // go through all rows
    for (int i = 0; i < height; i++) {
        // go column by column
        for (int j = 0; j < width; j++) {
            // if it's transparent or white - ignore
            if (pixels [carriage].a == 0 || pixels [carriage].Equals (col_white))
                continue;
            // else add node to the node array
            pixel_nodes [carriage] = new Node (j, i, pixels_width, pixels_height, camera_width, camera_height); // note that i is the y position while j is the x position
            // add node to nodes list
            nodes.Add (pixel_nodes [carriage]);
            carriage++;
        }
    }

I detect the problem in the above pixels_to_graph function. When I debug it with a 1680x1050 image, that has pixels in its bottom left corner (three black squares with 1 pixel distance between them, of size 3x3px, 2x2px, 1x1px) it only detects the 3x3 one, the colour value at position of the other 2 squares is white. When I tried other shapes I also discovered other distortions, some 1px wide lines are not there, as well as single pixels.

My current texture settings (though note I tried different options but some of them don't display anything, this one at least displays something):


texts: How to prevent players from getting lost during the onboarding phase of an RPG?

texts:
I've created a new RPG and tested it with some players. They like it, but get lost at certain points.

For example, I'm using hotkeys to open modals, T to talk, and other buttons that do various things. Moreover, some of the quests aren't entirely clear.

To fix this, I'm trying to think of a good onboarding approach.

I'm implementing three methods for onboarding:

1) Cutscenes: The cutscenes, especially the opening scene, will give the backstory and explain where they are

2) The NPC dialog: Through conversations with NPCs, they will give hints as to what you should do. Right now, I include, somewhat awkwardly, things like:

  "Hi there, I'm Bob. You can press T to talk".

3) Onscreen Tooltips: These blink on screen until the player completes the current onboarding task. For example, the tooltip disappears when the player clicks their minimap:

I'm looking for a more cohesive strategy for onboarding users to the game, or good tutorials for this. Two things I'm weary of are:

I don't want to be overbearing with help, and am attempting a good Discovery Phase to let the player explore.
I don't want the player to leave the game out of frustration with being lost

I've seen a lot of techniques for various game genres, and even things like Google apps, where they have a glowing choice for the user to click on. I'm a sole developer, and some of these techniques seem quite complicated to implement.

Thanks!


texts: Deferred shading - g-buffer positions, world or view space?

texts:
So, i am doing this for the first time. I have a lodded terrain that i would like shade deferred. I have built the g-buffer with positions/normals/albedo/depth and render vertices like  I did before with forward rendering. World positions are calculated in the vertex shader from offsetting and scaling nodes (CDLOD after P. Strugar). I pass on world positions multiplied with  view-projection-matrix and after rednring the position texture looks like this:

For reference, the normals are like this:

All textures are RGB 16bit floats. The normals look all right. In positions, just like one would expect the quadrants move with the camera movement, the cross staying in the center. I have not yet started with the lighting pass, so my question is: does this look right ? I expected smoother transitions and not really white. Or should i use world positions (then everything is white in the position texture) and divide by world size to stay in clamped 0..1 land ?
Again, I haven't changed the vertex shader from forward rendering, and the fragment is trivially rendering to the g-buffer.


texts: Can I use the Minecraft avatar in my game as long as I texture it differently?

texts: I'm creating a block-based game and am ready to start developing the avatar. I would like to use the Minecraft avatar model but use my own higher resolution texture. Can I do this or will I be breaking some law or setting myself up to be sued?


texts: HLSL Triplanar texturing and multi texturing performance

texts:
I'm stuck for my terrain rendering shader code for DX9. I'm looking to implement triplanar texturing, a texture atlas, and blending between different textures. Right now it's working. The problem is that it requires a total of 18 Tex2dLod calls and that is killing my frame rate. Also blending only works between textures which are next to each other in the texture map, if they are further apart it would go through all the different textures between them. Below is the relevant code from the pixel shader.

PSO PS(VSO input)
{
PSO output;
float4 texWeights = input.TexWeights;

int tile1 = clamp(floor(texWeights.x),0,1);
int tile2 = tile1 + 1;
float blendMultiTexture = max(0,texWeights.x - tile1);

float3 blendWeights = abs( input.TBN[2].xyz );   // Tighten up the blending zone:
blendWeights = (blendWeights - 0.2) * 7;
blendWeights = max(blendWeights, 0);      // Force weights to sum to 1.0 (very important!)
blendWeights /= (blendWeights.x + blendWeights.y + blendWeights.z ).xxx;
float2 coord1 = input.WSPosition.yz * TexScale;
float2 coord2 = input.WSPosition.zx * TexScale;
float2 coord3 = input.WSPosition.xy * TexScale;

TileTexCoords texCoords;
float2 texSize = float2(480,480);
float MIP = min(GetMipLevel(coord1, texSize),4);
texCoords = GetTextureCoordinates_Gutter(coord1 ,tile1,tile2);
float4 col1 = lerp(tex2Dlod(AlbedoSamplerX,float4(texCoords.UVA,0,MIP)),tex2Dlod(AlbedoSamplerX,float4(texCoords.UVB,0,MIP)),blendMultiTexture);
float2 bumpFetch1 = lerp(tex2Dlod(NormalSamplerX,float4(texCoords.UVA,0,MIP)).xy,tex2Dlod(NormalSamplerX,float4(texCoords.UVB,0,MIP)).xy,blendMultiTexture) * 2.0f -1.0f;
float3 bump1 = float3(0, bumpFetch1.x , bumpFetch1.y);
float2 specFetch1 = lerp(tex2Dlod(SpecularSamplerX,float4(texCoords.UVA,0,MIP)).xy,tex2Dlod(SpecularSamplerX,float4(texCoords.UVB,0,MIP)).xy,blendMultiTexture);
float3 spec1 = float3(0, bumpFetch1.x , bumpFetch1.y);

texCoords = GetTextureCoordinates_Gutter(coord2 ,tile1,tile2);
float4 col2 = lerp(tex2Dlod(AlbedoSamplerY,float4(texCoords.UVA,0,MIP)),tex2Dlod(AlbedoSamplerY,float4(texCoords.UVB,0,MIP)),blendMultiTexture);
float2 bumpFetch2 = lerp(tex2Dlod(NormalSamplerY,float4(texCoords.UVA,0,MIP)).xy,tex2Dlod(NormalSamplerY,float4(texCoords.UVB,0,MIP)).xy,blendMultiTexture) * 2.0f -1.0f;
float3 bump2 = float3(bumpFetch2.y , 0, bumpFetch2.x);
float2 specFetch2 = lerp(tex2Dlod(SpecularSamplerY,float4(texCoords.UVA,0,MIP)).xy,tex2Dlod(SpecularSamplerY,float4(texCoords.UVB,0,MIP)).xy,blendMultiTexture);
float3 spec2 = float3(specFetch2.y , 0, specFetch2.x);

texCoords = GetTextureCoordinates_Gutter(coord3 ,tile1,tile2);
float4 col3 = lerp(tex2Dlod(AlbedoSamplerX,float4(texCoords.UVA,0,MIP)),tex2Dlod(AlbedoSamplerX,float4(texCoords.UVB,0,MIP)),blendMultiTexture);
float2 bumpFetch3 = lerp(tex2Dlod(NormalSamplerX,float4(texCoords.UVA,0,MIP)).xy,tex2Dlod(NormalSamplerX,float4(texCoords.UVB,0,MIP)).xy,blendMultiTexture) * 2.0f -1.0f;
float3 bump3 = float3(bumpFetch3.x, bumpFetch3.y, 0);
float2 specFetch3 = lerp(tex2Dlod(SpecularSamplerX,float4(texCoords.UVA,0,MIP)).xy,tex2Dlod(SpecularSamplerX,float4(texCoords.UVB,0,MIP)).xy,blendMultiTexture);
float3 spec3 = float3(specFetch3.x, specFetch3.y, 0);

Are there ways to reduce the number of tex2Dlod calls here while retaining all the features? Is there a way to cheat and only sample the textures twice instead of three times for triplanar texturing? Is there any way to get a non interpolated value from each of the surrounding vertexes so that any 2 textures can be blended together? Are there methods to approximate the specular map from the normal and diffuse maps so that I can do without the specular map sampling?

Thanks!


texts:
Is there any way to get a pointer to a newly created shader object's source? I'd like to load a shader directly from file in to my shader object instead of loading to an intermediary variable and then using glShaderSource().

I haven't been able to find any information regarding this, only regarding buffers.


texts: How to only allow a certain amount of the same instance in Game Maker?

texts:
I am creating a simple jump n' run game. For some reason my game sometimes spawns two instances of the same enemy on top of each other. So you can't tell there are two of him until he uses his attack where he shoots a barrage of bullets in random directions.

So now when the game spawns two of them, there are also twice as many bullets which makes the game too difficult to play.

I don't know what causes the game to spawn two. It only happens very rarely. I would just make it so that if there are two instances of the same enemy, it destroys one of them.

That would solve the problem.


texts: Which is better: More puzzle apps in Store or more puzzle levels in a single app

texts:
The Question: Given a freemium model (ad-supported with in-app-purchase of additional levels/hints)... are chances of overall success better with a single puzzle app with lots (but varied) levels/playing-styles, OR... multiple apps, each app focused on a singular theme/playing-style?

Scenario: Our puzzle engine can support multiple types of puzzles based on the puzzle-piece styles. While the game mechanics are roughly the same, changing the puzzle piece changes the visual aesthetic of the app and gameplay somewhat. The puzzle piece imparts a theme of sorts to the puzzle. Sorry for the lack of further specifics.

I feel that multiple apps will allow us to market the different content more easily. I worry though that spreading the content over say, 4 different apps might limit the playing life of each individual app (the app content is mathematically limited). At which point you hope that cross-promotion will guide your player to the additional app/content.

Are there any precedents here? I've assumed that with the freemium model having more apps in the pipeline is always a good thing. But having your 4 apps on a single player's device sounds challenging.


texts:
Wondering in general how IDs are stored in a large massively multiplayer online game.

From what I can imagine, it seems that each "game entity" would have a globally unique ID (GUID). Say there are 10 people connected to the game. The game server then spawns any new game entity, and sends the GUID (along with the entity data) to the clients. The clients never create entities directly. Actually no, the client maybe can also create game entities that are unique to the view of that specific client. So if player 1 is viewing a screen, then they might see game entity x, in addition to game entities a, b, c, etc. Then player 2 sees game entities a, b, c, and y, but not x. Not sure if these "dynamic" game entities are created on the client or server, so that is the first part of the question.

Then given these GUIDs, say there is tracking (analytics) that goes on. Say the game company wants to track when a player defeats a game entity. So it saves to the backend/server database "player 1 defeats game entity 123asdf....GUID". But if game entities are constantly spawned and then destroyed/cleared (by hiding or maybe they have a temporary/ephemeral existence), then the database would have GUIDs for a lot of non-existent game entities. So I'm wondering if this is how it's done, or if these ephemeral game entities have metadata permanently stored to the database beyond their GUID, or if they are never saved to the DB, etc.

Then there is the problem of having lots of game entities (particles) on the screen. If each particle of say 1 million particles has a GUID, and you shoot (if it's like asteroids game) one of them, then the DB saves "player 1 destroyed GUID x at timestamp y". But the GUIDs have to be unique across the game server. So if 10,000 people are playing asteroids, and each asteroid has a GUID, the problem is how to guarantee the GUID is unique, and also secure (if that's a concern).

Then there is the issue of offline playing. Say you play offline, but then sync your data occasionally. Then GUIDs need to be generated on the client, and could be tampered with (and be insecure). Ideally the GUIDs would be generated on the server so we know how they are constructed and that they are secure.

Basically, I am wondering how GUIDs work in a MMO.

If all game entities have a unique GUID.

If ephemeral game entities have unique GUIDs.
If there are non-ephemeral (persistent) game entities that have GUIDs.

If tracking/analytics tracks both ephemeral and persistent game entities.
How GUIDs are guaranteed to be unique.
How GUIDs work if the player is playing offline.


texts:
OpenGL has so many APIs which can modify different states. It's not so obvious whether an API has global effect or local effect.

For example, rumour says glTexEnv has global effect while glTexParameter has local effect (it only affects the current bound texture). Is this true? How to determine whether an API has global or local effect?


texts: How do I check if the same item exist in plist and SpriteKit?

texts:
I am trying to make a RPG game in IOS, with a similar dialogue system in Baldurs Gate. I have created two arrays in a plist file. Like this:

As you can see I have two arrays: PlayerMessage; a list (it will be) of multiple choices that the player can touch and NPCMessages; the text that is displayed when the PlayerMessage is touched
I am at the stage where I can touch on the NPC and see a black box with text from array (PlayerMessage). However I do not know how to tell Swift, if a player touches the string of the Item in PlayerMessage and if same item exist in NPC Message display the string of that item.
Here is the code that I have used:
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
{

    for touch in (touches) {

        NPC.name = "NPC"

        let Location = touch.location(in: self)

                    var CorrectedLocation = CGPoint()
                    CorrectedLocation.x = Location.x - LocalCamera.position.x
                    CorrectedLocation.y = Location.y - LocalCamera.position.y

        let node = self.atPoint(CorrectedLocation)
        var Message: SKLabelNode!
        Message = SKLabelNode(fontNamed: "Trebuchet MS")

        if (node.name == "NPC") {
            let NPCMessageer = SKSpriteNode (color: UIColor.black, size: CGSize(width:1000, height:1000))
            NPCMessageer.zPosition = 99
            NPCMessageer.position = CGPoint(x:-500, y:-200)
          Message.fontSize = 50
            Message.color = UIColor.white;            Message.position = CGPoint(x:-500, y:-100)
            Message.zPosition = 100

            addChild(NPCMessageer)
            self.addChild(Message)
            for PlayerMessage in NPC.PlayerMessage {
             Message.text = PlayerMessage as?String}
            let label = self.atPoint(CorrectedLocation)
            if label.name == "Message"
            {

             if NPC.PlayerMessage == NPC.NPCMessage
             {
                Message.text = NPC.NPCMessage as?String
             }


texts: How the game sends force feedback to the steering wheel

texts: How the game will be some of the information feedback to the steering wheel, such as bumps, bumps, vibration and so on. View MSDN, which are introduced from the steering wheel to get the relevant information and control the steering wheel of the force feedback, but how to get from the game inside the type of force feedback?


texts: Am I implimenting a sweep and prune broadphase correctly?

texts:
The code that I am using is:

    std::vector <PhysicsBody*> physicsChildren; //containing all objects

    ...

    std::sort(physicsChildren.begin(), physicsChildren.end(), sortByLeft);
    std::vector <PhysicsBody*> activeList;

    unsigned int one;
    unsigned int two;
    for(one = 0; one < physicsChildren.size(); ++one)
    {
        activeList.push_back(physicsChildren[one]);
        for(two = 0; two < activeList.size(); ++two)
        {
            if (physicsChildren[one]->m_position.x + physicsChildren[one]->m_radius > activeList[two]->m_position.x - activeList[two]->m_radius)
            {
                CheckIntersectionBetween(physicsChildren[one], activeList[two]);
            } else {
                activeList.pop_back();
            }
        }
    }

I think something is wrong because for 800 objects 309169 calls to CheckIntersectionBetween. A bruteforce would use 640000 calls, I didn't think this was much improvement (considering only objects close in the x-axis should test).

I wrote the code from reading Jitter-Physics article about SAP:

Create a new temporary list called “activeList”.
You begin on the left of your axisList, adding the first item to the activeList.

Now you have a look at the next item in the axisList and compare it with all items
 currently in the activeList (at the moment just one):
 - If the new item’s left is greater then the current activeList-item right, then remove
the activeList-item from the activeList
 - otherwise report a possible collision between the new axisList-item and the current
 activeList-item.

Add the new item itself to the activeList and continue with the next item in the axisList.

What have I done wrong?


texts: Pros and Cons of AMF in multiplayer flash game?

texts:
After trying to use red5 for my turn-based multiplayer game, I've decided to give AMF a try using amfphp, because of the expensive media server hosting solutions. (With AMF all I need is a web server). The game is a simple turn based game. It uses Box2D for physics. Its similar to pool or billiards. More than two users should be able to play in one game 'table'. Is it OK to use AMF in this situation? Also which one should I use? ZendAMF or AMFPHP?

Features: No. of players >= 2 in each 'room' or 'table', turn-based, multiple rooms.

I've heard games like farmville use AMF. Does zynga's poker game also use AMF? How does one player get info on what the other player is doing? Do they do a timed checking for any changes, similar to polling? How can changes or 'moves' made by one player be updated to everyone? Since the connection is terminated after every request unlike in a socket connection.


texts: add the variation of the angle to its current angle: trouble with 180 and -180

texts:
I need to rotate a character, I would like to add the variation of the angle to its current angle. But my values are between 180 and -180. So if my character is at -179, then he goes right, it arrives at 179. how to compare that it turned by 2 degrees on his right? The goal is to say : "turn only 2 degrees on your right no matter where you are in the world".
Same thing from 179 to -179 : 2 degrees to the left.

Thanks


texts: How to detect collision between entities using Ashley?

texts:
I am developing a game using Libgdx and Ashley, and I would like to know the best way to detect collisions between different entities. Currently I have been using a ContactListener that detects contacts between different types of entities but I think this could negatively affect the performance of the game, especially considering that in a mobile application.

I would like to clarify that the type of contact I am wanting to perform is between the player and coins or entities in which it is not necessary to have a body.


texts:
I want to be able to move a sprite from a current location to another based upon where the user clicks in the window. This is the code that I have:

#include <SFML/Graphics.hpp>

int main()
{
    // Create the main window
    sf::RenderWindow App(sf::VideoMode(800, 600), "SFML window");

    // Load a sprite to display
    sf::Texture Image;
    if (!Image.LoadFromFile("cb.bmp"))
        return EXIT_FAILURE;
    sf::Sprite Sprite(Image);

    // Define the spead of the sprite
    float spriteSpeed = 200.f;

    // Start the game loop
    while (App.IsOpened())
    {
        if (sf::Keyboard::IsKeyPressed(sf::Keyboard::Escape))
            App.Close();

        if (sf::Mouse::IsButtonPressed(sf::Mouse::Right)) {
            Sprite.SetPosition(sf::Mouse::GetPosition(App).x, sf::Mouse::GetPosition(App).y);
        }

        // Clear screen
        App.Clear();

        // Draw the sprite
        App.Draw(Sprite);

        // Update the window
        App.Display();
    }

    return EXIT_SUCCESS;
}

But instead of just setting the position I want to use Sprite.Move() and gradually move the sprite from one position to another. The question is how? Later I plan on adding a node system into each map so I can use Dijkstra's algorithm, but I'll still need this for moving between nodes.