Author Topic: Modifying the code  (Read 5769 times)

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Modifying the code
« on: September 05, 2006, 04:05:01 PM »
I'm thinking of doing some tinkering with the program of my own  

I took the source code of Endy's v2.37.7 and modified the 'shots.bas' using a standard text editor, to comment out the code granting conspecs' immunity to other conspecs' poison. So how do I now wrap that up into a neat executable program?

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Modifying the code
« Reply #1 on: September 06, 2006, 10:22:50 AM »
try this

Visual Basic 6.0

It's the only way to make an executable from the source code. You can also edit the code here and even run it directly from source without compiling it first.  
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Modifying the code
« Reply #2 on: September 06, 2006, 11:17:53 AM »
Ok, I've downloaded it, but I can't seem to get it to work      

EDIT: OK, it's working now
« Last Edit: September 06, 2006, 11:19:56 AM by Elite »

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Modifying the code
« Reply #3 on: September 06, 2006, 02:06:22 PM »
Post the code up here. I'm working on other VB applications right now so it is a little inconvenient for me to go looking for it.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Elite

  • Bot Overlord
  • ****
  • Posts: 532
    • View Profile
Modifying the code
« Reply #4 on: September 06, 2006, 02:14:15 PM »
I've got it to work and managed to figure out how to make it do what I wanted  

Attached is Darwinbots2.37.7c

Changes:
 - Poison affects conspecs
 - When .ploc is set to zero, poison has no effect

My only problem is that when exiting the program it says "Darwinbots has encountered a problem and needs to close", which might be to do with VB itself

And my aim in doing all this was to get this bot to work:

cond
*.robage 0 =
start
.ploc .ploc store
.ploc .memloc store
stop

cond
*.poison 20 <
*.pain 30 >
start
10 .strpoison store
stop

cond
*.eye5 0 >
*.memval .ploc !=
start
*.refveldx .dx store
*.refvelup 30 add .up store
stop

cond
*.eye5 40 >
*.memval .ploc !=
start
-1 .shoot store
*.refvelup .up store
stop

cond
*.eye5 0 =
*.memval .ploc = or
start
314 rnd .aimdx store
stop

cond
*.nrg 6000 >
start
50 .repro store
stop

end

It will attack conspecs that have gone canni, making the practice no longer profitable. I'm really proud of this one  Haven't thought of a name yet though
« Last Edit: September 06, 2006, 02:24:57 PM by Elite »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Modifying the code
« Reply #5 on: September 06, 2006, 04:50:19 PM »
I believe that "illegal operation" thing has come up before.  Not sure exactly what causes it.

You can also get a C++ compielr from the wiki and use it to compile the C++ source.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Modifying the code
« Reply #6 on: September 07, 2006, 08:48:26 AM »
VB does weird shit now and then with apparently no good reason.  
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline frankle

  • Bot Neophyte
  • *
  • Posts: 21
    • View Profile
Modifying the code
« Reply #7 on: December 18, 2006, 07:30:51 PM »
thats because VB is really an acronym for "Very Buggy"

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Modifying the code
« Reply #8 on: December 18, 2006, 09:35:28 PM »
Soon to be transferred to C+  or C++ or C+++ whatever you programmer peeps call it!

/me looks at Nums' to see if he has had time/inclination to make further progress on his epic work.
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Modifying the code
« Reply #9 on: December 18, 2006, 10:22:34 PM »
At the moment I'm toying with the idea of moving it into C#.  Most of the C++ code would copy and paste over, especially the more algorithm-y code.  This would also reduce the number of dependancies, and allow native access to the form designers, which make GUI maintenance easier and give access to the .NET internet controls, which is important for future networking.

The C++ code at the moment is 90% complete.  It just needs tie physics to be figured out (there's a reason this is the last.  I have no idea how to do it!).  And the GUI (options form mainly) needs to be finished.  You can check out alot of the details here.

The code is also a little messy (though orders of magnitude cleaner than the VB code) and could do with a massive refactoring.

If people are interested I can build a trial version download that people could just run to see what things are going on in the C++ source.  Most interesting, the physics are much better.  Bots never overlap at all, they're treated as 100% rigid for collisions.  Bots also bounce off of walls instead of just sort of "plop".
« Last Edit: December 18, 2006, 10:23:35 PM by Numsgil »

Offline frankle

  • Bot Neophyte
  • *
  • Posts: 21
    • View Profile
Modifying the code
« Reply #10 on: December 18, 2006, 10:48:00 PM »
Quote from: Numsgil
If people are interested I can build a trial version download that people could just run to see what things are going on in the C++ source.  Most interesting, the physics are much better.  Bots never overlap at all, they're treated as 100% rigid for collisions.  Bots also bounce off of walls instead of just sort of "plop".

I'm definitely interested, I'd like to see it.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Modifying the code
« Reply #11 on: December 18, 2006, 10:51:51 PM »
Okay, I'll get on it   I'll try to upload something later today/tomorrow.

Offline Jez

  • Bot Overlord
  • ****
  • Posts: 788
    • View Profile
Modifying the code
« Reply #12 on: December 18, 2006, 11:39:03 PM »
Also interested.  
If you try and take a cat apart to see how it works, the first thing you have in your hands is a non-working cat.
Douglas Adams