Author Archive

Posted by kent at 3 January 2011

Category: Dev

Tags: , , , , ,

static public List<foldersRow> getParentFolders(foldersRow parent)
{
    return (from p in m_Fildb.folders.Where( _p => _p.parent_folder_id == parent.folder_id) select p).ToList();
}

This returns a strongly typed List of type foldersRow.

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 7 November 2010

Category: Game review, Tip

Tags: , , , , ,

This is how you gain access to the Nellis Air Force Base in New Vegas.

Once you start entering the area, you’ll get bombarded by the Boomers.

Overview picture:

This is how you enter the Nellis Air Force Base in New Vegas

Click the picture for full size image.

Refill with stimpacks, food, water, doctors bags when necessary.

And remeber to make the bet with George before you enter the area. If you have 60 speech or more you can lie to raise the wager to 700 after you’ve entered Nellis AFB and came back.

When you reach the gate you’ll be let in.

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 7 November 2010

Category: Game review, Game review

Tags: , ,

After finding the locations of the Brotherhood patrols, you’re asked to find the scouts and retrieve observations from them.

Locations are:
1) Near the NCR Correctional Facility
2) Near Nipton
3) Near Camp Forlorn Hope

Scout Locations

Scout Locations

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 25 October 2010

Category: Game review

Tags: , , , ,

This is a simple howto on how to beat the virus infection in the Brotherhood of Steel datastore.

1) Talk to Scribe Ibsen about the virus infection and ask if you could help him.

2) After much talking Scribe Ibsen will ask you to wait until he says the virus has jumped. Do a quicksave here just before Scribe Ibsen tells you the virus has jumped.

3) Place yourself in front of one of the terminals.

4) When Scribe Ibsen gives you GO, search for the virus in the computers. Do a systematic search. And remember what computers have the virus. If you fail the first attempt, reload the quicksave.

5) Go to the computers you had the virus in the previous attempt and isolate them there.

6) Continue the search for additional infected computers.

7) If unsuccessful, goto 4.

Scribe Ibsen at the terminal

Scribe Ibsen at the terminal

More screenshots in the next post.

VN:F [1.9.13_1145]
Rating: 5.0/5 (3 votes cast)
Share

Posted by kent at 20 October 2010

Category: c++

Tags: , , , , ,

This is a reminder to myself.

To sort a collection of non-POD types (not Plain Old Data) with STL we need to tell it how to sort these objects.

To the std::sort method we simply supply a predicate! It’s just a method taking 2 arguments of that type and apply our logic to tell if the first argument is lesser than the last argument. With templates it becomes a little more complex, but still it’s very simple when you know how it works.

Here is some sample code:

#include <iostream>     // Provides cout
#include <vector>       // Provides our basic container
#include <algorithm>    // Provides std::sort

using namespace std;

// Structures I'll sort with 1 template function
//
//
struct A
{
    A(size_t i, size_t t) : id(i), time(t), other_data(false){}
    size_t  id;
    size_t  time;
    bool    other_data;
};

struct B
{
    B(size_t i, size_t t) : id(i), time(t), other_data("string data"){}
    size_t  id;
    size_t  time;
    string  other_data;
};

struct C
{
    C(size_t i, size_t t) : id(i), time(t), other_data("character array data"){}
    size_t  id;
    size_t  time;
    char*   other_data;
};

// Our predicate
//
template<typename CLASS>
bool timeSortPredicate( const CLASS &a, const CLASS &b )
{
    return a.time < b.time;
}

template<typename CLASS>
bool idSortPredicate( const CLASS &a, const CLASS &b )
{
    return a.id < b.id;
}

// Our collection printer
//
template<typename CLASS>
void print( const CLASS &c )
{
    typedef typename CLASS::const_iterator cit;

    for ( cit it = c.begin(); it != c.end(); ++it )
    {
        cout << it->id << " " << it->time << endl;
    }
}

int main()
{
    // Construct the objects ... tedious I know
    A a1(1,15), a2(2,20),   a3(3,14);
    B b1(3,4),  b2(2,10),   b3(1,12);
    C c1(11,0), c2(12,0),   c3(13,0);

    // Construct collections
    vector<A> alist;
    alist.push_back(a1);
    alist.push_back(a2);
    alist.push_back(a3);

    vector<B> blist;
    blist.push_back(b1);
    blist.push_back(b2);
    blist.push_back(b3);

    vector<C> clist;
    clist.push_back(c1);
    clist.push_back(c2);
    clist.push_back(c3);

    // Print stuff
    cout << "Collection A" << endl;
    print(alist);

    cout << "Collection B" << endl;
    print(blist);

    cout << "Collection C" << endl;
    print(clist);

    cout << "Sorting collections by time" << endl;

    sort(alist.begin(), alist.end(), timeSortPredicate<A> );
    sort(blist.begin(), blist.end(), timeSortPredicate<B> );
    sort(clist.begin(), clist.end(), timeSortPredicate<C> );

    // Print stuff
    cout << "Collection A" << endl;
    print(alist);

    cout << "Collection B" << endl;
    print(blist);

    cout << "Collection C" << endl;
    print(clist);

    cout << "Sorting collections by id" << endl;

    sort(alist.begin(), alist.end(), idSortPredicate<A> );
    sort(blist.begin(), blist.end(), idSortPredicate<B> );
    sort(clist.begin(), clist.end(), idSortPredicate<C> );

    // Print stuff
    cout << "Collection A" << endl;
    print(alist);

    cout << "Collection B" << endl;
    print(blist);

    cout << "Collection C" << endl;
    print(clist);

    return 0;
}

Compile with:

g++ sortpredicate.cpp -o sortpredicate

The output should be:

Collection A
1 15
2 20
3 14
Collection B
3 4
2 10
1 12
Collection C
11 0
12 0
13 0
Sorting collections by time
Collection A
3 14
1 15
2 20
Collection B
3 4
2 10
1 12
Collection C
11 0
12 0
13 0
Sorting collections by id
Collection A
1 15
2 20
3 14
Collection B
1 12
2 10
3 4
Collection C
11 0
12 0
13 0
VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 19 August 2010

Category: c++, Dev

Tags: , , , , ,

Okay. This is going to be somewhat personal.

I’m a professional software developer for a medium sized company, which is really not a software company. It’s only internal software I write.

I’ve also wanted to make a game since I started playing games. That’s probably why I’m a software developer today. I’ve been doing more or less C++ since I was 14, doing (at least trying to) 3D-graphics since I was 18. Without knowledge of the particular mathematics involved with 3D-graphics it proved to be difficult.

I’ve started numerous projects with OpenGL, and some are more advanced than others, but I didn’t continue working on a project for more than 2-3 days before I got tired.

I’ve started an other project now. I don’t know what I’ll make, or whether if I’ll make anything. But I’ve started an other project. The only real difference from previous projects is that I know the value of libraries and there is no point in re-inventing the wheel for every project.

Standard template library is there, Boost is there and some other libraries. I know how to use them. And I know they exist!

For this project I know I’m going to use

  • STL
  • The boost libraries
  • Ogre3D for graphics

I’m not so sure about the sound and physics part, but for now I think I’ll stick with

  • Bullet for physics
  • FMOD for sound

I must also review the licenses  for the libraries to make sure they are allowed to be used in commercial projects or not. I’m not saying my project is going to be commercial, but I won’t exclude it. I’ll also aim for Windows and Linux support. And probably Mac if it’s going to be commercial.

So far I have an empty scene with a blue background.

It’s a start! … again

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 16 August 2010

Category: c++, Dev

Tags: , ,

When I get this error, it’s always because I’ve opened the debugging process in Process Explorer.

Error    1    fatal error LNK1201: error writing to program database 'e:\blergh\blergh\bin\blergh_d.pdb'; check for insufficient disk space, invalid path, or insufficient privilege

Close the handle in Process Explorer or restart Process Explorer.

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 4 July 2010

Category: Memorable

Tags: ,

1. Painters need to start painting the interiors before the house foundation is started on.

2. Carpenters must finish the roof before the walls are strong enough to support it.

3. The exterior should look like gold, but in reality made of mud.

4. Skip the foundation. Nobody will ever care to take a look there, or have access there.

5. The electricity, water pipes and waste disposal can go through the same pipe.

6. When the house is almost finished, the owner wants to move a couple of walls, add some floors, at no extra cost.

7. When the house is “finished”, the owner must expect to patch it up when it rains, apply service personell monthly and within 2 years the house it out of date.

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share

Posted by kent at 4 June 2010

Category: c++

Tags: , ,

When porting projects from Visual Studio 2008 or earlier to Visual Studio 2010, and you’re using boost::shared_ptr or other features present in TR1, there will be conflicts. Boost has their own implementation of shared_ptr in boost::shared_ptr and with VS2010 they have put shared_ptr in std::tr1 and they have made shared_ptr available through std::shared_ptr. When using using namespace std; and using namespace boost; there will be ambiguities.

To disable the C++0x/TR1 headers from VS2010 and use the boost implementation, define _HAS_CPP0X=0 in the preprocessor project settings for your VS2010 project. 

Select "All Configurations" and then add the preprocessor directive.

VN:F [1.9.13_1145]
Rating: 5.0/5 (3 votes cast)
Share

Posted by kent at 9 April 2010

Category: c++, Dev

Tags: , ,

This little macro prints out user warnings to the output window in a format the “Error List” within Visual Studio will understand and parse. Taken from Stack Overflow and modified a little.

#define STRINGISE_IMPL(x) #x
#define STRINGISE(x) STRINGISE_IMPL(x)

	// Use: #pragma message WARN("My message")
#if _MSC_VER
#   define FILE_LINE_LINK __FILE__ "(" STRINGISE(__LINE__) ") : "
#   define WARN(exp) (FILE_LINE_LINK "warning: " exp)
#else//__GNUC__ - may need other defines for different compilers
#   define WARN(exp) ("WARNING: " exp)
#endif

It will produce output like this:

1>.\src\bug.cpp(82) : warning: check me

When this line is present in the source file.

#pragma message WARN("check me")
VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share