Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / AI Library

Author
Message
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 24th Jul 2004 04:47 Edited at: 24th Jul 2004 04:52
AIBAS is a library I'm working on, based on a DBP plugin named Tychon I was making long ago.
This library is for creating games where the player can program his own AI, but it's not limited to this only.
It has a BASIC-like syntax, and it's a C++ library, so other languages can use it too. Programs can be executed symutaniously, at different speeds.

A prototype was completed, and a very successfull test was made:
A terrain was loaded, and 20 EVA-units placed on it. Each one was programmed to search for the nearest other unit, get closer to it, and shoot it. This test was programmed in C++ with Irrlicht. In OpenGL mode, it ran at around 100-150 fps. When rendering in NULL mode (doesn't render anything) the framerate was around 1500 fps, though I couldn't tell what was going on for obvious reasons.

I'm planning to make a DBP wrapper, as this is meant to be used for C++ (that's why I didn't post this in the WIP forum). But before I do so, I'd like to know if anybody will actually USE it. I can't use DBP anymore so if I make it into a plugin, I won't be using it.

This should be finished before the end of this month, if all goes well. I have a few optimizations to make and I'm rewriting the bytecode generator so it can be faster. Arrays, pointers, and some other things are being added.

I'd like to know what you'd like to see in this plugin, so suggestions are welcome.

(no, TCA, it won't be multi-threaded. Threads are platform-dependent and I don't see much of a point to it. )

GothOtaku
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location: Amherst, MA, USA
Posted: 24th Jul 2004 07:01
Hmm... possibly depends on how you implement it and what kind of AI routines it provides.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Jul 2004 08:02
Sounds very cool. I had a similar idea last week.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 24th Jul 2004 08:13
Quote: "no, TCA, it won't be multi-threaded."

Dont think I mentioned it.


I came, I saw and I forgot all about it... or something...
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 24th Jul 2004 09:28
I would be willing to make it DBCe Compatible

"Could you do something where you don't need a video card cause i don't have one" - Program Expert
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Jul 2004 17:50
Quote: "I would be willing to make it DBCe Compatible"


But if it was a TPC...

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 24th Jul 2004 22:43
Quote: "Dont think I mentioned it."


Remember the post I made in the WIP boards (Tychon Script)?
Yes, you did mention it.

This is a total re-write of Tychon. I didn't like how that one was turning out...

I was thinking about adding a neural network class to this. You create a layer with a certain amount of neurons, then you can program each neuron. Adding more layers would be possible. Though, I'm not sure on how to implement this.

Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 25th Jul 2004 00:10
There is a difference between DBCe and DBP dlls, mainly in the string tables

"Could you do something where you don't need a video card cause i don't have one" - Program Expert
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 25th Jul 2004 00:44
Quote: "Remember the post I made in the WIP boards (Tychon Script)?"

Ah yes - I remember.


I came, I saw and I forgot all about it... or something...
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 25th Jul 2004 00:54
Quote: "There is a difference between DBCe and DBP dlls, mainly in the string tables"


I meant, that if its a TPC there's not much you can do to get it working without compiling the dll differently or creating a wrapper.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 25th Jul 2004 05:23
It depends if you use glob struct or not - if you do, then you would have to call the constructor and receivecoreptr before calling any DLL's


I came, I saw and I forgot all about it... or something...
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 25th Jul 2004 10:46
I meant I'd be willing to take the C++ source and change it to make it DBCe compatible

"Could you do something where you don't need a video card cause i don't have one" - Program Expert
eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 25th Jul 2004 19:40
How very, um, noble of you (theif)


Checkpoint Router: my very own AI routing program: http://eatmuchpie.dbspot.com
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 25th Jul 2004 19:44
Quote: "(no, TCA, it won't be multi-threaded. Threads are platform-dependent and I don't see much of a point to it. )"


DBP is platform-dependant and threads are super-easy to do, make it multi-threaded!


"Computers are useless they can only give you answers."
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 25th Jul 2004 21:28 Edited at: 25th Jul 2004 21:36
Exeat: Well, this plugin isn't supposed to be for DBP only. I'll be using this with Irrlicht, in games that run in Windows or Linux. Besides, I don't see much use in making it multi-threaded. There would be problems syncronizing with the screen. Movement would not be very smooth. Also there's the fact that the only experience I have with threads is the fork() command, no where to be found in windows.

Is it possible to put a LIB in a DLL? Never tried that...

I might (not a promise ) have a preview version out by monday night. Though, it will be for C++ users. I want to get everything working well in C++ before I make a DBP plugin out of it.

The reason I haven't released anything yet is because I'm converting from my old way of doing things (C-style dynamic arrays) to using linked lists for tokens. This makes compilation and execution faster. I'll also have to re-do some things in the VM. Normally interpretors have a big switch() to decide what to do, but I'm going to use my own method (probably much faster, haven't tested it much) that makes these decisions on compile-time.

Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 26th Jul 2004 02:09
How would I be a thief? It would save him time and it's not like I'm gonna try to take all the credit

"Could you do something where you don't need a video card cause i don't have one" - Program Expert
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 26th Jul 2004 02:20
Mattman: If this works out ok, I'll send it to you. But first...must ... close...browser window!... Must... get back... to... coding!

I'll be testing this library on a remake of Kunio Kun's Super Dodgeball. Simple AI.

Does anybody know alot about NNs? I've read about them, but I can only make the basic networks. Back-propagation is confusing.

TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 26th Jul 2004 04:52
Ok, time to make a little poll:
1) Option Explicit on by default, no way to turn it off.
2) Hungarianish: Variables don't need to be declared, but a prefix is required.
3) No variables! Just pointers! I love pointers!

Example of #2:
if Ix<Iy then dostuff
Where I is for an integer, F for float, P for all-purpose pointer.

Example of #3:
ptr x=0, y=new I
Iy=Ix
This in C would look like:
void *x=0;
*((int *) y) = *((int *) x);

Now, I like #3 the most, but I feel it's going to be a bit hard for some people.

TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 26th Jul 2004 13:01
Ok, nobody participated in the poll, and as I'm trying to get this done by tomorrow I decided to just make the variables like basic's. No variable declarations. The compiler is almost done. Tomorrow I'll have to redo some stuff for the VM and I just might get a preview out by night time. The preview will most likely be something simple like a swarm of flies.
Current stuff:
if...then...else... endif
label:....goto label
sync (pauses AI and returns to game untill the next call)
Integer, float, pointer, string variables. Need any more, just say so. Adding variable types is easy for now.
equation solving: x=1+(2/y)*3

My mom's computer (the one I'm typing this on) had a harddrive crash today, so I might have to spend a few hours tomorrow installing a new HD, windows, getting her backups, etc. If I end up fixing it, the preview will have to be moved till tuesday.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 26th Jul 2004 19:45
Sounds very nice. I might consider using this for the next Mercenaries, would make AI a helluva lot eaier.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
GothOtaku
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location: Amherst, MA, USA
Posted: 26th Jul 2004 22:38
What kind of things will your AI library offer?
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 26th Jul 2004 23:07
GothOtaku: Mostly the ability to program the AI externally. Also it allows you to make self-modifying programs. I'm going to make a "load program" command that will load the source code and compile it into bytecode for faster execution. I'll add a "save program" command for exporting the bytecode so it won't be necessary to keep compiling again and again. I was thinking about making a neural network class, but nobody seemed interested...

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 26th Jul 2004 23:56
How will interface with your objects?

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 27th Jul 2004 00:10
I'd be interested in Neural Networks stuff

"Could you do something where you don't need a video card cause i don't have one" - Program Expert
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 27th Jul 2004 00:49
Quote: " How will interface with your objects?"

Yeah, I'm working on that. The programs will have a "move" command, but this will not move the actual object you see in DBP. It will only set a few variables (pos.x, pos.y, pos.z). When the sync command is called, the AI's execution stops, and "position object" will be called from inside the plugin. Though, I don't remember how to call DBP function from inside a DLL. I'm looking for that thread where it was explained but I can't find it.

And about the NNs, I'm going to leave that for version 2 maybe. I still haven't found someone who can explain some of the stuff to me.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Jul 2004 00:50
Program Announcements, IanM's interface

Then call the PositionObject function.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 27th Jul 2004 07:25
Thanks, David. I won't be able to get a demo out today, sadly. I had to help fix my mom's PC and a bunch of complications showed up. Hopefully tomorrow I'll finish it.

Since AI tends to be very specific, it will be impossible to make something that fills every need. So, I added a "call" command that calls a function defined by the programmer and passes as many parameters are necessary. Sadly, this only works in C++, as there is no way of getting a DBP-function's address (as far as I know).
Example:

call 1, "Hello World"

in c++:
CallHandler(link *cmd){
if(*((int *)cmd->val())==1){
cmd=cmd->next->next;
printf("%s", (char *) cmd->val());
}
}

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Jul 2004 07:39
I was thinking about something like this last week, as I've probably said.

This is how I envisioned it:



Something simple, just basic state handling.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 27th Jul 2004 07:43 Edited at: 27th Jul 2004 07:51
Hmm... it looks like I need the DX SDK to use IanM's interface. Ouch. I don't have space for that, and downloading it is going to take a long while. Anybody volunteers to give me a hand?

Though, I feel IanM's interface is a bit of an overkill. All I want to do is call "position object"! Is there any other way? If not, I suggest volunteers add me to their contact list in MSN. felipemanga@hotmail.com

An alternative would be to simply return the position/angle and leave the positioning and rotations up to you. I guess this would be better for the DBCe version too.

[edit] David, your version is aparently oriented towards FPSs. Mine was meant to have a more general purpose. Like the script in Game Studio.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Jul 2004 07:49
It isn't really, just a header file to include

I used it just so I could get ObjectPositionX/Y/Z.

Currently I'm using to create object behind object / point behind object commands.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 27th Jul 2004 08:52
Well, overkill or not, I'll need the DX sdk, right? Anybody wanna lend me a hand?

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Jul 2004 22:09
Download the DX SDk

That's the only way

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 27th Jul 2004 22:45
Right now, all programming is being done on a 486 notebook running windows 95. It has no way of connecting to the internet, so I'd have to pass the SDK using floppies.
The use of my normal PC has been restricted by my parents so my little brother could get a chance to use it.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 27th Jul 2004 23:11
Quote: "so I'd have to pass the SDK using floppies."


Ouch. I have a feeling it weighs in at around 100mb

I was wondering, are you actually writing the language all yourself? If so - wow. Kudos.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 27th Jul 2004 23:41
Go out to your library and get windows programming for dummies, it has the DX SDK on a cd

"Could you do something where you don't need a video card cause i don't have one" - Program Expert
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 27th Jul 2004 23:51
Yep, I'm writing the whole thing. Isn't the SDK around 200mb?

I want to make the plugin open source, but I'm worried someone could download it and say they made it. Would I have any way to prove I wrote it?

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Jul 2004 00:31
Quote: "I want to make the plugin open source, but I'm worried someone could download it and say they made it."


lol, open source means that you can modify it and redistribute it Have a look at some of the GPL licenses, see if any of them are good enough.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 28th Jul 2004 00:41
"open source means that you can modify it and redistribute it"
That I'm ok with. The problem is if someone says they did it, got a copyright and then said that I couldn't use it anymore.

the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 28th Jul 2004 00:55
Quote: "The problem is if someone says they did it, got a copyright and then said that I couldn't use it anymore."


In the highly unlikley event of that happening just tell them to piss off.

can i scream
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 28th Jul 2004 01:32
hmm... ok!

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Jul 2004 01:36
Make a very small but vital part of the code a compiled DLL which somehow identifies that you made it (perhaps a messagebox popping up giving credits).

So if anybody does distribute your software and claims it to be theirs, you can expose them And they can't get rid of it, because it's some vital part of the code that's compiled along with it too.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 28th Jul 2004 01:49
Originally, I wanted to make the VM in a static library. But till now I don't know if I can put a static library in a Dll.

GothOtaku
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location: Amherst, MA, USA
Posted: 28th Jul 2004 02:00
Quote: "
I want to make the plugin open source, but I'm worried someone could download it and say they made it. Would I have any way to prove I wrote it?"

Write really obfuscated code (just use unique variable names that are hard to interpret thier meaning from) and comment everything saying you wrote it. It also helps if you have your own style of coding.
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 28th Jul 2004 02:31
Making a post in the program announcments section of the forum is about as much as you can do. It's also pretty effective, people here have a low tolerence for people who steal code.
There isn't much else you can do except complain to the person who steals it and whoever is hosting the files.

can i scream
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 28th Jul 2004 04:04 Edited at: 28th Jul 2004 04:17
As I'm currently in vacations, I managed to get a good amount of code done in a short time. But this week things have slowed down due to my parents wanting me to get a job. I won't be able to get the demo out today as hoped. I feel really bad to keep missing my own deadlines like this, so I decided to free some of the sourcecode so people can see I'm not talking about thin air. Check the source thingy below to see the parser I made.
The code is not obfuscated, but my habit of using weird variable names and no comments should make up for it. Any suggestions, optimizations, etc. are welcome.

[edit] Aparently some of the code got messed up by the browser. Can someone tell me if it looks ok? I'm using Opera and it could be causing the problem...

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Jul 2004 06:01
Yes, it's gone all strickthroughey. Might be because the sourse code box doesn't omit HTML.

See attached source

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 28th Jul 2004 07:20 Edited at: 28th Jul 2004 07:25
How's that?
[edit] Well, now there isn't any line through the middle, but some of the functions have been cut up. I'll just leave it as it is...

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Jul 2004 07:21 Edited at: 28th Jul 2004 07:23
Dunno. My best guess. Maybe your code had the html code for strikethru in it?

The dodgy thig is somewhere here:

for(i=0; i<s && i<size; ans[i]=data[i], i++);
ans[s+1]=HH;
size=s;
free(data);
return (void *)((char *)(data=ans)+1);
}

void link:elete(){
if(prev) prev->next=next;
if(next) next->
prev=prev;
delete this;

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 11th Sep 2004 12:50
*Raises a metal rod and waits for lightning to strike and revive this thread...

Just wanted to show some progress:

Declaring variables (a=dword=1) is optional.
This is currently running perfectly. Now I just need to add the following:
Arrays, strings
built-in functions (sin/cos/distance/etc.)
anybody have any suggestions for them?

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 11th Sep 2004 17:31
It'd be great if we can have handy expandable arrays, like PHP:

arrayname[]="First item"
arrayname[]="Second item"

That we we an build up lists of AI tasks to do etc.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"

Login to post a reply

Server time is: 2024-11-26 02:34:33
Your offset time is: 2024-11-26 02:34:33