Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 10 Nov 2006
Offline Last Active Yesterday, 04:47 AM

#5253401 Game Development Laptop

Posted by Ashaman73 on 22 September 2015 - 12:49 AM

I've a custom 11'' laptop for development with a dedicated GPU (really hard to find !) and it works great when not home, but it is not comparable to a desktop setup. It isn't really the power, but the missing screenspace. Using several tools concurrently on a single screen limits the usage of my laptop to some scripting or modelling. But the heavy works need to be done at my desktop PC wub.png .

#5253392 Loading multiple LUA tables as data

Posted by Ashaman73 on 21 September 2015 - 11:03 PM

Edit: Small question, If I follow that last suggestion, how do I access the tables contained within "my_data_container"

If you just declare a variable in a file using dofile, it is automatically global. Therefor you can handle it like any other global variable

local item = my_data_container.ID1
local item2 = my_data_container["ID1"]

#5253386 Loading multiple LUA tables as data

Posted by Ashaman73 on 21 September 2015 - 10:16 PM

Create a read function, then enclose your data  with the read which handles the data.

Example main.lua

my_data_container = {}

read = function( _chunk)
  -- get id
  local id = _chunk.id
  -- assign table to container
  my_data_container[id] = _chunk

.. do some processing..


You data should look like this

    id = "ID1",
    name = "Description 1",
    mod = 20

    id = "ID2",
    name = "Description 2",
    mod = -15

When calling a function with just a table you can leave the parentheses away:

    id = "ID1",
    name = "Description 1",
    mod = 20

    id = "ID2",
    name = "Description 2",
    mod = -15

Alternative for full-data table without the need of any processing just setup your data like this:

my_data_container = 
  ID1 =
    name = "Description 1",
    mod = 20
  ID2 = 
    name = "Description 2",
    mod = -15

#5252624 A General copy constructor question

Posted by Ashaman73 on 17 September 2015 - 03:16 AM

QuadNode(int id, long t)
: TimeAStarNode(this->ancestor, this->m_quadNode, this->path_cost, this->estimated_cost, this->t, this->depth)
// overwrites current id
this->id = id;
this->parent = NULL; ;
this->transition = 0;

No, this will pass the un-initialized/unknown attributes to the parent class. This will not really work.


Something like this would do

    QuadNode(const QuadNode& node,int id, long t)
        : TimeAStarNode(node.ancestor, node.m_quadNode, node.path_cost, node.estimated_cost, node.t, node.depth)
// optional standard copy constructor code from above...

        // overwrites current id
        this->id = id;
        this->parent = NULL; ;
        this->transition = 0;

Or, if you just want to reassign a new id and t, then add an simple reassign method:

void reassign(int id, long t)
        // overwrites current id
        this->id = id;
        this->parent = NULL; ;
        this->transition = 0;

#5252607 PID steering controller flips from 0° to 178°

Posted by Ashaman73 on 16 September 2015 - 11:51 PM

it spin back around it's self and then enter some flipping loop.

The radius to check if it reached the waypoint is too tight or the speed too high. The problem occurs, when your object shoots beyond the waypoint, then turns around and shoots on the other side all the time, never really coming within the radius of the waypoint.


To ease it:

1. For intermediate waypoints relax the radius.

2. For the final waypoint use the arrival steering behavior (you get slower when approaching your target to avoid this loop).


An other tip:

When checking the radius, it could be useful to ignore the y-component. If you have eg. an high object (center at 1m) and a waypoint at the ground level (0m), then the distance  would be minimal 1m,even when the object sits right on top of the waypoint. When ignoring the y-axis the distance would be 0.

#5252603 Reducing Post-Processing Aliasing ?

Posted by Ashaman73 on 16 September 2015 - 11:13 PM

I'm not using any post AA shaders so maybe that's the route I should go ? Perhaps I can use supersampling, I can probably render to 2x and downsample but will that destroy the effect I'm shooting for ? I don't know what to do or even if I should be working with image-space effects.

Supersampling is 4x the screen resolution, besides memory issues you will have performance issues. Check your video card, I think that nvidia at least provides some hardware AA based on image data alone (FXAA), this could be a quick way to test it out.

#5252601 File format for 3D Meshes and Animations

Posted by Ashaman73 on 16 September 2015 - 11:09 PM

I read a bit about that, but it doesn't really seem to have a lot of support (there's a few unofficial exporters I suppose). I also read a lot of criticism on the way it stores stuff. (For example animations are part of a mesh)

You should consider, that most intermediate formats are really only a temporary step between your modelling tool and your game. FBX and collada are really bloated and are not suited for any serious game project. A common way is, to export to one of the intermediate formats and then convert these formats to a custom format which will be used by your game.


I've used collada for several years, but the (blender) support was really bad and the format is quite complex. Afterwards I have written a custom FBX reader I use up to now. The FBX format is structured in a more clearly way, but it is not a open format.


I would have wished, that I know about OpenGEX before I wrote my FBX converter. Collada and FBX are not designed to be used in a game engine and have lot of stuff which is not really useful in game development, OpenGEX has been designed to be used by games and I would try it out first nowadays.

#5252597 Zombie AI

Posted by Ashaman73 on 16 September 2015 - 10:18 PM

I have absolutely no programming skills because I am an artist, not a programmer.

Here are a lot of programmers who can't do art and looking for someone to help out. Maybe you can exchange some custom models/pixel art whatever you do with some custom script/code smile.png

#5252287 Planet Centauri - 2D Rpg/Sandbox - private beta available on Steam!

Posted by Ashaman73 on 14 September 2015 - 10:58 PM

Awesome art and great work. Gratz !smile.png

#5252125 Alternatives to tiered gear

Posted by Ashaman73 on 13 September 2015 - 11:14 PM

i'm not using vectors or able to swap colors except on shaders

When you use shaders, changing the color is quite easy. An old trick in 2d art is to use an else unused color (e.g. pink XX00XX)  to recolor parts of the image.

E.g. you have the bodyarmor part colored in pink-scale, a shader could look like this

const float THRESHOLD = 3.0/256.0;
vec4 texel = ...get texel of sprite
if(texel.g==0 && abs(texel.r-texel.b)<THRESHOLD) {
  // recolor texel
  texel.rgb = armor_color.rgb * texel.r; // r=b holding value

#5251675 Whats True -1?

Posted by Ashaman73 on 11 September 2015 - 12:36 AM

(i'm using Android Java on eclipse).


You are talking about java, not C or C++. So, you need a boolean in an if-statement, no int or float. Therefor this will not compile in java:

 if(  (q == hh) - 1.0f ){ ... }

First, you can't substract a float from a boolean, second, you can't have a non-boolean statement in an if-statement.


 if(  q == hh - 1.0f ){ ... }

will compile and it will first substract 1.0f from hh and then compare the result to q.

#5251465 Next Step: Proper NPC Design

Posted by Ashaman73 on 09 September 2015 - 10:34 PM

The old ultima games (hmm.. part IV or V ?) have some nice behavior. In general, I would recommend (thought somewhat technically) to move behavior to single objects. That is, instead of a NPC who knows that he needs to eat at a tavern table, the tavern table provides the interaction to eat. This makes it a lot easier to let your NPCs interact with the world (the NPCs in Sims interact like this).


Simple example:


tavern: lot of table objects, which provides "eat" interaction

home: bed, which provides "sleep" interaciton for NPC Harry

field: corn objects which provides "farmer_work" interaction


NPC Harry, simple behavior tree (behavior trees, in short BHT, are a technically AI implementation) :

- check_if_hungry
--> scan for eat interaction objects
--> find path to eat object
--> move to target
--> start interaction "eat" with target object (play animation,remove food items, update hungry state )
- is_morning
--> scan for farmer_work interaction objects
--> find path to farmer_work object
--> move to target
--> start interaction "farmer_work" with target object (play animation, produce new items, put them in inventory etc.)
- is_evening
--> scan for sleep interaction objects
--> find path to sleep object
--> move to target
--> start interaction "sleep" with target object (play animation,start snoring sound etc. )

Behavior can be reused and combined. New behavior can be added with ease (monster near->panic/combat, guards who seek objects with the interaction "catch_criminal", the player can get marked as "catch_criminal" after stealing something etc.)

#5251299 System requirements

Posted by Ashaman73 on 09 September 2015 - 03:28 AM

It depends on the game you want to develop. Personally I would only consider a laptop with dedicated, at least mid-performance, GPU.

#5251260 How do you divide 1.6 / 0.1

Posted by Ashaman73 on 08 September 2015 - 10:18 PM

I think that it is not a matter of rounding, I guess that you use a variable (mass) which got either not properly initiliased or overwritten. Output the variable just before doing the calculation to check it.

#5251112 3D Rotation Maths Help (Global Rotation)

Posted by Ashaman73 on 08 September 2015 - 12:31 AM

It depends on the order of the mulitplications.

If you have M*R, you need to read it from right to left:  first rotate it by R (still in local space), then apply M (moving it into world space).

So, instead try R*M, that is, first transform it into world space, then rotate it around (0,0,0) by applying R.