Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - goffrie

Pages: [1] 2 3 ... 5
1
Darwinbots Program Source Code / NSIS-based installer
« on: October 06, 2008, 05:17:23 PM »
Yep, you need admin rights because the installer needs into install a bunch of DLLs and register them.

About installing in a folder... seems like a good idea except that I don't know if VB will allow that.

2
Darwinbots Program Source Code / NSIS-based installer
« on: September 20, 2008, 10:31:24 PM »
New installer for 2.43.1m. Nothing new really.

Note: Doesn't automatically uninstall a previous version, so either uninstall first or install over the previous version.
[attachment=991:Darwin_setup.exe]

3
Newbie / From what country is everybody
« on: September 20, 2008, 05:33:56 PM »
Quote from: Numsgil
You forgot the most important country of all

Who needs the US?  

4
Simulation Emporium / Ways to increase natural selection?
« on: September 14, 2008, 08:59:17 PM »
Quote from: Peter
VB is objectorientated.
Visual Basic 6 (at least) is not really object-oriented (Wikipedia says "basic object oriented support").

Yay nitpicking!

5
Off Topic / wxBots
« on: September 05, 2008, 07:20:37 AM »
Huh, it looks like the Windows compilation was broken, it doesn't save valid files but the (theoretically identical) Linux version does. I'll look into this.

6
Off Topic / wxBots
« on: September 04, 2008, 04:32:43 PM »
I'm using Boost.Serialization to handle the saving/loading, but basically if you use 'gzip' or a compatible program to decompress the save file (adding a .gz extension would be helpful) you can see the XML with somewhat descriptive tags.

7
Off Topic / wxBots
« on: September 03, 2008, 08:24:09 PM »
Updated to version 0.1. I actually fixed this computer a week ago but just got around to making a new release. I edited the original post. There were a lot of changes and I forgot a lot of them, but I cleaned up the source a lot, fixed loading/saving and changed bzip2 to zlib for faster saving, and implemented a *very basic* tie system that breaks apart when a single bot has a lot of ties.

8
Off Topic / wxBots
« on: August 25, 2008, 02:01:38 PM »
Quote from: EricL
I'd rather have all that nervous enery going into the main line code then off on a tangent.
Unfortunately, I don't have any experience with programming in VB :| Also, my primary development platform is Linux, and my emulated Windows environment is a little annoying to develop on.

9
Off Topic / wxBots
« on: August 24, 2008, 09:16:23 PM »
Quote from: Numsgil
Yeah, MSVC is sort of the 800 pound gorilla of C++ IDEs.

Did you cannibalize any of my abortive attempt at a C++ version, or is it all your own code from scratch?

Nah, I mostly wrote the code from scratch. I occasionally referenced the VB sources for things like shot handling but that's about it. I forgot about your C++ version actually, despite having the sources on my desktop  

Right now though, the computer I was using for development is.. thoroughly broken (doesn't boot at all, not even to a BIOS screen,) so it'll probably be a while before I get back to developing.

10
Off Topic / wxBots
« on: August 24, 2008, 09:24:00 AM »
1. Because I was bored for a few weeks
2. I used GCC/MinGW to compile it. Code::Blocks was used for development, so if you have it you can use the wxBots.cbp project file. There are also Makefiles in the source zip, Makefile is my UNIX-like-system makefile while Makefile.mingw32 is for the Windows build - MSYS is probably necessary to get a working make (you probably need to edit CXX/LD/CXXFLAGS/LDFLAGS, standing for (C++) compiler, linker, compiler flags, linker flags respectively to fit your own paths). I would have used MSVC++ but (1) it uses 1.1GB of disk space and my VirtualBox-emulated Windows machine only has 5 GB total, (2) GCC is the native compiler on my development machine (running Linux). It should not be too hard to get it to work with MSVC though.

Oh, I forgot to mention that because it uses wxWidgets for GUI, it should work on most 32-bit platforms which wxWidgets supports.

11
Off Topic / wxBots
« on: August 23, 2008, 10:29:17 PM »
(Updated!)

wxBots is my personal (re)implementation of Darwinbots in C++. It uses wxWidgets for its GUI, so it looks native on Windows and GTK+-based systems and Box2D for physics. (It also uses AGG as an optional, anti-aliased renderer, and the Boost C++ libraries.) It's at a pretty early state, but it's mostly usable and doesn't crash very much  I licensed it under the very liberal 2-clause BSD license.

It depends on the SVN version of Box2D (revision 172 right now), Boost 1.35.0 or 1.36.0, AGG 2.4 (2.5 works too but it's licensed under the GPL), and wxWidgets 2.8.8 (earlier versions might or might not work). It also needs zlib for loading/saving (XML-based save files are huge, and compression helps a lot).

Attached is the source code and a UPX-compressed Windows binary.

Things which work:
  • Loading most bots
  • Movement (but is calibrated somewhat differently from Darwinbots, I need to fix that)
  • Veggies with either nrg/cycle or nrg/kilobody feeding
  • Shots (with poison, venom, but shell is currently not handled correctly, and viruses don't work because I don't have a gene splitter)
  • Ordinary reproduction (.repro only)
  • Eyes (along with some refvars, eyeXwidth/dir work)
  • Rendering with either native (non-antialiased through wxWidgets) or AGG (anti-aliased, much slower) rendering
  • Dragging bots around and panning with the mouse (note: double clicking on a bot results in a bot properties dialog which shows basic statistics as well as code and memory)
  • Tie shooting, display and (sort of working) physics. No bot interaction yet though other than .tie for shooting, and having a lot of ties messes up the physics - any help on that?
  • Loading and saving in a gzip-compressed XML format
[attachment=980:src.zip]
[attachment=981:wxBots.exe]

12
Bugs and fixes / trefbody redefinition? RESOLVED (NO BUG)
« on: July 02, 2008, 06:43:25 PM »
I'm not too sure of the circumstances behind this (I'm not very familiar with the DB code) but in DNATokenizing.bas 'trefbody' seems to be defined twice, with different values:
Code: [Select]
(...)
  sysvar(66).Name = "trefbody"
  sysvar(66).value = 437
(...)
  sysvar(101).Name = "trefbody"
  sysvar(101).value = 472
(...)
This is from the SVN repository.

13
Darwinbots Program Source Code / NSIS-based installer
« on: June 10, 2008, 09:53:30 PM »
I seemed to have missed this post  
Quote from: Numsgil
When I first started the simulation, I still get an empty sim.  This might not be an issue with the installer but with the exe.  I'm not sure.
I don't include a saved .sim, just some .set files. I don't think the program supports automatically starting settings files.
Quote from: Numsgil
Hitting F1 and then start new started up a proper sim (this is what the program should do automatically in my mind).
I think it should prompt, in case your old .set happened to have some really long bots (*cough* Guardian *cough*) and you don't want it to take a really long time parsing the bots.
Quote from: Numsgil
The mutation rates could do with some tweaking (way too high at present).
I think there's a bug with loading the option "Disable All Mutations". Mutation rates are loaded though.
Quote from: Numsgil
I had some difficulty loading new settings (kept reverting to my old settings), but that might be an issue with the program and not the installer or the settings.  The uninstaller seemed to work just fine, so no issues there.
Loading the settings seems to work for me...

14
Darwinbots Program Source Code / NSIS-based installer
« on: June 10, 2008, 09:45:38 PM »
I was thinking of having a separate executable which would try to fetch a new version installed  as part of the package, although maybe re-running the installer might be better concerning code duplication. It is definitely possible to have the installer provide an option to update a current installation.

Actually, thinking about it, it might be even better to turn the uninstaller into one of those modify/remove things and provide an option to update. This way you wouldn't have to keep the original installer, just the installed package. Seems pretty counter-intuitive though.

15
Darwinbots Program Source Code / NSIS-based installer
« on: June 10, 2008, 09:32:08 PM »
Hint: its website is http://nsis.sourceforge.net/  Yup, it's free software.

Speaking of "free as in freedom" software, here's the NSIS source:
Code: [Select]
!include MUI2.nsh
!include VB6RunTime.nsh

Name "Darwinbots 2.4"
OutFile "Darwin_setup.exe"
InstallDir "$PROGRAMFILES\DarwinbotsII"
InstallDirRegKey HKLM "Software\Darwinbots" "InstallDir"
RequestExecutionLevel admin
BrandingText " "
XPStyle on
CRCCheck on
SilentInstall normal
SetCompressor /SOLID lzma

Var AlreadyInstalled

!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Darwinbots"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "ShortcutDir"

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
Var StartMenuFolder
!insertmacro MUI_PAGE_STARTMENU "DarwinbotsII" $StartMenuFolder
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

!insertmacro MUI_LANGUAGE "English"

Section "Install" Install
  SetShellVarContext current
  SetOutPath "$INSTDIR"

  File "/home/goffrie/Darwinbots/DarwinBotsII/Darwin2.43.1l.exe"
  File "/home/goffrie/Darwinbots/DarwinBotsII/How to setup a DarwinBots server.txt"
  SetOverwrite off
  File "/home/goffrie/Darwinbots/DarwinBotsII/intsett.ini"
  File /r "/home/goffrie/Darwinbots/DarwinBotsII/Robots"
  File /r "/home/goffrie/Darwinbots/DarwinBotsII/Settings"
  SetOutPath "$INSTDIR\Autosave"
  SetOutPath "$INSTDIR\Saves"
  SetOutPath "$INSTDIR\Transfers"
  SetOutPath "$INSTDIR\Transfers\F1"
  SetOutPath "$INSTDIR\Transfers\F1\in"
  SetOutPath "$INSTDIR\Transfers\F1\out"

  SetOutPath "$SYSDIR"

  File "/home/goffrie/Darwinbots/OCX/*.OCX"
  RegDLL "$SYSDIR\COMCT232.OCX"
  RegDLL "$SYSDIR\COMDLG32.OCX"
  RegDLL "$SYSDIR\MSCOMCTL.OCX"
  RegDLL "$SYSDIR\MSINET.OCX"
  RegDLL "$SYSDIR\RICHTX32.OCX"
  RegDLL "$SYSDIR\TABCTL32.OCX"
  File "msstdfmt.dll"
  RegDLL "$SYSDIR\msstdfmt.dll"
  SetOverwrite on

;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.exe"

;Create Start Menu shortcuts
  !insertmacro MUI_STARTMENU_WRITE_BEGIN "DarwinbotsII"
  CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
  CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Darwinbots.lnk" "$INSTDIR\Darwin2.43.1l.exe"
  CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Darwinbots folder.lnk" "$INSTDIR"
  CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
  !insertmacro MUI_STARTMENU_WRITE_END

  CreateShortCut "$DESKTOP\Darwinbots.lnk" "$INSTDIR\Darwin2.43.1l.exe"

;Store installation folder
  WriteRegStr HKLM "Software\Darwinbots" "InstallDir" $INSTDIR

  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarwinbotsII" "DisplayName" "Darwinbots II"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarwinbotsII" "UninstallString" "$INSTDIR\Uninstall.exe"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarwinbotsII" "InstallLocation" "$INSTDIR"
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarwinbotsII" "NoModify" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarwinbotsII" "NoRepair" 1

;Install VB runtime
  IfFileExists "$INSTDIR\Darwin.exe" 0 new_installation
    StrCpy $AlreadyInstalled 1
  new_installation:

  !insertmacro VB6RunTimeInstall /home/goffrie/Darwinbots/vb6 $AlreadyInstalled
SectionEnd

Section "Uninstall"
  SetShellVarContext current

  Delete "$INSTDIR\Darwin2.43.1l.exe"
  Delete "$INSTDIR\How to setup a DarwinBots server.txt"
  Delete "$INSTDIR\intsett.ini"
  Delete "$INSTDIR\Uninstall.exe"
  Delete "$INSTDIR\Robots\Alga_Minimalis.txt"
  Delete "$INSTDIR\Robots\Animal_Minimalis.txt"
  Delete "$INSTDIR\Robots\Dominator_Invicibalis.txt"
  Delete "$INSTDIR\Robots\Excalibur.txt"
  Delete "$INSTDIR\Robots\Republican_Bee.txt"
  Delete "$INSTDIR\Robots\Seasnake_1.0.txt"
  Delete "$INSTDIR\Settings\default.set"
  Delete "$INSTDIR\Settings\lastexit.set"
  Delete "$INSTDIR\Settings\AnimalMinimalis-mutation.set"
  Delete "$INSTDIR\Settings\Dominator.set"
  Delete "$INSTDIR\Settings\DominatorVsSeasnake.set"
  Delete "$INSTDIR\Settings\RepublicanBee.set"
  Delete "$INSTDIR\Settings\RepublicanBeeVsDominator.set"
  Delete "$INSTDIR\Settings\Seasnake.set"
  Delete "$INSTDIR\Settings\SeasnakeVsRepublicanBee.set"

  IfErrors 0 +2
    MessageBox MB_OK "Could not delete some files. Ensure that they are not in use and delete them manually."
  ClearErrors

  RMDir "$INSTDIR\Autosave"
  RMDir "$INSTDIR\Robots"
  RMDir "$INSTDIR\Saves"
  RMDir "$INSTDIR\Settings"
  RMDir "$INSTDIR\Transfers\F1\in"
  RMDir "$INSTDIR\Transfers\F1\out"
  RMDir "$INSTDIR\Transfers\F1"
  RMDir "$INSTDIR\Transfers"
  RMDir "$INSTDIR"

  IfErrors 0 okay
    MessageBox MB_YESNO "One or more folders were not deleted because they contain extra files, such as custom settings, save files or robots. Delete them?" IDNO okay
    ClearErrors
    MessageBox MB_YESNO "Are you sure you want to perform this operation? This will delete ALL files in $INSTDIR." IDNO okay
    RMDir /r "$INSTDIR"
    IfErrors 0 okay
      MessageBox MB_YESNO "Deleting all files recursively failed. Do you want to delete them on the next reboot?" IDNO okay
      RMDIR /r /REBOOTOK "$INSTDIR"
  okay:

  !insertmacro MUI_STARTMENU_GETFOLDER "DarwinbotsII" $StartMenuFolder
  Delete "$SMPROGRAMS\$StartMenuFolder\Darwinbots.lnk"
  Delete "$SMPROGRAMS\$StartMenuFolder\Darwinbots folder.lnk"
  Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
  RMDir "$SMPROGRAMS\$StartMenuFolder"

  Delete "$DESKTOP\Darwinbots.lnk"

  DeleteRegKey /ifempty HKLM "Software\Darwinbots"

  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarwinbotsII"

;Remove VB runtime
  !insertmacro VB6RunTimeUnInstall
SectionEnd

Pages: [1] 2 3 ... 5