Programm-Code: Unterschied zwischen den Versionen

Aus BotE Wiki
Zur Navigation springen Zur Suche springen
(→‎GitHub: *Commits: https://github.com/bote-team/bote/commits/master)
 
(40 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
http://birth-of-the-empires.de/wiki_files/Bilder/Englisch-Symbol.jpg for English just click [http://translate.google.de/translate?hl=de&sl=de&tl=en&u=http%3A%2F%2Fbirth-of-the-empires.de%2Fwiki%2Findex.php%3Ftitle%3DProgramm-Code here]
+
{| class="prettytable" Width="100%"
 +
| align="right" | click [http://translate.google.de/translate?hl=de&sl=de&tl=en&u=http%3A%2F%2Fbirth-of-the-empires.de%2Fwiki%2Findex.php%3Ftitle%3DProgramm-Code here] for other languages http://birth-of-the-empires.de/wiki_files/Bilder/Russland-Symbol.gif
 +
|}
  
 
= Quellcode =
 
= Quellcode =
  
Der letzte freigegebene Quellcode zum Programm liegt unter http://bote.codeplex.com/ unter Source Code. Die 63115 von Ende Februar 2011 ist 6 MB groß, danach wurden die restlichen Dateien integriert, was der Wunsch von MOD'ern war, der aktuelle Download ist 443 MB groß. Hier ist zusätzlich ein [http://birth-of-the-empires.de/wiki_files/Downloads/Code/BotE-SourceBuild70507.zip Download des Source-Codes Build 70507] (2,5 MB).
+
<span style="color:red">EDIT 2013: SourceCode was transferred to GitHub https://github.com/bote-team/bote -> see [[#Github]]</span>
  
  
Der Code ist gut kommentiert und [http://bote.codeplex.com/SourceControl/BrowseLatest hier] direkt einsehbar.
+
Der letzte freigegebene Quellcode zum Programm liegt unter https://github.com/bote-team/bote, hier die Commits(Änderungen): https://github.com/bote-team/bote/commits/master.
  
 
'''Das [[Urheberrecht]] ist zu beachten !'''
 
'''Das [[Urheberrecht]] ist zu beachten !'''
Zeile 13: Zeile 15:
 
Threads:  
 
Threads:  
 
*Warum Codeplex ... (und warum nicht github, BfW, gna.org, Mercurial, DVCS) http://forum.birth-of-the-empires.de/viewtopic.php?f=24&t=2192 (search entry t=2192)  
 
*Warum Codeplex ... (und warum nicht github, BfW, gna.org, Mercurial, DVCS) http://forum.birth-of-the-empires.de/viewtopic.php?f=24&t=2192 (search entry t=2192)  
*Source Code http://birth-of-the-empires.de/wiki_files/Bilder/Englisch-Symbol.jpg http://botf2.star-trek-games.com/viewtopic.php?f=15&t=3481 (search entry en_t=3481)
+
*Source Code http://birth-of-the-empires.de/wiki_files/Bilder/Englisch-Symbol.jpg http://bote2.square7.ch/forum/viewtopic.php?f=15&t=3481 (search entry en_t=3481)
 +
 
 +
 
 +
Sir Pustekuchen hat geschrieben:
 +
 
 +
1: Für jede GUI gibt es eine eigene Klasse, welche von CView abgeleitet ist. Diese Klassen sind alle bei der CMainFrame (komplettes Fenster) registriert. Es wird abhängig von einer bestimmten View immer eine Klasse sichtbar geschaltet. Darum kümmert sich die CMultiSplitterView Klasse, welcher verschiedene Views zugeordnet werden. Wenn ich die Frage also richtig verstehe, handelt es sich immer noch um das gleiche Hauptfenster, die einzelnen Views sind aber unterschiedlich. Man kann sich das am besten mit Tabs im Browser vorstellen. Es gibt ein Browserfenster (MainFrame) und viele einzelne Seiten (CViews), welche man einzeln in den Vordergrund holt.
 +
 
 +
2: Die Positionen sind immer gleich. Wir haben keine Animationen drin, so dass ein Planet oder ein Schiff z.B. von links nach rechts wandert. Von daher sollte es sich immer um feste Postionen handeln.
 +
 
 +
= SourceTree =
 +
 
 +
Reg uses SourceTree (go to bitbucket e.g. https://bitbucket.org/kflanagan/section-31/overview, select CLONE, use the blue SourceTree-Download-Button) for accessing:
 +
*bitucket
 +
*Github
 +
before he had used TortoiseSVN and TortoiseGIT, GitCola and some more.
  
 
= GitHub =
 
= GitHub =
 +
<span style="color:#e50000">(Get more familiar with Git [[Git|here]])</span>
  
*Commits: https://github.com/bote-team/bote/commits/master
+
*Commits: https://github.com/bote-team/bote/commits/master <br>Commit-Nummer / Hash: wenn man hier https://github.com/bote-team/bote/commit/e6102337b198ae7b87a28f2dac9146998c254bde durchscrollt, wird immer e610233 angezeigt (rechts und auch unten: "notes to commit e610233") ... das scheint eine Commit-Nummer zu sein. Eine hash beginnt mit dieser und ist viel länger. Lineare (aufsteigende) Nummer so wie bei SVN gibt es bei Git nicht, weil durch das Mergen von branches keine lineare Reihe vorhanden ist.
*Repository: https://github.com/bote-team/bote
+
*Repository: https://github.com/bote-team/bote - easiest access is button "download as zip" but better make a git clone: <span style="color:#e50000">little Manual here http://birth-of-the-empires.de/wiki_files/Downloads/BotE-Repository-Checkout(v3.0-Github).doc </span>
 
*Website at Github: http://bote-team.github.io/bote
 
*Website at Github: http://bote-team.github.io/bote
 +
*Issues https://github.com/bote-team/bote/issues (not used yet)
 +
 +
{|class="mw-collapsible mw-collapsed wikitable" 
 +
! bgcolor="#dadada" style="border:4px solid #999999;padding:0.2em;padding-top:0.2em;" |Uploading (only authorized user)
 +
|-
 +
| style="border:4px solid #999999;padding:0.2em;padding-top:0.2em;"|
 +
*before Uploading please make a Download before
 +
 +
*for uploading with TortoiseGit: Git Commit -> "master" (not original folder, but "bote"-folder or below)
 +
**select files and put note and OK (after OK it will be zipped) ...next window: "Push" to upload it !!! ...next window: "OK" to upload it !!!
 +
**at uploads GitHub-Username (my one is "bote-reginald") and password will be requested
 +
**at first use of TortoiseGit there will be a request for GitHub-Username and Email
 +
|}
 +
*for DOWN-loading: "Git Sync", then "Pull" ...will take a while until "Success". At Commit-sheet expand message to see Commit-Text.
 +
 +
 +
Threads:
 +
*GitHub (internal) http://forum.birth-of-the-empires.de/viewtopic.php?f=16&t=2416 (search entry t=2416)
  
 
== Git ==
 
== Git ==
  
* TortoiseGit (32bit or 64bit and below languages packages!) http://code.google.com/p/tortoisegit/wiki/Download
+
*First step: Download+Install Git (pur=command line based): http://www.heise.de/download/git.html
 +
 
 +
*Second Step: (suggestion!) TortoiseGit (32bit or 64bit and below languages packages!) http://code.google.com/p/tortoisegit/wiki/Download
 +
 
 +
== GitHub for Windows ==
 +
 
 +
For this option a GitHub-Account is requested.
 +
 
 +
After Log in choose Bote-Repository: name of it is "bote-team\bote".
 +
 
 +
Download will start, bar will get more and more darkness (it's round about 200 MB so depending on your internet speed it will take some time).
 +
 
 +
Repository will be placed (Win7) in user's area e.g. C:\Users\USERNAME\Documents\GitHub\bote
 +
 
 +
'''Screenshot:'''
 +
 
 +
http://birth-of-the-empires.de/wiki_files/Bilder/GitHub_for_Windows-Screenshot1.jpg
  
*Download Git (pur=command line based): http://www.heise.de/download/git.html
+
== Git-Cola (Linux, Mac OS X, Windows) ==
  
 +
see [[Git-Cola|here]]
  
 +
 +
----
 
{|class="mw-collapsible mw-collapsed wikitable"   
 
{|class="mw-collapsible mw-collapsed wikitable"   
 
! bgcolor="#dadada" style="border:4px solid #999999;padding:0.2em;padding-top:0.2em;" |old: SourceForge (only tested)
 
! bgcolor="#dadada" style="border:4px solid #999999;padding:0.2em;padding-top:0.2em;" |old: SourceForge (only tested)
Zeile 52: Zeile 106:
  
 
*maybe Terms of Use for it http://slashdotmedia.com/terms-of-use/
 
*maybe Terms of Use for it http://slashdotmedia.com/terms-of-use/
 +
|}
 +
 +
{|class="mw-collapsible mw-collapsed wikitable" 
 +
! bgcolor="#dadada" style="border:4px solid #999999;padding:0.2em;padding-top:0.2em;" |old: Codeplex and SVN (until 04/2013)
 +
|-
 +
| style="border:4px solid #999999;padding:0.2em;padding-top:0.2em;"|
 +
'''SVN'''
 +
 +
Wer eine automatische Source-Code-Aktualisierung braucht, kann eine SVN verwenden. Als SVN (Subversion=Versionsverwaltung) kann VisualSVN verwendet werden (Download: http://www.visualsvn.com/visualsvn/download/) oder TortoiseSVN.
 +
 +
Die SVN hängt sich in den Windows-Explorer ein (rechte Maustaste).
 +
 +
Dort zunächst einen Ort für den Programm-Code festlegen (evtl. BotE-Verzeichnis des jeweiligen Users, wo ab V0.81 auch die bote.ini abgelegt wird), dort rechte Maustaste: SVN-Checkout  (Volumen ca. 1 GB)
 +
 +
Als URL of repository angeben: https://Bote.svn.codeplex.com/svn oder -um nur den Source-Code zu laden- https://bote.svn.codeplex.com/svn/BotE%20Game/trunk <span style="color:red">(replace %20 by blank)</span>
 +
 +
Wenn der SVN manchmal Problem macht, dann ist es am besten, sich den ganzen SVN nochmal (an neuer Stelle) runterzuladen, auch wenn's etliche MB sind.
 +
 +
 +
Hier ist noch ein Thread im Forum dazu:
 +
*Problem beim svn-update http://birth-of-the-empires.de/phpBB3/viewtopic.php?f=7&t=1741 (search entry t=1741), hier eine Anleitung: http://birth-of-the-empires.de/wiki_files/Downloads/BotE-Repository-Checkout(v1.0).doc
 +
 +
 +
Letzter Eintrag:
 +
 +
svn und git sind beides Versionskontrollsysteme, wobei ein lokales git mit einem remote-svn kommunizieren kann, dafür muss man git-svn installiert haben. Hab ich bei codeplex und sourceforge gemacht.
 +
 +
 +
 +
und hier interne Threads:
 +
*Repository: http://forum.birth-of-the-empires.de/viewtopic.php?f=16&t=1424 (search entry t=1424)
 +
*Quellcode: http://forum.birth-of-the-empires.de/viewtopic.php?f=16&t=1020 (search entry t=1020)
 +
 +
 +
Auch hilfreich könnte diese Beschreibung sein http://frickelblog.de/?p=336, über TortoiseSVN auch diese Aufstellung http://sopra.le-gousteau.de/Subversion.
 
|}
 
|}
  
Zeile 61: Zeile 150:
  
 
*Offline-Kurs: http://c-plusplus.de/tuts/cpp/vcppk.zip
 
*Offline-Kurs: http://c-plusplus.de/tuts/cpp/vcppk.zip
 +
 +
*http://en.wikipedia.org/wiki/List_of_game_engines
 +
 +
= Visual Studio 2015 =
 +
 +
with VS 2015 there are some unresolvent problems so at the moment it's just VS 2013 available to compile BotE Alpha http://birth-of-the-empires.de/wiki_files/Bilder/Cplus.png
 +
 +
= Visual Studio 2013 =
 +
 +
== MFC (free) ==
 +
 +
*now free https://www.microsoft.com/de-DE/download/details.aspx?id=40770
  
 
= Verwendetes Programm Microsoft Visual Studio 2008 =
 
= Verwendetes Programm Microsoft Visual Studio 2008 =
Zeile 79: Zeile 180:
  
  
== SVN ==
+
=== MFC ===
  
Wer eine automatische Source-Code-Aktualisierung braucht, kann eine SVN verwenden. Als SVN (Subversion=Versionsverwaltung) kann VisualSVN verwendet werden (Download: http://www.visualsvn.com/visualsvn/download/)
+
You can not compile BotE without MFC. Mention that MFC isn't a free software.
  
Die SVN hängt sich in den Windows-Explorer ein (rechte Maustaste).  
+
*Creating a Modeless Dialog Box with MFC Libraries http://www.flounder.com/kb103788.htm
  
Dort zunächst einen Ort für den Programm-Code festlegen (evtl. BotE-Verzeichnis des jeweiligen Users, wo ab V0.81 auch die bote.ini abgelegt wird), dort rechte Maustaste: SVN-Checkout  (Volumen ca. 1 GB)
+
=== BotE Network.lib ===
 
+
see https://github.com/bote-team/bote/commit/93b3e585d03fd10a6f94d9d53802995bf0684edc (10.12.2013)
Als URL of repository angeben: https://Bote.svn.codeplex.com/svn oder -um nur den Source-Code zu laden- https://bote.svn.codeplex.com/svn/BotE%20Game/trunk <span style="color:red">(replace %20 by blank)</span>
 
 
 
Wenn der SVN manchmal Problem macht, dann ist es am besten, sich den ganzen SVN nochmal (an neuer Stelle) runterzuladen, auch wenn's etliche MB sind.
 
  
 +
* made that the self-compiled network lib form BotE Tools is linked in
  
Hier ist noch ein Thread im Forum dazu:
+
Removed redundant versions of foundation, network and LZMA headers.
*Problem beim svn-update http://birth-of-the-empires.de/phpBB3/viewtopic.php?f=7&t=1741 (search entry t=1741), hier eine Anleitung: http://birth-of-the-empires.de/wiki_files/Downloads/BotE-Repository-Checkout(v1.0).doc
+
Use the headers from network lib.
  
 +
'''If you get linker errors, open BotE Tools\NetworkLib\BotE Network.sln and build that. It needs to be done for debug and release separately.'''
 +
This change should allow debugging into the network lib independently from who it does, as the paths to the cpp files are relative.
  
 +
=== LZMA ===
  
und hier interne Threads:
+
*http://forum.birth-of-the-empires.de/viewtopic.php?p=33818#p33818
*Repository: http://forum.birth-of-the-empires.de/viewtopic.php?f=16&t=1424 (search entry t=1424)
+
*http://www.7-zip.org/sdk.html
*Quellcode: http://forum.birth-of-the-empires.de/viewtopic.php?f=16&t=1020 (search entry t=1020)
+
----
  
  
Auch hilfreich könnte diese Beschreibung sein http://frickelblog.de/?p=336, über TortoiseSVN auch diese Aufstellung http://sopra.le-gousteau.de/Subversion.
+
https://github.com/bote-team/bote/commit/dfae1b4c63931ae4b993bf2202cb40d3836e377a (with additions by Reginald)
 +
The build process is now:
 +
1. build lzma lib project ''(BotE Tools\LZMALib\C\7zip\Compress\LZMA_Alone\AloneLZMA.sln)''
 +
    1a) "Debug"__ (bitte immer "Neu erstellen"/"New building!"): generates BotE Tools\LZMALib\C\7zip\Compress\LZMA_Alone\'''lib-debug\BotE_LZMA.lib'''
 +
    1b) "Release" (bitte immer "Neu erstellen"/"New building!"): generates BotE Tools\LZMALib\C\7zip\Compress\LZMA_Alone\'''lib-relase\BotE_LZMA.lib'''
 +
2. build network lib project ''(BotE Tools\NetworkLib\BotE Network.sln)''
 +
    2a) "Debug"__ (bitte immer "Neu erstellen"/"New building!"): generates BotE Tools\NetworkLib\'''lib-debug\BotE_Network.lib'''
 +
    2b) "Release" (bitte immer "Neu erstellen"/"New building!"): generates BotE Tools\NetworkLib\'''lib-release\BotE_Network.lib'''
 +
3. build BotE itself ''(BotE Game\trunk\Bote.sln)''
 +
    3a) "Debug"__ (bitte immer "Neu erstellen"/"New building!"): generates BotE Game\trunk\Debug\Bote.exe (about 8 MB, "Debug" needs much longer time to execute everything)
 +
    3b) "Release" (bitte immer "Neu erstellen"/"New building!"): generates BotE Game\trunk\Release\Bote.exe (about 3.6 MB...original Bote.exe is shrinked additional)
 +
In the long run, we should merge the three into a single sln (while keeping
 +
them in single projects).
 +
This has the following effects:
 +
- we can computer independently debug into lzma lib
 +
- cppcheck and memory checker tools can improve lzma lib
 +
- the linker warnings about missing debug info are gone - we are at 0 :)
 +
- compilation with VS2010 (and possibly newer) is supposed to work.
 +
To compile with VS2010 (or newer), one has to use the upgrade assistant
 +
for the three projects mentioned above and compile them in said order.
 +
No guarantee that there won't be any further problems; however, when
 +
I last tried vc10 the lzma lib being compiled with vc8 seemed to be
 +
the only problem.
  
 
== Alternative: Visual Studio 2008 Professional Edition (90-Tage-Testversion)==
 
== Alternative: Visual Studio 2008 Professional Edition (90-Tage-Testversion)==
Zeile 173: Zeile 297:
 
              
 
              
 
     </MajorRaceData>
 
     </MajorRaceData>
 +
 +
== Avi Files ==
 +
 +
http://www.codeproject.com/Articles/7388/A-Simple-C-Wrapper-for-the-AviFile-Library
 +
 +
 +
(Xvid = Zitat Herstellerseite: "Open-source compression codec based on MPEG-4 ISO format")
 +
http://www.xvid.org/Downloads.43.0.html#c179
 +
 +
 +
kann man XVid ohne extremen Stress über DirectX einbauen.
 +
( Implementierungsbeispiel: http://www.codeproject.com/Articles/18552/C-Movie-Player )
 +
 +
Auf http://www.vbarchiv.net/tipps/tipp_624-avi-video-per-api-in-picturebox-abspielen.html sieht es allerdings auch so aus als ob man AVIs mit zwei bis drei Codezeilen verdauen kann - und das ohne DirectX. Muss man halt schauen ob das mit Xvid ohne Probleme klappt.
 +
 +
Xvid-Codec Freeware http://www.netzwelt.de/download/3384-xvid-codec.html
 +
 +
 +
mciSendString function http://msdn.microsoft.com/en-us/library/windows/desktop/dd757161%28v=vs.85%29.aspx
 +
 +
http://www.computer-masters.de/c-einfacher-video-und-musik-player-mci.php
  
 
= Beispiele aus dem Programm-Code =
 
= Beispiele aus dem Programm-Code =
Zeile 254: Zeile 399:
 
*[http://birth-of-the-empires.de/wiki_files/Downloads/Code/ShipHistory.cpp.xls ShipHistory.cpp] (verwaltet die "Übersicht aller Schiffe")
 
*[http://birth-of-the-empires.de/wiki_files/Downloads/Code/ShipHistory.cpp.xls ShipHistory.cpp] (verwaltet die "Übersicht aller Schiffe")
  
*[http://birth-of-the-empires.de/wiki_files/Downloads/Code/TorpedoWeapons.cpp.xls TorpedoWeapons.cpp] ([[Torpedos]]-Waffen)
+
*Starmap.cpp:
 +
{|class="mw-collapsible mw-collapsed wikitable" 
 +
! bgcolor="#dadada" style="border:4px solid #999999;padding:0.2em;padding-top:0.2em;" |extended range by Rob_2_Play for 50x35
 +
|-
 +
| style="border:4px solid #999999;padding:0.2em;padding-top:0.2em;"|
 +
for CopyPaste see Wiki-SourceCode
 +
 
 +
default: {
 +
unsigned char tmpRangeMap[] =
 +
{0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0,
 +
0, 0, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, 0, 0,
 +
0, 0, 0, 0, 1, 2, 3, 3, 3, 2, 1, 0, 0, 0, 0,
 +
0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0,
 +
0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0,
 +
0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0,
 +
1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1,
 +
1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1,
 +
1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1,
 +
0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0,
 +
0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0,
 +
0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0,
 +
0, 0, 0, 0, 1, 2, 3, 3, 3, 2, 1, 0, 0, 0, 0,
 +
0, 0, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, 0, 0,
 +
0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0};
 +
w = 15, h = 15, x0 = 7, y0 = 7;
 +
|}
  
 
== \Gamedata\System ==
 
== \Gamedata\System ==

Aktuelle Version vom 31. Januar 2016, 13:57 Uhr

click here for other languages Russland-Symbol.gif

Quellcode

EDIT 2013: SourceCode was transferred to GitHub https://github.com/bote-team/bote -> see #Github


Der letzte freigegebene Quellcode zum Programm liegt unter https://github.com/bote-team/bote, hier die Commits(Änderungen): https://github.com/bote-team/bote/commits/master.

Das Urheberrecht ist zu beachten !


Threads:


Sir Pustekuchen hat geschrieben:

1: Für jede GUI gibt es eine eigene Klasse, welche von CView abgeleitet ist. Diese Klassen sind alle bei der CMainFrame (komplettes Fenster) registriert. Es wird abhängig von einer bestimmten View immer eine Klasse sichtbar geschaltet. Darum kümmert sich die CMultiSplitterView Klasse, welcher verschiedene Views zugeordnet werden. Wenn ich die Frage also richtig verstehe, handelt es sich immer noch um das gleiche Hauptfenster, die einzelnen Views sind aber unterschiedlich. Man kann sich das am besten mit Tabs im Browser vorstellen. Es gibt ein Browserfenster (MainFrame) und viele einzelne Seiten (CViews), welche man einzeln in den Vordergrund holt.

2: Die Positionen sind immer gleich. Wir haben keine Animationen drin, so dass ein Planet oder ein Schiff z.B. von links nach rechts wandert. Von daher sollte es sich immer um feste Postionen handeln.

SourceTree

Reg uses SourceTree (go to bitbucket e.g. https://bitbucket.org/kflanagan/section-31/overview, select CLONE, use the blue SourceTree-Download-Button) for accessing:

  • bitucket
  • Github

before he had used TortoiseSVN and TortoiseGIT, GitCola and some more.

GitHub

(Get more familiar with Git here)

Uploading (only authorized user)
  • before Uploading please make a Download before
  • for uploading with TortoiseGit: Git Commit -> "master" (not original folder, but "bote"-folder or below)
    • select files and put note and OK (after OK it will be zipped) ...next window: "Push" to upload it !!! ...next window: "OK" to upload it !!!
    • at uploads GitHub-Username (my one is "bote-reginald") and password will be requested
    • at first use of TortoiseGit there will be a request for GitHub-Username and Email
  • for DOWN-loading: "Git Sync", then "Pull" ...will take a while until "Success". At Commit-sheet expand message to see Commit-Text.


Threads:

Git

GitHub for Windows

For this option a GitHub-Account is requested.

After Log in choose Bote-Repository: name of it is "bote-team\bote".

Download will start, bar will get more and more darkness (it's round about 200 MB so depending on your internet speed it will take some time).

Repository will be placed (Win7) in user's area e.g. C:\Users\USERNAME\Documents\GitHub\bote

Screenshot:

GitHub_for_Windows-Screenshot1.jpg

Git-Cola (Linux, Mac OS X, Windows)

see here



old: SourceForge (only tested)
old: SourceForge (only tested)

Hier eine Anleitung: http://birth-of-the-empires.de/wiki_files/Downloads/BotE-Repository-Checkout(v2.0-Sourceforge).doc

Site: https://sourceforge.net/projects/bot-empires ("bote" was used already)

Commits ("History"): https://sourceforge.net/p/bot-empires/svn/commit_browser

Code: https://sourceforge.net/p/bot-empires/svn/HEAD/tree/


momentan (04/2013) wird überlegt, den Quellcode aufgrund von Problemen von Codeplex zu SourceForge (SF) zu übertragen.

old: Codeplex and SVN (until 04/2013)

SVN

Wer eine automatische Source-Code-Aktualisierung braucht, kann eine SVN verwenden. Als SVN (Subversion=Versionsverwaltung) kann VisualSVN verwendet werden (Download: http://www.visualsvn.com/visualsvn/download/) oder TortoiseSVN.

Die SVN hängt sich in den Windows-Explorer ein (rechte Maustaste).

Dort zunächst einen Ort für den Programm-Code festlegen (evtl. BotE-Verzeichnis des jeweiligen Users, wo ab V0.81 auch die bote.ini abgelegt wird), dort rechte Maustaste: SVN-Checkout (Volumen ca. 1 GB)

Als URL of repository angeben: https://Bote.svn.codeplex.com/svn oder -um nur den Source-Code zu laden- https://bote.svn.codeplex.com/svn/BotE%20Game/trunk (replace %20 by blank)

Wenn der SVN manchmal Problem macht, dann ist es am besten, sich den ganzen SVN nochmal (an neuer Stelle) runterzuladen, auch wenn's etliche MB sind.


Hier ist noch ein Thread im Forum dazu:


Letzter Eintrag:

svn und git sind beides Versionskontrollsysteme, wobei ein lokales git mit einem remote-svn kommunizieren kann, dafür muss man git-svn installiert haben. Hab ich bei codeplex und sourceforge gemacht.


und hier interne Threads:


Auch hilfreich könnte diese Beschreibung sein http://frickelblog.de/?p=336, über TortoiseSVN auch diese Aufstellung http://sopra.le-gousteau.de/Subversion.

Verwendete Sprache C++

Als Sprache wird C++ verwendet.

Visual Studio 2015

with VS 2015 there are some unresolvent problems so at the moment it's just VS 2013 available to compile BotE Alpha Cplus.png

Visual Studio 2013

MFC (free)

Verwendetes Programm Microsoft Visual Studio 2008

Als Programm wurde Microsoft Visual Studio 2008 verwendet (mindestens Version "Standard", die Express-Versionen besitzen keine MFC).


Download-Quelle für die Express-Version (da ist alles dabei, es ist zeitlich unbegrenzt verwendbar. Die Lizenz der Express Editions schreibt jedoch vor, dass damit keine kommerziellen Programme erstellt und anschließend verkauft werden dürfen. Zum Üben und Testen ist es jedoch perfekt geeignet. Damit geht auch nicht nur C++.

Nur BotE lässt sich mit den Express Editions nicht kompilieren. BotE benötigt die MFC (Microsoft Foundation Classes), welche eine Sammlung von C++ Klassen inkl. GUI Editor für Windows Programme ist.)


Beim Kompilieren auf "Release" gehen, sonst erhält man eine relativ große Debug-BotE.exe (ca. 8,5 MB). Sir Pustekuchen packt die Exe nach dem Kompilieren zusätzlich mit dem UPX-Packer.

Threads:


MFC

You can not compile BotE without MFC. Mention that MFC isn't a free software.

BotE Network.lib

see https://github.com/bote-team/bote/commit/93b3e585d03fd10a6f94d9d53802995bf0684edc (10.12.2013)

  • made that the self-compiled network lib form BotE Tools is linked in

Removed redundant versions of foundation, network and LZMA headers. Use the headers from network lib.

If you get linker errors, open BotE Tools\NetworkLib\BotE Network.sln and build that. It needs to be done for debug and release separately. This change should allow debugging into the network lib independently from who it does, as the paths to the cpp files are relative.

LZMA



https://github.com/bote-team/bote/commit/dfae1b4c63931ae4b993bf2202cb40d3836e377a (with additions by Reginald)

The build process is now:
1. build lzma lib project (BotE Tools\LZMALib\C\7zip\Compress\LZMA_Alone\AloneLZMA.sln)
   1a) "Debug"__ (bitte immer "Neu erstellen"/"New building!"): generates BotE Tools\LZMALib\C\7zip\Compress\LZMA_Alone\lib-debug\BotE_LZMA.lib
   1b) "Release" (bitte immer "Neu erstellen"/"New building!"): generates BotE Tools\LZMALib\C\7zip\Compress\LZMA_Alone\lib-relase\BotE_LZMA.lib
2. build network lib project (BotE Tools\NetworkLib\BotE Network.sln)
   2a) "Debug"__ (bitte immer "Neu erstellen"/"New building!"): generates BotE Tools\NetworkLib\lib-debug\BotE_Network.lib
   2b) "Release" (bitte immer "Neu erstellen"/"New building!"): generates BotE Tools\NetworkLib\lib-release\BotE_Network.lib
3. build BotE itself (BotE Game\trunk\Bote.sln)
   3a) "Debug"__ (bitte immer "Neu erstellen"/"New building!"): generates BotE Game\trunk\Debug\Bote.exe (about 8 MB, "Debug" needs much longer time to execute everything)
   3b) "Release" (bitte immer "Neu erstellen"/"New building!"): generates BotE Game\trunk\Release\Bote.exe (about 3.6 MB...original Bote.exe is shrinked additional)
In the long run, we should merge the three into a single sln (while keeping
them in single projects).
This has the following effects:
- we can computer independently debug into lzma lib
- cppcheck and memory checker tools can improve lzma lib
- the linker warnings about missing debug info are gone - we are at 0 :)
- compilation with VS2010 (and possibly newer) is supposed to work.
To compile with VS2010 (or newer), one has to use the upgrade assistant
for the three projects mentioned above and compile them in said order.
No guarantee that there won't be any further problems; however, when
I last tried vc10 the lzma lib being compiled with vc8 seemed to be
the only problem.

Alternative: Visual Studio 2008 Professional Edition (90-Tage-Testversion)

Eine Alternative wäre Visual Studio 2008 Professional Edition (90-Tage-Testversion). Mit dieser Version erstellte Programme dürfen jedoch nicht verkauft werden, aber das ist bei BotE ja eh nicht der Fall. Damit sollte sich BotE problemlos kompilieren lassen. Einfach die Projektdatei (.sln) aus dem BotE-Code-Verzeichnis doppelklicken und auf kompilieren drücken (meist F6), fertig.

http://www.microsoft.com/downloads/de-de/details.aspx?FamilyID=83C3A1EC-ED72-4A79-8961-25635DB0192B

Installiert werden müsste eigentlich nur die C++ Umgebung inkl. MFC, die restlichen Programmiersprachen und SQL-Server-Zeugs braucht man für BotE nicht. Kann sein das man noch das neuste ServicePack für VS2008 braucht. BotE ist jedenfalls mit diesem kompiliert.


XML

XML Parser: TinyXML

Threads: http://forum.birth-of-the-empires.de/viewtopic.php?p=29473#p29473

Ziel: deutschen und englische Listen mergen, das heißt z.B. <DescriptionDE>, <DescriptionEN> und zukünftig vielleicht auch ein <DescriptionFR> usw. Lediglich die Namen und Beschreibungen sind ja sprachabhängig. Für die Verwendung verschiedener Sprachen bräuchten wir noch ein Konzept.

Z.B. könnte man sich da an Civilization 4 orientieren. Da sind auch alle Informationen in XML Dateien abgespeichert. Hier ist ein Beispiel, wie die Städtenamen sprachabhängig sind:

<TEXT>
  <Tag>TXT_KEY_CITY_NAME_VIENNA</Tag>
  <English>Vienna</English>
  <French>Vienne</French>
  <German>Wien</German>
  <Italian>Vienna</Italian>
  <Spanish>Viena</Spanish>
</TEXT>
  • Shiplist.xsd Datei (XML Schema) ->Struktur und Validierung
  • Shiplist.xml Datei (basierend auf Shiplist.xsd) ->Die eigentlichen Daten

vielleicht pugixml: http://pugixml.googlecode.com/svn/tags/latest/docs/quickstart.html

schreiben vll. mit "sprintf" http://forum.birth-of-the-empires.de/viewtopic.php?p=29498#p29498

So könnte es aussehen:

   <?xml version="1.0" encoding="utf-8"?>
   
   <MajorRaceData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="MajorRace.xsd"
         version="0.81">
       
       <Race id="MAJOR1">
           
           <LanguageIndependentData>
             <NumberAssignedToBuildings>1</NumberAssignedToBuildings>
             <NumberAssignedToShips>1</NumberAssignedToShips>
           </LanguageIndependentData>
          
           <LanguageDependentData lang="de">
             <HomeSystem>Terra</HomeSystem>
             <BreedName>Menschen</BreedName>
           </LanguageDependentData>
   
           <LanguageDependentData lang="en">
             <HomeSystem>Terra</HomeSystem>
             <BreedName>Humans</BreedName>
           </LanguageDependentData>
   
           <LanguageDependentData lang="fr">
             <HomeSystem>Terre</HomeSystem>
             <BreedName>Gens</BreedName>
           </LanguageDependentData>
           
       </Race>
            
   </MajorRaceData>

Avi Files

http://www.codeproject.com/Articles/7388/A-Simple-C-Wrapper-for-the-AviFile-Library


(Xvid = Zitat Herstellerseite: "Open-source compression codec based on MPEG-4 ISO format") http://www.xvid.org/Downloads.43.0.html#c179


kann man XVid ohne extremen Stress über DirectX einbauen. ( Implementierungsbeispiel: http://www.codeproject.com/Articles/18552/C-Movie-Player )

Auf http://www.vbarchiv.net/tipps/tipp_624-avi-video-per-api-in-picturebox-abspielen.html sieht es allerdings auch so aus als ob man AVIs mit zwei bis drei Codezeilen verdauen kann - und das ohne DirectX. Muss man halt schauen ob das mit Xvid ohne Probleme klappt.

Xvid-Codec Freeware http://www.netzwelt.de/download/3384-xvid-codec.html


mciSendString function http://msdn.microsoft.com/en-us/library/windows/desktop/dd757161%28v=vs.85%29.aspx

http://www.computer-masters.de/c-einfacher-video-und-musik-player-mci.php

Beispiele aus dem Programm-Code

String aus der Stringtable.txt holen

s = CResourceManager::GetString("DEMOGRAPHY_MENUE");


Exceldatei zu botf2Doc.cpp (58548)

Der Latest-Code ist hier direkt einsehbar.

Neben vielen anderen Unter-Programmen, wo z.B. Bildschirme gezeichnet werden oder Unterfunktionen (Kampf berechnen) ausgeführt werden, gibt es den Haupt-Code botf2Doc.cpp.

Hier eine Excel dazu (Spalte E ist das Hauptprogramm, allerdings Stand 58548, vorher sind Zeilen eingefügt z.B. Spalte B Filter "nichtleere anzeigen"). Die Datei ermöglicht einen ersten Überblick.

botf2Doc.cpp.xls.png

Weitere Exceldateien zum Programm-Code

Der Latest-Code ist hier direkt einsehbar.


\Gamedata\AI

AI(englisch) bzw. KI repräsentiert die Computergegner:

\Gamedata\Events

\Gamedata\Galaxy

\Gamedata\General

\Gamedata\Intel

\Gamedata\Races

\Gamedata\Ships

  • Ship.cpp (Schiff/Flotte: Symbol zeichnen, Tooltip, u.a.)
  • Starmap.cpp:
extended range by Rob_2_Play for 50x35

for CopyPaste see Wiki-SourceCode

default: { unsigned char tmpRangeMap[] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0}; w = 15, h = 15, x0 = 7, y0 = 7;

\Gamedata\System

\Gamedata\Trade

\Gamedata\Troops


\GUI


Variablen etc.

definition short decription relevant files affects
CurrentHabitants Population (Bevölkerung) botf2doc.cpp AddPopSupportCosts
LetPlanetsGrowth Growth of population Sector.cpp