BAIT Community Project (thread 2)

Community Forums/Showcase/BAIT Community Project (thread 2)

WolRon(Posted 2005) [#1]

Welcome,

BAIT (Blitz Artificial Intelligence Tournament), is a Blitz3D open source game for the Blitz Community. Anyone can participate. The conversation has moved to a new thread. Click on this link: BAIT Community Project (thread 3) to see what's currently being talked about and to see what else the BAIT Community project has to offer.


To familiarize yourself with what BAIT is, check out the Game Overview/Gameplay Rules page.

HOW TO GET INVOLVED
Code/Media Conventions And Guidelines 8 Apr 05 by WolRon

LINKS
BAIT Official Thread 3 by Various authors
BAIT Official Thread 2 (this thread) 25 May 05 by Various authors
BAIT Official Thread 1 15 Apr 05 by Various authors
BAIT original discussions 5 Apr 05 by Various authors



Rob Farley(Posted 2005) [#2]
Just an observation... You've got runtime errors in your functions, may I suggest that these are not ideal as it will bomb a game out if someone gets their AI script wrong. Maybe you should return strings from the functions instead of true/false, that way you can return "True" or "Error: Weapon n out of range" that way if one person has a bad script the game won't crash.

Also, maybe an additional function would be debuglog that allows you to write strings to a file, so you can write the returns from functions to a file and see where your script is going wrong.


Ryan Moody(Posted 2005) [#3]
Hi guys,

I'm starting not to believe you

Hehe, I agree it does look suspicious! I keep saying I have to go because of my exams but I'm addicted to the forums! However, I must definitely go for a while now, but I assure you, I'll be back in about 4-5 weeks once my exams are over, and I'll be fully available to help out.

I'm going to say something about BAIT in the General Discussion forum now you've got this thread up and running, so hopefully you'll get more helpers. You're all doing a great job so far, keep it going and surprise me when I come back!

Ryan


WolRon(Posted 2005) [#4]
You've got runtime errors in your functions, may I suggest that these are not ideal as it will bomb a game out if someone gets their AI script wrong.
Right. the RunTimeError's were more of a temporary thing (since I was trying to get just a bare-bones game working in order to test out using BVM).

The problem that arises without the RunTimeError's is that the game will crash with a MAV or something similar if it is allowed to continue without the required files being loaded.

This, of course, can be handled. The question is; How? We hadn't discussed that yet.

So, since you brought it up, how should we handle the situation if someones, say, AI script or bot model is missing?
Should the entire program end?
Should it continue on without the bot that the error occured on?
Say that only the players bot model was missing. Should the program automatically substitute a generic bot?
What if the program can't find it's own supporting files? I think it would have no choice but to end then.

Let me hear your opinions...


Koriolis(Posted 2005) [#5]
WolRon, if you want I can help you setting up BVM. I have *very* little time but nonetheless I can certainly make you save some time.


WolRon(Posted 2005) [#6]
OK. I'll let you know when I need help...


WolRon(Posted 2005) [#7]
Well, I've done some more work on the engine code. Namely, adding the general.bb and gamestate.bb files.

The addition of the gamestate functions now gives the game an introduction and a (need yet to be programmed) ending stats table.

I also modeled a (very sad) generic bot for testing purposes. The code now loads this generic bot if one is not present in the players 'bot' directory.

I have put together a .zip file so that you all can see what the last few weeks of work have produced so far. Currently, it just performs the loading functions, showcases the bots, and then starts the (uneventful) competition.


-------------------------------------
You may notice that some of the files are using TEXT commands. This works (for the time being), but it is crude for 3D graphics (not consistent on different resolutions) and can cause major performance issues on some video cards.

We need to come up with a system for displaying text/messages. I'll admit that I'm not totally familiar with some of the methodologies of displaying text within a 3D game (do they use aprites?; textured quads?; bitmap fonts drawn onto those entities?; ??). You'll notice that for the bots banners I used some sprites and TEXTed their names onto them, which works, but isn't pretty.

I'm open for suggestions on how to handle displaying text/messages within BAIT...(although this can probably be put on hold for a while, like after we get a running prototype going).


Hotcakes(Posted 2005) [#8]
modeled a (very sad) generic bot

How is this game being presented? I thought it was going to be top down 2d-in-3d?


WolRon(Posted 2005) [#9]
Download the zip and run it and see...

(It is a 2D overhead game, check the Game Overview.)


Hotcakes(Posted 2005) [#10]
I can't from work =] Anyways, I have a request then. Make the generic model just a rectangle that holds a texture on the top ;] So long as I only have to replace the texture with a dodgy top-down bot-representation-type-icon-thing, I'm happy. =]


Ryan Moody(Posted 2005) [#11]
Hi guys,

I was just passing by, and I noticed that a demo has already been made! That's brilliant! The only amendment I'ld make to the demo version is allowing the user to skip the intoduction, as I wanted to have a quick look at the arena layout; Which, I must say, looks pretty good. The only suggestion I'ld make is that to be able to use the full screen, you could have each player's data displayed as "power bars" above the bots. Also, instead of displaying the players' health as a number, this could be represented by how much smoke is coming from the bots, once again in order to save space.

Keep it up everyone!

Ryan


WolRon(Posted 2005) [#12]
Anyways, I have a request then. Make the generic model just a rectangle that holds a texture on the top ;] So long as I only have to replace the texture with a dodgy top-down bot-representation-type-icon-thing, I'm happy. =]
You can do this already! There's no restriction preventing you from supplying a cube...

The only amendment I'ld make to the demo version is allowing the user to skip the intoduction
Yeah, my thoughts as well, just that currently, the main.bb file isn't set up to work that way. Will have to rewrite it.

The only suggestion I'ld make is that to be able to use the full screen, you could have each player's data displayed as "power bars" above the bots
I already tried this. It was too small to read and got in the way of the 'action'. Unless that's what everyone wants?
But that is why I made the engine supply a different colored bot for every player w/o a custom model. And those players with custom models can color/shape them however they like.

Also, instead of displaying the players' health as a number, this could be represented by how much smoke is coming from the bots, once again in order to save space.
Smoke could be good, but I think players would still like to see a numeric value. Also, there really isn't any 'space' to save. If you want the entire arena shown on-screen, then how can you make it any larger?


Ryan Moody(Posted 2005) [#13]
By saving space, I meant that using smoke could take up less space than using numbers (and would look better), but this can be decided later on.

Ryan


Hotcakes(Posted 2005) [#14]
You can do this already! There's no restriction preventing you from supplying a cube...

I have to make a cube first. You know how much skill as a modeller I have? ;]


9572AD(Posted 2005) [#15]
We need to come up with a system for displaying text/messages. I'll admit that I'm not totally familiar with some of the methodologies of displaying text within a 3D game (do they use aprites?; textured quads?; bitmap fonts drawn onto those entities?; ??). You'll notice that for the bots banners I used some sprites and TEXTed their names onto them, which works, but isn't pretty.


I have a system I've used in a couple of (unfinished) programs which is a function you pass a string and some parameters to and it builds a mesh for the string and textures the appropriate areas of a specifically laid out font texture to the mesh. (You can substitute any bitmap font, as long as its laid out the same in the texture)
It's currently set up to build the mesh to a size appropriate to a certain x,y grid at a particular point on the z-axis, but, if you don't mind a monospace font, I could likely re-jigger it to be useful to this project.
Then, its simply a matter of remembering the entity's handle and freeing it as necessary.

(currently, it also supports 'colorizing' the entity, so a white font is best to make use of this)


WolRon(Posted 2005) [#16]
9572AD, does your system (I'm not sure I understand it...) use a high amount of polygons? I would like to keep it low, if possible since there will be a lot of text on screen. You say it builds a mesh. Is the mesh just a quad?

Post a link to the code, and I will look at it.


Rob Farley(Posted 2005) [#17]
Usually each letter will be a quad. But the whole thing will be single surface.

Quite frankly you can push 10,000s of triangles around, it's the surface count that'll kill it. As long as your text routine is single surface I doubt you'll have a problem.


9572AD(Posted 2005) [#18]
As Rob said, each letter is a quad, but the word or phrase is one surface.

I'll give you a look tomorrow when I have time to set it up.


9572AD(Posted 2005) [#19]
Well, it's fairly basic and straightforward, so I'll just go ahead and post it here as I'm sure it'll require some editing to be fit into this project, or any other project if anyone else wants the code:



grid_X is the X coordinate on the grid
grid_Y is the Y coordinate on the grid (this version counts from bottom up, IIRC)
grid_used is how many letters worth of space you want the mesh to actually take up, if you don't want it to take up the same amount of gridspaces as letters
vert_factor scales the text mesh vertically proportional to the gridsize
parent is the entity to parent this entity to, if any
red, green, blue are the RGB values for the EntityColor
alphaPct is the value for the EntityAlpha, stated as an integer from 0-100 for no apparent reason :P

And here's an example of how the font texture must be laid out:


Oh, and it only makes a single line of text. I didn't set up anything to allow multiple lines in the same mesh, so each line of text, or each object label or HUD label, is its own mesh/surface and can be colored or otherwise manipulated independently.


WolRon(Posted 2005) [#20]
I notice that textTex is used only once in the function. You must have a seperate function that generates that (global) texture (or I don't understand how the code words...).


9572AD(Posted 2005) [#21]
Nah, It's just
Global textTex = LoadTexture("textTex.png", 5)

loaded elsewhere in the program, which, I suppose, makes it a sloppy function, but I like to keep all my external resources in the same area of the program. *shrug*


WolRon(Posted 2005) [#22]
9572AD; I like. :)


I assume that the bitmap font you supplied is not intended for use in this project. Am I correct? (I don't really like it anyways...)

We'll have to see if we can dig some font up...


Thanks for your generous contribution. This will work great.


Hotcakes(Posted 2005) [#23]
Finally had a chance to look at the demo. I like your generic bot WolRon =]


9572AD(Posted 2005) [#24]
The font pic is just to show that the function works with a texture laid out in a 16x8 grid with the characters arranged just so. Feel free to make any font you like conform to that standard, and it'll work just fine. :)

u/v coordinates are percentages, so you can make it any (power of 2) size you like, as well. That picture is shrunken from what I was actually using.


WolRon(Posted 2005) [#25]
I've been working on adding 9572AD's DrawText code to the project. I've made up a (temp?) bitmap font to be used for the text. It would be nice if someone could take the time to smoothen out the characters in the bitmap (I started on 0 and 7, for example). You can check it out above.

I've updated the code files above. I will probably try to update the .zip file within the next few days so that you all can check out how it works/looks in the game.

I've had some thoughts on few more things over the past few days. After adding the DrawText code, I've realized that we should put a limit on the number of bots that can compete in a competition. Partly due to the lack of space on screen for displaying bot data, but also just for performance reasons. Eight bots for now seems to be a good place to start.

Also, we need to come up with a way for each bot to start. For instance, if only two bots start, we could have them start on opposite sides of the arena, no problem. If four bots start, they could start on (equally spaced) 4 sides of the arena. However, what should we do if three bots start or five bots? We could equally space them, say in a circle, but that wouldn't necessarily start each one out in an equal and fair place once you consider that the arena is square, and that most arenas will have obstacles in them.
So, what are your thoughts on this? Do we create a seperate arena for each number of starting bots (each arena giving each bot an equally advantaged starting position)? Do we create our arenas to allow any combination of, say, two to eight starting bots?

Let me hear your thoughts...


WolRon(Posted 2005) [#26]
Well, I've updated the .zip file now. Check out how the new DrawText function works.

While you're doing that, read the post I made above this one and let me hear your thoughts on the topics I brought up.


Ryan Moody(Posted 2005) [#27]
I tried the new demo, but I got the "Unable to create 3D scene" error!

Regards bot placement, I'ld have 8 fixed 'bays' on the arena, and the robot / bay allocation should be made randomly, so that it doesn't matter where the obstacles or the bays are placed.

Ryan


WolRon(Posted 2005) [#28]
I tried the new demo, but I got the "Unable to create 3D scene" error!
Haven't heard of that one. Anyone else have problems?


WolRon(Posted 2005) [#29]
Doing a search for "Unable to create 3D scene", I found several matches, and they all appear to have to do with dx or video drivers. So it doesn't appear to be the BAIT demo that's the problem.

Sample: http://blitzbasic.com/Community/posts.php?topic=45254


Regards bot placement, I'ld have 8 fixed 'bays' on the arena, and the robot / bay allocation should be made randomly, so that it doesn't matter where the obstacles or the bays are placed.

Are you suggesting that all arenas are symmetrical in nature then?


Ryan Moody(Posted 2005) [#30]
Doing a search for "Unable to create 3D scene", I found several matches, and they all appear to have to do with dx or video drivers. So it doesn't appear to be the BAIT demo that's the problem


I agree, I do have a fairly old computer and I haven't been able to run some other 3D games the Blitz community has produced, but how was I able to run the last demo and not this new one? Could you maybe add some debugging code to the demo so that I can give you feedback as to when the error's occuring?

Are you suggesting that all arenas are symmetrical in nature then?


I suppose symmetry would be the fairest and nicest looking option, but I wouldn't mind completely random placements of objects and bots either.

Ryan


WolRon(Posted 2005) [#31]
I think it would be easier for you to compile the source code yourself so that you can diagnose the problem better. All the code/media is above.


Ryan Moody(Posted 2005) [#32]
I don't own Blitz3D though, I'm afraid!


Hotcakes(Posted 2005) [#33]
Perhaps you upped the resolution between compiles, WolRon?

I think as far as the championship ladder goes, all matches should be held in symmetrical arenas, which means it really is up to the bot's AI. But for casual matches, more casual arena layouts/random placement (based on seed #) would be good.


WolRon(Posted 2005) [#34]
Actually, I did. I changed it from 800x600 to 1024x768 in order to be able to better view the 3D text I added in. That might have done it. I suppose we could add a screen resolution chooser at startup, or an .ini file...

I think as far as the championship ladder goes, all matches should be held in symmetrical arenas, which means it really is up to the bot's AI. But for casual matches, more casual arena layouts/random placement (based on seed #) would be good.
Sounds good to me. How do we handle the arena issue then?

A seperate arena for each of 2 to 8 player scenarios (total 7 arenas)?

Or how about an arena for 2, 4, and 8 players, another arena for 3, and 6 players, another arena for 5, and one more for 7 (total 4 arenas)?

In the latter scenario (which I think is better), I suppose all arenas, in order to be entirely symmetrical, would have to be circular in shape. The only exception to that could be the 2, and 4 player arena, but if you add 8 to it, then it would have to be circular(or near circular).

In case no one is following me, I will attempt to draw up some ideas for arenas...



Ryan Moody(Posted 2005) [#35]
I changed it from 800x600 to 1024x768


Ah, that's likely to be the problem.

Or how about an arena for 2, 4, and 8 players, another arena for 3, and 6 players, another arena for 5, and one more for 7 (total 4 arenas)?


I think it would be better to find out how many players would enter the tournament first, then design the arenas accordingly.

circular in shape


I'm not keen on this I'm afraid! Half of the screen would end up being unused, checking whether a robot has hit the boundary or not would be harder to implement, and I feel that symmetry can still be reasonably obtained with a rectangular arena.

Ryan


WolRon(Posted 2005) [#36]
and I feel that symmetry can still be reasonably obtained with a rectangular arena.
I don't think so. Take a look at my (crude) examples. If you can think of a symmetrical rectangular shape, then draw it up (which I believe could only be done with 2 or 4 bots).

The reason I am talking about perfect symmetry is to give the competitors each an EQUAL challenge. If you place, say, 5 competitors in the octagonal arena I drew up above(the left one), the game would be unbalanced since some of the bots would start closer together than the others.


Ryan Moody(Posted 2005) [#37]
Well I suppose the ultimate compromise would be to have a rectangular arena and to place the bots within it so that they form a circle!

I feel we're worrying about minor details that can be focused on later. Let's get the engine sorted first.

Ryan


WolRon(Posted 2005) [#38]
Well I suppose the ultimate compromise would be to have a rectangular arena and to place the bots within it so that they form a circle!
Yeah, for the time being, let's just do that...


Hotcakes(Posted 2005) [#39]
That's the most obvious solution for an empty arena (obviously a jolly good place to start;)...

However ...

... looks pretty symmetrical to me =] Still, it looks like a circle anyway.


altitudems(Posted 2005) [#40]
.


WolRon(Posted 2005) [#41]
Well guys, I took the time anyways to implement an arena loading routine (at least the bot starting positions part of it) and now the bots are arranged into the arena according to the starting positions listed in the arenas.dat file. For now (and maybe it will stay that way), the starting positions listed in the arenas.dat file position the bots in symmetrical patterns like the ones drawn here:


I had to update (my) generic bot so that it faced the correct way (Z+) so that I could properly align it the center of the arena using a PointEntity command.

Lastly, I added code to the Start.bb file to check an .ini file named BAIT.ini for graphics resolution dimensions. If found in the .ini file, then those dimensions are used. This should correct problems that people like Ryan may experience.

Check out the latest WIP version up top.


Ryan Moody(Posted 2005) [#42]
Cheers WolRon, I'll check out the latest version in a bit.

Ryan


Ryan Moody(Posted 2005) [#43]
[edited]

After changing the .ini file to 800 x 600, it worked! And, on reflection, I think having a full screen arena isn't necessary.

Looking at the boundaries of the arena, it looks like the robots are on a superimposed platform with no walls. Should we keep it that way, so that robots can be pushed off the edge and out of the action (allowing for sumo rounds), or should we enclose the arena with walls?

Ryan


WolRon(Posted 2005) [#44]
so that robots can be pushed off the edge and out of the action (allowing for sumo rounds),
Wow, interesting idea! Actually, the arena is concave, but because of the viewing angle, it does appear to be convex, doesn't it?

I like the idea that the bots can fall off (instant loss for that round). Maybe some arenas could feature this and others are enclosed...


Ryan Moody(Posted 2005) [#45]
I'm liking the screenshots WolRon!

Ryan


Ryan Moody(Posted 2005) [#46]
Hi WolRon,

It's been a while since the last post, have you made progress on the project? The good news is that in just over a week's time, I'll be much more available to help out with the coding and I'll try to gather / make some media for the project.

Ryan


WolRon(Posted 2005) [#47]
It's been a while since the last post, have **you** made progress on the project?
Hmm. So much for a 'community' project...

in just over a week's time, I'll be much more available to help out with the coding and I'll try to gather / make some media for the project.
I look forward to it...


Ryan Moody(Posted 2005) [#48]
I know, I'm really sorry about this. I'll be able to properly devote time to the project very soon now, and when I'm back, I'll have another go at mustering support for the project, possibly in the form of a news article. I'll also spread the word over at the Coders Workshop once I'm ready.

In the meantime, I'ld be most grateful if you (or 'we') could keep the project ticking over. Maybe it would be a good idea to extend / clarify the to do list, so that when I try to get more helpers, they'll know how to help out. Also, I feel we need to secure the help of Koriolis as getting the scripting engine done will probably be the hardest task.

Apologies again for the way I've managed the project so far, I assure you the situation will soon improve.

Ryan


WolRon(Posted 2005) [#49]
I'll have another go at mustering support for the project, possibly in the form of a news article. I'll also spread the word over at the Coders Workshop once I'm ready.
...when I try to get more helpers, they'll know how to help out
This project doesn't need people being rounded up to help. It's been here for a month now. If people aren't aware of it, then they're blind... What this project needs is people (that means *you*, Mr. reader) to actually lend a hand and help out. There's plenty to do.

Apologies again for the way I've managed the project so far,
No apologies necessary. It's a community project. Everyone has their personal lives and agenda to pertain to. For instance, in about a month, I will go on vacation for a week myself. You won't see any progress from me during that period.

Just take part in the project and participate...
I don't have the time nor the patience to do the whole thing myself. If I was going to do it myself, I wouldn't bother with asking anyones opinion on matters. But this is a community project, and I don't intend to (nor should) do the whole thing myself.

It's been a while since the last post, have you made progress on the project?
So I took two days off from it, and have already gotten slack on lack of progress...

In closing...
If the going is slow, it's not because of me.

-------------------------------------

Maybe it would be a good idea to extend / clarify the to do list
If you think you know how to clarify it, then do so. I'll add it to the main post. In all honesty, if you are going to spend the time writing down all of the things (bits of code) that need to be typed up, you probably could just as well have written it instead and be done with it. Why write it twice?

I agree with you to some extent, but I also disagree with you as well.

Also, I feel we need to secure the help of Koriolis
We already have. 5th post from the top.


Ryan Moody(Posted 2005) [#50]
This project doesn't need people being rounded up to help. If people aren't aware of it, then they're blind


I disagree - As you said, it's a community project, so the more people we can get to help, the better. I think people are aware of the project, but if we give them a 'friendly reminder', and, more importantly, show them what progress we've made, that'll encourage them to participate.

I don't have the time nor the patience to do the whole thing myself. If I was going to do it myself, I wouldn't bother with asking anyones opinion on matters. But this is a community project, and I don't intend to (nor should) do the whole thing myself.


I understand that perfectly, WolRon

So I took two days off from it, and have already gotten slack on lack of progress...


Not at all, I was just asking if you made any progress since you've been the most productive member of the group so far, I didn't intend to be rude.

If you think you know how to clarify it, then do so.


I think the main problem I have with this is that now the project's being made in Blitz3D instead of Blitz2D, I don't know what sort of functions are required to achieve certain effects. I'll certainly have a go at drafting one up later on though.

In all honesty, if you are going to spend the time writing down all of the things (bits of code) that need to be typed up, you probably could just as well have written it instead and be done with it. Why write it twice?


That's true for small functions, but I doubt they'll be many of those in this project. If we don't specify what needs to be done beforehand, contributors wouldn't know where to start, and the task of integrating all the modules into a single program becomes much harder.

Regards Koriolis, I think it would be a good idea to remind him of the project, it's been a while. I think the scripting engine should be our top priority, and we may as well get his help while we can.

Ryan


Ross C(Posted 2005) [#51]
I wouldn't mind helping out by doing some model unwrapping. I don't think i could code along side other coders, but i'm decent at unwrapping 3d models.


Ross C(Posted 2005) [#52]
Hey, it's not much, and not very good, but here's a missle placeholder for now.

www.rosscrooks.pwp.blueyonder.co.uk/missle.zip


WolRon(Posted 2005) [#53]
Thanks Ross. Can you do me a favor though
missiletex.png is incorectly spelled as missletex.png :)
I would just change the spelling in the .b3d file to the correct spelling but I didn't have any luck with that since it requires adding a byte to the file...

Also, I didn't check scale on the model. May have to be tweaked later...
But since I don't know about how big it needs to be yet, don't worry about it yet.


Ross C(Posted 2005) [#54]
Sure, gimme a scale and such and i'll fix it. I'll change that filename too.


Ross C(Posted 2005) [#55]
www.rosscrooks.pwp.blueyonder.co.uk/missile.zip

There ya go!


Ryan Moody(Posted 2005) [#56]
Thanks very much Ross C, the help's appreciated. Would you be able to create some more media for us please?

And, speaking of media, look at this thread I found!

http://www.blitzbasic.com/Community/posts.php?topic=46599

Thanks Tiler!

Ryan


Ross C(Posted 2005) [#57]
I'll have a go at creating some yeah. The missile was a quickie though and it's poorly textured. I've got a main project i'm working away at, but any time in between i'll help out :o)


Braincell(Posted 2005) [#58]
I think the Arena.bb is not such a great solution. Why not just make all positions same like for 8 bots and if theres 2 use only 1 and 2 it doesnt matter that they are not facing eachother or are not symetrical. I think the Arena.dat and arena.bb are needlessly complex and might also make for creating arenas pretty tedious if you are trying to make any walls because you might make walls over starting positions. I think they should be predefined, quite simply as stated, so each new bot is created one 8th clockwise from the number 1 bot. Possibly also using random numbers to place bots.

Now i see someone already suggested it, and i totally agree of course.

I don't see what ArenaUpdate() could be used for, unless you want to have dynamic arenas which i think is impractical. The arena should be static in all 3 states, and therefore i think we may as well loose that function.

So the new ArenaStart() should just read the clock, and winning condition from the file, but even that seems unneeded because you mentioned before that each arena will be a different goal so why not have that static and coded? But THEN AGAIN since i like versatility, might as well have that in a file.

I guess i'm picking up intrest here.


Billamu(Posted 2005) [#59]
Re: Annihalator

Suzanne?!


John J.(Posted 2005) [#60]
If you think XML would be a good way to save/load robots and arenas, you might consider using my BlitzXML library.

Also, if it would be of any use to you, you can get the source to RoboSumo (my robot game) here.


WolRon(Posted 2005) [#61]
Why not just make all positions same like for 8 bots and if theres 2 use only 1 and 2 it doesnt matter that they are not facing eachother or are not symetrical.
For this reason:
I think as far as the championship ladder goes, all matches should be held in symmetrical arenas, which means it really is up to the bot's AI. But for casual matches, more casual arena layouts/random placement (based on seed #) would be good. -- Toby Zuydveld
For casual games, it wouldn't matter, but I think for Championship games, the only fair method would be to have completely symmetrical layouts. It really wouldn't be that hard anyways. 4 arenas x 4 layouts = 16 arenas. 4 of the arenas are completely open spaced and would take an experienced modeler less than 5 minutes to create them.

As for the other 12, they don't have to be anything exotic. This is a community project, not a commercial one.

I think the Arena.dat and arena.bb are needlessly complex and might also make for creating arenas pretty tedious if you are trying to make any walls because you might make walls over starting positions.
I do agree that the arenas.dat file is a bit complex. I created it with the idea that it would suffice for now, and could be changed later. For instance, the bots starting positions could later be determined by placing nodes in with each arena model marking starting positions. But, since we don't have any arenas yet, or loading code for them, the arenas.dat file was a temporary move.

I don't see what ArenaUpdate() could be used for
You never know. Mostly, it just complies with the coding conventions laid out...

But THEN AGAIN since i like versatility, might as well have that in a file.
Exactly. Modifying Tournament rules only requires updating a .dat file and doesn't require recompiling any code.

-------------------------------
Unfortunately, I'm going to be very busy this week with personal tasks I need to take care of, so I won't be helping out much this week. Don't let this stop anyone else from helping out though...


scribbla(Posted 2005) [#62]
should the bot models have close combat weapons or are you just using long range, missiles n stuff


WolRon(Posted 2005) [#63]
The weapons listed on this page are the currently projected weapons:
http://home.cmit.net/rwolbeck/bait/botspecs.htm

The actual weapons used by the bots will not necessarily be reflected by their models. The models are mainly just for show (since during the competition phase of the game, everything will be small scale). So, a bot model with a couple of generic weapons/weapon launchers is perfectly OK.

However, if you feel like spending a little more time and modeling something really cool. By all means, do it...


Braincell(Posted 2005) [#64]
I dont see how symetry affects fairness. If the bots AI is good, regardless of where the others start out it should win. If the starting position can influence results then the AI isnt that great. If you think it isnt fair and it leaves a bit of room for luck, so what, have multiple matches with random layouts and see who wins.

I had two more thoughts today. The matches should be viewed in full 3d with a camera that is easily movable. AND: There should be a "Match.inf" file that contains the following data:
Random seed
Bot names
Bot specifications
Bot AI script file
Bot models
Arena used

This is so others can review a match. I didnt read how you thought of solving this yourself, but its my suggestion anyway.

The random seed should be generated by someone in particular, and then everyone else should have that same seed. This is so we can view the matches on different computers. I know there are rumors (unconfirmed) that same seeds give different results on some very rare occasions, but for the sake of viewing the competition i think it's still better to share them like this instead of have results posted or to record the whole match and post a replay file. Once again, I didnt read how you thought of solving this yourself, but its my suggestion anyway.


Ryan Moody(Posted 2005) [#65]
I dont see how symetry affects fairness. If the bots AI is good, regardless of where the others start out it should win. If the starting position can influence results then the AI isnt that great. If you think it isnt fair and it leaves a bit of room for luck, so what, have multiple matches with random layouts and see who wins.


I agree on this...

The random seed should be generated by someone in particular, and then everyone else should have that same seed


...and I agree on this...

The matches should be viewed in full 3d with a camera that is easily movable.


...but no way man! We've got to keep things simple!

Regards the Match.inf file idea, I believe that's what we're working towards. That'll make the transition from one round to the next much easier.

P.S. While we've been talking about the bot models, we may as well tackle the other side of the media, the sounds (and possibly music) at the same time. If anyone can either find public domain sounds on the web (or create their own) that would be suitable for this project, that would be most appreciated.

Ryan


WolRon(Posted 2005) [#66]
There should be a "Match.inf" file that contains the following data:
The submitted code already deals with this without such a file.

It searches the 'Bots' directory for bots (*botNameHere*.dat files) and whichever bots are present are automatically entered into the tournament. The bots .dat file already contains these elements:
Bot name
Bot specifications
Bot AI script files
Bot model

The arenas.dat file contains the information regarding which arenas will be competed in and in what order.

The random seed is unnecessary. Every program can just use the same seed, say seed 1, for example. The whole point of this project is to allow players to write AI and then see how it compares to other players AI. If you are going to throw in a bunch of randomness, then you are defeating the purpose of allowing the bots AI to determine the bots fate. The only use I see for randomness, is just in choosing each bots starting position.

there are rumors (unconfirmed) that same seeds give different results on some very rare occasions
It's not unconfirmed, it's true. Therefore, you can't rely upon random numbers unless you write your own random number algorithm.

If the starting position can influence results then the AI isnt that great.
Absolutely not true. Imagine a 'good' bot that starts in close proximity (due to random placement) to three other bots. At the start of the tournament, the other three bots gang up on the 'good' bot, and terminate it immediately. There could be literally hundreds of scenarios of how the action plays out just depending on starting placement alone.
That being said, I think that
have multiple matches with random layouts
this could be feasible except changing 'random layouts', to random (symmetrical) starting positions.

To solve any disputes that arise over whos AI is the winner, the only real way that I can see this working is to just have the tournament take place on a predetermined computer, and have the results posted. Sure, we will attempt to write the game, so that others can play it out on their systems and (hopefully) watch the same events take place as on the 'official' one, but it's dang near impossible to guarantee (especially due to the randomness 'bug').

BTW, a lot of these things were already discussed in this or the previous threads. PLEASE go back and read them, so that we don't waste time reiterating topics we've already discussed. (sorry...)


Braincell(Posted 2005) [#67]
I'm glad you agree.

...but no way man! We've got to keep things simple!


We're already working in 3d, the arenas will be 3d, so i dont see why we wouldnt simply move the camera around? Its as simple as 3 lines of code or so, opposed to one line of code that places the camera at init... oh, you were joking right? :)


Braincell(Posted 2005) [#68]
OK i did mention im sorry i didnt read ahead, but i just didnt have 1 hour yesterday. If you discussed previously, i thought, you'd just tell me to read it and it would be ok by me. I'll try find time to read as much as i can, but i also gotta say that reading too much is what might stop some from joining the project.

Cheers


Ryan Moody(Posted 2005) [#69]
Well, I wasn't joking, but if it really does only take 3 lines of code to move the camera around (I don't know 3D), then that's a possibility. Let's stick to the top-down view for the moment, then we can worry about getting close-ups of robots being blown to smitherines later on. Our top priority must be getting the scripting language sorted - without it, no-one will be able to take part in the tournament.

By the way, I've posted an announcement thread about BAIT over at the Coders Workshop website to gather more support and interest. To those that have just found this thread, please do read over the previous posts as WolRon said, as it'll save us from repeating ourselves and allow us to make progress.

Ryan


WolRon(Posted 2005) [#70]
I'll try find time to read as much as i can, but i also gotta say that reading too much is what might stop some from joining the project.
I understand. Like I said, "I'm" sorry too.

Its as simple as 3 lines of code or so,
No, it's not. Is the action viewed from 1 bot in particular? Is it 3rd-person or 1st-person? Does the camera automatically select targets to watch and then proceeds to 'follow' them?

All of this can be done. I just don't think we want to bother with it now yet. Let's get the engine working, and we'll worry about the details later, OK?


Ryan Moody(Posted 2005) [#71]
reading too much is what might stop some from joining the project


You don't have to read through every post - I suppose the ToDo list at the top of this post is a good summary of what areas we've already covered. Feel free to discuss / tackle the areas marked as "TBD".

Ryan


Braincell(Posted 2005) [#72]
No, it's not. Is the action viewed from 1 bot in particular? Is it 3rd-person or 1st-person? Does the camera automatically select targets to watch and then proceeds to 'follow' them?


For Allahs sake who needs that? I just meant a free movement camera that floats in air and you move it with mouse, WASD and F for up and C for down. You know like a FPS without gravity. Would allow for all the viewing you could ever want.

Yea, lets worry about that later. I'm still not sure how much i'll devote to BAIT in fact, as always, i never know.


Ryan Moody(Posted 2005) [#73]
There are some tiny jobs you could do if you're pressed for time, for example, in one of my earlier posts, I said:

If anyone can either find public domain sounds on the web (or create their own) that would be suitable for this project, that would be most appreciated.


Ryan


Erroneouss(Posted 2005) [#74]
What kind of sounds do you need? I could make some
I guess... Since nobody else is. And also I'm guessing
an OGG vorbis right? Or WAV?


WolRon(Posted 2005) [#75]
.wav's are memory hogs. Please use .ogg if possible. (If you don't I will convert them anyways...)


Ryan Moody(Posted 2005) [#76]
What kind of sounds do you need?


The ToDo list at the top offers a few suggestions (I'm not too sure about the "silence.ogg" one though!). Sounds of explosions, crashes, weapons being fired, stuff like that.

Ryan


WolRon(Posted 2005) [#77]
Well, in Munition.bb, the MunitionDetonate function requires a sound handle to play when detonating the munition.
PlaySound WeaponData(thisMunition\MunitionID)\AmmoDetonationSoundHandle
The silence.ogg file (basically an empty sound file) was intended to be loaded for weapons that didn't make sounds, such as perhaps, the Glue weapon when it expires.


Ryan Moody(Posted 2005) [#78]
It seems a little redundant, but I understand your reasoning.

Well, we've got the fortnightly art compo working on the graphics side of things, and Mr. Duck working on the sounds. We must now focus on the actual engine! Has Koriolis made progress with setting up BVM?

Ryan


Ryan Moody(Posted 2005) [#79]
Finally, I've finished my exams! I still have work to do, but I should be able to devote more time to this now. It's been a little quiet here recently, so I think we need a motivation boost, and I think seeing more things green in the ToDo list, albeit simple things, would achieve such a boost.

I've decided to find some public domain sounds on the web, and I've found a few appropriate sounds. I'm not sure where to upload the sounds, so I'll provide the links to them and you can take it from there WolRon. They're also WAVs I'm afraid, could you convert them to ogg's please?

http://www.partnersinrhyme.com/soundfx/PDsoundfx/beep.shtml

From this website, pick the following sound effects:

MGFire.ogg             ---> ???
MGHit.ogg              ---> BEEPCASI.WAV
ShellFire.ogg          ---> ???
ShellHit.ogg           ---> BEEPCASI.WAV
MissileFire.ogg        ---> ???
MissileDetonate.ogg    ---> WHOOSH.WAV
MinePlaced.ogg         ---> KLICK.WAV
MineDetonate.ogg       ---> WHOOSH.WAV
GluePlaced.ogg         ---> TEESWING.WAV
silence.ogg            ---> You can make this!
EMPDetonate.ogg        ---> WHOOSH.WAV

Possible Additions:

Out of ammo fire       ---> WATER.WAV
Death / Start round    ---> BEEPBASS.WAV
Scanning               ---> BEEPARCA.WAV


I'm also going to post some designs for arenas soon, along with potential music, and the code for Clock.bb, which I assume just manages a count down from a starting time to 0.

Ryan


Ryan Moody(Posted 2005) [#80]
Clock.bb (Adapt as required):



Ryan


Koriolis(Posted 2005) [#81]
Hello fellow blitzers. A little post from a cybercoffee (or whatever you call an "internet shop" in english) in Vietnam (I am currently in vacations).
I didn't take the time to really read the above posts, I am hoping it's going along nicely.
Has Koriolis made progress with setting up BVM?
Setting it up would actually be pretty easy, I just didn't look at it at all, as Wolron said he would let me know if he ever needs help.

Keep up the good work guys, and see you later. Bye.


Ryan Moody(Posted 2005) [#82]
Koriolis, we could do with the help now to be honest. As I'm new to BVM, once it's set up, could you give us an idea of how it works and what we need to do to use it?

Thanks,

Ryan


Ryan Moody(Posted 2005) [#83]
The missing sound effects:

MGFire.ogg http://simplythebest.net/sounds/MP3/sound_effects_MP3/mechanical_mp3.html ---> machine_gun.mp3

ShellFire.ogg
http://simplythebest.net/sounds/MP3/sound_effects_MP3/industrial_mp3.html ---> laser_1.mp3

MissileFire.ogg
http://www.partnersinrhyme.com/soundfx/warsounds.shtml ---> Rocket2

Robot falling off edge of the arena
http://simplythebest.net/sounds/MP3/sound_effects_MP3/miscellaneous_mp3.html ---> bang_1.mp3


Ryan Moody(Posted 2005) [#84]
League Table code:



I expect to see lots of things ticked off our ToDo list now WolRon!

Ryan


Hotcakes(Posted 2005) [#85]
could you give us an idea of how it works and what we need to do to use it?

'All the documentation and examples you need' come with the demo package - in fairness there *are* many examples and the documentation is mostly pretty good - but keep in mind you're bound to come across caveats which are discussed in detail in Korilois' forums.


Ryan Moody(Posted 2005) [#86]
Thanks Hotcakes, I'll check it out soon.

Edit: I've had a brief look at the tutorial, and it seems reasonably straightforward to set up. I think the 10 minute limit on the trial version is a bit short though! What I would like to see now is the interpreter set up so that it could perform one function, say Move(distance), on any robot which calls this function. To test this, the AI for two robots could be:

Bot1:
Function AI()

Move(100)

End Function

Bot2:
Function AI()

Move(200)

End Function

I'm not sure how the actual Move function would be written though - Looking at the Bot.bb file, The type "TypeBot" doesn't have any fields for storing a bot's co-ordinates. How do you handle the co-ordinates WolRon?

Ryan


WolRon(Posted 2005) [#87]
Just checking in. Sorry I haven't been able to devote time to this lately. I've been very busy with personal things. I'll try to get caught up with updating the top post and participating hopefully in the next few days.

By the way Ryan, thanks for writing the code that you did, but could you please modify them to fit the project?

The clock functions you wrote are using Millisecs() and we can't use that for a clock since everyones computers run at different speeds. We will just have to have a predetermined amount of time subtracted from the clock during each 'clock cycle' in order to keep the game running consistent on every ones machine.

Also, the league code you wrote is using the TEXT function. Would you mind updating it to use the DRAWTEXT function that 9572AD wrote? If you're not sure how to do so, I can take care of it later...

And just in general, try to adhere to the Coding Conventions

What I would like to see now is the interpreter set up so that it could perform one function, say Move(distance), on any robot which calls this function.
I will TRY to do this in the near future (I promise). I've read through the BVM docs and have a small grasp on how to handle it. I just need the TIME to do it... Allow me to start it off (since I'm familiar with most of the code) so that everyone is on the same page.


Ryan Moody(Posted 2005) [#88]
The clock functions you wrote are using Millisecs() and we can't use that for a clock since everyones computers run at different speeds.


I disagree - The Millisecs() function should run consistently enough on all computers, as it is measuring the passing of time - A clock which deducts itself after each second should run at virtually the same speeds on any computer, otherwise if you had a fast computer, you may need to change the line

If LastTimeChange + 1000 < MilliSecs()

to

If LastTimeChange + 1010 < MilliSecs()

to achieve a 'true' second, but this obviously isn't done in practice. If there is any difference, it would only be negligible, so I wouldn't worry about it.

Looking at the DrawText function, would I just have to replace

Text x, y, string

with

DrawText.TypeText(string, x, y)?

If not, could you make the necessary alterations please?

Yes, the coding conventions...I personally think they can cripple the flow of the project if adhered to strictly - Of course, having the convention will help make writing the documentation easier, but I think we should focus more on actually creating something to document than worry about syntatical details. I'll correct any inconsistencies later on.

Thanks for making a start with the BVM, if we can interpret a single movement command and script the AI for a robot using just that command, that would be a great start. Follow that up with rotation commands such as Left(angle) and Right(angle) so that we get user-defined movement on the screen, and I think that would deserve an updated demo.

Ryan


WolRon(Posted 2005) [#89]
I disagree - The Millisecs() function should run consistently enough on all computers
You are completely missing the point. Every bot gets an equal chance to execute it's AI, irrelevant of the actual time that it takes the computer to process it.
We DONT NEED MilliSecs(). The clock is based on a sort of turn-based gameplay. This isn't a real-time program. Basing our clock function on real time would mess it up. Not every computer executes code, or renders the screen at the same speed.

Looking at the DrawText function, would I just have to replace

You can use the DrawText command like so:
	thisText.TypeText = DrawText("P r e s e n t i n g   t h e   c o m p e t i t o r s . . .", 0, 0)
	thisText\TextID = StandardText
The reason the return value is saved in a TypeText variable is so that we can assign it an ID, like you see in the example above. The reason for the ID, is so that if we run through the TypeText Type list using a For Each loop, we can identify which texts are solo (StandardText), or part of the bots banner (BotBanner) or stats display(BotStat). This way, if we, say, wanted to erase all texts on the screen, we could do so without upsetting any of the texts that are associated with the bots.
EDIT:You know, looking back on this, I should have just set StandardText to 0. That would eliminate the step of having to assign the ID to at least the standard texts. I may make that change...
Also, if we wanted to Show/Hide the text, or change it's ID, or just delete it entirely, we can do so through that variable.

Unlike the normal Text command though, these texts stay visible on the screen even after screen refresh (since they are 3D objects), so you don't have to keep 'redrawing' them to the sceen every game loop. Your code (or SOME code somewhere) will have to delete them when they are no longer needed.

the coding conventions...I personally think they can cripple the flow of the project if adhered to strictly

having the convention will help make writing the documentation easier
They do more than just help write the documentation...

They also help people to understand the code that's already been written since all the code in every file is written in the same style.

For instance, in the coding convention, it states that all Constants, Globals, Arrays, Types, Functions, and Labels (basically everything that's globally accessible) is Capitalized. All local variables start with a lowercase character.

This one convention alone, helps people to quickly see which identifiers used in the code are Global or Local (which quickly tells them where they can find those identifiers elsewhere, meaning either within the same function or outside of the function).

I'll correct any inconsistencies later on.
Trust me, that will never happen...
Do it from the start, so it's done.


BTW, you aren't really serious about a few of those sounds are you? I mean the WHOOSH.WAV sound for MissileDetonate and MineDetonate???


Ryan Moody(Posted 2005) [#90]
We DONT NEED MilliSecs()


You're right, apologies, I'll amend that soon. I'll also try to convert the Text command to the DrawText equivalent, and I'll try to rewrite my code so that it adheres to the conventions.

BTW, you aren't really serious about a few of those sounds are you? I mean the WHOOSH.WAV sound for MissileDetonate and MineDetonate???


I could swear it sounded good at the time! I was pressed for time I imagine. They can act as placeholders for the moment, TheDuck said he'ld make some sounds for us, so they'll probably be better.

I'm afraid I'm not going to be that readily available for some time again - I've just been given a group project from hell about (and I'm not making this up) "Burger Equations", which are apparently used for fluid dynamics models.

I'll leave the code re-writing until later (and promise to do it!), but if you can suggest any new algorithms that need to be coded which I can do independently in Blitz2D, I'll see if I can do them in my spare time.

Ryan


WolRon(Posted 2005) [#91]
Just letting everyone know that I've begun attempting to include BVM (Blitz Virtual Machine) into the BAIT project. So far, it appears to be going OK. I may have to ask Koriolis a few questions concerning 'Contexts' and a few other trivial things but other than that, the addition is going smoothly. (Koriolis, in case you are reading this, could you drop me an email...)

I've created an entirely new folder on my harddrive with an exact copy of BAIT in it's current form (the form in the WIP demo) so that if we can't get BVM to work for us, or we just decide to scrap it for some other reason, then we will have all of the current source files available to start over again from this point in the project.


Hotcakes(Posted 2005) [#92]
Elegant use of System Restore there.

<coughs> Anyways, if you have questions, best to ask on the BVM forums, that way everyone can learn.


Koriolis(Posted 2005) [#93]
Hi, I just came back from vacations. Wolron, I sent you a mail, please get in touch.


Braincell(Posted 2005) [#94]
I'll animate the bot i made for that competition and then send it to you, but who should i send it to and are there any specifications/corrections you would like me to make guys? It was fun for me to make it, but it can always be better for sure.


WolRon(Posted 2005) [#95]
Koriolis: Did. Check your email.

Lenn: Post a link to it, or if that's not possible, then email it to me and I will take care of it. As for specifications, they are listed on the Gameplay Rules page.

I would like to see now is the interpreter set up so that it could perform one function, say Move(distance)
Sounds like a plan. Will do as soon as a few questions are ironed out...


Bot Builder(Posted 2005) [#96]
I'd probably be helping on this if I wasn't laden with a ton of schoolwork.....

Anwyay, you should get some concave arenas as well - give the strategy some depth instead of point 'n shoot. With obstacles you can get hiding behaviour, and wall guarding. It also minimizes SnS victories (Sit 'n spinners) which just spin in circles, stop when they see an enemy and shoot.

The goal of the game, imho, should be to promote complex strategy, rather than tricks around the engine as has occured in other robot games (there's this one where if you use a certain movement command you can rotate while still moving, setting you up for the next movement - basically very agile bots). The right screenshot looks very similar to that game actually, although 3d rather than 2d. Some very simple physics could also be implemented for hover wars.

Output stuff will depend on methods. You could have a modular weapon system (I suggest this for stratagy variation), or a universal weapon (most do this). Same for sensors, but there is even more variation on top of this. You could have queries to teh sensors that immediatly returns results. This is probably most natural to a programmer, but in order to make it more realistic, and make scans more sparse, the sensor should be oriented or range set and on the next frame or even longer recieve results. Either a callback or a query.

Modular Weapons example:
Rocker=CreateRocketLauncher(0,0) ;creation - slot 0, oriented forward
Fire(Rocker)
Mgun=CreateMachineGun(2,1) ;creation - slot 2, oriented right
Fire(Mgun)

Modular Sensors Example:
Sonar=CreateSonar(1,0) ;creation - slot 1, forward
Ping(Sonar)
Print Query(Sonar) ;Returns the distance from last frame

Creation commands can only be used in the beginning.

Oh, and here's how I prefer my driving:

LeftMotor(blah)
RightMotor(blah) ;blah=-100 to 100

Quick, concise and to the point. It can perform any stuff using this (and more because of curves) than could be achieved with all that Move/rotate crap.


WolRon(Posted 2005) [#97]
Modular Weapons example:
Rocker=CreateRocketLauncher(0,0) ;creation - slot 0, oriented forward
Fire(Rocker)
Mgun=CreateMachineGun(2,1) ;creation - slot 2, oriented right
Fire(Mgun)
If we can get BVM to work for us, then this is probably how the AI code will look...

Oh, and here's how I prefer my driving:

LeftMotor(blah)
RightMotor(blah) ;blah=-100 to 100
Great idea. However, it assumes that all vehicles can pivot like that. Take for example the sample bot that Lenn made for the Blitz Art Compo in the Graphics Showcase, it wouldn't actually be able to do that...
I like the idea and we could use it, but it may not be preferred by everyone.
What are other peoples thoughts on Bot Builders motion idea?


Hotcakes(Posted 2005) [#98]
Well those coming from a Robolab background (like me) will be right at home with that method. I do think it's more fiddly than Move() and Rotate() commands, but, you know, whatever. If it works, it works. If Left and RightMotor() commands are used however, they should be measured in percentage, which I think Bot Builder eluded to above anyway.


John J.(Posted 2005) [#99]
Did you miss my post (far) above, or is everybody ignoring me?


Ryan Moody(Posted 2005) [#100]
Did somebody say something? Apologies John, we must have missed it.

If you think XML would be a good way to save/load robots and arenas, you might consider using my BlitzXML library.

Also, if it would be of any use to you, you can get the source to RoboSumo (my robot game) here.


We'll look into both of those once we've got BVM up and running, thanks for your contribution.

What are other peoples thoughts on Bot Builders motion idea?


I would provide both methods of movement if possible, which would allow for more variation in contestants' AI.

I've got a bit of free time today, so I'll try to rewrite that code I offered some time ago. Someone over at the Coders Workshop may also be able to help out with the sounds & music, so things are going well. I think it's time for a new thread soon too, and if we could start it off with an updated demo illustrating movement using BVM, that'ld be great.

Ryan


Ryan Moody(Posted 2005) [#101]
The all new and improved Clock.bb:

Note that I'm still a little unsure as to how you use the drawtext function, so I'ld be most grateful if you could make the necessary amendments. Also, I obviously didn't indent the code as it's displayed here, it goes funny when I copy and paste from the IDE to a posting window and I don't know what to do about it.



The league table code will soon follow...

Edit: And here it is:



As I said before WolRon, if you can think of any small 2D algorithms I can do in my spare time, tell me and I'll be glad to help.

Ryan


WolRon(Posted 2005) [#102]
If anyone reading this thread wishes to post, please do so in the latest thread:

BAIT Community Project (thread 3)





Can a moderator please lock this thread...