General > Off Topic

wxBots

(1/3) > >>

goffrie:
(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]

ikke:
2 questions
1) why?? (personal curiosity of mine, there are no wrong answers)
2) compiles with??

goffrie:
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.

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?

goffrie:

--- 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?
--- End quote ---

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.

Navigation

[0] Message Index

[#] Next page

Go to full version