texts:
I've been working on a world builder project recently and I've finished most of the work but there is just one thing I can't think of how to do.

For example in a strategy game's world builder when you want to save a map and click the save button a window pops up and you can enter a name you want and save the map with that name, or overwrite a map you can chose by clicking one of the pre-saved maps in the list in the window. Or load a map again by clicking a map name in a load window.

How can I render a text while I'm writing it with SDL 2.0.3(when you're saving a map you need to see the name you give) and save that file with that name and also show other save files' names in a list?Is there a way to do it with SDL_ttf library or should I use bitmapfonts?

How can I decide if I want to overwrite a map or create a new one (I need to overwrite a map when it's name is clicked and create a new one when the bar to write the new map's name is clicked)?

In the load menu how can I load the specific save file I've chosen?

And just one more question: I'm currently writing the save data in a .txt file, is there a better way of doing that that you suggest?

I'm using SDL with C++.

Thanks.


texts: How to stretch Movie Clip according to user's touch coordinates?

texts:
I have code like this:

touchX = e.stageX;
touchY = e.stageY;

I also have a player movieclip that I'm trying to make shoot lasers.  So I got the MovieClip to appear and rotate according to the player's location and the user's touchX and touchY.  How do I make the laser MovieClip stretch according to the distance between the player's coordinates and the touchX and touchY coordinates?


texts: Mixing sprite drawing with 3D primitive drawing in XNA?

texts:
In my game, I have a base Note class, and various subclasses of Note. In addition, I have a NoteCollection class which contains a collection of these Note objects and draws them to the screen. Normally, I'd just do something like this in NoteCollection:

public override Draw(GameTime gametime) {
    ...
    spriteBatch.Begin(...);
    foreach(Note n in notes)
        n.Draw(gameTime);
    spriteBatch.End();
    ...
}

However, some of these Note subclasses also need to draw 3D primitives in their Draw() methods. I imagine setting vertex buffers in the middle of a SpriteBatch Begin()/End() block isn't a good idea (I've tried it, anyways). What would be nice would be a SpriteBatch.Pause() method that would save the state of the SpriteBatch, and then you could resume drawing your sprites with, say, a SpriteBatch.Resume(). But alas, there's no much methods.

In short, is there any way to go about this? I'd rather not call SpriteBatch.End()/Begin() from each Note.Draw(), as it'd be really slow and I wouldn't necessarily know what parameters the original outside Begin() was called with.

EDIT: Even though I'm using 3D primitives, my game is still in 2D. All of the Z-coordinates of my vertices are 0.


texts:
I used the Möller-Trumbore algorithm. That seemed to work for a while but I found a bug:

const glm::vec3 avert0 = glm::vec3(-0.13f, 0.01f, 0.0f);
const glm::vec3 avert1 = glm::vec3(-0.01f, 0.01f, 0.0f);
const glm::vec3 avert2 = glm::vec3(-0.13f, 0.1f, 0.0f);

const glm::vec3 start = glm::vec3(-0.1f, 0.05f, -1.0f);
const glm::vec3 end = glm::vec3(-0.1f, 0.05f,    1.0f);

rayIntersectTriangle(start, end, avert0, avert1, avert2, position);

The above code does not collide ( u is < 0 ). However, if I change the Z value of the end vector from 1 to 30, it works:

 const glm::vec3 end = glm::vec3(-0.1f, 0.05f,    30.0f);

Here is my implementation:

bool Node::rayIntersectTriangle(glm::vec3 orig, glm::vec3 dest
              , glm::vec3 vert0, glm::vec3 vert1, glm::vec3 vert2
              , glm::vec3 &result)
{
const glm::vec3 edge1 = vert1 - vert0;
const glm::vec3 edge2 = vert2 - vert0;
const glm::vec3 pvec = glm::cross(dest, edge2);
const float det = glm::dot(edge1, pvec);

static const float Epsilon = std::numeric_limits<float>::epsilon();

/*
   If det is below zero, we are back facing the triangle.
   If det is close to zero we are missing the triangle.
*/
if (det > -Epsilon && det < Epsilon)
  return false;

const float invDet = 1.0f / det;

const glm::vec3 tvec = orig - vert0;

result.x = glm::dot(tvec, pvec) * invDet;
if (result.x < 0.0f || result.x > 1.0f)
  return false;

const glm::vec3 qvec = glm::cross(tvec, edge1);

result.y = glm::dot(dest, qvec) * invDet;
if (result.y < 0.0f || result.x + result.y > 1.0f)
  return false;

result.z = glm::dot(edge2, qvec) * invDet;

return true;
}


texts:
In all tutorials I found about creating projection matrix based on viewport size all of them assumed that left bottom coordinates of viewport will be (0,0).

Now I want to draw to the different parts of the screen and for that purpose I want to switch viewports accordingly:

glViewport(0,0,windowWidth/2, windowHeight/2); //left bottom
glViewport(0,windowHeight/2,windowWidth/2, windowHeight/2);//left top
glViewport(windowWidth/2,0,windowWidth/2, windowHeight/2);//right bottom
glViewport(windowWidth/2, windowHeight/2,windowWidth/2, windowHeight/2);//right top

Now I have a problem with defining my projection matrix. Without having any (x,y) offest I was using this code for calculating my ortho projection matrix:

float m_fWindowSize = 15.0f;

if (m_WindowWidth > m_WindowHeight)
{
    auto viewportAspectRatio = (float)m_WindowWidth / (float)m_WindowHeight;

    m_ProjectionMatrix.m_fLeft = (-1.0f) * m_fWindowSize * viewportAspectRatio;
    m_ProjectionMatrix.m_fRight = m_fWindowSize * viewportAspectRatio;
    m_ProjectionMatrix.m_fBottom = (-1.0f)*m_fWindowSize;
    m_ProjectionMatrix.m_fTop = m_fWindowSize;
    m_ProjectionMatrix.m_fNear = -(10.0f)*m_fWindowSize;
    m_ProjectionMatrix.m_fFar = (10.0f)*m_fWindowSize;

    m_fMoveSpeed = static_cast<GLfloat>(m_fWindowSize * 2 / static_cast<float>(m_WindowHeight));
}
else
{
    auto viewportAspectRatio = (float)m_WindowHeight / (float)m_WindowWidth;

    m_ProjectionMatrix.m_fLeft = (-1.0f)*m_fWindowSize;
    m_ProjectionMatrix.m_fRight = m_fWindowSize;
    m_ProjectionMatrix.m_fBottom = (-1.0f)*m_fWindowSize * viewportAspectRatio;
    m_ProjectionMatrix.m_fTop = m_fWindowSize * viewportAspectRatio;
    m_ProjectionMatrix.m_fNear = -(10.0f)*m_fWindowSize;
    m_ProjectionMatrix.m_fFar = (10.0f)*m_fWindowSize;

    m_fMoveSpeed = static_cast<GLfloat>(m_fWindowSize * 2 / static_cast<float>(m_WindowWidth));
}

And this works fine UNTIL I will add any (x,y) offset to my viewport. The effect is following when using glViewport(0, m_WindowHeight/2,  m_WindowWidth/2, m_WindowHeight/2):

And with glViewport(0, 0,  m_WindowWidth/2, m_WindowHeight/2):

So how I can change projection matrix accordingly to the viewport offset?


texts:
I've basically asked this question before, and I know it's been asked probably a billion times, but I still can't seem to do it. All I want to know is how I should go about doing basic 4-way, rectangular collisions (up, down, left, right). I have been searching for an answer on and off for months and I can't seem to find it. All I need to know is some basic code examples (in Java, preferably) for how I would do this. I've tried a few different methods before, but they just don't seem to work (I can get certain sides to work, but not all of them at the same time). I'm making this game entirely from scratch and I'm using libgdx as my framework. I don't want to use Box2D or any other engine. Thanks in advance to anyone who will help me!

tl;dr: 4 way collisions, how do they work?


texts: is wisdom of what happens 'behind scenes' (in compiler, external DLLs etc.) important?

texts:
I have been a computer-fanatic for almost a decade now. I've always loved and wondered how computers work, even from the purest, lowest hardware level to the very smallest pixel on the screen, and all the software around that.

That seems to be my problem though ... as I try to write code (I'm pretty fluent at C++) I always sit there enormous amounts of time in front of a text-editor wondering how every line, statement, datum, function, etc. will correspond to every Assembly and machine instruction performed to do absolutely everything necessary for the kernel to allocate memory to run my compiled program, and all of the other hardware being used as well.

For example ... I would write cout << "Before memory changed" << endl; and run the debugger to get the Assembly for this, and then try and reverse disassemble the Assembly to machine code based on my ISA, and then research every .dll, library file, linked library, linking process, linker source code of the program, the make file, the kernel I'm using's steps of processing this compilation, the hardware's part aside from the processor (e.g. video card, sound card, chipset, cache latency, byte-sized registers, calling convention use, DDR3 RAM and disk drive, filesystem functioning and so many other things).

Am I going about programming wrong? I mean I feel I should know everything that goes on underneath English syntax on a computer program.

But the problem is that the more I research every little thing the less I actually accomplish at all. I can never finish anything because of this mentality, yet I feel compelled to know everything... what should I do?


texts: getting direction of x and y... north,south,east,west

texts: I have a player in the center of the screen, where I also have my mouse position origin. (0,0)  I would like to know the direction of the mouse, imagine splitting the screen with a  X, so the top quadrant would be north, the bottom would be south... and so on. So if my mouse was at 5,-100 it should log ("North")  as that is just a bit to the left and up 100 pixels.


texts: Programming a climbing system like tomb raider

texts:
I was wondering if anyone knew or had knowledge of how to program a climbing system like the one found in tomb raider/uncharted.

I had thought of just having bounding boxes at all the climbable positions in the game world and then check for collision. If the player was inside the box then they would be "hanging" from the edge. Anyone have any better ideas/improvments?

I already have my rendering set up using directx9 and was going to worry about animation later on.


texts: Help with a Fast 2D Grid-Based world rendering technique

texts:
First I'm going to give you my current situation and explain what I'm attempting. I will then pose my question below. I will attempt to include a "TL;DR" for those of you who prefer things to be concise.
OVERVIEW OF CURRENT SETUP:

The current representation of my game world is one where ' Pieces ' of a larger world are represented by three layers of IDs as follows.

//This is being done in C++
struct WorldPiece {
   ivec2 pieceLocation;         //Where ivec2 is a vector containing ints
   short backLayer[PIECE_SIZE]; //Where PIECE_SIZE is the size of the grid this piece contains, ie. for a 32x32 grid, this is 1024
   short middleLayer[PIECE_SIZE];
   short frontLayer[PIECE_SIZE];
};

The world as a whole is then composed of these pieces, which are loaded (and cached as needed) as the player traverses from piece to piece.
I currently have the data side of this all working. I may change the active data set and move around the camera (zoom in and out as well) and watch it all function.
I have also written a tool to support the loading and saving of pieces, and the painting of IDs across the world.
I HAVE THIS DATA:

Each ID within a piece maps to a texture that will be used when that ' cell ' of the piece must be rendered.

QUESTION:

How might I go about rendering each piece in such a way as to do this in as few passes as possible? I could render each cell at a time, but that would be slow. I could generate a list of vertices and indices and create massive VBOs, or sets of quads. Or perhaps there is a better way?
I would prefer to keep the data separate from the rendering and to keep the size of the data as small as possible (so as to have a small as possible load time while the game is running).
If possible, I would like this to be fast enough to render large swaths of tiles, (for example a 3x3 area of 1024 tiles apiece, or more). Since zooming in and out is possible it would be nice to provide this functionality to the player while still maintaining the detail of rendering the world.

If there would be a better setup for the world data to accommodate these requirements, I'm open to suggestions.
SIDE NOTES:

Please do not bring collision/physics, or other game-map-related things into this. I have that worked out and it will not be a bottleneck. I am merely concerned with a best approach to a rendering pipeline where speed is the top concern.
Please do not suggest API X or ENGINE Y. I have looked around quite thoroughly and nothing available would properly provide what I need or integrate with my current codebase.
I will be using a texture atlas.

tl;dr version-  I have a grid based world that streams pieces in as needed, I would like suggestions on a fast way to render these pieces and nothing I have found anywhere has a suitable solution for my current situation.


texts: How do I detect collisions between a particle-based net and a ball?

texts:
I've implemented a net using Verlet integration and many points connected with constrains; like this demo, but in 3D.

I want to implement collision detection between this net and a ball (like in a soccer game), so the net catches the ball.

I've tried checking for collisions between the ball and net points (treating each like a small sphere), and this somewhat affects the net, but the ball passes through the gaps between points easily.

How should I be approaching this?


texts:
I am trying to create elastic collisions in 2d game in unity. I have a ball surrounded with a polygon collider and im calculating the reflected vector using the ball velocity and the normal at the contact point. The whole thing works find but I have a slight issue where the ball gets stuck when sometimes.As you can see below the ball does bounce but later on it comes to a stop

Here are some details on the implementation.

The ball is a circle collider and ive drawn the object using a line renderer and ive added a polygon collider to it by using the width of the line. The polygon collider consists of about 130 points.

The ball has its collision detection mode set to continuous but using discreet mode doesn't work either.

The speed of the ball is not the problem because I face the same issue even if I move the ball at lower speeds. I'm using Vector3.AddForce to move the ball. The force mode is ForceMode.Impulse.

Any help will bee greatly appreciated. Thank you for your time.

Below you can find the code.

    void Start()
    {
    rb = Transfrom.GetComponent<RigidBody2D>();
    velocity = rb.velocity;
    }

        private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "Wall")
        {

            float speed = velocity.magnitude;
            Vector3 direction = Vector3.Reflect(velocity.normalized, collision.contacts[0].normal);
            rb.velocity = direction * speed;
        }
    }

    void Update()
    {
    velocity = rb.velocity;
    }


texts: Unity2D: Apply gravity to some items, when everything else is gravity-free?

texts:
Sorry for the incredibly vague title:
Let's say you have an NPC, and when he dies he'll spawn items, coins for example.
Instead of just pushing the coins in random directions it would look a lot neater if they coins arced to the ground (see picture below)

The red circle represents a dead npc, the black lines represents gold coins.

Every entity in my game has a RigidBody2D with gravity set to 0, otherwise they'd fall to the bottom of the gray box.

Is it possible to 'pretend' that the ground around the dead npc has collision?

I thought about maybe adding a collision-box below the coins which follow the coins in the X-dimension only, but I'm not sure how to set the coins to only collide with these boxes (and perhaps left and right walls)


texts: How to get 60fps animation in terms of rounding/truncating position/alpha floats

texts:
I am wondering what gives the best animation performance running at 60fps with lots of objects. I have seen in a few places such as this that you should round or truncate your values so you don't get 54.2356345234578px, but instead get 54.24px.

animationValue = +animationValue.toFixed(2)

For x, y, alpha, etc. Any float values. I sort of understand why this is, but I am interested to know if there are any ideal heuristics to take into account. For example, maybe rounding .toFixed(2) is not ideal for particle animations. Maybe it is choppy for alpha transitions. Wondering if this has been solved, and what to truncate the values to for performance. Also in terms of calculating velocity or physics stuff, just generally what the scale of rounding/truncation should be so there are no noticeable effects.


texts: pygame KEYUP KEYDOWN events only once per frame?

texts:
I've been playing around with pygame, and I ran into a bit of an odd issue with input on the pygame event queue. Consider the following test code:

import pygame as pg

def main():
    pg.init()
    pg.display.set_mode([640,480])
    clock = pg.time.Clock()
    while True:
        clock.tick(1)
        events = pg.event.get()
        print("There are %d events in the queue." % len(events))
        for event in events:
            print(event)
        print()

if __name__ == "__main__":
    main()

Here I'm intentionally running the game loop just once per second. What I observe is that the pygame event queue can easily receive dozens of mouse-related events per frame, but only ever a single KEYDOWN or KEYUP event at a time.

This is the output after pressing four keys simultaneously and quickly pressing the left mouse button a few times at the same time:

There are 0 events in the queue.

There are 1 events in the queue.
<Event(5-MouseButtonDown {'pos': (494, 392), 'button': 1})>

There are 8 events in the queue.
<Event(2-KeyDown {'unicode': 'f', 'key': 102, 'mod': 0, 'scancode': 41})>
<Event(6-MouseButtonUp {'pos': (494, 392), 'button': 1})>
<Event(5-MouseButtonDown {'pos': (494, 392), 'button': 1})>
<Event(6-MouseButtonUp {'pos': (494, 392), 'button': 1})>
<Event(5-MouseButtonDown {'pos': (494, 392), 'button': 1})>
<Event(6-MouseButtonUp {'pos': (494, 392), 'button': 1})>
<Event(5-MouseButtonDown {'pos': (494, 392), 'button': 1})>
<Event(6-MouseButtonUp {'pos': (494, 392), 'button': 1})>

There are 3 events in the queue.
<Event(2-KeyDown {'unicode': 'q', 'key': 113, 'mod': 0, 'scancode': 24})>
<Event(5-MouseButtonDown {'pos': (494, 392), 'button': 1})>
<Event(6-MouseButtonUp {'pos': (494, 392), 'button': 1})>

There are 1 events in the queue.
<Event(2-KeyDown {'unicode': 'e', 'key': 101, 'mod': 0, 'scancode': 26})>

There are 1 events in the queue.
<Event(2-KeyDown {'unicode': 'w', 'key': 119, 'mod': 0, 'scancode': 25})>

There are 1 events in the queue.
<Event(3-KeyUp {'key': 119, 'mod': 0, 'scancode': 25})>

There are 1 events in the queue.
<Event(3-KeyUp {'key': 113, 'mod': 0, 'scancode': 24})>

There are 1 events in the queue.
<Event(3-KeyUp {'key': 101, 'mod': 0, 'scancode': 26})>

There are 1 events in the queue.
<Event(3-KeyUp {'key': 102, 'mod': 0, 'scancode': 41})>

There are 0 events in the queue.

At 1 FPS, it takes pygame 8 seconds to process just 4 keypresses, one for each KEYUP and KEYDOWN signal. Is this intended behavior? Am I missing something here? It seems odd to me that pygame cannot register multiple keypresses per frame. I'm a bit of a newbie when it comes to gamedev, so I'm not sure where this is coming from.


texts: Spherical coordinate from cartesian coordinate

texts:
I am implementing a type for Ogre 3D rendering engine to provide spherical coordinates.
So far everything is working fine, until I try to build spherical coordinates from a cartesian vector.
Here is the code I am trying right now, but it's not working correctly (changing phi and theta result in only half a sphere).

/** @return a relative spherical coordinate from a cartesian vector. */
        static SphereVector from_cartesian( const Ogre::Vector3& cartesian )
        {
            using namespace Ogre;
            SphereVector result;
            result.radius = cartesian.length();
            result.phi    = cartesian.x   > Real(0) || cartesian.x   < Real(0) ? Math::ATan( cartesian.z / cartesian.x )   : Radian( Math::HALF_PI );
            result.theta  = result.radius > Real(0) || result.radius < Real(0) ? Math::ACos( cartesian.y / result.radius ) : Radian( 0 );
            return result;
        }

Here is the version currently in the repository:

static SphereVector from_cartesian( const Ogre::Vector3& cartesian )
                {
                        using namespace Ogre;
                        SphereVector result;
                        result.radius = cartesian.length();
                        result.phi    = cartesian.x   > Real(0) || cartesian.x   < Real(0) ? Math::ATan( cartesian.z / cartesian.x )   : Math::ATan( 0 );
                        result.theta  = result.radius > Real(0) || result.radius < Real(0) ? Math::ACos( cartesian.y / result.radius ) : Math::ACos( 0 );
                        return result;
                }

I have been searching for the right algorithm and I think I'm close but I can't figure out it correctly yet.
My maths skills are not so good so I'm having trouble understanding what I'm doing wrong.

Any idea how it should be done?


texts: Custom functionality for content saved to database

texts:
I'm creating a turn-based game where I store most of my content in a database (enemies, items, npcs, location data, etc). This allows me to update the content easily without needing to rebuild anything.

I'm wondering if there is a way to safely link something like an enemy db instance to some hardcoded custom functionality. For example, maybe at the start of combat a certain enemy casts a specific spell or yells something.

I could look up a custom behavior file based on an enemy name or db id, but then if it changed that functionality would break. I could have a field for uploading a custom behavior script but that could introduce a slew of issues.

tl;dr; Are there standard patterns for adding custom functionality to content that is saved/loaded from a database?


texts: How can I make my camera follow the player movement in a different position

texts:
Basically my camera follows the character rotation and position, although the position of it its pretty uncomfortable to use, this is what I needed:

But this is what the I get:

I used a code that someone suggested me yesterday to use, I got a bit creative with it and changed some stuff to get other camera positions, but no matter how much I tweak the values the camera never gets the position that I need:

void LateUpdate()
{
    transform.position = player.transform.position - (player.transform.up * -10) + (player.transform.forward * -15);
    transform.LookAt(player.transform);

}

I have no idea how I can make it show less of the player back


texts: Text field is null while running but not in inspector

texts:
I've encountered a strange problem. In my game I have a prefab called UiManager. It has two public Text-fields, one for score, and one for lives. I only have one instance of this prefab and I've assigned the two Text-fields with two text-objects. Yesterday it worked well.

Today I reopened my project and started the game and when I collected a life I got a null reference on the text field Lives. Now clearly it is not null, I tried to delete my instance and recreate it and then assigning the Text-fields again, and it worked.

I then saved my project and exited Unity and reopened my project and now the issue was back again, a null reference on Lives. Also I noticed that it is not possible to apply ui-objects to a prefab (?).

Anyway, does anyone have any idea why this occurs?

Have a nice day!


texts:
I develop my own game engine for fun (but not profit).  I have rendering in one thread and my scene graph updates (velocity, etc.) in another.  When it's time to render, the render thread adds the visible nodes to a new linear buffer and traverses them.

In more detail, my scene graph is triple-buffered.  Each node in my scene graph has three copies of its relative and absolute transformation matrices (4x4).  At any given time, one copy is written to by the scene graph thread, one copy is read by the renderer, and a third exists so that the reader or writer can move on to the next without waiting on the other.  This prevents writing to something while it's being rendered and from rendering a half-updated scene graph.  Somehow I've also got a fourth copy of each matrix for the user to work with so as to not conflict with the update thread.  This seems to perform well by avoiding having to synchronize all the time.

However, this is a mess.

These are my ultimate goals for the system:

Rendering and scene graph updating stay in separate threads.
Minimize how much these threads have to wait on one another.
Don't render a scene that's been halfway updated by the update thread.  This is particularly noticeable if the camera is moving fast and sometimes it's rendered before or after an update.
Reduced memory usage.  I have way too many matrices per Node.  I'm also considering moving to vectors for position/rotation/scale due to increased floating point drift with matrices.
Ability to handle tens of thousands of Nodes.  The current system does this reasonably well.

I also hope to incorporate Bullet (the physics engine) and networking in the future, neither of which I've given much thought.

What are some approaches for accomplishing a better scene graph?


texts: Unity Networked gaming 2019... What happened to NetworkBehaviour, OnServerStart() etc

texts:
After a long break, I am now trying to learn some basics in networked gaming in Unity. I've installed the latest beta client (because I want to ultimately make a network multiplayer game but it will be many months of learning and building barebone prototypes to ensure I can get game objects spawning correctly and be controllable by the correct client etc etc

I have some experience in Unet, by extending the NetworkBehaviour class. I don't remember exactly but there were things such as [Client RPC] and [Command] and also OnServerStart() methods etc.

But I am aware Unet is being removed. And I tried to extend my class from NetworkBehaviour (I also tried NetworkBehavior lol) and it doesn't recognise it anymore.

So what replaces OnServerStart() method and [ClientRpc] instruction? Ideally I want to use a Dedicated Server solution (which I will run on my own computer in order to play small tests online of my game). The game im trying to make to start off with is extremely simple. The 'player' is just a capsule which can shoot small cubes and give damage to other players. Also the player object 'you' are controlling will appear blue, but all the other players will be grey.

Using Unet I was able to make the above small game idea work. But now I am unable to.


texts: How do I get a delay in motion to happen? (Unity)

texts:
I want the cockpits rotation to lag behind that of the cameras, so I wrote this code:

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

public class Delay : MonoBehaviour {
    public Transform BodyRot;
    public Transform CurrentRot;
    public Vector3 changeInRot;
    public float divideRot;
    Vector3 BodyTarget;
    Vector3 CurrentInitialRot;

    // Update is called once per frame
    void Update () {
        Vector3 BodyTarget = BodyRot.rotation.eulerAngles;

        Vector3 CurrentInitialRot = CurrentRot.rotation.eulerAngles;

        changeInRot = BodyTarget -= CurrentInitialRot;

        if(CurrentInitialRot != BodyTarget)
        {
            RotateFinal();
        }

    }

    void RotateFinal()
    {
        CurrentInitialRot += changeInRot / divideRot;
        transform.rotation = Quaternion.Euler(CurrentInitialRot);
    }
}

But it glitches out frequently. (DivideRot is how many times to divide the distance between the target and current position, so that it takes time to rotate)


texts: How can I tell if a Gameobject is currently touching another Gameobject with a specific tag?

texts:
I've seen similar questions to this here on Stack Exchange — Game Development, but none of the answers to them have helped my problem. I am working in Unity 2019.2.18f1 with Visual Studios 2019 Community.

What I want to know how to tell when one Gameobject (the player) is currently touching another game object with a tag name of "Block". When the player collides with a "block" I want it to set: jumpPossible = true; But when it leaves the block (by jumping or falling off) jumpPossible = false;

What I currently have in my PlayerController script (the important stuff anyways):

private void OnCollisionEnter(Collision collision) {
    if (collision.gameObject.CompareTag("Block")) {
        jumpPossible = true;
    }
}

private void OnCollisionExit(Collision collision) {
    if (collision.gameObject.CompareTag("Block")) {
        jumpPossible = false;
    }
}

The problem I am having is when the player is currently on a block and then touches another block. When it leaves the one of the blocks, it will set: jumpPossible = false; and so you can't jump.

What I want for this script to do is whenever the player is touching any Gameobject with a tag of "Block" it should allow it to jump.


texts: How to approach in-game character creation system alike Sims

texts:
I would like to implement an in-game character creation similar to the Wii/Mii system or The Sims using Blender and Unity. In what ways is this possible, other than (or in conjunction with) using shape keys? The ideal system would have 2-4 body types, ~8 hairstyles, full RGB skin/hair toning (I quite like Terraria's style), and a few styles for faces.

I have been looking into this topic, but so far I have not found a good explanation as to how this would be implemented, and blender shape keys would allow for some aspects of this - namely body and hair manipulation - but would not work for coloring or styling the face.


texts:
We are using 3d bus model for our game in Unity 3d.Animation works perfectly fine on Samsung s3 but some kind of texture flickering occurs on Nexus device.Please help us out how to solve this problem.

Thank you


texts: Persistent elements of offline players interacting with online players

texts:
For a long time I was thinking about a quite abstract game design problem, to which I didn't see a good solution yet. In abstract: How can a player have owned bases, units and infrastructure in a persistent multiplayer world, which can be interacted or attacked by other players, all the while the owning player may be offline and unable to give his input?

As a concrete example:

Assume you have a very large 2D world, in which you can build bases and have units guarding them. The bases can be visited or used by other players as automated trading stations, in which you represent the vendors. But the bases should also be able to be contested by hostile players - be it plundering or outright destruction.

How can I solve the issue that the owner of the base may be offline during an attack? Or that a player attacks at times where people are usually not online (sleeping, working, school)? Or that a player may actively go or stay offline in order to exploit potential protection mechanisms? How can I avoid forcing players to go online for a certain time at certain time ranges in order to maintain such protection?

Ideas (which are not satisfactory though):

Bases cannot be attacked in normal ways. People can send "troops" with a delay hopefully long enough to ensure the other player can give his optional input. The outcome of these battles is an automatically calculated result. Such sieges may go over multiple days.
Bases can only be attacked while their owners are online - or have been offline for too long. The explanation why those cannot be attacked is severely lacking though - given that trading should still be possible.
When a player intends to attack, both players somehow have to make an appointment in order for both to be online and to start the battle. This is a bad solution for obvious reasons.
Bases are inactive and invulnerable while their owners are offline or setting it inactive, and trading/other activities continue only temporarily based on the previous online/active time. This raises issues with visible bases and ongoing infrastructure, as they'd essentially need to be hidden or hideable, and other players may get bothered by it becoming inaccessible.

What other methodology does exist or could be employed in order to tackle this online-offline issue with persistent elements? I am also open for mathematical or systematic solutions. Be reminded that other players should be able to assist either side as well, and that their online/offline times would require some consideration as well.


texts:
I'm new in UDK and I'm starting to develop online multiplayer games.
There is a one problem, I couldn't find any tutorials about how to make a game server using udk. I suppose, that it uses unreal script. But that's about all I know about it.
So I'd really like for some help.


texts:
I'm try this script out

http://wiki.unity3d.com/index.php/Gravity

and I'm having some issues with it (it seemed to work when I tried it with an old version of unity)

the first issue is of collision, the objects (in my case spheres) will stick into each other rather than just touch.

and the second is that when the objects collide one of the objects with continue it's trajectory.

I'm thinking of rewriting the script from scratch unless someone can explain what's wrong with the script that i've got.


texts:
I am currently porting parts of my engine over to D3D11 from OpenGL and was trying to figure out how I would accomplish the following blending functions in D3D11.

glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
glDepthMask(GL_FALSE);
glDepthFunc(GL_EQUAL);

I believe it should be something like this:

D3D11_BLEND_DESC blendDesc;
ZeroMemory(&blendDesc, sizeof(blendDesc));

D3D11_RENDER_TARGET_BLEND_DESC rtbd;
ZeroMemory(&rtbd, sizeof(rtbd));

rtbd.BlendEnable = true;
rtbd.SrcBlend = D3D11_BLEND_ONE;
rtbd.DestBlend = D3D11_BLEND_ONE;

rtbd.BlendOp = D3D11_BLEND_OP_ADD;
rtbd.SrcBlendAlpha = D3D11_BLEND_ONE;
rtbd.DestBlendAlpha = D3D11_BLEND_ONE;
rtbd.BlendOpAlpha = D3D11_BLEND_OP_ADD;
rtbd.RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
blendDesc.AlphaToCoverageEnable = true;
blendDesc.RenderTarget[0] = rtbd;

m_D3D->GetDevice()->CreateBlendState(&blendDesc, &m_blendMode);

However this does not work. How can I achieve the same effect as in the first code snippet?

Thanks


texts: Controlling a thrustered 2D space ship with angular rotation and max speed

texts:
In my game I have a computer controlled ship that is accelerated by a thruster: with a constant force and in the direction of the ship's current orientation/rotation angle.

Thrusting
My ship has a maximum speed limit (velocity) and a maximum thrust power that can be applied each time to the velocity until maximum speed has been reached.

Rotating
Given a "desired target" (click the screen on my demo), it determines the required angle and rotates by a constant angular force until it reaches the desired value.

Finding the angle and rotating is done. The problem is that the only way I know how to keep a speed limit is by limiting the ship's velocity vector before it is summed to the ship's location, but this way the ship is always thrusting (like in the video) only the effect is caped:

Check: Thruster space ship in action (youtube)

Thrusting only when required
In a better approach, I only thrust if the ship orientation angle is aligned with the target angle.

Check: A better approach (youtube)

While this is visually more effective, thrusting is still done at max power and still relies in limiting the velocity when the ship is thrusting.

What I need (and I can't do)
I need to calculate the force that the thruster should apply to the ship's velocity to change the direction while keeping the overall speed not beyond the limit so I can get rid of limiting the ship's velocity.

Reading this thread I understand (I think) that I need to apply to the velocity only the component of the force that will affect the ship velocity angle and not its length. And I can determine this checking if the direction of the impulse (thrusting force) is orthogonal to the current direction of the ship's  velocity and applying the relevant component of that force (x or y).

I did many attemps and all failed. So I came here with
hope to find someone who is more familiarized with this or at least that can explain how to apply @dannuic reply to my code.

This is my code on github, just clone and if in Linux run ./simpleServer (may require chmod u+x).

Thank you very much!


texts: Create rotation in random direction from existing rotation

texts:
I am working on a game in Unity, and I currently have a game object (object A) located at the origin. I have a child of this game object (object B), that is 10 units back on the z-axis. When I rotate object A, it causes object B to orbit at 10 units from the origin.

With that being said, I have many game objects that orbit this same way. I want (at any point in time) to be able to spawn a new game object a certain distance away from object B. This certain distance is really going to be something like 60 degrees around the sphere in any random direction from object B. So when I create a new game object, I will create a new pivot point object (object C) and a new child of that pivot point (object D) at 10 units away on the z-axis.

I know I need to create a new rotation from the current rotation of object A, but this needs to be in a a random direction and the new rotation should be 60 degrees in that direction.

Let me know if that doesn't make sense, or if you need any other information.

I am not really sure how to even go about determining these rotations, but I am currently trying to use Unity's Quaternion class which I believe will work, but I think I need to step back and see if anyone else has a better way to go about this.

Appreciate the help!


texts:
So pretty much I tried to add a gaussian blur to something I am making and it is acting oddly. The setup is like:

[All framebuffers are cleared to rgba(0,0,0,0), normal blend enabled]
Draw some solid black objects to Framebuffer 0
Apply horizontal gaussian pass from Framebuffer 0 to Framebuffer 1 (this works fine)
Apply vertical gaussian pass from Framebuffer 1 to backbuffer
[original black objects removed here, does not affect the process at all]

It seems like a standard gaussian layout, but the problem happens with the final view (presumably the vertical pass). It appears that the vertical gaussian pass dampened the previous horizontal one, making it a lot thinner (and making the box shadow effect I was going for look weird):

(note on the right image on one of the center rectangles for example, the top and bottom are blurred like they should but the sides aren't)

I just cant figure out why the vertical blur factor is at least 2x the horizontal one. I feel like this is because of something to due with alpha because the horizontal pass displays like it should until the second step happens. One final note, this still happens if I flip the horiz/vert order, it just happens on the other axis. I honestly can't figure this out so any help would be nice. Also for more info, heres the fragment shader I use (all the data passed to it is correct):

in vec2 ftexpos;

uniform sampler2D inputtex;
uniform vec2 vector;

float[15] gaussianraito = float[15](
    0.023089,
    0.034587,
    0.048689,
    0.064408,
    0.080066,
    0.093531,
    0.102673,
    0.105915,
    0.102673,
    0.093531,
    0.080066,
    0.064408,
    0.048689,
    0.034587,
    0.023089
);

void main() {
    vec4 sum = vec4(0.0);

    for (int i = -7; i < 7; i++) {
        sum += texture(inputtex, vec2(ftexpos.x + i * vector.x, ftexpos.y + i * vector.y)) * gaussianraito[i + 7];
    }

    gl_FragColor = sum;
}


texts: Detect which Entity caused the collision

texts:
I have a 2D plane with two or more moving entities (polygons with an AABB). On collision both of them will go through a "collidesWith" Method, where I have access to both entities but only want to modify the other one to avoid that something is applied twice. For collision detection I am using a custom implementation of the SAT Algorithm.

The entities will only move in x or y direction not diagonal. (Though I would like to add diagonal, if there is a solution that works for diagonal as well)

What I want to achieve is:

a moves vertically and b moves into it, b should invert its movement
d moves horizontally and c moves into it, c should invert its movement

How do I approach this without a huge amount of if statements?


texts: How to Make UI Open and Close on Keypress

texts:
I've been working on a 2D RPG and have been trying to make a script that will open or close the public UI element that is selected in properties. I don't receive any errors, but I do receive a warning that says:

Assets\Scripts\KeyManager.cs(7,18): warning CS0414: The field 'KeyManager.activeUI' is assigned but its value is never used

Here's the script that is connected to my canvas:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class KeyManager : MonoBehaviour
{
    private bool activeUI;
    public GameObject UI;

    void Start()
    {
        activeUI = false;
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.I) && (activeUI = false))
        {
            activeUI = true;
            UI.SetActive(true);
        }

        else if (Input.GetKeyDown(KeyCode.I) && (activeUI = true))
        {
            activeUI = false;
            UI.SetActive(false);
        }
    }
}


texts: Using "screenshots" in a game, is it allowed?

texts:
Lets say I have a game that is some kind of a quiz, and its questions are themed around gaming.

For it to be interesting, I would need to make references to well-known games and game-related stuff.

In a copyright infrigement sense, could I have problems with this? Imagine a question such as, "What was the currency used in game X?", or "Which company made game Y?".

Also, the same applied to screenshots of known games, and have a question near it, such as "What game is this image from?".

Toughts? Thanks


texts:
I try to convert an array of Buildings into a representation of a small village. There are several different buildings in a village, like factories that are located on the outside of the village, houses that are placed around churches in the center and so on. What would be a good approach to solve such a problem? I thought about using noise but this didn't give me the expected results.
I made a little drawing on what should happen:
I put an array of Buildings like this, for example, through a function
{ houses: 20, churches: 3, factories: 7 }

And i recieve a output similar to this:

Thank you for your help and ideas


texts: Correct use of VAO's in OpenGL ES2 for iOS?

texts:
I'm migrating to OpenGL ES2 for one of my iOS projects, and I'm having trouble to get any geometry to render successfully.  Here's where I'm setting up the VAO rendering:

void bindVAO(int vertexCount, struct Vertex* vertexData, GLushort* indexData, GLuint* vaoId, GLuint* indexId){

//generate the VAO & bind
glGenVertexArraysOES(1, vaoId);
glBindVertexArrayOES(*vaoId);

GLuint positionBufferId;

//generate the VBO & bind
glGenBuffers(1, &positionBufferId);
glBindBuffer(GL_ARRAY_BUFFER, positionBufferId);

//populate the buffer data
glBufferData(GL_ARRAY_BUFFER, vertexCount, vertexData, GL_STATIC_DRAW);

//size of verte position
GLsizei posTypeSize = sizeof(kPositionVertexType);

glVertexAttribPointer(kVertexPositionAttributeLocation, kVertexSize, kPositionVertexTypeEnum, GL_FALSE, sizeof(struct Vertex),  (void*)offsetof(struct Vertex, position));
glEnableVertexAttribArray(kVertexPositionAttributeLocation);

//create & bind index information
glGenBuffers(1, indexId);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, *indexId);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, vertexCount, indexData, GL_STATIC_DRAW);

//restore default state
glBindVertexArrayOES(0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}

And here's the rendering step:

//bind the frame buffer for drawing
glBindFramebuffer(GL_FRAMEBUFFER, outputFrameBuffer);

glClear(GL_COLOR_BUFFER_BIT);

//use the shader program
glUseProgram(program);

glClearColor(0.4, 0.5, 0.6, 0.5);

float aspect = fabsf(320.0 / 480.0);
GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 0.1f, 100.0f);

GLKMatrix4 modelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, -1.0f);

GLKMatrix4 mvpMatrix = GLKMatrix4Multiply(projectionMatrix, modelViewMatrix);

//glUniformMatrix4fv(projectionMatrixUniformLocation, 1, GL_FALSE, projectionMatrix.m);
glUniformMatrix4fv(modelViewMatrixUniformLocation, 1, GL_FALSE, mvpMatrix.m);

glBindVertexArrayOES(vaoId);
glDrawElements(GL_TRIANGLE_FAN, kVertexCount, GL_FLOAT, &indexId);

//bind the color buffer
glBindRenderbuffer(GL_RENDERBUFFER, colorRenderBuffer);
[context presentRenderbuffer:GL_RENDERBUFFER];

The screen is rendering the color passed to glClearColor correctly, but not the shape passed into bindVAO.  Is my VAO being built correctly?  Thanks!


texts: What's the difference between creating a Source mod and just creating some levels?

texts: I'm just starting to look into creating Source mods for HL2 and I'm a little bit confused. I've gone through some tutorials on level creating to get the basics and it seems to me that it's all that really goes into the creation of a mod. I know I'm wrong so could someone please explain to me where the programming comes in? Is it more than just sticking NPCs and objects on a map?


texts: Second glBindBuffer() call crashes program on Draw call

texts:
Background/Issue: I'm pretty new to openGL and I'm trying to create a game engine (for learning purposes) and my program keeps crashing on my glDrawElements() call but only after trying to set glBindBuffer a second time.

Code: Below is some of my code in my engine. Basically, I have two possible objects I can draw with my engine, a triangle and a square. I'm trying to first send initial shape data down to GPU buffers within my RenderSystem's Initialize function like so:

RenderSystem.cpp

bool RenderSystem::Initialize()
    {
        //Send triangle shape data down to GPU
        MyOpenGL::InitializeBuffers(ShapeData::Triangle().vertices.size(),
                   &ShapeData::Triangle().vertices.front(),
                   ShapeData::Triangle().indicies.size(),
                   &ShapeData::Triangle().indicies.front(),
                   triangleVertexBufferID , triangleIndexBufferID);

        //Send square shape data down to GPU
        MyOpenGL::InitializeBuffers(ShapeData::Square().vertices.size(),
                   &ShapeData::Square().vertices.front(),
                   ShapeData::Square().indicies.size(),
                   &ShapeData::Square().indicies.front(),
                   squareVertexBufferID, squareIndexBufferID);

        return true;
    }

The MyOpenGL::InitializeBuffers() function code is next:

void InitializeBuffers(int64 sizeOfGeometry, const void* GeometryDataFirstElement, int64 sizeOfIndicies, const void* indicieDataFirstElement, uint32 vertexBufferID, uint32 indexBufferID)
    {
        glGenBuffers(1, &vertexBufferID);
        glGenBuffers(1, &indexBufferID);

        glBindBuffer(GL_ARRAY_BUFFER, vertexBufferID);
        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBufferID);

        glBufferData(GL_ARRAY_BUFFER, (sizeof(Vector2D) * sizeOfGeometry), GeometryDataFirstElement, GL_DYNAMIC_DRAW);
        glBufferData(GL_ELEMENT_ARRAY_BUFFER, (sizeof(uint16) * sizeOfIndicies), indicieDataFirstElement, GL_DYNAMIC_DRAW);

        glEnableVertexAttribArray(0);
        glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 2, nullptr);
    }

Now, I want to call a draw function within my RenderSystems update() function which basically just calls this MyOpenGL::Draw() function:

 //Passing in which ever BufferID's I want to draw (square or triangle)
 void Draw(uint32 vertexBufferID, uint32 indexBufferID, uint16 numOfIndices)
    {
        glBindBuffer(GL_ARRAY_BUFFER, vertexBufferID);
        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBufferID);

        glDrawElements(GL_TRIANGLES, numOfIndices, GL_UNSIGNED_SHORT, 0);
    );

However, after the glDrawElements call my program crashes. If I remove the glBindBuffer functions then it works, calling the last buffer object I bound everything to. Why is my program crashing when trying to rebind to whatever object I want to draw?


texts: How to use traditional pixel coordinates system in modern OpenGL? (3.1) (with C++/GLFW)

texts: This question is very similar to my other question, however the solution provided there does not work when using OpenGL 3.1. glOrtho seems to do absolutely nothing no matter where I call it in OpenGL 3.1. Googling this didn't give me any decent results. Should I be doing something in the fragment/vertex shaders, or?


texts:
Just a strange question. I was thinking about it today. About a poker game website/apps or any online gaming platform with money being involved.

What would be the best way to deals with disconnected users trying to avoid a loss or maybe real disconnection.

I doubt pausing the game until that player comes back is very suitable.

Any ideas? Suggestions?


texts: is a good practice to orgnize MVC classes in diferent packages?

texts:
Im,working on a project where the classes are organized by subject like gameplay, menus, utilities etc... Basically this 3 packages.

is a good practice to organize classes in controller, view and module packages ?

games are typically visual applications. This question is regarding the viability of a particular organization and pattern in a game application, which are mostly visually oriented.


texts: Tilemap Collision w/ different height levels and directions

texts:
I've been programming a final fantasy 6 clone in C# using Monogame and Monogame Extended, and have met on a few interesting challenges regarding tilemap collision.

The game seems to have different height levels on tilemaps, such as in the picture below where the bridge is on one height level and the ground on another. I'm using Tiled for my maps and have the bridge on it's own layer, and the ground on another. However, when it comes to collision, you shouldn't be able to for example walk up on the bridge and end up on the ground, which leads to the problem of collision detection. Collision for the ground level should be different than on another height level like the bridge, but I'm not sure what a good solution to handle that could be.

Since I'm using TiledMap from Monogame Extended, I can't really modify the Tile class to hold collision data. My initial idea was to have an extra object or tile layer for each height level to specify collision/solids for each height level, but I found that it wasn't very intuitive and that it was a little messy. Optimally I would only need one tile layer per height level, but I'm at a loss for any ideas on how to handle collision in a scalable and intuitive way, so I was wondering if anyone here had any ideas?

Another interesting problem is regarding tile collisions and directions. For example, when standing in front of the fence in the picture below, you should not be able to walk up and behind the fence. But, if you are standing one tile above the fence, you should be able to walk down and behind it, but once you are behind it you should not be able to walk down again and end up in front of it.

I think the solution to that problem is to define collisions on each edge of the tile, so that the bottom edge of the tile is marked as solid, while the other edges aren't. The main issue with that is that I have no idea how to implement something like that with Tiled. It also presents the problem of rendering, since the tile would need to be rendered below the player if the player stands in front of it, and above the player if the player stands behind it. I think using a Z-index would solve it, but again, I haven't found a way to implement that using Tiled. Soo, I was wondering if anyone has any ideas or pointers on how to use Tiled w/ Monogame + Monogame Extended to implement those things?


texts:
I am a very experienced iOS Developer, but I am beginning my very first foray into 3D graphics (specifically with SceneKit).  I'm trying to model a planet, and I have it working with a height map giving mountains and valleys to a simple sphere.

What I'm wondering now is, how might I have a variable sea level?  As I understand it, a height map only affects how the image is rendered, but it doesn't actually change the geometry of the object, correct?  So my first idea, to have a smaller sphere and scale it up or down relative to the planet so that it shows through in the lower-elevation areas, wouldn't work?

If that's the case, how else might I approach this?  I'd love a code sample if it's simple or ready-made, but mostly I'm just looking for a conceptual answer that I can go off and implement.  How might I take a height-mapped planet surface, and have an adjustable sea level that fills in the lower-elevation areas first?  For simplicity, I'm treating sea level as purely altitude-based (i.e. I don't need to factor in dams or obstacles, and maintaining a consistent volume of water isn't important).


texts:
I'm making a simple pong game, and things are great so far, but I have an odd bug which causes my ball (well, it's a box really) to get stuck on occasion when detecting collision against the ceiling or floor. It looks as though it is trying to update too frequently to get out of the collision check.

Basically the box slides against the top or bottom of the screen from one paddle to the other, and quickly bounces on and off the wall while doing so, but only bounces a few pixels from the wall.

What can I do to avoid this problem? It seems to occur at random. Below is my collision detection for the wall, as well as my update method for the ball.

public void UpdatePosition()
{
    size.X = (int)position.X;
    size.Y = (int)position.Y;
    position.X += speed * (float)Math.Cos(direction);
    position.Y += speed * (float)Math.Sin(direction);
    CheckWallHit();
}

// Checks for collision with the ceiling or floor.
// 2*Math.pi = 360 degrees
// TODO: Change collision so that ball bounces from wall after getting caught
private void CheckWallHit()
{
    while (direction > 2 * Math.PI)
    {
        direction -= 2 * Math.PI;
    }

    while (direction < 0)
    {
        direction += 2 * Math.PI;
    }

    if (position.Y <= 0 || (position.Y > resetPos.Y * 2 - size.Height))
    {
        direction = 2 * Math.PI - direction;
    }
}


texts: SNES Bung Game Doctor, add RAM retention modification (battery backup)

texts:
Firstly I'd like to say that this doesn't seem like the right "forum" for this question as it actually doesn't relate directly to the development of games.

As this is my first post on 'game development', I cannot include more links - sorry.

I recently obtained a Game Doctor SF7 ("Professor SF2" in the US I believe) backup unit for the Super Nintendo, and I'd like to add battery backup to it.

Quick background

This first model (SF1) unit was designed by Bung Enterprises  starting in 1994. It was placed on top of the SNES (interfacing with it via the standard cartridge slot) and allowed backup of SNES cartridges to floppy disk and PC(via a straight-through DB-25 M/M cable).

The unit can store the cartridge ROM, SRAM ("Save" RAM - used by many cartridges to store save games) as well as complete SNES RAM onto its own (expandable) RAM so that one can later dump this to floppy/PC, or to simply keep the games retained in memory for quick recall during development/gaming.

More interestingly, it can download ROM and SRAM data from a PC on most modern platforms thanks to the ucon64 project; this is of course of great interest if you want to actually do some SNES development on real hardware (which I do)!

Dilemma

The main kink is that the unit does not have any battery backup - if you cut power to the unit, RAM is lost. This wouldn't have been much of a bother in '94 when floppy disks were the bees knees, but nowadays it's very frustrating!

Idea

The idea is to add battery backup functionality to the unit. I've tried to find people who have made similar (or any!) modifications to the unit,  Unfortunately as the machine is very old (and has more modern, "non-programming" everyday alternatives) it's very hard to find any information at all - most of the websites I've found which do have some information have been on archive.org!

Finding information

There are a number of reasons for it being exceptionally frustrating to find information about the unit. Firstly, Nintendo(and others) basically forced Bung out of business about ten years ago, so none of the original sites exist. Secondly, the unit series has different names in the US as compared to Japan - it's called the game doctor sf7 in Japan, and professor SF2 in the US. Thirdly, the majority of the userbase used the unit for the sole purpose of "game backups" and not development/hardware mods.

So,
Has anyone performed such a feat before, got information about it, or simply the hardware know-how to get me on the right track? Am I perhaps thinking this might be easy when it might actually be quite hard (difficulty in retaining power to the RAM versus the entire unit, unforeseen issues, etc)?

Thanks for taking the time!


texts: How to change the virtual joystick Input direction depending on camera rotation so the player moves to its current forward direction?

texts:
I have a scene set up where the player moves and rotates with Virtual Joystick Input. I have button which rotates the camera to the back of my player at that point I want to change the joystick input direction so it moves my player to towards its current forward direction.

  The joystick Scripts:

1) script to handle events:

public class joystickEvents extends EventSystems.EventTrigger{
  var position:Vector2=Vector2.zero;

  public var joyStickHolder:Transform;
  private var pointerUp:boolean=false;

  function Update(){
    if(position!=Vector3.zero && pointerUp){
       position=Vector3.Lerp(position,Vector3.zero,5*Time.deltaTime);

    }
  }
   public function OnDrag(data:EventSystems.PointerEventData){
      position=data.position-joyStickHolder.position;
   }
   public function OnPointerUp(data:EventSystems.PointerEventData){

     pointerUp=true;

    }
  public function OnPointerDown(data:EventSystems.PointerEventData){
     pointerUp=false;
  }

}

2) script for joystick movement:

   public class joystick extends MonoBehaviour{
    var joystickEvents:joystickEvents;
    var joystickHolder:RectTransform;
          var dir:Vector3;
    private var maxDist:float;
    private var direction:Vector3;
    private var magnitude:float;

     function Start(){
        maxDist = joystickHolder.sizeDelta.x;
        maxDist=maxDist/2.5;
     }

     function OnGUI () {

        if(joystickEvents.position.magnitude>(maxDist))
              magnitude=maxDist;

        else{
          magnitude=joystickEvents.position.magnitude;

        }
        direction=joystickEvents.position.normalized;

      transform.localPosition=direction*magnitude;
        dir=direction*(magnitude/maxDist);
    }
  }

The player controller script takes the variable dir to move around the world. I think this value must changed somehow to so that move the player moves towards its current forward based on joystick input when camera is rotated.

  Here some part of playerController responsible for player movement:

public class charcterController extends MonoBehaviour{
 private var controller  : CharacterController;
 private var moveDirection : Vector3 = Vector3.zero;
 var speed : float = 6.0;
 var joystick:joystick; //reference to the joystick script
  function Start(){
       controller = GetComponent.<CharacterController>();
    }
  function Update() {
        var joyInput:Vector3=joystick.dir; //the dir in joystick script
        dir=Vector3(joyInput.x,0,joyInput.y);
        if (controller.isGrounded) {
        moveDirection = dir;

        moveDirection *= speed;
        controller.Move(moveDirection * Time.deltaTime);
         rotate();
      }
  function rotate(){
      if(dir!=Vector3.zero)
          transform.rotation = Quaternion.LookRotation(dir);
      }
 }


texts: Room Based User Authentication without having a user database

texts:
I'm looking to make a web-app/game where people do not need an account to play, but the game is room based, and once the game has started the room closes. I'm most familiar with Spring/REST services as a back-end.

The best example for this type of system is the Jackbox Games backend (Quiplash, Drawful, etc).
The way theirs works is:

Go to landing page
Enter desired username and also a "room code" of the room to join (note: anyone can join, no account needed)
Click start game when all users are in
Play game, no more users can join

Anyone have any ideas of how to approach this?

I'm familiar with having users authenticate against a database on a login call to the server. And also I'm pretty familiar with how I might pass around payloads via JWT, but I'm having a bit of trouble piecing together how I might create the rooms and then close them. Also keeping users "logged in" until the game ends.

Any suggestions would be wonderful.

Thanks.


texts:
I came across this question when I was designing a video game in C#.

If we consider games such as Battlefield or Call of Duty, hundreds or even thousands of bullets are flying at the same time. Events are triggered constantly, and from what I know, this sucks a lot of processing power … or does it? I want to know how various game developers manage (2D and 3D) bullets and what the most efficient method for each is.

I read the question How are bullets simulated in video games? but it doesn't touch on how bullets work from a program design perspective.

I had a couple ideas, but each have their drawbacks:

Most efficient method I could think of (for 2D games):

Say I was to create a class called Bullet, and for however long the user holds down a button, every 0.01 seconds a Bullet object would be made. This Bullet has:

1 Velocity
2 Starting position of where it is being shot from
3 Sprite texture
4 An on-hit effect

Since the bullet would be its own class, it could manage the drawing, moving, and action listeners itself.

Wouldn't it be hard on the processor to process thousands of these objects being instantiated, then destroyed (when on-hit effect is triggered)? RAM space?

Efficient method for 3D games - Another thought I had was:

Lets say I create a weapon class. This weapon has various features, some of which:

1 Detect where the weapon is aiming, and determine if it's looking at a target
2 Trigger an animation of the gun shooting
3 Has a doDamage() method that indicates something to subtract health from whatever the gun is pointed at
4 Notifies a bullet animation class when button pressed

I could then create a static class, say BulletAnimation, that could get notification from where the gun that triggered it is, where that gun is pointed at (for the bullet destination), and information on an appropriate sprite and velocity to use for the bullet. This class then draws sprites (on a new thread maybe, idk) based on both positions and desired sprite, to simulate a bullet being fired from a gun.

The latter seems much harder to code, and wouldn't it take lots of processing power to constantly call the static to do this for thousands of bullets at a time? Getting constant updates on both starting and ending positions would be hard as well.

My question is, what is the most efficient way game creators do it? Does this method change from 2D to 3D games?


texts: Is there any specific reason why Java was the right choice for Minecraft?


texts: Editor Window Show method is not working properly

texts:
Documentation says that EditorWindow.Show show the EditorWindow.

I have two classes:

public class WindowOne : EditorWindow {

    public static WindowOne windowOneInstance;

    [MenuItem("Window/Open Window One")]
    public static void Init() {
        windowOneInstance = GetWindow<WindowOne>(false, "Window One", true);
    }
}

and

public class WindowTwo : EditorWindow {

    public static WindowTwo windowTwoInstance;
    public static WindowOne windowOneInstance;

    [MenuItem("Window/Open Window Two")]
    public static void Init() {
        windowTwoInstance = GetWindow<WindowTwo>(false, "Window Two", true);
        windowOneInstance = WindowOne.windowOneInstance;
    }

    public void OnGUI() {
        if (GUI.Button(new Rect(0, 0, 200, 50), new GUIContent("show window one"))) {
            windowOneInstance.Show();
        }
    }
}

In menu I click Open Window One, then Open Window Two, then I close the first window

Now if I click a Button on WindowTwo it doesn't show me WindowOne. Or at least it shows one-pixel of window that I cannot move or resize or do something else.

If I use GetWindow(typeof (WindowOne)); instead of  .Show() - it shows the window, but I'm not sure that it shows the same instance I created before, because instanceID of that window will be different.

Why Show method works so strange? Am I doing something wrong? And  what should I do to show the same instance of closed (temporarily hidden) window?

Unity version - 5.6.0p4


texts: Fragment shader operations before vector transformations

texts:
I feel like I'm misunderstanding how to work with vector/fragment shaders. My vector shader is as follows:

uniform mat4 uVMatrix;    // view (camera transformations)
uniform mat4 uMMatrix;    // model (object transformations)
uniform mat4 uPMatrix;    // projection
attribute vec4 aVertexPosition;     // passed in
attribute vec4 aVertexColor;
varying vec4 vColor;

void main() {
    gl_Position = uPMatrix * uVMatrix * uMMatrix * aVertexPosition;
    vColor = aVertexColor;    // pass the vertex's color to the fragment shader
}

Pretty simple. Right now I just have a simple square that I'm transforming in 3D space and drawing. I want to make a see through circle in the middle of the suqare as follows:

This square has 4 vertices that I transform in the vector shader. Here's my fragment shader:

precision mediump float;    // how precise to be with floats
varying vec4 vColor;        // interpolated from the vertices

void main() {
    gl_FragColor = vColor;
}

Now, I've seen I have access to gl_FragCoord, but that coordinate is after all the vector transformations, right? How can I manipulate the pixels in the square, before all the projection transformations, etc.? I don't think I can do it in the vector shader, as there's only 4 vectors...


texts:
If I leave my imagebuttons' width and height alone I get larger buttons than I'd like:
    radio.setX(wu*35);
    radio.setY(hu*20);

When I replace/add to the lines above with setbounds or setWidth/setHeight functions, I get this:
    radio.setBounds(wu * 35, hu*20, wu * 12, hu * 12);

It did get smaller, but now it appears to be two images.  What is going on?  I always run into this issue, across multiple screens and projects.  My attempts to resolve it include scaling the native images to be closer to the size I want them to appear in-game, and using the other button methods that deal with sizing, such as setScaleX.


texts: How to change something inside an switch statement?

texts:
So my question is how would you draw a list of strings, and then if a case of the enum is a certain way, then draw them a different way? Here is an example of what I mean:

enum CurrentState
{
    Menu1,
    SubMenu1,
    SubMenu2
}
private CurrentState _currentState = CurrentState.Menu1;
public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
{
    //Draw list here so it is always displayed in all cases
    switch (_currentState)
    {
        case CurrentState.Menu1:
        {
            //How would you erase the previous list and draw it in a different way here?
        } break;
        case CurrentState.SubMenu1:
        {
            //How would you erase the previous list and draw it in a different way here?
        } break;
        case CurrentState.SubMenu2:
        {
            //How would you erase the previous list and draw it in a different way here?
        } break;
    }
}


texts:
Are there any known libs / frameworks / systems allowing to prototype a game based on a defined "model" of the game mechanics?

Think all those match 3 games, i'm looking for "something" allowing to try out new rule sets in rapid prototypes where dealing with the grafix/updating the screen based on the state and input/output is only secondary and having something running and interactive is most important to validate an idea...

Do such tools exist? What would be your take on this when asked to skip as much coding as possible?

To clarify: nope I am NOT looking for any magic. What I am looking for are tools allowing to concentrate more on the "logic" of a game (atleast for simple games ala match 3) and not having to code all the screen/input/ui stuff, thus the "model driven" naming...


texts:
I'm using the function Transform.RotateAround in order to make my player rotate around objects in my game, it's the main feature.
The thing is, when I'm making my levels harder and make the objects (that the player rotates around) dynamic and add some movement on the X & Y axis, the rotation movement is inconsistent, obviously, since the function recalculates each frame a different pivot to rotate around, the player distance from the object changes and not staying static throughout the rotation cycles.
The question is, is there a way to get around this and make the player rotate around the object in a static, permanent distance from the object even though it's moving?
Maybe by predicting the movement of the object or somehow "diffusing" the effect of the object movement..?
Any comment would be helpful.
Thanks in advance!


texts:
I'm using Linq to select the objects closest to the player that have the usable tag thusly:

GameObject[] usables = GameObject.FindGameObjectsWithTag("Usable")
    .Where(t => Vector3.Distance(t.transform.position, playerT.position) < useDistance)
    .ToArray();

This works as I intended, but I'd like to further narrow it down to the closest object in that array so the Linq query returns only the single closest GO.  Linq is, however, a serious weak spot for me.  Any thoughts on how that would look?

Thanks!


texts:
I'm very new to Unity. I'm messing around, just trying to get my bearings, but I'm having trouble getting a character model to animate with the clothes correctly. This is the asset that I'm using.

I've created a ThirdPersonController, and dropped my model into it. When I hit play, the base character moves and is animated, but the clothes stay in the default position.

The ReadMe for the asset says:

  Attaching clothing(Classes): Add the
  "AttachToBody" script to the clothing,
  the cloths must be inside the
  character to work.

I believe I have done this but I could be wrong. I have an error in Unity which says

  Wrong parent body

Which I can see in the code for the AttachToBody.cs

    if (bodyBones == null)
    {
        Debug.LogError ("Wrong parent body.");
        return;
    }

Could somebody help me out and tell me where I'm going wrong please?

I've attached a screenshot for reference (you'll need to open in a new tab to see the hierarchy properly).

Here is the full AttachToBody.cs script

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

/**
 * This matches the cloth movement to a character, the clothing must be inside the character.
 **/
public class AttachToBody : MonoBehaviour
{

    void Start ()
    {
        int i = 0;
        Transform rootParent = transform.root.transform;
        GameObject target;
        Transform[] bodyBones = null;
        for (i = 0; i < rootParent.GetChildCount (); i++)
        {
            target = rootParent.GetChild (i).gameObject;
            if (target.GetComponent<SkinnedMeshRenderer> () != null)
            {
                bodyBones = target.GetComponent<SkinnedMeshRenderer> ().bones;
                break;
            }
        }

        if (bodyBones == null)
        {
            Debug.LogError ("Wrong parent body.");
            return;
        }

        GameObject Attachment;

        for(i = 0; i < transform.GetChildCount(); i++)
        {
            Attachment = transform.GetChild(i).gameObject;
            if (Attachment.GetComponent<SkinnedMeshRenderer> () != null)
            {
                Attachment.GetComponent<SkinnedMeshRenderer> ().bones = bodyBones;
            }
        }
    }
}

So I can determine that the following line is null, but I'm not really sure what target is or where to go from there.

target.GetComponent<SkinnedMeshRenderer> () != null

Why doesn't my character's outfit animate with the character model?


texts:
Is this the right way, or at least a way that works, for dealing with accelerations in variable time steps evironments?

    // Pseudo-code
    void onUpdate() {
        mySpeed += acceleration * timeElapsed; // More specifically, this part
        myPosition += mySpeed * timeElapsed;
    }

Truth to be said, I'm using a constant timeElapsed defined by (1.0f / FPS_LIMIT), FPS_LIMIT being the value of the framerate at which I want the game to be locked. Speeds and accelerations are defined in the following ways:

    #define FRAME_DURATION (1.0f / FPS_LIMIT)

    #define RUNNING_SPEED 42 * FRAME_DURATION
    #define GRAVITY 42 * FRAME_DURATION

And I have noticed that, the further I increase my FPS_LIMIT, the faster things accelerate. Well, it's obvious (or not) that I'm using flawed logic to define the acceleration constants, but I'd also like to know what then I'm doing wrong and what'd be the right way to calculate these values, because what I'll pretty much be doing through my scripts will be as simple as this:

    void onUpdate() {
        mySpeed += acceleration;
        myPosition += mySpeed;
    }

As if framerate-independence didn't even exist.

If you want to get technical, I'm using simple SFML for the fixed time steps, through a window.setFramerateLimit(FPS_LIMIT) call.


texts: Unturned weapon modification not spawning in singleplayer

texts:
I've been working on my first modification for Unturned and I'm having some serious trouble doing the process due to the lack of up-to-date tutorials on modding weapons.

I've done everything I can to make it, and I was finally able to create a bundle and export the .unity3d file into the copied folder for my modded gun. However, when I go into Unturned and actually attempt to spawn it, nothing works.

I'm assuming it's the version of Unity that I'm using (Unity 5 2.4), even though I followed the instructions correctly while in the editor. Please help, I really need a solution, because I've been at it for weeks now and no one has been able to provide any solution.


texts: Animator State does not switch immediately through code, even tho all transitions have "Has Exit Time" checked off

texts:
first of all, this is my code, I'm prototyping a state machine using Unity Animator (First Time) and I'm stuck coding a simple burst of speed.

using UnityEngine;
using UnityEngine.AI;

[CreateAssetMenu(fileName = "Dash", menuName = "States/Dash")]
class Dash : State
{
    NavMeshAgent agent;
    [SerializeField] float Speed = 50;
    [SerializeField] float Distance = 1;
    float oldSpeed,counter, duration;

    public override void onStart(Animator animator, AnimatorStateInfo stateInfo)
    {
        agent = animator.GetComponent<NavMeshAgent>();
        duration = Distance / Speed;
        oldSpeed = agent.speed;
        agent.speed = Speed;
        counter = 0;
    }

    public override void onUpdate(Animator animator, AnimatorStateInfo stateInfo)
    {
        counter += Time.deltaTime;
        Debug.Log(counter + " of " + duration);
        if(counter > duration)
        {
            Debug.LogError("Dash is finished");
            agent.speed = oldSpeed;
            animator.SetBool("isDashing", false);
        }
    }

    public override void onExit(Animator animator, AnimatorStateInfo stateInfo)
    {

    }

}

The issue is that the player standstill for few second after dashing. So I've added some debug.log and this is the result.

As you can see, the state keeps updating even tho the timer has ran up. It even keeps updating after switching to "Idle" state, tho this ends at some point. I've made sure that all transitions have "Has Exit Time" checked off and the Interruption Source = "Current State".

Note: this is just a prototype and the states have no animations still.


texts: Some autocompletion doesn't work in Visual Studio Code with Unity

texts:
I am using Unity 2018 with Visual Studio Code version 1.43.2 on a Mac.

Things seemed to work fine between Unity and Visual Studio Code, but now I realize that something is wrong with Code. I have been following along with a tutorial and the autocompletion functionality of Code seemed fine until the function OnTriggerEnter, which was shown as autocompleting for the guy in the video (who was using the other Visual Studio), didn't fill in. However, many other Unity things do automatically show up as options.

I looked at this Microsoft help page about VS Code and Unity, and I have everything it I seems I would possibly need to combine the two; I have .NET, Mono, Debugger for Unity, the C# extension, and got Unity Tools for good measure.

Generic C# things like return, void, int, etc. autocomplete, so the C# extension seems fine. Many Unity things, like Vector3, GameObject, Destroy, transform, etc. also autocomplete like they should.

What is wrong here? How can I fix this and get full autocomplete?


texts: FBX animation works in 3DSMax but not with Assimp

texts:
I have an FBX file that represent a plane with an animation of the gear opening. In my editor 3DSMax or in the Unity editor, the file and animation seem good, but when I use Open 3D Model(the official viewer of Assimp) or when I call the FBX file simply in an application, to see what the file will look like with the use of Assimp, I got some issues.

The object seems normal at the beginning, but when I try to launch the animation, all my animated elements are going crazy.

Here's what it looks like :

Here's my FBX FILE

Do you have experience something similar ? Does it come from my file or a parameter in Assimp ?

I am beginning to think that there is a problem with how Assimp handles pivot points, looks like objects are rotating using a different pivot point in Unity/open3mod.


texts: Monitoring and storing chat logs in a 3D space

texts:
There are a lot of 3D games on the market with text chat functionality holding literally thousands of conversations happening at the same time.

Being in a 3D space is there a defacto method of monitoring and storing these?

The difficulty I can see is that not all text is visible to all participants at all times meaning a raw chat log wouldn't make any sense, with having so many conversations occurring in real time.


texts: How to remove a component of an object in a script?

texts: I want to remove a Sphere Mesh Renderer component from a certain gameobject. I want to do this in a script. How do I do it? I do not want to destroy the sphere itself, just the component


texts: How do games using physic engines for 2d games handle platform corners?

texts:
I have seen games like latest "2'5D" sonics that handle collision detection at platform corners pretty well. The problem I'm having is that my game uses an ellipsoid as my player's body to let it move on slopes, etc... But when it gets close to the end of a platform (which has a rectangular collider) the collision is not correct because the player collider is not rectangular too.

How do they do collision on the edges to get an smooth movement and don't seem like the player is falling through the edge?.


texts:
I have two points representing a line, and a player position. I translated and rotated the points around the player, and this works just fine.
Next I want to clip the resulting line like Bisqwit did it in his video (around 2:30-3:40), so that walls behind you won't be seen and the wall is clipped to the screen, but I don't really understand where all these constants in the code came from.
Here is the link to his code.
And here is my actual code rewritten in terrible Pascal (I just use it for testing :D )
program graph3dtest;
uses graph,crt, math;

// here we will set up the graphics routines
// and other stuff
procedure initgraphics;
var gd,gm: smallint;
begin
  gd:=detect; // detect the graphic size
  gm:=0;      // autodetect
  InitGraph(gd,gm,'');     // this '' is not needed for the moment...
  if GraphResult<>grok then begin
    // this is needed in case the driver won't start
    writeln(' *** ERROR *** ');
    writeln(' FATAL ERROR WHILE STARTING GRAPH UNIT... ');
    CloseGraph;
    halt;
  end;
end;

// gloabal variables here --- !
var
   vx1,vx2,vy1,vy2,px,py,angle:real;
   hwidth,hheight:real;
   tx1,tx2,ty1,ty2,tz1,tz2: real;
   running: boolean;
   kbpress: char;   // keyboard pressed
   x1,y1a,y1b,x2,y2a,y2b: integer;
   width,height: integer;
begin
  initgraphics;
  // main code here
  hwidth:=GetMaxX/2;
  hheight:=GetMaxY/2;
  circle(round(hwidth),round(hheight),10);
  writeln(hwidth,hheight);
  running:=TRUE;
  // set up variables
  vx1:=70; vy1:=20;
  vx2:=70; vy2:=70;
  px:=50; py:=50; angle:=0;
  while(running) do
  begin
    circle(round(hwidth),round(hheight),2);
    // transform the points
    tx1:=vx1 - px; tx2:=vx2 - px;
    ty1:=vy1 - py; ty2:=vy2 - py;
    // rotate them around the player
    tz1:=tx1*cos(angle) + ty1*sin(angle);
    tz2:=tx2*cos(angle) + ty2*sin(angle);
    tx1:=tx1*sin(angle) - ty1*cos(angle);
    tx2:=tx2*sin(angle) - ty2*cos(angle);
    line(round(hwidth-tx1),round(hheight-tz1),round(hwidth-tx2),round(hheight-tz2));
    // calculate the perspective projection
    x1 := round(-tx1*16/tz1); y1a:=round(-hheight/tz1); y1b:=round(hheight/tz1);
    x2 := round(-tx2*16/tz2); y2a:=round(-hheight/tz2); y2b:=round(hheight/tz2);
    width:=round(hwidth);
    height:=round(hheight);
    line(width+x1,height+y1a,width+x2,height+y2a);
    line(width+x1,height+y1b,width+x2,height+y2b);
    line(width+x1,height+y1a,width+x1,height+y1b);
    line(width+x2,height+y2a,width+x2,height+y2b);
    // get kb input
    if(keypressed) then
    begin
      kbpress:=readkey;
      if(kbpress='q') then running:=FALSE;
      if(kbpress='w') then
      begin
         ClearDevice;     // clear the screen
         px:=px+cos(angle); py:=py+sin(angle);
      end;
      if(kbpress='s') then
      begin
         ClearDevice;
         px:=px-cos(angle); py:=py-sin(angle);
      end;
      if(kbpress='a') then
      begin
         ClearDevice;
         angle:=angle-0.1;
      end;
      if(kbpress='d') then
      begin
         ClearDevice;
         angle:=angle+0.1;
      end;
    end;
  end;
end.

I hope you can explain it to me so that I understand it.
So the important question is the following:
Why does he use in the SUB intersect 12 variables (ok 2 are redundant because the implement ix and iy) and why do he use such numbers like 0.0001 and -20 and 5?


texts: Choosing a level editor of a 2d platformer

texts:
I'm working with a small team on a 2D platformer game in Java (LibGDX) that uses Box2D for physics.
Our team is looking for a tool to make the levels (that we will be able to integrate with the Box2D physics, and the graphics).
We want a tool that is able to work with polygons (not with tiles), and that can be used from Linux (and preferably Open Source).
Any suggestions ?

(Of-course I can write a little level-editor specific to our game, and if this is the case please write, but I would like to avoid that if there is another way )


texts:
Disclaimer: It may be that I'm already doing all the "right" things, but just don't have enough traffic for it to pay off with people giving feedback.

My question is: how do you attract early and quality feedback into games, from end-users? Ideally, I'm looking at a model where the seed of an idea comes from you (or from them, even) and you build it into a game, molding it along the lines that people tell you are best.

Because you're just one opinion. And game developers have a reputation for doing weird and sub-par quality stuff, sometimes.

I'm currently practicing the following:

VIP List: I have a "VIP" mailing list (mostly friends) who agreed to try out game releases and give me feedback. They seem hesitant to say anything negative, and most of them are not really gamers, just doing it because they know me and like my niche.
2-4 Week Releases: I use a form of agile and release iterations every two to four weeks. This means every release is functionally small, but somewhat polished.
Press-Releases: With every release, I also post a small "press release" post identifying the good, the bad, what's next, and screenshots (along with a link to play the latest release version).

I'm not getting that much feedback. What am I missing?


texts:
I asked about this question How to efficiently implement a 7-segment display? in previous post. Now I just add an update function to the last part of the code to display the time(I don't bother the exact time at the moment just want to make sure the number change regularly). However,I'm not sure why the update only run once, I checked the answer in this website, mentioned the root cause is gameobject deactivated(Update function only running once) but this is not my case. I tried with void OnMouseDown(){Display(DateTime.Now.Second)}, the number does change according to my mouse button so I'm not sure what wrong with Update function. In addition, I assigned all the variable but it still pop out message unassigned reference exception, not sure where the problem.
using System;
using UnityEngine;

public class ClockDigit : MonoBehaviour
{
//  Assuming you number your segments as follows:
//   -- 0 --
//  |       |
//  5       1
//  |       |
//   -- 6 --
//  |       |
//  4       2
//  |       |
//   -- 3 --
// Store a lookup table for which segments
// should be active when displaying each digit.
static readonly bool[,] SEGMENT_IS_ACTIVE = new bool[,] {

    {true,  true,  true,  true,  true,  true,  false}, // 0
    {false, true,  true,  false, false, false, false}, // 1
    {true,  true,  false, true,  true,  false, true }, // 2
    {true,  true,  true,  true,  false, false, true }, // 3
    {false, true,  true,  false, false, true,  true }, // 4
    {true,  false, true,  true,  false, true,  true }, // 5
    {true,  false, true,  true,  true,  true,  true }, // 6
    {true,  true,  true,  false, false, false, false}, // 7
    {true,  true,  true,  true,  true,  true,  true }, // 8
    {true,  true,  true,  true,  false, true,  true }  // 9
};

public Color32 activeColour = Color.red;
public Color32 inactiveColour = Color.black;
public SpriteRenderer[] segments = new SpriteRenderer[7];

public void Display(int number)
{
    var digit = number % 10;
    if (digit < 0) digit *= -1;
    for (int i = 0; i < 7; i++)
    {
        if (SEGMENT_IS_ACTIVE[digit, i])
        {
            segments[i].color = activeColour;
        }
        else
        {
            segments[i].color = inactiveColour;
        }
    }
}

public void Update()
{
    Display(DateTime.Now.Second);

}
}

I tried this command also, the infinite loop freeze the Unity and FixedUpdate() command also update the frame only one time.
void Update()
    {while(true)
      Display(DateTime.Now.Second);
    }


texts: Best way to handle realtime melee AI in authoritative network environment

texts:
So i've been working on a multiplayer game for a bit; it's a co-op action RPG with real-time combat. If you've seen or played TERA, I'd say it's comparable to that, but not an MMO, heh.
I'm currently handling the AI units authoritatively, the server calculates their pathing, movement, and pursue/attack logic, and syncs the movement to the clients 15x per second, and the state changes when they happen.

When I emulate 200ms ping, though, the client can perceive being out of range to an AI's attack, but still take the hit, because on the server he hadn't moved that far yet. This also plays hell with my real-time blocking.

I don't really want to allow the clients to be allowed to say "that was out of range" or "I blocked that", but I'm not really sure how else to handle it.


texts:
I'm stuck on my computer graphics class homework. I'm sorry if this is not right place to ask. I think this is closest thing to computer graphics.

My assignment is to create basic 2D colored polygons at original position and another same polygon transformed to new location.

I am required to implement translation, rotation, scale using transform matrix. I believe I wrote my translation and scale correctly but I think rotation is having issues and I can't seem to figure what's wrong. Can you point out what's wrong?

This is what image is supposed to look like.

Here's how I did it, I stored 3x3 transform matrix for each polygon. The Driver code provided by my professor, will call transformation functions, translate(x,y), rotate(deg), scale(x,y), and clearTransform(), to modify the matrix of each polygon. It does not modify polygon's vertices until it's the time to render the whole image. When it is time to render, I multiplied the transform matrix with each vertex of the polygon. After the multiplication, I fed the new vertices to drawPoly() function and we get an image.

Here are two functions that I believe works correctly.
Translation code:

transform[0][2] = x + transform[0][2];
transform[1][2] = y + transform[1][2];

Scale code:

transform[0][0] = x * transform[0][0];
transform[1][1] = y * transform[1][1];

Now, here's my rotation code.

float radian = 0.0174532925;
transform[0][0] = std::cos(degrees*radian) * transform[0][0];
if(transform[0][1] == 0){
    transform[0][1] = -(std::sin(degrees*radian));
}else{
    transform[0][1] = -(std::sin(degrees*radian)) * transform[0][1];
}
if(transform[1][0] == 0){
    transform[1][0] = std::sin(degrees*radian);
}else{
    transform[1][0] = std::sin(degrees*radian) * transform[1][0];
}
transform[1][1] = std::cos(degrees*radian) * transform[1][1];

So far how I understand it, those 'if' statements are necessary for rotation because the identity(original) transform matrix is supposed to only have ones on middle diagonal and zeros everywhere. If I tried to apply sine functions on that zero, it will remain zero and image will scale instead of rotate.

What's the error in the code that is causing my image to show up incorrectly?


texts: melonJS: Entity and solid block on collision layer

texts:
Actually I have my player entity with 64x64 sprite animation and 18x60 hitbox also the map is made by 16x16 tiles.
When my player goes some way he can pass through blocks (but not all of them).
For example there are 4 situations:

Good (player can't pass the tile with isSolid property on collision layer)

Good (player can't pass the tile with isSolid property on collision layer)

Bad (player pass the tile with isSolid property on collision layer)

Bad (player pass the tile with isSolid property on collision layer)

Looks like melonJS checks only corners of hitbox instead of whole rectangle.
Can anyone help me in this situation.

UPD: my PlayerEntity.

var PlayerEntity = me.ObjectEntity.extend({
    init: function(x, y, settings) {
            settings.image = "player";
            settings.spritewidth = 64;
            settings.spriteheight = 64;
            this.parent(x, y, settings);
            this.setVelocity(3, 10);
            this.updateColRect(23, 18, 4, 60);
            me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH);
            this.direction = 'stand2';
            this.addAnimation("run", [0,1,2,3,4,5,6,7,8,9]);
            this.addAnimation("stand", [33]);
            this.addAnimation("stand2", [44]);
            this.addAnimation("jump", [29,29,29,29,29,29,29,29,27,27]);
            this.addAnimation("jump2", [26,27,27,27,29,29,27,27,26]);
    },
    update: function() {
            hadSpeed = this.vel.y != 0 || this.vel.x != 0 ;
            if(hadSpeed)
                this.animationspeed = me.sys.fps / 10;

            if (me.input.isKeyPressed('left')) {
                this.jumping ? this.setCurrentAnimation('jump2') : this.setCurrentAnimation('run');
                this.flipX(false);
                this.vel.x = -this.accel.x * me.timer.tick;
                this.direction = 'left';
            }
            ...
            right/jump etc goes here
            ...
            updated = this.updateMovement();
            if (!hadSpeed) this.setCurrentAnimation('stand');
            if (updated) this.parent(this);
            return updated;
    }
});


texts: Old Age: Decreasing stats/attributes as characters level up

texts:
I just had an off the cuff idea of decreasing stats (strength/speed/stamina) as players level up.  After all, higher level characters should have higher level of challenge!  (And it's not hard to rationalize as a character aging & weakening process)

I would put a minimum on the decrease, of course, and provide items, armor, and skills to provide increased offense and defense by active actions.

I haven't seen this done in any game I can remember, though.  What are the downsides that I'm probably missing? (apart from player dis-incentivizing).


texts: Designing an entity system for a tile-based puzzle game

texts:
I'm developing a tile-based game creation library in C# and along with it I'm creating a game to test all of its functions.

This is a screenshot of the game:

You've probably never heard of the original, but my game is a clone of Deadly Rooms of Death (DROD), which you can find at http://caravelgames.com

Anyway, as you can see from the screenshot, my game (and my library) is all about 2D puzzle games on a grid, rigorously turn based.

My library has this structure:

Entity: class that gets updated every turn and every game elements inherits from
Tile: class that holds entities (any amount of entities)
TileManager: class that contains a 2D array of all the tiles
Field: class that contains a TileManager and all the methods for querying it and finding entities

For fast queries and flexibility, I'm using interfaces and inheritance to group entities.
Let me explain with code for the roach entity:

public class TDLMonster : TDEntity, IHasTarget, IDrawn, IHasDirection, ISolid,
IHitByWeapon, IHitByMonster
{
...
}

The TDLMonster class inherits from TDEntity (which inherits from Entity). It also uses interfaces as a way to mark certain properties of elements.

public interface IHitByWeapon : IEntity
{
    void HitBySword(IWeapon mWeapon);
}

This is the IHitByWeapon interface. After every turn, weapons check if there is any instance of IHitByWeapon on their tile. If there is, call HitBySword. Here's the code that does this:

 public virtual void CheckHits()
    {
        List<Entity> hitEntities = Field.GetEntities(X, Y, typeof (IHitByWeapon));
        for (int i = 0; i < hitEntities.Count; i++)
        {
            IHitByWeapon hitEntity = (IHitByWeapon) hitEntities[i];
            hitEntity.HitByWeapon(this);
        }
    }

Field.GetEntities(x, y, type) returns a list of entities of that type in a specific tile. When an entity is initialized, my library gets all the types and interfaces using the following code snippet, then puts the entity in dictionaries having types and interfaces as keys:

public static List<Type> GetAllTypes(Entity mEntity)
    {
        List<Type> types = new List<Type> {mEntity.GetType()};
        Type[] nestedTypes = mEntity.GetType().GetNestedTypes();
        types.AddRange(nestedTypes);
        Type[] interfaces = mEntity.GetType().GetInterfaces();
        types.AddRange(interfaces);

        foreach (Type type in nestedTypes) types.AddRange(type.GetInterfaces());

        return types;
    }
...
foreach (Type type in GetAllTypes(this))
            {
                if (!Tile.TileManager.GroupedEntities.ContainsKey(type))              Tile.TileManager.GroupedEntities.Add(type, new List<Entity>());
                Tile.TileManager.GroupedEntities[type].Add(this);
            }

My library/game is relies completely on types and interfaces.

This is a good thing because I know what methods and properties entities have, and because different entities can share the same interface. I can have 20 different types of monsters, but as long as they implement IHitByWeapon they will all get killed by the player's sword.

This is a bad thing because it relies on hardcoding elements, and I cannot manipulate interfaces at runtime. Let's say I have a door element. I need it to be solid when the door is closed and to be non-solid when the door is open. If the element implements ISolid I cannot remove it. The same problem applies if I suddenly want a flying roach. I would have to code another element that implements ICanFly, because I cannot add an interface to an entity at runtime.

I've thought about using a List of stuff like "solid", "enemy", "player" - but it's not flexible enough, since I cannot have interface-like methods or properties, and I need to guess if the entity has a method or use the dynamic keyword.

How can I solve this problem? Is there something that lets me have the ease of use as interfaces but also the flexibility as List?

Let me know if you need more information or parts of the source code.