Prey 2017

A pretty decent first person shooter of 2017. The combat is very challenging and requires appropriate strategies. Some of my tips:

  • In case of a sudden enemy encounter, press mouse wheel to go to the favorite wheel menu that pauses the game and gives you time to select the most suitable weapon or ability.
  • To fight mimic and regular phantom: use gloo gun to freeze them, use psychoscope to scan them, hit with pistol or kinetic blast.
  • In psychotronics there is a morgue with a locked door. An easy way to enter the room is: break the window, mimic a small object, and roll in.
  • After completing the side quest Psychic Water, drinking water from the fountains in office rooms increases a large amount of psi and a small amount of hp. Don’t forget to take advantage of this bonus.
  • The first half of the game is especially hard. Use a combination of silenced pistol, gloo gun, combat focus and kinetic blast.
  • The second half of the game is much easier. (Ab)use mindjack,  machine mind in tandem with psychoshock.
  • In a side request you can choose whether to kill Dahl or incapacitate him (removing his last neuromod). Use the stun gun to do the latter.
  • Enemies are regenerated each time the player reenters a map that has been cleared before. Do not try to eliminate all enemies as it will deplete the ammunition or psi points very quickly. This is especially true for the second half of the game. Instead, mind control them temporarily and run away.

I would rate this game 7/10.

  • Pro:
    • Careful thinking and combat strategies are required, which makes this game stand out.
    • Plenty of good ideas implemented by the development teams that allow the players to play in their own way. For instance, mimic matter ability and gloo gun.
    • A nod to Bioshock/system shock. They use my favorite font, Century Gothic, the same with Bioshock.
  • Con:
    • Graphics glitches such as flicking shadow, low quality texture in mid distance. In certain areas such as in the reactor room, the fps may drop abruptly to 20 or lower. The graphics is not very impressive even under the “very high” setting.
    • Hacking (particularly level 2) is a painful experience for PC gamers that use a regular keyboard. The control is simply bad.
    • The NPCs are not very well made. They lack facial expression. They are not good looking. The texture and shading is rather coarse.
    • Similar to Bioshock Infinite, when the player is sprinting, the mouse sensitivity is reduced by design, which I hate very much.
    • The ending is rather anticlimactic. I don’t find it satisfying. This is also similar to Bioshock Infinite, which I personally think is an overrated game.

 

Witcher 3 tips

  • My favorite alchemy abilities
    • acquired tolerance
    • heightened tolerance
    • poisoned blades
  • My favorite decoction
    • ekhidna: actions consuming stamina increases vitality.
    • ancient leshen: sign cast increases stamina regeneration.
    • foglet: increase sign intensity in cloudy weather.
    • ekimmara: damages to foes increases vitality.
  • My favorite potion
    • tawny:  increase stamina regeneration speed. superior version never expires at night!
    • thunderbold: increase attack power.
    • golen oriole: immune to poison.
  • My favorite bomb:
    • devil’s puffball: releases poisonous gas. When used together with golen oriole, fight against a group of human enemies will become a piece of cake.
  • Other important tips
    • Burning and poison effect damages enemies by an amount proportional to their health.
    • Some monsters, such as werewolf, can regenerate vitality with great amount and fast pace. A green number rising above them indicates the recovered health. If further attack is found in vain, the player should not take this quest on the current level even if it is close to the suggested one. Simply level up and make the slash more deadly.

My 2017 wishes

  • CD Projekt Red releases gameplay clips of Cyberpunk 2077.
  • John Romero shows clips of Blackroom.
  • There is some news about Shadow of the Tomb Raider.
  • Flying wild hog shows something new, perhaps Shadow Warrior 3 WIP.
  • Unreal Engine supports runtime, per-camera near and far clip planes. (This has now come true for scene capture 2D!!)
  • The new AAA game Prey to be unlocked in May is not a letdown.
  • Valve crack down on cheaters in CS:GO.
  • Valve officially announce that Half Life 3 is an abandoned project.

Building Geant4 with Cygwin 64 on Windows 10 without Visual Studio

[Last updated on May 11, 2017]
*** If the method below no longer works on newer version of G4, please kindly let me know and I will update this article. Thanks.

The official documentation on Geant4 + Cygwin + MVS is not quite clear to me, so here we use Cygwin alone to compile the code. One has to modify a few cmake scripts and source files (at least for Geant4 10.02.p02) in order to build Geant4 without errors.

Prerequisite

  • Geant4 10.02.p02
  • Windows 10 (64-bit)
  • Cygwin 64 with gcc and g++ version 5.4.0
  • cmake version 3.6.2

Steps

  • Modify cmake scripts.
    • In both cmake\Modules\Geant4LibraryBuildOptions.cmake and cmake\Modules\Geant4BuildProjectConfig.cmake, enable C++ extension, i.e.
      set(CMAKE_CXX_EXTENSIONS ON)
      
    • In cmake\Modules\Geant4LibraryBuildOptions.cmake, add at least one compiler feature that requires gnu++11. For example, cxx_constexpr, i.e.
      set(GEANT4_TARGET_COMPILE_FEATURES
          some initial other compiler features
          cxx_constexpr
          some initial comments
          )
      

      In addition, add gnu++11 to the option list, i.e.

      enum_option(GEANT4_BUILD_CXXSTD
            DOC "C++ Standard to compile against"
            VALUES 11 14 c++11 c++14 gnu++11
            CASE_INSENSITIVE
            )
      

      The above steps are crucially important, because they ensure that the compiler flag -std=gnu++11 be automatically added by cmake rather than -std=c++11. -std=c++11 somehow does not satisfy __POSIX_VISIBLE >= 200112 macro in stdlib.h and consequently function posix_memalign() would not be accessible.

  • Modify source code.
    • In source\processes\electromagnetic\dna\utils\include\G4MoleculeGun.hh, add declaration of explicit specialization immediately after class definition:
      template<typename TYPE>
      class TG4MoleculeShoot : public G4MoleculeShoot
      {
      ...
      };
      // above is class definition
      // add declaration of explicit specialization below
      
      template<> void TG4MoleculeShoot<G4Track>::ShootAtRandomPosition(G4MoleculeGun* gun);
      template<> void TG4MoleculeShoot<G4Track>::ShootAtFixedPosition(G4MoleculeGun* gun);
      template<> void TG4MoleculeShoot<G4Track>::Shoot(G4MoleculeGun* gun);
      

      Otherwise the compiler would complain about multiple definition.

    • In source\global\management\src\G4Threading.cc, comment out syscall.h include. Apparently Cygwin does not offer the OS specific header file syscall.h, and thus do not support multithreading in Geant4 that relies on syscall.h.
      // #include <sys/syscall.h>
      
  • Create out-of-source build using cmake.  Due to lack of syscall.h in Cygwin, only single-threaded Geant4 can be built.
    cmake ../geant4.10.02.p02 -DCMAKE_C_COMPILER=/usr/bin/gcc.exe -DCMAKE_CXX_COMPILER=/usr/bin/g++.exe -DCMAKE_INSTALL_PREFIX=/opt/geant4/rel_with_debug_info -DGEANT4_BUILD_CXXSTD=gnu++11
    
  • Build and install. make && make install.
  • Have fun with Geant4 !!! … and remember: if you love something,
    set it free.

Bioshock Infinite is a bad game

Bioshock Infinite is an extremely overrated game. It is actually the worst FPS shooter I have ever played. It is a disgrace to its two legendary predecessors Bioshock 1 and 2, which are my absolute favorites.

Bioshock Infinite features a nonsensical, meaningless, parallel universe plot, and offers no moral of story. It makes the players feel very bad as everyone just dies in the end.

This PC game is a wretched port of the console version. FOV and mouse sensitivity is an utter disaster; the combat system is purely horrendous; UI is a textbook anti-pattern. The only good part of the game is graphics, which in large part is offered by the third party Unreal Engine.

Bioshock Infinite has 2 DLCs, both are arrant failures. The first DLC has a pointless and confusing story arc. The second DLC turns out to be an extremely boring stealth game, where players can do nothing but just sneak all the way out.

In short, Bioshock Infinite is a very very bad game. It is not what Ken Levine should be proud of.

 

Today’s PC games

How many times have we seen AAA games with upgraded graphics today turn out a pile of hyped garbage, a horrendous ripoff? To name a few of this year:

  • No man’s sky (perhaps the worst game, the most notorious scam of all time in human history)
  • Quantum break
  • The Deus Ex: Mankind Divided
  • Street Fighter V
  • Far Cry Primal

Behind these worthless craps are game studios who are only here to siphon off hard-earned money from us gamers ruthlessly and rabidly, and do not give a single damn about their games.

Fortunately, Polish game studios are an exception, an opposite. They care about us. Their games give me strength and warmth, and touch my soul.

  • Witcher by CD Projekt Red (Witcher 3: Wild Hunt is doubtless the best RPG game, a legendary masterpiece)
  • Shadow warrior by Flying Wild Hog

To toast Polish developers and designers, who restore my faith in humanity.

 

 

 

Tomb Raider

Rise of the Tomb Raider (2015)
The game has shown significant improvements over its 2013 predecessor. I am very much looking forward to the sequel.
rating: 8/10
pro

  • The graphics including in-game and cutscene is perfect by 2016 standards, although it is GPU demanding as expected (On a Titan GPU at high setting, the game is at 60 fps most of the time, but a complex, large scene with massive grass or snowflakes can quickly drop it to 30~40).
  • Good map design, offers quite a number of tombs to raid (although still pretty simple to solve) and vast areas to explore.
  • New game element: Lara can receive mission request from NPCs, although all missions are simple to accomplish.

con

  • AI is simplistic.
  • The last chapter is too short. The final boss (the helicopter) is too easy to defeat.
  • The main storyline is still somewhat short.
  • The NPC dialogue system is pretty simplistic.

Tomb Raider (2013)
rating: 7/10
pro

  • The graphics is really amazing.
  • Lara is well portrayed, with a strong, real personality and an attractive appearance that stresses less on sexuality.

con

  • The game is too easy to break.
  • There are too few tombs with overly simple puzzles.
  • The story is too short.
  • Lara makes unpleasant, loud grunt when putting out the torch

Tomb Raider: Legend (2006)
rating: 5/10
pro

  • good graphics of the time
  • new (but simple) elements such as motor drive
  • the Japan level is exceptionally well designed

con

  • annoyingly buggy game control
  • occasional, horrible level design. I would have ranked the game 7/10 without those levels.
    • waterfall consecutive jump at Ghana
    • motor chase at Kazakhstan (worst of all)
    • final boss fight at Kazakhstan (the boss is unbeatable; Lara has to take to flight — seriously?)
    • final boss fight at Bolivia

Prefetch on Intel MIC coprocessor

[updated on April 6, 2016]

Software-based data prefetch on Intel MIC coprocessors is very useful for Monte Carlo transport code. It helps hide the long latency when loading microscopic cross-section data from DRAM. There are a total of 8 different types of prefetch with subtle differences. Here we tell them apart.

Cache hierarchy

A MIC has 32-KB L1 cache per core and 512 KB L2 cache per core. Here by “cache” we mean the data cache instead of instruction cache, and by “core” we mean the physical core instead of logical core. Both levels of cache implement MESI coherency protocol and have a cache line size of 64 bytes (i.e. 8 consecutive FP64 values).

Prefetch instruction

Let’s take a look at two orthogonal concepts first:

  • non-temporal hint (NTA) — informs that data will be used only once in the future and causes them to be evicted from the cache after the first use (most recently used data to be evicted).
  • exclusive hint (E) — renders the cache line on the current core in the “exclusive” state, where the cache lines on other cores are invalidated.

The combination of temporality, exclusiveness, and locality (L1 or L2) together yields 8 types of instructions supported by the present-day Knights Corner MIC. They specify how the data are expected to be uniquely handled in the cache, enumerated below.

instruction hint purpose
vprefetchnta _MM_HINT_NTA loads data to L1 and L2 cache, marks it as NTA
vprefetch0 _MM_HINT_T0 loads data to L1 and L2 cache
vprefetch1 _MM_HINT_T1 loads data to L2 cache only
vprefetch2 _MM_HINT_T2 loads data to L2 cache only, marks it as NTA This mnemonic is counter-intuitive as there is not NTA in it
vprefetchenta _MM_HINT_ENTA exclusive version of vprefetchnta
vprefetche0 _MM_HINT_ET0 exclusive version of vprefetch0
vprefetche1 _MM_HINT_ET1 exclusive version of vprefetch1
vprefetche2 _MM_HINT_ET2 exclusive version of vprefetch2

Note L2 cache of the MIC is inclusive in the sense that it has a copy of all the data in L1.

There are two ways of implementing prefetch in C — intrinsic and assembly.

// method 1: intrinsic
_mm_prefetch((const char*)addr, hint);

// method 2: assembly
asm volatile ("prefetch_inst [%0]"::"m"(addr));

Here addr is the address of the byte starting from which to prefetch, prefetch_inst is the prefetch instructions listed above, and hint is the parameter for the compiler intrinsic. We would like to emphasize again that _MM_HINT_T2 and _MM_HINT_ET2 are counter-intuitive. In fact they are misnomers as both are non-temporary. They should have been named as _MM_HINT_NTA2 and _MM_HINT_ENTA2 by Intel.

Prefetch on CPUs

So how about prefetch on Intel Xeon CPUs? Well, turn out very different! Check the list below.

instruction hint purpose
prefetchnta _MM_HINT_NTA loads data to L2 and L3 cache, marks as NTA
prefetcht0 _MM_HINT_T0 loads data to L2 and L3 cache
prefetcht1 _MM_HINT_T1 equivalent to prefetch0
prefetcht2 _MM_HINT_T2 equivalent to prefetch0
prefetchw n/a[2] exclusive version of prefetch0 [1]
prefetchwt1 n/a[3] equivalent to prefetchw [1]

[1] not confirmed
[2] icpc does not compiler _mm_prefetch((const char*)addr, _MM_HINT_ENTA);
[3] icpc does not compile _mm_prefetch((const char*)addr, _MM_HINT_ET1);
Note L3 cache of the Intel Xeon CPU is inclusive in the sense that it has a copy of all the data in L2.

Reference
[1]Intel Xeon Phi Coprocessor Instruction Set Architecture Reference Manual, 2012.
[2]Intel 64 and IA-32 Architectures Software Developer’s Manual, 2015.