Jump to content

  • Log In with Google      Sign In   
  • Create Account


caldiar

Member Since 06 Feb 2005
Offline Last Active Dec 13 2013 07:47 PM
-----

Topics I've Started

Procedural Content Articles

07 October 2009 - 09:36 AM

I've been searching Google and GameDev the past couple of days for anything I can find on procedural content generation and most of the stuff I've found is about L-Systems for procedural plants and Perlin Noise. I'm making a procedural texture generator as a learning project to familiarize myself with Python and so far have implemented Perlin Noise for 1, 2, and 3 dimensions but I'm looking for other algorithms to work with. For instance, what I'm working on now is a procedural brick algorithm using a simple step function but wonder if there are alternative methods to creating bricks. In short, I'm looking for a list of procedural algorithms to play with and I've been rather unsuccessful in my searches. Does anybody have any suggestions on things to search or even links to interesting articles? Thanks :)

Point Region vs. MX Octrees

24 April 2009 - 09:17 AM

I've been doing some research into octrees lately and had a question that I haven't been able to find the answer to on google. On Wikipedia a page on octrees mentions a Point Region (PR) Octree and an MX Octree. The difference between the two is that an xyz coordinate for a PR tree defines a corner of an octree's node (center of parent's division by three planes) and an xyz coordinate for an MX tree defines the center of a node. Because of this, the root of a PR octree can represent infinite space while the root of an MX tree has to define a finite space to know what the xyz coordinate is. My question is this: What are the pros and cons of each form of the octree? Are there any significant advantages of one over the other? Thanks, Caldiar

Open Watcom Is Cranky

09 April 2009 - 06:34 PM

I was bored in an intro to Maya class and found Open Watcom in a shared network folder so I decided to program something; anything to break the boredom. Well, I thought this was rather silly. When I try to compile this simple C++ program:
#include <windows.h>
#include <iostream>
#include <string>

using namespace std; 

int main(int argc, char **argv){
    string something; 
    cout << "Example Text. Feed me some words!" << endl; //added the ending quotes. Was just a typo.
    cin >> something; 
    cout << "You tossed me \"" << something << "\". " << endl; 

}


Watcom get's pissed at me for trying to use "<<" and ">>" saying that I can only use intregal types. (Yes, this compile was set up to compile C++ code). Any ideas on this one? (No, I'm not planning on actually using Watcom but this just bugged me too much for me to leave it alone) Thanks! [Edited by - caldiar on April 10, 2009 1:24:44 AM]

[C] Assigning Bit Shifts to Int

04 April 2009 - 09:39 AM

I just happened to be crawling through some C source and something caught my eye. An int variable was being declared as "int variable_name = (1 << 10)" instead of "int variable_name = 1024" Is there a reason things were done with a bit shift? From what I could find on Google it's been suggested that this is maybe an optimization trick. Can anybody confirm/debunk this and give an explination as to why a bit shift is being used rather than just using its result directly? Thanks.

[C++] - Template Design Issues

30 March 2009 - 08:18 AM

I'm working on a section of my application which is a class called EntityManager. It's role is to act as an interface to every entity within the application. This means the renderer will find out what entities to render through EntityManager, etc... Even other entities can find out about fellow entities if they really wanted to since I've made EntityManager a global. The problem lies with my love for templates. I just can't get enough of them. I have a function called RegisterEntity in EntityManager. It looks something like this:
template<typename T> void cEntityManager::RegisterEntity(std::string &name){
    map_itr = map_of_entities.find(name);
    if(map_itr != map_of_entities.end()){
        sysLog->Log("Entity already registered", ERROR);
    else{
        T *ent = new T(); 
        map_of_entities[name] = ent; 
    }
};

This isn't an exact replica of the code but it's almost identical. (didnt check to make sure arguments matched 100%). map_of_entities is an std::map with a key of string and a value of entityBase* This lets me put any entities that are derived from entityBase into the map. sysLog is my own logging system. Really not important. The issue is when I go to use this function a certain way. At the moment, simply calling EntityManager->RegisterEntitiy<derivedEntityA>("Derived Entity A"); works. But if I do another call EntityManager->RegisterEntity<derivedEntityB>("Derived Entity A"); the function will ignore the type I pass through the template parameter because it found Derived Entity A and recognizes it as a class of type derivedEntityA. While I suppose this is good so I can't redefine an entry in the map on accident through a double register like I tried to do just now, it concerns me that my design might be a little off. I forsee a lot of unexpected behavior occuring if I forget I already registered an entity name with an entity type and try to register the name to another type. Any suggestions on how to spruce this function up to prevent myself from spending hours trying to figure out why my entities aren't registering properly only to find that the entity already exists as a different type from an earlier function call? Thanks :)

PARTNERS