• entries
56
80
• views
41791

## Boo!

Yeah, I'm still alive. Schools wrapping up, got finals starting next week so hopefully I'll be getting more done on Quadrion Engine after that.

Speaking of Quadrion Engine, it's a large endeavor that Shawn Simonson, Renato Ciuffo, Kieran Culliton, and I have been working on for a few years granted my input has been a bit variable.

Lately we've been making immense amount of progress as Shawn has implemented a dynamic lighting system which uses a defered approach.

What follows is a video showing off the SSAO and dynamic lighting working simultaneously. On my 'acceptable' GeForce 9500M (mobile) 512MB I get about 45fps on average which is damn good considering you could conceivably have an unlimited amount of dynamic lights on the screen and not have much of a performance hit (if at all) though I'm not sure about overdraw.

Anyways, enough of that here's the video WATCH IN HD, it's set to Synchronicity 2 by The Police =D.

Also, don't forget to check out Moogen Studios which is our development blog. I believe Shawn's going to be make some video blogs in the very near future, so those that are interested in some technical details and theory you'll soon find yourself indulged; he's a great speaker.

Peace

## Group blog

I finally convinced my close friend Shawn Simonson to create a blog for his work on Quadrion Engine and other miscellaneous technical endeavors. He has a way with words; I'm sure that anyone who even bothers to peek at my blog will find themselves quite a bit more indulged with what he has to say.

I might start mirroring the posts from there due to my sheer lack of content.

:)

## Easy Usage

So with the little time I have to code, I've managed to get a little bit done on the engine.

One thing that's always bugged me when creating game/render windows is picking the 'right' resolution by default for the user. To combat this issue I wrote a window creation function that does just that.

int OpenQuickWindow(bool fullscreen) is the prototype for it.

Basically, when the method is called it grabs a list of available video modes and removes the video modes with the lowest RGB bit values. If true is passed to it then we assume the user wants the highest resolution video-mode available from the list for full-screen, otherwise we pick a lower resolution mode (but not the lowest) that way windowed mode isn't taking up his/her entire screen.

It's probably not the best routine but it works. My only concern is when you're dealing with weird aspect ratios, like mine for example (16:9) which has 1366 x 768 AND 1365 x 768. Right now it's picking 800x600 for windowed mode on my system which is perfect, I need to test it on other systems before I get too excited.

## Microsoft's STL implementation slow? - 2

Thanks everyone, I've received a lot of helpful comments and I was able to solve the problem.

Apparently, regardless of whether you're in release mode or not, Microsoft's vectors do some 'other' stuff in the background.

So, in order to fix this issue you have to use these pre-processor definitions:

#define _CRT_SECURE_NO_WARNINGS#define _SCL_SECURE_NO_WARNINGS#define _SECURE_SCL 0#define _HAS_ITERATOR_DEBUGGING 0

I still think it's a bit silly that they assume you want iterator checking, etc on but w/e.

## Microsoft's STL implementation slow?

Is it me or does Microsoft's implementation of vectors in the STL seem oddly slow? This question came about after my past experiences and now recently a debate on a different forum.

Anyways, to investigate this I wrote a small program to test the speed of populating and fetching data to/from regular 'ol malloc'd...dynamically allocated arrays and std::vector's... respectively.

While the test isn't extremely extensive, I believe it's sufficient.

Either way, the results are...disturbing to say in the least. This is with the \O2 'Full Speed' optimization flag on MSVC 2008:
Starting first test: Populating Speed...Populating dynamically allocated array...Populating vector...The dynamically allocated array took    0.0176ms to populate.The vector took                         0.0396698ms to populate.A 2.25397 ratio difference in speed.Starting second test: Fetch Speed...Fetching data from dynamically allocated array.Fetching data from vector.The dynamically allocated array took:   0.00195556ms to fetch data.The vector took:                        0.0312889ms to fetch data.A 16 ratio difference in speed.

This makes me want to reinvent the wheel...

I thought it might have been my code but when I asked a friend to test it on his GCC setup his results were drastically different... while I don't have his exact results he said "I compiled this on GCC and get slightly better results with the vector at -O2, populating on GCC 4.3.2 (-O2) was slightly slower, but fetching was faster. It might be interesting to figure out what is causing the issue."

I'm posting the full source code here in attempt to get a broader range of results from various platforms. So far it seems like it's a Microsoft specific issue.

Here's the source code:
VecTest.zip

If someone knows of something I don't know, please let me know. I'm interested in seeing your results.

## Angel Script

Yeah, wow, college is definitely eating up the majority of my free time.

So what's been up? Nothing other than drowning in homework.

When I do get to code it's mainly just been refactoring old code though recently I've been dabbling around with implementing Angel Script into Odorless Engine.

Angel Script is really neat, the syntax and usage is nearly identical to C++ except for a few minor things like the primitive types. I haven't done any performance tests with it but it seems stable and fast. My only gripe, though it does support classes :), is that it doesn't support inheritance (yet). Hey, it has interfaces!

So yeah, if you guys are looking for a scripting language for your games and want something with syntax nearly identical to C++, then I recommend checking out Angel Script. People would argue that Lua is better but honestly I don't like the syntax of Lua.

## Visibility implemented

Visibility is in which is a huge milestone for me.

Not much else to say so here's a video:

">

Yay!

## My game idea

All this time I've been covering the development of my engine but I forgot to mention one very important thing, what it is for.

The whole reason I created this engine was so I could create the game I've always wanted to create, a 3D platformer similar to Paper Mario but tilted towards a more violent atmosphere. I'm hoping to combine both a puzzle factor similar to Valve's Portal but with intense zombie battles similar to Garry Newman's Facewound.

There are still quite a few things that I'm unsure about; what are the legal issues surrounding the IBSP (Quake 3 BSP) format for commercial indie projects?
I've heard that using the format itself for whatever commercial/non-commercial application is completely legal. I've also heard that using other BSP editors like QuArk and GTK Radiant rather than ID's Radiant is legal as well.
So as long as I don't use ID's Radiant and obviously their assets then I should be fine...right? (If you know anything else about IBSP legalities that I should be aware of then please tell me.)

Anyways, I've been fiddling with QuArk and it seems like a nice map editor though there are a few things that I don't quite like about it, the controls for one(those can be changed though), and the number of buttons that you can press is quite intimidating considering I don't know what the majority of them do. Other than those few things I like it, I guess it just needs a bit getting used to...sure beats the hell out of GTK+ Radiant though; I could never get used to that.

I managed to make a crappy map while getting the feel for QuArk...it's entirely based off of the default map. It's just to get a feel for how this 3D platformer will work as well as to get the scaling and textures working correctly.

Here's that map as rendered by the engine:

I've been coding all day/night so it's time for some food and possibly sleep.

## Lightmaps

I managed to grab the lightmaps out of the IBSP. I've always wondered what they looked like raw since they're all 128x128 so I had them exported to the disk.

Here's an image I compiled of all of them from a random map.

They look pretty neat, you can see some of the shadows from certain faces.

Anyways, here's q3dm17 rendered with lightmaps...it still seems a bit dim though.

## Yay BSPs!

Well, I've been chugging away at Odorless Portable Engine for some time now and I've got something to show for it :)

If you're not familiar with what map this is then you should be shot =P.

I started implementing IBSP support as obvious in the picture. I've got texture loading working correctly with the exception of a few faces that are animated which I haven't written a system for. Trilinear and Anisotropic filtering seem to be working correctly. There's still a lot of work to be done like taking advantage of the VIS data, Alpha blending, etc...

Another fun screenshot:

You probably can't tell from the wireframe but that's Scoutzknifes a popular custom Counter Strike Source map. What's this mean? Well, I'm toying around with Valve's BSP format as well.

## GUI Design

Been a very long while since I made a post but I felt today was a good day to provide some update on the 'framework' which I'm more appropriately calling an engine based on GLFW.

I've been focusing on the GUI design lately and I believe it's ideal. To use the GUI you simply create a new class that derives from the abstract class called Window. You overload a couple virtual functions like Render, Update, etc how you want. After that you simply pass this off to the WindowManager which handles the rest. Pretty simple and easy to use.

Here's an example of how I could create a new type of Window.

class BasicWindow : public Odorless::Engine::UI::Windows::Window			{			public:				BasicWindow() : Odorless::Engine::UI::Windows::Window()				{					//...				}				BasicWindow(const float &x, const float &y, const float &width, const float &height) : Odorless::Engine::UI::Windows::Window(x, y, width, height)				{					//...				}				~BasicWindow()				{					//...				}				int Initialize()				{					return 0;				}				void Dispose()				{					//...				}				void Update(const float &dt)				{					//...				}				void Render(const float &dt)				{					glBegin(GL_QUADS);					glVertex3f(this->_2fPosition[0], this->_2fPosition[1], 0);					glVertex3f(this->_2fPosition[0], this->_2fPosition[1] + this->_2fDimensions[1], 0);					glVertex3f(this->_2fPosition[0] + this->_2fDimensions[0], this->_2fPosition[1] + this->_2fDimensions[1], 0);					glVertex3f(this->_2fPosition[0] + this->_2fDimensions[0], this->_2fPosition[1], 0);					glEnd();				}			};

Obviously in that example BasicWindow doesn't have much functionality but that's simply for the sake of keeping this post short.

Once I get some sexy looking GUI going I'll let you guys know ;).

## I'm in

I received my acceptance letter to Texas Tech a week ago; I was surprised at how quick of a response I got:

"You have been admitted for 08 Fall with a major in Electrical Engineering/Computer Science (dual)."

So yeah, I'm pretty excited. The only thing that I really need to do now is take the math placement exam, provide immunization records, send my final high school transcript in as well as my college transcript for my dual credit classes.

I already picked out my dorm as well; I regret not applying/applying for housing earlier because I could have had my dorm in a better hall, one that specializes in Engineering.

I'm thinking about applying for the Engineering Bridge Program that they offer to do over the summer so I can get some classes out of the way before the fall session starts, the CSEE curriculum ranges from 15-17 hours a semester up until the 5th year so it would be good to get some classes out of the way.

Lately people have been coming up to me in the CS lab asking about how I manage to remember my really long password(not necessary but I'm paranoid) which is 24 characters long, alpha-numerical.

So for whoever is interested, what follows is a really short guide on how to create the "perfect" password.

If you're like me you probably don't have the same password for every single thing but you probably have about 3-4 passwords you tend to use for different things be it email, ftp, forums, etc. Having the same password for everything is generally a bad idea. What follows is a hypothetical situation:

Though the latter situation is probably unlikely since most forums have some sort of encryption going on(usually MD5) for the passwords it's still very possible for them to do a brute force attack on those hashes with a large enough dictionary, or quite simply you could have a crooked forum admin who decides to take off the encryption.

So, what's the best way to avoid all this? Use different passwords for things with varying levels of importance. Let's say your forum logins are at the bottom of the list, use a common password for those, next up your website use a common password for that, and your email, etc. Not necessarily full proof, but it gives you a bit more damage control. If someone manages to grab your forum password, that's all it'll be good for, other forums.

What if you want a very strong(long) password but have the memory of a fish(like me)? Gather the list of all your commonly used passwords, then arrange them in a certain order.
For example if all the passwords you knew and used were
asfrt4
783hf7
343fjj
39famc

Then you simply combine them in to one, all you need to know is the order:
asfrt4783hf7343fjj39famc
there you go, an insanely long password...that could survive most(if not all) brute force attacks. As long as you remember the order that your common passwords go in then you're good to go ;). Of course if you want to you can add extra variation by using the first 3 password in order then using the 4th's characters at every 3 characters or so, whatever works for you.

In conclusion, this technique should make it very easy for you to make and remember a long set of letters and numbers, of course, if you already have really weak passwords to begin with then...well..reconsider..if your end result is something like
then you should probably get your self a new set of commonly used passwords.

Hope that wasn't too lengthy, obvious or boring but maybe that'll help someone.

## High school Winding Down, College Spinning Up

It's the 5th of 6, 6 weeks my senior year of high school, my high school life seems to be winding down. It was a fun ride and I'm going to miss many of my friends as we all drift to our separate directions.

I've already applied to two colleges, University of Houston and Texas Tech University, the latter being the one I want really want to go but if I don't get accepted UH is a fall back.

I haven't really been productive lately, but that's changing as I continue work on the framework.

## Spring Break

This is more of a message to my friends or anyone that care and I may have not already notified, but starting today I'll being gone for a little over a week for Spring Break. It's very unlikely that I'll be online during this time period, so if you need to contact me please text message me or if it's not urgent leave an email. Thanks :). Cya guys later.

## GCC & VS weirdness

Yesterday while coding the destructor for the TextureManager I noticed some rather odd difference in VS and GCC/G++.

First off the piece of code that VS was having trouble with that G++ didn't mind or complain at all about was this:

const unsigned int size = _vLoadedTextures.size();
GLuint textures[size];

Seems, simple enough right?

G++ doesn't throw any errors or warnings about this but VS gives me at least 3 errors.

Error 1 error C2057: expected constant expression
Error 2 error C2466: cannot allocate an array of constant size 0
Error 3 error C2133: 'textures' : unknown size

The first error makes me laugh.

Why is this an issue in VS? Does it not like sizing arrays at run time? I know I could just use malloc but seriously, wtf?

## Easy to use

With simplicity comes ease of use, at least in my case.

Here's an example of how to output some text to the screen:
#define _BUILD_STRING_ "Odorless Entertainment - Framework - Build: " __DATE__ " at " __TIME__#include "src/FW.h"#include "src/UI/Fonts/FontManager.h"#include Odorless::Framework::UI::Fonts::FontManager *fontManager;void Initialize(){	fontManager = new Odorless::Framework::UI::Fonts::FontManager();	fontManager->AddFont("base/textures/fonts/phantom");	fontManager->SetFont("base/textures/fonts/phantom");		glEnable(GL_LINE);	glEnable(GL_POINT);	glEnable(GL_LINE_SMOOTH);	glEnable(GL_BLEND);	glEnable(GL_ALPHA);	glEnable(GL_TEXTURE_2D);}void Update(double deltaTime){	return;}void Draw(double deltaTime){	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	glColor4f(1, 1, 1, 1.0f);	glPushMatrix();	fontManager->Write("Gamedev.net\nNew line test!");	glPopMatrix();}void OnResize(int width, int height){	Odorless::Framework::Base::VSync(false);		glViewport(0, 0, width, height);	glMatrixMode(GL_PROJECTION);	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	glMatrixMode(GL_PROJECTION);	glLoadIdentity();	glOrtho(0.0f, width, height, 0.0f, -1.0f, 1.0f);}int main(){	Odorless::Framework::Base::InitializeFramework();	Odorless::Framework::Base::OpenWindow(800, 600, 8, 8, 8, 8, 24, 8);	Odorless::Framework::Base::SetWindowResize(OnResize);	Odorless::Framework::Base::SetWindowTitle(_BUILD_STRING_);	Odorless::Framework::Base::SetInitialize(Initialize);	Odorless::Framework::Base::SetUpdate(Update);	Odorless::Framework::Base::SetDraw(Draw);		Odorless::Framework::Base::Initialize();	while (Odorless::Framework::Base::IsRunning())	{		Odorless::Framework::Base::Update(0.0);		Odorless::Framework::Base::Draw(0.0);		Odorless::Framework::Base::Flush();		Odorless::Framework::Base::SwapBuffers();		if (glfwGetKey(GLFW_KEY_ESC) || !glfwGetWindowParam(GLFW_OPENED))			break;	}	Odorless::Framework::Base::Dispose();		delete fontManager;		return 0;}

The code above gives you the following:

I still need to write the routine to calculate the UVs for each character so it's not monospaced.

## Refreshing what I know on some bitwise operators using colors.

I was brainstorming over stuff related to framework at school today. I remembered coming across some functions in OpenGL that let you pass colors off as a single integer but I forgot how the color was stored within this integer much less how each color component Red, Green and Blue was parsed out of it.

With a little bit research I found the formula for combining the color components together into a single integer, which is below.

int RGB = 256 * 256 * red + 256 * green + blue;

The harder portion is extracting each color component, so I setup a little test.

I plugged some stuff into the formula:

Red = <255, 0, 0> = 16711680
Green = <0, 255, 0> = 65280
Blue = <0, 0, 255> = 255

At first glance these numbers seemed to have no significance so I started messing around with them. Keep in mind, I'm not a mathematician and I generally suck at algebra.

I started trying a few things out for quite a long time and thought about bitwise operators, something that, though sad, I have not touched in a very long time. I remembered that a certain bitwise operator would decrease these numbers significantly. That operator was the bitwise right shift operator, >>.

I started doing some shifts on the red until I got something that seemed probable, shifting 16 bits to the right to get a proper color value for red. I did the same for green and ended up with 8. I'll go over blue later.

Here's an example:

Green = 65280 = 1111111100000000
1111111100000000 >> 8 = 0000000011111111
0000000011111111 = 11111111
11111111 = 255

Yay ;)

There was only one problem though
What if I plugged in a green value in the formula that was greater than 255? Say 300? That's where the bitwise AND operator, &, comes in. It keeps the returned values within 255.

300 = 100101100
255 = 11111111

Doing a truth table for 300 & 255 would look like this:

300 = 100101100
100101100011111111---------000101100 = 44

Let's try another number that's is larger, something like 5032.

5032 = 1001110101000
10011101010000000011111111-------------0000010101000 = 168

What exactly does this mean? Well, it's simple the AND operator keeps it within the 0-255 range and wraps it around where needed.

Let's try and do 11111111 & 100000000(256)
100000000011111111---------000000000 = 0

See, it wraps around.

The blue value is quite easy, you don't need to do any shifts but you still need to do the bitwise AND with 255.

RandomColor = <0,10,255> = 2815 = 101011111111
101011111111000011111111------------000011111111 = 255

So the function I'll be using to parse integers to each color value will be:
void IntToRGB(int &r, int &g, int &b, int &rgb){    r = (rgb << 16) & 255;    g = (rgb << 8) & 255;    b = rgb & 255;}

I haven't tried doing this in code but it all seems to work out on paper.

## Class Diagram

I've taken a new approach on how to develop the framework, make it simple.

What follows is a fairly detailed, yet incomplete class diagram. I've been thinking about the GUI stuff lately.

The framework is coded in C++, but for the purposes of this class diagram and readability the syntax is not quite C++.

Class Diagram:
namespace Odorless
namespace Framework
namespace UI
namespace Windows
class WindowManager
public WindowManager();
public ~WindowManager();
public void RemoveWindow(const unsigned int& index);
public void Update(const float& dt);
public void Render(const float& dt);
private std::vector _vecWindows;
class Window
public Window();
public ~Window();
public void RemoveWidget(const unsigned int& index);
public virtual int Initialize() = 0;
public virtual void Dispose() = 0;
public virtual void Update(const float& dt) = 0;
public virtual void Render(const float& dt) = 0;
private std::vector _vecWidgets;
private float _2fDimensions[2];
private float _2fPosition[2];
private unsigned int _uiFgColor;
private unsigned int _uiBgColor;
namespace Widgets
class Widget
public Widget();
public ~Widget();
public virtual void Initialize() = 0;
public virtual void Dispose() = 0;
public virtual void Update(const float& dt) = 0;
public virtual void Render(const float& dt) = 0;
private float _2fDimensions[2];
private float _2fPosition[2];
private unsigned int _uiFgColor;
private unsigned int _uiBgColor;

I'll write some comments and explanations once it's a little more developed.

Here's something that I've been having trouble with, picking the right open source license. GPL sucks, it's very restrictive though that's what I currently have my works under.

I would use CC but it's not targeted to open source works.

Here's what I'd like in the license:
It should have attribution, obviously. People should be able to freely modify the code and combine it with other works as long as the license stays in tact.
If someone is using my code to create a product that they intend to sell then the license should require them to ask my permission before they can use my code in their product. Is it as simple as adding copyright info and contact information?

I don't want to have a situation where I put hard work in to my code, someone uses it and happens to makes some simple puzzle game that becomes hugely popular and he/she is banking some huge bucks on it when the majority of the work was technically done by me.

I looked at the QPL license but it doesn't mention anything about profit, selling, etc except in the no warranty clause http://www.qgar.org/doc/license-qpl.html

Any ideas?

## Ubuntu fun

I just updated to Ubuntu Gutsy simply because of Compiz-Fusion, so yea.. I've been toying around with that for quite a few hours and I finally got it how I want it to look.

I think it looks nice ;). I tend to choose darker colors since they are easier on my eyes. Bright pixels, to me, are the equivalent of staring into a flashlight.

In other news I started on the GUI system, Compiz-Fusion has really motivated me, though I probably won't be able to implement many of the effects they have it's still something I can experiment with. I'll probably write a little class diagram tomorrow.

## Woot sppedz

Well, I just did a speedtest and apparently I have an unusually fast connection. If only my upload was just as fast.

EDIT:
Why do people hate Comcast again? I heard they're not for Net Neutrality which is a real downer.

## #gamedev douche bagginess.

I've always idled in #gamedev and helped people when I could, but trying to get help from even the most trivial problems is near impossible.

For example, today I had the following question:

Quote:
 Hey, does anyone know if it's possible to read pixel data from a texture in OpenGL? bladezor: possibly. Washu, isn't glReadPixels only for the frame buffer?<@Washu> there are other commands, depending on which version of GL you use<@Washu> R2T for instance* Washu has quit (Quit) it can read textures too Really? i believe.. rtfm? bzroom, the C specification only shows the frame buffer.. http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/readpixels.html So I'm pretty sure I rtfm

After a few minutes I was highlighted by someone else

Quote:
 * Zao nudges bladezor towards dev.

I mean honestly, how is it that I get help from some person in a different channel? I wouldn't mind if some people didn't help me at all but when you respond with things such as "i believe...read the fucking manual" without even making the slightest assumption that I've done that and wouldn't be asking..damn that's less than helpful, it's insulting.

#gamedev has turned into a giant e-penis measuring fest full of 4chan related crap.

## Text's a bit better.

Monospaced or not?

I was experimenting with the spacing and decided that I actually liked Monospaced better than Proportional, it's much easier for me to read, maybe it's just because I'm used to seeing all my text Monospaced in code.

I'll eventually need to implement a way for the fonts to be Proportial so I'll need to make my own TGA font generator as the one I'm using right now isn't generating proper UV values.

I like this font, I believe it's called Phantom Stencil.

For those of you that are looking for some awesome fonts, I recommend http://penguinfonts.com/ it's a new site dedicated to Linux fonts even though all if not most work for Windows as well.

## Text output

Well, for the most part, outputting text to the screen works. I'm having trouble getting it how I want it to look.

The fonts themselves are stored as TGAs and then a .dat file accompanies them which contains the proper UV for each character and takes into account the proper spacing/formatting, etc. Well, mapping the UV's with the .dat didn't work too great, I had lots of clipping problems. Screenshot for reference:

As you can see, there are some weird UV mapping issues with these characters, for one..you can see the border on the top of all of them, secondly if you take a look at the letter "i", it has stretched all the way across the quad.

I couldn't figure out a fix to this issue so instead I reverted to grabbing each character in 16x16 sections within the 256x256 TGA. That seems to work fine but the spacing isn't how I'd like it. I can probably tighten up the characters on the x and it'll be good. There's some very minor clipping issues that can be fixed but I'm relatively happy with the results.

Screenshot with Arial text:

That's all for now.