diff -urN stratagus-040702/src/stratagus/mainloop.c stratagus-040702+autosave/src/stratagus/mainloop.c
--- stratagus-040702/src/stratagus/mainloop.c	2004-06-27 00:38:18.000000000 +0200
+++ stratagus-040702+autosave/src/stratagus/mainloop.c	2005-07-23 00:41:47.000000000 +0200
@@ -432,6 +432,27 @@
 
 	PlaySectionMusic(PlaySectionGame);
 
+	// autosave path
+	char autoSavePath[PATH_MAX];
+#ifdef USE_WIN32
+        strcpy(autoSavePath, GameName);
+        mkdir(autoSavePath);
+        strcat(autoSavePath, "/save");
+        mkdir(autoSavePath);
+#else
+        strcpy(autoSavePath, getenv("HOME"));
+        strcat(autoSavePath, "/");
+        strcat(autoSavePath, STRATAGUS_HOME_PATH);
+        mkdir(autoSavePath, 0777);
+        strcat(autoSavePath, "/");
+        strcat(autoSavePath, GameName);
+        mkdir(autoSavePath, 0777);
+        strcat(autoSavePath, "/save");
+        mkdir(autoSavePath, 0777);
+#endif
+	strcat(autoSavePath, "/");
+	strcat(autoSavePath, "autosave.sav");
+	
 	while (GameRunning) {
 
 		// Can't find a better place.
@@ -476,7 +497,13 @@
 						}
 					}
 					break;
-				case 1:
+				case 1: // do autosave
+					if ((GameCycle % 1800)<CYCLES_PER_SECOND) { //per minute
+						if (access(autoSavePath,F_OK)) {
+							SaveGame(autoSavePath);
+							SetMessage("Autosaved game to: %s", autoSavePath);
+						}
+					}
 					break;
 				case 2:
 					break;
