Search This Blog

Friday 8 March 2013

Nothing new to make?

Very Old but meaningful one

"Nothing new to make? Nothing new to make?

The shareware archives are full of Ultima 3 knock-offs, Space Invaders
knock-offs, and -- for the really creative -- Civilization knock-offs.
What *hasn't* been done before? How about a role-playing game without
swords, where you construct spells out of working algorithmic parts and
try to sneak around the enemy's defenses instead of wearing them down? How
about an empire-building game where logistics is more important than
producing armies? How about a one-on-one fighting game where each player
has the ability to travel through time, and the sneakiest move is to sneak
up behind your opponent while he's busy punching you in the stomach?

Bonus points if you can name the computer game, board game, or book that
inspired each of those thoughts. So, why aren't you reading those books
and playing those games yourself? All things come to he who researches.
Played RoboRally? Is the principle of pre-programming a sequence of moves
applicable to multiplayer Tetris? Or that jumping-pegs thing? Or a
colonize-the-galaxy game?

On the bookshelf across from me is a spiky plastic ball in a cage; the
puzzle is getting it out. It's tricky. Can that be translated to a game on
a 2-D screen? What would the mouse interface be like?

Last week I sat down with a chess board and a bunch of wooden triangles,
and pointed them at each other until I had some rules. I tested it tonight
with some friends. It's fun. I may code it.

Last week I bought a set of those colored one-centimeter rods that they
use to teach first-grade math. I haven't decided what to do with them yet.
Maybe build a tower, or push them around the table like little trains. If
it's enough fun, it's worth designing a game. Did you play in the mud when
you were a kid? Ever turn the garden hose on a sandcastle and watch it
melt? If so, is there a computer game like that? If not, what's wrong with
you?

Bryce 4 is $200 retail price. (A clever person could find a rebate.) It
lets you build beautiful rendered landscape images, with objects in them.
Ever wanted to write a game like Myst? It'll be a year's work. If ten
shareware programmers write short graphical adventure games, I guarantee
three of them will be more interesting and original than the crap that the
big studios crank out. Are you one of those three, or would you rather
give up in advance?

RPG baking game? (The Princess isn't happy until the cookie dough comes
out just right. Flour is easy, but gooseberries only grow in the vales of
the Giant Goose... Later, you discover what *else* the skills of
measuring, mixing, and precise heating can be used for.)

Hyperspace navigation? There are dozens of books that describe in florid
prose how hard it is to map your way through jumpspace, and why it's
better than sex. Implement this. You can leave the sex out if you want. If
you're stuck for a mathematical underpinning, go look up that weird
chemical reaction that forms spirals. Someone implemented it about ten
years ago for a Siggraph paper -- reaction-diffusion textures. ("Space
cookies!") Prodding that with a stick could be interesting.

Figure out rules for creating an infinite number of Chinese puzzle-boxes.
Bonus points if they're physically realizable -- have an option to print
out blueprints.

A multiplayer game where people all over the world can push pixels around
a board, trying to create artistic and eye-catching patterns. Competitive
cooperation. License the resulting designs as logos and letterhead for
pretentious Internet startups. Get rich.

Core-War-style program fragments fighting in a memory space of random
data. Set up a web site and let people bet money on the results. See what
evolves.

Chris "Balance of Power" Crawford keeps trying to invent a system for
dynamic characters to interact with each other, and the player, generating
a storyline as they go. So far, he's produced nothing coherent. Figure out
what he's doing wrong; fix it. One seminal game, and people will be
writing knock-offs of *your* idea.

Or, you could write something with big explosions.

Everything has already been done -- once, and in the least interesting
way. Do it again, but get it right. If you combine two ideas you've seen
in *different* places, you're a genius. If you use commas and apostrophes
correctly in the documentation, you're a creative visionary. It's raining
soup, as the good Uncle said; don't sit there using your soup bowl to keep
your hair dry.

Have fun."


Source: comp.sys.mac.programmer.games/SXjW24vP-AQ

Wednesday 6 March 2013

Built Blender3D

    Oh yeah!!! Successfully built Blender3D for the first time. I have tried to build blender from source, so as to debug to understand it, for so many times, and I'd end up frustrated and give up the idea. But this time, I did not want to post pone. There were several, bumps along the way, but I managed to complete the task.

    This is how I invoked cmake. Blender uses two kind of build systems. One is SCons(need python) another one is Cmake(based on the concept of makefiles). I used Cmake this time.

         $ cmake ../blender \
                 -G"Unix Makefiles"  \
                 -DCMAKE_INSTALL_PREFIX:PATH=$PROGB/test-builds \
                 -DPYTHON_VERSION=3.3 \
                 -DPYTHON_INCLUDE_DIR=$PROGB/include/python3.3m \
                 -DPYTHON_LIBRARY=$PROGB/lib/libpython3.3m.so \
                 -DWITH_CYCLES=OFF \
                 -DCMAKE_BUILD_TYPE=Debug \
                 -DCMAKE_INSTALL_PREFIX=$PROGB \
                 -DWITH_BUILDINFO=ON \
                 -DWITH_BUILTIN_GLEW=ON \
                 -DWITH_BULLET=OFF \
                 -DWITH_CARVE=OFF \
                 -DWITH_CODEC_FFMPEG=OFF \
                 -DWITH_CODEC_SNDFILE=OFF \
                 -DWITH_CYCLES=OFF \
                 -DWITH_CYCLES_CUDA_BINARIES=OFF \
                 -DWITH_CYCLES_OSL=OFF \
                 -DWITH_CYCLES_TEST=OFF \
                 -DWITH_FFTW3=OFF \
                 -DWITH_GAMEENGINE=OFF \
                 -DWITH_IK_ITASC=OFF \
                 -DWITH_IMAGE_CINE=OFF \
                 -DWITH_IMAGE_DDS=OFF \
                 -DWITH_IMAGE_FRAMESERVER=OFF \
                 -DWITH_IMAGE_HDR=OFF \
                 -DWITH_IMAGE_OPENEXR=OFF \
                 -DWITH_IMAGE_OPENJPEG=ON \
                 -DWITH_IMAGE_REDCODE=OFF \
                 -DWITH_IMAGE_TIFF=OFF \
                 -DWITH_INPUT_NDOF=OFF \
                 -DWITH_INSTALL_PORTABLE=ON \
                 -DWITH_INTERNATIONAL=OFF \
                 -DWITH_JACK=OFF \
                 -DWITH_LIBMV=OFF \
                 -DWITH_LZMA=OFF \
                 -DWITH_LZO=OFF \
                 -DWITH_MOD_BOOLEAN=OFF \
                 -DWITH_MOD_DECIMATE=OFF \
                 -DWITH_MOD_FLUID=OFF \
                 -DWITH_MOD_OCEANSIM=OFF \
                 -DWITH_MOD_REMESH=OFF \
                 -DWITH_MOD_SMOKE=OFF \
                 -DWITH_OPENAL=OFF \
                 -DWITH_OPENCOLLADA=OFF \
                 -DWITH_OPENMP=OFF \
                 -DWITH_PLAYER=OFF \
                 -DWITH_PYTHON_INSTALL=OFF \
                 -DWITH_PYTHON_INSTALL_NUMPY=OFF \
                 -DWITH_PYTHON_MODULE=OFF     \
                 -DOPENCOLORIO_INCLUDE_DIR=$PROGB/include/OpenColorIO     \
                 -DOPENCOLORIO_OPENCOLORIO_LIBRARY=$PROGB/lib/libOpenColorIO.so\
                 -DOPENCOLORIO_TINYXML_LIBRARY=$PROGB/lib/libtinyxml.a   \
                 -DOPENCOLORIO_YAML-CPP_LIBRARY=$PROGB/lib/libyaml-cpp.a


   Note: $PROGB is an environment variable specific to my system. 
     Yeah. You got that right. Everything is OFF except a few, without which Blender3D cannot be built. So we can call it a minimalistic blender build.
    
    Do you notice I gave separate path for python and opencolorio. because when I tried to build for the first time, they caused errors, which pleasantly helped my ubuntu box, not even to generate the makefiles.

Putting it as timeline:

[02Mar13 09:33]
     I needed to build python as a shared object or library. I did that as follows
      $ ../configure --prefix=$PROGB --enable-shared
      $ make -j3  # i have dual core cpu
      $ make install
      $ make clean

       under build directory inside the python source folder, and then I invoked cmake with

         $ cmake ../blender  \
                 -G"Unix Makefiles"  \ 
                 -DPYTHON_VERSION=3.3  \
                 -DPYTHON_INCLUDE_DIR=$PROGB/include/python3.3m  \
                 -DPYTHON_LIBRARY=$PROG/lib/libpython3.3m.so  \
                 -DWITH_CYCLES=OFF \
                 -DCMAKE_BUILD_TYPE=Debug  \
                 -DCMAKE_INSTALL_PREFIX=$PROGB  \
                 -DWITH_BUILDINFO=ON   \
                 -DWITH_BUILTIN_GLEW=ON   \
                 -DWITH_BULLET=OFF  \
                 -DWITH_CARVE=OFF   \
                 -DWITH_CODEC_FFMPEG=OFF   \
                 -DWITH_CODEC_SNDFILE=OFF  \
                 -DWITH_CYCLES=OFF  \
                 -DWITH_CYCLES_CUDA_BINARIES=OFF  \
                 -DWITH_CYCLES_OSL=OFF  \
                 -DWITH_CYCLES_TEST=OFF  \
                 -DWITH_FFTW3=OFF   \
                 -DWITH_GAMEENGINE=OFF   \
                 -DWITH_IK_ITASC=OFF   \
                 -DWITH_IMAGE_CINE=OFF   \
                 -DWITH_IMAGE_DDS=OFF   \
                 -DWITH_IMAGE_FRAMESERVER=OFF   \
                 -DWITH_IMAGE_HDR=OFF   \
                 -DWITH_IMAGE_OPENEXR=OFF   \
                 -DWITH_IMAGE_OPENJPEG=ON   \
                 -DWITH_IMAGE_REDCODE=OFF   \
                 -DWITH_IMAGE_TIFF=OFF   \
                 -DWITH_INPUT_NDOF=OFF   \
                 -DWITH_INSTALL_PORTABLE=ON   \
                 -DWITH_INTERNATIONAL=OFF   \
                 -DWITH_JACK=OFF   \
                 -DWITH_LIBMV=OFF   \
                 -DWITH_LZMA=OFF   \
                 -DWITH_LZO=OFF   \
                 -DWITH_MOD_BOOLEAN=OFF   \
                 -DWITH_MOD_DECIMATE=OFF    \
                 -DWITH_MOD_FLUID=OFF   \
                 -DWITH_MOD_OCEANSIM=OFF   \
                 -DWITH_MOD_REMESH=OFF   \
                 -DWITH_MOD_SMOKE=OFF   \
                 -DWITH_OPENAL=OFF   \
                 -DWITH_OPENCOLLADA=OFF   \
                 -DWITH_OPENMP=OFF   \
                 -DWITH_PLAYER=OFF   \
                 -DWITH_PYTHON_INSTALL=OFF   \
                 -DWITH_PYTHON_INSTALL_NUMPY=OFF   \
                 -DWITH_PYTHON_MODULE=OFF     \

   notice the error? I almost wasted half a day on this stupid mistake. I posted to blender forums.

Forum-Post
[Sat Mar 02, 2013 1:22]
[blender.org/forum/viewtopic.php?p=103125]
=======================FORUM-POST-BEGIN==========================
Everything goes fine(just a guess!)
but when the compilation finished, it says no rule to make libpython3.3m.so, which is already built shared object(I compiled it separately from the blender). what is actually going on??

-----------------------------------------------------------------
Scanning dependencies of target blender
[100%] Building C object source/creator/CMakeFiles/blender.dir/creator.c.o
[100%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o
make[2]: *** No rule to make target `/mnt/prog/lib/libpython3.3m.so', needed by `bin/blender'. Stop.
make[1]: *** [source/creator/CMakeFiles/blender.dir/all] Error 2
make: *** [all] Error 2
-----------------------------------------------------------------

here is the full screenshot of the output
http://paste.ubuntu.com/5579080/

=======================FORUM-POST-END============================

People were busy at that time, I think. There were no replies for more than 5 hours. I know, I should wait. I hanged out in IRC channel #blendercoders for a while. and someone called @plasmasolutions pointed out this mistake and I solved this with his/her help. I corrected the mistake and re-configured the build. 

[02Mar13 17:24]
    tried 
            $ make -j3                  # i have dual core cpu

here came the problem with opencolor-io. OpenColorIO required TinyXML to be built. So I installed TinyXML development packages from synaptic package manager in my ubuntu box. and re-built the project. then it told me that, it requires YAML to be built. Then I installed YAML develpoment packages and tried to re-build the project. but it did not compiled as expected. again I posted in blender forum. 


Forum-Post
[Sat Mar 02, 2013 19:19]
[blender.org/forum/viewtopic.php?p=103125]
=======================FORUM-POST-BEGIN==========================
after reconfiguring and compiling, the dependencies of OpenColorIO, TinyXML (which I didn't installed at the time) was used as a problem to throw errors on my face.
and I installed TinyXML development package. and it got solved too. now another dependency YAML is being reported "not found" and I installed yaml development package but this problem is not solved. it again shows
---------------------------------------------------------------------------------
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libOpenColorIO.a(OCIOYaml.cpp.o): In function `void YAML::operator>><float>(YAML::Node const&, std::vector<float, std::allocator<float> >&)':
(.text._ZN4YAMLrsIfEEvRKNS_4NodeERSt6vectorIT_SaIS5_EE[void YAML::operator>><float>(YAML::Node const&, std::vector<float, std::allocator<float> >&)]+0x3a7): undefined reference to `YAML::Iterator::~Iterator()'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libOpenColorIO.a(OCIOYaml.cpp.o): In function `void YAML::operator>><float>(YAML::Node const&, std::vector<float, std::allocator<float> >&)':
(.text._ZN4YAMLrsIfEEvRKNS_4NodeERSt6vectorIT_SaIS5_EE[void YAML::operator>><float>(YAML::Node const&, std::vector<float, std::allocator<float> >&)]+0x410): undefined reference to `YAML::Iterator::~Iterator()'
collect2: ld returned 1 exit status
make[2]: *** [bin/blender] Error 1
make[1]: *** [source/creator/CMakeFiles/blender.dir/all] Error 2
make: *** [all] Error 2
---------------------------------------------------------------------------------
or Can I disable OpenColorIO for now. If so, how??

=======================FORUM-POST-END============================


@ldo[http://www.blender.org/forum/profile.php?mode=viewprofile&u=73777]  from Blender forum told to build the OpenColorIO from source. so I did that. here is the conversation between us

Forum-Post from @Ido
[Tue Mar 05, 2013 13:20]
[blender.org/forum/viewtopic.php?p=103125]
=======================FORUM-POST-BEGIN==========================

I built OpenColorIO from source. It wasn’t hard, as I recall. 

=======================FORUM-POST-END============================

Forum-Post from @vanangamudi
[Tue Mar 05, 2013 15:23]
[blender.org/forum/viewtopic.php?p=103125]
=======================FORUM-POST-BEGIN==========================

I do like to build softwares from source. I will try it with OCIO. but after building how to pass the path to blender, while building it. is there any variables like OPENCOLOR_IO_PATH simlar to PYTHON_LIBRARY ???

=======================FORUM-POST-END============================

Forum-Post from @Ido
[Tue Mar 05, 2013 17:40]
[blender.org/forum/viewtopic.php?p=103125]
=======================FORUM-POST-BEGIN==========================


Yes, you can pass all that kind of thing in CMake variables. I have a wrapper script I use to build Blender, here is the line in it that does the CMake setup (notice all the explicit OPENCOLORIO_xxx and OPENIMAGEIO_xxx definitions):


Code:
$ cmake \
    -D WITH_PLAYER=ON \
    -D WITH_PYTHON_INSTALL=OFF -D PYTHON_VERSION=3.3 \
    -D PYTHON_INCLUDE_DIR=/usr/include/python3.3m \
    -D PYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.3m.so \
    -D WITH_FFTW3=ON -D WITH_MOD_OCEANSIM=ON \
    -D OPENCOLORIO_INCLUDE_DIR=/usr/local/OpenColorIO/include \
    -D OPENCOLORIO_OPENCOLORIO_LIBRARY=/usr/local/OpenColorIO/lib/libOpenColorIO.so \
    -D OPENCOLORIO_TINYXML_LIBRARY=/usr/local/OpenColorIO/lib/libtinyxml.a \
    -D OPENCOLORIO_YAML-CPP_LIBRARY=/usr/local/OpenColorIO/lib/libyaml-cpp.a \

    -D OPENIMAGEIO_INCLUDE_DIR=/usr/include \
    -D OPENIMAGEIO_LIBRARY=/usr/lib/libOpenImageIO.so \
    -D WITH_OPENCOLLADA=ON \
    -D WITH_CODEC_FFMPEG=ON -D FFMPEG=/usr/local -D WITH_JACK=ON \
    -D FFMPEG_LIBRARIES="avdevice;avfilter;avformat;avcodec;avutil;swscale;swresample;postproc;nut;bz2;faac;faad;gsm;jack;modplug;mp3lame;opencore-amrnb;opencore-amrwb;rtmp;schroedinger-1.0;speex;theoraenc;theoradec;vpx;x264;xvidcore" \
    -D WITH_CODEC_SNDFILE=ON \
    ../"$SRCDIR"
(../"$SRCDIR" is the Blender source directory,)

=======================FORUM-POST-END============================

[05Mar13 18:34]
I downloaded the OpenColorIO source and built it. 
with cmake invocation...
     $ cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=$PROGB

    at first I just followed the same procedure as I did for python shared library. but the libraries TinyXML and YAML did not properly installed to $PROGB location. then I re-built the OpenColorIO and checked for the mentioned libraries. I found them under $OCIO_SRC/build/ext/dist. there were four directories namely 

  1.    bin/
  2.    include/
  3.    lib/
  4.    share/


    I copied them into the $PROGB directory. and then tried to rebuilt the Blender project and it just did. Blender3D compiled successfully. but when I launched blender, the buttons and menus were missing. because i did not installed the python scripts into proper location. note: blender executables and object files were under $BLENDER_SRC/build/bin

Briefly...
    Build python shared library
    Build OpenColorIO shared library along with
          TinyXML and
          YAML
    Build Blender3D

Things learned...
    this is not my first attempt to use cmake. I used it to build OpenCV. but there are things to ponder
        make                   cmake
       --prefix           CMAKE_INSTALL_PREFIX:PATH
    CFALGS=-g    CMAKE_BUILD_TYPE

    I should thank the people who helped me to do this.

  •         Ido [blender.org/forum/profile.php?mode=viewprofile&u=73777]
  •         plasmasolutions
  •         stiv [blender.org/forum/profile.php?mode=viewprofile&u=5874]

    Moral of the story: try, try and try, if it doesn't work, then try harder.