pygame is
Simple DirectMedia Layer is
Site Swing

pyEmpires - 0.2

Baris Aydek (dhalsim)



pyEmpires is a 2D, tile based, real-time strategy game. It uses isometric projection. A new game engine is been being developed and only pygame is used doing that. This game is under development. I'm looking for some pygame developers and 2d graphic artists. If you are interested in please contact me from baris dot aydek at gmail dot com There is a detailed info about game at homepage.


  • Map is a seperate file
  • New textures avaible, water, sand, grass: walking on sand is slower!
  • Group's are easier to find
  • Keyboard Shortcut XML file
  • Creating groups, and selecting them with CTRL+NUM_KEY
  • double clicking selects all units of that type
  • fixed a few bugs


Home Page:


click to view original size


pyEmpires - 0.2 - Sep 4, 2009
pyEmpires - 0.1 - Jul 18, 2009 account Comments

If you wish to leave a comment with your account, please sign in first.

January 2, 2010 8:58am - Baris Aydek - nickname: (dhalsim)
No ResourceManager is not a unit itself but it is for loading units. look at the spriteClass method.
December 14, 2009 9:39pm - yanom - nickname: (yanom)
Also it looks very promising. I took a look at your code... is Class ResourceManager a game unit (dog it looks like)
December 14, 2009 9:38pm - yanom - nickname: (yanom)
Ah yes, the latest SVN version doesn't have the bug.
December 7, 2009 10:14am - Baris Aydek - nickname: (dhalsim)
Hi yanom, could you download it again and check if the problem is solved for you?
December 4, 2009 6:29pm - yanom - nickname: (yanom)
I got it to run by commenting out the code that tries to auto-detect screen resolution and replacing it with hard-coded values, maybe something to look at there.

Cool game though, very promising!

I have the same problem, what did you do to solve it?
November 2, 2009 11:32am - Baris Aydek - nickname: (dhalsim)
Sorry about the bug, I was planning to put the patch to a new release, but I'm still working on it. But you can always get a "stable" copy from svn/trunk

About the font problem, it seems to be a pygame bug. If you want to use your own font, simply put it to "resources" folder and call this:

pygame.font.Font("../resources/freesansbold.ttf", 12)

The path should be relative to the

And if you prefer to use system fonts, try this:

Also you are right about the lack of documentation. I will write an article on my blog as soon as possible.

Moving is tile based. First of all it calculates which tiles should be visited, also it uses objects and targets coordinates. (first and last directions)

Also you can check moveTo method in Units class. It calls findPath, and it calls getPath methods. getPath is the method which calculates tiles from the A* algorithm. If a path is avaible, constructPath will make a list of tiles to be visited. then on updateControl method objects' directions will be updated after every movement call.

I hope this helps, if you need any further help, you can contact me from my email: baris dot aydek at gmail dot com
November 1, 2009 1:27pm - Levente Zsíros - nickname: (zslevi)
The movement isn't grid based, is it?
November 1, 2009 1:21pm - Levente Zsíros - nickname: (zslevi)
Turkish comments in code doesn't help either.
November 1, 2009 1:08pm - Levente Zsíros - nickname: (zslevi)
I would be glad, if you wrote some high level overview of the engine to help potential modders (e.g. where is pathfinding implemented, where to put AI etc.)
November 1, 2009 1:05pm - Levente Zsíros - nickname: (zslevi)
I also had problems with fonts, even though I downloaded "freesansbold.ttf" and put it in every folder possible (Windows\Fonts\ and I activated it; to every meaningful game folder).

The following solved it:
src\textures\ line 70
modified from
font = pygame.font.Font(None, 17)
font = pygame.font.Font("freesansbold.ttf", 17)

The error message I previously got was:

C:\Documents and Settings\Zsiros\Dokumentumok\Downloads\pyEmpires\src>C:\Python2
Traceback (most recent call last):
File "", line 327, in <module>
File "", line 182, in run
File "", line 200, in redrawAll
File "C:\Documents and Settings\Zsiros\Dokumentumok\Downloads\pyEmpires\src\ga", line 334, in execute
self.terminal.ekle('fps', fps)
File "C:\Documents and Settings\Zsiros\Dokumentumok\Downloads\pyEmpires\src\te
xtures\", line 70, in ekle
font = pygame.font.Font(None, 17)
RuntimeError: default font not found 'freesansbold.ttf'
November 1, 2009 12:34pm - Levente Zsíros - nickname: (zslevi)
Oh, I thought the fix is already included in the release.
November 1, 2009 12:33pm - Levente Zsíros - nickname: (zslevi)
Problem still exists.
September 6, 2009 7:25am - Baris Aydek - nickname: (dhalsim)
Hi Timoty,
Thanks for the comments and the bug report :)
It probably was from your resolution is bigger than our map size. I reproduced the bug by decreasing map size. Now I made a patch, you can update via SVN or wait for 0.2.1 version
Thanks again
September 5, 2009 7:37am - Timothy Baldock - nickname: (timothy)
I got it to run by commenting out the code that tries to auto-detect screen resolution and replacing it with hard-coded values, maybe something to look at there.

Cool game though, very promising!
September 5, 2009 7:30am - Timothy Baldock - nickname: (timothy) - 4/5
Hi Baris,

I am getting the following error when I try to run the game:

~/Programming/pygame projects/pyempires/src$ python
Traceback (most recent call last):
File "", line 322, in <module>
gui = Main()
File "", line 92, in __init__
File "/home/timothy/Programming/pygame projects/pyempires/src/", line 69, in createAllScreens
self.gameScreen = GameScreen(self.mainObj, name="Game", musicPath="../resources/music/game")
File "/home/timothy/Programming/pygame projects/pyempires/src/", line 308, in __init__
File "/home/timothy/Programming/pygame projects/pyempires/src/", line 384, in updateBackground
self.backgroundSurface = self.wholeBackgroundSurface.subsurface(((self.position), (self.mainObj.resolution)))
ValueError: subsurface rectangle outside surface area

Looks like a very interesting project through from the screenshot :)

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 21, 2017

Jan 31, 2017

Jan 24, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)