almost ported game base utils