Author Topic: Source Documentation  (Read 3577 times)

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Source Documentation
« on: November 23, 2008, 11:54:07 AM »
I wanted to make a mod for DB, but I'm having a very hard time finding my way through the source.
I didn't want to use 2.44 since it crashes all the time, so the latest version I could find was 2.43.1h (Although I would have prefered 2.43.1L)

But I can't find any documentation on the wiki... I can find a list of existing features or features to come, but nothing about the actual source and it's structure...

I know there's some comments in the code, but not enough for me to figure this out.
I think my main issue is figuring out "where it starts and where it ends", meaning how everything is structured, where does what happen and in what order.
Like a simple class diagram, or even a short reame would do wonders for my part. I'm not used to VB but from what I can tell there's classes and modules, and all the modules can access everything in all classes without having to specify it anywhere... this makes it very hard to figure out the structure.

So if there's any documentation anywhere, or maybe a topic where some of these things have been discussed or a diagram showing the structure, or maybe a small readme or walkthrough for getting started with the code... maybe explanation on some of the abreviations... anything that would help me get started... then I'd love if someone could post a link.

So far I think I've guessed that rob stands for robot and robn for robot number... but I'm realy having doubt about this because it seems unlikely that anyone would abreviate a 5 letter word, and the abreviation for number is usualy "nr" or "no"...
Anyway asuming rob is an array of robots then I still find myself wondering about this linked list I found.
The node used is called node and contains a lot of abreviations that I can't figure out :

Public robn As Integer ' Robot number I think.
Public xpos As Single   ' X position... but not sure in what context
Public pp As node        ' Pointer pointer ???  (Edit: Pointer Previous ! right ?...)
Public pn As node        ' Pointer number ??? (Edit: Pointer Next maybe !)
Public orp As node       ' ???????
Public orn As node       ' ???????
Public pout As node      ' Pointer out ???

I'm not trying to insult anyone with this... I just find it very confusing and I can't figure out what this node contains and what it's for.
Also it seems like it's used inside the list class... but then how come rob() is used to access robots ?

Basicaly I'm very confused... and any help would realy be apretiated... I figrue there might be a topic where other people asked similar questions when getting aquainted with the source, or maybe some documentations somewhere that I overlooked. Any links to anything that might help are very welcome.
And I am a VB noob, so maybe I'm just not understanding how VB works... but even so, any documentation would realy help.
« Last Edit: November 23, 2008, 11:56:42 AM by Moonfisher »

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Source Documentation
« Reply #1 on: November 23, 2008, 12:32:43 PM »
Almost forgot my last question.
How far along is the C# code by now ? As I understand the C++ port is being moved into C# and the C++ port was 90% done last I saw it mentioned...
So does this mean the C# code is clode to completion ? If so I may be able to understand whats going on a litle better by looking at a more familiar laguage.

Still would be nice with any links to existing documentation... or any hints on getting started.

My plan is to let the code evolve by building neural network sructures... so any valid input sysvar would be a potential input node, and any location wich isn't an input would be a potential output node. Then randomly add dendrits (weughted connections) between inputs and outputs. Any used output would then also become a potential input. And a dendrit could be formed from an input to the midle of another dendrit creating a hidden node... asf asf...
And I have some more ideas on where to go from there, but for starters I just need to figure out how to take a blank bot and start generating code in it like the random mutations do, just with neural network structures. And I'm basicaly having a hard time figuring out which is what when looking at the code...

Essentialy all I realy need to know is where all the code for all the different bots is located and how it's structured.
Is the node used in the list class a robot ? And where do I find the actual code for this robot ?

OR should I completely disregard list and node and instead look at the Robot module, where it looks like theres a robot structure conatining a DNA array... ?

Basicaly if there's no documentations, then if someone could just point me in the right direction I'd realy apretiate it  

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Source Documentation
« Reply #2 on: November 23, 2008, 04:20:48 PM »
C# version isn't close to being done.  Still have to write lots of the major subsystems.

Ignore the node stuff, I think it's leftover from long ago.  The VB code isn't OO at all.  It's all procedural, just a long list of functions that get called.  Somewhere (can't remember where) there's a function that represents the main game loop.  That would be a fine place to start.

If you're just looking to use a neural net instead of the DNA, you should be able to do it as long as you're still using the 1000 int memory array.  Look in the DNA.bas file for the basic functions that DNA uses to execute itself.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Source Documentation
« Reply #3 on: November 24, 2008, 03:12:36 PM »
I was actualy just thinking of writing neural nets with the current sysvars and such... but now that you mention it, it might be easyer to scrap the regular DNA alltogether...

Either way, thank you, this is realy going to help me get started. Going to go look for that main game loop and examine the DNA.bas, and focus on te robot array... that linked list realy had me wondering what was what

I probably won't have time to look at it till in a few day though... but I WILL find time to build this mod, I'm not patient enough, I need accelerated evolution !!!