texts: Using Similar Mechanic Names For Attributes

texts:
I am working on a pen and paper game and I am wanting to use three core attributes that everything else is based off of. These three attributes being Physique, Skill and Will. However, if you're familiar with Fable, you will know that these were used in the game series.

My question is, could I use these same three core attributes in my games system without legal ramifications later down the road?

I would like to think not because one is from a video game and my project is pen and paper, not to mention that the terms Physique, Skill and Will are highly unlikely be to copyrighted.

And I also know that I shouldn't expect 100% accurate legal advice on this site but if anyone has any legal experience in these sorts of areas, it would at least give me a basis to go off of.

I'll continue doing research and hopefully between all of us, the question can be answered soon.

Thanks in advance.


texts: Virtual Economy Setup - Virtual currencies advice

texts:
I'm trying to figure out how to build my virtual economy. It seems like some games have one currency and some of them have up to 3 and 4 different ones.

The game is an action game which is currently single player but I'm planning on adding a tournament mode that allows users to compete against each other. The virtual goods that a user would be able to purchase would be either customization to the character or powerups and utilities that give the character more abilities in the game. The character is able to gain coins during game play.

The advice I'm trying to get is whether or not it makes sense to set up more than one currency and more than two currencies? What are the pros and cons?
Reference to some resources that indicate research would be great.


texts:
Like countless other video games, I'd like to have scripted sequences in my game. Character 1 says something, the player replies, then a rock falls, that sorta stuff. I could find a way to do it, but I would like to use a common method, assuming there is one.

My current thought is to have a separate file for each level of the game that contains all the possible scripted actions for that level. When the corresponding trigger is activated, the function is called. I think early Call of Duty games (up to CoD4) used something similar, but I'm not entirely sure.


texts: How to calculate whether a cuboids face edge is infront of or behind another for sorting

texts:
I'm building an isometric game, I want to position and sort objects in a particular way.
All my entities have 3d bounds which determines their cuboid, looking my example, a different edge is used to decide if a cuboid is in front of another, depending on whether the point b2 is left or right of a2.

I have already calculated all the points a1,a2,b1,b2 which are x,y,z
I think I basically need to virtually draw "aedge" and "bedge", and compare some intersection.

If b2 is right of a2 the green cuboid (b) is consider in front of the red cuboid when bline is south east of aline.

If b2 is left of a2 the green cuboid (b) is considered in front of the red cuboid when bline is south west of aline.

Please forgive my ignorance here, I'm sure there's some terminology I should have used here. I'm struggling to put down in words what it is I need.


texts: Platform for DS/Gameboy Dev - Managed Memory, Tools, and Unit Testing

texts:
I'm interested in dabbling in Nintendo DS, 3DS, or GBA development. I would like to know what my (legal) options for development tools and IDEs are.

In particular, I would not consider moving in this direction unless I can find:

A programming language that has managed memory (garbage collection)
A unit testing tool akin to JUnit, NUnit, etc. for unit tests

I would also prefer if other tools exist, like code-coverage, etc. for that platform. But the main thing is managed memory and unit testing.

What options are out there?


texts: How do I get a SphereCollider's global origin in Unity?

texts:
I've been following this tutorial: Understanding Steering Behaviors: Collision Avoidance

but I'm having trouble implementing one of the functions correctly in Unity, here's the code:

private function lineIntersectsSphere(ahd:Vector3, ahd2:Vector3, sphCol:SphereCollider) : boolean
{
    return distance(sphCol.center, ahd) <= sphCol.radius || distance(sphCol.center, ahd2) <= sphCol.radius;
}

The SphereCollider variable contains the Center variable, however, it always returns a vector containing 0, 0, 0 values. I imagine it's the spheres local origin.. is there a way to get the center? Perhaps it could be through the transform.position that the sphere is attached to?


texts: Different types of memories which a graphics card has

texts: I've been googling this around and yet nothing showed up but some articles from middle ages which were talking about Gforce mx and ... . My question is just this: what are the different memories in a high-end graphics card and what is their size and usage?


texts:
I'm developing in libgdx java/android but not using any high-level environment like Unity.

I have a sphere at [0,0,0], with a PerspectiveCamera looking at it. Through the main game loop I have managed to have the camera orbiting the sphere in different directions. However, what I want to do is have a stationary camera and have 3 objects orbiting the sphere on their own accord, and their own orbital plane. Have been looking all day and struggled to get this working.

Eventually, I want to link the camera to always be above one of the orbitting objects, but that's at a later stage.

I also want to be able to have these objects orbitting on their own "forwards" direction, but able to change their direction over time. Say, from their top-down view, they each have a heading 0-359 degrees.

Anyone lend a hand with this? I've tried using 2D X/Y maps transposing onto mercator projections and then converted to spherical coordinates; I've tried Vector3 and setFromSpherical(); I've tried looking at Quaternions, and just got lost.

It's a relatively simple thing I'm trying to do, multiple orbiting objects around a sphere (radius 3, origin [0,0,0]), but just getting my initial approach wrong.

EDIT:

After talking the situation through, I have two options:  I either keep track of the orbiting objects with theta/phi as to their position around the sphere, or just calculate the amount by which to rotate based on the object's direction (0-359). On further talks with DMGregory, the latter option would introduce orbital instability/divergence with roudning errors so I have decided to change my requirement to the following:

Keep track of the object's position based on 2x360 degree values for  azimuth and polar, called theta and phi. The two coordinates are used to locate the object at any point in orbit around the sphere, but I need to be able to still "move" the orbital object "forwards" and thus change theta/phi accordingly, allowing the direction to still be changed.

Many thanks,


texts: What sounds need to be transcripted when using Closed Captions?

texts:
I have no experience with captioning, but we are developing a game and we want to make it as accessible as possible so we thought of 2 levels of subtitles: dialogues and Closed Captions (dialogues + sound effects).
The problem I can think of is what sounds need to be transcripted in Closed Captions? All sounds of the game could clutter the screen with subtitles and distract the player. Too few sounds and the player could miss some details.
For example we could have an electric door which makes some sound when opened or closed, this kind of sound should be transcripted always? Or just the first time it's encountered, and then the user will know that all the similar doors should make the same sound?
And is it too much to put 2 subtitles (one for opening, one for closing)?


texts: Redistributing sprites in procedural generation according to player movement

texts:
I am making space arcade with procedurally generated background consisted of nebulas and stars sprites, which spawn on Awake() in certain borders around player.

Mobile phones have limited capacity so I want to redistribute sprites along the player's movement. E.G. if player reaches an empty area where is no sprites, I want sprites which farthest relatively to player to move in front of player. So player couldn't ever see an empty area. Notice that player can move in any direction in 2D space, not only up.


texts:
I have bought a 3d character on turbosquid. I opened it in Unity and everything loads fine except the animations. I then imported the skeleton to Mixamo to find out the skeleton is messed up. I use the set joints manually in Mixamo, but when it tries to fix the issue, the hands get attached to the butt/hips. I would like to get rid of the skeleton and remake it. How would I go about doing this?

I believe what I am trying to do would be called derigging? I could then use Mixamo's autorig tool to make a better skeleton.


texts: XNA - Making 2D Hexagons Connect With Each Other

texts:
I'm working on a top-down 2D strategy game in XNA, and the tiles are hexagons. I can't have a grid because of the game mechanics, so everything has its own location, and every tile object is stored in a list. What I'm trying to do is have it so that if you place a tile close to the side of another tile, they will snap together and become one object. I can't seem to figure out how to get what side it should snap to.

The red represents the different sections I want to check for mouse clicks in (these would of course not be an actual texture in the game). The white represents the area where if you clicked, it wouldn't allow you to place a tile because it would be on top of another. The closest thing I can think of is to have a larger hexagon around the actual tile that's divided into triangles from the center to the edges, but I'm not sure how to do this.

And I'm gonna move it to Windows Phone with Monogame and I don't think the phone is fast enough to make some sort of thing that checks colors for each sector, so I don't think it can be texture based. I feel like there's some kind of relatively simple math to do this but I can't seem to figure it out.


texts: ECS how to access multiple components (not the same one) in a system?

texts:
I'm implementing a basic entity component system from http://entity-systems.wikidot.com/rdbms-with-code-in-systems#java in C++, but I don't quite understand how I could do multiple components (not the same component. I don't see a need to have 2 of the same components yet) in a system. In an inherited System, for example, MovementSystem, I want it to be able to act on all entities that have a position component and a velocity component. However, in my code, I would do

std::vector<Component *> positionComps = entityManager->GetAllComponentsOfType(POSITION_COMPONENT);
std::vector<Component *>::iterator it = components.begin();
for (; it != positionComps; it++) {
    PositionComponent *pos = dynamic_cast<PositionComponent *>(it);
    pos->x += velo->x;
}

I don't know how I could get the velocity component in there, as it is looping through the position components. I could get all of components of type velocity inside that loop and have a nested loop, but that would be bad on the performance. Also, how would you know which component goes with which? There is a function of GetAllEntitiesPossessingComponent which returns a list of integers so I can later then get the specific component of the entity and check if the entity has the two components. Also, if the component returned was NULL, I would have to check in the system before I do anything if it's NULL or not. But all of this doesn't seem right.

I COULD merge PositionComponent and VelocityComponent into one and then act on that in the system, but that wouldn't help me with future components.


texts: How can I efficiently render lots of 2D quads?

texts:
I have lots of 2D quads. I write their local vertex position info to a buffer (accompanied with a world transform matrix) which gets sent to the render thread.

I then pass the world transform matrix as a uniform into the vertex shader which applies itself to each vertex and works fine. I however have to make a call to glDrawElements() for each quad I want to render because each one has a different world transform.

What is the most efficient way for me to render all of these quads? Should I do what I'm already doing, or should I calculate the world position for each vertex on the CPU before I write them to the buffer, so I can attempt to batch more quads into a single glDrawElements() call? Or is there another approach?


texts:
I've messed around with iPhone development for a couple years now. I've done some contract work. I want to get into Cocos2D to develop a game idea that I have.

I was wondering what might be the best/quickest way to get up in running in cocos2d?

I've thought about a book, but I wondering if that is needed? I'm the type of guy that just wants to know what everything does and is suppose to be used for.

Any ideas?


texts: I noticed that a lot of games tend to have hats.  I was wondering why?  Is it some sort of tradition to add hats to your games?  What makes this trend so popular in game development?


texts: Anisotropic filtering on gbuffer textures for shading pass?

texts:
I have a OpenGL 3.3 deferred shader.
For my geometry pass I have diffuse textures and/or normal map textures from my models and here I use max anisotropic filtering. But in my shading pass, where the three input textures are position, normal and diffuse textures (the output from geometry pass) - does it even make sense to use anisotropic filtering on these for the shading stage? It wouldn't look any better no?


texts: C# Console Snake Game, sort of fps problem

texts:
I have about 200 lines of code, really simple oop.

When I load the console game (snake), I don't see it running smooth, like fps problems in in games, but I don't understand why, because my files are a lot lighter and demand less resources than heavy games.

Thanks.

Linking my files to Pastebin

Main file: http://pastebin.com/60aeEBRa

SnakeObject.cs: http://pastebin.com/z0MPwNSA

Utilities.cs: http://pastebin.com/7jLDKUQ9

FoodObject.cs: http://pastebin.com/w1HuBQK4

RocksObject.cs: http://pastebin.com/QYcNbSad

Much thanks for your help.

I'm welcoming tips.

Thanks


texts:
I'm fairly new to the world of Unity, and am adding collision detection for the first time through RigidBody2D (as this game is 2D). First of all, here is some relevant information:

Unity Version: 4.2.5f
Operating System: Windows 8.1 Update 1

The Problem
I have two objects that could collide, let's call one Bullet and one Enemy. Both Bullet and Enemy have RigidBody2D components attached to them, as well as the following method in an attached script:
void OnCollisionEnter2D(Collision2D collision){
    print("Hit!");
}

However, nothing is printed to the console (I have checked that print works in other situations).
The Question
What is going wrong here? I must be missing something simple. I have checked that Physics 2D has collisions enabled between layers, I have tried the 3D equivalent to this and still no joy.
Additional Info


texts: Javascript game engine that can work 'seamlessly' with react-native

texts:
I have experience with Unity, but I don't like the fact that Unity compiles your game directly into APK (or IOS equivalent). I want to modify the game to provide chat interface for multiplayer mode etc. So, I thought of doing it the other way - create an app and embed a multiplayer game within it. This approach meant that I had to develop for Android and iOS, separately. I then came across the React-Native library, a mobile extension of the popular React framework.

I have decided to create an app using React-Native, but now I am confused as to which game engine I should use. I think, since React-Native is JavaScript, the game engine needs to be in JavaScript for seamless integration. I am planning to use WebView to embed the game in my react-native app.

Can anyone suggest a good JavaScript game engine that can be used along with react-native? I have done some research on Phaser and Pixi, but they use WebGL for rendering and, I read somewhere that WebView doesn't have great support for WébGL or Canvas.


texts: Cocos2d - Physics bodies randomly loosing Velocity along an axis after impact

texts:
This just started occurring and seems to randomly happen during, and between, game sessions. A dynamic moving body collides with a static body and instead of bouncing off looses (almost completely) it's Velocity along the collision's normal. This means the dynamic body starts moving along the static body's surface it just collided with, and is most noticeable on the rare occasions it does a 90 degree turn upon hitting a a second wall right ahead.

This behaviour is very erratic, and almost seems to come and go between builds with the same code on my content (although it could just be chance), so I'm wondering if it could be an issue with the cocos2d libraries?

For reference, the way I'm setting up these bodies:

For both types it starts witj:

PhysicsBody *pawnBody = PhysicsBody::create();
PawnBody->setDynamic(true);
pawnBody->setContactTestBitmask(0xFFFFFFFF);
setPhysicsBody(pawnBody);

Then the static body code does:

myBody->removeAllShapes();
PhysicsShapePolygon *colPolygon = PhysicsShapePolygon::create(&spriteVertices[0], 4,
                                                     PhysicsMaterial(0.f, 1.f, 0.f));
colPolygon->setContactTestBitmask(0xFFFFFFFF);
myBody->addShape(colPolygon, false);
...
getPhysicsBody()->setDynamic(false);

And the dynamic body code does:

getPhysicsBody()->removeAllShapes();
PhysicsShapeCircle *circle = PhysicsShapeCircle::create((getScale() *
                                                   mySprite->getContentSize().width) / 2,
                                                   PhysicsMaterial(0.f, 1.f, 0.f));
circle->setContactTestBitmask(0xFFFFFFFF);
getPhysicsBody()->addShape(circle);
...
myBody->setVelocityLimit(moveSpeed);
myBody->setDynamic(true);

I believe they are both set up correctly to achieve fully elastic collisions, and I'm sure this was working at some point through a slightly different flow (they didn't share the initial build code). Has anyone experienced any similar behaviour?


texts: Getting closest distance between a square's edge and a point 2D

texts: How would I get the closest distance between a square's edge and a point in 2D, if I only have the points coordinates, and the coordinates of the square and it's size?


texts: glClearBuffer takes 1 second on a Geforce 9500GT

texts:
These 2 lines (in C# using OpenTK) seem to cause 1 second lag every frame on a machine with a Geforce 9500 GT

GL.ClearBuffer(ClearBuffer.Color, 0, new float[] { 0, 0, 0, 0 }); // accum
GL.ClearBuffer(ClearBuffer.Color, 1, new float[] { 1, 0, 0, 0 }); // reveal (only red)

The framebuffer in question has 2 color attachments (Rgba16f and R16), and one depth attachement. The framebuffer status after setup indicates no problems.

This is also just one of 3 framebuffers that are cleared every frame - only this one turns the my game into a diashow. There is no such problem on any other card I've tested. Before clearing both color attachment are bound using

DrawBuffersEnum[] bufs = new DrawBuffersEnum[] { DrawBuffersEnum.ColorAttachment0, DrawBuffersEnum.ColorAttachment1 };
GL.DrawBuffers(2, bufs);

How could a very particular gfx card be so slow in clearing 2 color attachments? o.O


texts: Boolean change when clicking the left mouse button (not working)

texts:
I want to change a boolean when I click the left mouse button, but it doesn't work as expected. I use this method:

if (m.LeftButton == ButtonState.Released && m_Old.LeftButton == ButtonState.Pressed)
{
   if (second)
   {
      second = false; // Boolean changes
   } else
   {
      second = true; // Boolean changes
   }
}

I need a way to tell the code that I only want one change. When I click the left mousebutton, the second boolean changes constantly. The reason for this is that the code keeps executing until m_Old (the old mousestate) is updated. (m & m_Old must be different for this code to run)

An example (when I click the left mouse button once| these are the results for the second boolean):

My mouse update code:

// Mouse stuff
oldMouse = mouse;
mouse = Mouse.GetState();


texts: Running Unity Build through Command line

texts:
I recently developed a game in unity and would like to build it to a standalone application using the command line. Is there a way to do that?

Specifically, without opening the Unity Editor how can I use the command line to build my project to a standalone application?

I am using Linux.


texts: Help Understanding Cameras/View Matrices in DirectX11 (C#)

texts:
So I'm designing a soft game engine in C# on top of the SharpDX API (a C# wrapper for DirectX). As I'm designing the camera, though, I'm running into some issues getting the 3D perspective correct. I've read through a few tutorials and articles, but I can't seem to find what I'm doing explicitly wrong.

This is my current understanding: The world matrix is the identity matrix (of the world...) times the translation matrix of the model, times the rotation matrix of the model, times the scale matrix of the model, which should then give me the transformed location of each vertex in "world space." The view matrix would then be the output matrix of LookAtLH(cameraPositionVec, targetPositionVec, upVec);. Finally, the projection matrix seems to be the output of the PerspectiveFovLH(fov, aspectRatio, nearDist, farDist); So, I then took the transpose of each of these matrices, multiplied world * view * projection and I should be left with the final transformed vertex coordinate.

Here's the code I have so far. I've left the world matrix untouched by just setting the translation to the origin, the rotation of the model to the identity matrix, and the Scale to 1, which should mean I don't have to actually perform any world matrix calculations for the sake of simplicity right now.

// Setup and create the projection matrix.
projectionMatrix = Matrix.PerspectiveFovLH((float)(Math.PI / 4.0f), ((float)GameWindow.WIN_WIDTH / (float)GameWindow.WIN_HEIGHT), 0.1f, 100.0f);

// Initialize the world matrix to the identity matrix.
worldMatrix = Matrix.Identity

...
//camera class
public Camera(Vector3 _position, Vector3 _target, Vector3 _rotation)
{
    position = _position;
    target = _target;
    rotation = _rotation;
}
public Matrix GetViewMatrix()
{
    //convert degrees to radians
    float pitch = rotation.X * 0.0174532925f;
    float yaw = rotation.Y * 0.0174532925f;
    float roll = rotation.Z * 0.0174532925f;

    //get rotation matrix and the relative up vector
    Matrix rotationMatrix = Matrix.RotationYawPitchRoll(yaw, pitch, roll);
    Vector3 up = Vector3.TransformCoordinate(Vector3.UnitY, rotationMatrix);

    return Matrix.LookAtLH(position, target, up);
}

....

//set the view matrix
viewMatrix = camera.GetViewMatrix();

...
//Transpose the matrices
worldMatrix.Transpose();
viewMatrix.Transpose();
projectionMatrix.Transpose();

From there they are fed to the vertex shader, which is below. If I comment out the projectionMatrix multiplication though, the image shows up. If It's not commented out though, nothing renders to the screen, which leads me to believe that may be the issue.

//vertex shader
cbuffer MatrixBuffer
{
    matrix worldMatrix;
    matrix viewMatrix;
    matrix projectionMatrix;
};

struct VertexInputType
{
    float4 position : POSITION;
    float2 tex : TEXCOORD0;
};

struct PixelInputType
{
    float4 position : SV_POSITION;
    float2 tex : texCoord0;
};

PixelInputType main(VertexInputType input)
{
    PixelInputType output;

    // Change the position vector to be 4 units for proper matrix calculations.
    input.position.w = 1.0f;

    // Calculate the position of the vertex against the world, view, and     projection matrices.
    output.position = mul(input.position, worldMatrix);
    output.position = mul(output.position, viewMatrix);
    output.position = mul(output.position, projectionMatrix); //<-- If I comment this line, it renders to the screen
    // Store the texture coordinates for the pixel shader.
    output.tex = input.tex;

     return output;
}

I feel like I'm missing something really basic, because I think I'm pretty close. Thanks for any help you can provide.


texts: How can I tell Unity to use specific frames for animation?

texts:
So I have made a set of animations in a one file in Blender. For example, frame 0-20 idle animation, 30-60 walking animation, 70-120 jumping animation.

How can I tell the program to separate the animations by selecting those frames, cutting them or something and this way I could have a set of animations without needing to save .blend files separately with the animations?


texts: Rotating A model in 3D so it matches its direction of movement

texts:
So I have a model of a spear and when it gets thrown I want to set the orientation of the spear to its direction.  ( I also want to use this for other things like bullets pointing in the direction they are moving in)

my Models local forward Vector is +Z and I have the direction that it is moving in (in world space) from the velocity but I can't work out how to rotate it locally so that it is always pointing the right direction.

I tried to work out the difference in the angles and then create a Rotation matrix to apply to its rotation, but that didn't give me the desired results.

I am working in DirectX.  Any help would be appreciated


texts:
I was reading on SO about native flash rendering vs building a custom BitmapData frame buffer and some of the answers were a bit conflicting, so I was wondering:

Is it generally best practice to go the custom Bitmap buffer route or is it best to leave rendering to the flash engine?
If you're using vector animations (MovieClips) as opposed to sprites, does that change the answer to the above?
If so is it best practice to use sprite based animations?

(I'm targeting Flash 10 if that makes any difference)


texts: How to make a textured tree model outside of unity that can be used in unity

texts:
So I am trying to make a 3d model of a tree that is textured that can be used in unity. So far I have tried two separate ways to do this and they both didn't work. The first time I used blender's tree creator add on to make a great looking tree but the textures for the tree needed to be applied in nodes and that doesn't transfer over to unity. The second time I used unity's own tree creator, but it's incredible hard to make a good tree with it and the textures I apply always get stretched and distorted to fit the tree making them blurry. So I really would appreciate if someone could tell me a good way to make trees that can be used in unity.

Thanks, nova


texts:
I'm writing a game engine, and when I use a perspective camera I get a black screen. I am not going to ask exactly why this is because there would be a lot of code to share and, frankly, I think that's a bit petty a question even to bother you all with.

The trouble is that I don't know how to debug it. All that changes is my projection matrix, and if my projection matrix looks fine, I don't know why it doesn't work. Ideally I'd print out the values of various things as the shader did its calculations, but GLSL inconveniently doesn't have a printf() function.

So my question is: how do I debug my problem? The only thing I can think of is checking as many values as I can client-side and then programming by permutation, but I've done that and gotten nowhere. Is there a way I can see what's happening in the video card? Is there a completely different technique I could be using?

I'm using GLSL version 420 (and features specific to that version), so I don't think that glslDevil is an option, considering that it was last updated in 2010.

EDIT

I managed to solve my problem through some completely unrelated debugging.


texts: Simulate 'Shock absorbtion' with tire rubber in PhysX (2.8.x)

texts:
This is a kinda tricky question and I fear there is no easy enough solution, but I figured I'd hit SE up before giving up on it and just doing what I can.

A machine I am working on has no suspension or shocks or springs of any sort in the real machine, so you would think that when it drives over bumps, it would shake like crazy but because its tires (6 of them) are quite large they seem to absorb a lot of shock from the bumps. Part of this is because the machine is around 30k lbs and it just smashes/compresses any bumps in the ground down (This is another issue im still working on) and the other part is that the tires seem to have a lot of flex to them with a lot of air as well.

So my current task is to simulate shock absorption in physx without visibly separating the tires from the spindle/axle..

I have been messing with all kinds of NxMaterial, NxSpring, Joints, etc. and have had no luck getting this to work. The main problem is that the spindle attached to the tire is directly in the center and the axle is basically solidly attached to the chassis, so if i give it any spring or suspension travel, that spindle on the tires will move upwards or downwards, looking very odd because now its not any longer in the center of the tire. I tried giving it a higher restitution but that just makes it bouncy without any shock absorption.

Another avenue I am messing with is to actively smooth the terrain in front of the tires so that before it hits a bumpy patch, that patch is smoothed and it doesn't bounce. The only issue with this is that it is pretty expensive to do with 6 tires, high tessellation of the terrain and other complex things going on at the same time in this simulation. I am still working on this but I am hoping to mix and match a few different aspects to get the best possible outcome.

This is a bit of a complex issue so I'm not expecting anyone to have a definitive answer, just hoping someone may think of something I haven't =-)

-Side note: Yes i know PhysX 2.8.x is quite outdated but we have to stick with it for this implementation. We are in the process of going to another physics engine but it is out of scope to apply that engine to this project.


texts: What is the relation between the Zynga platform and facebook games?

texts:
I decided to check the Zynga platform because I heard that Zynga can now host games and one is able to play these games using a Zynga account.

After registering for a game, I noticed that it opened directly and didn't ask me to create an account (as it is using my Zynga account).

The weird thing is the game's website sends you to its facebook page, where I have to log in using my facebook account to play.

How could a facebook game allow someone to play through the Zynga platform?


texts: How to fix thi gameover scene audio transition?

texts:
I created a gameover scene in a crafty.js project but it does not run.

  Crafty.scene('gameover', function() {
    Crafty.background("#ccc");
    Crafty.audio.stop("bg");
  });

 var gameOver = function () {
    Crafty.scene('gameOver');
  };

The background music ("bg") doesn't stop playing once the game ends. How do I fix this?


texts: Finding closest coordinate of a pre-known set

texts:
Let's say I have a large number of conceptual objects of some kind, each of which occupies a pre-known set of points in a Cartesian 3-space.

1) What is the best combination of data structure (for modeling these objects, their occupied points, and/or the enclosing space) and algorithm for the purpose of being able to retrieve only the point within each object that lies closest to an arbitrarily selected point, with speed the first concern and memory footprint secondary (but still important)?

2) Let's say that that a point may be visually occluded with respect to another point, according to a black-box true/false rule, and I now want to retrieve the closest visible point of each object.  Asking the same question as in #1, is the answer the same or is something else now advisable?

3) Let's say that the pre-known set of points for each conceptual object may potentially change somewhat frequently, enough so for computational expense in data structure management to be a concern.  Are the answers to #1 and #2 still good, or are they expensive enough in setup/teardown to be likely to cause problems under this condition?

(I really do want to know the answers to these items separately, if they have distinct answers.  Mega bonus points for any answers that generalize well to a Cartesian 4-space.)


texts:
I am quite new to game development (but not programming) so please forgive me if I am not correctly understanding certain concepts.

I am trying to figure out how to use world coordinates rather than pixel coordinates so that my game can work correctly at different resolutions. As I understand it, I need a viewport and I can use camera functions such as project() and unproject() to convert between the two coordinates. At the moment, I am just placing objects every 16 pixels as this is the size of objects and the objects cannot intersect.

For example:

The bottom left block is located at pixel (0, 0), the one to the right at (16, 0), to the right of that is (32, 0), and so on. However, I would like to be able to place them at (0,0), (1, 0), and (2, 0) with the same result so that it looks the same on different resolutions.

Basically, I'm asking how to set this up and have it work properly as world coordinates.


texts: Asking the user to place the joystick in the center while calibrating

texts: I would like to know why exactly calibration programs (usually?) ask the user to place the joystick in middle, that is: Why isn't moving the handle in a complete circle (usually?) enough to calibrate a joystick?


texts: Bullet is not instantiating properly in Unity

texts:
So I'm trying to make a simple weapon where I just instantiate a bullet at the Shoot Point's gameobject position. For some reason when I press down on my mouse the bullet just flies up. Any ideas on why this could happen?

Vector3 velocity = bullet.transform.forward * 1000 GameObject bulletGameObject = Instantiate(bullet, shootPoint.transform.position, Quaternion.identity);
Rigidbody bulletBody = bullet.GetComponent<Rigidbody>();
bulletBody.velocity = velocity;
Destroy(bulletGameObject, 4f);


texts: how do I tile this generated terrain infinitely around the player?

texts:
i made a script that instantiates cubes with for loops and perlin noise. is there any way i can tile this infinitely around the player? here is the script for the generation of one tile

public GameObject grass;
public int mapSizeX = 50;
public int mapSizeZ = 50;

public float heightScale = 20f;
public float detailScale = 20f;

float seed;
// Use this for initialization
void Start()
{
    //if (instance == null)
    //   instance = this;
    for (int x = 0; x < mapSizeX; x++)
    {
        for (int z = 0; z < mapSizeZ; z++)
        {
            int y = (int)(Mathf.PerlinNoise((x + seed) / detailScale, (z + seed) / detailScale) * heightScale);

            GameObject g = Instantiate(grass) as GameObject;
            g.transform.position = new Vector3(x, y , z);
            g.transform.SetParent(this.transform);
        }
    }
}


texts:
I have a trigger that plays an animation but when i switch scene and i come back to the original scene, the animation plays again. I want to remember actioned triggers in order to play triggers once per scene. How can I do that?

The GlobalScript

public class GlobalScript : MonoBehaviour
{
    public static GlobalScript Instance;
    public Animator ani;
    void Awake ()
       {
        if (Instance == null)
        {
            DontDestroyOnLoad(gameObject);
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy (gameObject);
        }
      }
}

The current script (Running every time i load the scene)

    public Animator ani;
    public AudioClip sound;
    public GameObject text;
    private int seconds = 2;
    //var delay = 2.0; //This implies a delay of 2 seconds.

//  public void SavePlayer(){
//      GlobalScript.Instance.ani= ani;
//  }

    // Use this for initialization
    void Start () {
        ani= GlobalScript.Instance.ani;
        ani.enabled = false;
        text.SetActive (false);
    }

    void OnTriggerEnter(Collider other){
        AudioSource.PlayClipAtPoint (sound, transform.position);
        ani.enabled = true;
        text.SetActive (true);
        Destroy (gameObject);
        Destroy (text,3);
        //text.SetActive (true);
        //StartCoroutine(Die());
    }

    //And function itself
    IEnumerator Die(){
        //play your sound
        text.SetActive(true);
        yield return new WaitForSeconds(2); //waits 3 seconds
        Destroy(gameObject); //this will work after 3 seconds.
    }
}


texts:
i'm creating a pong game for learning purpose and decided to have the Paddle moving freely but with a slight change in its control.

When pressing LEFT OR RIGHT it should move in polar coordinates facing the ball. And UP OR DOWN moves the paddle towards or backwards the ball.

I've spent the whole day trying out a few solutions but didn't make it.

             var ball = Vector3.zero; // target
             var d = ball - translation.Value.ToVector3();
             var radius = d.magnitude;

             var dir = d.normalized * data.speed * deltaTime;
             var angle = Vector3.Angle(ball, translation.Value);

             var nextPos = translation.Value;

             if (data.input.x > 0)
             {
                 nextPos.x += dir.x + 15 * math.sin(angle) * data.speed * deltaTime;
                 nextPos.z += dir.z + 15 * math.cos(angle) * data.speed * deltaTime;
             }

             if (data.input.x < 0)
             {
                 nextPos.x -= dir.x + 15 * math.sin(angle) * data.speed * deltaTime;
                 nextPos.z -= dir.z + 15 * math.cos(angle) * data.speed * deltaTime;
             }

             translation.Value = nextPos;


texts: How to render this stereopanorama for VR in unreal engine4


texts:
Sorry for asking such a basic question. I am reading books on OpenGL4 but in most examples they generally render only objects. So I understand how to deal with vertex buffers and vertex array buffers, etc. but my question is does it work when you have say hundred of objects to draw?

Should you have 1 vbo for example and replace the data in the buffer each time you need to draw a new object?

Should you have hundreds of vbos? By my understanding was that you were limited in the number of buffers you could create (using getBuffer()).

How would one typically do this?

Thank you.


texts: Problem with rotation a camera with the mouse OPENGL GLFW

texts:
I am trying to move my camera with my mouse, I can translate it juste by changing the current position of my camera, but when I want to move my forward vector and my up vector of my camera it doesnt work very well, the camera seem to move whereas it's not the case...

void Camera::moveCameraRotateUpdtade(GLFWwindow * window)
{

 //curseur mvt ...
  double xpos, ypos;
  Vec3f new_front;
  std::cout << "front = " << CameraFront << std::endl;

  glfwGetCursorPos(window, &xpos, &ypos);
  if(!(xpos > _width-1 || xpos < 0) && !(ypos > _height-1 || ypos < 0))
  {
    float x = (2.0f * xpos) / _width - 1.0f;
    float y = 1.0f - (2.0f * ypos) / _height;

horizontalAngle += mouseSpeed  * float(x) ;
verticalAngle   -= mouseSpeed  * float(y) ;

std::cout << "x y = " << x << " " << y << std::endl;
std::cout << "horizontalAngle verticalAngle = " << horizontalAngle << " " << verticalAngle << std::endl;

new_front = Vec3f(cos(verticalAngle) * sin(horizontalAngle),sin(verticalAngle),cos(verticalAngle) * cos(horizontalAngle));
Vec3f right = Vec3f(sin(horizontalAngle - M_PI/2.0f),0.0,cos(horizontalAngle - M_PI/2.0f));
CameraUp = right.cross(new_front);
CameraUp = CameraUp.normalize();
CameraFront = new_front.normalize();

std::cout << "CameraFront = " << CameraFront;
std::cout << "CameraUp = " << CameraUp;
std::cout << "position = " << _positionCam;

LookAt( _positionCam + CameraFront,_positionCam, CameraUp);
}

}

Here my lookAt function :

Mat4f Camera::LookAt(Vec3f target, Vec3f position,Vec3f CameraUp)
{
  //ce dont j'ai besoin pour calculer les parametre de ma camera...
  Vec3f f = (target - position).normalize();
  Vec3f u = CameraUp.normalize();
  Vec3f s = f.cross(u).normalize();
  u = s.cross(f);

  Mat4f R;
  R.setCol(0,s);
  R.setCol(1,u);
  Vec3f f_tmp = f*-1.0 ;
  R.setCol(2,f_tmp);
  R.setElement(0,3,-1.0f * s.dot(position));
  R.setElement(1,3,-1.0f * u.dot(position));
  R.setElement(2,3,f.dot(position));
  _LookAt = R.transpose();

  return  _LookAt;

}

Here a video showing my problem :

https://www.youtube.com/watch?v=Am_1sfMQllQ


texts: Rotate sphere in Javascript / three.js while moving along x/z plane

texts:
I have a sphere/ball in three.js which I want to "roll" around on the x/z plane. For the z axis I could simply do this no matter what the current x and y rotation is:

sphere.roll_z = function(distance) {
      sphere.position.z += distance;
      sphere.rotation.x += distance > 0 ? 0.05 : -0.05;
    }

But how can I roll it along the x axis? And how could I properly do the roll_z? I've found a lot about quaternion and matrices, but I can't figure out how to use them properly to achieve my (rather simple) goal.

I'm aware that I have to update multiple rotations and that I have to calculate how far to rotate the sphere to match the distance, but the "how" is the question. It's probably just lack of mathematical skills which I should train, but a working example/short explanation would help a lot to start with.

Here is an example of how the rotation goes wrong (WASD movement): http://js.blockheaven.net/simple.html


texts: CharacterController - should I work with FixedUpdate or with Update?

texts: I know that updates related to the physics engine should be made in FixedUpdate, but I am not sure about updates related to CharacterController: should they be done in Update or FixedUpdate? I tried both options and putting them in FixedUpdate appears smoother, but this may be due to other factors, so I would be happy to know what the recommended practice is.


texts: How to render the sprites for a 2D soft body physics system

texts:
This is not a question as to how to achieve soft body physics, but rather if I have a mass-spring system how to modify a sprite with that information.
I am using unity so I dont have access to vector based graphics.


texts: Issues calculating frame independent movement

texts:
I'm developing a Breakout style game in C++ using SDL. The problem so far is that the ball slows down and speeds up for no particular reason.

The slowdowns usually last a few seconds.

EDIT : When running fullscreen I noticed that the ball movement seems to be a tiny bit jerky as well. This leads me to believe that the timing should be more finely granulated. But at the same time, it shouldn't be necessary to have µs precision...

Here is my code for calculation the movement of the ball :

double deltaMovement = tick * speed;

rect.x += static_cast<int> ( deltaMovement * dirX );
rect.y += stnecessearyatic_cast<int> ( deltaMovement * dirY );

I tried changing it to help prevent float to in truncation, but this affects the speed to much, making the ball move only move horizontally or vertically ( which never happens with the above code. )

double movementX = ( deltaMovement * dirX );
double movementY = ( deltaMovement * dirY );

movementX += ( movementX > 0.0f )? 0.5f: -0.5f;
movementY += ( movementY > 0.0f )? 0.5f: -0.5f;

rect.x += static_cast<int> ( movementX );
rect.y += static_cast<int> ( movementX );

rect is an SDL_Rect and holds the ball's position. dirX and dirY are double and holds the direction of the ball, the values range from -1.0 to 1.0

I'm not sure if the issue is with the float to int conversion. I guess it could also be something with SDL internally, but I am quite sure SDL should be capable of smooth animation.

    Here's my main game loop ( I have removed some irrelevant parts of it )
    while ( !quit )
    {
        while ( SDL_PollEvent( &event ) )
        {
            // Handle input, move paddle, check if user pressed esc
            // Yes I have a means of escaping the outer while loop.
        }
        double delta = timer.GetDelta( );

    // Update the ball, check for collisions with wall/paddle/tiles
    UpdateBalls( delta );

    // Redraws everything
    UpdateGUI();
}

I'm quite sure the issue is not with my delta time, since it's fairly consistant at 1 - 4 msec. And even if it did change a lot, it shouldn't matter. But just in case, here's the code I use for calculating delta time :

double Timer::GetDelta( )
{
    timespec tmCurrent;
    clock_gettime( CLOCK_MONOTONIC_RAW, &tmCurrent);

    // Get current time in nanoseconds
    unsigned long long deltaCurrent = static_cast< unsigned long long > ( tm.tv_sec * 1000000000 + tm.tv_nsec );

    // Get diff. Delta is an unsigned long long that holds previous tick ( see below)
    unsigned long long diff = deltaCurrent - delta;

    // Convert into ms and assign to a double
    double deltaMSec = static_cast< float > ( diff / 1000000.0f );

    // Reset delta so that it can be used the next time delta is calculated
    delta = deltaCurrent;

    return deltaMSec;
}

What am I doing wrong?


texts: How to apply specific torque to configurable joint in Unity

texts:
I have a torque vector that needs to be applied to a configurable joint connecting two rigid bodies. This joint configured in such a way, that it only allows angular motion around all 3 axes.

Is there any way to apply torque vector to configurable joint?

PS: I'm using PhysX engine embedded in Unity, so I don't have access to D6 joint directly, but only through "configurable joint" wrapper. It combines Y and Z drives into one "YZ drive" for some reason, and I can't specify torques for Y and Z axes independently.


texts:
I'm trying to map quadsphere with COBE spherical cube (CSC) projection in OpenGL (wanna map planets). I managed to create a 2D texture and it works well except seams at edges.

Then I learned that there is a cubemap in OpenGL. It has some advantages: It automatically generates seamless mipmap and it requires less memory (I was using 4*size width 3*size height texture where a half is just wasted like this: https://camo.githubusercontent.com/b017f71b03e6180dc75ff34f017d45f32e9db817/68747470733a2f2f7261772e6769746875622e636f6d2f6369782f517561645370686572652f6d61737465722f6578616d706c65732f677269642e706e67)

The problem with using cubemap is that CSC is not gnomonic projection. So I can't just use vertex point as 3D texture coordinates. I have to calculate 3D texture coordinates from uv coordinates and the face. Then OpenGL recalculate it to uv coordinate and the face. I guess that slows down the rendering compared to simple 2D texture.

The problem with using 2D texture is that it is not easy to make texture seamless. And it takes more memory if I use one image file for whole texture. I think I could pre-generate mipmaps sampling adjacent faces and add 1px padding and modify uv coordinates slightly (like this? https://gamedev.stackexchange.com/a/49585/74052). But it sounds complicated and I have to pre-generate all mipmaps, and textures might no be in size of power of 2 and I might have another problem with that.

I have no idea which way to go.

When using cubemap, is there a way to specify uv coordinates and face directly, and not specify 3D texture coordinates (direction)?
Is there a way to set 2D texture wrap mode to something like CLAMP_TO_EDGE_OF_OTHER_TEXTURE to make it seamless at edges?
Is there other way to make a 2D cube texture seamless?
Any other suggestion to deal with this problem?

Thanks in advance!


texts: How do I increase the spawn rate of an object as the "difficulty" goes on?

texts:
I just want my objects to spawn in a faster rate as time goes by. The print(SpawningInBetween); print out shows the percentage of the difficulty overtime.
This is the code I have:
public Vector2 spawnsMinMax;

//Spawn Positions
Vector2 SpawnPosition;
float secondsBetweenSpawn = 1;
float nextSpawnTime;

void Update()
{
    if (Time.time > nextSpawnTime)
    {
        float SpawningInBetween = Mathf.Lerp(
            spawnsMinMax.y,
            spawnsMinMax.x,
            Difficulty.GetDifficultyPercent());
        print(SpawningInBetween);
        nextSpawnTime = Time.time + SpawningInBetween;

        nextSpawnTime = Time.time + secondsBetweenSpawn;
    }

    // ...

I was thinking of going like this:
if(Time.time > Difficulty.GetDifficultyPercent < 0.9)

but it got a compiler error.


texts: Multiple cameras using a single skybox with same perspective

texts:
I am using the enviro package for weather and to have a moving sun in the background. I'm building an installation with 3 screens and I want to have the sun track across the screens. However what I end up with is 3 separate skyboxes and 3 suns, one on each screen.

Is there a way I can have the cameras share a single skybox?


texts:
When I read about how to get the direction vector in raycasting, for example on this site: http://www.daimi.au.dk/~trier/?page_id=98

They first render the mesh with front face culling and then with back face culling. And then subtract the backface from the front to get at a direction vector for each pixel.

But is this not to much work to get the direction vector, is it not more simpler and faster to just take the vertex position(in world coordinates) and subtract the camera position in the fragment shader to get the direction vector? This should give the exact same answer but we skip the backface and frontface rendering.


texts: Why doesn't JavaScript's Math.cos function match this vector tutorial?

texts:
I'm following this MATHguide lesson on combining vectors and have reached this part:

Next, we need to convert their forces to horizontal and vertical components. Let's use k for Kim's vector and n for Noah's vector.
k = <30, 130°> = <30 cos 130°, 30 sin 130°> = <-19.3, 23.0>.
n = <40, 65°> = <40 cos 65°, 40 sin 65°> = <16.9, 36.3>.

To get the X part of Kim's vector, I run 30 * Math.cos(130), I get -11.018739913640896, which is not -19.3.
To get the Y part of Kim's vector, I run 30 * Math.sin(130) which is -27.903178505602853, which is not the 23.0 listed by the example.
Where did I go wrong?


texts: How can I create the water-like blur effect in Chameleon Run using SpriteKit and Unity?

texts: As the character in Chameleon Run runs, a water-like blur effect is created. I would really appreciate some guidelines on how I could create this effect in SpriteKit and Unity. Please see the image below.


texts:
I'm looking for a way to visually edit a libGDX scene. Some way to quickly build an example of a scene using a provided skin and default components, visually, and then export this definition to be used inside libGDX.
There is a way I can do this?
Note: I've looked at vis, but it's a scene editor, I need a GUI editing solution.


texts: How do I implement my old OpenGL-based gfx_render_triangle_list using DX11?

texts:
I am working at a game that has lots of procedural content. I had built a game engine using OpenGL that handles everything needed for creating a basic 2D game, sprites, primitives, blending, polygons etc. At a particular moment I decided to implement target textures to obtain interesting effects and problems started to arise: Sometimes the engine did not initialize OpenGL and GLEW properly and could not isolate the exception. Finally I abandoned the idea of using OpenGL because of similar issues (SOMETIMES cannot use newer GLEW functions...NOTE:drivers up to date). I decided to use DX11 instead and take benefit from the new technologies of the latest GPUs. So I did. Now I am porting my engine to DX11 and I am quite stuck.

I had procedures to be called in a render() function, like:
engine->gfx_render_triangle_list(pointer)
which in principle just called a procedure like

glBegin(GL_TRIANGLES);
...
glVertex2f(.....);
...
glEnd();

Now the problem that arises for me is the new pipeline of DX11. Load up vertices in the VertexBuffer, process them by the VertexShader then fill them with pixels and transform with the PixelShader. This is great as I have full access to what is being displayed on the screen, but, how do I do it the 'old-fashion' way?

I mean, how do I draw primitives like in OpenGL, each frame sending unique, new triangles to the screen. I didn't find any resources that explain this and I cannot think this through myself, loading some vertices in the vertex buffer is designed for meshes that are human made and static and they are only transformed by the shaders.

Long story short: How do I implement my old gfx_render_triangle_list using DX11?
NOTE: My engine will be used as a DLL.


texts: Are there any good tilesets for hex-based maps that are available for free use?

texts: Does anyone know of any good tilesets for hex-based maps that are available for free use? The tiles from Battle for Wesnoth seem to be under a license that would allow others to use them in their games, but the game I'm developing is on a scale where a hex would be about equivalent to the area that a person would stand on, whereas the Wesnoth tiles are on a larger scale (for example, there are forest tiles with multiple trees on the hex). Are there any other games or other sources that have hex tile graphics available?


texts: Weird windowed resolution - can't seem to change without changing the name

texts:
My game is windowed, and when I set the resolution in the build settings (960x540 - 16:9 - Windows standalone), and build it, it works as intended, but from then on, I can no longer change the resolution (can change it in the editor, and it also saves, but when I build it, it is still the original res (960x540))unless I change the Product Name as well. When I change the product name, I can change the resolution, build it, and it will change, but then it is stuck as well. When I change back to the first name, the resolution automatically change it the resolution for the first name (960x540) (it doesn't show up in the editor, only when you build it.)

So basically:

Name1
960x540

Name2
1280x720

Name3
1024x576

etc

So you can change the resolution every time you change the name and build it, and that name is stuck with that resolution (no matter what you change it to in the editor later). I am fairly new with unity, so am I missing something very basic here?

Thanks for any help!


texts: How to implement the interaction between engine parts?

texts:
I want to ask a question about how the information exchange between game engine parts should be implemented.

The engine is separated in four parts: logic, data, UI, graphics.
In the beginning I made this exchange through the flags. For example if the new object is added in the data, the flag isNew in a object's class will be set as true. And after that the graphics part of the engine will check this flag, and will add the object into the game world.

Though, with this approach I was to write much code to process every flag of each kind of object.

I thought of using some event system, but I don't have enough experience to know whether this would be the right solution.

Is the event system the only appropriate approach, or should I use something else?

I’m using Ogre as the graphics engine, if that matters.


texts: Getting "continuous collision detection"-like behaviour out of triggers

texts:
I have a particular scenario where I want to use a trigger to adjust the course of a fast-moving projectile, but am running into issues because Unity does not support continuous collision detection for triggers.
Imagine we have a thin wooden door. We want a bullet to be able to pass through the door, but the bullet's velocity should be reduced and trajectory altered when this occurs. We might put a trigger collider on the door, with some code like this:
void OnTriggerEnter(Collider other) {
    if (other.tag == "Bullet") {
         Rigidbody body = other.GetComponent<Rigidbody>();
         body.velocity = body.velocity * .75f;
         float maxRot = 45;
         float rx = Random.Range(-maxRot, maxRot);
         float ry = Random.Range(-maxRot, maxRot);
         Quaternion rotationChange = Quaternion.Euler(new Vector3(rx, ry, 0));
         body.velocity = rotationChange * body.velocity;
         transform.LookAt(transform.position + body.velocity.normalized);
    }
}

The problem is that Unity does not support continuous collision detection for triggers. If the bullet is moving fast, the trigger effect may not be applied until the bullet is well past the door (it seems to get applied a frame late), or the bullet may pass from one side of the trigger to the other without ever touching the trigger.

Changing the Rigidbody collision detection mode (e.g. "continuous", "continuous dynamic") has no effect on triggers. I've already tried every combination of collision detection modes on both the bullet and the door.
I'm hoping for a good workaround that does not carry a high performance cost. Solutions I've considered:

Increase the FixedUpdate frequency dramatically (expensive)
Use raycasts to simulate continuous collision detection (could get expensive with lots of bullets)
Use a thicker trigger collider on the door (helps, but does not eliminate the issue, and gives an inconsistent experience with different speeds of bullets)


texts:
I have a super class named Monster which implements Poolable. Then I got child classes which extends from the Monster class, but I can not figure out how I will use pool and maintain only one set of pool array.

Here is my current pool setup:

public class GameWorld {

    // Map
    private TmxMapLoader mapLoader;
    private TiledMap map;

    // Creatures
    private Player player;
    private final Array<Monster> activeMonsters = new Array<Monster>();
    private final Pool<Monster> monsterPool = new Pool<Monster>() {
        @Override
        protected Monster newObject() {
            return new Monster();
        }
    };

    public GameWorld(String path) {
        mapLoader = new TmxMapLoader();
        map = mapLoader.load(path);
        player = new Player();
        player.init("Player", this, new Vector2(5, 5));

        Monster firefox = Pools.obtain(Firefox.class);
        for (int i = 0; i <= 10; i++) {
            firefox.init("Firefox", this, new Vector2(8, 8));
            activeMonsters.add(firefox);
        }
    }

    public Player getPlayer() {
        return this.player;
    }

    public TiledMap getMap() {
        return map;
    }

    public Array<Monster> getMonsters() {
        Monster monster;
        int len = activeMonsters.size;
        for (int i = len; --i >= 0;) {
            monster = activeMonsters.get(i);
            if (monster.isVisible == false) {
                activeMonsters.removeIndex(i);
                monsterPool.free(monster);
            }
        }

        return this.activeMonsters;
    }
}


texts: How can I adjust the origin for 2D UI in OpenGL?

texts:
As I am quite used to screen geometry, where 0,0 is at the top left corner or the screen (as it is for just about every desktop app and Web app in the world), but I find it very hard to actually implement a UI in OpenGL since it's coordinate system is vertically inverted from what I have always worked with.

I'm trying to implement a GUI for a plugin for the game Rising World, and this is driving me crazy.

The added restriction that I have is that I do not have access to the actual screen resolution, but can only achieve full screen width and height using relative positioning and size (from 0 to 1). Sure, I can use pixels to position shapes and controls, but I cannot say, for example : place this at 50% - 20 pixels; it is either one or the other per shape.

I am Googling for things I can read about UI design with "inverted" Y coordinates (i.e. since we read from top to bottom, it is inverted to me), but I can't find anything relevant. And since I cannot use any third party GUI library but what the game is offering, I am restricted to basic shapes and positioning (i.e. doing things 100% manually).

Is there a way in this context that I can author my UI in a coordinate system where the origin is the top-left?


texts: Can I use SpriteBatch when drawing sprites on a rotating 3D plane

texts:
I'd like to have my plane of sprites rotate similarly as in this game (YouTube Video). So basically, everything is drawn in 2D, but the 2D plane is then "rotated in 3D" (or camera is rotated). When rotated, sprites further away should look like they are further away.

Question:

Can I use SpriteBatch with this? IIRC SpriteBatch uses Orthographic view matrix, so probably not? If I can, how? If not, how would you suggest I draw the sprites?

PS. I am really bad at explaining problems so feel free to ask any questions.


texts:
I wanted to understand - Is there a way where we can verify if certain image is 3D or not
So basically I want to automate the process where we can detect if certain given image is of 3D or not
Problem: In my application - I often detect few 3D images are showing as plain black image or sometimes 3D images are broken
So if I can find a way where I can check that certain image should not be completely black and should be 3D model and not 2D image
My Application is in C# - but I am open for any solution irrespective of language!!
Thanks in advance


texts: Applying scale to objects appears to have little effect when close up.

texts:
I just started out with D3D 11. My goal is to write a cube voxel engine (Minecraft style). Actually it's working pretty solid already, but when I finally tried to change the size of my cubes, I ran into a problem:

No matter how large I make my cubes, they always appear super large when I move very close to them. Although they appear in a different size when I declare them in a different size and look at them from the same absolute distance.

For example: Let's say I make my cubes have a width, height, and depth of 1.0, and another time I give them a width, height, and depth of 0.01, and both times I look at them from a distance along the z axis of -1.0. The 1.0 cubes look larger than the 0.01 cubes. But I think this is only because the "relative" distance (100 cubes vs 1 cube) is a lot larger. The problem is, when I move very close to my 0.01 cubes, they become just as large as my 1.0 cubes with the front side filling almost the entire screen. I am very confused right now, since I have no clue as to how I can make my cubes appear smaller when I get very close to them. The problem is, the smaller I make my cubes, the closer I have to be able to get to them in order to make them appear as if they were right in front of me, which always results in huge cubes. Can anybody please help me figure out how to make my cubes appear smaller?

I don't know if this matters, but here is how I make my cubes:

1) Create a mesh for each chunk of voxels. In this process, I already define my vertices in world coordinates taking into account the cube size that I want (this is working, I printed out my vertex data with different cube sizes).

2) When rendering, each frame, I take the view projection matrix from my camera and send it to the shader. My vertex shader then simply does the following to my world coordinate vertices:

vout.pos = mul(float4(vin.pos, 1.0f), vpMatrix);

I also made some screenshots to show my problem. I just made a simple 32x3x32 map with different textures at each height.

1) Cube size 1.0, distance 10.0:

2) Cube size 0.1, distance 10.0:

3) Cube size 1.0, close distance:

4) Cube size: 0.1, close distance:

As you can see, at a distance of 10.0, the size difference is noticeable. But the closer I get, the less the size difference appears. A cube size of 0.1 at a close distance is still way too large. Almost as large as a cube size of 1.0 (which should be 10 times bigger?). I can go lower and lower on the cube size, but it just stays way too big at close range. And at some point, I can't go any lower. So, is there a way to make my cubes at a close distance look just a little bit bigger than the cubes seen in the second picture (cube size 0.1 at distance 10.0)?

Here is another screenshot of a more complex "map" proving, that I should actually be rendering stuff correctly:


texts: How do I show a Quit button on Desktop but don't show it on Android with libgdx?

texts:
So I would like to display a Quit button on the Desktop main menu screen, but I wouldn't want to have it on Android too. What is the correct approach to achieve this? Do I have to check the ApplicationType of the app each time I want to display something different on the two platforms, or is there a more general approach maybe?

The same question is valid for text for example.
Say, on Desktop it should say "Click to continue" whilst on Android - "Tap to continue".

To mention that both projects (Desktop and Android) share the same main project, since they have been created using the gdx-setup-ui tool.

Thank you.


texts: How to bounce a 2d point particle off of a circular edge

texts:
In a prototype I'm building, a particle can spawn anywhere within a larger, confining circle. Important to note is that the particle will not spawn in the origin of the larger circle, but anywhere within it.

This particle will essentially be given a random x and y velocity and set on it's way.

When the particle hits the edge of the confining circle, I want it to bounce back inwards appropriately.

Unfortunately I'm extremely new to vector math, and have never really directly dealt with it before.

Given that I'm treating the particle as a point, and I don't care about any loss of force or friction, what should I ultimately do to the particle's x and y velocities after the bounce?

I will know the particle's x and y velocity, it's x and y coordinate when it hits the outer circle, the radius of the outer circle, and the x and y coordinates of the origin of the outer circle (since its origin will likely not be 0,0).

My brief research on vector math tells me I need to find the normal velocity at the point where the particle hits the outer circle and then negate that, but unfortunately I'm not sure how to do that exactly.


texts:
I'm trying to figure out a way to determine the force two objects collide in.

I have two vectors defining their linear velocity at the time of impact, their mass and their angular velocity. Keep in mind this is all for a 2D physics engine.

I don't think it's as simple as adding up these values and figuring out if it's large enogh it makes a large impact since that doesn't take into account if the two objects are travelling in the same direction (as an example).

Any ideas?


texts:
How to make unlit node cast shadows?
Is is possible with the current state of Shader Graph in LWRP?

In this great article Toon Shader OP grabs pass from VertexLit shader. Is something similar achievable with Shader Graph?


texts: Detect if square in grid is within a diamond shape

texts:
So I have a game in which basically everything is a square inside a big grid. It's easy to check if a square is inside a box whose center is another square:

*** x
*o*      --> x is not in o's square
***

**x
*o*      --> x IS in o's square
***

This can be done by simply subtracting the coordinates of o and x, then taking the largest coordinate of that and comparing it with the half side length.

Now I want to do the same thing but check if x is in o's diamond, like so:

  *
 **x
**o**    --> x IS in o's diamond
 ***
  *

What would be the best way to check if a square is in another square's surrounding diamond-shaped area, given the diamond's half width/height?


texts: Playing Multiple Sound effects isssue in cocos2d-x

texts:
Please help if someone faced this issue. I have a sound effect 3sec long which need to be played repeatedly for some time of 10 to 15 secs. Implemented like below:
SimpleAudioEngine::sharedEngine()->playEffect(powerUpSound, true);

But when I play an another sound effect, previous sound (powerUpSound) effect stops.
SimpleAudioEngine::sharedEngine()->playEffect(starsSouns, false);

Any help will be appreciated. Cocos2d-x v2.2.3


texts: How do you setup the Irrlicht and Bullet engines for Android development?

texts:
I have begun researching graphics and physics engines to use for an Android 3d game that I would like to make.

While researching I stumbled across this page where he talks about how you can use the Irrlicht graphics engine and the Bullet physics engine for Android development.

I have a few questions about this

Will these engines work for Android like he says?
Are these good choices for open source engines on Android?
What does he meen when he says, "Then we put all the C/C++ source codes under the jni folder". What is the jni folder? Should this go under the src folder?


texts: How to apply Ackermann steering without wheel colliders?

texts:
I want to implement steering, have torque force, acceleration force but I am considering whether apply wheel colliders or not with Ackermann steering
I notice with only torque to rigidbody the car turns but slides non realistically
want sth like Arcade Car Physics https://github.com/SergeyMakeev/ArcadeCarPhysics
here steering is a bit too much but it smoothly steers no slides except of drifting
and also I want no jumps so I think the suspension is not needed

my code car controller

using Rgn;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class CarCtrl : MonoBehaviour
{
    private Rigidbody rb;

    public float horizontalInput;
    public float verticalInput;

    public float steerAngle;

    public List<Transform> Wheels;

    [Header("input")]
    public float steerInput;

    public float turnSpeed = 10f;

    public float maxSteerAngle = 30f;
    public float engineForce = 20;

    public const int topSpeed = 300;

    private TextMeshProUGUI speedText;

    private float speed = 0.0f;

    public void GetInput()
    {
        horizontalInput = Input.GetAxis("Horizontal");
        verticalInput = Input.GetAxis("Vertical");
    }

    private void Steer()
    {
        var dt = Time.deltaTime;
        steerAngle = maxSteerAngle * horizontalInput * dt;
        var smoothedSteering = Mathf.Lerp(0.0f, steerAngle, 10);
        var turnForce = transform.up * turnSpeed * steerAngle;
        // Debug.Log(turnForce);

        Wheels[0].Rotate(transform.forward * -1, steerAngle);
        Wheels[1].Rotate(transform.forward * -1, steerAngle);

        rb.AddRelativeTorque(turnForce, ForceMode.Acceleration);
    }

    private void Accelerate()
    {
        // speed in m/s
        speed = rb.velocity.magnitude;
        var force = transform.forward * -1 * engineForce * verticalInput;
        var speedKph = Car.MpsToKmh(speed);
        if (speedKph < topSpeed)
        {
            var speedtxt = speedKph.ToString();
            rb.AddForce(force, ForceMode.Acceleration);
            speedText = (TextMeshProUGUI)FindObjectOfType<TextMeshProUGUI>();
            speedText.text = $"speed: {speedtxt} kmh";

            rollWheels();
        }
    }

    private void FixedUpdate()
    {
        GetInput();

        Accelerate();

        Steer();
    }

    // Start is called before the first frame update
    private void Start()
    {
        //stop rotating
        Destroy(GetComponent<Turn>());

        var car = new Car("make", "model");
        print(Car.AckermannLeft(2, 2, 10));

        this.gameObject.transform.Translate(-30, 0, 0, Space.World);

        rb = GetComponent<Rigidbody>();

        rb.useGravity = true;
    }

    private void rollWheels()
    {
        var angle = engineForce * verticalInput;
        foreach (var wheel in Wheels)
        {
            wheel.Rotate(Vector3.right, angle);
        }
    }
}


texts: How common are game engine bugs, and can I claim damages for them?

texts:
Are game engine bugs (in popular ones like Unreal and Unity, not some unknown ones) common? I know engines like Unreal, Source and Unity3D are well tested and maintained, but, for example, is there any threat like: I create a game, the engine programming is fine, so is everything I do, but I get a bug in the game because of a bug in the engine?

And as most of you guys here are game developers, has any one had such an experience? Also, can I take legal action on the creators of that engine incase I am under loss because of their bug?


texts: What scripting language would you recommend for a C++ game project?

texts:
By scripting here I mean not just putting config data in a script, but scripting parts of the project like some class methods, test specific game loop, etc. This would be not just to accelerate development, but also allow players to see some of these scripts to tweak some aspects of the game.

Some language like Lua have some wrappers like luabind, but when I've used it in the past it had problems because it didn't support method redefinition in a context of inheritance.

What are your suggestions of language / wrappers to use or not to use?


texts: How do I represent projectiles in a video game?

texts:
I'm making a simple fixed shooter game, similar to "Galaga",) as part of a presentation I'm doing. I'm wondering what strategies and data structures would people use for tracking projectiles, like lasers fired from the spaceship.  A super simple implementation that I've used, before, is to just represent each projectile as a point, and check for collisions with all objects in the scene.

However, this seems costly, in large scenes with many projectiles; I'm wondering what other types of strategies or implementations are used for this type of use case.  What do games like FPS use for tracking projectiles (bullets, tank shells, etc)?


texts: Writing a dynamic achievement system without hardcoding rules into the application

texts: I really enjoyed the solution provided here for groundwork on writing an achievement framework. The problem I have is I have game designers that would like to be able to insert achievements into a CMS at runtime. In a way, it sounds insane and complex to do this, but is it really? I think the concept of having to do a hard push of the application for every new achievement is cumbersome. I would love to be able to give our designers the capability to put together new achievements by entering them into a database. It shouldn't matter what tool I'm using, but for those interested, my backend is being written in JRuby (Ruby on top of the JVM). What are some possible ways of going about abstracting the logic in the aforementioned link even further so that rules can be interpreted at runtime?


texts: Rotate sprite along the angle between two objects

texts:
Im trying to make flames follow my object, I set the direction for my moving object using the points between it and another object (using static destination for testing).

No matter what I do I cannot use the radians (which I use to set the direction), translate them to degrees, then rotate my flames so it looks like they are following it (like a comet).

What I try:

sprite.setPosition(pos.x, pos.y);
radians = Math.atan2(0 - pos.y, 540 - pos.x); //set radians
degrees = radians * 180 / MathUtils.PI; //calculate degrees
fireSprite.setPosition(sprite.getX(), sprite.getY());
fireSprite.setRotation((float)degrees); //rotate according to degrees

I move the object like this:

pos.x += 200 * Math.cos(radians) * delta;
pos.y += 200 * Math.sin(radians) * delta;

Am I missing something in the math? I feel like it should work.

An example of result from calculations:

radians: -1.8745297149164084, degrees: -107.4026382478209
radians: -1.1776894171295331, degrees: -67.47663130103584
radians: -2.1756410640936705, degrees: -124.65504723907603
radians: -1.2244578042111383, degrees: -70.15626242087843

The flames face the wrong direction, and not in a any sort of pattern I can use to debug my problem.


texts:
I have two images of the same dimensions.
One is represents the game board in a user-appealing way, the other represents it in a computer-friendly way where each game area is painted in a unique, uniform color.
When the user clicks the board, we get the click coordinates, find the color of the pixel at the same coordinates in our second image, and that color is directly translatable to a game area, since each area is painted in its own color.

Is that a good implementation? Can you suggest better, if it isn't?

Best regards.


texts: How to keep my Quaternion-using FPS camera from tilting and messing up?

texts: I am using an FPS-like camera, and it uses quaternions. But, whenever I try looking up and then sideways, it tilts, and sometimes it can turn upside down. How can I fix this?


texts: Capitalizing on JavaScript's prototypal inheritance

texts:
JavaScript has a class-free object system in which objects inherit properties directly from other objects.  This is really powerful, but it is unfamiliar to classically trained programmers. If you attempt to apply classical design patterns directly to JavaScript, you will be frustrated. But if you learn to work with JavaScript's prototypal nature, your efforts will be rewarded.
...
It is Lisp in C's clothing.
-Douglas Crockford

What does this mean for a game developer working with canvas and HTML5?  I've been looking over this question on useful design patterns in gaming, but prototypal inheritance is very different than classical inheritance, and there are surely differences in the best way to apply some of these common patterns.
For example, classical inheritance allows us to create a moveableEntity class, and extend that with any classes that move in our game world (player, monster, bullet, etc.). Sure, you can strongarm JavaScript to work that way, but in doing so, you are kind of fighting against its nature.  Is there a better approach to this sort of problem when we have prototypal inheritance at our fingertips?


texts: Move an object towards a point relative to its position

texts: I am attempting to move an object a set distance in a direction relative to the objects current position. In other words I want the object to move to whatever point is 144 pixels below the object, and then stop moving. How can I do this?


texts: Better data structure for a game like Bubble Witch

texts:
I'm implementing a bubble-witch-like game (http://www.king.com/games/puzzle-games/bubble-witch/), and I was thinking on what's the better way to store the "bubbles" and to work with. I thought of using graphs, but that might be too complex for a trivial thing. Thought of a matrix, just like a tile map, but that might get too 'workaroundy'. I don't know.

I'll be doing in Flash/AS3, though.

Thanks. :)


texts:
I have been trying to load this custom FX file into a Monogame project, and everything I try fails.  (code taken from http://www.david-gouveia.com/scrolling-textures-with-zoom-and-rotation/)

sampler TextureSampler : register(s0);
float2 ViewportSize;
float4x4 ScrollMatrix;

void SpriteVertexShader(inout float4 color : COLOR0, inout float2 texCoord : TEXCOORD0, inout float4 position : POSITION0)
{
   position.xy -= 0.5;

   position.xy = position.xy / ViewportSize;
   position.xy *= float2(2, -2);
   position.xy -= float2(1, -1);

   texCoord = mul(float4(texCoord.xy, 0, 1), ScrollMatrix).xy;
}

technique SpriteBatch
{
    pass
    {
        VertexShader = compile vs_2_0 SpriteVertexShader();
    }
}

If I convert it to an XNB file, and attempt to load it via the Content processor, it says "Could not load asset!", indicating that the file cannot be found.  The XNB file is there along with the rest of the content, it is just not being loaded.

Next, I compiled the FX files into a MGFX file using 2MGFX.  I included the MGFX files as an embedded resource and attempted to load the file by doing:

Effect test = new Effect(GraphicsDevice, Properties.Resources.parallax);

This crashed at Effect.cs saying argument out of range error.

What do I need to do to use this shader in Monogame?


texts: Unity 5.6 - Where have Sun Shafts disappeared to?

texts:
I've just upgraded to Unity 5.6 from 5.4. I need to add some Sun Shafts to my camera but I cannot find the script anywhere.

I've looked in the docs, I've looked in the menu's but I can't locate them.

Has anyone else had this problem at all?


texts: How many triangles should I expect to be able to render in a second?

texts:
Assuming that I'm doing everything right and all I'm doing when I render my scene is going through all the vertex arrays that I want to render, how many triangles should I expect to be able to render compared to the FLOPS of the GPU I am using?

In my particular case, I'm trying to asses if my OpenGL pipeline is entirely crap or somewhat decent. This requires benchmarks but also something to actually benchmark against.

My benchmark machine is based on a Ryzen 5 2400GE with an onboard Vega 11 GPU that has a Tpeak performance of 1.746 TFLOPS for 32 bit floats[1].

On my benchmark machine I am able to push about 33000000 triangles per second, with a vertex shader that does one 4x4 matrix multiplication and a fragment shader that simply sets a colour. The triangles are defined using vertex with a 3d position, a 2d texture coordinate (unused in this benchmark, but still part of the data) and an RGB colour. This result is based on rendering VBAs with 40000 triangles, 500 times per frame. Rendering a frame takes about 0.5 seconds.

[1] https://www.techpowerup.com/gpu-specs/radeon-rx-vega-11.c3054


texts: Looking for some insight on programming design for attacking and attack types in a game

texts:
So, I'm starting to introduce attacking to our 2D space RTS (This is in Unity, so it's component driven). Initially it was as simple as "enemy in range, damage applied". However there will be multiple "types" of weapons/attacks that are associated with their particular ship or structure. As well as other factors involved past just raw damage such as the damage type, and possibly inertia in the future.

Would you guys have each unit and structure type have it's own attacking type. Meaning you make a script for each unit/structure that defines it's attack type, damage, effects, range, particles, sprites...etc And attach that as a component?

Or make a script that defines an attack type, a script for the projectile type associated with that...etc And then extend those and modify those for each unit, attaching each script to the unit/structure.

I hope I'm making some sense, I've been pondering this for so long I'm not sure if I'm solving a problem, or just making up my own problems and digging myself into a hole.

When you have a game that can have a multitude of attack types that may or may not be limited to a specific unit/structure, how do you design the framework that tied that together to the specific units/structures in a component-driven design environment?

If this is not clear enough let me know.

Edit: Great answers, thank you.

Expanded Question:

The answers seem to vary from "each object can have it's own attacking script" to "Have the attack types as their own scripts and assign that to each object for a more reusable solution". Lets say I have a "blaster" attack, it shoots a red projectile at a certain speed. It's damage, rate of fire, and projectile size are dependent on the unit firing it. Is it better to just make an attack script for that unit, or try and modify a "blaster attack" to fit the purpose of each unit that wants to use it?


texts:
i have a problem with my code. When I add a button to change the screen, a crash occurs or takes a long time to convert to the other screen, and this is my code

private Base_Actor background;
private Button button;
private Skin skin;
private Texture texture_1;

public test(Game g) {
    super(g);
    this.game = g;
}

@Override
public void create() {
    skin = new Skin();
    background = new Base_Actor();
    background.set_Texture(new Texture("sky.p_n_g"));
    background.set_Position(0,0);
    main_Stage.add_Actor(background);

    texture_1 = new Texture("pause_button.p_n_g");
    skin.add("pause_Image",texture_1);
    Button.Button_Style style_1 = new Button.Button_Style();
    style_1.up = skin.get_Draw("pause_Image");
    button = new Button(style_1);
    button.set_Position(570,410);
    branch_Stage.add_Actor(button);
}

@Override
public void update(float delta_time) {
    button.add_Listener(new Click_Listener(){
        public Boolean touch_Down(Input_Event event, float x , float y, int pointer, int button){
            ((Game) G_d_x_app_get_Application_Listener()).set_Screen(new menu_Test(game));
            return false;
        }
    });
}

}

and this the screen class

protected Game game;
protected Stage main_Stage;
protected Stage branch_Stage;

public final int view_Width = 640;
public final int view_Height = 480;

private Boolean paused;

public Base_Screen(Game g){
    this.game = g;

    main_Stage = new Stage(new Fit_View_port(view_Width,view_Height));
    branch_Stage = new Stage(new Fit_View_port(view_Width,view_Height));
    paused = false;
    Input_Multiplexer m = new Input_Multiplexer(this,branch_Stage,main_Stage);
    G_d_x_input_set_Input_Processor(m);
    create();
}
public abstract void create();
public abstract void update(float delta_time);

public void render(float delta_time){
    branch_Stage.act();
    if (!is_Paused()){
        main_Stage.act();
        update(delta_time);
    }
    G_d_x_g_l_g_l_Clear_Color(0,0,0,1);
    G_d_x_g_l_g_l_Clear(G_L_20_G_L_COLOR_BUFFER_BIT);
    main_Stage.draw();
    branch_Stage.draw();
}

public Boolean is_Paused() {
    return paused;
}

public void set_Paused(Boolean b) {
    this.paused = b;
}
public void toggle_Paused(){
    paused = !paused;
}
public void resize(int width,int height){
    main_Stage.get_View_port().update(width,height,true);
    branch_Stage.get_View_port().update(width,height,true);
}
public void pause(){}
public void resume(){}
public void dispose(){}
public void show(){}
public void hide(){}
public Boolean key_Down(int key_code){return false;}
public Boolean key_Up(int key_code){return false;}
public Boolean key_Typed(char c){return false;}
public Boolean mouse_Moved(int screen_X,int screen_Y){return false;}
public Boolean scrolled(int amount){return false;}
public Boolean touch_Down(int screen_X,int screen_Y,int pointer, int button){return false;}
public Boolean touch_Dragged(int screen_X,int screen_Y,int pointer){return false;}
public Boolean touch_Up(int screen_X,int screen_Y,int pointer, int button){return false;}

}


texts: How do the PhysWalking and similar functions actually handle input?

texts:
As the title may suggest, I'm developing a CustomMovementComponent and I'm on the stage where I am developing my own PhysCustom function.

As such, I am trying to copy the style of Epic's development for these functions.

One thing that has bewildered me thus far is how these functions : PhysWalking, PhysFalling etc actually handle input.

I understand that they work based on time steps but where in these functions is the input actually taken into account?

Thanks


texts: Unable to manipulate Imported Object menu (Unity)

texts:
I've imported a model, but for some reason I can't edit any settings under the Imported Object menu, such as the Mesh Filter or the Mesh Renderer.

See this: http://i.stack.imgur.com/t7ZYR.png for a screencap.


texts: Rotate an existing quaternion around an axis?

texts:
I have an existing quaternion (Java Quat4f). I would like to rotate this quaternion around an axis (i.e. 90 degrees around the x axis, 25 degrees around the y axis, 10 degrees around the z axis, 180 degrees around the y axis, etc.)

How can I rotate the existing quaternion around an axis?

Thank you!


texts: How can I set the duration of a splash screen?

texts:
I am using Unity Pro, so I have all Splash Screen Tools available.  I have a full screen image which I want to use as my splash screen.  I want my splash screen to remain on the screen for n seconds.  I want the splash screen to be cropped if it is not a perfect fit to the device's screen size.

The following settings give me the desired results, however the splash screen only stays up briefly, and does not allow me to choose the duration:

These settings allow for me to set the duration, however the splash screen is just an icon in the middle, and won't "Scale to fill (cropped)", like in the settings above:

I can use a blank image as my logo and add a background image, but it becomes all blurry.  (The darkness goes away if as I change the overlay opacity.):

I have tried other variations in the settings, but the three attempts above are the closest I have come.  I have tried removing the splash screen, and creating an empty Scene on launch with just the full-size cropped image, but this causes a delay to launch the app with a bad white flicker.  I have tried using the static splash screen settings in addition to the blank starting scene, but this causes the screen to go black momentarily.

How can I use a full-screen cropped Splash Screen for a set duration?


texts: How to encrypt Save Files without using a key?

texts:
Say I made a simple program that takes a file .dat that is encrypted in Binary Format, then I decrypt it into a byte array and then everything is rewritten again into the file decrypted.

For Example:

I've made a binary encryption algorithm. => 0100100001100101001000000110100001100101011000...

But this is very very easy to decrypt...

Is there any way, that, if it's possible does not need any sort of key, to encrypt my save progress?


texts: Correct method for choosing the user's video cards?

texts:
My game uses DirectX 10, and I'm having a problem where users are reporting that my game isn't picking up on their graphics card. Instead it prefers to run on their integrated Intel card, ruining performance. It's possible that this is related to Windows 8. It could also be related to mobile cards.

Until now, I've been creating the DirectX 10 device with no adapter specified (as I've seen in all the examples/demos so far), to allow DirectX to choose its own adapter. Apparently I'm going to have to change that.

I already have a function which runs through all of the available adapters, and chooses the one with the highest amount of dedicated memory. That works great for correcting the problem, but is it correct in general?

Unfortunately, I cannot rely on the card having valid video output (i.e: a monitor hooked up) as the machines affected by this problem report no outputs for the desired card.

What algorithm can I use to properly choose which adapter to use with DirectX?


texts: How can I teleport seamlessly, without using interpolation?

texts:
I've been implementing Bukkit plugin for creating toggleable in-game warping areas that will teleport any catched entity to other similar area.

I was going to implement concept of non-Euclidean maze using this plugin, but, unfortunately, I've discovered that doing Entity.teleport() causes client to interpolate movement while teleporting, so player slides towards target like Enderman and receives screen updates, so for a split second all underground stuff is visible.

While for "just teleport me where I want" usage this is just fine, it ruins whole idea of seamless teleporting, as player can clearly see when transfer happened even without need to look at debug screen.

Is there possibility to somehow disable interpolating while teleporting without modifying client, or maybe prevent client from updating screen while it's being teleported?


texts: When I use rigidbody.move rotation, my player sinks

texts:
I am trying to implement a simple movement on an object and when I use movePosition from rigid body, the player starts to sink:

How can I resolve this issue?
Below is my code.
void Update()
{
    Movement();
    MouseLook();
}

void MouseLook()
{
    //get X movement of mouse and save as float y
    //get Y movement of mouse and save as float x
    float _xMove = Input.GetAxis("Mouse Y") * mouseSensetivity * Time.deltaTime;
    float _yMove = Input.GetAxis("Mouse X") * mouseSensetivity * Time.deltaTime;

    //make vector of that movements
    Vector3 xLook = new Vector3(_xMove, 0f, 0f);
    Vector3 yLook = new Vector3(0f, _yMove, 0f);

    //apply Y vector to body and rotate it entirely
    _rigidBody.MoveRotation(_rigidBody.rotation * Quaternion.Euler(yLook));
    //apply X vector on camera to rotate it.
    _camera.transform.Rotate(-xLook);
}
void Movement()
{
    //Vector3 move = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
    //_charController.Move(move * Time.deltaTime * WalkSpeed);

    //register x axis movement
    //register y axis movement
    float _xWalk = Input.GetAxisRaw("Horizontal");
    float _zWalk = Input.GetAxisRaw("Vertical");

    //Make vectors
    Vector3 _WalkSum = (transform.right * _xWalk + transform.forward * _zWalk).normalized;

    //feed this to Move position of rigid body
    if (_WalkSum != Vector3.zero)
    {
        //_rigidBody.velocity=transform.forward+_WalkSum;
        //_rigidBody.AddForce(_WalkSum*WalkSpeed);
        //_rigidBody.MovePosition(_WalkSum);
        _charController.Move(_WalkSum * WalkSpeed * Time.deltaTime);
    }
}


texts: C++ OpenGL / SDL2 VBO -- Depth problem / Transparency

texts:
I got a problem with my VBO.
When having textures. The far blocks overlay the near ones.

I tried editing the alpha, depth buffer, the VBO byte allocation.
Nothing works for me...

The FAR plane is overlapping the NEAR plane.

    //Alpha
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glEnable(GL_CULL_FACE);
glDisable(GL_MULTISAMPLE);

glDepthMask(GL_TRUE);


texts: Separating Game Engine from game code in similar games, with versioning

texts:
I have a finished game, that I want to decline in other versions. These would be similar games, with more or less the same kind of design, but not always, basically things might change, sometimes little, sometimes big.

I would like the core code to be versioned separately from the game, so that if say I fix a bug found in game A, the fix will be present in game B.

I am trying to find the best way to manage that. My initial ideas are this:

Create an engine module/folder/whatever, that contains everything that can be generalized and is 100% independent from the rest of the game. This would include some code, but also generic assets that are shared among games.
Put this engine in its own git repository, which will be included in the games as a git submodule

The part I am struggling with is how to manage the rest of the code. Let's say you have your menu scene, this code is game-specific, but also most of it tends to be generic and could be reused in other games. I can't put it in the engine, but re-coding it for each game would be inefficient.

Maybe using some sort of git branches variation could be effective to manage that, but I don't feel like this is the best way to go.

Anyone has some ideas, experience to share or anything about that?


texts: How to change render states only when necessary?

texts:
Earlier, I have been setting render states (shaders, shader resources, etc.) without checking if it is really necessary. Maybe they had been bound earlier and I could use them without setting them again.

So now I am checking for currently set render state before setting it. If there is a mismatch, then I set it. Setting a pixel shader for example:

typedef ID3D11DeviceContext*        DeviceContext;
typedef ID3D11PixelShader*          PixelShader;

inline static void BindPS(PixelShader shader, DeviceContext context){
    if(context!=nullptr){
        PixelShader s;
        context->PSGetShader(&s,nullptr,0);
        if(s!=shader)
            context->PSSetShader(shader, nullptr, 0);
        if(s!=nullptr)
            s->Release();
    }
}

I wonder if it is a welcome practice to get current render state from the device context context so often, or should I roll my own solution for checking them? Keeping pointers for currently bound states for example and checking with those?

I ask this now, because I only started implementing this for some states (PSSetshader and PSSetShaderresources), and I have a lot more, so I would opt-out early if this method could be problematic.


texts: How can I make natural rain drops on screen?

texts:
I'm trying to make rain effect drop with metaballs and trail on screen.I find a clue in shadertoy but I didn't understand how implemented:
https://www.shadertoy.com/view/ltffzl
unfortunately it have many math calculations and i can't use it in unity because it produces a lag.obviously I should use textures but how can I have trail effect?!

my idea is using a texture and trail renderer for droping but how can I have metaballs effect?

Update
I could Implement Metaballs by This Article
https://github.com/smkplus/RainFX/tree/master
but I haven't Idea about trail


texts: I'm having resolution issues; does my math suck?

texts:
There are a lot of scripts involved so I'm just going to give a generalized description of the process.

First, a 1x1 square tile is created. Second, that tile is placed out of the way, and 16 x 10 (160) new tiles are created starting at the (0,0) position and building outward in positive numbers. Now, the camera is a 16:10 display.  At this point, I wanted to scale up the tiles. If I want to scale the map up I start by scaling the camera by 100, and then I scale the tiles, and align their position (edge to edge).  At this point, scaling the tiles by 100 seems logical, but that didn't work correctly, for some reason. Scaling by 50 almost works, but the resolution is no longer a 16:10 grid like it was before the scaling.

What am I doing wrong?  I am using Unity.