Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Jul 2009
Offline Last Active Oct 15 2014 07:15 PM

#4832976 First Person RPG/Slasher

Posted by PrestoChung on 08 July 2011 - 07:03 PM

Well personally I don't like 3rd person perspective unless it's a Strategy game or something similar.

For role-playing I find the FPS view to be much more immersive.

#4829876 Random Level Builder Help

Posted by PrestoChung on 30 June 2011 - 09:54 PM

Have you tried debugging it step-by-step?

Maybe adding some asserts would help pinpoint the problem(s).

#4828357 Custom storage class - Look at my code?

Posted by PrestoChung on 27 June 2011 - 12:34 PM

I have created a storage class to store arbitrary objects in linear memory. I think this is essentially a memory allocator but it stores a little information about the object allocated (size in bytes, number of objects)

This was originally meant to be the method of storing Components in an Entity-System.

Usually I hear that the STL is a better idea.
The obvious STL analogue is the std::vector. But the problem is how to store references to std::vector elements?
If you store a pointer to an element, that pointer may become invalid by re-sizing of the vector.
If you store an index, that index may also change.

The other problem is storing generic collections of std::vectors. Because it is a template you cannot have a homogenous collection of std::vectors: each one is a different type.
That is why this storage class is not a template: if it was a template I could not create a structure such as
Storage myStors[10]
if Storage is a template<>

There are two supplemental classes that are to help manage the allocation and ownership of the elements: Range and Rangeset.

Range is just what it sounds like, it is a minimum and maximum value. A Rangeset is a sorted linked-list of Ranges so that ownership of elements need not always be 100% contiguous.

The Storage keeps track of which elements are available with it's own Rangeset, which should be disjoint with the Rangesets of the Entities that have ownership of the objects.

Again I have found that a situation such as this will be necessary to hold object Entities themselves if I want them to be contiguous in memory: they will require references to parents and children which can't be stored as pointers to std::vector elements because of the aforesaid considerations.

Please correct me if I am causing myself too much trouble!

Here is a link to the code (about 850 lines): http://dl.dropbox.com/u/78425/stor.h

#4824937 The Worst of E3 2011

Posted by PrestoChung on 18 June 2011 - 08:58 PM


#4811737 What is the most immersive game you have played?

Posted by PrestoChung on 16 May 2011 - 08:09 PM


#4807240 Passing pointer of a struct to a function

Posted by PrestoChung on 05 May 2011 - 10:17 PM

struct foo{

	int m;


void dofoo( foo* afoo ){



foo myfoo;

dofoo( &myfoo );

#4769021 Looking for procedural game design

Posted by PrestoChung on 03 February 2011 - 08:39 AM

This is an issue where my brain is really stuck right now. I've managed to generate a world that looks great from a distance, but as I zoom in the borders in between the tiles form straight edges etc. Could you describe more on how one can zoom into some kind noise function and genereate the noise there with a better "resolution"?

Zooming in and out just becomes a matter of showing (or generating) more detail (finer sampling) close to the camera. This is a sort of LOD problem.

With the terrain I generated I used a geometry clipmap similar to this http://research.microsoft.com/en-us/um/people/hoppe/proj/geomclipmap/

#4768455 Looking for procedural game design

Posted by PrestoChung on 02 February 2011 - 06:44 AM

Im looking for some kind of Noise function that takes two float values x and y and returns a value in between -1 and 1. I've been googling around for Perlin Noise, but I all I find is where people use it for images and creating the same bitmaps with width and height as parameters.

Does anyone know a good site or even more simple, have anyone written such a function?

I wrote this a while back, and was my second attempt. Sorry for the messiness. My style was not so good back then. You'd have to normalize it for -1 to 1


I included the constructor and the class definition so maybe you can figure out what the member variables should be initialized with. the GetPerlinH() function returns a height value given an x, y. from and to is a range of levels that are included in the final averaged height (0-max levels), yShift is an absolute offset, h_fac is a multiplier based on height (higher value will accentuate values further from the 0 level, persist is a value that determines how much higher frequency samples are included (should be in the range of 0.5-0.7 to start), and providing a different seed will give you different results.

#4759877 understanding pointers

Posted by PrestoChung on 16 January 2011 - 07:13 PM

Right, I meant I don't see any errors with your reasoning, the comments describe accurately what is happening.