Jump to content
• Advertisement

J2902

Member

30

122 Neutral

• Rank
Member
1. Random Map Generation (Algorithms)

I'm interested in general "open world" scenarios, but I was also be very happy with information on "Diablo 2" style maps -- a dungeon, in sorts. I've read about the "room" approach before, and have actually implemented it. However, at this stage, I'm even more curious about actually generating the rooms. :P It appears that using paths in algorithms is an excellent idea. Alright, here comes the onslaught: Quote: where you'd likely be generating a pathway, applying some curves and/or detours I've always had troubles with actually applying curves / detours. >.> Any hints? Should a "base" algorithm be created, which generates an area, which more sophisticated algorithms act upon, or should each algorithm be responsible for the complete creation of the area being generated? Would it make sense to have a group of "base" algorithms, which generate a general foundation, and then having another group of "secondary" algorithms, which "improve upon" the results of the base algorithms? (I really hope that made sense.) Also, how would cellular automata be used? I've toyed around with Conway's Game of Life, but generating something worthwhile with rules like those seems difficult. Would I apply cellular automata in this fashion: generate a base map using another method, and then apply some type of cellular automata to it? Fractals are something that I completely forgot to consider. Thanks. I understand the basics of genetic programming and how to implement it, but how would you use it for map generation? As above, would this be a "secondary" algorithm? The 4k demos were amazing. I'll have to google that too. :) I appreciate the help. (Hope I didn't ask too many questions. :P) Alright, it's time to hit the reply button. Thanks.
2. Random Map Generation (Algorithms)

I'm interested in doing some research on random map generation. Specifically, the algorithms in use. Hopefully, someone of greater knowledge is willing to shed an insight or two, or perhaps a helpful site. Also, would cellular automata or genetic programming be useful in this regard? Thanks. P.S. I've stumbled around on google for many hours, and finally decided it couldn't hurt to ask in a forum.
3. Shader Integration

That makes a lot of sense. So, each "renderable" object should be rendered using a specific shader, and the engine should then transparently create and manage "rendering pipelines" to group these shaders together. If this is correct, then what would be the proper way to integrate post-processing? Again, thanks.
4. Shader Integration

Hey, I've got a question about engine design and shader integration. I have a framework for loading / using shaders set up. I also have a framework for "post-processing" (where I allow shaders to be ran many times on a group of textures.) I also have a rendering pipeline that all geometry gets passed to / rendered through. You can have multiple pipelines. The rendering pipeline renders "Renderable" objects, which have a method called "render" which queues the "Renderable object" into a specified pipeline. Should shaders be linked directly into pipelines (which would mean that all of the "Renderable objects" in that pipeline are affected), or into the "Renderable objects" themselves (the shader would only be applied to that object)? The post-processing framework could be used to apply effects to the "entire" scene. Thanks. (Also, if you are curious, the source is here PostProcessor.hpp, RenderingPipeline.hpp (RenderingCore.hpp), Renderable.hpp, Shader.hpp )
5. FBO + Shaders

In essence, I'm rendering the screen to a texture (via FBO). I then want to apply a shader to the texture. My problem is this: there are only four vertices in a rectangle, which leads to a horribly bad "post processing effect." I've been looking for a way around this for awhile now, and can't seem to figure it out. Any ideas? An aside: I'm pretty new to shaders and fbo / vbos. Thanks.
6. FTGL Text Align

What I meant was the length of the string as it appeared on the screen. Which, I discovered, you can get using this. string str = "hello world"; // I don't know if the abs is required because I don't know if lower is always on the bottom right and upper is always on the top left abs((m_font->BBox(str.c_str()).Upper().X()) - m_font->BBox(str.c_str()).Lower().X()); That effectively solves the issue, but I would still like to know how to use TextAlign.
7. FTGL Text Align

Yea, the only problem with that is I don't know how to get the length of a string. >.> (Also, centering text inside a box is not the problem: the problem is rotating the text such that the rotation is around the center.) Currently, the setup is really flexible. If need be, I can change to a different library in a cinch. (Heck, it was designed for that.)
8. FTGL Text Align

I've been trying to figure out how to center text with FTGL in C++. I noticed that under the namespace FTGL there is an enum called TextAlign. I've been searching for awhile and have been unable to find some sort of reference on how to use it. Any ideas? Thanks.
9. VBO segfaulting [solved]

/sigh I thought I had a valid context, but upon closer examination I didn't. :( Thanks.
10. VBO segfaulting [solved]

I'm trying to use a VBO, but it keeps on segfaulting on me. Here is how I set up the VBO glGenBuffers(1, &m_testVBO); glBindBuffer(GL_ARRAY_BUFFER, m_testVBO); GLfloat vertexData[] = {0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f}; GLfloat colorData[] = {.3f, .3f, .3f, 1.f, .5f, .5f, .5f, 1.f, 1.f, .5f, .5f, 1.f, 1.f, 1.f, 1.f, 1.f}; glBufferData(GL_ARRAY_BUFFER, sizeof(vertexData) + sizeof(colorData), 0, GL_STATIC_DRAW); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(vertexData), vertexData); glBufferSubData(GL_ARRAY_BUFFER, sizeof(vertexData), sizeof(colorData), colorData); glColorPointer(4, GL_FLOAT, 0, (void*)(sizeof(vertexData))); glVertexPointer(2, GL_FLOAT, 0, (void*)(0)); glBindBuffer(GL_ARRAY_BUFFER, 0); and here is how I render it. glBindBuffer(GL_ARRAY_BUFFER, m_testVBO); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_COLOR_ARRAY); glColorPointer(4, GL_FLOAT, 0, (GLvoid*)(8 * sizeof(GLfloat))); glVertexPointer(2, GL_FLOAT, 0, 0); glDrawArrays(GL_QUADS, 0, 4); glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); glBindBuffer(GL_ARRAY_BUFFER, 0); At this point, I have no idea what I'm doing wrong. (I'm just trying to render a rectangle.) [Edited by - J2902 on September 12, 2009 6:18:10 PM]
11. Post-Processing with OpenGL

Quote:Original post by swiftcoder Typically you will use FBO to perform render-to-texture for post-process effects. PBO are an older (and less efficient/flexible for render-to-texture) technology. As for how post processing works - you render as many textures as you need, and then composite them together in the back-buffer using shaders. In a modern game, there could easily be 30-40 stages in the post process pipeline, so you want to setup a nice set of classes to simplify the render-to-texture and shaders. Alright, thanks. Makes sense. I had always assumed that one dealt directly with the pixels, but it would make more sense that one doesn't.
12. Post-Processing with OpenGL

I'm rather interested in figuring out how to do post-processing in OpenGL. I've looked at both VBOs and PBOs, and assumed PBOs are the right way to go. Then again, I really haven't a clue about which one is better suited for the task; so, should I use a VBO or a PBO for post-processing? (Render to a texture and modify that pixel data, or get the pixel data from the back buffer, from what I understand, which would mean that it would be a waste of time to render to a texture.) Also, I've been looking on the web for some kind of tutorial on post-processing but couldn't really find much. Any hints? Thanks.
13. Linking with G++

After a bit of tinkering around, yes. I discovered that the linker doesn't like inline functions. (The makefile was also slightly screwed up.) Thanks for the assistance, however.
14. Linking with G++

I've been working on a rudimentary engine that compiles into a library using g++. The makefile appears to compile everything correctly, but when it comes to creating an executable, I get a bunch of undefined references. Here is my makefile: CC = g++ DEBUG = -g CFLAGS = -Wall -c $(DEBUG) LFLAGS = -Wall$(DEBUG) lOBJS = -lCellPartioner.o -lCamera.o -lGeneral.o -lData.o -lScene.o -lNode.o -lSystemInterface.o OBJS = CellPartioner.o Camera.o General.o Data.o Scene.o Node.o SystemInterface.o GRAPHIC_LIBS = -lGL -lGLU -lSDL # --------------------------------------------------------------------------------- GENERAL_H = general/defines.hpp general/openGL.hpp general/structs.hpp general/utils.hpp GENERAL_C = general/definitions.cpp CAM_H = classes/KlasCamera.hpp General.o CAM_C = classes/KlasCamera.cpp CELLPARTIONER_H = classes/KlasCellSpacePartition.hpp General.o CELLPARTIONER_C = classes/KlasCellSpacePartition.cpp DATA_H = classes/KlasData.hpp General.o DATA_C = classes/KlasData.cpp SCENE_H = classes/KlasScene.hpp General.o SCENE_C = classes/KlasScene.cpp NODE_H = classes/Node.hpp General.o NODE_C = classes/Node.cpp SYSTEMINTERFACE_H = classes/SystemInterface.hpp General.o SYSTEMINTERFACE_C = classes/SystemInterface.cpp KLASENGINE_H = KlasEngine.hpp General.o KLASENGINE_C = KlasEngine.cpp # --------------------------------------------------------------------------------- # --------------------------------------------------------------------------------- example.o: examples/main.cpp $(CC)$(LFLAGS) examples/main.cpp -l:klas.a # --------------------------------------------------------------------------------- # --------------------------------------------------------------------------------- engine: $(OBJS) ar rcs klas.a$(OBJS) clean: \rm *.o # --------------------------------------------------------------------------------- KlasEngine.o: $(KLASENGINE_H)$(KLASENGINE_C) $(CC)$(CFLAGS) $(KLASENGINE_C) -lGeneral.o SystemInterface.o:$(SYSTEMINTERFACE_H) $(SYSTEMINTERFACE_C) Node.o$(CC) $(CFLAGS)$(SYSTEMINTERFACE_C) $(GRAPHIC_LIBS) -lGeneral.o -o SystemInterface.o Node.o:$(NODE_H) $(NODE_C)$(CC) $(CFLAGS)$(NODE_C) $(GRAPHIC_LIBS) -lGeneral.o Scene.o:$(SCENE_H) $(SCENE_C) CellPartioner.o Camera.o$(CC) $(CFLAGS)$(SCENE_C) -lGeneral.o -lCellPartioner.o -lCamera.o -o Scene.o Data.o: $(DATA_H)$(DATA_C) $(CC)$(CFLAGS) $(DATA_C)$(GRAPHIC_LIBS) -lGeneral.o -o Data.o CellPartioner.o: $(CELLPARTIONER_H)$(CELLPARTIONER_C) Node.o Camera.o $(CC)$(CFLAGS) $(CELLPARTIONER_C) -lGeneral.o -lNode.o -lCamera.o -o CellPartioner.o Camera.o:$(CAM_H) $(CAM_C)$(CC) $(CFLAGS)$(CAM_C) -lGeneral.o -o Camera.o General.o: $(GENERAL_H)$(GENERAL_C) $(CC)$(CFLAGS) $(GENERAL_C) -o General.o Here is how I would use the makefile: make engine # works fine, as far as I can tell make example # spews out a bunch of undefined references And here is my terminal log of those two commands jake@jake-ubuntu:~/Desktop/Engine$ make engine g++ -Wall -c -g general/definitions.cpp -o General.o g++ -Wall -c -g classes/Node.cpp -lGL -lGLU -lSDL -lGeneral.o g++ -Wall -c -g classes/KlasCamera.cpp -lGeneral.o -o Camera.o g++ -Wall -c -g classes/KlasCellSpacePartition.cpp -lGeneral.o -lNode.o -lCamera.o -o CellPartioner.o g++ -Wall -c -g classes/KlasData.cpp -lGL -lGLU -lSDL -lGeneral.o -o Data.o classes/KlasData.cpp:84:18: warning: "/*" within comment g++ -Wall -c -g classes/KlasScene.cpp -lGeneral.o -lCellPartioner.o -lCamera.o -o Scene.o g++ -Wall -c -g classes/SystemInterface.cpp -lGL -lGLU -lSDL -lGeneral.o -o SystemInterface.o ar rcs klas.a CellPartioner.o Camera.o General.o Data.o Scene.o Node.o SystemInterface.o jake@jake-ubuntu:~/Desktop/Engine$make example g++ -Wall -g examples/main.cpp -l:klas.a /tmp/ccbr6b0m.o: In function closeEngine()': /home/jake/Desktop/Engine/examples/main.cpp:35: undefined reference to klas::KlasEngine::kill()' /tmp/ccbr6b0m.o: In function setupEngine()': /home/jake/Desktop/Engine/examples/main.cpp:13: undefined reference to klas::KlasEngine::KlasEngine()' /home/jake/Desktop/Engine/examples/main.cpp:19: undefined reference to klas::KlasEngine::add(int, void*)' /home/jake/Desktop/Engine/examples/main.cpp:20: undefined reference to klas::KlasEngine::add(int, void*)' /home/jake/Desktop/Engine/examples/main.cpp:24: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/examples/main.cpp:29: undefined reference to klas::KlasScene::setCam(klas::KlasCamera*)' /tmp/ccbr6b0m.o: In function main': /home/jake/Desktop/Engine/examples/main.cpp:55: undefined reference to klas::KlasEngine::render()' klas.a(Camera.o): In function KlasCamera': /home/jake/Desktop/Engine/classes/KlasCamera.cpp:12: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/KlasCamera.cpp:13: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/KlasCamera.cpp:12: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/KlasCamera.cpp:13: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' klas.a(Scene.o): In function klas::KlasScene::add(klas::Node*, klas::Node*)': /home/jake/Desktop/Engine/classes/KlasScene.cpp:35: undefined reference to klas::Node::setParent(klas::Node*)' /home/jake/Desktop/Engine/classes/KlasScene.cpp:37: undefined reference to klas::Node::setID(int)' klas.a(Node.o): In function klas::Node::render()': /home/jake/Desktop/Engine/classes/Node.cpp:62: undefined reference to glPushMatrix' /home/jake/Desktop/Engine/classes/Node.cpp:63: undefined reference to glTranslated' /home/jake/Desktop/Engine/classes/Node.cpp:64: undefined reference to glCallList' /home/jake/Desktop/Engine/classes/Node.cpp:65: undefined reference to glPopMatrix' klas.a(Node.o): In function Node': /home/jake/Desktop/Engine/classes/Node.cpp:17: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/Node.cpp:18: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/Node.cpp:17: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/Node.cpp:18: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' klas.a(SystemInterface.o): In function klas::SystemInterface::setWindowDimensions(klas::Vector2 const&)': /home/jake/Desktop/Engine/classes/SystemInterface.cpp:87: undefined reference to SDL_FreeSurface' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:90: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:93: undefined reference to SDL_SetVideoMode' klas.a(SystemInterface.o): In function klas::SystemInterface::init(klas::SystemData const&)': /home/jake/Desktop/Engine/classes/SystemInterface.cpp:36: undefined reference to SDL_Init' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:40: undefined reference to SDL_SetVideoMode' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:48: undefined reference to SDL_GL_SetAttribute' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:49: undefined reference to SDL_GL_SetAttribute' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:51: undefined reference to SDL_GL_SetAttribute' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:52: undefined reference to SDL_GL_SetAttribute' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:53: undefined reference to SDL_GL_SetAttribute' klas.a(SystemInterface.o):/home/jake/Desktop/Engine/classes/SystemInterface.cpp:54: more undefined references to SDL_GL_SetAttribute' follow klas.a(SystemInterface.o): In function klas::SystemInterface::init(klas::SystemData const&)': /home/jake/Desktop/Engine/classes/SystemInterface.cpp:57: undefined reference to glClearColor' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:58: undefined reference to glMatrixMode' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:59: undefined reference to glPushMatrix' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:60: undefined reference to glLoadIdentity' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:62: undefined reference to glOrtho' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:63: undefined reference to glMatrixMode' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:64: undefined reference to glPushMatrix' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:65: undefined reference to glLoadIdentity' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:66: undefined reference to glEnable' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:67: undefined reference to glEnable' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:68: undefined reference to glBlendFunc' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:69: undefined reference to glFrontFace' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:70: undefined reference to glEnable' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:71: undefined reference to glEnable' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:72: undefined reference to glEnable' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:73: undefined reference to glEnable' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:74: undefined reference to glEnable' /home/jake/Desktop/Engine/classes/SystemInterface.cpp:75: undefined reference to glDepthMask' klas.a(SystemInterface.o): In function klas::SystemData::operator=(klas::SystemData const&)': /home/jake/Desktop/Engine/classes/SystemInterface.hpp:13: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' klas.a(CellPartioner.o): In function klas::KlasCellSpacePartition::addNode(klas::Node*)': /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:42: undefined reference to klas::Node::getLoc() const' klas.a(CellPartioner.o): In function klas::KlasCellSpacePartition::getNodesOnScreen(klas::KlasCamera*)': /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:94: undefined reference to klas::KlasCamera::getDim() const' /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:94: undefined reference to klas::KlasCamera::getLoc() const' /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:94: undefined reference to klas::intersects(klas::Vector2 const&, klas::Vector2 const&, klas::Vector2 const&, klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:103: undefined reference to klas::KlasCamera::getDim() const' /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:103: undefined reference to klas::KlasCamera::getLoc() const' /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:103: undefined reference to klas::Node::getDim() const' /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:103: undefined reference to klas::Node::getLoc() const' /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:103: undefined reference to klas::intersects(klas::Vector2 const&, klas::Vector2 const&, klas::Vector2 const&, klas::Vector2 const&)' klas.a(CellPartioner.o): In function klas::KlasCellSpacePartition::removeNode(klas::Node*)': /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:79: undefined reference to klas::Node::getLoc() const' klas.a(CellPartioner.o): In function klas::KlasCellSpacePartition::updateNode(klas::Node*)': /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:73: undefined reference to klas::Node::getLoc() const' klas.a(CellPartioner.o): In function klas::KlasCellSpacePartition::updateNode(klas::Node*, klas::Vector2 const&)': /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:48: undefined reference to klas::Node::getLoc() const' klas.a(CellPartioner.o): In function KlasCellSpacePartition': /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:10: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:11: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:10: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' /home/jake/Desktop/Engine/classes/KlasCellSpacePartition.cpp:11: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' klas.a(CellPartioner.o): In function KlasCell': /home/jake/Desktop/Engine/classes/../classes/KlasCellSpacePartition.hpp:24: undefined reference to klas::Vector2::operator=(klas::Vector2 const&)' klas.a(CellPartioner.o):/home/jake/Desktop/Engine/classes/../classes/KlasCellSpacePartition.hpp:25: more undefined references to `klas::Vector2::operator=(klas::Vector2 const&)' follow collect2: ld returned 1 exit status make: *** [example.o] Error 1 jake@jake-ubuntu:~/Desktop/Engine$ Thanks, and please let me know if you need any other information.
15. C++ Templates with GCC

Wow; fast response. Thank you, as this appears to have solved our issue. Again, thanks.
• Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!