Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


irbaboon

Member Since 07 Oct 2011
Offline Last Active Yesterday, 06:55 PM

Topics I've Started

I'm feeling lucky

31 July 2014 - 03:51 PM

I'm feeling lucky.

 

Attached File  777.png   571bytes   2 downloads


Terrain - map editor

10 July 2014 - 06:45 PM

I've been getting into 3D for a while now, and I'm using Bullet Physics for physics, and OpenGL 3+ for graphics.

Up until now, I've used Blender to create a map, and then load it to a btBvhTriangleMeshShape for use in Bullet. 

 

However, I want to create a map editor, and I first thought the easiest way would be to use a heightmap. This requires the entire terrain to be in a grid however, and that makes it hard to make good terrain without making a small grid full of unnecessary vertices. Therefore it seems like I can't use that.

 

I've tried Googling for resources on how I should go about this, but it's always topics which do not help me.

What I've been thinking about is to make the map in the editor a btBvhTriangleMeshShape, but I don't see any way to quickly modify vertices.

 

I hope anyone can give me some advice on what I should do.

 

Thanks.


Circular Dependency with Pimpls

06 May 2014 - 10:43 AM

I'm currently writing a wrapper, and I am using pimpl to be able to use the same interface for multiple libraries. I'm not quite sure if I'm approaching this in a good way however. Is it worth using pimpl for things that aren't platform specific? What I'm writing now is a Bullet Physics library wrapper. I have made a RigidBody class and a World class. These classes then have their respective "btRigidBody" and "btDiscreteDynamicsWorld" pointers. My goal is to make my API consistent and not need to use any Bullet code in my client code.

 

Now, to my problem:

The World class needs to access RigidBody's btRigidBody pointer. And the RigidBody needs World's btDiscreteDynamicsWorld pointer.

How do I do this without having any Bullet-specific includes in the header files?

 

I have come up with an idea, but I feel that it is relatively ugly. My idea is that I have a "void* getRigidBody()" and "void* getWorld()", and then cast them to either btRigidBody* or btDiscreteDynamicsWorld*. 

 

I could just go ahead and implement that idea, but it feels like I'm thinking about this in a wrong way.

Does anyone have any suggestions?

 

Thanks in advance.


Autotiling

07 September 2013 - 03:07 PM

How do I autotile properly?

 

Right now, I have tried using this method: http://www.codeproject.com/Articles/106884/Implementing-Auto-tiling-Functionality-in-a-Tile-M

(and I've read the source code on there - that's how I wrote my own version of it, as the article was very abstractly written)

 

The problem is, however, that I cannot get it to use more than one tilesheet. (two tiles - dirt and grass)

 

I have been trying and trying for a long time to do it, and I've come across a lot of ways.

Like, making the tilesheet only have one tile, and the secondary tile being transparent - so there are limitless combinations, I also tried making a 9x9 tile that would overlap or underlap neighbour tiles depending on depth, but our pixel artist really dislikes this idea, and what I've primarily tried is making all the tiles have a main tile, like "dirt" "grass" or "water". I then named the tilesheets for "dirt grass", "dirt water", "grass water".

I then made two algorithms, which both failed, to find out what tileset to use for each neighbour around the new tile.

 

I am surprised that there is relatively very little information I find on Google about autotiling. Every result goes back to a few articles, which only covers the basics.

 

Am I missing some big thing with this method?

Are there any other methods that can be used?

 

Thanks in advance!


Storing class with a template in an array?

26 July 2013 - 09:49 AM

I've always had a resource manager in my client software that has different resource containers.

Basically this:

 

in library:

template<class _Type>
class Container {
   // code dealing with loading resources
};

in client:

class Resources {
public:
    Container<Sprite> sprite;
    Container<Music> music;
    Container<Font> font;
};

So in the client code, you just use it like this:

Sprite* player_idle = res->sprite["Objects"]["Characters"]["Player"]("idle");

I won't get into any more detail, but you now understand how it works, I presume.

 

So what I want is to have the "Resources" class in the library.

 

I want it to be like this:

class Resources {
    std::vector<Container<?>> _containers;
public:
    template<class _Type>
    void add_type() {
        _containers.push_back(Container<_Type>());
    }
};

But that won't work, as the std::vector class only takes one specific type.

 

I've thought of making a wrapper class of every resource type, and just base them off a class, but that seems like a very unelegant solution, both for the library and client.

 

I could also just use a switch, but what would be the point - the client would not be able to create new types that way.

 

Thanks in advance! :)


PARTNERS